User:Nx/monobook.js
Appearance
< User:Nx
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin can be added at User:Nx/monobook.css. |
var nx_hfn_strict = true;
importScript('User:Nx/HideFakeNotice.js');
importScript('User:Lupin/recent2.js');
function addSinceTab() {
// Default number of revisions to check. Set to 0 to use your usual default for a history page.
// Sensible options might be 300, 500 or 750. Values up to 5000 are valid, but will be quite slow.
if (!window.defaultdiffs) defaultdiffs=0;
if (window.location.href.indexOf("&action=history&gotosince=true")!=-1) {
do_since_I_last_edited()
}
else if (wgCanonicalNamespace != "Special") {
mw.util.addPortletLink("p-cactions", "/w/index.php?title="+encodeURIComponent(mw.config.get('wgPageName'))+"&action=history&gotosince=true" + ((defaultdiffs <= 0) ? "" : "&limit=" + defaultdiffs ), 'since', '', "all changes since your last edit");
}
}
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 hists=document.getElementById("pagehistory").getElementsByTagName('li');
for (n=0;n<hists.length;n++) {
if (getElementsByClassName(hists[n],'*','mw-userlink')[0].innerHTML==wgUserName) {
histlinks = getElementsByClassName(hists[n],'*','mw-history-histlinks')[0].getElementsByTagName("a")
if (histlinks.length > 1) {
document.location= histlinks[0].href;
} else {
msg.replaceChild(document.createTextNode
("You are the last editor. "),
msg.firstChild);
}
return;
}
}
msg.replaceChild(document.createTextNode
("You have not edited this page! (recently). Look at more edits? "),
msg.firstChild);
var lookharderA = document.createElement("A");
lookharderA.href = wgServer + '/w/index.php?title='+encodeURIComponent(mw.config.get('wgPageName'))+'&action=history&gotosince=true&limit=1000';
lookharderA.innerHTML = '1000';
msg.appendChild(lookharderA);
msg.appendChild(document.createTextNode
(" "));
lookharderA = document.createElement("A");
lookharderA.href = wgServer + '/w/index.php?title='+encodeURIComponent(mw.config.get('wgPageName'))+'&action=history&gotosince=true&limit=2500';
lookharderA.innerHTML = '2500';
msg.appendChild(lookharderA);
msg.appendChild(document.createTextNode
(" "));
lookharderA = document.createElement("A");
lookharderA.href = wgServer + '/w/index.php?title='+encodeURIComponent(mw.config.get('wgPageName'))+'&action=history&gotosince=true&limit=5000';
lookharderA.innerHTML = '5000';
msg.appendChild(lookharderA);
}
$(addSinceTab);