Created
February 8, 2013 08:51
-
-
Save rc5hack/4737523 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Code copied from Russian wikipedia (08.02.2012) | |
*/ | |
window.loadedScripts={}; | |
window.importScriptURI=function(url){ | |
if(loadedScripts[url]){return null;} | |
loadedScripts[url]=true; | |
var s=document.createElement('script'); | |
s.setAttribute('src',url); | |
s.setAttribute('type','text/javascript'); | |
document.getElementsByTagName('head')[0].appendChild(s); | |
return s; | |
}; | |
window.importScript=function(page){ | |
var uri=mw.config.get('wgScript')+'?title='+mw.util.wikiUrlencode(page)+'&action=raw&ctype=text/javascript'; | |
return importScriptURI(uri); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment