Skip to content

Instantly share code, notes, and snippets.

@CMiles1979
Created June 22, 2017 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save CMiles1979/294fb3701fe5b080772244f0ba73fe5a to your computer and use it in GitHub Desktop.
Save CMiles1979/294fb3701fe5b080772244f0ba73fe5a to your computer and use it in GitHub Desktop.
L4
// ==UserScript==
// @id iitc-plugin-highlight-L4@YppKYMthrFckr
// @name IITC plugin: L4 Highlighter
// @category Highlighter
// @version 0.1.1.20170411.215050
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @description [iitc-2017-04-11-215050] use black portal fill to show L4 portals.
// @include https://*.ingress.com/intel*
// @include http://*.ingress.com/intel*
// @match https://*.ingress.com/intel*
// @match http://*.ingress.com/intel*
// @include https://*.ingress.com/mission/*
// @include http://*.ingress.com/mission/*
// @match https://*.ingress.com/mission/*
// @match http://*.ingress.com/mission/*
// @grant none
// ==/UserScript==
function wrapper(plugin_info) {
// ensure plugin framework is there, even if iitc is not yet loaded
if (typeof window.plugin !== 'function') window.plugin = function() {};
//PLUGIN AUTHORS: writing a plugin outside of the IITC build environment? if so, delete these lines!!
//(leaving them in place might break the 'About IITC' page or break update checks)
plugin_info.buildName = 'iitc';
plugin_info.dateTimeVersion = '20170411.214534';
plugin_info.pluginId = 'portal-highlighter-L4';
//END PLUGIN AUTHORS NOTE
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.pL4 = function() {};
window.plugin.pL4.highlight = function(d) {
if (d.portal.options.level == 4){// && d.portal.options.team === 'e') {
console.log(d);
var color = 'black';
var params = {fillColor: color};
d.portal.setStyle(params);
}
};
var setup = function() {
window.addPortalHighlighter('L4', window.plugin.pL4.highlight);
};
// PLUGIN END //////////////////////////////////////////////////////////
setup.info = plugin_info; //add the script info data to the function as a property
if (!window.bootPlugins) window.bootPlugins = [];
window.bootPlugins.push(setup);
// if IITC has already booted, immediately run the 'setup' function
if (window.iitcLoaded && typeof setup === 'function') setup();
} // wrapper end
// inject code into site context
const script = document.createElement('script');
var info = {};
if (typeof GM_info !== 'undefined' && GM_info && GM_info.script)
info.script = {
version: GM_info.script.version,
name: GM_info.script.name,
description: GM_info.script.description,
};
script.appendChild(document.createTextNode('(' + wrapper + ')(' + JSON.stringify(info) + ');'));
(document.body || document.head || document.documentElement).appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment