r65103 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65102‎ | r65103 | r65104 >
Date:22:59, 15 April 2010
Author:catrope
Status:ok
Tags:
Comment:
new-installer: Fix r65069 so DB selection actually works, prettify textbox sync code
Modified paths:
  • /branches/new-installer/phase3/skins/common/config.js (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/skins/common/config.js
@@ -16,6 +16,8 @@
1717
1818 // Show/hide code for DB-specific options
1919 // FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here?
 20+ $( '.dbRadio' ).each( function() { $( '#' + $(this).attr( 'rel' ) ).hide(); } );
 21+ $( '#' + $( '.dbRadio:checked' ).attr( 'rel' ) ).show();
2022 $( '.dbRadio' ).click( function() {
2123 var $checked = $( '.dbRadio:checked' );
2224 var $wrapper = $( '#' + $checked.attr( 'rel' ) );
@@ -59,10 +61,9 @@
6062 $label = $( 'label[for=config__NamespaceType_site-name]' );
6163 labelText = $label.text();
6264 $label.text( labelText.replace( '$1', '' ) );
63 - $( '#config_wgSitename' ).bind( 'keyup change', function() { sync( $(this) ); } );
64 - sync( $( '#config_wgSitename' ) );
65 - function sync( $e ) {
66 - var value = $e.val()
 65+ $( '#config_wgSitename' ).bind( 'keyup change', syncText ).each( syncText );
 66+ function syncText() {
 67+ var value = $(this).val()
6768 .replace( /[\[\]\{\}|#<>%+? ]/g, '_' )
6869 .replace( /&/, '&amp;' )
6970 .replace( /__+/g, '_' )

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65069new-installer: Rewrite all JS to use jQuery and generally be more elegantcatrope16:38, 15 April 2010

Status & tagging log