r77124 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77123‎ | r77124 | r77125 >
Date:00:40, 23 November 2010
Author:krinkle
Status:ok
Tags:
Comment:
* Swapping enableForOther locked input-field from disabled to readonly. No need to block users from selecting the text inside, only block editing it field.
* 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.
Modified paths:
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)
  • /trunk/phase3/skins/common/config.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/config.js
@@ -47,14 +47,18 @@
4848 $wrapper.show( 'slow' );
4949 }
5050 } );
51 -
 51+
 52+ // Hide "other" textboxes by default
 53+ // Should not be done in CSS for javascript disabled compatibility
 54+ $( '.enabledByOther' ).closest( '.config-block' ).hide();
 55+
5256 // Enable/disable "other" textboxes
5357 $( '.enableForOther' ).click( function() {
5458 var $textbox = $( '#' + $(this).attr( 'rel' ) );
5559 if ( $(this).val() == 'other' ) { // FIXME: Ugh, this is ugly
56 - $textbox.removeAttr( 'disabled' );
 60+ $textbox.removeAttr( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' );
5761 } else {
58 - $textbox.attr( 'disabled', 'disabled' );
 62+ $textbox.attr( 'readonly', 'readonly' ).closest( '.config-block' ).slideUp( 'fast' );
5963 }
6064 } );
6165
Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -613,8 +613,8 @@
614614 array_shift( $args );
615615 $args = array_map( 'htmlspecialchars', $args );
616616 $text = wfMsgReal( $msg, $args, false, false, false );
 617+ $html = htmlspecialchars( $text );
617618 //$html = $this->parse( $text, true );
618 - $html = $text;
619619 return
620620 "<span class=\"mw-help-field-hint\"\n" .
621621 " title=\"" . $html . "\"\n" .
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -478,8 +478,8 @@
479479 ) ) .
480480 $this->parent->getTextBox( array(
481481 'var' => 'wgMetaNamespace',
482 - 'label' => '',
483 - 'attribs' => array( 'disabled' => '' ),
 482+ 'label' => '', //TODO: Needs a label?
 483+ 'attribs' => array( 'readonly' => 'readonly', 'class' => 'enabledByOther' ),
484484
485485 ) ) .
486486 $this->getFieldSetStart( 'config-admin-box' ) .

Status & tagging log