Merge "Remove #wpTextbox1 fallback from ArticleTargetLoader#requestPageData"

This commit is contained in:
jenkins-bot 2017-04-10 17:05:03 +00:00 committed by Gerrit Code Review
commit 77987b976d
2 changed files with 6 additions and 7 deletions

View file

@ -252,7 +252,9 @@
section,
oldid,
'mwTarget', // ve.init.mw.DesktopArticleTarget.static.name
modified
modified,
// If switching to visual, check if we have wikitext to convert
mode === 'visual' ? $( '#wpTextbox1' ).textSelection( 'getContents' ) : undefined
);
} )
.done( incrementLoadingProgress );

View file

@ -103,13 +103,14 @@
* @param {string} [oldid] Old revision ID, current if omitted
* @param {string} [targetName] Optional target name for tracking
* @param {boolean} [modified] The page was been modified before loading (e.g. in source mode)
* @param {string} [wikitext] Wikitext to convert to HTML. The original document is fetched if undefined.
* @return {jQuery.Promise} Abortable promise resolved with a JSON object
*/
requestPageData: function ( mode, pageName, section, oldid, targetName, modified ) {
requestPageData: function ( mode, pageName, section, oldid, targetName, modified, wikitext ) {
if ( mode === 'source' ) {
return this.requestWikitext( pageName, section, oldid, targetName, modified );
} else {
return this.requestParsoidData( pageName, oldid, targetName, modified );
return this.requestParsoidData( pageName, oldid, targetName, modified, wikitext );
}
},
@ -168,10 +169,6 @@
'Api-User-Agent': 'VisualEditor-MediaWiki/' + mw.config.get( 'wgVersion' )
};
if ( wikitext === undefined ) {
wikitext = $( '#wpTextbox1' ).textSelection( 'getContents' );
}
if (
// wikitext can be an empty string
wikitext !== undefined &&