From ef7640de6a44f2a9fd1656bf92f7b9cb7689daee Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Sat, 28 Feb 2015 04:47:03 +0000 Subject: [PATCH] debug highlighter plugin: a place for experimental/temporary highlighters currently, highlighters for the unknown_10/11 flags recently added to the portal data --- plugins/portal-highlighter-debug.user.js | 57 ++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 plugins/portal-highlighter-debug.user.js diff --git a/plugins/portal-highlighter-debug.user.js b/plugins/portal-highlighter-debug.user.js new file mode 100644 index 00000000..2d07f257 --- /dev/null +++ b/plugins/portal-highlighter-debug.user.js @@ -0,0 +1,57 @@ +// ==UserScript== +// @id iitc-plugin-highlight-portals-high-level +// @name IITC plugin: Debug: Highlighers +// @category Debug +// @version 0.1.0.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] Various debug and/or temporary highlighters. Will change over time as needed. +// @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.portalHighlighterDebug = function() {}; + +window.plugin.portalHighlighterDebug.unknown10 = function(data) { + var opacity = 0.7; + var color = undefined; + + if (data.portal.options.data.unknown_10) { + color='red'; + } + + if (color) { + data.portal.setStyle({fillColor: color, fillOpacity: opacity}); + } +} + +window.plugin.portalHighlighterDebug.unknown11 = function(data) { + var opacity = 0.7; + var color = undefined; + + if (data.portal.options.data.unknown_11) { + color='red'; + } + + if (color) { + data.portal.setStyle({fillColor: color, fillOpacity: opacity}); + } +} + +var setup = function() { + window.addPortalHighlighter('DEBUG: Unknoen_10 (mission start portals?)', window.plugin.portalHighlighterDebug.unknown10); + window.addPortalHighlighter('DEBUG: Unknoen_11', window.plugin.portalHighlighterDebug.unknown11); +} + +// PLUGIN END ////////////////////////////////////////////////////////// + +@@PLUGINEND@@