User:Ms2ger/standard.js

function standardLinkFa { var rootIds = ["topbar", "footer"]; // these root elements can contain FA-links

for (var i = 0, il = rootIds.length; i < il; i++) { var root = document.getElementById(rootIds[i]); if (!root) continue; var links = root.getElementsByTagName("a"); for (var j = 0, jl = links.length; j < jl; j++) { var lang = links[j].title.split(":")[0]; var fa = document.getElementById("interwiki-" + lang + "-fa"); if (!fa) continue; links[j].className += " fa"; } } } addOnloadHook(standardLinkFa);