From: jenkins-bot Date: Tue, 7 Apr 2015 01:03:42 +0000 (+0000) Subject: Merge "MessagePoster followup: Dependency and docs" X-Git-Tag: 1.31.0-rc.0~11825 X-Git-Url: https://git.cyclocoop.org/?a=commitdiff_plain;h=0eebe5dca53affdf21404a10b808ea3faa5c67b7;hp=b2f4fd38db7868e7088bc9b59a78a53e445265c7;p=lhc%2Fweb%2Fwiklou.git Merge "MessagePoster followup: Dependency and docs" --- diff --git a/resources/Resources.php b/resources/Resources.php index cbe6b82e6f..e56d5577c6 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -974,6 +974,7 @@ return array( ), 'dependencies' => array( 'mediawiki.api.edit', + 'mediawiki.messagePoster', ), 'targets' => array( 'desktop', 'mobile' ), ), diff --git a/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.MessagePoster.js b/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.MessagePoster.js index b021558193..91366ff593 100644 --- a/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.MessagePoster.js +++ b/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.MessagePoster.js @@ -21,14 +21,14 @@ * by MessagePosters that require one, unless the message already contains the string * ~~~. * @return {jQuery.Promise} Promise completing when the post succeeds or fails. - * @return {Function} return.done - * @return {Function} return.fail - * @return {string} return.fail.primaryError Primary error code. For a mw.Api failure, - * this should be 'api-fail'. - * @return {string} return.fail.secondaryError Secondary error code. For a mw.Api failure, - * this, should be mw.Api's code, e.g. 'http', 'ok-but-empty', or the error passed through - * from the server. - * @return {Mixed} return.fail.details Further details about the error + * For failure, will be rejected with three arguments: + * + * - primaryError - Primary error code. For a mw.Api failure, + * this should be 'api-fail'. + * - secondaryError - Secondary error code. For a mw.Api failure, + * this, should be mw.Api's code, e.g. 'http', 'ok-but-empty', or the error passed through + * from the server. + * - details - Further details about the error * * @localdoc * The base class currently does nothing, but could be used for shared analytics or diff --git a/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js b/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js index 098bc88075..9d280800bd 100644 --- a/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js +++ b/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js @@ -50,11 +50,12 @@ * API and ResourceLoader requests in the background. * * @param {mw.Title} title Title that will be posted to - * @return {jQuery.Promise} Promise for the MessagePoster - * @return {Function} return.done Called if MessagePoster is retrieved - * @return {mw.messagePoster.MessagePoster} return.done.poster MessagePoster - * @return {Function} return.fail Called if MessagePoster could not be constructed - * @return {string} return.fail.errorCode String error code + * @return {jQuery.Promise} Promise resolving to a mw.messagePoster.MessagePoster. + * For failure, rejected with up to three arguments: + * + * - errorCode Error code string + * - error Error explanation + * - details Further error details */ MwMessagePosterFactory.prototype.create = function ( title ) { var pageId, page, contentModel, moduleName,