User:Eloquence/monobook.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Firefox/Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.
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); } } } } function global_append_tab(url, name, id) { var na = document.createElement('a'); na.setAttribute('href', url); var txt = document.createTextNode(name); na.appendChild(txt); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); // Grab the element we want to append the tab and append the tab to it. var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0]; tabs.appendChild(li); } function add_britannica_tab() { var title=wgPageName; if(wgNamespaceNumber==0) { global_append_tab('http://school.eb.com/search?query='+title+'&ct=eb','in britannica','eb-search'); } } addOnloadHook(externISBN); addOnloadHook(add_britannica_tab); var wikEdFrameCSS = []; wikEdFrameCSS['.wikEdLinkName'] = 'color: #000066; font-weight: bold;'; wikEdFrameCSS['.wikEdHeading'] = 'background-color: #e0e0e0; font-weight: bold;font-size:120%'; // [[User:Zocky/PicturePopups.js]] document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/w/index.php?title=User:Zocky/PicturePopups.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');