ingress-intel-total-conversion/plugins/resonator-display-zoom-level-decrease.user.js
Jon Atkins 4ce0da5056 large chunk of work towards a nicer build system
- plugins are now parsed for @@..@@ replacements
- main script and plugins have separate .meta.js files created - less web server load for update checks
- build script has variables for resource URL, update URL, etc, substituted via @@..@@ into main script and all plugins
2013-03-19 22:39:16 +00:00

49 lines
1.7 KiB
JavaScript

// ==UserScript==
// @id iitc-plugin-resonator-display-zoom-level-decrease@xelio
// @name IITC plugin: resonator display zoom level decrease
// @version 1.0.2.@@DATETIMEVERSION@@
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @updateURL @@UPDATEURL@@
// @downloadURL @@DOWNLOADURL@@
// @description Resonator start display earlier
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*
// @match http://www.ingress.com/intel*
// ==/UserScript==
function wrapper() {
// ensure plugin framework is there, even if iitc is not yet loaded
if(typeof window.plugin !== 'function') window.plugin = function() {};
// PLUGIN START ////////////////////////////////////////////////////////
// use own namespace for plugin
window.plugin.resonatorDisplayZoomLevelDecrease = function() {};
window.plugin.resonatorDisplayZoomLevelDecrease.changeConstant = function() {
// Minimum zoom level resonator will display
window.RESONATOR_DISPLAY_ZOOM_LEVEL = 16;
};
var setup = window.plugin.resonatorDisplayZoomLevelDecrease.changeConstant;
// PLUGIN END //////////////////////////////////////////////////////////
if(window.iitcLoaded && typeof setup === 'function') {
setup();
} else {
if(window.bootPlugins)
window.bootPlugins.push(setup);
else
window.bootPlugins = [setup];
}
} // wrapper end
// inject code into site context
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ wrapper +')();'));
(document.body || document.head || document.documentElement).appendChild(script);