Merge "Add tests for WikiMap and WikiReference"
[lhc/web/wiklou.git] / mw-config / config.js
index 2886e08..d2dc213 100644 (file)
@@ -3,13 +3,13 @@
                var $label, labelText;
 
                function syncText() {
-                       var value = $(this).val()
+                       var value = $( this ).val()
                                .replace( /[\[\]\{\}|#<>%+? ]/g, '_' )
                                .replace( /&/, '&amp;' )
                                .replace( /__+/g, '_' )
                                .replace( /^_+/, '' )
                                .replace( /_+$/, '' );
-                       value = value.substr( 0, 1 ).toUpperCase() + value.substr( 1 );
+                       value = value.charAt( 0 ).toUpperCase() + value.slice( 1 );
                        $label.text( labelText.replace( '$1', value ) );
                }
 
@@ -20,7 +20,7 @@
                                .find( '.mw-help-field-hint' )
                                        .show()
                                        .click( function () {
-                                               $(this)
+                                               $( this )
                                                        .closest( '.mw-help-field-container' )
                                                                .find( '.mw-help-field-data' )
                                                                        .slideToggle( 'fast' );
@@ -29,7 +29,7 @@
                // Show/hide code for DB-specific options
                // FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here?
                $( '.dbRadio' ).each( function () {
-                       $( document.getElementById( $(this).attr( 'rel' ) ) ).hide();
+                       $( document.getElementById( $( this ).attr( 'rel' ) ) ).hide();
                } );
                $( document.getElementById( $( '.dbRadio:checked' ).attr( 'rel' ) ) ).show();
                $( '.dbRadio' ).click( function () {
 
                // Show/hide random stuff (email, upload)
                $( '.showHideRadio' ).click( function () {
-                       var $wrapper = $( '#' + $(this).attr( 'rel' ) );
-                       if ( $(this).is( ':checked' ) ) {
+                       var $wrapper = $( '#' + $( this ).attr( 'rel' ) );
+                       if ( $( this ).is( ':checked' ) ) {
                                $wrapper.show( 'slow' );
                        } else {
                                $wrapper.hide( 'slow' );
                        }
                } );
                $( '.hideShowRadio' ).click( function () {
-                       var $wrapper = $( '#' + $(this).attr( 'rel' ) );
-                       if ( $(this).is( ':checked' ) ) {
+                       var $wrapper = $( '#' + $( this ).attr( 'rel' ) );
+                       if ( $( this ).is( ':checked' ) ) {
                                $wrapper.hide( 'slow' );
                        } else {
                                $wrapper.show( 'slow' );
@@ -80,9 +80,9 @@
 
                // Enable/disable "other" textboxes
                $( '.enableForOther' ).click( function () {
-                       var $textbox = $( document.getElementById( $(this).attr( 'rel' ) ) );
+                       var $textbox = $( document.getElementById( $( this ).attr( 'rel' ) ) );
                        // FIXME: Ugh, this is ugly
-                       if ( $(this).val() === 'other' ) {
+                       if ( $( this ).val() === 'other' ) {
                                $textbox.removeProp( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' );
                        } else {
                                $textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' );