:User:Palfrey/standard.js

//This code will change ISBN links to point to the url of your choice,

//instead of Special:Book_sources.

//

//How to use it:

//

//First, you must copy this code to your user javascript page. This is

//at User:/monobook.js . My username is Lunchboxhero so

//my javascript page is User:Lunchboxhero/monobook.js . You must be logged

//in to edit your javascript page.

//

//Once you have copied the code and saved the page, you need to refresh your

//browser's cache. For Mozilla/Safari/Konqueror: hold down Shift while clicking

//Reload (or press Ctrl-Shift-R), IE: press Ctrl-F5, Opera: press F5.

//

//The code should now work, as long as you are logged in.

//

//You can change the destination url by simply modifying the quoted url that

//follows document.links[i].href=

//

//Good luck, and if you have any questions, leave me a comment on the discussion

//page of User:Lunchboxhero/monobook.js .

//

//(Every line that starts with "//" is a comment and can be discarded.)

function externISBN() {

for (var i = 0; i < document.links.length; i++)

{

var ln = document.links[i].href.match(/isbn=(.*)/);

if (ln) {

document.links[i].href='http://www.amazon.co.uk/exec/obidos/ASIN/'+RegExp.$1;

}

}

}

addOnloadHook(externISBN);

//A clock that autoupdates

//From the user scripts project

addOnloadHook(loadclock)

function loadclock()

{

//monobook

if (document.getElementById('pt-userpage'))

{

var toplinks = document.getElementById('p-personal').getElementsByTagName('ul')[0];

addlilink(toplinks, '/w/index.php?title=' + wgPageName.replace(/&/g,'%26') + '&action=purge', '', 'utcdate');

}

//cologneblue

else if (document.getElementById('quickbar'))

{

var toplinks = document.getElementById('quickbar');

addquickbarlink('/w/index.php?title=' + wgPageName.replace(/&/g,'%26') + '&action=purge', 'Current time', 'utcdate','Browse')

}

showtime();

}

function showtime()

{

var timerID;

var now = new Date();

var timeValue = now.toUTCString().substring(0,22) + " UTC";

if (document.getElementById('utcdate'))

{document.getElementById('utcdate').firstChild.innerHTML = timeValue;}

timerID = setTimeout('showtime()', 1000);

}