From 7f556a9c132c846e734842d9a0d35a5995993770 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 20 May 2010 22:24:46 +0000 Subject: [PATCH] Show/hide memcached server field based on radio selection. Typical flaw of hiding info in JS-disabled browsers, but somebody can fix that :) --- includes/installer/WebInstaller.php | 3 ++- skins/common/config.css | 4 ++++ skins/common/config.js | 11 ++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) 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); -- 2.20.1