Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 1x 5x 4x 1x 1x 1x 1x 1x 1x 1x | /* global $ */ const Page = require( './Page' ); let page; /** * Constructs an incomplete Page model singleton representing the currently loaded page. * * Because this depends on the presence of certain DOM elements, it * should only be called after the DOMContentLoaded event. * * @ignore * @return {Page} */ function loadCurrentPage() { if ( page ) { return page; } const permissions = [].concat( mw.config.get( 'wgRestrictionEdit', [] ) ), relevantTitle = mw.Title.newFromText( mw.config.get( 'wgRelevantPageName' ) ), title = mw.Title.newFromText( mw.config.get( 'wgPageName' ) ); Iif ( permissions.length === 0 ) { permissions.push( '*' ); } page = new Page( { title: title.getPrefixedText(), titleObj: title, relevantTitle: relevantTitle.getPrefixedText(), protection: { edit: permissions }, revId: mw.config.get( 'wgRevisionId' ), isMainPage: mw.config.get( 'wgIsMainPage' ), isWatched: $( '#ca-watch' ).hasClass( 'watched' ), isMissing: mw.config.get( 'wgArticleId' ) === 0, id: mw.config.get( 'wgArticleId' ), namespaceNumber: mw.config.get( 'wgNamespaceNumber' ) } ); return page; } module.exports = loadCurrentPage; |