Merge "ArticleTarget: saveSuccess wasn't receiving expected arguments"

This commit is contained in:
jenkins-bot 2019-07-02 19:16:03 +00:00 committed by Gerrit Code Review
commit bad500da7b
2 changed files with 22 additions and 4 deletions

View file

@ -96,6 +96,17 @@ OO.inheritClass( ve.init.mw.ArticleTarget, ve.init.mw.Target );
/**
* @event save
* @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 {Object} lastModified Object containing user-formatted date
* and time strings, or undefined if we made no change.
* @param {string} contentSub HTML to show as the content subtitle
* @param {Array} modules The modules to be loaded on the page
* @param {Object} jsconfigvars The mw.config values needed on the page
* Fired immediately after a save is successfully completed
*/
/**
@ -680,7 +691,7 @@ ve.init.mw.ArticleTarget.prototype.saveComplete = function () {
this.initialEditSummary = null;
this.saveDeferred.resolve();
this.emit( 'save' );
this.emit.apply( this, [ 'save' ].concat( Array.prototype.slice.call( arguments ) ) );
};
/**

View file

@ -106,9 +106,16 @@ ve.init.mw.ArticleTargetEvents.prototype.onSaveInitiated = function () {
/**
* Track when the save is complete
*
* @param {string} content
* @param {string} categoriesHtml
* @param {number} newRevId
* @param {string} content Rendered page HTML from server
* @param {string} categoriesHtml Rendered categories HTML from server
* @param {number} newRevId 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 {Object} lastModified Object containing user-formatted date
* and time strings, or undefined if we made no change.
* @param {string} contentSub HTML to show as the content subtitle
* @param {Array} modules The modules to be loaded on the page
* @param {Object} jsconfigvars The mw.config values needed on the page
*/
ve.init.mw.ArticleTargetEvents.prototype.onSaveComplete = function ( content, categoriesHtml, newRevId ) {
this.trackTiming( 'performance.user.saveComplete', { duration: ve.now() - this.timings.saveInitiated } );