User:Color probe/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:Color probe/monobook.css. |
// Script from [[User:MarkS/extraeditbuttons.js]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:MarkS/extraeditbuttons.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//<nowiki> Admin-like RC Patrol tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:VoA/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//</nowiki>[[Category:Wikipedians who use RC script ]]
//Back-up edit counter
//Visit [[User:Interiot/Tool2/code.js]] in emergencies!
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript');
//
function addlilink(tabs, url, name, id, title, key){
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na);
tabs.appendChild(li);
if(id)
{
if(key && title)
{
ta[id] = [key, title];
}
else if(key)
{
ta[id] = [key, ''];
}
else if(title)
{
ta[id] = ['', title];
}
}
// re-render the title and accesskeys from existing code in wikibits.js
akeytt();
return li;
}
//
//
function addTab(url, name, id, title, key){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
return addlilink(tabs, url, name, id, title, key);
}
//
//
//From http://en.wikipedia.org/w/index.php?title=User:JesseW/monobook.js&oldid=20755510
// addLastDiff
addOnloadHook(function () {
addTab("http://en.wikipedia.org/w/index.php?title=" + wgPageName + "&diff=cur&oldid=prev", 'Last', 'ca-diff', 'Show most recent diff', '');
});
//
// gotoLocalhostWiki
addOnloadHook(function () {
addTab("http://main/w/index.php?title=" + wgPageName + "", 'LocalWiki', 'ca-lw', 'Go to LocalWiki', '');
});
//
//Please leave the following line
//user:Where/usertabs
addOnloadHook(function() {
if (document.title.search("/") != -1 || document.title.search("- History -") != -1) { //no subpages or history
return;
}
if (document.title.indexOf("User:") == 0 || document.title.indexOf("User talk:") == 0) {
username_a = document.URL.match(/:.*:(.*)/);
username=username_a[1];
addTab("http://en.wikipedia.org/wiki/Special:Contributions/" + username, "contrib", "ca-contrib", "Contributions", "");
addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=move&user=" + username, "page moves", "ca-pagemoves", "Page moves", "");
addTab("http://en.wikipedia.org/w/index.php?title=Special%3ALog&type=block&user=" + username, "block log", "ca-blog", "Block log", "");
addTab("http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user=" + username, "edit count", "ca-kate", "Edit count", "");
}
});
//
// Compare link
function fixCompare()
{
var histForm=document.getElementsByTagName("form")[0];
var finalButton=document.getElementById("historysubmit");
var firstButton=histForm.getElementsByTagName("input")[1];
histForm.removeChild(finalButton);
histForm.removeChild(firstButton);
var compareLink=document.createElement("a");
var genLink="http://en.wikipedia.org/w/index.php?title=" + histForm.title.value + "&diff=" + histForm.diff[0].value + "&oldid=" + histForm.oldid[1].value;
compareLink.setAttribute("href", genLink);
compareLink.appendChild(document.createTextNode("Compare selected versions"));
histForm.insertBefore(compareLink, document.getElementById("pagehistory"));
var endLink=compareLink.cloneNode(true);
histForm.appendChild(endLink);
var diffList=document.getElementById("pagehistory");
diffList.setAttribute("onchange", "updateCompare()");
}
function updateCompare()
{
var histForm=document.getElementsByTagName("form")[0];
var diffList=document.getElementById("pagehistory");
var compareLink=diffList.previousSibling;
var endLink=diffList.nextSibling;
var oldInd=-1;
var i=0;
while(oldInd==-1 & i<histForm.oldid.length)
{
if(histForm.oldid[i].checked)
oldInd=i;
i++;
}
var diffInd=-1;
var j=0;
while(diffInd==-1 & j<histForm.diff.length)
{
if(histForm.diff[j].checked)
diffInd=j;
j++;
}
var genLink="http://en.wikipedia.org/w/index.php?title=" + histForm.title.value + "&diff=" + histForm.diff[diffInd].value + "&oldid=" + histForm.oldid[oldInd].value;
compareLink.setAttribute("href", genLink);
endLink.setAttribute("href", genLink);
}
if(document.title.search("- History -") != -1)
addOnloadHook(fixCompare);
//
// Script from [[User:Cacycle/diff.js]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/diff.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');