MediaWiki:Common.js
From BetaArchive Wiki
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. */ /* for WikiEd */ (function () { var script = document.createElement('script'); script.src = '//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js&action=raw&ctype=text/javascript'; script.async = true; document.getElementsByTagName('head')[0].appendChild(script); } ) (); /* For mass rollback */ (function () { var script = document.createElement('script'); script.src = '//en.wikipedia.org/w/index.php?title=User:Writ_Keeper/Scripts/massRollback.js&action=raw&ctype=text/javascript'; script.async = true; document.getElementsByTagName('head')[0].appendChild(script); } ) (); /* For purge option on tab */ $.when(mw.loader.using(['mediawiki.util', 'mediawiki.api', 'mediawiki.notify']), $.ready).then(function () { if ( $( '#ca-purge' ).length || mw.config.get( 'wgNamespaceNumber' ) < 0 ) return; var node = mw.util.addPortletLink( 'p-cactions', mw.util.getUrl( null, { action: 'purge' } ), 'Purge', 'ca-purge', 'Purge the server cache of this page' ); $(node).on( 'click', function (e) { new mw.Api().post( { action: 'purge', titles: mw.config.get( 'wgPageName' ) } ).then(function () { location.reload(); }, function () { mw.notify( 'Purge failed', { type: 'error' } ); }); e.preventDefault(); }); });