Checkin for doronr@naboonline.com to fix bug 117517 -- move "Enable js for

mail/news" to the new scripts/windows pref pane.
r=db48x, sr=alecf
This commit is contained in:
tingley%sundell.net 2006-05-17 02:32:09 +00:00
Родитель 2d1d7a8fed
Коммит 1e2468a3b5
3 изменённых файлов: 59 добавлений и 47 удалений

Просмотреть файл

@ -69,7 +69,7 @@ function doAllowImageSrcChange(){
function changeDisabledState(state){
//Set the states of the groupbox children state based on the "javascript enabled" checkbox value
document.getElementById("allowScriptsDescription").disabled = state;
document.getElementById("allowScripts").disabled = state;
document.getElementById("allowWindowMoveResize").disabled = state;
document.getElementById("allowWindowOpen").disabled = state;
document.getElementById("allowImageSrcChange").disabled = state;
@ -79,8 +79,18 @@ function changeDisabledState(state){
document.getElementById("allowWindowFlip").disabled = state;
}
function javascriptEnabledChange(state){
changeDisabledState(!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 getPrefValueForCheckbox(prefName){
@ -168,12 +178,13 @@ function Startup(){
document.getElementById("allowDocumentCookieGet").checked = data["allowDocumentCookieGet"].checked;
document.getElementById("javascriptEnabled").checked = data["javascriptEnabled"].checked;
document.getElementById("javascriptAllowNavigator").checked = data["javascriptAllowNavigator"].checked;
if (document.getElementById("javascriptAllowMailnews"))
document.getElementById("javascriptAllowMailNews").checked = data["javascriptAllowMailNews"].checked;
}
//If javascript is disabled, then disable the checkboxes
if (!document.getElementById("javascriptEnabled").checked) changeDisabledState(true);
javascriptEnabledChange();
parent.hPrefWindow.registerOKCallbackFunc(doOnOk);
}

Просмотреть файл

@ -39,50 +39,50 @@
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/pref/pref-scripts.dtd" >
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
<page id="scriptsAndWindowPanel" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://communicator/content/pref/pref-scripts.xul');"
headertitle="&lHeader;">
<script type="application/x-javascript" src="chrome://communicator/content/pref/pref-scripts.js"/>
<script type="application/x-javascript">
<![CDATA[
var panel = "chrome://communicator/content/pref/pref-scripts.xul";
var _elementIDs = ["javascriptEnabled", "allowWindowOpen", "allowWindowMoveResize", "allowWindowFlip", "allowWindowStatusChange", "allowImageSrcChange", "allowDocumentCookieSet", "allowDocumentCookieGet"];
var _elementIDs = ["javascriptAllowNavigator", "allowWindowOpen", "allowWindowMoveResize", "allowWindowFlip", "allowWindowStatusChange", "allowImageSrcChange", "allowDocumentCookieSet", "allowDocumentCookieGet"];
]]>
</script>
<groupbox orient="vertical" id="scriptsSettings">
<caption>
<checkbox id="javascriptEnabled" label="&enableJsCheck.label;" accesskey="&enableJsCheck.accesskey;"
<label value="&enableJavaScript.label;"/>
<checkbox id="javascriptAllowNavigator" label="&navigator.label;" accesskey="&navigator.accesskey;"
pref="true" preftype="bool" prefstring="javascript.enabled"
prefattribute="checked" oncommand="javascriptEnabledChange(this.checked);"/>
</caption>
prefattribute="checked" oncommand="javascriptEnabledChange();"/>
<separator/>
<label id="allowScripts" value="&allowScripts.label;"/>
<description id="allowScriptsDescription" value="&allowScriptsDescription.label;"/>
<tree flex="1">
<treechildren flex="1">
<treerow>
<checkbox id="allowWindowOpen" label="&allowWindowOpen.label;" oncommand="doAllowWindowOpen();"/>
</treerow>
<treerow>
<checkbox id="allowWindowMoveResize" label="&allowWindowMoveResize.label;" oncommand="doWindowMoveResize();"/>
</treerow>
<treerow>
<checkbox id="allowWindowFlip" label="&allowWindowFlip.label;" oncommand="doWindowFlipChange();"/>
</treerow>
<treerow>
<checkbox id="allowWindowStatusChange" label="&allowWindowStatusChange.label;" oncommand="doWindowStatusChange();"/>
</treerow>
<treerow>
<checkbox id="allowImageSrcChange" label="&allowWindowImageSrcChange.label;" oncommand="doAllowImageSrcChange();"/>
</treerow>
<treerow>
<checkbox id="allowDocumentCookieSet" label="&allowDocumentCookieSet.label;" oncommand="doAllowCookieSet();"/>
</treerow>
<treerow>
<checkbox id="allowDocumentCookieGet" label="&allowDocumentCookieGet.label;" oncommand="doAllowCookieGet();"/>
</treerow>
</treechildren>
</tree>
</groupbox>
<tree>
<treechildren flex="1">
<treerow>
<checkbox id="allowWindowOpen" label="&allowWindowOpen.label;" oncommand="doAllowWindowOpen();"/>
</treerow>
<treerow>
<checkbox id="allowWindowMoveResize" label="&allowWindowMoveResize.label;" oncommand="doWindowMoveResize();"/>
</treerow>
<treerow>
<checkbox id="allowWindowFlip" label="&allowWindowFlip.label;" oncommand="doWindowFlipChange();"/>
</treerow>
<treerow>
<checkbox id="allowWindowStatusChange" label="&allowWindowStatusChange.label;" oncommand="doWindowStatusChange();"/>
</treerow>
<treerow>
<checkbox id="allowImageSrcChange" label="&allowWindowImageSrcChange.label;" oncommand="doAllowImageSrcChange();"/>
</treerow>
<treerow>
<checkbox id="allowDocumentCookieSet" label="&allowDocumentCookieSet.label;" oncommand="doAllowCookieSet();"/>
</treerow>
<treerow>
<checkbox id="allowDocumentCookieGet" label="&allowDocumentCookieGet.label;" oncommand="doAllowCookieGet();"/>
</treerow>
</treechildren>
</tree>
</page>

Просмотреть файл

@ -4,14 +4,15 @@
<!ENTITY lHeader "Scripts &amp; Windows">
<!--LOCALIZATION NOTE (enbableJsCheck.label): 'JavaScript' should never be translated -->
<!ENTITY enableJsCheck.label "Enable JavaScript">
<!ENTITY enableJsCheck.accesskey "r">
<!ENTITY navigator.label "Navigator">
<!ENTITY navigator.accesskey "r">
<!ENTITY allowScriptsDescription.label "Allow scripts to do the following:">
<!ENTITY allowWindowOpen.label "Open windows by themselves">
<!ENTITY enableJavaScript.label "Enable JavaScript for:">
<!ENTITY allowScripts.label "Allow scripts to:">
<!ENTITY allowWindowOpen.label "Open unrequested windows">
<!ENTITY allowWindowMoveResize.label "Move or resize existing windows">
<!ENTITY allowWindowFlip.label "Make windows flip over or under other windows">
<!ENTITY allowWindowFlip.label "Raise or lower windows">
<!ENTITY allowWindowStatusChange.label "Change status bar text">
<!ENTITY allowWindowImageSrcChange.label "Change images (image rollovers)">
<!ENTITY allowWindowImageSrcChange.label "Change images">
<!ENTITY allowDocumentCookieSet.label "Create or change cookies">
<!ENTITY allowDocumentCookieGet.label "Read cookies">