MediaWiki:Common.js
Opjepass: Noh em Speichere künnd et sin, datt De Dingem Brauser singe Cache Speicher övverlisste muss, ih datt De de Änderunge och ze sinn kreß.
- Beim Mozilla un Firefox un Safari, dröck dä Jrußschreffknopp eronger un kleck dann op Reload / Aktualisieren, udder dröck Ctrl+F5 / Strg+F5, udder dröck Ctrl+R / Strg+R, obb enem Macintosh dröck ⌘+R.
- Beim Google Chrome, dröck Ctrl+Jrußschreffknopp+R / Strg+Jrußschreffknopp+R, obb enem Macintosh dröck ⌘+Jrußschreffknopp+R.
- Beim Internet Explorer, dröck dä Jrußschreffknopp eronger un kleck dann op Refresh / Aktualisieren, udder dröck Ctrl+F5 / Strg+F5,
- Beim Konqueror klegg op Reload / Aktualisieren, udder dröck op F5.
- Beim Opera kanns De övver et Menue jonn un däm janze Zwescheschpeischer singe Enhald övver Tools → Preferences / Werkzeug → Einstellungen fottschmieße, neuerdings jeiht et och met Alt+F5.
/* Any JavaScript here will be loaded for all users on every page load. */
//=============================================================
//*** Configuration for "star" logo in front of interwiki links to Featured Articles
//*** and green symbol in front of interwiki links to Good Articles
/** set to false in Special:Mypage/monobook.js to switch off this "feature" */
var linkFA_enabled = true;
/** description that is displayed when cursor hovers above FA interwiki links */
var linkFA_description = " — Enen äxzelänten Artikkel!";
var linkGA_description = " — Jooden Artikkel!";
// linkFA_bullet/linkGA_bullet and linkFA_style/linkGA_Style werden nur für cologneblue, nostalgia and standard verwendet,
// für monobook und simple siehe [[MediaWiki:Common.css]]
/** image to use instead of the standard bullet (for cologneblue, nostalgia and standard */
var linkFA_bullet = "//upload.wikimedia.org/wikipedia/commons/d/d0/Monobook-bullet-star-transparent.png";
var linkGA_bullet = "//upload.wikimedia.org/wikipedia/commons/a/a1/Monobook-bullet-star-gray.png";
/** style to use for the linkFA_bullet/LinkGA_bullet img */
var linkFA_style = "margin-right: 0.2em;";
var linkGA_style = "margin-right: 0.2em;";
/**
* star logo for featured articles in other languages,
* see Template:Link_FA / Template:Link_GA and MediaWiki:Common.css
*/
$(function() {
var skin = mw.config.get('skin');
// early exit when disabled
if (!linkFA_enabled) return;
// skins need to be treated differently
if (skin == "monobook" || skin == "simple" || skin == "modern") {
newer();
}
else if (skin == "cologneblue" || skin == "nostalgia" || skin == "standard") {
older();
}
/** skin == "monobook" || skin == "simple" || skin="modern" */
function newer() {
// links are to replaced in p-lang only
var pLang = document.getElementById("p-lang");
if (!pLang) return;
var lis = pLang.getElementsByTagName("li");
for (var i = 0; i < lis.length; i++) {
var li = lis[i];
// only links with a corresponding Link_FA template are interesting
if (document.getElementById(li.className + "-fa") && li.className.indexOf("badge-featuredarticle") === -1) {
li.className += " FA"; // additional class so the template can be hidden with CSS
li.title += linkFA_description; // change title
continue;
}
if (document.getElementById(li.className + "-ga") && li.className.indexOf("badge-goodarticle") === -1) {
li.className += " GA"; // additional class so the template can be hidden with CSS
li.title += linkGA_description; // change title
continue;
}
}
}
/** skin == "cologneblue" || skin == "nostalgia" || skin == "standard" */
function older() {
// these root elements can contain FA-/GA-links
var rootIds = new Array("topbar", "footer");
for (var i=0; i<rootIds.length; i++) {
var root = document.getElementById(rootIds[i]);
if (!root) continue;
// if the root exists, try to decorate all the links within
var links = root.getElementsByTagName("a");
for (var j=0; j<links.length; j++) {
decorate(links[j], "-fa", linkFA_bullet, linkFA_description, linkFA_style);
decorate(links[j], "-ga", linkGA_bullet, linkGA_description, linkGA_style);
}
}
}
/** id necessary, modify a link to show the FA- or GA-star (older) */
function decorate(link, idSuffix, bullet, description) {
var lang = link.title.split(":")[0]; // not precise enough
var fa = document.getElementById("interwiki-" + lang + idSuffix);
if (!fa) return;
// build an image-node for the FA-star
var img = document.createElement("img");
img.setAttribute("src", bullet);
img.setAttribute("alt", description);
img.setAttribute("style", style);
// decorate the link with the image
link.appendChild(img);
link.appendChild(link.removeChild(link.firstChild));
link.setAttribute("title", description);
}
});
// END