Benutzer:Heiko/monobook.js

aus Wikipedia, der freien Enzyklopädie

Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.

  • Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
  • Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
  • Internet Explorer/Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
  • Opera: Strg+F5
 NavigationBarShowDefault = 20;

 // aOnloadFunctions[aOnloadFunctions.length] = document_sz_to_ss;

// CommonsHelper
// [[Benutzer:Krimpet/CH2_de.js]]
document.write('<script type="text/javascript" src="' 
             + 'http://de.wikipedia.org/w/index.php?title=Benutzer:Krimpet/CH2_de.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// Unwatch
$(function () {
    // Check if we're on the watchlist
    if (!mw.config.get('wgCanonicalSpecialPageName') || mw.config.get('wgCanonicalSpecialPageName') != "Watchlist") return;
    if (!document.forms[0] || !document.forms[0].namespace) return;

    // Unwatch links go back to watchlist with "Removing requested items from watchlist..." message
    //var query_prefix = "title="+encodeURIComponent(mw.config.get('wgPageName'))+"&action=submit&remove=1&id[]=";

    // ...or...
    //Unwatch links go to "Removed from watchlist" page
    var query_prefix = "action=unwatch&title=";

    // get list of all links in content:
    var links = document.getElementById('bodyContent').getElementsByTagName('a');

    // make a static copy of the nodelist and lose the original for speed
    // while we're at it, prune the uninteresting links from the list
    var linksCopy = new Array ();
    for (var i = 0; i < links.length; i++) {
        if (/[?&]action=history([&#]|$)/.test(links[i].href)) linksCopy.push(links[i]);
    }
    links = linksCopy;

    for (var i = 0; i < links.length; i++) {
        // create unwatch link and append it after history link
        var unwatch = document.createElement('a');
        unwatch.href = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/index.php?" + query_prefix + encodeURIComponent(links[i].title);
        unwatch.id = "ca-unwatch";
        unwatch.title = "Unwatch "+links[i].title;
        unwatch.appendChild(document.createTextNode("unwatch"));
        links[i].parentNode.insertBefore(unwatch, links[i].nextSibling);

        // insert a delimiter between the two links
        var delim = links[i].previousSibling;
        delimText = (delim.nodeType == 3 ? delim.nodeValue : ""); // kluge to handle case where "diff" is unlinked
        delim = document.createTextNode(delimText.replace(/^.*diff/, ""));
        links[i].parentNode.insertBefore(delim, unwatch);
    }
});