-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathless-clutter.user.js
62 lines (52 loc) · 2.3 KB
/
less-clutter.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// ==UserScript==
// @id iitc-plugin-less-clutter@qnstie
// @name IITC plugin: less clutter in the display
// @category Tweaks
// @version 0.1.0.20130928.170000
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL http://iitcm.code-noobs.org/less-clutter.meta.js
// @downloadURL http://iitcm.code-noobs.org/less-clutter.user.js
// @description [qnstie-2013-07-08] render markers as small circles with thin bezels, regardless of their level. Best to use with "Portal Levels" plugin.
// @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==
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 START ////////////////////////////////////////////////////////
window.plugin.lessClutter = function() {};
window.plugin.lessClutter.setup = function() {
window.addHook('iitcLoaded', function() {
window.getMarkerStyleOptions = function(details) {
var options = {
radius: 6,
stroke: true,
color: COLORS[details.team],
weight: 1,
opacity: 1,
fill: true,
fillColor: COLORS[details.team],
fillOpacity: 1,
dashArray: null
};
return options;
}
});
};
var setup = window.plugin.lessClutter.setup;
// 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
var 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);