wikimedia/mediawiki-extensions-MobileFrontend

View on GitHub
resources/dist/mobile.editor.overlay.js.map.json

Summary

Maintainability
Test Coverage
{"version":3,"file":"mobile.editor.overlay.js","mappings":"qJAAa,SAAAA,EAAAC,GAAA,OAAAD,EAAA,mBAAAE,QAAA,iBAAAA,OAAAC,SAAA,SAAAF,GAAA,cAAAA,CAAA,WAAAA,GAAA,OAAAA,GAAA,mBAAAC,QAAAD,EAAAG,cAAAF,QAAAD,IAAAC,OAAAG,UAAA,gBAAAJ,CAAA,EAAAD,EAAAC,EAAA,UAAAK,EAAAC,EAAAC,GAAA,QAAAC,EAAA,EAAAA,EAAAD,EAAAE,OAAAD,IAAA,KAAAR,EAAAO,EAAAC,GAAAR,EAAAU,WAAAV,EAAAU,aAAA,EAAAV,EAAAW,cAAA,YAAAX,IAAAA,EAAAY,UAAA,GAAAC,OAAAC,eAAAR,EAAAS,EAAAf,EAAAgB,KAAAhB,EAAA,WAAAe,EAAAP,GAAA,IAAAS,EAAA,SAAAT,GAAA,aAAAT,EAAAS,KAAAA,EAAA,OAAAA,EAAA,IAAAF,EAAAE,EAAAP,OAAAiB,aAAA,YAAAZ,EAAA,KAAAW,EAAAX,EAAAa,KAAAX,EAAAD,UAAA,aAAAR,EAAAkB,GAAA,OAAAA,EAAA,UAAAG,UAAA,uDAAAC,OAAAb,EAAA,CAAAc,CAAAd,GAAA,gBAAAT,EAAAkB,GAAAA,EAAAA,EAAA,YAAAM,EAAAf,EAAAR,EAAAM,GAAA,OAAAN,EAAAwB,EAAAxB,GAAA,SAAAQ,EAAAF,GAAA,GAAAA,IAAA,UAAAP,EAAAO,IAAA,mBAAAA,GAAA,OAAAA,EAAA,YAAAA,EAAA,UAAAc,UAAA,4EAAAd,GAAA,YAAAA,EAAA,UAAAmB,eAAA,oEAAAnB,CAAA,CAAAoB,CAAAlB,EAAA,CAAAmB,CAAAnB,EAAAoB,IAAAC,QAAAC,UAAA9B,EAAAM,GAAA,GAAAkB,EAAAhB,GAAAL,a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jf,EAAQif,aAAe,IAAKnN,SAAS,SAAE1L,GAAO,OAAM7C,EAAK0b,YAAYrG,KACtE,IAAIhG,EAASxM,GAAW,IACzBrI,EAAKtB,KAAM+C,KAAMQ,EAClB,CAEAkI,EAAU0K,EAAS7U,EAAM,CACxB0D,SAAUxD,EAAKwD,SAAS,yEAWxBmI,SAAU,CACTlC,UAAMpF,EACNoB,KAAM,MAIRhC,EAAOC,QAAUiR,C","sources":["webpack://mfModules/./src/mobile.editor.overlay/BlockMessageDetails.js","webpack://mfModules/./src/mobile.editor.overlay/EditorGateway.js","webpack://mfModules/./src/mobile.editor.overlay/EditorOverlayBase.js","webpack://mfModules/./src/mobile.editor.overlay/SourceEditorOverlay.js","webpack://mfModules/./src/mobile.editor.overlay/VisualEditorOverlay.js","webpack://mfModules/./src/mobile.editor.overlay/blockMessageDrawer.js","webpack://mfModules/./src/mobile.editor.overlay/identifyLeadParagraph.js","webpack://mfModules/./src/mobile.editor.overlay/mobile.editor.overlay.js","webpack://mfModules/./src/mobile.editor.overlay/parseBlockInfo.js","webpack://mfModules/./src/mobile.editor.overlay/saveFailureMessage.js","webpack://mfModules/./src/mobile.editor.overlay/setPreferredEditor.js","webpack://mfModules/./src/mobile.startup/Section.js"],"sourcesContent":["'use strict';\nconst Button = require( '../mobile.startup/Button' ),\n\tView = require( '../mobile.startup/View' ),\n\tIcon = require( '../mobile.startup/Icon' ),\n\tutil = require( '../mobile.startup/util' );\n\n/**\n * Renders a block message details.\n *\n * @extends module:mobile.startup/View\n * @private\n */\nclass BlockMessageDetails extends View {\n\t/** @inheritdoc */\n\tget isTemplateMode() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tcreateDetailsAnchorHref: function () {\n\t\t\t\treturn function ( blockId, render ) {\n\t\t\t\t\treturn mw.util.getUrl( 'Special:BlockList', { wpTarget: '#' + render( blockId ) } );\n\t\t\t\t};\n\t\t\t},\n\t\t\tcreateDetailsAnchorLabel: function () {\n\t\t\t\treturn mw.msg( 'mobile-frontend-editor-blocked-drawer-help' );\n\t\t\t},\n\t\t\tcreateTitle: function () {\n\t\t\t\tlet msgKey = 'mobile-frontend-editor-blocked-drawer-title';\n\t\t\t\tif ( mw.user.isAnon() ) {\n\t\t\t\t\tmsgKey += '-ip';\n\t\t\t\t}\n\t\t\t\tif ( this.partial ) {\n\t\t\t\t\tmsgKey += '-partial';\n\t\t\t\t}\n\t\t\t\t// The following messages can be passed here:\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-title\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-title-partial\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-title-ip\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-title-ip-partial\n\t\t\t\treturn mw.msg( msgKey );\n\t\t\t},\n\t\t\tcreateBody: function () {\n\t\t\t\tlet msgKey = '';\n\t\t\t\tif ( mw.user.isAnon() && this.anonOnly ) {\n\t\t\t\t\tmsgKey = 'mobile-frontend-editor-blocked-drawer-body';\n\t\t\t\t\tif ( this.noCreateAccount ) {\n\t\t\t\t\t\tmsgKey += '-login';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsgKey += '-login-createaccount';\n\t\t\t\t\t}\n\t\t\t\t\tif ( this.partial ) {\n\t\t\t\t\t\tmsgKey += '-partial';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( this.partial ) {\n\t\t\t\t\t\tmsgKey = 'mobile-frontend-editor-blocked-drawer-body-partial';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// The following messages can be passed here:\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-partial\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-login\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-login-partial\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-login-createaccount\n\t\t\t\t// * mobile-frontend-editor-blocked-drawer-body-login-createaccount-partial\n\t\t\t\treturn msgKey ? mw.msg( msgKey ) : msgKey;\n\t\t\t},\n\t\t\tseeMoreLink: mw.msg( 'mobile-frontend-editor-blocked-drawer-body-link' ),\n\t\t\treasonHeader: mw.msg( 'mobile-frontend-editor-blocked-drawer-reason-header' ),\n\t\t\tcreatorHeader: function () {\n\t\t\t\t// The gender is the subject (the blockee) not the object (the blocker).\n\t\t\t\treturn mw.msg( 'mobile-frontend-editor-blocked-drawer-creator-header',\n\t\t\t\t\tmw.user.options.get( 'gender' ) );\n\t\t\t},\n\t\t\texpiryHeader: mw.msg( 'mobile-frontend-editor-blocked-drawer-expiry-header' )\n\t\t};\n\t}\n\n\t/**\n\t * Configure the call to action depending on the type of block.\n\t *\n\t * @return {Object} Configuration options\n\t */\n\tgetButtonConfig() {\n\t\tlet cta = true;\n\t\tconst config = {\n\t\t\t\tprogressive: true\n\t\t\t},\n\t\t\twiki = mw.config.get( 'wgDBname' );\n\n\t\tif ( mw.user.isAnon() && this.options.anonOnly ) {\n\t\t\t// The user can avoid the block by logging in\n\t\t\tconfig.label = mw.msg( 'mobile-frontend-editor-blocked-drawer-action-login' );\n\t\t\tconfig.href = new mw.Title( 'Special:UserLogin' ).getUrl();\n\t\t} else if ( this.options.partial ) {\n\t\t\t// The user can avoid the block by editing a different page\n\t\t\tconfig.label = mw.msg( 'mobile-frontend-editor-blocked-drawer-action-randompage' );\n\t\t\tconfig.href = new mw.Title( 'Special:Random' ).getUrl();\n\t\t\tconfig.quiet = true;\n\t\t} else {\n\t\t\t// The user cannot avoid the block\n\t\t\tconfig.tagName = 'button';\n\t\t\tconfig.label = mw.msg( 'mobile-frontend-editor-blocked-drawer-action-ok' );\n\t\t\tconfig.additionalClassNames = 'cancel';\n\t\t\tcta = false;\n\t\t}\n\n\t\tif ( cta && mw.config.get( 'wgMFTrackBlockNotices' ) ) {\n\t\t\tmw.track( 'counter.MediaWiki.BlockNotices.' + wiki + '.MobileFrontend.ctaShown', 1 );\n\t\t\tconfig.events = {\n\t\t\t\tclick: function () {\n\t\t\t\t\tmw.track( 'counter.MediaWiki.BlockNotices.' + wiki + '.MobileFrontend.ctaClicked', 1 );\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\treturn config;\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tpostRender() {\n\t\tconst drawer = this;\n\t\tthis.$el.find( '.block-message-buttons' ).prepend(\n\t\t\tnew Button( this.getButtonConfig() ).$el\n\t\t);\n\t\tthis.$el.find( '.block-message-icon' ).prepend(\n\t\t\t( new Icon( {\n\t\t\t\ticon: 'block-destructive'\n\t\t\t} ) ).$el\n\t\t);\n\t\tthis.options.parsedReason.then( function ( htmlReason ) {\n\t\t\tdrawer.$el.find( '.block-message-reason div' ).html( htmlReason );\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritdoc\n\t */\n\tget template() {\n\t\treturn util.template( `\n<div class=\"block-message block-message-container\">\n  <div class=\"block-message-icon\"></div>\n  <div class=\"block-message-info\">\n    <div class=\"block-message-item block-message-title\">\n      <h5>{{ createTitle }}</h5>\n    </div>\n    <div class=\"block-message-data\">\n      <div class=\"block-message-item\">\n        <p>\n          {{ createBody }}\n          <a class =\"block-message-see-more\" href=\"#\">{{ seeMoreLink }}</a>\n        </p>\n      </div>\n      <div class=\"block-message-item block-message-creator\">\n        {{#creator.name}}\n          <p>\n            {{ creatorHeader }}\n            <strong>\n              {{#creator.url}}\n                <a href=\"{{ creator.url }}\">{{ creator.name }}</a>\n              {{/creator.url}}\n              {{^creator.url}}\n                {{ creator.name }}\n              {{/creator.url}}\n            </strong>\n          </p>\n        {{/creator.name}}\n      </div>\n      {{#duration}}\n        <div class=\"block-message-item\">\n          <p>\n            {{ expiryHeader }}\n            <strong>{{ duration }}</strong>\n          </p>\n        </div>\n      {{/duration}}\n      {{#blockId}}\n        <div class=\"block-message-item\">\n          <a href=\"{{#createDetailsAnchorHref}}{{ blockId }}{{/createDetailsAnchorHref}}\">\n            {{ createDetailsAnchorLabel }}\n          </a>\n        </div>\n      {{/blockId}}\n    </div>\n  </div>\n  {{#reason}}\n    <div class=\"block-message-item block-message-reason\">\n      <h5>{{ reasonHeader }}</h5>\n      <div><p>{{{ reason }}}</p></div>\n    </div>\n  {{/reason}}\n  <div class=\"block-message-buttons\">\n  </div>\n</div>` );\n\t}\n}\n\nmodule.exports = BlockMessageDetails;\n","const util = require( '../mobile.startup/util' ),\n\tactionParams = require( '../mobile.startup/actionParams' );\n\n/**\n * API that helps save and retrieve page content\n *\n * @param {Object} options Configuration options\n * @param {mw.Api} options.api an Api to use.\n * @param {string} options.title the title to edit\n * @param {string|null} options.sectionId the id of the section to operate edits on.\n * @param {number} [options.oldId] revision to operate on. If absent defaults to latest.\n * @param {boolean} [options.fromModified] whether the page was loaded in a modified state\n * @param {string} [options.preload] the name of a page to preload into the editor\n * @param {Array} [options.preloadparams] parameters to prefill into the preload content\n * @param {string} [options.editintro] edit intro to add to notices\n * @private\n */\nfunction EditorGateway( options ) {\n\tthis.api = options.api;\n\tthis.title = options.title;\n\tthis.sectionId = options.sectionId;\n\tthis.oldId = options.oldId;\n\tthis.preload = options.preload;\n\tthis.preloadparams = options.preloadparams;\n\tthis.editintro = options.editintro;\n\tthis.content = undefined;\n\tthis.fromModified = options.fromModified;\n\tthis.hasChanged = options.fromModified;\n}\n\nEditorGateway.prototype = {\n\n\t/**\n\t * Get the block (if there is one) from the result.\n\t *\n\t * @memberof EditorGateway\n\t * @param {Object} pageObj Page object\n\t * @return {Object|null}\n\t */\n\tgetBlockInfo: function ( pageObj ) {\n\t\tlet blockedError;\n\n\t\tif ( pageObj.actions &&\n\t\t\tpageObj.actions.edit &&\n\t\t\tArray.isArray( pageObj.actions.edit )\n\t\t) {\n\t\t\tpageObj.actions.edit.some( function ( error ) {\n\t\t\t\tif ( [ 'blocked', 'autoblocked' ].indexOf( error.code ) !== -1 ) {\n\t\t\t\t\tblockedError = error;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} );\n\n\t\t\tif ( blockedError && blockedError.data && blockedError.data.blockinfo ) {\n\t\t\t\treturn blockedError.data.blockinfo;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\t/**\n\t * Get the content of a page.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t * @return {jQuery.Promise}\n\t */\n\tgetContent: function () {\n\t\tlet options;\n\n\t\tconst self = this;\n\n\t\tfunction resolve() {\n\t\t\treturn util.Deferred().resolve( {\n\t\t\t\ttext: self.content || '',\n\t\t\t\tblockinfo: self.blockinfo,\n\t\t\t\tnotices: self.notices\n\t\t\t} );\n\t\t}\n\n\t\tif ( this.content !== undefined ) {\n\t\t\treturn resolve();\n\t\t} else {\n\t\t\toptions = actionParams( {\n\t\t\t\tprop: [ 'revisions', 'info' ],\n\t\t\t\trvprop: [ 'content', 'timestamp' ],\n\t\t\t\tinprop: [ 'preloadcontent', 'editintro' ],\n\t\t\t\tinpreloadcustom: self.preload,\n\t\t\t\tinpreloadparams: self.preloadparams,\n\t\t\t\tineditintrocustom: self.editintro,\n\t\t\t\ttitles: self.title,\n\t\t\t\t// get block information for this user\n\t\t\t\tintestactions: 'edit',\n\t\t\t\t// …and test whether this edit will auto-create an account\n\t\t\t\tintestactionsautocreate: true,\n\t\t\t\tintestactionsdetail: 'full'\n\t\t\t} );\n\t\t\t// Load text of old revision if desired\n\t\t\tif ( this.oldId ) {\n\t\t\t\toptions.rvstartid = this.oldId;\n\t\t\t}\n\t\t\t// See T52136 - passing rvsection will fail with non wikitext\n\t\t\tif ( this.sectionId ) {\n\t\t\t\toptions.rvsection = this.sectionId;\n\t\t\t}\n\t\t\treturn this.api.get( options ).then( function ( resp ) {\n\t\t\t\tif ( resp.error ) {\n\t\t\t\t\treturn util.Deferred().reject( resp.error.code );\n\t\t\t\t}\n\n\t\t\t\tconst pageObj = resp.query.pages[0];\n\t\t\t\t// page might not exist and caller might not have known.\n\t\t\t\tif ( pageObj.missing !== undefined ) {\n\t\t\t\t\tif ( pageObj.preloadcontent ) {\n\t\t\t\t\t\tself.content = pageObj.preloadcontent.content;\n\t\t\t\t\t\tself.hasChanged = !pageObj.preloadisdefault;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.content = '';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst revision = pageObj.revisions[0];\n\t\t\t\t\tself.content = revision.content;\n\t\t\t\t\tself.timestamp = revision.timestamp;\n\t\t\t\t}\n\n\t\t\t\t// save content a second time to be able to check for changes\n\t\t\t\tself.originalContent = self.content;\n\t\t\t\tself.blockinfo = self.getBlockInfo( pageObj );\n\t\t\t\tself.wouldautocreate = pageObj.wouldautocreate && pageObj.wouldautocreate.edit;\n\t\t\t\tself.notices = pageObj.editintro;\n\n\t\t\t\treturn resolve();\n\t\t\t} );\n\t\t}\n\t},\n\n\t/**\n\t * Mark content as modified and set changes to be submitted when #save\n\t * is invoked.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t * @param {string} content New section content.\n\t */\n\tsetContent: function ( content ) {\n\t\tif ( this.originalContent !== content || this.fromModified ) {\n\t\t\tthis.hasChanged = true;\n\t\t} else {\n\t\t\tthis.hasChanged = false;\n\t\t}\n\t\tthis.content = content;\n\t},\n\n\t/**\n\t * Save the new content of the section, previously set using #setContent.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t * @param {Object} options Configuration options\n\t * @param {string} [options.summary] Optional summary for the edit.\n\t * @param {string} [options.captchaId] If CAPTCHA was requested, ID of the\n\t * captcha.\n\t * @param {string} [options.captchaWord] If CAPTCHA was requested, term\n\t * displayed in the CAPTCHA.\n\t * @return {jQuery.Deferred} On failure callback is passed an object with\n\t * `type` and `details` properties. `type` is a string describing the type\n\t * of error, `details` can be any object (usually error message).\n\t */\n\tsave: function ( options ) {\n\t\tconst self = this,\n\t\t\tresult = util.Deferred();\n\n\t\toptions = options || {};\n\n\t\t/**\n\t\t * Save content. Make an API request.\n\t\t *\n\t\t * @return {jQuery.Deferred}\n\t\t */\n\t\tfunction saveContent() {\n\t\t\tconst apiOptions = {\n\t\t\t\taction: 'edit',\n\t\t\t\terrorformat: 'html',\n\t\t\t\terrorlang: mw.config.get( 'wgUserLanguage' ),\n\t\t\t\terrorsuselocal: 1,\n\t\t\t\tformatversion: 2,\n\t\t\t\ttitle: self.title,\n\t\t\t\tsummary: options.summary,\n\t\t\t\tcaptchaid: options.captchaId,\n\t\t\t\tcaptchaword: options.captchaWord,\n\t\t\t\tbasetimestamp: self.timestamp,\n\t\t\t\tstarttimestamp: self.timestamp\n\t\t\t};\n\n\t\t\tif ( self.content !== undefined ) {\n\t\t\t\tapiOptions.text = self.content;\n\t\t\t}\n\n\t\t\tif ( self.sectionId ) {\n\t\t\t\tapiOptions.section = self.sectionId;\n\t\t\t}\n\n\t\t\t// TODO: When `wouldautocreate` is true, we should also set up:\n\t\t\t// - apiOptions.returntofragment to be the URL fragment to link to the section\n\t\t\t//   (but we don't know what it is; `sectionId` here is the number)\n\t\t\t// - apiOptions.returntoquery to be 'redirect=no' if we're saving a redirect\n\t\t\t//   (but we have can't figure that out, unless we parse the wikitext)\n\n\t\t\tself.api.postWithToken( 'csrf', apiOptions ).then( function ( data ) {\n\t\t\t\tif ( data && data.edit && data.edit.result === 'Success' ) {\n\t\t\t\t\tself.hasChanged = false;\n\t\t\t\t\tresult.resolve( data.edit.newrevid, data.edit.tempusercreatedredirect,\n\t\t\t\t\t\tdata.edit.tempusercreated );\n\t\t\t\t} else {\n\t\t\t\t\tresult.reject( data );\n\t\t\t\t}\n\t\t\t}, function ( code, data ) {\n\t\t\t\tresult.reject( data );\n\t\t\t} );\n\t\t\treturn result;\n\t\t}\n\n\t\treturn saveContent();\n\t},\n\n\t/**\n\t * Abort any pending previews.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t */\n\tabortPreview: function () {\n\t\tif ( this._pending ) {\n\t\t\tthis._pending.abort();\n\t\t}\n\t},\n\n\t/**\n\t * Get page preview from the API and abort any existing previews.\n\t *\n\t * @memberof EditorGateway\n\t * @instance\n\t * @param {Object} options API query parameters\n\t * @return {jQuery.Deferred}\n\t */\n\tgetPreview: function ( options ) {\n\t\tlet\n\t\t\tsectionLine = '',\n\t\t\tsectionId = '';\n\n\t\tconst self = this;\n\n\t\tutil.extend( options, {\n\t\t\taction: 'parse',\n\t\t\t// Enable section preview mode to avoid errors (T51218)\n\t\t\tsectionpreview: true,\n\t\t\t// Hide section edit links\n\t\t\tdisableeditsection: true,\n\t\t\t// needed for pre-save transform to work (T55692)\n\t\t\tpst: true,\n\t\t\t// Output mobile HTML (T56243)\n\t\t\tmobileformat: true,\n\t\t\tuseskin: mw.config.get( 'skin' ),\n\t\t\tdisabletoc: true,\n\t\t\ttitle: this.title,\n\t\t\tprop: [ 'text', 'sections' ]\n\t\t} );\n\n\t\tthis.abortPreview();\n\t\t// Acquire a temporary user username before previewing, so that signatures and\n\t\t// user-related magic words display the temp user instead of IP user in the\n\t\t// preview. (T331397)\n\t\tconst promise = mw.user.acquireTempUserName().then( function () {\n\t\t\tself._pending = self.api.post( options );\n\t\t\treturn self._pending;\n\t\t} );\n\n\t\treturn promise.then( function ( resp ) {\n\t\t\tif ( resp && resp.parse && resp.parse.text ) {\n\t\t\t\t// When editing section 0 or the whole page, there is no section name, so skip\n\t\t\t\tif ( self.sectionId && self.sectionId !== '0' &&\n\t\t\t\t\tresp.parse.sections !== undefined &&\n\t\t\t\t\tresp.parse.sections[0] !== undefined\n\t\t\t\t) {\n\t\t\t\t\tif ( resp.parse.sections[0].anchor !== undefined ) {\n\t\t\t\t\t\tsectionId = resp.parse.sections[0].anchor;\n\t\t\t\t\t}\n\t\t\t\t\tif ( resp.parse.sections[0].line !== undefined ) {\n\t\t\t\t\t\tsectionLine = resp.parse.sections[0].line;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttext: resp.parse.text['*'],\n\t\t\t\t\tid: sectionId,\n\t\t\t\t\tline: sectionLine\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn util.Deferred().reject();\n\t\t\t}\n\t\t} ).promise( {\n\t\t\tabort: function () {\n\t\t\t\tself._pending.abort();\n\t\t\t}\n\t\t} );\n\t}\n};\n\nmodule.exports = EditorGateway;\n","/* global $ */\n/**\n * @class EditorOverlayBase\n * @private\n */\nconst Overlay = require( '../mobile.startup/Overlay' ),\n\tutil = require( '../mobile.startup/util' ),\n\tparseBlockInfo = require( './parseBlockInfo' ),\n\theaders = require( '../mobile.startup/headers' ),\n\ticons = require( '../mobile.startup/icons' ),\n\tButton = require( '../mobile.startup/Button' ),\n\tIconButton = require( '../mobile.startup/IconButton' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' ),\n\tblockMessageDrawer = require( './blockMessageDrawer' ),\n\tMessageBox = require( '../mobile.startup/MessageBox' ),\n\tmwUser = mw.user;\n\n/**\n * 'Edit' button\n *\n * @param {OO.ui.ToolGroup} toolGroup\n * @param {Object} config\n * @private\n */\nfunction EditVeTool( toolGroup, config ) {\n\tconfig = config || {};\n\tconfig.classes = [ 'visual-editor' ];\n\tEditVeTool.super.call( this, toolGroup, config );\n}\nOO.inheritClass( EditVeTool, OO.ui.Tool );\n\nEditVeTool.static.name = 'editVe';\nEditVeTool.static.icon = 'edit';\nEditVeTool.static.group = 'editorSwitcher';\nEditVeTool.static.title = mw.msg( 'mobile-frontend-editor-switch-visual-editor' );\n/**\n * click handler\n *\n * @memberof EditVeTool\n * @instance\n */\nEditVeTool.prototype.onSelect = function () {\n\t// will be overridden later\n};\n/**\n * Toolbar update state handler.\n *\n * @memberof EditVeTool\n * @instance\n */\nEditVeTool.prototype.onUpdateState = function () {\n\t// do nothing\n};\n\n/**\n * Base class for SourceEditorOverlay and VisualEditorOverlay\n *\n * @class EditorOverlayBase\n * @private\n * @extends Overlay\n * @uses IconButton\n * @uses user\n * @param {Object} params Configuration options\n * @param {boolean} params.editSwitcher whether possible to switch mode in header\n * @param {boolean} params.hasToolbar whether the editor has a toolbar\n */\nfunction EditorOverlayBase( params ) {\n\tconst\n\t\toptions = util.extend(\n\t\t\ttrue,\n\t\t\t{\n\t\t\t\tonBeforeExit: this.onBeforeExit.bind( this ),\n\t\t\t\tclassName: 'overlay editor-overlay',\n\t\t\t\tisBorderBox: false\n\t\t\t},\n\t\t\tparams,\n\t\t\t{\n\t\t\t\tevents: util.extend(\n\t\t\t\t\t{\n\t\t\t\t\t\t'click .back': 'onClickBack',\n\t\t\t\t\t\t'click .continue': 'onClickContinue',\n\t\t\t\t\t\t'click .submit': 'onClickSubmit',\n\t\t\t\t\t\t'click .anonymous': 'onClickAnonymous'\n\t\t\t\t\t},\n\t\t\t\t\tparams.events\n\t\t\t\t)\n\t\t\t}\n\t\t);\n\n\tif ( options.isNewPage ) {\n\t\toptions.placeholder = mw.msg( 'mobile-frontend-editor-placeholder-new-page', mwUser );\n\t}\n\t// change the message to request a summary when not in article namespace\n\tif ( mw.config.get( 'wgNamespaceNumber' ) !== 0 ) {\n\t\toptions.summaryRequestMsg = mw.msg( 'mobile-frontend-editor-summary' );\n\t}\n\tthis.isNewPage = options.isNewPage;\n\tthis.sectionId = options.sectionId;\n\tthis.overlayManager = options.overlayManager;\n\n\tOverlay.call( this, options );\n}\n\nmfExtend( EditorOverlayBase, Overlay, {\n\t/**\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @mixes Overlay#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {OverlayManager} defaults.overlayManager instance\n\t * @property {mw.Api} defaults.api to interact with\n\t * @property {boolean} defaults.hasToolbar Whether the editor has a toolbar or not. When\n\t *  disabled a header will be show instead.\n\t * @property {string} defaults.continueMsg Caption for the next button on edit form\n\t * which takes you to the screen that shows a preview and license information.\n\t * @property {string} defaults.closeMsg Caption for a button that takes you back to editing\n\t * from edit preview screen.\n\t * @property {string} defaults.summaryRequestMsg Header above edit summary input field\n\t * asking the user to summarize the changes they made to the page.\n\t * @property {string} defaults.summaryMsg A placeholder with examples for the summary input\n\t * field asking user what they changed.\n\t * @property {string} defaults.placeholder Placeholder text for empty sections.\n\t * @property {string} defaults.captchaMsg Placeholder for captcha input field.\n\t * @property {string} defaults.captchaTryAgainMsg A message shown when user enters\n\t * wrong CAPTCHA and a new one is displayed.\n\t * @property {string} defaults.switchMsg Label for button that allows the user\n\t * to switch between two different editing interfaces.\n\t * @property {string} defaults.licenseMsg Text and link of the license,\n\t * under which this contribution will be released to inform the user.\n\t */\n\tdefaults: util.extend( {}, Overlay.prototype.defaults, {\n\t\thasToolbar: false,\n\t\tcontinueMsg: mw.msg( 'mobile-frontend-editor-continue' ),\n\t\tcloseMsg: mw.msg( 'mobile-frontend-editor-keep-editing' ),\n\t\tsummaryRequestMsg: mw.msg( 'mobile-frontend-editor-summary-request' ),\n\t\tsummaryMsg: mw.msg( 'mobile-frontend-editor-summary-placeholder' ),\n\t\tplaceholder: mw.msg( 'mobile-frontend-editor-placeholder' ),\n\t\tcaptchaMsg: mw.msg( 'mobile-frontend-account-create-captcha-placeholder' ),\n\t\tcaptchaTryAgainMsg: mw.msg( 'mobile-frontend-editor-captcha-try-again' ),\n\t\tswitchMsg: mw.msg( 'mobile-frontend-editor-switch-editor' ),\n\t\tconfirmMsg: mw.msg( 'mobile-frontend-editor-cancel-confirm' ),\n\t\tlicenseMsg: undefined\n\t} ),\n\t/**\n\t * @inheritdoc\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\ttemplate: util.template( `\n<div class=\"overlay-header-container header-container position-fixed\"></div>\n\n<div class=\"overlay-content\">\n\t<div class=\"panels\">\n\t\t<div class=\"save-panel panel hideable hidden\">\n\t\t\t<div id=\"error-notice-container\"></div>\n\t\t\t<h2 class=\"summary-request\">{{{summaryRequestMsg}}}</h2>\n\t\t\t<div class=\"summary-input\"></div>\n\t\t\t{{#licenseMsg}}<div class=\"license\">{{{licenseMsg}}}</div>{{/licenseMsg}}\n\t\t</div>\n\t\t<div class=\"captcha-panel panel hideable hidden\">\n\t\t\t<div class=\"captcha-box\">\n\t\t\t\t<img id=\"image\" src=\"\">\n\t\t\t\t<div id=\"question\"></div>\n\t\t\t\t<div class=\"cdx-text-input\">\n\t\t\t\t\t<input class=\"captcha-word cdx-text-input__input\" placeholder=\"{{captchaMsg}}\" />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t{{>content}}\n</div>\n<div class=\"overlay-footer-container position-fixed\">\n\t{{>footer}}\n</div>\n\t` ),\n\t/**\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tsectionId: '',\n\t/**\n\t * Logs an event to http://meta.wikimedia.org/wiki/Schema:EditAttemptStep\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} data\n\t */\n\tlog: function ( data ) {\n\t\tmw.track( 'editAttemptStep', util.extend( data, {\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\teditor_interface: this.editor\n\t\t} ) );\n\t},\n\t/**\n\t * Logs an event to http://meta.wikimedia.org/wiki/Schema:VisualEditorFeatureUse\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} data\n\t */\n\tlogFeatureUse: function ( data ) {\n\t\tmw.track( 'visualEditorFeatureUse', util.extend( data, {\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\teditor_interface: this.editor\n\t\t} ) );\n\t},\n\n\t/**\n\t * If this is a new article, require confirmation before saving.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @return {boolean} The user confirmed saving\n\t */\n\tconfirmSave: function () {\n\t\tif ( this.isNewPage &&\n\t\t\t// TODO: Replace with an OOUI dialog\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\t!window.confirm( mw.msg( 'mobile-frontend-editor-new-page-confirm', mwUser ) )\n\t\t) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t},\n\t/**\n\t * Executed when page save is complete. Updates urls and shows toast message.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {number|null} newRevId ID of the newly created revision, or null if it was a\n\t * null edit.\n\t * @param {string} [redirectUrl] URL to redirect to, if different than the current URL.\n\t * @param {boolean} [tempUserCreated] Whether a temporary user was created\n\t */\n\tonSaveComplete: function ( newRevId, redirectUrl, tempUserCreated ) {\n\t\tconst\n\t\t\tself = this;\n\n\t\tthis.saved = true;\n\n\t\tif ( newRevId ) {\n\t\t\tlet action;\n\t\t\tif ( self.isNewPage ) {\n\t\t\t\taction = 'created';\n\t\t\t} else if ( self.options.oldId ) {\n\t\t\t\taction = 'restored';\n\t\t\t} else {\n\t\t\t\taction = 'saved';\n\t\t\t}\n\t\t\tself.showSaveCompleteMsg( action, tempUserCreated );\n\t\t}\n\n\t\t// Ensure we don't lose this event when logging\n\t\tthis.log( {\n\t\t\taction: 'saveSuccess',\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\trevision_id: newRevId\n\t\t} );\n\t\tif ( tempUserCreated && redirectUrl ) {\n\t\t\t// The caller handles this redirect, either in SourceEditorOverlay or in VE's ArticleTarget\n\t\t\treturn;\n\t\t}\n\t\tsetTimeout( function () {\n\t\t\t// Wait for any other teardown navigation to happen (e.g. router.back())\n\t\t\t// before setting our final location.\n\t\t\tif ( redirectUrl ) {\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.href = redirectUrl;\n\t\t\t} else if ( self.sectionId ) {\n\t\t\t\t// Ideally we'd want to do this via replaceState (see T189173)\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.hash = '#' + self.sectionId;\n\t\t\t} else {\n\t\t\t\t// Cancel the hash fragment\n\t\t\t\t// otherwise clicking back after a save will take you back to the editor.\n\t\t\t\t// We avoid calling the hide method of the overlay here as this can be asynchronous\n\t\t\t\t// and may conflict with the window.reload call below.\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.hash = '#';\n\t\t\t}\n\t\t} );\n\t},\n\t/**\n\t * Show a save-complete message to the user\n\t *\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t * @param {string} action One of 'saved', 'created', 'restored'\n\t * @param {boolean} [tempUserCreated] Whether a temporary user was created\n\t */\n\tshowSaveCompleteMsg: function ( action, tempUserCreated ) {\n\t\t__non_webpack_require__( 'mediawiki.action.view.postEdit' ).fireHook( action, tempUserCreated );\n\t},\n\t/**\n\t * Executed when page save fails. Handles logging the error. Subclasses\n\t * should display error messages as appropriate.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} data API response\n\t */\n\tonSaveFailure: function ( data ) {\n\t\tlet code = data && data.errors && data.errors[0] && data.errors[0].code;\n\n\t\tconst\n\t\t\t// Compare to ve.init.mw.ArticleTargetEvents.js in VisualEditor.\n\t\t\ttypeMap = {\n\t\t\t\tbadtoken: 'userBadToken',\n\t\t\t\tassertanonfailed: 'userNewUser',\n\t\t\t\tassertuserfailed: 'userNewUser',\n\t\t\t\tassertnameduserfailed: 'userNewUser',\n\t\t\t\t'abusefilter-disallowed': 'extensionAbuseFilter',\n\t\t\t\t'abusefilter-warning': 'extensionAbuseFilter',\n\t\t\t\tcaptcha: 'extensionCaptcha',\n\t\t\t\t// FIXME: This language is non-inclusive and we would love to change it,\n\t\t\t\t// but this relates to an error code provided by software.\n\t\t\t\t// This is blocked on T254649\n\t\t\t\tspamblacklist: 'extensionSpamBlacklist',\n\t\t\t\t// FIXME: This language is non-inclusive and we would love to change it,\n\t\t\t\t// but this relates to an error code provided by software.\n\t\t\t\t// Removal of this line is blocked on T254650.\n\t\t\t\t'titleblacklist-forbidden': 'extensionTitleBlacklist',\n\t\t\t\tpagedeleted: 'editPageDeleted',\n\t\t\t\teditconflict: 'editConflict'\n\t\t\t};\n\n\t\tif ( data.edit && data.edit.captcha ) {\n\t\t\tcode = 'captcha';\n\t\t}\n\n\t\tthis.log( {\n\t\t\taction: 'saveFailure',\n\t\t\tmessage: code,\n\t\t\ttype: typeMap[code] || 'responseUnknown'\n\t\t} );\n\t},\n\t/**\n\t * Report load errors back to the user. Silently record the error using EventLogging.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {string} text Text (HTML) of message to display to user\n\t */\n\treportError: function ( text ) {\n\t\tconst errorNotice = new MessageBox( {\n\t\t\ttype: 'error',\n\t\t\tmsg: text,\n\t\t\theading: mw.msg( 'mobile-frontend-editor-error' )\n\t\t} );\n\t\tthis.$errorNoticeContainer.html( errorNotice.$el );\n\t},\n\thideErrorNotice: function () {\n\t\tthis.$errorNoticeContainer.empty();\n\t},\n\t/**\n\t * Prepares the penultimate screen before saving.\n\t * Expects to be overridden by child class.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonStageChanges: function () {\n\t\tthis.showHidden( '.save-header, .save-panel' );\n\t\tthis.hideErrorNotice();\n\t\tthis.log( {\n\t\t\taction: 'saveIntent'\n\t\t} );\n\t\t// Scroll to the top of the page, so that the summary input is visible\n\t\t// (even if overlay was scrolled down when editing) and weird iOS header\n\t\t// problems are avoided (header position not updating to the top of the\n\t\t// screen, instead staying lower until a subsequent scroll event).\n\t\twindow.scrollTo( 0, 1 );\n\t},\n\t/**\n\t * Executed when the editor clicks the save button. Expects to be overridden by child\n\t * class. Checks if the save needs to be confirmed.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonSaveBegin: function () {\n\t\tthis.confirmAborted = false;\n\t\tthis.hideErrorNotice();\n\t\t// Ask for confirmation in some cases\n\t\tif ( !this.confirmSave() ) {\n\t\t\tthis.confirmAborted = true;\n\t\t\treturn;\n\t\t}\n\t\tthis.log( {\n\t\t\taction: 'saveAttempt'\n\t\t} );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof EditorOverlayBase\n\t */\n\tpreRender: function () {\n\t\tconst options = this.options;\n\n\t\tthis.options.headers = [\n\t\t\theaders.formHeader(\n\t\t\t\tutil.template( `\n{{^hasToolbar}}\n<div class=\"overlay-title\">\n\t<h2>{{{editingMsg}}}</h2>\n</div>\n{{/hasToolbar}}\n{{#hasToolbar}}<div class=\"toolbar\"></div>{{/hasToolbar}}\n{{#editSwitcher}}\n\t<div class=\"switcher-container\">\n\t</div>\n{{/editSwitcher}}\n\t\t\t\t` ).render( {\n\t\t\t\t\thasToolbar: options.hasToolbar,\n\t\t\t\t\teditSwitcher: options.editSwitcher,\n\t\t\t\t\teditingMsg: options.editingMsg\n\t\t\t\t} ),\n\t\t\t\toptions.readOnly ? [] : [\n\t\t\t\t\tnew IconButton( {\n\t\t\t\t\t\ttagName: 'button',\n\t\t\t\t\t\taction: 'progressive',\n\t\t\t\t\t\tweight: 'primary',\n\t\t\t\t\t\ticon: 'next-invert',\n\t\t\t\t\t\tadditionalClassNames: 'continue',\n\t\t\t\t\t\tdisabled: true,\n\t\t\t\t\t\ttitle: options.continueMsg\n\t\t\t\t\t} )\n\t\t\t\t],\n\t\t\t\ticons.cancel(),\n\t\t\t\t'initial-header'\n\t\t\t),\n\t\t\theaders.saveHeader( options.previewingMsg, 'save-header hidden' ),\n\t\t\theaders.savingHeader( mw.msg( 'mobile-frontend-editor-wait' ) )\n\t\t];\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\tthis.$errorNoticeContainer = this.$el.find( '#error-notice-container' );\n\n\t\tOverlay.prototype.postRender.apply( this );\n\t\tthis.showHidden( '.initial-header' );\n\t},\n\tshow: function () {\n\t\tconst self = this;\n\t\tthis.allowCloseWindow = mw.confirmCloseWindow( {\n\t\t\t// Returns true if content has changed\n\t\t\ttest: function () {\n\t\t\t\t// Check if content has changed\n\t\t\t\treturn self.hasChanged();\n\t\t\t},\n\n\t\t\t// Message to show the user, if content has changed\n\t\t\tmessage: mw.msg( 'mobile-frontend-editor-cancel-confirm' ),\n\t\t\t// Event namespace\n\t\t\tnamespace: 'editwarning'\n\t\t} );\n\n\t\tthis.saved = false;\n\t\tOverlay.prototype.show.call( this );\n\n\t\t// Inform other interested code that the editor has loaded\n\t\t/**\n\t\t * Internal for use in ContentTranslation and GrowthExperiments only.\n\t\t *\n\t\t * @event ~'mobileFrontend.editorOpened'\n\t\t * @memberof Hooks\n\t\t */\n\t\tmw.hook( 'mobileFrontend.editorOpened' ).fire( this.editor );\n\t},\n\t/**\n\t * Back button click handler\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonClickBack: function () {},\n\t/**\n\t * Submit button click handler\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonClickSubmit: function () {\n\t\tthis.onSaveBegin();\n\t},\n\t/**\n\t * Continue button click handler\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonClickContinue: function () {\n\t\tthis.onStageChanges();\n\t},\n\t/**\n\t * \"Edit without logging in\" button click handler\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\tonClickAnonymous: function () {},\n\t/**\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Function} exit Callback to exit the overlay\n\t * @param {Function} cancel Callback to cancel exiting the overlay\n\t */\n\tonBeforeExit: function ( exit, cancel ) {\n\t\tconst self = this;\n\t\tif ( this.hasChanged() && !this.switching ) {\n\t\t\tif ( !this.windowManager ) {\n\t\t\t\tthis.windowManager = OO.ui.getWindowManager();\n\t\t\t\tthis.windowManager.addWindows( [ new mw.widgets.AbandonEditDialog() ] );\n\t\t\t}\n\t\t\tthis.windowManager.openWindow( 'abandonedit' )\n\t\t\t\t.closed.then( function ( data ) {\n\t\t\t\t\tif ( data && data.action === 'discard' ) {\n\t\t\t\t\t\t// log abandonment\n\t\t\t\t\t\tself.log( {\n\t\t\t\t\t\t\taction: 'abort',\n\t\t\t\t\t\t\tmechanism: 'cancel',\n\t\t\t\t\t\t\ttype: 'abandon'\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tself.onExit();\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\tcancel();\n\t\t\treturn;\n\t\t}\n\t\tif ( !this.switching && !this.saved ) {\n\t\t\t// log leaving without changes\n\t\t\tthis.log( {\n\t\t\t\taction: 'abort',\n\t\t\t\tmechanism: 'cancel',\n\t\t\t\t// if this is VE, hasChanged will be false because the Surface has\n\t\t\t\t// already been destroyed (which is good because it stops us\n\t\t\t\t// double-showing the abandon changes dialog above)... but we can\n\t\t\t\t// test whether there *were* changes for logging purposes by\n\t\t\t\t// examining the target:\n\t\t\t\ttype: ( this.target && this.target.edited ) ? 'abandon' : 'nochange'\n\t\t\t} );\n\t\t}\n\t\tthis.onExit();\n\t\texit();\n\t\tif ( mw.config.get( 'wgAction' ) === 'edit' ) {\n\t\t\t// We got into the overlay via directly visiting an action=edit\n\t\t\t// URL, which has been taken over. As such, depending on\n\t\t\t// how we got here, the normal overlay process isn't going to\n\t\t\t// produce the correct result.\n\t\t\tsetTimeout( function () {\n\t\t\t\t// This needs to happen after the overlay-hide has completed\n\t\t\t\t// so we have access to the \"real\" URL, and `exit`\n\t\t\t\t// unfortunately doesn't expose a promise for this. There's\n\t\t\t\t// several setTimeouts within the hide, so we're just going\n\t\t\t\t// to use a long-enough setTimeout of our own to skip those.\n\t\t\t\tif ( !mw.util.getParamValue( 'veaction' ) && !mw.util.getParamValue( 'action' ) ) {\n\t\t\t\t\t// Use reload if possible, to emulate having gone back\n\t\t\t\t\tlocation.reload();\n\t\t\t\t} else {\n\t\t\t\t\tlocation.href = mw.util.getUrl();\n\t\t\t\t}\n\t\t\t}, 100 );\n\t\t}\n\t},\n\tonExit: function () {\n\t\t// May not be set if overlay has not been previously shown\n\t\tif ( this.allowCloseWindow ) {\n\t\t\tthis.allowCloseWindow.release();\n\t\t}\n\t\t/**\n\t\t * Internal for use in ContentTranslation and GrowthExperiments only.\n\t\t *\n\t\t * @event ~'mobileFrontend.editorClosed'\n\t\t * @memberof Hooks\n\t\t */\n\t\tmw.hook( 'mobileFrontend.editorClosed' ).fire();\n\t},\n\t/**\n\t * Sets additional values used for anonymous editing warning.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} options\n\t * @return {jQuery.Element}\n\t */\n\tcreateAnonWarning: function ( options ) {\n\t\tconst $actions = $( '<div>' ).addClass( 'actions' ),\n\t\t\t// Use MediaWiki ResourceLoader require(), not Webpack require()\n\t\t\tcontLangMessages = (\n\n\t\t\t\t__non_webpack_require__( './contLangMessages.json' )\n\t\t\t),\n\t\t\tmsg = this.gateway.wouldautocreate ?\n\t\t\t\t'mobile-frontend-editor-autocreatewarning' :\n\t\t\t\t'mobile-frontend-editor-anonwarning',\n\t\t\t$anonWarning = $( '<div>' ).addClass( 'anonwarning content' ).append(\n\t\t\t\tnew MessageBox( {\n\t\t\t\t\ttype: 'notice',\n\t\t\t\t\tclassName: 'anon-msg',\n\t\t\t\t\t// eslint-disable-next-line mediawiki/msg-doc\n\t\t\t\t\tmsg: mw.message( msg, contLangMessages[ 'tempuser-helppage' ] ).parse()\n\t\t\t\t} ).$el,\n\t\t\t\t$actions\n\t\t\t),\n\t\t\tparams = util.extend( {\n\t\t\t\treturnto: options.returnTo || (\n\t\t\t\t\t// use wgPageName as this includes the namespace if outside Main\n\t\t\t\t\tmw.config.get( 'wgPageName' ) + '#/editor/' + ( options.sectionId || 'all' )\n\t\t\t\t),\n\t\t\t\twarning: 'mobile-frontend-edit-login-action'\n\t\t\t}, options.queryParams ),\n\t\t\tsignupParams = util.extend( {\n\t\t\t\ttype: 'signup',\n\t\t\t\twarning: 'mobile-frontend-edit-signup-action'\n\t\t\t}, options.signupQueryParams ),\n\t\t\tanonymousEditorActions = [\n\t\t\t\tnew Button( {\n\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-editor-anon' ),\n\t\t\t\t\tblock: true,\n\t\t\t\t\tadditionalClassNames: 'anonymous progressive',\n\t\t\t\t\tprogressive: true\n\t\t\t\t} ),\n\t\t\t\tnew Button( {\n\t\t\t\t\tblock: true,\n\t\t\t\t\thref: mw.util.getUrl( 'Special:UserLogin', params ),\n\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-watchlist-cta-button-login' )\n\t\t\t\t} ),\n\t\t\t\tnew Button( {\n\t\t\t\t\tblock: true,\n\t\t\t\t\thref: mw.util.getUrl( 'Special:UserLogin', util.extend( params, signupParams ) ),\n\t\t\t\t\tlabel: mw.msg( 'mobile-frontend-watchlist-cta-button-signup' )\n\t\t\t\t} )\n\t\t\t];\n\n\t\t$actions.append(\n\t\t\tanonymousEditorActions.map( function ( action ) {\n\t\t\t\treturn action.$el;\n\t\t\t} )\n\t\t);\n\n\t\treturn $anonWarning;\n\t},\n\t/**\n\t * Creates and returns a copy of the anon talk message warning\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @return {jQuery.Element}\n\t */\n\tcreateAnonTalkWarning: function () {\n\t\treturn $( '.minerva-anon-talk-message' ).clone();\n\t},\n\t/**\n\t * Get an options object not containing any defaults or editor\n\t * specific options, so that it can be used to construct a\n\t * different editor for switching.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @return {Object} Options\n\t */\n\tgetOptionsForSwitch: function () {\n\t\t// Only preserve options that would be passed in editor.js#setupEditor\n\t\t// and skip over defaults.\n\t\treturn {\n\t\t\tswitched: true,\n\t\t\toverlayManager: this.options.overlayManager,\n\t\t\tcurrentPageHTMLParser: this.options.currentPageHTMLParser,\n\t\t\tfakeScroll: this.options.fakeScroll,\n\t\t\tapi: this.options.api,\n\t\t\tlicenseMsg: this.options.licenseMsg,\n\t\t\ttitle: this.options.title,\n\t\t\ttitleObj: this.options.titleObj,\n\t\t\tisAnon: this.options.isAnon,\n\t\t\tisNewPage: this.options.isNewPage,\n\t\t\toldId: this.options.oldId,\n\t\t\tcontentLang: this.options.contentLang,\n\t\t\tcontentDir: this.options.contentDir,\n\t\t\tsectionId: this.options.sectionId\n\t\t};\n\t},\n\n\t/**\n\t * Checks whether the state of the thing being edited as changed. Expects to be\n\t * implemented by child class.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t */\n\thasChanged: function () {},\n\t/**\n\t * Get a promise that is resolved when the editor data has loaded,\n\t * or rejected when we're refusing to load the editor because the user is blocked.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @return {jQuery.Promise}\n\t */\n\tgetLoadingPromise: function () {\n\t\treturn this.dataPromise.then( function ( result ) {\n\t\t\t// check if user is blocked\n\t\t\tif ( result && result.blockinfo ) {\n\t\t\t\tconst block = parseBlockInfo( result.blockinfo ),\n\t\t\t\t\tmessage = blockMessageDrawer( block );\n\t\t\t\treturn util.Deferred().reject( message );\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\t},\n\tshowEditNotices: function () {\n\t\tconst overlay = this;\n\t\tif ( mw.config.get( 'wgMFEditNoticesFeatureConflict' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.getLoadingPromise().then( function ( data ) {\n\t\t\tif ( data.notices ) {\n\t\t\t\tconst editNotices = Object.keys( data.notices ).filter( function ( key ) {\n\t\t\t\t\tif ( key.indexOf( 'editnotice' ) !== 0 ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( key === 'editnotice-notext' ) {\n\t\t\t\t\t\t// This notice is shown on pages which don't have any\n\t\t\t\t\t\t// other edit notices. It's blank by default, but\n\t\t\t\t\t\t// some wikis have it template-generated and hidden\n\t\t\t\t\t\t// by CSS. It's filtered out from VE's API response,\n\t\t\t\t\t\t// but not from the source mode.\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t// The contents of an edit notice is unlikely to change in the 24 hour\n\t\t\t\t\t// expiry window, so just record that a notice with this key has been shown.\n\t\t\t\t\t// If a cheap hashing function was available in core (or the API provided\n\t\t\t\t\t// as hash) it could be used here instead.\n\t\t\t\t\tconst storageKey = 'mf-editnotices/' + mw.config.get( 'wgPageName' ) + '#' + key;\n\t\t\t\t\tif ( mw.storage.get( storageKey ) ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tmw.storage.set( storageKey, '1', 24 * 60 * 60 );\n\t\t\t\t\treturn true;\n\t\t\t\t} );\n\n\t\t\t\tif ( editNotices.length ) {\n\t\t\t\t\tmw.loader.using( 'oojs-ui-windows' ).then( function () {\n\t\t\t\t\t\tconst $container = $( '<div>' ).addClass( 'editor-overlay-editNotices' );\n\t\t\t\t\t\teditNotices.forEach( function ( key ) {\n\t\t\t\t\t\t\tconst $notice = $( '<div>' ).append( data.notices[ key ] );\n\t\t\t\t\t\t\t$notice.addClass( 'editor-overlay-editNotice' );\n\t\t\t\t\t\t\t$container.append( $notice );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tOO.ui.alert( $container );\n\n\t\t\t\t\t\toverlay.logFeatureUse( {\n\t\t\t\t\t\t\tfeature: 'notices',\n\t\t\t\t\t\t\taction: 'show'\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\t/**\n\t * Handles a failed save due to a CAPTCHA provided by ConfirmEdit extension.\n\t *\n\t * @memberof EditorOverlayBase\n\t * @instance\n\t * @param {Object} details Details returned from the api.\n\t */\n\thandleCaptcha: function ( details ) {\n\t\tconst self = this,\n\t\t\t$input = this.$el.find( '.captcha-word' );\n\n\t\tif ( this.captchaShown ) {\n\t\t\t$input.val( '' );\n\t\t\t$input.attr( 'placeholder', this.options.captchaTryAgainMsg );\n\t\t\tsetTimeout( function () {\n\t\t\t\t$input.attr( 'placeholder', self.options.captchaMsg );\n\t\t\t}, 2000 );\n\t\t}\n\n\t\t// handle different mime types different\n\t\tif ( details.mime.indexOf( 'image/' ) === 0 ) {\n\t\t\t// image based CAPTCHA's like provided by FancyCaptcha, ReCaptcha or similar\n\t\t\tthis.$el.find( '.captcha-panel#question' ).detach();\n\t\t\tthis.$el.find( '.captcha-panel img' ).attr( 'src', details.url );\n\t\t} else {\n\t\t\t// not image based CAPTCHA.\n\t\t\tthis.$el.find( '.captcha-panel #image' ).detach();\n\t\t\tif ( details.mime.indexOf( 'text/html' ) === 0 ) {\n\t\t\t\t// handle mime type of HTML as HTML content (display as-is).\n\t\t\t\t// QuestyCaptcha now have default MIME type \"text/html\": see T147606\n\t\t\t\tthis.$el.find( '.captcha-panel #question' ).html( details.question );\n\t\t\t} else {\n\t\t\t\t// handle mime types\n\t\t\t\t// (other than image based ones and HTML based ones)\n\t\t\t\t// as plain text by default.\n\t\t\t\t// e.g. MathCaptcha (solve a math formula) or\n\t\t\t\t// SimpleCaptcha (simple math formula)\n\t\t\t\tthis.$el.find( '.captcha-panel #question' ).text( details.question );\n\t\t\t}\n\t\t}\n\n\t\tthis.showHidden( '.save-header, .captcha-panel' );\n\t\tthis.captchaShown = true;\n\t}\n} );\n\nmodule.exports = EditorOverlayBase;\n","const EditorOverlayBase = require( './EditorOverlayBase' ),\n\tutil = require( '../mobile.startup/util' ),\n\ticons = require( '../mobile.startup/icons' ),\n\tSection = require( '../mobile.startup/Section' ),\n\tsaveFailureMessage = require( './saveFailureMessage' ),\n\tEditorGateway = require( './EditorGateway' ),\n\tfakeToolbar = require( '../mobile.init/fakeToolbar' ),\n\tMessageBox = require( '../mobile.startup/MessageBox' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' ),\n\tsetPreferredEditor = require( './setPreferredEditor' ),\n\tVisualEditorOverlay = require( './VisualEditorOverlay' ),\n\tcurrentPage = require( '../mobile.startup/currentPage' );\n\n/**\n * Overlay that shows an editor\n *\n * @class SourceEditorOverlay\n * @uses Section\n * @uses EditorGateway\n * @uses VisualEditorOverlay\n * @extends EditorOverlayBase\n * @private\n *\n * @param {Object} options Configuration options\n * @param {jQuery.Promise} [dataPromise] Optional promise for loading content\n */\nfunction SourceEditorOverlay( options, dataPromise ) {\n\tthis.isFirefox = /firefox/i.test( window.navigator.userAgent );\n\tthis.gateway = new EditorGateway( {\n\t\tapi: options.api,\n\t\ttitle: options.title,\n\t\tsectionId: options.sectionId,\n\t\toldId: options.oldId,\n\t\tfromModified: !!dataPromise,\n\t\tpreload: options.preload,\n\t\tpreloadparams: options.preloadparams,\n\t\teditintro: options.editintro\n\t} );\n\tthis.readOnly = !!options.oldId; // If old revision, readOnly mode\n\tthis.dataPromise = dataPromise || this.gateway.getContent();\n\tthis.currentPage = currentPage();\n\tif ( this.currentPage.isVEVisualAvailable() ) {\n\t\toptions.editSwitcher = true;\n\t}\n\tif ( this.readOnly ) {\n\t\toptions.readOnly = true;\n\t\toptions.editingMsg = mw.msg( 'mobile-frontend-editor-viewing-source-page', options.title );\n\t} else {\n\t\toptions.editingMsg = mw.msg( 'mobile-frontend-editor-editing-page', options.title );\n\t}\n\toptions.previewingMsg = mw.msg( 'mobile-frontend-editor-previewing-page', options.title );\n\tEditorOverlayBase.call(\n\t\tthis,\n\t\tutil.extend( true,\n\t\t\t{ events: { 'input .wikitext-editor': 'onInputWikitextEditor' } },\n\t\t\toptions\n\t\t)\n\t);\n}\n\nmfExtend( SourceEditorOverlay, EditorOverlayBase, {\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\ttemplatePartials: util.extend( {}, EditorOverlayBase.prototype.templatePartials, {\n\t\tcontent: util.template( `\n<div lang=\"{{contentLang}}\" dir=\"{{contentDir}}\" class=\"editor-container content\">\n\t<textarea class=\"wikitext-editor\" id=\"wikitext-editor\" cols=\"40\" rows=\"10\" placeholder=\"{{placeholder}}\"></textarea>\n\t<div class=\"preview collapsible-headings-expanded mw-body-content\"></div>\n</div>\n\t\t` )\n\t} ),\n\t/**\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\teditor: 'wikitext',\n\t/**\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tsectionLine: '',\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tshow: function () {\n\t\tEditorOverlayBase.prototype.show.apply( this, arguments );\n\t\t// Ensure we do this after showing the overlay, otherwise it doesn't work.\n\t\tthis._resizeEditor();\n\t},\n\t/**\n\t * Wikitext Editor input handler\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonInputWikitextEditor: function () {\n\t\tthis.gateway.setContent( this.$el.find( '.wikitext-editor' ).val() );\n\t\tthis.$el.find( '.continue, .submit' ).prop( 'disabled', false );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonClickBack: function () {\n\t\tEditorOverlayBase.prototype.onClickBack.apply( this, arguments );\n\t\tthis._hidePreview();\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tpostRender: function () {\n\t\tconst self = this;\n\n\t\t// log edit attempt\n\t\tthis.log( { action: 'ready' } );\n\t\tthis.log( { action: 'loaded' } );\n\n\t\tif ( this.currentPage.isVEVisualAvailable() ) {\n\t\t\tmw.loader.using( 'ext.visualEditor.switching' ).then( function () {\n\t\t\t\tconst toolFactory = new OO.ui.ToolFactory(),\n\t\t\t\t\ttoolGroupFactory = new OO.ui.ToolGroupFactory();\n\n\t\t\t\ttoolFactory.register( mw.libs.ve.MWEditModeVisualTool );\n\t\t\t\ttoolFactory.register( mw.libs.ve.MWEditModeSourceTool );\n\t\t\t\tconst switchToolbar = new OO.ui.Toolbar( toolFactory, toolGroupFactory, {\n\t\t\t\t\tclasses: [ 'editor-switcher' ]\n\t\t\t\t} );\n\n\t\t\t\tswitchToolbar.on( 'switchEditor', function ( mode ) {\n\t\t\t\t\tif ( mode === 'visual' ) {\n\t\t\t\t\t\tif ( !self.gateway.hasChanged ) {\n\t\t\t\t\t\t\tself._switchToVisualEditor();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Pass wikitext if there are changes.\n\t\t\t\t\t\t\tself._switchToVisualEditor( self.gateway.content );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tswitchToolbar.setup( [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'editMode',\n\t\t\t\t\t\ttype: 'list',\n\t\t\t\t\t\ticon: 'edit',\n\t\t\t\t\t\ttitle: mw.msg( 'visualeditor-mweditmode-tooltip' ),\n\t\t\t\t\t\tinclude: [ 'editModeVisual', 'editModeSource' ]\n\t\t\t\t\t}\n\t\t\t\t] );\n\n\t\t\t\tself.$el.find( '.switcher-container' ).html( switchToolbar.$element );\n\t\t\t\tswitchToolbar.emit( 'updateState' );\n\t\t\t} );\n\t\t}\n\n\t\tEditorOverlayBase.prototype.postRender.apply( this );\n\n\t\t// This spinner is still used when displaying save/preview panel\n\t\tthis.$el.find( '.overlay-content' ).append( icons.spinner().$el );\n\t\tthis.hideSpinner();\n\n\t\tthis.$preview = this.$el.find( '.preview' );\n\t\tthis.$content = this.$el.find( '.wikitext-editor' );\n\t\t// The following classes can be used here:\n\t\t// * mw-editfont-monospace\n\t\t// * mw-editfont-sans-serif\n\t\t// * mw-editfont-serif\n\t\tthis.$content.addClass( 'mw-editfont-' + mw.user.options.get( 'editfont' ) );\n\n\t\t// make license links open in separate tabs\n\t\tthis.$el.find( '.license a' ).attr( 'target', '_blank' );\n\n\t\t// If in readOnly mode, make textarea readonly\n\t\tif ( this.readOnly ) {\n\t\t\tthis.$content.prop( 'readonly', true );\n\t\t}\n\n\t\tthis.$content\n\t\t\t.on( 'input', this._resizeEditor.bind( this ) )\n\t\t\t.one( 'input', function () {\n\t\t\t\tself.log( { action: 'firstChange' } );\n\t\t\t} );\n\n\t\tif ( this.isFirefox ) {\n\t\t\tthis.$content.on( 'mousedown', function () {\n\t\t\t\t// Support: Firefox Mobile\n\t\t\t\t// Firefox scrolls back to the top of the page *every time*\n\t\t\t\t// you tap on the textarea. This makes things slightly\n\t\t\t\t// more usable by restoring your scroll offset every time\n\t\t\t\t// the page scrolls for the next 1000ms.\n\t\t\t\t// The page will still flicker every time the user touches\n\t\t\t\t// to place the cursor, but this is better than completely\n\t\t\t\t// losing your scroll offset. (T214880)\n\t\t\t\tconst docEl = document.documentElement,\n\t\t\t\t\tscrollTop = docEl.scrollTop;\n\t\t\t\tfunction blockScroll() {\n\t\t\t\t\tdocEl.scrollTop = scrollTop;\n\t\t\t\t}\n\t\t\t\twindow.addEventListener( 'scroll', blockScroll );\n\t\t\t\tsetTimeout( function () {\n\t\t\t\t\twindow.removeEventListener( 'scroll', blockScroll );\n\t\t\t\t}, 1000 );\n\t\t\t} );\n\t\t}\n\n\t\t// Render edit summary\n\t\tthis.summaryTextArea = new OO.ui.MultilineTextInputWidget( {\n\t\t\tplaceholder: this.options.summaryMsg,\n\t\t\tclasses: [ 'summary' ],\n\t\t\tvalue: '',\n\t\t\tmaxRows: 2\n\t\t} );\n\t\tthis.$el.find( '.summary-input' ).append(\n\t\t\tthis.summaryTextArea.$element\n\t\t);\n\n\t\tthis._loadContent();\n\t},\n\n\t/**\n\t * Handles click on \"Edit without login\" in anonymous editing warning.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @private\n\t */\n\tonClickAnonymous: function () {\n\t\tthis.$anonWarning.hide();\n\t\tthis.$anonTalkWarning.hide();\n\t\t// reenable \"Next\" button\n\t\tthis.$anonHiddenButtons.show();\n\t\tthis.$content.show();\n\t\tthis._resizeEditor();\n\t},\n\n\t/**\n\t * Prepares the preview interface and reveals the save screen of the overlay\n\t *\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonStageChanges: function () {\n\t\tconst self = this,\n\t\t\tparams = {\n\t\t\t\ttext: this.getContent()\n\t\t\t};\n\n\t\tthis.scrollTop = util.getDocument().find( 'body' ).scrollTop();\n\t\tthis.$content.hide();\n\t\tthis.showSpinner();\n\n\t\tif ( mw.config.get( 'wgIsMainPage' ) ) {\n\t\t\tparams.mainpage = 1; // Setting it to 0 will have the same effect\n\t\t}\n\n\t\tfunction hideSpinnerAndShowPreview() {\n\t\t\tself.hideSpinner();\n\t\t\tself.$preview.show();\n\t\t\tmw.hook( 'wikipage.content' ).fire( self.$preview );\n\t\t}\n\n\t\tthis.gateway.getPreview( params ).then( function ( result ) {\n\t\t\tconst parsedText = result.text,\n\t\t\t\tparsedSectionLine = result.line;\n\n\t\t\tself.sectionId = result.id;\n\t\t\t// On desktop edit summaries strip tags. Mimic this behavior on mobile devices\n\t\t\tself.sectionLine = self.parseHTML( '<div>' ).html( parsedSectionLine ).text();\n\t\t\tnew Section( {\n\t\t\t\tel: self.$preview,\n\t\t\t\ttext: parsedText\n\t\t\t} ).$el.find( 'a' ).on( 'click', false );\n\n\t\t\thideSpinnerAndShowPreview();\n\t\t}, function () {\n\t\t\tself.$preview.replaceWith(\n\t\t\t\tnew MessageBox( {\n\t\t\t\t\ttype: 'error',\n\t\t\t\t\tmsg: mw.msg( 'mobile-frontend-editor-error-preview' )\n\t\t\t\t} ).$el\n\t\t\t);\n\t\t\thideSpinnerAndShowPreview();\n\t\t} );\n\n\t\tEditorOverlayBase.prototype.onStageChanges.apply( this, arguments );\n\t},\n\n\t/**\n\t * Hides the preview and reverts back to initial screen.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @private\n\t */\n\t_hidePreview: function () {\n\t\tthis.gateway.abortPreview();\n\t\tthis.hideSpinner();\n\t\t// FIXME: Don't rely on internals - we re-render template instead.\n\t\tthis.$preview.removeClass(\n\t\t\t'cdx-message--error'\n\t\t).hide();\n\t\tthis.$content.show();\n\t\twindow.scrollTo( 0, this.scrollTop );\n\t\tthis.showHidden( '.initial-header' );\n\t},\n\n\t/**\n\t * Resize the editor textarea, maintaining scroll position in iOS\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\t_resizeEditor: function () {\n\t\tlet scrollTop, container, $scrollContainer;\n\n\t\tif ( !this.$scrollContainer ) {\n\t\t\tcontainer = OO.ui.Element.static\n\t\t\t\t.getClosestScrollableContainer( this.$content[ 0 ] );\n\t\t\t// The scroll container will be either within the view\n\t\t\t// or the document element itself.\n\t\t\t$scrollContainer = this.$el.find( container ).length ?\n\t\t\t\tthis.$el.find( container ) : util.getDocument();\n\t\t\tthis.$scrollContainer = $scrollContainer;\n\t\t\tthis.$content.css( 'padding-bottom', this.$scrollContainer.height() * 0.6 );\n\t\t} else {\n\t\t\t$scrollContainer = this.$scrollContainer;\n\t\t}\n\n\t\t// Only do this if scroll container exists\n\t\tif ( this.$content.prop( 'scrollHeight' ) && $scrollContainer.length ) {\n\t\t\tscrollTop = $scrollContainer.scrollTop();\n\t\t\tthis.$content\n\t\t\t\t.css( 'height', 'auto' )\n\t\t\t\t// can't reuse prop( 'scrollHeight' ) because we need the current value\n\t\t\t\t.css( 'height', ( this.$content.prop( 'scrollHeight' ) + 2 ) + 'px' );\n\t\t\t$scrollContainer.scrollTop( scrollTop );\n\t\t}\n\t},\n\n\t/**\n\t * Set content to the user input field.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @param {string} content The content to set.\n\t */\n\tsetContent: function ( content ) {\n\t\tthis.$content\n\t\t\t.show()\n\t\t\t.val( content );\n\t\tthis._resizeEditor();\n\t},\n\n\t/**\n\t * Returns the content of the user input field.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @return {string}\n\t */\n\tgetContent: function () {\n\t\treturn this.$content.val();\n\t},\n\n\t/**\n\t * Requests content from the API and reveals it in UI.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @private\n\t */\n\t_loadContent: function () {\n\t\tconst self = this;\n\n\t\tthis.$content.hide();\n\n\t\tthis.getLoadingPromise()\n\t\t\t.then( function ( result ) {\n\t\t\t\tconst content = result.text;\n\n\t\t\t\tself.setContent( content );\n\n\t\t\t\t// If the loaded content is not the default content, enable the save button\n\t\t\t\tif ( self.hasChanged() ) {\n\t\t\t\t\tself.$el.find( '.continue, .submit' ).prop( 'disabled', false );\n\t\t\t\t}\n\n\t\t\t\tconst options = self.options;\n\t\t\t\tconst showAnonWarning = options.isAnon && !options.switched;\n\n\t\t\t\tif ( showAnonWarning ) {\n\t\t\t\t\tself.$anonWarning = self.createAnonWarning( options );\n\t\t\t\t\tself.$anonTalkWarning = self.createAnonTalkWarning();\n\t\t\t\t\tself.$el.find( '.editor-container' ).append( [ self.$anonTalkWarning, self.$anonWarning ] );\n\t\t\t\t\tself.$content.hide();\n\t\t\t\t\t// the user has to click login, signup or edit without login,\n\t\t\t\t\t// disable \"Next\" button on top right\n\t\t\t\t\tself.$anonHiddenButtons = self.$el.find( '.overlay-header .continue' ).hide();\n\t\t\t\t}\n\n\t\t\t\tif ( self.gateway.fromModified ) {\n\t\t\t\t\t// Trigger intial EditorGateway#setContent and update save button\n\t\t\t\t\tself.onInputWikitextEditor();\n\t\t\t\t}\n\n\t\t\t\tself.showEditNotices();\n\t\t\t} );\n\t},\n\n\t/**\n\t * Loads a {VisualEditorOverlay} and replaces the existing SourceEditorOverlay with it\n\t * based on the current option values.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @private\n\t * @param {string} [wikitext] Wikitext to pass to VE\n\t */\n\t_switchToVisualEditor: function ( wikitext ) {\n\t\tconst self = this;\n\t\tthis.log( {\n\t\t\taction: 'abort',\n\t\t\ttype: 'switchnochange',\n\t\t\tmechanism: 'navigate'\n\t\t} );\n\t\tthis.logFeatureUse( {\n\t\t\tfeature: 'editor-switch',\n\t\t\taction: 'visual-mobile'\n\t\t} );\n\n\t\t// Save a user setting indicating that this user prefers using the VisualEditor\n\t\tsetPreferredEditor( 'VisualEditor' );\n\n\t\tthis.$el.addClass( 'switching' );\n\t\tthis.$el.find( '.overlay-header-container' ).hide();\n\t\tthis.$el.append( fakeToolbar() );\n\t\tthis.$content.prop( 'readonly', true );\n\n\t\tmw.loader.using( 'ext.visualEditor.targetLoader' ).then( function () {\n\t\t\tmw.libs.ve.targetLoader.addPlugin( 'ext.visualEditor.mobileArticleTarget' );\n\t\t\treturn mw.libs.ve.targetLoader.loadModules( 'visual' );\n\t\t} ).then(\n\t\t\tfunction () {\n\t\t\t\tconst options = self.getOptionsForSwitch();\n\t\t\t\toptions.SourceEditorOverlay = SourceEditorOverlay;\n\t\t\t\tif ( wikitext ) {\n\t\t\t\t\toptions.dataPromise = mw.libs.ve.targetLoader.requestPageData( 'visual', mw.config.get( 'wgRelevantPageName' ), {\n\t\t\t\t\t\tsection: options.sectionId,\n\t\t\t\t\t\toldId: options.oldId || mw.config.get( 'wgRevisionId' ),\n\t\t\t\t\t\ttargetName: 'mobile',\n\t\t\t\t\t\tmodified: true,\n\t\t\t\t\t\twikitext: wikitext\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tdelete options.dataPromise;\n\t\t\t\t}\n\n\t\t\t\tconst newOverlay = new VisualEditorOverlay( options );\n\t\t\t\tnewOverlay.getLoadingPromise().then( function () {\n\t\t\t\t\tself.switching = true;\n\t\t\t\t\tself.overlayManager.replaceCurrent( newOverlay );\n\t\t\t\t\tself.switching = false;\n\t\t\t\t} );\n\t\t\t},\n\t\t\tfunction () {\n\t\t\t\tself.$el.removeClass( 'switching' );\n\t\t\t\tself.$el.find( '.overlay-header-container' ).show();\n\t\t\t\tself.$el.find( '.ve-mobile-fakeToolbar-container' ).remove();\n\t\t\t\tself.$content.prop( 'readonly', false );\n\t\t\t\t// FIXME: We should show an error notification, but right now toast\n\t\t\t\t// notifications are not dismissible when shown within the editor.\n\t\t\t}\n\t\t);\n\t},\n\n\t/**\n\t * Get the current edit summary.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @return {string}\n\t */\n\tgetEditSummary: function () {\n\t\treturn this.summaryTextArea.getValue();\n\t},\n\n\t/**\n\t * Executed when the editor clicks the save/publish button. Handles logging and submitting\n\t * the save action to the editor API.\n\t *\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonSaveBegin: function () {\n\t\tconst self = this,\n\t\t\toptions = {\n\t\t\t\tsummary: this.getEditSummary()\n\t\t\t};\n\n\t\tif ( self.sectionLine !== '' ) {\n\t\t\toptions.summary = '/* ' + self.sectionLine + ' */' + options.summary;\n\t\t}\n\t\tEditorOverlayBase.prototype.onSaveBegin.apply( this, arguments );\n\t\tif ( this.confirmAborted ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( this.captchaId ) {\n\t\t\toptions.captchaId = this.captchaId;\n\t\t\toptions.captchaWord = this.$el.find( '.captcha-word' ).val();\n\t\t}\n\n\t\tthis.showHidden( '.saving-header' );\n\n\t\tthis.gateway.save( options )\n\t\t\t.then( function ( newRevId, redirectUrl, tempUserCreated ) {\n\t\t\t\tconst title = self.options.title;\n\t\t\t\t// Special case behaviour of main page\n\t\t\t\tif ( mw.config.get( 'wgIsMainPage' ) && !redirectUrl ) {\n\t\t\t\t\t// FIXME: Blocked on T189173\n\t\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\t\twindow.location = mw.util.getUrl( title );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tself.onSaveComplete( newRevId, redirectUrl, tempUserCreated );\n\n\t\t\t\tif ( redirectUrl && tempUserCreated ) {\n\t\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\t\twindow.location.href = redirectUrl;\n\t\t\t\t}\n\t\t\t}, function ( data ) {\n\t\t\t\tself.onSaveFailure( data );\n\t\t\t} );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @param {number|null} newRevId ID of the newly created revision, or null if it was a\n\t * null edit.\n\t * @param {string} [redirectUrl] URL to redirect to, if different than the current URL.\n\t * @param {boolean} [tempUserCreated] Whether a temporary user was created\n\t */\n\tonSaveComplete: function ( newRevId, redirectUrl ) {\n\t\tEditorOverlayBase.prototype.onSaveComplete.apply( this, arguments );\n\n\t\t// The parent class changes the location hash in a setTimeout, so wait\n\t\t// for that to happen before reloading.\n\t\tsetTimeout( function () {\n\t\t\tif ( redirectUrl ) {\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.href = redirectUrl;\n\t\t\t} else if ( newRevId ) {\n\t\t\t\t// Set a notify parameter similar to venotify in VisualEditor.\n\t\t\t\tconst url = new URL( location.href );\n\t\t\t\turl.searchParams.set( 'mfnotify', this.isNewPage ? 'created' : 'saved' );\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.search = url.search;\n\t\t\t} else {\n\t\t\t\t// Null edit; do not add notify parameter.\n\t\t\t\t// Note the \"#\" may be in the URL.\n\t\t\t\t// If so, using window.location alone will not reload the page\n\t\t\t\t// we need to forcefully refresh\n\t\t\t\t// eslint-disable-next-line no-restricted-properties\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t} );\n\t},\n\n\t/**\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tshowSaveCompleteMsg: function ( action, tempUserCreated ) {\n\t\t__non_webpack_require__( 'mediawiki.action.view.postEdit' ).fireHookOnPageReload( action, tempUserCreated );\n\t},\n\n\t/**\n\t * Executed when page save fails. Handles error display and bookkeeping,\n\t * passes logging duties to the parent.\n\t *\n\t * @inheritdoc\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t */\n\tonSaveFailure: function ( data ) {\n\t\tlet msg, noRetry;\n\n\t\tif ( data.edit && data.edit.captcha ) {\n\t\t\tthis.captchaId = data.edit.captcha.id;\n\t\t\tthis.handleCaptcha( data.edit.captcha );\n\t\t} else {\n\t\t\tmsg = saveFailureMessage( data );\n\t\t\tthis.reportError( msg );\n\t\t\tthis.showHidden( '.save-header, .save-panel' );\n\n\t\t\t// Some errors may be temporary, but for others we know for sure that the save will\n\t\t\t// never succeed, so don't confuse the user by giving them the option to retry.\n\t\t\tnoRetry = data.errors && data.errors.some( function ( error ) {\n\t\t\t\treturn error.code === 'abusefilter-disallowed';\n\t\t\t} );\n\n\t\t\tif ( noRetry ) {\n\t\t\t\t// disable continue and save buttons, reenabled when user changes content\n\t\t\t\tthis.$el.find( '.continue, .submit' ).prop( 'disabled', true );\n\t\t\t}\n\t\t}\n\n\t\tEditorOverlayBase.prototype.onSaveFailure.apply( this, arguments );\n\t},\n\n\t/**\n\t * Checks whether the existing content has changed.\n\t *\n\t * @memberof SourceEditorOverlay\n\t * @instance\n\t * @return {boolean}\n\t */\n\thasChanged: function () {\n\t\treturn this.gateway.hasChanged;\n\t}\n} );\n\nmodule.exports = SourceEditorOverlay;\n","/* global ve, $ */\nconst EditorOverlayBase = require( './EditorOverlayBase' ),\n\tEditorGateway = require( './EditorGateway' ),\n\tfakeToolbar = require( '../mobile.init/fakeToolbar' ),\n\tmfExtend = require( '../mobile.startup/mfExtend' ),\n\trouter = __non_webpack_require__( 'mediawiki.router' ),\n\tidentifyLeadParagraph = require( './identifyLeadParagraph' ),\n\tsetPreferredEditor = require( './setPreferredEditor' ),\n\tutil = require( '../mobile.startup/util' ),\n\tOverlayManager = require( '../mobile.startup/OverlayManager' ),\n\toverlayManager = OverlayManager.getSingleton(),\n\tcurrentPage = require( '../mobile.startup/currentPage' );\n\n/**\n * Overlay for VisualEditor view\n *\n * @class VisualEditorOverlay\n * @extends EditorOverlayBase\n * @private\n *\n * @param {Object} options Configuration options\n * @param {SourceEditorOverlay} options.SourceEditorOverlay Class to use for standard\n *  Wikitext editor. It must be passed in explicitly to avoid a cyclic\n *  dependency between VisualEditorOverlay and SourceEditorOverlay\n */\nfunction VisualEditorOverlay( options ) {\n\tconst surfaceReady = util.Deferred();\n\n\tEditorOverlayBase.call( this,\n\t\tutil.extend( {\n\t\t\teditSwitcher: false,\n\t\t\thasToolbar: true,\n\t\t\tonBeforeExit: this.onBeforeExit.bind( this ),\n\t\t\tisBorderBox: false,\n\t\t\tclassName: 'overlay editor-overlay editor-overlay-ve'\n\t\t}, options )\n\t);\n\tthis.SourceEditorOverlay = options.SourceEditorOverlay;\n\tthis.isNewPage = options.isNewPage;\n\tthis.fromModified = options.dataPromise && options.switched;\n\n\t// VE surfaces must be attached to the DOM while initializing, and measurable\n\tthis.$el.addClass( 'editor-overlay-ve-initializing' );\n\toverlayManager.container.appendChild( this.$el[ 0 ] );\n\n\t// Gateway present for a few utility purposes; the VE articletarget\n\t// handles the actual API calls separately\n\tthis.gateway = new EditorGateway( {\n\t\tapi: options.api,\n\t\ttitle: options.title,\n\t\tsectionId: options.sectionId,\n\t\toldId: options.oldId\n\t} );\n\n\tthis.origDataPromise = this.options.dataPromise || mw.libs.ve.targetLoader.requestPageData(\n\t\t'visual',\n\t\toptions.titleObj.getPrefixedDb(),\n\t\t{\n\t\t\tsessionStore: true,\n\t\t\tsection: options.sectionId || null,\n\t\t\toldId: options.oldId || undefined,\n\t\t\ttargetName: ve.init.mw.MobileArticleTarget.static.trackingName,\n\t\t\tpreload: options.preload,\n\t\t\tpreloadparams: options.preloadparams,\n\t\t\teditintro: options.editintro\n\t\t}\n\t);\n\n\tconst modes = [];\n\tthis.currentPage = currentPage();\n\tif ( this.currentPage.isVEVisualAvailable() ) {\n\t\tmodes.push( 'visual' );\n\t}\n\tif ( this.currentPage.isVESourceAvailable() ) {\n\t\tmodes.push( 'source' );\n\t}\n\n\tthis.target = ve.init.mw.targetFactory.create( 'article', this, {\n\t\t$element: this.$el,\n\t\t// string or null, but not undefined\n\t\tsection: this.options.sectionId || null,\n\t\tmodes: modes,\n\t\t// If source is passed in without being in modes, it'll just fall back to visual\n\t\tdefaultMode: this.options.mode === 'source' ? 'source' : 'visual'\n\t} );\n\tthis.target.once( 'surfaceReady', function () {\n\t\tsurfaceReady.resolve();\n\n\t\tthis.target.getSurface().getModel().getDocument().once( 'transact', function () {\n\t\t\tthis.log( { action: 'firstChange' } );\n\t\t}.bind( this ) );\n\t}.bind( this ) );\n\tlet firstLoad = true;\n\tthis.target.on( 'surfaceReady', function () {\n\t\tsetPreferredEditor( this.target.getDefaultMode() === 'source' ? 'SourceEditor' : 'VisualEditor' );\n\t\t// On first surfaceReady we wait for any dialogs to be closed before running targetInit.\n\t\t// On subsequent surfaceReady's (i.e. edit mode switch) we can initialize immediately.\n\t\tif ( !firstLoad ) {\n\t\t\tthis.targetInit();\n\t\t}\n\t\tfirstLoad = false;\n\t}.bind( this ) );\n\n\tthis.target.load( this.origDataPromise );\n\n\t// Overlay is only shown after this is resolved. It must be resolved\n\t// with the API response regardless of what we are waiting for.\n\tthis.dataPromise = this.origDataPromise.then( function ( data ) {\n\t\tthis.gateway.wouldautocreate =\n\t\t\tdata && data.visualeditor && data.visualeditor.wouldautocreate;\n\n\t\treturn surfaceReady.then( function () {\n\t\t\tthis.$el.removeClass( 'editor-overlay-ve-initializing' );\n\t\t\treturn data && data.visualeditor;\n\t\t}.bind( this ) );\n\t}.bind( this ) );\n}\n\nmfExtend( VisualEditorOverlay, EditorOverlayBase, {\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\ttemplatePartials: util.extend( {}, EditorOverlayBase.prototype.templatePartials, {\n\t\teditHeader: util.template( `\n<div class=\"overlay-header header initial-header hideable hidden\">\n\t<div class=\"toolbar\"></div>\n</div>\n\t\t` ),\n\t\tcontent: util.template( `\n<div class=\"surface\" lang=\"{{contentLang}}\" dir=\"{{contentDir}}\">\n</div>\n\t\t` )\n\t} ),\n\t/**\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\teditor: 'visualeditor',\n\t/**\n\t * Destroy the existing VisualEditor target.\n\t *\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tdestroyTarget: function () {\n\t\tif ( this.target ) {\n\t\t\tthis.target.destroy();\n\t\t\tthis.target = null;\n\t\t}\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tshow: function () {\n\t\tconst\n\t\t\toptions = this.options,\n\t\t\tshowAnonWarning = options.isAnon && !options.switched;\n\n\t\tEditorOverlayBase.prototype.show.apply( this, arguments );\n\n\t\t// log edit attempt\n\t\tthis.log( { action: 'ready' } );\n\t\tthis.log( { action: 'loaded' } );\n\n\t\tif ( !showAnonWarning ) {\n\t\t\tthis.targetInit();\n\t\t} else {\n\t\t\tthis.$anonWarning = this.createAnonWarning( this.options );\n\t\t\tthis.$anonTalkWarning = this.createAnonTalkWarning();\n\t\t\tthis.$el.append( [ this.$anonTalkWarning, this.$anonWarning ] );\n\t\t\tthis.$el.find( '.overlay-content' ).hide();\n\t\t}\n\n\t\tthis.emit( 'editor-loaded' );\n\t},\n\t/**\n\t * Initialize the target after it has been made visible\n\t * @memberof VisualEditorOverlay\n\t */\n\ttargetInit: function () {\n\t\t// Note this.target will not be set if an error occurred and/or destroyTarget was called.\n\t\tif ( this.target ) {\n\t\t\tthis.target.afterSurfaceReady();\n\t\t\tthis.scrollToLeadParagraph();\n\t\t\tthis.showEditNotices();\n\t\t}\n\t},\n\t/**\n\t * Scroll so that the lead paragraph in edit mode shows at the same place on the screen\n\t * as the lead paragraph in read mode.\n\t *\n\t * Their normal position is different because of (most importantly) the lead paragraph\n\t * transformation to move it before the infobox, and also invisible templates and slugs\n\t * caused by the presence of hatnote templates (both only shown in edit mode).\n\t * @memberof VisualEditorOverlay\n\t */\n\tscrollToLeadParagraph: function () {\n\t\tlet editLead, editLeadView, readLead, offset, initialCursorOffset;\n\n\t\tconst\n\t\t\tcurrentPageHTMLParser = this.options.currentPageHTMLParser,\n\t\t\tfakeScroll = this.options.fakeScroll,\n\t\t\t$window = $( window ),\n\t\t\tsection = this.target.section,\n\t\t\tsurface = this.target.getSurface(),\n\t\t\tmode = surface.getMode();\n\n\t\tif ( ( section === null || section === '0' ) && mode === 'visual' ) {\n\t\t\teditLead = identifyLeadParagraph( surface.getView().$attachedRootNode );\n\t\t\tif ( currentPageHTMLParser.getLeadSectionElement() ) {\n\t\t\t\treadLead = identifyLeadParagraph( currentPageHTMLParser.getLeadSectionElement() );\n\t\t\t}\n\n\t\t\tif ( editLead && readLead ) {\n\t\t\t\toffset = $( editLead ).offset().top - ( $( readLead ).offset().top - fakeScroll );\n\t\t\t\t// Set a model range to match\n\t\t\t\teditLeadView = $( editLead ).data( 'view' );\n\t\t\t\tif ( editLeadView ) {\n\t\t\t\t\tsurface.getModel().setLinearSelection(\n\t\t\t\t\t\tnew ve.Range( editLeadView.getModel().getRange().start )\n\t\t\t\t\t);\n\t\t\t\t\tinitialCursorOffset =\n\t\t\t\t\t\tsurface.getView().getSelection().getSelectionBoundingRect().top;\n\t\t\t\t\t// Ensure the surface is tall enough to scroll the cursor into view\n\t\t\t\t\tsurface.$element.css( 'min-height', $window.height() + initialCursorOffset - surface.padding.top );\n\t\t\t\t}\n\t\t\t\t$window.scrollTop( offset );\n\t\t\t}\n\t\t}\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tonBeforeExit: function ( exit, cancel ) {\n\t\tconst overlay = this;\n\t\tEditorOverlayBase.prototype.onBeforeExit.call( this, function () {\n\t\t\t// If this function is called, the parent method has decided that we should exit\n\t\t\texit();\n\t\t\t// VE-specific cleanup\n\t\t\toverlay.destroyTarget();\n\t\t}, cancel );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tonClickBack: function () {\n\t\tEditorOverlayBase.prototype.onClickBack.apply( this, arguments );\n\t\tthis.switchToEditor();\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tonClickAnonymous: function () {\n\t\tconst self = this;\n\t\tthis.$anonWarning.hide();\n\t\tthis.$anonTalkWarning.hide();\n\t\tself.$el.find( '.overlay-content' ).show();\n\t\tthis.targetInit();\n\t},\n\t/**\n\t * Reveal the editing interface.\n\t *\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\tswitchToEditor: function () {\n\t\tthis.showHidden( '.initial-header' );\n\t},\n\t/**\n\t * Loads an {SourceEditorOverlay} and replaces the existing {VisualEditorOverlay}\n\t *\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t * @param {jQuery.Promise} [dataPromise] Optional promise for loading content\n\t */\n\tswitchToSourceEditor: function ( dataPromise ) {\n\t\tconst self = this,\n\t\t\tSourceEditorOverlay = this.SourceEditorOverlay,\n\t\t\toptions = this.getOptionsForSwitch();\n\t\tthis.log( {\n\t\t\taction: 'abort',\n\t\t\ttype: 'switchnochange',\n\t\t\tmechanism: 'navigate'\n\t\t} );\n\t\tthis.logFeatureUse( {\n\t\t\tfeature: 'editor-switch',\n\t\t\taction: 'source-mobile'\n\t\t} );\n\n\t\t// Save a user setting indicating that this user prefers using the SourceEditor\n\t\tsetPreferredEditor( 'SourceEditor' );\n\n\t\tthis.$el.addClass( 'switching' );\n\t\tthis.$el.find( '.overlay-header-container' ).hide();\n\t\tthis.$el.append( fakeToolbar() );\n\t\tthis.target.getSurface().setReadOnly( true );\n\n\t\tif ( dataPromise ) {\n\t\t\t// If switching with edits we can't stay in section editing, as a VE edit\n\t\t\t// can always affect the whole document (e.g. references)\n\t\t\toptions.sectionId = null;\n\t\t\trouter.navigateTo( document.title, {\n\t\t\t\tpath: '#/editor/all',\n\t\t\t\tuseReplaceState: true\n\t\t\t} );\n\t\t}\n\t\tconst newOverlay = new SourceEditorOverlay( options, dataPromise );\n\t\tnewOverlay.getLoadingPromise().then( function () {\n\t\t\tself.switching = true;\n\t\t\tself.overlayManager.replaceCurrent( newOverlay );\n\t\t\tself.switching = false;\n\t\t} );\n\t},\n\t/**\n\t * @inheritdoc\n\t * @memberof VisualEditorOverlay\n\t * @instance\n\t */\n\thasChanged: function () {\n\t\tif ( this.saved ) {\n\t\t\t// If we just saved, there's not really any changes, and the\n\t\t\t// target is going to be destroyed in one tick\n\t\t\treturn false;\n\t\t}\n\t\treturn this.fromModified || (\n\t\t\tthis.target &&\n\t\t\tthis.target.getSurface() &&\n\t\t\tthis.target.getSurface().getModel().hasBeenModified()\n\t\t);\n\t}\n} );\n\nmodule.exports = VisualEditorOverlay;\n","const\n\tDrawer = require( '../mobile.startup/Drawer' ),\n\tBlockMessageDetails = require( './BlockMessageDetails' );\n\n/**\n * @private\n * @typedef {Object} BlockMessageOptions\n * @property {number} blockId representing the block\n * @property {boolean} partial is this a partial block?\n * @property {Object} creator\n * @property {string} creator.name of the blocker\n * @property {string} creator.url associated with the block\n * @property {string} reason for block\n * @property {string} [duration] of block e.g. \"1 week\"\n * @property {string} [expiry] of block, wrapped in parentheses\n *  e.g. \"(1st September 2019)\"\n */\n\n/**\n * This creates the drawer at the bottom of the screen that appears when a\n * blocked user tries to edit.\n *\n * @private\n * @param {BlockMessageOptions} props\n * @return {module:mobile.startup/Drawer}\n */\nmodule.exports = function blockMessageDrawer( props ) {\n\tconst blockDrawer = new Drawer( {\n\t\tclassName: 'drawer block-message',\n\t\tonBeforeHide: function ( drawer ) {\n\t\t\tdrawer.$el.remove();\n\t\t},\n\t\tonShow: function () {\n\t\t\tconst $drawer = blockDrawer.$el.find( '.drawer.block-message' ),\n\t\t\t\tdrawerTop = $drawer.offset().top - 100,\n\t\t\t\tcreatorTop = blockDrawer.$el.find( '.block-message-creator' ).offset().top - 100,\n\t\t\t\tbuttonsTop = blockDrawer.$el.find( '.block-message-buttons' ).offset().top - 100,\n\t\t\t\t$seeMore = blockDrawer.$el.find( '.block-message-see-more' ),\n\t\t\t\twiki = mw.config.get( 'wgDBname' );\n\n\t\t\t$drawer.css( 'top', drawerTop + ( buttonsTop - creatorTop ) );\n\t\t\t$seeMore.on(\n\t\t\t\t'click',\n\t\t\t\tfunction () {\n\t\t\t\t\tconst $container = blockDrawer.$el.find( '.block-message-container' );\n\t\t\t\t\t$drawer.css( 'top', 0 );\n\t\t\t\t\t$container.css( 'overflow-y', 'auto' );\n\t\t\t\t\t$container.css( 'height', buttonsTop - $container.offset().top );\n\t\t\t\t\t$seeMore.hide();\n\n\t\t\t\t\tif ( mw.config.get( 'wgMFTrackBlockNotices' ) ) {\n\t\t\t\t\t\tmw.track( 'counter.MediaWiki.BlockNotices.' + wiki + '.MobileFrontend.reasonShown', 1 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( mw.config.get( 'wgMFTrackBlockNotices' ) ) {\n\t\t\t\tmw.track( 'counter.MediaWiki.BlockNotices.' + wiki + '.MobileFrontend.shown', 1 );\n\t\t\t}\n\t\t},\n\t\tchildren: [\n\t\t\t( new BlockMessageDetails( props ) ).$el\n\t\t]\n\t} );\n\treturn blockDrawer;\n};\n","/* global $ */\n/**\n * Find first paragraph that has text content, i.e. paragraphs that are not empty.\n * Keep in sync with MoveLeadParagraphTransform::identifyLeadParagraph().\n *\n * @private\n * @param {jQuery} $body Where to search for paragraphs\n * @return {Node|null} The lead paragraph\n */\nmodule.exports = function identifyLeadParagraph( $body ) {\n\t// Keep in sync with MoveLeadParagraphTransform::isNotEmptyNode()\n\tfunction isNotEmptyNode( node ) {\n\t\t// Ignore VE whitespace characters\n\t\treturn !/^[\\s↵➞]*$/.test( node.textContent );\n\t}\n\n\t// Keep in sync with MoveLeadParagraphTransform::isNonLeadParagraph()\n\tfunction isNonLeadParagraph( node ) {\n\t\tnode = node.cloneNode( true );\n\t\tconst $node = $( node );\n\t\t// The paragraph itself can be an invisible template (T293834)\n\t\tif ( $node.hasClass( 've-ce-focusableNode-invisible' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Ignore non-content nodes, TemplateStyles and coordinates\n\t\t$node.find( '.ve-ce-branchNode-inlineSlug, .ve-ce-focusableNode-invisible, style, span#coordinates' ).remove();\n\t\tif ( isNotEmptyNode( node ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tconst $paragraphs = $body.children( 'p' );\n\tfor ( let i = 0; i < $paragraphs.length; i++ ) {\n\t\tconst p = $paragraphs[ i ];\n\t\tif ( !isNonLeadParagraph( p ) ) {\n\t\t\treturn p;\n\t\t}\n\t}\n\treturn null;\n};\n","const m = require( './../mobile.startup/moduleLoaderSingleton' ),\n\tSourceEditorOverlay = require( './SourceEditorOverlay' ),\n\tVisualEditorOverlay = require( './VisualEditorOverlay' );\n\n// Exposed for MobileFrontend mobile.init usage.\nm.define( 'mobile.editor.overlay/SourceEditorOverlay', SourceEditorOverlay );\nm.define( 'mobile.editor.overlay/VisualEditorOverlay', VisualEditorOverlay );\n","const util = require( '../mobile.startup/util' );\n\n/**\n * @param {string} blockinfo\n * @return {Object}\n */\nmodule.exports = function parseBlockInfo( blockinfo ) {\n\tconst blockInfo = {\n\t\tpartial: blockinfo.blockpartial || false,\n\t\tnoCreateAccount: blockinfo.blocknocreate || false,\n\t\tanonOnly: blockinfo.blockanononly === undefined ? true : blockinfo.blockanononly,\n\t\tcreator: {\n\t\t\tname: blockinfo.blockedby,\n\t\t\turl: null\n\t\t},\n\t\texpiry: null,\n\t\tduration: null,\n\t\treason: '',\n\t\tblockId: blockinfo.blockid\n\t};\n\n\t// Workaround to parse a message parameter for mw.message, see T96885\n\tfunction jqueryMsgParse( wikitext ) {\n\t\tconst parser = new mw.jqueryMsg.Parser();\n\t\ttry {\n\t\t\tconst ast = parser.wikiTextToAst( wikitext );\n\t\t\treturn parser.emitter.emit( ast ).html();\n\t\t} catch ( e ) {\n\t\t\t// Ignore error as it's probably the parser error. Usually this is because we\n\t\t\t// can't parse templates.\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// URL only useful if block creator is a local user\n\tif ( blockinfo.blockedbyid === 0 ) {\n\t\tblockInfo.creator.url = '';\n\t} else {\n\t\tblockInfo.creator.url = mw.Title.makeTitle(\n\t\t\tmw.config.get( 'wgNamespaceIds' ).user,\n\t\t\tblockInfo.creator.name\n\t\t).getUrl();\n\t}\n\n\tif ( [ 'infinite', 'indefinite', 'infinity', 'never' ].indexOf( blockinfo.blockexpiry ) === -1 ) {\n\t\tblockInfo.expiry = mw.message( 'parentheses', blockinfo.blockexpiryformatted ).escaped();\n\t\tblockInfo.duration = blockinfo.blockexpiryrelative;\n\t}\n\n\tconst reason = blockinfo.blockreason;\n\tif ( reason ) {\n\t\tblockInfo.reason = jqueryMsgParse( reason ) || mw.html.escape( reason );\n\t\tblockInfo.parsedReason = ( new mw.Api() ).get( {\n\t\t\taction: 'parse',\n\t\t\tformatversion: 2,\n\t\t\ttext: reason,\n\t\t\tcontentmodel: 'wikitext'\n\t\t} ).then( function ( result ) {\n\t\t\treturn result.parse.text;\n\t\t} ).catch( function () {\n\t\t\treturn jqueryMsgParse( reason ) || mw.html.escape( reason );\n\t\t} );\n\t} else {\n\t\tblockInfo.reason = mw.message( 'mobile-frontend-editor-generic-block-reason' ).escaped();\n\t\tblockInfo.parsedReason = util.Deferred().resolve( blockInfo.reason ).promise();\n\t}\n\n\treturn blockInfo;\n};\n","/**\n * Build a save failure message from the API response\n *\n * @param {Object} data API response\n * @return {string} message HTML text describing the failure for display to the user\n */\nmodule.exports = function saveFailureMessage( data ) {\n\t// In most cases, return the error message from the API directly.\n\t// Handle a few exceptions where it is unsuitable for end-users\n\t// (some error messages are seemingly intended for tool developers).\n\n\tconst code = data && data.errors && data.errors[0] && data.errors[0].code;\n\n\tif ( code === 'editconflict' ) {\n\t\treturn mw.msg( 'mobile-frontend-editor-error-conflict' );\n\t}\n\n\tif ( code === 'readonly' ) {\n\t\treturn data.errors[0].html + '<br>' + data.errors[0].data.readonlyreason;\n\t}\n\n\tif ( data.errors && data.errors[0] ) {\n\t\treturn data.errors[0].html;\n\t}\n\n\t// This probably indicates a connection problem and a \"fake\" response\n\t// generated by mediawiki.Api. TODO Give a better error message here.\n\treturn '';\n};\n","/**\n * Store the user's preferred editor\n *\n * @param {string} editor 'VisualEditor' or 'SourceEditor'\n */\nmodule.exports = function setPreferredEditor( editor ) {\n\tif ( mw.user.isNamed() ) {\n\t\tnew mw.Api().saveOption( 'mobile-editor', editor ).then( function () {\n\t\t\tmw.user.options.set( 'mobile-editor', editor );\n\t\t} );\n\t} else {\n\t\tmw.storage.set( 'preferredEditor', editor );\n\t}\n};\n","const util = require( './util.js' ),\n\tmfExtend = require( './mfExtend' ),\n\tView = require( './View' );\n\n/**\n * Builds a section of a page\n *\n * @extends module:mobile.startup/View\n * @ignore\n * @param {Object} options Configuration options\n */\nfunction Section( options ) {\n\tconst self = this;\n\toptions.tag = 'h' + options.level;\n\tthis.line = options.line;\n\tthis.text = options.text;\n\tthis.hasReferences = options.hasReferences || false;\n\tthis.id = options.id || null;\n\tthis.anchor = options.anchor;\n\tthis.subsections = [];\n\t( options.subsections || [] ).forEach( ( section ) => self.subsections.push(\n\t\tnew Section( section ) ) );\n\tView.call( this, options );\n}\n\nmfExtend( Section, View, {\n\ttemplate: util.template( `\n<h{{level}} id=\"{{anchor}}\">{{{line}}}</h{{level}}>\n{{{text}}}\n\t` ),\n\t/**\n\t * @memberof Section\n\t * @instance\n\t * @mixes module:mobile.startup/View#defaults\n\t * @property {Object} defaults Default options hash.\n\t * @property {string} defaults.text Section text.\n\t */\n\tdefaults: {\n\t\tline: undefined,\n\t\ttext: ''\n\t}\n} );\n\nmodule.exports = Section;\n"],"names":["_typeof","o","Symbol","iterator","constructor","prototype","_defineProperties","e","r","t","length","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","i","toPrimitive","call","TypeError","String","_toPrimitive","_callSuper","_getPrototypeOf","ReferenceError","_assertThisInitialized","_possibleConstructorReturn","_isNativeReflectConstruct","Reflect","construct","apply","Boolean","valueOf","setPrototypeOf","getPrototypeOf","bind","__proto__","_setPrototypeOf","Button","require","View","Icon","util","BlockMessageDetails","_View","a","n","_classCallCheck","arguments","create","value","_inherits","get","createDetailsAnchorHref","blockId","render","mw","getUrl","wpTarget","createDetailsAnchorLabel","msg","createTitle","msgKey","user","isAnon","this","partial","createBody","anonOnly","noCreateAccount","seeMoreLink","reasonHeader","creatorHeader","options","expiryHeader","cta","config","progressive","wiki","label","href","Title","quiet","tagName","additionalClassNames","track","events","click","drawer","$el","find","prepend","getButtonConfig","icon","parsedReason","then","htmlReason","html","template","module","exports","actionParams","EditorGateway","api","title","sectionId","oldId","preload","preloadparams","editintro","content","undefined","fromModified","hasChanged","getBlockInfo","pageObj","blockedError","actions","edit","Array","isArray","some","error","indexOf","code","data","blockinfo","getContent","self","resolve","Deferred","text","notices","prop","rvprop","inprop","inpreloadcustom","inpreloadparams","ineditintrocustom","titles","intestactions","intestactionsautocreate","intestactionsdetail","rvstartid","rvsection","resp","reject","query","pages","missing","preloadcontent","preloadisdefault","revision","revisions","timestamp","originalContent","wouldautocreate","setContent","save","apiOptions","result","action","errorformat","errorlang","errorsuselocal","formatversion","summary","captchaid","captchaId","captchaword","captchaWord","basetimestamp","starttimestamp","section","postWithToken","newrevid","tempusercreatedredirect","tempusercreated","abortPreview","_pending","abort","getPreview","sectionLine","extend","sectionpreview","disableeditsection","pst","mobileformat","useskin","disabletoc","acquireTempUserName","post","parse","sections","anchor","line","id","promise","Overlay","parseBlockInfo","headers","icons","IconButton","mfExtend","blockMessageDrawer","MessageBox","mwUser","EditVeTool","toolGroup","classes","super","EditorOverlayBase","params","onBeforeExit","className","isBorderBox","isNewPage","placeholder","summaryRequestMsg","overlayManager","OO","inheritClass","ui","Tool","static","name","group","onSelect","onUpdateState","defaults","hasToolbar","continueMsg","closeMsg","summaryMsg","captchaMsg","captchaTryAgainMsg","switchMsg","confirmMsg","licenseMsg","log","editor_interface","editor","logFeatureUse","confirmSave","window","confirm","onSaveComplete","newRevId","redirectUrl","tempUserCreated","saved","showSaveCompleteMsg","revision_id","setTimeout","location","hash","__non_webpack_require__","fireHook","onSaveFailure","errors","captcha","message","type","badtoken","assertanonfailed","assertuserfailed","assertnameduserfailed","spamblacklist","pagedeleted","editconflict","reportError","errorNotice","heading","$errorNoticeContainer","hideErrorNotice","empty","onStageChanges","showHidden","scrollTo","onSaveBegin","confirmAborted","preRender","formHeader","editSwitcher","editingMsg","readOnly","weight","disabled","cancel","saveHeader","previewingMsg","savingHeader","postRender","show","allowCloseWindow","confirmCloseWindow","test","namespace","hook","fire","onClickBack","onClickSubmit","onClickContinue","onClickAnonymous","exit","switching","windowManager","getWindowManager","addWindows","widgets","AbandonEditDialog","openWindow","closed","mechanism","onExit","target","edited","getParamValue","reload","release","createAnonWarning","$actions","$","addClass","contLangMessages","gateway","$anonWarning","append","returnto","returnTo","warning","queryParams","signupParams","signupQueryParams","anonymousEditorActions","block","map","createAnonTalkWarning","clone","getOptionsForSwitch","switched","currentPageHTMLParser","fakeScroll","titleObj","contentLang","contentDir","getLoadingPromise","dataPromise","showEditNotices","overlay","editNotices","keys","filter","storageKey","storage","set","loader","using","$container","forEach","$notice","alert","feature","handleCaptcha","details","$input","captchaShown","val","attr","mime","detach","url","question","Section","saveFailureMessage","fakeToolbar","setPreferredEditor","VisualEditorOverlay","currentPage","SourceEditorOverlay","isFirefox","navigator","userAgent","isVEVisualAvailable","templatePartials","_resizeEditor","onInputWikitextEditor","_hidePreview","toolFactory","ToolFactory","toolGroupFactory","ToolGroupFactory","register","libs","ve","MWEditModeVisualTool","MWEditModeSourceTool","switchToolbar","Toolbar","on","mode","_switchToVisualEditor","setup","include","$element","emit","spinner","hideSpinner","$preview","$content","one","docEl","document","documentElement","scrollTop","blockScroll","addEventListener","removeEventListener","summaryTextArea","MultilineTextInputWidget","maxRows","_loadContent","hide","$anonTalkWarning","$anonHiddenButtons","hideSpinnerAndShowPreview","getDocument","showSpinner","mainpage","parsedText","parsedSectionLine","parseHTML","el","replaceWith","removeClass","container","$scrollContainer","Element","getClosestScrollableContainer","css","height","wikitext","targetLoader","addPlugin","loadModules","requestPageData","targetName","modified","newOverlay","replaceCurrent","remove","getEditSummary","getValue","URL","searchParams","search","fireHookOnPageReload","router","identifyLeadParagraph","getSingleton","surfaceReady","appendChild","origDataPromise","getPrefixedDb","sessionStore","init","MobileArticleTarget","trackingName","modes","push","isVESourceAvailable","targetFactory","defaultMode","once","getSurface","getModel","firstLoad","getDefaultMode","targetInit","load","visualeditor","editHeader","destroyTarget","destroy","showAnonWarning","afterSurfaceReady","scrollToLeadParagraph","editLead","editLeadView","readLead","offset","initialCursorOffset","$window","surface","getMode","getView","$attachedRootNode","getLeadSectionElement","top","setLinearSelection","Range","getRange","start","getSelection","getSelectionBoundingRect","padding","switchToEditor","switchToSourceEditor","setReadOnly","navigateTo","path","useReplaceState","hasBeenModified","Drawer","props","blockDrawer","onBeforeHide","onShow","$drawer","drawerTop","creatorTop","buttonsTop","$seeMore","children","$body","isNonLeadParagraph","node","cloneNode","$node","hasClass","textContent","isNotEmptyNode","$paragraphs","p","m","define","blockInfo","blockpartial","blocknocreate","blockanononly","creator","blockedby","expiry","duration","reason","blockid","jqueryMsgParse","parser","jqueryMsg","Parser","ast","wikiTextToAst","emitter","blockedbyid","makeTitle","blockexpiry","blockexpiryformatted","escaped","blockexpiryrelative","blockreason","escape","Api","contentmodel","catch","readonlyreason","isNamed","saveOption","tag","level","hasReferences","subsections"],"sourceRoot":""}