Merge "(bug 36938) XSS in uselang parameter"
[lhc/web/wiklou.git] / skins / common / config.js
index 10e53bb..23f7302 100644 (file)
@@ -1,18 +1,19 @@
 (function( $ ) {
        $( document ).ready( function() {
-               // Show/hide code for help text
-               $( '.config-show-help a' ).click( function() {
-                       $(this).parent().siblings( '.config-help-message' ).show( 'slow' );
-                       $(this).parent().siblings( '.config-hide-help' ).show();
-                       $(this).parent().hide();
-                       return false;
-               } );
-               $( '.config-hide-help a' ).click( function() {
-                       $(this).parent().siblings( '.config-help-message' ).hide( 'slow' );
-                       $(this).parent().siblings( '.config-show-help' ).show();
-                       $(this).parent().hide();
-                       return false;
-               } );
+
+
+               // Set up the help system
+               $( '.mw-help-field-data' )
+                       .hide()
+                       .closest( '.mw-help-field-container' )
+                               .find( '.mw-help-field-hint' )
+                                       .show()
+                                       .click( function() {
+                                               $(this)
+                                                       .closest( '.mw-help-field-container' )
+                                                               .find( '.mw-help-field-data' )
+                                                                       .slideToggle( 'fast' );
+                                       } );
                
                // Show/hide code for DB-specific options
                // FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here?
@@ -28,7 +29,7 @@
                } );
                
                // Scroll to the bottom of upgrade log
-               $( "#config-update-log" ).each( function() { this.scrollTop = this.scrollHeight; } );
+               $( '#config-live-log' ).find( '> textarea' ).each( function() { this.scrollTop = this.scrollHeight; } );
                
                // Show/hide Creative Commons thingy
                $( '.licenseRadio' ).click( function() {
@@ -66,9 +67,9 @@
                $( '.enableForOther' ).click( function() {
                        var $textbox = $( '#' + $(this).attr( 'rel' ) );
                        if ( $(this).val() == 'other' ) { // FIXME: Ugh, this is ugly
-                               $textbox.removeAttr( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' );
+                               $textbox.removeProp( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' );
                        } else {
-                               $textbox.attr( 'readonly', 'readonly' ).closest( '.config-block' ).slideUp( 'fast' );
+                               $textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' );
                        }
                } );