User:Andrew Hampe/monobook.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// [[User:Lupin/popups.js]]

importScript('User:Lupin/popups.js');


document.write('<script src="'
 + 'http://de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.js'
 + '&action=raw&ctype=text/javascript"></script>');
var qeEnabled          = true;  // Activate Script?
var qeEnableSection0   = true;  // Enable QuickEdit link for section 0 (introduction)?
var qeEnableAccessKeys = true;  // Activate access keys?

// addPurge
addOnloadHook(function () {
    var hist; var url;
    if (!(hist = document.getElementById('ca-history') )) return;
    if (!(url = hist.getElementsByTagName('a')[0] )) return;
    if (!(url = url.href )) return;
    addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),
                   'purge', 'ca-purge', 'Purge server cache for this page', '0');
});
// 


function warn() {
    var prompter = prompt("Which warning do you wish to issue?");
    var msgtext  = "{{subst:" + prompter + "}}[[User:Andrew Hampe|Andrew Hampe]] | [[User talk:Andrew Hampe|Talk]] 18:47, 22 March 2007 (UTC)";
    var summary  = "{{" + prompter + "}}";
    var txt      = document.editform.wpTextbox1;
    if (txt.value.length > 0) txt.value += '\n';
    txt.value += msgtext;
    document.editform.wpSummary.value = summary;
    document.editform.submit();
}


// Script from [[User:Tra/userwatchlist.js]]
importScript('User:Tra/userwatchlist.js'); //[[User:Tra/userwatchlist.js]]

// Originally based on http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510  
//See [[Wikipedia:WikiProject User scripts/Scripts/Show last diff]]
// addLastDiff
function addLastDiff()
{
    addPortletLink('p-cactions', 'http://en.wikipedia.org/w/index.php?title=' + wgPageName + "&diff=cur&oldid=prev", 'last', 'ca-last', 'Show most recent diff');
}
addOnloadHook(addLastDiff);

// 

//From http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510
function addSinceTab() {
    if (window.location.href.indexOf("&action=history&gotosince=true")!=-1) {
       do_since_I_last_edited()
    }
    else if (wgCanonicalNamespace != "Special") {
       addPortletLink("p-cactions", "/w/index.php?title="+wgPageName+"&action=history&gotosince=true", 'since', '', "since");
    }
}
function do_since_I_last_edited() {
        var csub=document.getElementById("contentSub");
        var msg=document.createElement("p");
        msg.appendChild(document.createTextNode
                        ("Parsing history... please wait..."));
        msg.className="error";
        csub.insertBefore(msg, csub.firstChild)

        var username=document.getElementById("pt-userpage").textContent;
        var hists=document.getElementById("pagehistory").getElementsByTagName('li');
        for (n=0;n<hists.length;n++) {
            if (hists[n].getElementsByTagName("span")[0].getElementsByTagName('a')[0].textContent==username) {
                document.location=hists[n].childNodes[1].href; 
                return;
            }
        }

        msg.replaceChild(document.createTextNode
                         ("You have not edited this page! (recently)"),
                         msg.firstChild);
}

addOnloadHook(addSinceTab);

//

/*
importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklefluff.js');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:AzaToth/twinklearv.js');
importScript('User:AzaToth/twinklespeedy.js');
importScript('User:AzaToth/twinklediff.js');
importScript('User:AzaToth/twinkleprotect.js');
importScript('User:AzaToth/twinkleprod.js');
 */