Jump to content

User:Mcmillin24/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.
importScript('User:AndyZ/peerreviewer.js'); //[[User:AndyZ/peerreviewer.js]]
importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool
showInstaview_PR=true;
instaview_PR=true;
cat_PR=true;
importScript('Wikipedia:AutoEd/complete.js');
importScript('User:Symplectic_Map/spell.js');

// [[User:Lupin/popups.js]] - please include this line 

mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');

//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
  mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }

// Admin-like RC Patrol tools

mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:VoA/monobook.js' 
             + '&action=raw&ctype=text/javascript');
// ARV

function inc (file) {
  mw.loader.load('/w/index.php?title='+file+'&action=raw&ctype=text/javascript&dontcountme=s');
}
inc("User:Lightdarkness/aiv.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.  Go to [[Wikipedia:Book sources]] and copy 
//the URL of the site you want to use (right-click the link, then click "Copy Link 
//Location", "Copy Target", or similar).  Put the new URL between the quotes next 
//to magicURL, in place of the URL now there.
//
//The current magicURL includes Wikipedia's Amazon Referral reference. That means if you click on 
//the ISBN link, go to Amazon and end up buying the book, Wikipedia will earn some small amount
//of money from that sale.  If you don't want to support Wikipedia in this way, but do want ISBNs
//to link to Amazon, replace the current magicURL with "http://www.amazon.com/exec/obidos/ASIN/MAGICNUMBER"
//
//Good luck, and if you have any questions, leave a comment on the discussion
//page of User:Lunchboxhero/monobook.js . Thanks to Superm401 and drrngravy for their
//improvements.
//
//(Every line that starts with "//" is a comment and can be discarded.)
 
function externISBN() {
 
  var magicURL = "http://library.lib.asu.edu/search/i?SEARCH=MAGICNUMBER";
 
  var magicRegex = /MAGICNUMBER/ig;
  if(mw.config.get('wgPageName') != "Special:Booksources" && mw.config.get('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);
      }
    }
  }
 
}
 
$(externISBN);

document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Csewiki/monobook.js&action=raw&ctype=text/javascript&dontcountme=s"><\/script>');
document.write('<link rel="stylesheet" type="text/css" href="http://en.wikipedia.org/w/index.php?title=User:Csewiki/monobook.css&action=raw&ctype=text/css&dontcountme=s"><\/link>');