MediaWiki:Minerva.js

From Arcana Novum Wiki
Jump to navigation Jump to search

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)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* Arcana Novum Wiki - JavaScript for the mobile skin (Minerva) only.
 *
 * Logged-out visitors cannot edit here. On a phone, an ?action=edit link
 * (e.g. "expanding it" in {{Stub}}) opens MobileFrontend's "The editor will
 * now load..." page, and because the visitor has no edit rights the editor
 * never loads and the page stays stuck. MobileFrontend 1.43 does not check
 * edit rights there, so send those visitors back to the article with the
 * editor route, where MobileFrontend shows its "log in to edit" prompt.
 */
if ( mw.config.get( 'wgAction' ) === 'edit' && !mw.config.get( 'wgIsProbablyEditable' ) ) {
	mw.loader.using( 'mediawiki.util' ).then( function () {
		location.replace( mw.util.getUrl( mw.config.get( 'wgPageName' ) ) + '#/editor/all' );
	} );
}