mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-15 02:13:49 +00:00
534bca9e5f
Lazy loading images is now untangled from the Skin code so there is no reason to call this anymore. Lazy loading image is a MobileFrontend responsibility not a Minerva. Minerva doesn't need to know anything about it. Bug: T246838 Depends-On: Ibeee7cae4b85ba888d0fecccdeec232ddd4cde0f Change-Id: I4c4ef896b81ee494637a64d1087faa62a6f7c589
38 lines
1 KiB
JavaScript
38 lines
1 KiB
JavaScript
// FIXME: make this an object with a constructor to facilitate testing
|
|
// (see https://bugzilla.wikimedia.org/show_bug.cgi?id=44264)
|
|
/**
|
|
* mobileFrontend namespace
|
|
* @class mw.mobileFrontend
|
|
* @singleton
|
|
*/
|
|
module.exports = function () {
|
|
var 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).
|
|
|
|
var redirectedFrom, $msg, title;
|
|
|
|
if ( wgRedirectedFrom === null ) {
|
|
return;
|
|
}
|
|
|
|
redirectedFrom = mw.Title.newFromText( wgRedirectedFrom );
|
|
|
|
if ( redirectedFrom ) {
|
|
// mw.Title.getPrefixedText includes the human-readable namespace prefix.
|
|
title = redirectedFrom.getPrefixedText();
|
|
$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' ) ) );
|
|
/* eslint-enable no-console */
|
|
};
|