* On top of that, also using javascript to hide the input-field if/when not needed, untill needed (PHP has a backup check to only use this value if the radio-button was on 'other')
* Escaping special html characters in the attributes. The message for .mw-help-field-hint contained the phrase " content pages, in a "'''project namespace'''". " which (raw, unescaped) ends the attribute right after the "a". Fixed now.
array_shift( $args );
$args = array_map( 'htmlspecialchars', $args );
$text = wfMsgReal( $msg, $args, false, false, false );
+ $html = htmlspecialchars( $text );
//$html = $this->parse( $text, true );
- $html = $text;
return
"<span class=\"mw-help-field-hint\"\n" .
" title=\"" . $html . "\"\n" .
) ) .
$this->parent->getTextBox( array(
'var' => 'wgMetaNamespace',
- 'label' => '',
- 'attribs' => array( 'disabled' => '' ),
+ 'label' => '', //TODO: Needs a label?
+ 'attribs' => array( 'readonly' => 'readonly', 'class' => 'enabledByOther' ),
) ) .
$this->getFieldSetStart( 'config-admin-box' ) .
$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.removeAttr( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' );
} else {
- $textbox.attr( 'disabled', 'disabled' );
+ $textbox.attr( 'readonly', 'readonly' ).closest( '.config-block' ).slideUp( 'fast' );
}
} );