diff --git a/build.py b/build.py index f2bf7bf5..01a3163d 100755 --- a/build.py +++ b/build.py @@ -61,6 +61,33 @@ distUrlBase = settings.get('distUrlBase') buildMobile = settings.get('buildMobile') +# plugin wrapper code snippets. handled as macros, to ensure that +# 1. indentation caused by the "function wrapper()" doesn't apply to the plugin code body +# 2. the wrapper is formatted correctly for removal by the IITC Mobile android app +pluginWrapperStart = """ +function wrapper() { +// ensure plugin framework is there, even if iitc is not yet loaded +if(typeof window.plugin !== 'function') window.plugin = function() {}; + +""" +pluginWrapperEnd = """ +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); + +""" + + def readfile(fn): with io.open(fn, 'Ur', encoding='utf8') as f: return f.read() @@ -137,6 +164,9 @@ def doReplacements(script,updateUrl,downloadUrl): script = script.replace('@@UPDATEURL@@', updateUrl) script = script.replace('@@DOWNLOADURL@@', downloadUrl) + script = script.replace('@@PLUGINSTART@@', pluginWrapperStart) + script = script.replace('@@PLUGINEND@@', pluginWrapperEnd) + return script diff --git a/plugins/ap-list.user.js b/plugins/ap-list.user.js index 6182ed70..a51bff27 100644 --- a/plugins/ap-list.user.js +++ b/plugins/ap-list.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -948,16 +945,4 @@ var setup = function() { } // 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); +@@PLUGINEND@@ diff --git a/plugins/basemap-blank.user.js b/plugins/basemap-blank.user.js index 29a40e1a..9cb7dbd5 100644 --- a/plugins/basemap-blank.user.js +++ b/plugins/basemap-blank.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -37,16 +34,4 @@ var setup = window.plugin.mapTileBlank.addLayer; // 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); +@@PLUGINEND@@ diff --git a/plugins/basemap-cloudmade.user.js b/plugins/basemap-cloudmade.user.js index 44181888..dbfb0144 100644 --- a/plugins/basemap-cloudmade.user.js +++ b/plugins/basemap-cloudmade.user.js @@ -34,10 +34,7 @@ // @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() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -88,16 +85,4 @@ var setup = window.plugin.mapTileCloudMade.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/basemap-opencyclemap.user.js b/plugins/basemap-opencyclemap.user.js index 6203f35b..5d5964e0 100644 --- a/plugins/basemap-opencyclemap.user.js +++ b/plugins/basemap-opencyclemap.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -44,16 +41,4 @@ var setup = window.plugin.mapTileOpenCycleMap.addLayer; // 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); +@@PLUGINEND@@ diff --git a/plugins/basemap-openstreetmap.user.js b/plugins/basemap-openstreetmap.user.js index 22519c07..3a1ebc59 100644 --- a/plugins/basemap-openstreetmap.user.js +++ b/plugins/basemap-openstreetmap.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -41,16 +38,4 @@ var setup = window.plugin.mapTileOpenStreetMap.addLayer; // 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); +@@PLUGINEND@@ diff --git a/plugins/basemap-yandex.user.js b/plugins/basemap-yandex.user.js index 6f914764..5e65092e 100644 --- a/plugins/basemap-yandex.user.js +++ b/plugins/basemap-yandex.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -62,16 +59,4 @@ var setup = window.plugin.mapTileYandex.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/compute-ap-stats.user.js b/plugins/compute-ap-stats.user.js index 95d8e9f3..e51edd25 100644 --- a/plugins/compute-ap-stats.user.js +++ b/plugins/compute-ap-stats.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -144,16 +141,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/draw-tools.user.js b/plugins/draw-tools.user.js index 08587ebf..e26b1131 100644 --- a/plugins/draw-tools.user.js +++ b/plugins/draw-tools.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -159,16 +156,4 @@ var setup = window.plugin.drawTools.loadExternals; // 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); +@@PLUGINEND@@ diff --git a/plugins/favorite-portals.user.js b/plugins/favorite-portals.user.js index 501f6339..b0833d6d 100644 --- a/plugins/favorite-portals.user.js +++ b/plugins/favorite-portals.user.js @@ -12,11 +12,11 @@ // @match http://www.ingress.com/intel* // @grant none // ==/UserScript== -function wrapper() { -if(typeof window.plugin !== 'function') window.plugin = function() {}; +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// + window.plugin.favoritePortals = function() {}; window.plugin.favoritePortals.portalList = {}; @@ -169,16 +169,4 @@ var setup = window.plugin.favoritePortals.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/guess-player-levels.user.js b/plugins/guess-player-levels.user.js index 04195507..b0a3e921 100644 --- a/plugins/guess-player-levels.user.js +++ b/plugins/guess-player-levels.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -182,16 +179,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/ipas-link.user.js b/plugins/ipas-link.user.js index c29b76c0..40886aa2 100644 --- a/plugins/ipas-link.user.js +++ b/plugins/ipas-link.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== - -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -76,16 +73,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/keys-on-map.user.js b/plugins/keys-on-map.user.js index 74353fa7..fb495552 100644 --- a/plugins/keys-on-map.user.js +++ b/plugins/keys-on-map.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -136,16 +133,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/keys.user.js b/plugins/keys.user.js index 9ffa64c0..22f4d1d2 100644 --- a/plugins/keys.user.js +++ b/plugins/keys.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -210,16 +207,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/max-links.user.js b/plugins/max-links.user.js index eddda059..62dd7245 100644 --- a/plugins/max-links.user.js +++ b/plugins/max-links.user.js @@ -13,11 +13,7 @@ // @grant none // ==/UserScript== -function wrapper() { - -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') - window.plugin = function() {}; +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -146,18 +142,5 @@ window.plugin.maxLinks.setup = function() { var setup = window.plugin.maxLinks.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/minimap.user.js b/plugins/minimap.user.js index 2c64401f..d8c49cda 100644 --- a/plugins/minimap.user.js +++ b/plugins/minimap.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -61,16 +58,4 @@ var setup = window.plugin.miniMap.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/pan-control.user.js b/plugins/pan-control.user.js index c8a1b147..7e9788cc 100644 --- a/plugins/pan-control.user.js +++ b/plugins/pan-control.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -46,16 +43,4 @@ var setup = window.plugin.panControl.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/player-tracker.user.js b/plugins/player-tracker.user.js index df0e6857..3de0b728 100644 --- a/plugins/player-tracker.user.js +++ b/plugins/player-tracker.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// window.PLAYER_TRACKER_MAX_TIME = 3*60*60*1000; // in milliseconds @@ -412,16 +409,4 @@ var setup = plugin.playerTracker.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/players-resonators.user.js b/plugins/players-resonators.user.js index 0b76bf12..f6647ec2 100644 --- a/plugins/players-resonators.user.js +++ b/plugins/players-resonators.user.js @@ -13,6 +13,10 @@ // @grant none // ==/UserScript== +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + /********************************************************************************************************* * Changelog: * @@ -24,13 +28,6 @@ * 0.1.0 First public release *********************************************************************************************************/ -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.playersResonators = function() {}; @@ -107,16 +104,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-counts.user.js b/plugins/portal-counts.user.js index d5b14dc2..08020cb9 100644 --- a/plugins/portal-counts.user.js +++ b/plugins/portal-counts.user.js @@ -14,6 +14,10 @@ // @grant none // ==/UserScript== +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + /* whatsnew * 0.0.8 : use dialog() instead of alert() * 0.0.6 : ignoring outside bounds portals (even if close to) @@ -25,12 +29,6 @@ * todo : */ -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.portalcounts = function() {}; @@ -132,16 +130,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-can-make-level.user.js b/plugins/portal-highlighter-can-make-level.user.js index c070f24e..f4eca8de 100644 --- a/plugins/portal-highlighter-can-make-level.user.js +++ b/plugins/portal-highlighter-can-make-level.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -79,16 +76,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-level-color.user.js b/plugins/portal-highlighter-level-color.user.js index e4f82b51..ad2e28d1 100644 --- a/plugins/portal-highlighter-level-color.user.js +++ b/plugins/portal-highlighter-level-color.user.js @@ -14,14 +14,11 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// -// use own namespace for plugin +// use own namespace for plugin window.plugin.portalHighligherPortalsLevelColor = function() {}; window.plugin.portalHighligherPortalsLevelColor.colorLevel = function(data) { @@ -38,16 +35,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-missing-resonators.user.js b/plugins/portal-highlighter-missing-resonators.user.js index 99ba0c6c..9457ad42 100644 --- a/plugins/portal-highlighter-missing-resonators.user.js +++ b/plugins/portal-highlighter-missing-resonators.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -64,16 +61,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-my-8-portals.user.js b/plugins/portal-highlighter-my-8-portals.user.js index 2c6f6f1a..11b6f6f7 100644 --- a/plugins/portal-highlighter-my-8-portals.user.js +++ b/plugins/portal-highlighter-my-8-portals.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -54,16 +51,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-my-portals.user.js b/plugins/portal-highlighter-my-portals.user.js index 4aa47ad1..09d208b6 100644 --- a/plugins/portal-highlighter-my-portals.user.js +++ b/plugins/portal-highlighter-my-portals.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -74,16 +71,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-needs-recharge.user.js b/plugins/portal-highlighter-needs-recharge.user.js index ca6f11b8..63422ec2 100644 --- a/plugins/portal-highlighter-needs-recharge.user.js +++ b/plugins/portal-highlighter-needs-recharge.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -47,16 +44,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-portal-ap-energy-relative.user.js b/plugins/portal-highlighter-portal-ap-energy-relative.user.js index 9f5aebcb..a4e53cb6 100644 --- a/plugins/portal-highlighter-portal-ap-energy-relative.user.js +++ b/plugins/portal-highlighter-portal-ap-energy-relative.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -105,16 +102,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-portal-ap-relative.user.js b/plugins/portal-highlighter-portal-ap-relative.user.js index 51e91fc8..f6c1cbf6 100644 --- a/plugins/portal-highlighter-portal-ap-relative.user.js +++ b/plugins/portal-highlighter-portal-ap-relative.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -100,16 +97,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-portal-ap.user.js b/plugins/portal-highlighter-portal-ap.user.js index 146cdd32..5b907248 100644 --- a/plugins/portal-highlighter-portal-ap.user.js +++ b/plugins/portal-highlighter-portal-ap.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -61,16 +58,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-portals-my-level.user.js b/plugins/portal-highlighter-portals-my-level.user.js index 890f4685..dddd1a2b 100644 --- a/plugins/portal-highlighter-portals-my-level.user.js +++ b/plugins/portal-highlighter-portals-my-level.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -55,16 +52,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-portals-upgrade.user.js b/plugins/portal-highlighter-portals-upgrade.user.js index 70d9d76d..569a1347 100644 --- a/plugins/portal-highlighter-portals-upgrade.user.js +++ b/plugins/portal-highlighter-portals-upgrade.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -58,16 +55,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-highlighter-with-lvl8-resonators.user.js b/plugins/portal-highlighter-with-lvl8-resonators.user.js index ab2740a6..01889199 100644 --- a/plugins/portal-highlighter-with-lvl8-resonators.user.js +++ b/plugins/portal-highlighter-with-lvl8-resonators.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -55,16 +52,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portal-level-numbers.user.js b/plugins/portal-level-numbers.user.js index 003692f5..532d78a9 100644 --- a/plugins/portal-level-numbers.user.js +++ b/plugins/portal-level-numbers.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -86,16 +83,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index f5923b41..96c3fbaf 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -14,6 +14,10 @@ // @grant none // ==/UserScript== +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + /* whatsnew * 0.0.14: Add support to new mods (S:Shield - T:Turret - LA:Link Amp - H:Heat-sink - M:Multi-hack - FA:Force Amp) * 0.0.12: Use dialog() instead of alert so the user can drag the box around @@ -35,12 +39,6 @@ * todo : export as GPX, Open in Google Maps, more statistics in the header, what else ? */ -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.portalslist = function() {}; @@ -390,16 +388,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/privacy-view.user.js b/plugins/privacy-view.user.js index 8a400335..92daeede 100644 --- a/plugins/privacy-view.user.js +++ b/plugins/privacy-view.user.js @@ -13,11 +13,7 @@ // @grant none // ==/UserScript== -function wrapper() { - -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') - window.plugin = function() {}; +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -114,18 +110,4 @@ var setup = window.plugin.privacyView.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/render-limit-increase.user.js b/plugins/render-limit-increase.user.js index 3f4494c9..752f2629 100644 --- a/plugins/render-limit-increase.user.js +++ b/plugins/render-limit-increase.user.js @@ -14,10 +14,8 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -50,16 +48,4 @@ var setup = window.plugin.renderLimitIncrease.setHigherLimits; // 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); +@@PLUGINEND@@ diff --git a/plugins/reso-energy-pct-in-portal-detail.user.js b/plugins/reso-energy-pct-in-portal-detail.user.js index ca0e8e31..1120167c 100644 --- a/plugins/reso-energy-pct-in-portal-detail.user.js +++ b/plugins/reso-energy-pct-in-portal-detail.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -47,16 +44,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/resonator-display-zoom-level-decrease.user.js b/plugins/resonator-display-zoom-level-decrease.user.js index aa43615b..82b08c28 100644 --- a/plugins/resonator-display-zoom-level-decrease.user.js +++ b/plugins/resonator-display-zoom-level-decrease.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -35,16 +32,4 @@ 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); +@@PLUGINEND@@ diff --git a/plugins/scale-bar.user.js b/plugins/scale-bar.user.js index a3d75f8c..26830c75 100644 --- a/plugins/scale-bar.user.js +++ b/plugins/scale-bar.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -42,16 +39,4 @@ var setup = window.plugin.scaleBar.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/scoreboard.user.js b/plugins/scoreboard.user.js index 8bd68d40..c449c28a 100644 --- a/plugins/scoreboard.user.js +++ b/plugins/scoreboard.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -427,16 +424,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/show-address.user.js b/plugins/show-address.user.js index 6c2844e7..62f0ab5a 100644 --- a/plugins/show-address.user.js +++ b/plugins/show-address.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -44,16 +41,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/show-linked-portals.user.js b/plugins/show-linked-portals.user.js index 4ae6676a..39392060 100644 --- a/plugins/show-linked-portals.user.js +++ b/plugins/show-linked-portals.user.js @@ -14,21 +14,16 @@ // @grant none // ==/UserScript== +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + /* * 0.0.1 initial release, show images, names and addresses of linked portal in portal detailview * - mouse click of the linked portal image selected the portal and adjust map * - click of "Linked Portal is out of range" zoom a step out */ -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.showLinkedPortal = function () { }; @@ -121,16 +116,4 @@ var setup = function () { } // 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); +@@PLUGINEND@@ diff --git a/plugins/show-portal-weakness.user.js b/plugins/show-portal-weakness.user.js index 914417be..d0f1602b 100644 --- a/plugins/show-portal-weakness.user.js +++ b/plugins/show-portal-weakness.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -92,16 +89,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/speech-search.user.js b/plugins/speech-search.user.js index 408be363..589f785c 100644 --- a/plugins/speech-search.user.js +++ b/plugins/speech-search.user.js @@ -13,10 +13,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if (typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -36,16 +33,4 @@ var setup = window.plugin.speechSearch.setup; // 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); +@@PLUGINEND@@ diff --git a/plugins/sync.user.js b/plugins/sync.user.js index c6c34e02..9f90b9cb 100644 --- a/plugins/sync.user.js +++ b/plugins/sync.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -754,16 +751,4 @@ var setup = function() { // 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); +@@PLUGINEND@@ diff --git a/plugins/zoom-slider.user.js b/plugins/zoom-slider.user.js index e25eea9f..d54e4be0 100644 --- a/plugins/zoom-slider.user.js +++ b/plugins/zoom-slider.user.js @@ -14,10 +14,7 @@ // @grant none // ==/UserScript== -function wrapper() { -// ensure plugin framework is there, even if iitc is not yet loaded -if(typeof window.plugin !== 'function') window.plugin = function() {}; - +@@PLUGINSTART@@ // PLUGIN START //////////////////////////////////////////////////////// @@ -42,16 +39,4 @@ var setup = window.plugin.zoomSlider.setup; // 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); +@@PLUGINEND@@