r84221 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84220‎ | r84221 | r84222 >
Date:01:19, 18 March 2011
Author:neilk
Status:deferred
Tags:
Comment:
make API error messages work when calls aborted, also make sure we import all messages
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizardHooks.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.Api.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizardHooks.php
@@ -89,12 +89,6 @@
9090 'resources/jquery/jquery.removeCtrl.css',
9191 ),
9292 'messages' => array(
93 - 'linktest',
94 - 'pluraltest',
95 - 'magictest',
96 - 'namespacedtest',
97 - 'extremelycomplextest',
98 - 'internallinktest',
9993 'uploadwizard',
10094 'uploadwizard-desc',
10195 'mwe-upwiz-js-off',
@@ -105,31 +99,70 @@
106100 'mwe-upwiz-step-deeds',
107101 'mwe-upwiz-step-details',
108102 'mwe-upwiz-step-thanks',
109 - 'mwe-upwiz-api-error-code',
110 - 'mwe-upwiz-tutorial-error',
111 - 'mwe-upwiz-intro',
 103+ 'mwe-upwiz-api-error-http',
 104+ 'mwe-upwiz-api-error-ok-but-empty',
 105+ 'mwe-upwiz-api-error-unknown-code',
 106+ 'mwe-upwiz-api-error-uploaddisabled',
 107+ 'mwe-upwiz-api-error-nomodule',
 108+ 'mwe-upwiz-api-error-mustbeposted',
 109+ 'mwe-upwiz-api-error-badaccess-groups',
 110+ 'mwe-upwiz-api-error-stashfailed',
 111+ 'mwe-upwiz-api-error-missingresult',
 112+ 'mwe-upwiz-api-error-missingparam',
 113+ 'mwe-upwiz-api-error-invalid-session-key',
 114+ 'mwe-upwiz-api-error-copyuploaddisabled',
 115+ 'mwe-upwiz-api-error-mustbeloggedin',
 116+ 'mwe-upwiz-api-error-empty-file',
 117+ 'mwe-upwiz-api-error-file-too-large',
 118+ 'mwe-upwiz-api-error-filetype-missing',
 119+ 'mwe-upwiz-api-error-filetype-banned',
 120+ 'mwe-upwiz-api-error-filename-tooshort',
 121+ 'mwe-upwiz-api-error-illegal-filename',
 122+ 'mwe-upwiz-api-error-verification-error',
 123+ 'mwe-upwiz-api-error-hookaborted',
 124+ 'mwe-upwiz-api-error-unknown-error',
 125+ 'mwe-upwiz-api-error-internal-error',
 126+ 'mwe-upwiz-api-error-overwrite',
 127+ 'mwe-upwiz-api-error-badtoken',
 128+ 'mwe-upwiz-api-error-fetchfileerror',
 129+ 'mwe-upwiz-api-warning-duplicate',
 130+ 'mwe-upwiz-api-warning-exists',
 131+ 'mwe-upwiz-tutorial-error-localized-file-missing',
 132+ 'mwe-upwiz-tutorial-error-file-missing',
 133+ 'mwe-upwiz-tutorial-error-cannot-transform',
 134+ 'mwe-upwiz-help-desk',
112135 'mwe-upwiz-add-file-n',
113136 'mwe-upwiz-add-file-0',
 137+ 'mwe-upwiz-add-file-0-free',
114138 'mwe-upwiz-browse',
 139+ 'mwe-upwiz-transport-started',
 140+ 'mwe-upwiz-uploading',
115141 'mwe-upwiz-transported',
 142+ 'mwe-upwiz-stashed-upload',
 143+ 'mwe-upwiz-getting-metadata',
 144+ 'mwe-upwiz-failed',
116145 'mwe-upwiz-click-here',
117 - 'mwe-upwiz-uploading',
118146 'mwe-upwiz-editing',
119147 'mwe-upwiz-remove',
120148 'mwe-upwiz-remove-upload',
121149 'mwe-upwiz-remove-description',
122150 'mwe-upwiz-upload',
 151+ 'mwe-upwiz-file-all-ok',
 152+ 'mwe-upwiz-file-some-failed',
 153+ 'mwe-upwiz-file-retry',
 154+ 'mwe-upwiz-next-file-despite-failures',
 155+ 'mwe-upwiz-skip-tutorial-future',
 156+ 'mwe-upwiz-file-all-failed',
123157 'mwe-upwiz-upload-count',
124158 'mwe-upwiz-progressbar-uploading',
125159 'mwe-upwiz-finished',
126160 'mwe-upwiz-secs-remaining',
127161 'mwe-upwiz-mins-secs-remaining',
128162 'mwe-upwiz-hrs-mins-secs-remaining',
129 - 'mwe-upwiz-deeds-intro',
130163 'mwe-upwiz-deeds-macro-prompt',
131164 'mwe-upwiz-deeds-custom-prompt',
132 - 'mwe-upwiz-details-intro',
133165 'mwe-upwiz-source-ownwork',
 166+ 'mwe-upwiz-source-ownwork-assert-any-license',
134167 'mwe-upwiz-source-ownwork-assert',
135168 'mwe-upwiz-source-ownwork-assert-custom',
136169 'mwe-upwiz-source-ownwork-assert-note',
@@ -167,7 +200,6 @@
168201 'mwe-upwiz-macro-edit',
169202 'mwe-upwiz-thanks-intro',
170203 'mwe-upwiz-thanks-explain',
171 - 'mwe-upwiz-thanks-caption',
172204 'mwe-upwiz-thanks-link',
173205 'mwe-upwiz-thanks-wikitext',
174206 'mwe-upwiz-thanks-url',
@@ -195,7 +227,9 @@
196228 'mwe-upwiz-tooltip-source',
197229 'mwe-upwiz-tooltip-sign',
198230 'mwe-upwiz-tooltip-title',
 231+ 'mwe-upwiz-dialog-title',
199232 'mwe-upwiz-tooltip-description',
 233+ 'mwe-upwiz-tooltip-categories',
200234 'mwe-upwiz-tooltip-other',
201235 'mwe-upwiz-tooltip-more-info',
202236 'mwe-upwiz-file-need-file',
@@ -205,6 +239,7 @@
206240 'mwe-upwiz-deeds-need-license',
207241 'mwe-upwiz-license-incompatible-pd',
208242 'mwe-upwiz-license-incompatible-cc',
 243+ 'mwe-upwiz-license-show-all-any-license',
209244 'mwe-upwiz-license-show-all',
210245 'mwe-upwiz-license-show-recommended',
211246 'mwe-upwiz-error-signature-blank',
@@ -224,10 +259,7 @@
225260 'mwe-upwiz-categories',
226261 'mwe-upwiz-categories-add',
227262 'mwe-upwiz-category-remove',
228 - 'mwe-upwiz-getting-metadata',
229 - 'mwe-upwiz-stashed-upload',
230 - 'mwe-upwiz-dialog-title',
231 - 'mwe-upwiz-tooltip-categories',
 263+ 'mwe-upwiz-thanks-caption',
232264 'mwe-upwiz-help-popup',
233265 'mwe-upwiz-help-popup-title'
234266 ),
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js
@@ -139,23 +139,16 @@
140140 * Set the status line for this upload with an internationalized message string.
141141 * @param String msgKey: key for the message
142142 * @param Array args: array of values, in case any need to be fed to the image.
 143+ * @param Boolean error: if true, show an error
143144 */
144145 setStatus: function( msgKey, args ) {
145146 if ( !mw.isDefined( args ) ) {
146147 args = [];
147148 }
148 - this.setStatusStr( gM( msgKey, args ) );
 149+ $j( this.div ).find( '.mwe-upwiz-file-status' ).html( gM( msgKey, args ) ).show();
149150 },
150151
151152 /**
152 - * Set the status line for this upload
153 - * @param String str: the string to use
154 - */
155 - setStatusStr: function( str ) {
156 - $j( this.div ).find( '.mwe-upwiz-file-status' ).html( str ).show();
157 - },
158 -
159 - /**
160153 * Clear the status line for this upload (hide it, in case there are paddings and such which offset other things.)
161154 */
162155 clearStatus: function() {
@@ -341,4 +334,4 @@
342335 return $j.inArray( ext.toLowerCase(), mw.UploadWizard.config[ 'fileExtensions' ] ) !== -1;
343336 }
344337
345 -};
\ No newline at end of file
 338+};
Index: trunk/extensions/UploadWizard/resources/mw.Api.js
@@ -153,6 +153,10 @@
154154 * available.
155155 */
156156 mw.Api.errors = [
 157+ /* occurs when POST aborted - jQuery 1.4 can't distinguish abort or lost connection from 200 OK + empty result */
 158+ 'ok-but-empty',
 159+
 160+ /* remote errors, defined in API */
157161 'uploaddisabled',
158162 'nomodule',
159163 'mustbeposted',

Status & tagging log