r74537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74536‎ | r74537 | r74538 >
Date:04:23, 9 October 2010
Author:neilk
Status:deferred
Tags:
Comment:
normalized options in wrong place; fixed
Modified paths:
  • /branches/uploadwizard/extensions/UploadWizard/resources/mw.Api.js (modified) (history)

Diff [purge]

Index: branches/uploadwizard/extensions/UploadWizard/resources/mw.Api.js
@@ -55,7 +55,7 @@
5656
5757 // caller can supply handlers for http transport error or api errors
5858 err: function( code, result ) {
59 - var errorMsg = "API error: " + type + " : " + code;
 59+ var errorMsg = "mw.Api error: " + code;
6060 mw.log( errorMsg );
6161 },
6262
@@ -104,7 +104,8 @@
105105 * @param {Object|Function} ajax properties, or just a success function
106106 */
107107 get: function( parameters, ajaxOptions ) {
108 - ajaxOptions.type = 'get';
 108+ ajaxOptions = this.normalizeAjaxOptions( ajaxOptions );
 109+ ajaxOptions.type = 'GET';
109110 this.ajax( parameters, ajaxOptions );
110111 },
111112
@@ -116,7 +117,8 @@
117118 * @param {Object|Function} ajax properties, or just a success function
118119 */
119120 post: function( parameters, ajaxOptions ) {
120 - ajaxOptions.type = 'post';
 121+ ajaxOptions = this.normalizeAjaxOptions( ajaxOptions );
 122+ ajaxOptions.type = 'POST';
121123 this.ajax( parameters, ajaxOptions );
122124 },
123125
@@ -127,7 +129,6 @@
128130 * @param {Object} ajax properties
129131 */
130132 ajax: function( parameters, ajaxOptions ) {
131 - ajaxOptions = this.normalizeAjaxOptions( ajaxOptions );
132133 parameters = $j.extend( {}, this.defaults.parameters, parameters );
133134 ajaxOptions = $j.extend( {}, this.defaults.ajax, ajaxOptions );
134135 ajaxOptions.data = parameters;

Status & tagging log