User:Franamax/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:Franamax/monobook.css. |
//shortcut.add("Ctrl+Shift+U",function() {
// alert("HEllo");
//});
//importScript('User:Lupin/popups.js');
//this function bolds and fuchsia-izes large positive additions to the watchlist
function bold_pos_watchlist() {
if (wgPageName != "Special:Watchlist") return;
var spanlist = document.getElementsByTagName("span");
for (x=0;x<spanlist.length;++x) {
elt = spanlist[x];
if (elt.className != "mw-plusminus-pos") continue;
if (elt.innerHTML.indexOf(",") < 0) continue;
elt.style.fontWeight = "bold";
elt.style.color = "fuchsia";
}
}
addOnloadHook(bold_pos_watchlist);
// end of watchlist bolding function
function externISBN() {
var magicURL = "http://www.amazon.co.uk/exec/obidos/ASIN/MAGICNUMBER/";
var magicRegex = /MAGICNUMBER/ig;
if(wgPageName != "Special:BookSources" && !(wgTitle == "Book sources" && wgCanonicalNamespace == "Project")){
for (var i = 0; i < document.links.length; i++) {
if( document.links[i].href.match(/Special:BookSources\/(.*)/) ) {
document.links[i].href=magicURL.replace(magicRegex, RegExp.$1);
}
}
}
}
//addOnloadHook(externISBN);