From: eranroz Date: Fri, 28 Feb 2014 07:46:13 +0000 (+0200) Subject: Update mw.api.watch according to new Watch API X-Git-Tag: 1.31.0-rc.0~16783^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=f3a7a5c4b34c9999ccd90236d695fe36af604578;p=lhc%2Fweb%2Fwiklou.git Update mw.api.watch according to new Watch API * Using titles instead of title which is deprecated * Allow operation on multiple pages Follow up of I820dcb64d469616b10741df013911197cc5bde29 Change-Id: Ic77b546c256fa70f253c7508defe4c0002258b2a --- diff --git a/resources/mediawiki.api/mediawiki.api.watch.js b/resources/mediawiki.api/mediawiki.api.watch.js index 49a4c622e6..ab8a5127de 100644 --- a/resources/mediawiki.api/mediawiki.api.watch.js +++ b/resources/mediawiki.api/mediawiki.api.watch.js @@ -8,7 +8,7 @@ * @private * @context mw.Api * - * @param {String|mw.Title} page Full page name or instance of mw.Title + * @param {string|mw.Title|string[]|mw.Title[]} page Full page name or instance of mw.Title or array of pages * @param {Function} [ok] Success callback (deprecated) * @param {Function} [err] Error callback (deprecated) * @return {jQuery.Promise} @@ -28,7 +28,7 @@ params = { action: 'watch', - title: String( page ), + titles: $.isArray( page ) ? page.join( '|' ) : String( page ), token: mw.user.tokens.get( 'watchToken' ), uselang: mw.config.get( 'wgUserLanguage' ) };