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:
Jon Atkins
2013-06-14 20:27:54 +01:00
parent a7a25098c9
commit 7d75a928cf
46 changed files with 134 additions and 780 deletions

View File

@ -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@@