Jump to content

User:Esprit15d/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.
    //Detect IE5.5+
               if (navigator.appVersion.indexOf("MSIE")==-1)
               {
                   // var magicURL = "http://www.amazon.com/gp/search?ie=UTF8&field-isbn=MAGICNUMBER&tag=wikipedia08-20";
importScript('User:Lunchboxhero/externISBN.js');
function externISBN() {
  for (var i = 0; i < document.links.length; i++) 
    {       
        if( document.links[i].href.match(/isbn=(.*)/) ) {
          document.links[i].href='http://www.amazon.com/exec/obidos/ASIN/'+RegExp.$1;
        }
    }

}

$(externISBN);
importScript('User:Galobtter/Shortdesc helper.js'); // [[User:Galobtter/Shortdesc helper]]

// {{commons ok}} tagger
function commonsOK() {
  if (document.editform) {
    document.editform.wpTextbox1.value += "\n{{commons ok}}";
    document.editform.wpSummary.value = "{{[[Template:commons ok|commons ok]]}}";
    document.editform.submit();
  } else
    document.location = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + mw.config.get('wgPageName') + "&action=edit&commonsOK=1";
}
function addCommonsOK(){
  if (mw.config.get('wgCanonicalNamespace') == "Image")
    mw.util.addPortletLink("p-cactions", "javascript:commonsOK()", "{{commons ok}}", "");
  if (document.location.href.indexOf("commonsOK=1") > 0)
    commonsOK();
}
$(addCommonsOK);

// [[User:Krimpet/CH2.js]]