From a887ea41ca092734616c177bfcbb9d83d48ea7e9 Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Wed, 25 Sep 2002 00:29:20 +0000 Subject: [PATCH] readding some advanced prefs. --- .../prefwindow/content/pref-advanced.xul | 36 +++++++++++++++---- .../prefwindow/content/pref-scripts.js | 31 ++++++---------- .../prefwindow/content/pref-scripts.xul | 16 ++++----- .../prefwindow/content/preftree.xul | 14 +++++++- .../prefwindow/locale/pref-scripts.dtd | 11 ++---- .../components/prefwindow/locale/preftree.dtd | 4 ++- 6 files changed, 67 insertions(+), 45 deletions(-) diff --git a/browser/components/prefwindow/content/pref-advanced.xul b/browser/components/prefwindow/content/pref-advanced.xul index 383f47cc74b6..81c77f75da1b 100644 --- a/browser/components/prefwindow/content/pref-advanced.xul +++ b/browser/components/prefwindow/content/pref-advanced.xul @@ -22,17 +22,41 @@ --> - %prefAdvancedDTD; + +%brandDTD; + %prefAdvancedDTD; ]> - - All your favorite prefs will be making a comeback in the near future. - + + + + + + + + diff --git a/browser/components/prefwindow/content/pref-scripts.js b/browser/components/prefwindow/content/pref-scripts.js index 85a94bf32057..58ba6c670027 100644 --- a/browser/components/prefwindow/content/pref-scripts.js +++ b/browser/components/prefwindow/content/pref-scripts.js @@ -53,18 +53,13 @@ function changeDisabledState(state){ document.getElementById("allowHideStatusBar").disabled = state; } -function javascriptEnabledChange(){ - // if javascriptAllowMailNews is overlayed (mailnews is installed), then if javascriptAllowMailnews - // and javascriptAllowNavigator are unchecked, we disable the tree items. - // If javascriptAllowMailNews is not available, we only take javascriptAllowNavigator in consideration - - if (document.getElementById('javascriptAllowMailNews')){ - if (!document.getElementById('javascriptAllowNavigator').checked && !document.getElementById('javascriptAllowMailNews').checked) - changeDisabledState(true); - else changeDisabledState(false); - } else { - changeDisabledState(!document.getElementById('javascriptAllowNavigator').checked); - } +function javascriptEnabledChange(aEnable){ + var label = document.getElementById("allowScripts"); + var listbox = document.getElementById("AllowList"); + label.disabled = aEnable; + + //XXXBlake this should work... + listbox.disabled = aEnable; } function getPrefValueForCheckbox(prefName){ @@ -83,7 +78,7 @@ function getPrefValueForCheckbox(prefName){ function Startup(){ - data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; + data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://browser/content/pref/pref-scripts.xul"]; //If scriptData does not exist, then it is the first time the panel was shown and we default to false if (!("scriptData" in data)){ @@ -110,15 +105,9 @@ function Startup(){ document.getElementById("allowDocumentCookieGet").checked = getPrefValueForCheckbox("dom.disable_cookie_get"); document.getElementById("allowDocumentCookieSet").checked = getPrefValueForCheckbox("dom.disable_cookie_set"); document.getElementById("allowHideStatusBar").checked = getPrefValueForCheckbox("dom.disable_window_open_feature.status"); - - //If we don't have a checkbox under groupbox pluginPreferences, we should hide it - var pluginGroup = document.getElementById("pluginPreferences") - var children = pluginGroup.childNodes; - if (!children || children.length <= 1) // 1 for the caption - pluginGroup.setAttribute("hidden", "true"); } - javascriptEnabledChange(); + javascriptEnabledChange(!document.getElementById("enableJavascript").checked); document.getElementById("AllowList").addEventListener("CheckboxStateChange", onCheckboxCheck, false); @@ -141,7 +130,7 @@ function doOnOk(){ return data[name].checked; } - var data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://communicator/content/pref/pref-scripts.xul"]; + var data = parent.hPrefWindow.wsm.dataManager.pageData["chrome://browser/content/pref/pref-scripts.xul"]; if (data.scriptData["allowWindowOpenChanged"].value){ parent.hPrefWindow.setPref("bool", "dom.disable_open_during_load", diff --git a/browser/components/prefwindow/content/pref-scripts.xul b/browser/components/prefwindow/content/pref-scripts.xul index 81e0beafc54c..1aad344acf86 100644 --- a/browser/components/prefwindow/content/pref-scripts.xul +++ b/browser/components/prefwindow/content/pref-scripts.xul @@ -45,7 +45,7 @@ - - - - + + + + oncommand="javascriptEnabledChange(!this.checked);"/> + + - -