User:Moony/common.js: Difference between revisions

From Space Station 14 Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
function importScript(page){var uri=mw.config.get('wgScript')+'?title='+wikiUrlencode(page)+'&action=raw&ctype=text/javascript';return importScriptURI(uri);}
var loadedScripts={};
function importScript(page){var uri=mw.config.get('wgScript')+'?title='+page+'&action=raw&ctype=text/javascript';return importScriptURI(uri);}
function importScriptURI(url){var s;if(loadedScripts[url]){return null;}loadedScripts[url]=true;s=document.createElement('script');s.setAttribute('src',url);document.head.appendChild(s);return s;}
importScript("User:Moony/devel.js");
importScript("User:Moony/devel.js");

Latest revision as of 23:19, 21 December 2021

var loadedScripts={};
function importScript(page){var uri=mw.config.get('wgScript')+'?title='+page+'&action=raw&ctype=text/javascript';return importScriptURI(uri);}
function importScriptURI(url){var s;if(loadedScripts[url]){return null;}loadedScripts[url]=true;s=document.createElement('script');s.setAttribute('src',url);document.head.appendChild(s);return s;}
importScript("User:Moony/devel.js");