Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.upload.js |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | */ |
198 | 198 | function checkMaxUploadSize( file ) { |
199 | 199 | function getMaxUploadSize( type ) { |
200 | | - sizes = mw.config.get( 'wgMaxUploadSize' ); |
| 200 | + var sizes = mw.config.get( 'wgMaxUploadSize' ); |
201 | 201 | if ( sizes[type] !== undefined ) { |
202 | 202 | return sizes[type]; |
203 | 203 | } |
— | — | @@ -204,10 +204,10 @@ |
205 | 205 | } |
206 | 206 | $( '.mw-upload-source-error' ).remove(); |
207 | 207 | |
208 | | - maxSize = getMaxUploadSize( 'file' ); |
| 208 | + var maxSize = getMaxUploadSize( 'file' ); |
209 | 209 | if ( file.size > maxSize ) { |
210 | | - error = $( '<p class="error mw-upload-source-error" id="wpSourceTypeFile-error">' + |
211 | | - mw.msg( 'largefileserver', file.size, maxSize ) + '</p>' ); |
| 210 | + var error = $( '<p class="error mw-upload-source-error" id="wpSourceTypeFile-error">' + |
| 211 | + mw.message( 'largefileserver', file.size, maxSize ).escaped() + '</p>' ); |
212 | 212 | $( '#wpUploadFile' ).after( error ); |
213 | 213 | return false; |
214 | 214 | } |
Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -254,6 +254,16 @@ |
255 | 255 | var index = parseInt( match, 10 ) - 1; |
256 | 256 | return index in parameters ? parameters[index] : '$' + match; |
257 | 257 | } ); |
| 258 | + |
| 259 | + if ( this.format === 'plain' ) { |
| 260 | + return text; |
| 261 | + } |
| 262 | + if ( this.format === 'escaped' ) { |
| 263 | + // According to Message.php this needs {{-transformation, which is |
| 264 | + // still todo |
| 265 | + return mediaWiki.html.escape( text ); |
| 266 | + } |
| 267 | + |
258 | 268 | /* This should be fixed up when we have a parser |
259 | 269 | if ( this.format === 'parse' && 'language' in mediaWiki ) { |
260 | 270 | text = mediaWiki.language.parse( text ); |
— | — | @@ -281,6 +291,16 @@ |
282 | 292 | this.format = 'plain'; |
283 | 293 | return this.toString(); |
284 | 294 | }; |
| 295 | + |
| 296 | + /** |
| 297 | + * Changes the format to html escaped and converts message to string |
| 298 | + * |
| 299 | + * @return {string} String form of html escaped message |
| 300 | + */ |
| 301 | + Message.prototype.escaped = function() { |
| 302 | + this.format = 'escaped'; |
| 303 | + return this.toString(); |
| 304 | + } |
285 | 305 | |
286 | 306 | /** |
287 | 307 | * Checks if message exists |