Merge "Revert "Update displaytitle on save (try #2)""

This commit is contained in:
jenkins-bot 2014-06-19 00:36:19 +00:00 committed by Gerrit Code Review
commit 9e7c60a4e4
3 changed files with 5 additions and 28 deletions

View file

@ -116,15 +116,6 @@ class ApiVisualEditorEdit extends ApiVisualEditor {
}
$result['isRedirect'] = $page->isRedirect();
$parserOutput = $this->getOutput()->getWikiPage()->getParserOutput(
$this->getOutput()->parserOptions()
);
if ( $parserOutput ) {
$result['displayTitleHtml'] = $parserOutput->getDisplayTitle();
} else {
wfDebug( '[VE] ApiVisualEditorEdit - parserOutput was false' );
}
if ( isset( $saveresult['edit']['newrevid'] ) ) {
$result['newrevid'] = intval( $saveresult['edit']['newrevid'] );
}

View file

@ -424,11 +424,9 @@ ve.init.mw.ViewPageTarget.prototype.onSurfaceReady = function () {
* @method
* @param {string} html Rendered page HTML from server
* @param {string} categoriesHtml Rendered categories HTML from server
* @param {number} newid New revision id, undefined if unchanged
* @param {boolean} isRedirect Whether this page is a redirect or not
* @param {string} displayTitle What HTML to show as the page title
* @param {number} [newid] New revision id, undefined if unchanged
*/
ve.init.mw.ViewPageTarget.prototype.onSave = function ( html, categoriesHtml, newid, isRedirect, displayTitle ) {
ve.init.mw.ViewPageTarget.prototype.onSave = function ( html, categoriesHtml, newid, isRedirect ) {
var newUrlParams, watchChecked;
this.saveDeferred.resolve();
if ( !this.pageExists || this.restoring ) {
@ -472,7 +470,7 @@ ve.init.mw.ViewPageTarget.prototype.onSave = function ( html, categoriesHtml, ne
}
this.saveDialog.close();
this.saveDialog.reset();
this.replacePageContent( html, categoriesHtml, isRedirect, displayTitle );
this.replacePageContent( html, categoriesHtml, isRedirect );
this.setupSectionEditLinks();
this.tearDownBeforeUnloadHandler();
this.deactivate( true );
@ -1538,10 +1536,8 @@ ve.init.mw.ViewPageTarget.prototype.onWindowPopState = function ( e ) {
* @method
* @param {string} html Rendered HTML from server
* @param {string} categoriesHtml Rendered categories HTML from server
* @param {boolean} isRedirect Whether this page is a redirect or not
* @param {string} displayTitle What HTML to show as the page title
*/
ve.init.mw.ViewPageTarget.prototype.replacePageContent = function ( html, categoriesHtml, isRedirect, displayTitle ) {
ve.init.mw.ViewPageTarget.prototype.replacePageContent = function ( html, categoriesHtml, isRedirect ) {
var $content = $( $.parseHTML( html ) ), $editableContent;
if ( $( '#mw-imagepage-content' ).length ) {
@ -1561,9 +1557,6 @@ ve.init.mw.ViewPageTarget.prototype.replacePageContent = function ( html, catego
}
mw.hook( 'wikipage.content' ).fire( $editableContent.empty().append( $content ) );
if ( displayTitle ) {
$( '#content > #firstHeading > span' ).html( displayTitle );
}
$( '#catlinks' ).replaceWith( categoriesHtml );
if ( isRedirect ) {
$( '#contentSub' ).text( ve.msg( 'redirectpagesub' ) );

View file

@ -543,14 +543,7 @@ ve.init.mw.Target.onSave = function ( doc, saveData, response ) {
} else if ( typeof data.content !== 'string' ) {
this.onSaveError( doc, saveData, null, 'Invalid HTML content in response from server', response );
} else {
this.emit(
'save',
data.content,
data.categorieshtml,
data.newrevid,
data.isRedirect,
data.displayTitleHtml || null
);
this.emit( 'save', data.content, data.categorieshtml, data.newrevid, data.isRedirect );
}
};