User:Manishearth/scriptlinks.js: Difference between revisions

Content deleted Content added
m Maintenance: Replacing addOnloadHook with native jQuery (mw:ResourceLoader/Migration_guide_(users)#addOnloadHook - phab:T130879)
maintenance: more info Uncaught ReferenceError: getElementsByClassName is not defined
 
Line 10:
importScript('boom.js')
function scriptLinks(className){
pre = getElementsByClassNamedocument.querySelectorAll(document, "*", ".source-javascript");
for(i = 0; i < pre.length; i++) {
par = getElementsByClassName(pre[i], .querySelectorAll("span.", + className);
for(j = 0; j < par.length; j++) {
par[j].innerHTML=par[j].innerHTML.replace(/\[\[([^\]\|]*)\]\]/g,"<a href='"+mw.config.get('wgServer')+mw.config.get('wgArticlePath')+"\'>$1</a>");
Line 33:
//Taken from [[User:AoV2/importScript_links]]
function importScript_links(){
pre = getElementsByClassNamedocument.querySelectorAll(document, "*", ".source-javascript");
for(i = 0; i < pre.length; i++) {
par = getElementsByClassName(pre[i], .querySelectorAll("span", ".br0");
for(j = 0; j < par.length; j++) {
if(par[j].innerHTML != "(") continue;