* Swapping enableForOther locked input-field from disabled to readonly. No need to...
authorKrinkle <krinkle@users.mediawiki.org>
Tue, 23 Nov 2010 00:40:45 +0000 (00:40 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Tue, 23 Nov 2010 00:40:45 +0000 (00:40 +0000)
* 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.

includes/installer/WebInstaller.php
includes/installer/WebInstallerPage.php
skins/common/config.js

index 84ba806..7abe688 100644 (file)
@@ -613,8 +613,8 @@ class WebInstaller extends CoreInstaller {
                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" .
index a7e89f9..074d2d1 100644 (file)
@@ -478,8 +478,8 @@ class WebInstaller_Name extends WebInstallerPage {
                        ) ) .
                        $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' ) .
index d137b84..fcd1145 100644 (file)
                                $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' );
                        }
                } );