plugin wrapper code - convert to use build.py macros. this ensures it's identical in all plugins, so the mobile app can remove/modify it without issues. also makes it easy to change if required
This commit is contained in:
@ -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@@
|
||||
|
Reference in New Issue
Block a user