mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-13 17:37:07 +00:00
effd4fe133
Change-Id: I67acf88e1b8de55054248d7cf8ca622d5772ea6f
29 lines
805 B
JavaScript
29 lines
805 B
JavaScript
module.exports = function () {
|
|
const menus = require( './menu.js' );
|
|
|
|
// setup main menu
|
|
menus.init();
|
|
|
|
( function ( wgRedirectedFrom ) {
|
|
// If the user has been redirected, then show them a toast message (see
|
|
// https://phabricator.wikimedia.org/T146596).
|
|
|
|
if ( wgRedirectedFrom === null ) {
|
|
return;
|
|
}
|
|
|
|
const redirectedFrom = mw.Title.newFromText( wgRedirectedFrom );
|
|
|
|
if ( redirectedFrom ) {
|
|
// mw.Title.getPrefixedText includes the human-readable namespace prefix.
|
|
const title = redirectedFrom.getPrefixedText();
|
|
const $msg = $( '<div>' ).html(
|
|
mw.message( 'mobile-frontend-redirected-from', title ).parse()
|
|
);
|
|
$msg.find( 'a' ).attr( 'href', mw.util.getUrl( title, { redirect: 'no' } ) );
|
|
mw.notify( $msg );
|
|
}
|
|
}( mw.config.get( 'wgRedirectedFrom' ) ) );
|
|
|
|
};
|