Jump to content

User:David Göthberg/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.
/* A JavaScript file loaded from my local web server for testing. */
mw.loader.load( 'http://localhost:8080/wikipediatest.js' );



// Add some links in the toolbox menu on the left side of the page.
$( function() {

  // Add "Secure server view" or "Normal server view" link.
  if( wgServer == "http://en.wikipedia.org" ) {
    mw.util.addPortletLink( "p-tb", 
      "https://secure.wikimedia.org/wikipedia/en/wiki/" + wgPageName, 
      "Secure server view", "pt-securepage", "Secure server view" );
  }
  else if( wgServer == "https://secure.wikimedia.org" ) {
    mw.util.addPortletLink( "p-tb", 
      "http://en.wikipedia.org/wiki/" + wgPageName, 
      "Normal server view", "pt-securepage", "Normal server view" );
  }

} );