Jump to content

User:Chris Chittleborough/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Chris Chittleborough (talk | contribs) at 13:35, 16 November 2006 (temp). 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.
 //Interiot's javascript edit counter; only active on visits to [[User:Interiot/Tool2/code.js]]
 if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
   document.write('<script type="text/javascript" src='+
    '"/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript&dontcountme=s"'+
    '></script>');
 }

 // Rewrite "ISBN xxx" links. Based on [[User:Lunchboxhero/monobook.js]].
 function Rewrite_ISBNs() {
   for (var i = 0; i < document.links.length; i++) {       
     if ( document.links[i].href.match(
               /^http:\/\/en\.wikipedia\.org\/w\/index\.php\?title=Special:Booksources&isbn=(.*)/ )
           && RegExp.$1 != '«»' )
     {
       document.links[i].href = '/wiki/User:Chris_Chittleborough/Sandbox#'+RegExp.$1;
     }
   }
 }
 addOnloadHook(Rewrite_ISBNs);
 if (document.title.substring(0,32) == 'User:Chris Chittleborough/Sandbox') {
    document.writeln('<script type="text/javascript" src='+
      '"/w/index.php?title=User:CWC/ISBNs.js&action=raw&ctype=text/javascript&dontcountme=s"'+
    '></script>');
 }