Jump to content

User:Mom2jandk/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.
// <nowiki>
// [[User:Lupin/popups.js]]

importScript('User:Lupin/popups.js');

// [[User:Outriggr/metadatatest.js]]      
 importScript('User:Outriggr/metadatatest.js');
 assessmentMyTemplateCode = ["{{"+"numismaticnotice|class=|importance=}}"];

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);

// [http://en.wikipedia.org/w/index.php?title=User:Until%281_%3D%3D_2%29/monobook.js&oldid=146047045]
function diff_only_buttons()
  {
  handle_diff('differences-prevlink');
  handle_diff('differences-nextlink');
 
  function handle_diff(diff_id)
    {
    var link = document.getElementById(diff_id);
    if (link == null)
      {
      return false;
      }
    var diff_only = document.createElement('a');
    diff_only.id = diff_id;
    diff_only.href = link.href + '&diffonly=1';
    diff_only.appendChild(document.createTextNode(' - (Diff only)'));
    link.parentNode.appendChild(diff_only);
    return true;
    }
  }
addOnloadHook(diff_only_buttons)
// </nowiki>