(function( $ ) {
$( document ).ready( function() {
- // Generate the tool tips
- $( '.mw-help-field-hint' ).tipsy( { gravity : 'se', opacity: '0.9' } );
+ // 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?
$( '.dbRadio' ).each( function() { $( '#' + $(this).attr( 'rel' ) ).hide(); } );
} );
// 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() {
$wrapper.show( 'slow' );
}
} );
-
+
+ // Hide "other" textboxes by default
+ // Should not be done in CSS for javascript disabled compatibility
+ $( '.enabledByOther' ).closest( '.config-block' ).hide();
+
// Enable/disable "other" textboxes
$( '.enableForOther' ).click( function() {
var $textbox = $( '#' + $(this).attr( 'rel' ) );
if ( $(this).val() == 'other' ) { // FIXME: Ugh, this is ugly
- $textbox.removeAttr( 'disabled' );
+ $textbox.removeProp( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' );
} else {
- $textbox.attr( 'disabled', 'disabled' );
+ $textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' );
}
} );