User:Nina/standard.js

// ============================================================ // BEGIN Configuration for "star" logo at the top of Featured Articles

/** set to false in Special:Mypage/monobook.js to switch off this "feature" */ var enable_linkFA = true;

/** * star logo for featured articles in other languages, * see Template:Link_FA and MediaWiki:Common.css */ function linkallFA { // early exit when disabled if (!enable_linkFA) return; // links are to replaced in p-lang only var topbar = document.getElementById("topbar"); if (!topbar) { alert("Keine topbar gefunden."); return; } else { // alert("topbar erspäht"); }   var tblinks = topbar.getElementsByTagName("a");       // find all topbar links for (var i=0; i<tblinks.length; i++) { var link = tblinks[i]; var parts = link.title.split(":"); if (document.getElementById("interwiki-" + parts[0] + "-fa")) { var lang = parts[0] document.write(lang); // build an image-node with all necessary attributes var FAimg = document.createElement("img"); var imgsrc = document.createAttribute("src"); imgsrc.nodeValue = "http://upload.wikimedia.org/wikipedia/commons/d/d4/Monobook-bullet-star.png"; // add alternative text (though not visible because of the "title" attribute of the link            var alttext = document.createAttribute("alt");             alttext.nodeValue = "Dieser Artikel wurde als exzellent bewertet.";             // add some beauty: margin-left to have some space to the name of the language             var styattr = document.createAttribute("style");             styattr.nodeValue = "margin-right: 0.2em;";             FAimg.setAttributeNode(imgsrc);             FAimg.setAttributeNode(alttext);             FAimg.setAttributeNode(styattr);             var NodeCopy = link.firstChild.cloneNode(true);             link.removeChild(link.firstChild);             link.appendChild(FAimg);             link.appendChild(NodeCopy);             link.setAttribute("title", "Dieser Artikel wurde als exzellent bewertet: " + link.getAttribute("title"));             //link.title = "Haha, hab ich dich!"; }        // only links with a corresponding Link_FA template are interesting //if (!document.getElementById(li.className + "-fa"))  continue; // additional class so the template can be hidden with CSS //li.className += " FA"; // change title //li.title = "Dieser Artikel wurde als exzellent bewertet."; } } // aOnloadFunctions[aOnloadFunctions.length] = linkallFA; $(linkallFA);

// END Configuration for "star" logo at the top of Featured Articles */ // ============================================================