From 84b38bdd82e24e3672a5f0388a0e8e554ede08ba Mon Sep 17 00:00:00 2001 From: fkloft Date: Fri, 9 Aug 2013 17:19:43 +0200 Subject: [PATCH 1/4] Always show "sign out" link in IITCm. (no hover on touch screen --> an accidental click would directly log you out) --- code/boot.js | 6 ------ mobile/smartphone.css | 4 ++++ style.css | 5 ++++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/boot.js b/code/boot.js index 69bd6f23..af5cdf0b 100644 --- a/code/boot.js +++ b/code/boot.js @@ -300,12 +300,6 @@ window.setupPlayerStat = function() { + '' + '' ); - - $('#name').mouseenter(function() { - $('#signout').show(); - }).mouseleave(function() { - $('#signout').hide(); - }); } window.setupSidebarToggle = function() { diff --git a/mobile/smartphone.css b/mobile/smartphone.css index efcbbfbe..5f8e4b86 100644 --- a/mobile/smartphone.css +++ b/mobile/smartphone.css @@ -76,6 +76,10 @@ body { background-color: #00c5ff !important; } +#name #signout { /* no hover, always show signout button */ + display: block; +} + #sidebar, #chatcontrols, #chat, #chatinput { background: #0B3351 !important; } diff --git a/style.css b/style.css index 532bc501..404f67a7 100644 --- a/style.css +++ b/style.css @@ -399,7 +399,7 @@ h2 #stats { overflow: hidden; } -h2 #signout { +#signout { font-size: 12px; font-weight: normal; line-height: 29px; @@ -410,6 +410,9 @@ h2 #signout { background-color: rgba(8, 48, 78, 0.5); display: none; /* starts hidden */ } +#name:hover #signout { + display: block; +} h2 sup, h2 sub { display: block; From df4300ca750862f5e643c117ab302a0e8d7c4c7d Mon Sep 17 00:00:00 2001 From: Catherine Taylor Date: Mon, 2 Sep 2013 20:14:18 +0100 Subject: [PATCH 2/4] Initial version, highlights portals which are running low on outbound links. --- ...-highlighter-outbound-link-counter.user.js | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 plugins/portal-highlighter-outbound-link-counter.user.js diff --git a/plugins/portal-highlighter-outbound-link-counter.user.js b/plugins/portal-highlighter-outbound-link-counter.user.js new file mode 100644 index 00000000..546ed8c3 --- /dev/null +++ b/plugins/portal-highlighter-outbound-link-counter.user.js @@ -0,0 +1,68 @@ +// ==UserScript== +// @id iitc-plugin-highlight-outbound-link-counter@cathesaurus +// @name IITC plugin: highlight portals running low on outbound links +// @category Highlighter +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Uses the fill color of the portals to show the number of outbound links: red = 8 (i.e. no more outbound links may be made), orange = 6 or 7, yellow = 4 or 5. +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// @grant none +// ==/UserScript== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + +// use own namespace for plugin +window.plugin.portalHighlighterOutboundLinkCounter = function() {}; + +window.plugin.portalHighlighterOutboundLinkCounter.highlight = function(data) { + var d = data.portal.options.details; + // var links = {incoming: 0, outgoing: 0}; + var outgoing = 0; + var playerFaction = 0; + + if (window.PLAYER.team === 'RESISTANCE') { + playerFaction = 1; + } else { + playerFaction = 2; + } + + // Only interested in portals of player's faction + if(getTeam(d) === playerFaction) { + if(d.portalV2.linkedEdges) $.each(d.portalV2.linkedEdges, function(ind, link) { + // links[link.isOrigin ? 'outgoing' : 'incoming']++; + if (link.isOrigin) { + outgoing++; + } + }); + + // if(links.outgoing > 3) { + if(outgoing > 3) { + // if(links.outgoing < 6) { + if(outgoing < 6) { + color = 'yellow'; + // } else if(links.outgoing < 8) { + } else if(outgoing < 8) { + color = 'orange'; + } else { + color = 'red'; + } + var params = {fillColor: color, fillOpacity: 1}; + data.portal.setStyle(params); + } + } +} + +var setup = function() { + window.addPortalHighlighter('Outbound Links', window.plugin.portalHighlighterOutboundLinkCounter.highlight); +} + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@ From 8889c4a128509faa7d1341f90d9cd65cb7b04d28 Mon Sep 17 00:00:00 2001 From: Catherine Taylor Date: Mon, 2 Sep 2013 20:42:01 +0100 Subject: [PATCH 3/4] Removed extraneous comments. --- plugins/portal-highlighter-outbound-link-counter.user.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plugins/portal-highlighter-outbound-link-counter.user.js b/plugins/portal-highlighter-outbound-link-counter.user.js index 546ed8c3..5ec60ff0 100644 --- a/plugins/portal-highlighter-outbound-link-counter.user.js +++ b/plugins/portal-highlighter-outbound-link-counter.user.js @@ -23,7 +23,6 @@ window.plugin.portalHighlighterOutboundLinkCounter = function() {}; window.plugin.portalHighlighterOutboundLinkCounter.highlight = function(data) { var d = data.portal.options.details; - // var links = {incoming: 0, outgoing: 0}; var outgoing = 0; var playerFaction = 0; @@ -36,18 +35,14 @@ window.plugin.portalHighlighterOutboundLinkCounter.highlight = function(data) { // Only interested in portals of player's faction if(getTeam(d) === playerFaction) { if(d.portalV2.linkedEdges) $.each(d.portalV2.linkedEdges, function(ind, link) { - // links[link.isOrigin ? 'outgoing' : 'incoming']++; if (link.isOrigin) { outgoing++; } }); - // if(links.outgoing > 3) { if(outgoing > 3) { - // if(links.outgoing < 6) { if(outgoing < 6) { color = 'yellow'; - // } else if(links.outgoing < 8) { } else if(outgoing < 8) { color = 'orange'; } else { From 61ecfc1c2d77f5552784c0b0ee1ebbaa87ad391e Mon Sep 17 00:00:00 2001 From: Catherine Taylor Date: Thu, 5 Sep 2013 16:20:42 +0100 Subject: [PATCH 4/4] Used TEAM_RES and TEAM_ENL constants, rather than magic numbers. --- plugins/portal-highlighter-outbound-link-counter.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/portal-highlighter-outbound-link-counter.user.js b/plugins/portal-highlighter-outbound-link-counter.user.js index 5ec60ff0..ce754661 100644 --- a/plugins/portal-highlighter-outbound-link-counter.user.js +++ b/plugins/portal-highlighter-outbound-link-counter.user.js @@ -27,9 +27,9 @@ window.plugin.portalHighlighterOutboundLinkCounter.highlight = function(data) { var playerFaction = 0; if (window.PLAYER.team === 'RESISTANCE') { - playerFaction = 1; + playerFaction = window.TEAM_RES; } else { - playerFaction = 2; + playerFaction = window.TEAM_ENL; } // Only interested in portals of player's faction