:User:Howardjp/monobook.js

// User:Lupin/popups.js

mw.loader.load(

'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'

+ '&action=raw&ctype=text/javascript&dontcountme=s');

//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.com/exec/obidos/ASIN/'+RegExp.$1;

}

}

}

addOnloadHook(externISBN);

// Add a "Kate" link to your monobook "personal menu" list at the very

// top of the page.

//

// Indicate where you would like "Kate" to appear:

// pt-userpage, pt-mytalk, pt-preferences,

// pt-watchlist, pt-mycontris, pt-logout

//

gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout"

//

function KateLink()

{

var user = document.getElementById( 'pt-userpage' ).firstChild.firstChild.data;

var li = document.createElement( 'li' );

li.id = 'pt-kate';

var a = document.createElement( 'a' );

a.appendChild( document.createTextNode( 'Kate' ) ); // eh, the css makes the text lowercase

a.href = 'http://tools.wikimedia.de/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + user;

li.appendChild( a );

if ( ! gsKateInsertBefore ) // append to end (right) of list

{ document.getElementById( 'pt-logout' ).parentNode.appendChild( li );

}

else

{ var before = document.getElementById( gsKateInsertBefore );

before.appendChild( li, before );

}

}

if ( window.addEventListener ) window.addEventListener( 'load', KateLink, false );

else if ( window.attachEvent ) window.attachEvent ( 'onload', KateLink );