User:Mythealias/monobook.js

From Wikipedia, the free encyclopedia
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.
//-----------------------------------------------------------------------------------------
// This piece of code was copied from Lunchboxhero's javascript page
// [http://en.wikipedia.org/wiki/User:Lunchboxhero/monobook.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:<your username>/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++) 
    {       
        if( document.links[i].href.match(/isbn=(.*)/) ) {
          document.links[i].href='https://gil.gatech.edu/cgi-bin/Pwebrecon.cgi?Search_Arg='+RegExp.$1+'&HIST=1&SL=None&Search_Code=ISBN&CNT=25&HIST=1';
        }
    }

}

addOnloadHook(externISBN);

//---------------------------------------------------------------------------------------


//---------------------------------------------------------------------------------------
// disabling Wikipedia access keys/keyboard shortcuts
// refer to [[Wikipedia:Keyboard shortcuts|Keyboard shortcuts]] and [http://meta.wikimedia.org/w/index.php?title=-&action=raw&gen=js]
ta['ca-delete'] = new Array('','Delete this page');
ta['ca-protect'] = new Array('=','Protect this page');
ta['ca-move'] = new Array('m','Move this page');

// changing the access keys.
ta['ca-addsection'] = new Array('=','Add a comment to this discussion.');   // '+' -> '='
//---------------------------------------------------------------------------------------


//---------------------------------------------------------------------------------------
// See [http://en.wikipedia.org/wiki/Wikipedia:Tools/Navigation_popups for details].
// [[User:Lupin/popups.js]]
 
importScript('User:Lupin/popups.js');
 
 
// simplePopups=true;            // Just load the links, no preview of the article.
// popupFixRedirs=true;          // Option to fix redirects. Not recommended.
popupSubpopups=false;         // No popup links during preview.
popupMaxWidth=500;            // Max width (default 350).
popupRevertSummary='Reverted edits by [[User:## |]] ([[User Talk:## |talk]]) to last version by [[User:## |]] using [[Wikipedia:Tools/Navigation popups|popups]]';
popupRevertSummaryPrompt=true;
 
//---------------------------------------------------------------------------------------


//---------------------------------------------------------------------------------------
// to install [[User:Cacycle/wikEd]] in-browser text editor
//document.write('<script type="text/javascript" src="'
//+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
//+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//
//---------------------------------------------------------------------------------------