| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
const ms = require( 'mobile.startup' ); |
| 8 |
const reportIfNightModeWasDisabledOnPage = require( './reportIfNightModeWasDisabledOnPage.js' ); |
| 9 |
const addPortletLink = require( './addPortletLink.js' ); |
| 10 |
const teleportTarget = require( 'mediawiki.page.ready' ).teleportTarget; |
| 11 |
|
| 12 |
function init() { |
| 13 |
const permissions = mw.config.get( 'wgMinervaPermissions' ) || {}; |
| 14 |
|
| 15 |
const $watch = $( '#page-actions-watch' ); |
| 16 |
|
| 17 |
if ( permissions.watch ) { |
| 18 |
require( './watchstar.js' ).init( $watch ); |
| 19 |
} |
| 20 |
|
| 21 |
addPortletLink.init(); |
| 22 |
mw.hook( 'util.addPortletLink' ).add( |
| 23 |
addPortletLink.hookHandler |
| 24 |
); |
| 25 |
|
| 26 |
|
| 27 |
if ( ms && !ms.stub ) { |
| 28 |
require( './initMobile.js' )(); |
| 29 |
} else { |
| 30 |
|
| 31 |
|
| 32 |
require( './searchSuggestReveal.js' )(); |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
if ( navigator.userAgent.match( /OS 14_[0-9]/ ) ) { |
| 39 |
document.body.classList.add( 'hotfix-T264376' ); |
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
teleportTarget.classList.add( 'content' ); |
| 44 |
reportIfNightModeWasDisabledOnPage( |
| 45 |
document.documentElement, mw.user.options, mw.user.isNamed() |
| 46 |
); |
| 47 |
} |
| 48 |
|
| 49 |
if ( !window.QUnit ) { |
| 50 |
init(); |
| 51 |
} |
| 52 |
|
| 53 |
module.exports = { |
| 54 |
|
| 55 |
VERSION: 1 |
| 56 |
}; |