MediaWiki:Common.js

E Vicipaedia

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */

 // ==========
 // conditional import of [[MediaWiki:Onlyifediting.js]] BEGIN
 // adapted from [[:de:MediaWiki:Monobook.js]]
 
 if (document.URL.indexOf("action=edit") > 0 || document.URL.indexOf("action=submit") > 0) {
   importScript('MediaWiki:Onlyifediting.js');
 }
 
 // conditional import of [[MediaWiki:Onlyifediting.js]] END
 // ==========

 // ==========
 // Results from Wikidata
 // [[File:Wdsearch_script_screenshot.png]]
 if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ||  ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgCanonicalSpecialPageName' ) === false ) ) {
   mw.loader.load("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");
 }
 // Results from Wikidata END
 // ==========