User:Fiiiisch!/vector.js

importScript('User:Anomie/linkclassifier.js'); // Linkback: User:Anomie/linkclassifier.js importStylesheet('User:Anomie/linkclassifier.css'); // Linkback: User:Anomie/linkclassifier.css

// better tooltips for redirects, showing also the target of the redirect function WL { // Konfiguration: if ( typeof pfeil == "undefined") var pfeil = " → "; if ( typeof titlebeibehalten == "undefined") var titlebeibehalten = true; var inhalt = document.getElementById("bodyContent"); var redirects = getElementsByClassName(inhalt, "a", "mw-redirect"); var catredirects = getElementsByClassName(inhalt, "span", "redirect-in-category"); var apredirects = getElementsByClassName(inhalt, "div", "allpagesredirect"); var allredirects = []; for(var i=0;i<redirects.length;i++) allredirects.push(redirects[i]); for(var i=0;i<catredirects.length;i++) allredirects.push(catredirects[i].getElementsByTagName("a")[0]); for(var i=0;i -1) { // links mit php-parameter start = link.indexOf("title=") + 6; ende = link.indexOf("&", start); }        if (ende == - 1) ende = link.length; var ziel = link.substring(start, ende); var schondrin = false; for(i=0; i0) diesmal.push(ziele.shift); var url = wgServer + "/" + wgScriptPath + "/api.php?action=query&format=xml&titles=" + diesmal.join("|") + "&redirects"; if ( typeof wl_xmlhttp != "undefined" ) wl_xmlhttp.abort; // Just to make sure... var wl_xmlhttp = new sajax_init_object; wl_xmlhttp.open('GET', url, true); wl_xmlhttp.onreadystatechange = function { if (! wl_xmlhttp) return ; if (wl_xmlhttp.readyState != 4) return; var xml = wl_xmlhttp.responseXML; if (! xml) return ; var r = xml.getElementsByTagName("r"); for(var i=0;i= r.length) break; }              if (j >= r.length) continue; // wurde nicht in xml gefunden var anhang = r[j].getAttribute("to"); if (! anhang) continue; var neuerTitle = pfeil + anhang; if (titlebeibehalten) neuerTitle = title + pfeil + anhang; node.setAttribute("title", neuerTitle); }           if (ziele.length > 0) query; //solange bis nichts mehr da ist };        wl_xmlhttp.send(null); }  } } $(WL);