Debian Codegraph @

skins/MinervaNeue/resources/skins.minerva.scripts/preInit.js

raw symbols SCIP
1 module.exports = function () {
2 const menus = require( './menu.js' );
3
4 // setup main menu
5 menus.init();
6
7 ( function ( wgRedirectedFrom ) {
8 // If the user has been redirected, then show them a toast message (see
9 // https://phabricator.wikimedia.org/T146596).
10
11 if ( wgRedirectedFrom === null ) {
12 return;
13 }
14
15 const redirectedFrom = mw.Title.newFromText( wgRedirectedFrom );
16
17 if ( redirectedFrom ) {
18 // mw.Title.getPrefixedText includes the human-readable namespace prefix.
19 const title = redirectedFrom.getPrefixedText();
20 const $msg = $( '<div>' ).html(
21 mw.message( 'mobile-frontend-redirected-from', title ).parse()
22 );
23 $msg.find( 'a' ).attr( 'href', mw.util.getUrl( title, { redirect: 'no' } ) );
24 mw.notify( $msg );
25 }
26 }( mw.config.get( 'wgRedirectedFrom' ) ) );
27
28 };