From: Chad Horohoe Date: Thu, 20 May 2010 22:24:46 +0000 (+0000) Subject: Show/hide memcached server field based on radio selection. Typical flaw of hiding... X-Git-Tag: 1.31.0-rc.0~36777 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=7f556a9c132c846e734842d9a0d35a5995993770;p=lhc%2Fweb%2Fwiklou.git Show/hide memcached server field based on radio selection. Typical flaw of hiding info in JS-disabled browsers, but somebody can fix that :) --- diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 4ba47bac8b..0edd7350d2 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -1430,11 +1430,12 @@ class WebInstaller_Options extends WebInstallerPage { 'value' => $selected, ) ) . $this->parent->getHelpBox( 'config-cache-help' ) . + '
' . $this->parent->getTextBox( array( 'var' => '_MemCachedServers', 'label' => 'config-memcached-servers', ) ) . - $this->parent->getHelpBox( 'config-memcached-help' ) . + $this->parent->getHelpBox( 'config-memcached-help' ) . '
' . $this->parent->getFieldsetEnd() ); $this->endForm(); diff --git a/skins/common/config.css b/skins/common/config.css index a7be5e37c5..ff482d4238 100644 --- a/skins/common/config.css +++ b/skins/common/config.css @@ -157,3 +157,7 @@ background: none !important; padding: 0 !important; } + +#config-memcachewrapper { + display: none; +} diff --git a/skins/common/config.js b/skins/common/config.js index 19f23d0b83..4b68732602 100644 --- a/skins/common/config.js +++ b/skins/common/config.js @@ -83,6 +83,15 @@ value = value.substr( 0, 1 ).toUpperCase() + value.substr( 1 ); $label.text( labelText.replace( '$1', value ) ); } - + + // Show/Hide memcached servers when needed + $("input[name$='config_wgMainCacheType']").change( function() { + var $memc = $( "#config-memcachewrapper" ); + if( $( "input[name$='config_wgMainCacheType']:checked" ).val() == 'memcached' ) { + $memc.show( 'slow' ); + } else { + $memc.hide( 'slow' ); + } + } ); } ); })(jQuery);