fname = fname.replace( / /g, '_' );
// Capitalise first letter if needed
if ( mw.config.get( 'wgCapitalizeUploads' ) ) {
- fname = fname.charAt( 0 ).toUpperCase().concat( fname.slice( 1 ) );
+ fname = fname[0].toUpperCase() + fname.slice( 1 );
}
// Output result
}
// Dont send leading ':' to open search
- if ( value.charAt( 0 ) === ':' ) {
+ if ( value[0] === ':' ) {
value = value.slice( 1 );
}
.replace( rUnderscoreTrim, '' );
// Process initial colon
- if ( title !== '' && title.charAt( 0 ) === ':' ) {
+ if ( title !== '' && title[0] === ':' ) {
// Initial colon means main namespace instead of specified default
namespace = NS_MAIN;
title = title
}
// Any remaining initial :s are illegal.
- if ( title.charAt( 0 ) === ':' ) {
+ if ( title[0] === ':' ) {
return false;
}
title = $.trim( title.replace( rWhitespace, ' ' ) );
// Process initial colon
- if ( title !== '' && title.charAt( 0 ) === ':' ) {
+ if ( title !== '' && title[0] === ':' ) {
// Initial colon means main namespace instead of specified default
namespace = NS_MAIN;
title = title
getName: function () {
if ( $.inArray( this.namespace, mw.config.get( 'wgCaseSensitiveNamespaces' ) ) !== -1 ) {
return this.title;
- } else {
- return this.title.charAt( 0 ).toUpperCase() + this.title.slice( 1 );
}
+ return this.title[0].toUpperCase() + this.title.slice( 1 );
},
/**
this.port = defaultUri.port;
}
}
- if ( this.path && this.path.charAt( 0 ) !== '/' ) {
+ if ( this.path && this.path[0] !== '/' ) {
// A real relative URL, relative to defaultUri.path. We can't really handle that since we cannot
// figure out whether the last path component of defaultUri.path is a directory or a file.
throw new Error( 'Bad constructor arguments' );
list: 'allusers',
// Prefix of list=allusers is case sensitive. Normalise first
// character to uppercase so that "fo" may yield "Foo".
- auprefix: userInput.charAt( 0 ).toUpperCase() + userInput.slice( 1 ),
+ auprefix: userInput[0].toUpperCase() + userInput.slice( 1 ),
aulimit: maxRows
} ).done( function ( data ) {
var users = $.map( data.query.allusers, function ( userObj ) {