Index: trunk/extensions/Push/Push.i18n.php |
— | — | @@ -53,7 +53,9 @@ |
54 | 54 | 'push-tab-no-used-templates' => '(No templates are used on this page.)', |
55 | 55 | 'push-tab-inc-files' => 'Include files', |
56 | 56 | 'push-tab-err-fileinfo' => 'Could not obtain which files are used on this page. None have been pushed.', |
57 | | - |
| 57 | + 'push-tab-err-filepush-unknown' => 'File push failed for an unknown reason.', |
| 58 | + 'push-tab-err-filepush' => 'File push failed: $1', |
| 59 | + |
58 | 60 | // Special page |
59 | 61 | 'special-push' => 'Push pages', |
60 | 62 | 'push-special-description' => 'This page enables you to push content of one or more pages to one or more MediaWiki wikis. |
Index: trunk/extensions/Push/specials/ext.push.special.js |
— | — | @@ -173,17 +173,17 @@ |
174 | 174 | function( data ) { |
175 | 175 | var fail = false; |
176 | 176 | |
177 | | - for ( i in data.upload ) { |
178 | | - if ( data.error ) { |
179 | | - handleError( pageName, data.error ); |
| 177 | + for ( i in data ) { |
| 178 | + if ( data[i].error ) { |
| 179 | + handleError( pageName, { info: mediaWiki.msg( 'push-tab-err-filepush', data[i].error.info ) } ); |
180 | 180 | fail = true; |
181 | 181 | break; |
182 | 182 | } |
183 | | - else if ( !data.upload ) { |
184 | | - handleError( pageName, { info: 'Unknown error' } ); // TODO |
| 183 | + else if ( !data[i].upload ) { |
| 184 | + handleError( pageName, { info: mediaWiki.msg( 'push-tab-err-filepush-unknown' ) } ); |
185 | 185 | fail = true; |
186 | | - break; |
187 | | - } |
| 186 | + break; |
| 187 | + } |
188 | 188 | } |
189 | 189 | |
190 | 190 | if ( !fail ) { |
Index: trunk/extensions/Push/Push.php |
— | — | @@ -86,6 +86,8 @@ |
87 | 87 | 'push-special-obtaining-fileinfo', |
88 | 88 | 'push-special-pushing-file', |
89 | 89 | 'push-tab-err-fileinfo', |
| 90 | + 'push-tab-err-filepush', |
| 91 | + 'push-tab-err-filepush-unknown', |
90 | 92 | ); |
91 | 93 | |
92 | 94 | // For backward compatibility with MW < 1.17. |
Index: trunk/extensions/Push/includes/ext.push.tab.js |
— | — | @@ -208,22 +208,22 @@ |
209 | 209 | function( data ) { |
210 | 210 | var fail = false; |
211 | 211 | |
212 | | - for ( i in data.upload ) { |
213 | | - if ( data.error ) { |
214 | | - handleError( sender, targetUrl, data.error ); |
| 212 | + for ( i in data ) { |
| 213 | + if ( data[i].error ) { |
| 214 | + handleError( sender, targetUrl, { info: mediaWiki.msg( 'push-tab-err-filepush', data[i].error.info ) } ); |
215 | 215 | fail = true; |
216 | 216 | break; |
217 | 217 | } |
218 | | - else if ( !data.upload ) { |
219 | | - handleError( sender, targetUrl, { info: 'Unknown error' } ); // TODO |
| 218 | + else if ( !data[i].upload ) { |
| 219 | + handleError( sender, targetUrl, { info: mediaWiki.msg( 'push-tab-err-filepush-unknown' ) } ); |
220 | 220 | fail = true; |
221 | | - break; |
222 | | - } |
| 221 | + break; |
| 222 | + } |
223 | 223 | } |
224 | | - |
| 224 | + |
225 | 225 | if ( !fail ) { |
226 | 226 | sender.innerHTML = mediaWiki.msg( 'push-button-completed' ); |
227 | | - setTimeout( function() {reEnableButton( sender, targetUrl, targetName );}, 1000 ); |
| 227 | + setTimeout( function() {reEnableButton( sender, targetUrl, targetName );}, 1000 ); |
228 | 228 | } |
229 | 229 | } |
230 | 230 | ); |