*/
function checkMaxUploadSize( file ) {
function getMaxUploadSize( type ) {
- sizes = mw.config.get( 'wgMaxUploadSize' );
+ var sizes = mw.config.get( 'wgMaxUploadSize' );
if ( sizes[type] !== undefined ) {
return sizes[type];
}
}
$( '.mw-upload-source-error' ).remove();
- maxSize = getMaxUploadSize( 'file' );
+ var maxSize = getMaxUploadSize( 'file' );
if ( file.size > maxSize ) {
- error = $( '<p class="error mw-upload-source-error" id="wpSourceTypeFile-error">' +
- mw.msg( 'largefileserver', file.size, maxSize ) + '</p>' );
+ var error = $( '<p class="error mw-upload-source-error" id="wpSourceTypeFile-error">' +
+ mw.message( 'largefileserver', file.size, maxSize ).escaped() + '</p>' );
$( '#wpUploadFile' ).after( error );
return false;
}
var index = parseInt( match, 10 ) - 1;
return index in parameters ? parameters[index] : '$' + match;
} );
+
+ if ( this.format === 'plain' ) {
+ return text;
+ }
+ if ( this.format === 'escaped' ) {
+ // According to Message.php this needs {{-transformation, which is
+ // still todo
+ return mediaWiki.html.escape( text );
+ }
+
/* This should be fixed up when we have a parser
if ( this.format === 'parse' && 'language' in mediaWiki ) {
text = mediaWiki.language.parse( text );
this.format = 'plain';
return this.toString();
};
+
+ /**
+ * Changes the format to html escaped and converts message to string
+ *
+ * @return {string} String form of html escaped message
+ */
+ Message.prototype.escaped = function() {
+ this.format = 'escaped';
+ return this.toString();
+ }
/**
* Checks if message exists