Jump to content

User:Franamax/monobook.js

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Franamax (talk | contribs) at 00:55, 8 October 2008 (test). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//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);