2019-07-02 21:10:10 +00:00
|
|
|
module.exports = function () {
|
2024-03-24 20:53:43 +00:00
|
|
|
const menus = require( './menu.js' );
|
2017-09-07 17:27:30 +00:00
|
|
|
|
2019-10-04 15:05:37 +00:00
|
|
|
// setup main menu
|
|
|
|
menus.init();
|
2017-09-07 17:27:30 +00:00
|
|
|
|
2017-07-12 15:12:40 +00:00
|
|
|
( function ( wgRedirectedFrom ) {
|
|
|
|
// If the user has been redirected, then show them a toast message (see
|
|
|
|
// https://phabricator.wikimedia.org/T146596).
|
|
|
|
|
|
|
|
if ( wgRedirectedFrom === null ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-03-24 20:53:43 +00:00
|
|
|
const redirectedFrom = mw.Title.newFromText( wgRedirectedFrom );
|
2017-07-12 15:12:40 +00:00
|
|
|
|
|
|
|
if ( redirectedFrom ) {
|
|
|
|
// mw.Title.getPrefixedText includes the human-readable namespace prefix.
|
2024-03-24 20:53:43 +00:00
|
|
|
const title = redirectedFrom.getPrefixedText();
|
|
|
|
const $msg = $( '<div>' ).html(
|
2019-07-31 23:28:27 +00:00
|
|
|
mw.message( 'mobile-frontend-redirected-from', title ).parse()
|
|
|
|
);
|
|
|
|
$msg.find( 'a' ).attr( 'href', mw.util.getUrl( title, { redirect: 'no' } ) );
|
|
|
|
mw.notify( $msg );
|
2017-07-12 15:12:40 +00:00
|
|
|
}
|
|
|
|
}( mw.config.get( 'wgRedirectedFrom' ) ) );
|
2024-01-24 22:02:12 +00:00
|
|
|
|
2019-07-02 21:10:10 +00:00
|
|
|
};
|