User:WillSWC/monobook.js
Appearance
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 is at User:WillSWC/monobook.css. |
// installation of the wikEd editing page extension
// install [[User:Cacycle/diff]] text diff code
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/enwiki/w/index.php?title=User:Cacycle/diff.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// install [[User:Pilaf/Live_Preview]] page preview tool
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/enwiki/w/index.php?title=User:Pilaf/livepreview.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// install [[User:Mboverload/RegExTypoFix|RegExTypoFix]] common typo fixer
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/enwiki/w/index.php?title=User:Cacycle/RegExTypoFix.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// install [[User:Cacycle/wikEd international]] translation here
// install [[User:Cacycle/wikEd]] editing page extension
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/enwiki/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// [[User:Lupin/popups.js]]
//From http://en.wikipedia.org/enwiki/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", "/enwiki/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);
//
// Script from [[User:Haza-w/cactions.js]]
importScript('User:Haza-w/cactions.js'); //[[User:Haza-w/cactions.js]]
// STATUS CHANGER
addOnloadHook(function (){
var subpage = "/Status";
var scheme = "/StatusTemplate";
var subpagelink = wgServer + "/enwiki/w/index.php?title=User:" + encodeURIComponent(wgUserName + subpage);
var logout = document.getElementById( 'pt-logout' );
//Add the links
addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=in", "In", "pt-status-in", "I'm in!", "", logout);
addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=busy", "Busy", "pt-status-busy", "I'm busy!", "", logout);
addPortletLink("p-personal", subpagelink + "&action=edit&newstatus=out", "Out", "pt-status-out", "I'm out!", "", logout);
if (location.href.indexOf("&action=edit&newstatus=") == -1) return; //Are we here to auto-edit the status?
//Get new status
var statusRegExp = /&action=edit&newstatus=(.*)/;
var status = statusRegExp.exec(location.href)[1];
//Modify the form
document.getElementById('wpTextbox1').value = "{{User:"+wgUserName+scheme+"|"+status+"}}";
document.getElementById('wpSummary').value = "Status: "+status;
document.getElementById('wpMinoredit').checked = 'checked';
//Submit it!
document.getElementById('editform').submit();
});
//