User:James Crippen/monobook.js

//

// Script from User:MarkS/extraeditbuttons.js document.write(' ');

// Script from User:Misza13/Scripts/View source $(function {  if (location.href.indexOf('viewsource=1') != -1) {    sl = document.getElementById('wpSummaryLabel'); sl.parentNode.removeChild(sl);    ed = document.getElementById('wpSummary').parentNode; ed.parentNode.removeChild(ed);    return;  }  editbutton = document.getElementById('ca-edit');  if (editbutton && location.href.indexOf('action=edit')==-1) {    editlink = editbutton.getElementsByTagName('a')[0].href + '&viewsource=1';    tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];    na = document.createElement('a');    na.href = editlink; na.appendChild(document.createTextNode('view source'));    li = document.createElement('li'); li.id = 'ca-viewsource'; li.appendChild(na);    tabs.insertBefore(li,editbutton);  } });

//This code will change ISBN links to point to the url of your choice, //instead of Special:Book_sources. function externISBN { var magicURL = "http://www.amazon.com/exec/obidos/ASIN/MAGICNUMBER/wikipedia08-20"; var magicRegex = /MAGICNUMBER/ig; if(wgPageName != "Special:Booksources" && wgPageName != "Wikipedia:Book_sources") {   for (var i = 0; i < document.links.length; i++) {            if(document.links[i].href.match(/isbn=(.*)/)) {         document.links[i].href=magicURL.replace(magicRegex, RegExp.$1); }   }  } }

$(externISBN);

//