r107014 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107013‎ | r107014 | r107015 >
Date:23:56, 21 December 2011
Author:krinkle
Status:ok
Tags:
Comment:
[mediawiki.api] bug fixes

* error callback of some convenience functions was broken. Second argument to get() is ajaxOptions, there is no third argument.
Modified paths:
  • /trunk/phase3/resources/mediawiki/mediawiki.api.edit.js (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.api.parse.js (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.api.titleblacklist.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki/mediawiki.api.parse.js
@@ -10,10 +10,10 @@
1111 *
1212 * @param wikiText {String}
1313 * @param success {Function} callback to which to pass success HTML
14 - * @param error {Function} callback if error (optional)
 14+ * @param err {Function} callback if error (optional)
1515 * @return {jqXHR}
1616 */
17 - parse: function( wikiText, success, error ) {
 17+ parse: function( wikiText, success, err ) {
1818 var params = {
1919 text: wikiText,
2020 action: 'parse'
@@ -23,7 +23,7 @@
2424 success( data.parse.text['*'] );
2525 }
2626 };
27 - return this.get( params, ok, error );
 27+ return this.get( params, { ok: ok, err: err } );
2828 }
2929
3030 } );
Index: trunk/phase3/resources/mediawiki/mediawiki.api.titleblacklist.js
@@ -44,7 +44,7 @@
4545 }
4646 };
4747
48 - return this.get( params, ok, err );
 48+ return this.get( params, { ok: ok, err: err } );
4949 }
5050
5151 } );
Index: trunk/phase3/resources/mediawiki/mediawiki.api.edit.js
@@ -42,7 +42,7 @@
4343 err( code, result );
4444 }
4545 };
46 - return api.post( params, { 'ok' : ok, 'err' : getTokenIfBad });
 46+ return api.post( params, { ok : ok, err : getTokenIfBad });
4747 }
4848 },
4949

Status & tagging log