ingress-intel-total-conversion/plugins/portal-highlighter-infrastructure.user.js
fkloft eba7d388a0 Enable IITC on mission permalink
Hint: to change a lot of scripts, execute this:

    sed -r '/\/\/ @match\s+http:\/\/www.ingress.com\/intel/r /tmp/includefile' -i~ *.user.js

`/tmp/includefile` should contain these lines: (no trailing newline!)

    // @include        https://www.ingress.com/mission/*
    // @include        http://www.ingress.com/mission/*
    // @match          https://www.ingress.com/mission/*
    // @match          http://www.ingress.com/mission/*
2015-04-13 17:28:30 +02:00

65 lines
2.3 KiB
JavaScript

// ==UserScript==
// @id iitc-plugin-highlight-portal-infrastructure@vita10gy
// @name IITC plugin: highlight portals with infrastructure problems
// @category Highlighter
// @version 0.2.1.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description [@@BUILDNAME@@-@@BUILDDATE@@] Use the portal fill color to denote if the portal has any infrastructure problems. Red: no picture. Yellow: potential title issue. Orange: both of these.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// @include https://www.ingress.com/mission/*
// @include http://www.ingress.com/mission/*
// @match https://www.ingress.com/mission/*
// @match http://www.ingress.com/mission/*
// @grant none
// ==/UserScript==
@@PLUGINSTART@@
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.portalInfrastructure = function() {};
window.plugin.portalInfrastructure.badTitles = ['^statue$',
'^fountain$',
'^sculpture$',
'^post office$',
'^us post office$',
'^church$',
'untitled',
'no title'];
window.plugin.portalInfrastructure.highlight = function(data) {
var d = data.portal.options.data;
var color = '';
var opa = .75;
if(!(d.image)) {
color = 'red';
}
if((new RegExp(window.plugin.portalInfrastructure.badTitles.join("|"),'i')).test(d.title)) {
color = color == 'red' ? 'orange' : 'yellow';
opa = .9;
}
if(color !== '') {
var params = {fillColor: color, fillOpacity: opa};
data.portal.setStyle(params);
}
}
var setup = function() {
window.addPortalHighlighter('Infrastructure', window.plugin.portalInfrastructure.highlight);
}
// PLUGIN END //////////////////////////////////////////////////////////
@@PLUGINEND@@