From 1e3136acae9c1d46f9474507a7761c64756e9d0f Mon Sep 17 00:00:00 2001 From: "rgoodger%ihug.co.nz" Date: Sat, 8 Jan 2000 12:53:56 +0000 Subject: [PATCH] [prefwindow] proxy panel cleanup --- .../resources/content/pref-proxies.js | 44 +++++++++++++++++++ .../resources/content/pref-proxies.xul | 11 +++-- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/xpfe/components/prefwindow/resources/content/pref-proxies.js b/xpfe/components/prefwindow/resources/content/pref-proxies.js index ee9f28142999..37159b325ca2 100644 --- a/xpfe/components/prefwindow/resources/content/pref-proxies.js +++ b/xpfe/components/prefwindow/resources/content/pref-proxies.js @@ -11,4 +11,48 @@ function showManualProxyConfig() viewHideButton.value = bundle.GetStringFromName("viewrow"); manualRow.style.display = "none" } +} + +function Startup() +{ + DoEnabling(); +} + +function DoEnabling() +{ + var ftp = document.getElementById("networkProxyFTP"); + var ftpPort = document.getElementById("networkProxyFTP_Port"); + var http = document.getElementById("networkProxyHTTP"); + var httpPort = document.getElementById("networkProxyHTTP_Port"); + var noProxy = document.getElementById("networkProxyNone"); + var autoURL = document.getElementById("networkProxyAutoconfigURL"); + var autoReload = document.getElementById("autoReload"); + + // convenience arrays + var manual = [ftp, ftpPort, http, httpPort, noProxy]; + var auto = [autoURL, autoReload]; + + // radio buttons + var radio0 = document.getElementById("networkProxyType0"); + var radio1 = document.getElementById("networkProxyType1"); + var radio2 = document.getElementById("networkProxyType2"); + + if( radio0.checked ) { + for( var i = 0; i < manual.length; i++ ) + manual[i].setAttribute( "disabled", "true" ); + for( var i = 0; i < auto.length; i++ ) + auto[i].setAttribute( "disabled", "true" ); + } + else if ( radio1.checked ) { + for( var i = 0; i < auto.length; i++ ) + auto[i].setAttribute( "disabled", "true" ); + for( var i = 0; i < manual.length; i++ ) + manual[i].removeAttribute( "disabled" ); + } + else if ( radio2.checked ) { + for( var i = 0; i < manual.length; i++ ) + manual[i].setAttribute( "disabled", "true" ); + for( var i = 0; i < auto.length; i++ ) + auto[i].removeAttribute( "disabled" ); + } } \ No newline at end of file diff --git a/xpfe/components/prefwindow/resources/content/pref-proxies.xul b/xpfe/components/prefwindow/resources/content/pref-proxies.xul index 56f14305a371..2abe01a1a6c2 100644 --- a/xpfe/components/prefwindow/resources/content/pref-proxies.xul +++ b/xpfe/components/prefwindow/resources/content/pref-proxies.xul @@ -45,6 +45,7 @@ @@ -54,13 +55,14 @@ &manualTypeRadio.label; - + @@ -133,10 +135,11 @@ --> - - &autoTypeRadio.label; + &autoTypeRadio.label; &configAutoconfigText.label; @@ -145,7 +148,7 @@ - +