New privacy pref panel, more pref cleanup.

This commit is contained in:
blakeross%telocity.com 2002-08-15 05:17:59 +00:00
Родитель c13cc92b0f
Коммит ec74333c87
8 изменённых файлов: 203 добавлений и 86 удалений

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

@ -406,7 +406,8 @@ pref("network.dir.format", 2);
// post to the server specified by this pref.
pref("network.hosts.nntp_server", "news.mozilla.org");
pref("network.image.imageBehavior", 0); // 0-Accept, 1-dontAcceptForeign, 2-dontUse
pref("network.image.enable", true); // 0-Accept, 1-dontAcceptForeign, 2-dontUse
pref("network.image.enableForOriginatingWebsiteOnly", false);
pref("network.image.warnAboutImages", false);
pref("network.proxy.autoconfig_url", "");
pref("network.proxy.type", 0);
@ -427,10 +428,10 @@ pref("network.proxy.socks_port", 0);
pref("network.proxy.socks_version", 5);
pref("network.proxy.no_proxies_on", "");
pref("network.online", true); //online/offline
pref("network.cookie.cookieBehavior", 3); // 0-Accept, 1-dontAcceptForeign, 2-dontUse, 3-p3p
pref("network.cookie.enable", true); // 0-Accept, 1-dontAcceptForeign, 2-dontUse, 3-p3p
pref("network.cookie.warnAboutCookies", false);
pref("network.cookie.lifetime.enabled", false);
pref("network.cookie.lifetime.behavior", 0);
pref("network.cookie.enableForCurrentSessionOnly", false);
pref("network.cookie.enableForOriginatingWebsiteOnly", false);
pref("network.cookie.lifetime.days", 90);
// The following default value is for p3p medium mode.

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

@ -43,7 +43,7 @@ function nsPrefWindow( frame_id )
if ( !frame_id )
throw "Error: frame_id not supplied!";
this.contentFrame = frame_id
this.contentFrame = frame_id;
this.wsm = new nsWidgetStateManager( frame_id );
this.wsm.attributes = ["preftype", "prefstring", "prefattribute", "disabled"];
this.pref = null;

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

@ -81,20 +81,5 @@
</hbox>
</vbox>
</groupbox>
<groupbox>
<caption label="&header3.label;"/>
<description>&historyPages.label;</description>
<hbox align="center">
<label value="&pageHis.label;" accesskey="&pageHis.accesskey;" control="histDay"/>
<textbox id="histDay" size="3"
preftype="int" prefstring="browser.history_expire_days"/>
<label value="&days.label;"/>
<spacer flex="1"/>
<button label="&clearHistory.label;" accesskey="&clearHistory.accesskey;"
oncommand="prefClearGlobalHistory(); this.disabled = true;"
id="browserClearHistory"
prefstring="pref.browser.history.disable_button.clear_hist"/>
</hbox>
</groupbox>
</page>

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

@ -0,0 +1,164 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-2000 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://browser/locale/pref/pref-privacy.dtd" >
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://browser/content/pref/pref-privacy.xul');"
headertitle="&lHeader;">
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["histDay", "browserCacheDiskCache", "enableCookies",
"enableCookiesForOriginatingSiteOnly", "enableCookiesForCurrentSessionOnly",
"enableImages", "enableImagesForOriginatingSiteOnly"];
function Startup() {
var cookiesEnabled = document.getElementById("enableCookies").checked;
var imagesEnabled = document.getElementById("enableImages").checked;
var cookieBroadcaster = document.getElementById("cookieBroadcaster");
var imageBroadcaster = document.getElementById("imageBroadcaster");
cookieBroadcaster.setAttribute("disabled", !cookiesEnabled);
imageBroadcaster.setAttribute("disabled", !imagesEnabled);
var clearHistButton = document.getElementById("browserClearHistory");
try {
var urlBarHist = Components.classes["@mozilla.org/browser/urlbarhistory;1"]
.getService(Components.interfaces.nsIUrlbarHistory);
var isBtnLocked = parent.hPrefWindow.getPrefIsLocked(clearHistButton.getAttribute("prefstring"));
var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"]
.getService(Components.interfaces.nsIBrowserHistory);
clearHistButton.disabled = ( urlBarHist.count == 0 && globalHistory.count == 0) || isBtnLocked;
}
catch(ex) {
}
}
function viewImages() {
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul","_blank",
"chrome,resizable=yes", "imageManager" );
}
function viewCookies() {
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul","_blank",
"chrome,resizable=yes", "cookieManager");
}
function clearCacheOfType(aType)
{
var classID = Components.classes["@mozilla.org/network/cache-service;1"];
var cacheService = classID.getService(Components.interfaces.nsICacheService);
cacheService.evictEntries(aType);
}
function clearCache()
{
clearCacheOfType(Components.interfaces.nsICache.STORE_ON_DISK);
clearCacheOfType(Components.interfaces.nsICache.STORE_IN_MEMORY);
}
function prefClearGlobalHistory()
{
var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"]
.getService(Components.interfaces.nsIBrowserHistory);
globalHistory.removeAllPages();
var urlBarHistory = Components.classes["@mozilla.org/browser/urlbarhistory;1"]
.getService(Components.interfaces.nsIUrlbarHistory);
urlBarHistory.clearHistory();
}
]]>
</script>
<broadcaster id="imageBroadcaster"/>
<broadcaster id="cookieBroadcaster"/>
<groupbox orient="horizontal" align="center">
<caption label="&history.label;"/>
<label value="&pageHis.label;" accesskey="&pageHis.accesskey;" control="histDay"/>
<textbox id="histDay" size="3"
preftype="int" prefstring="browser.history_expire_days"/>
<label value="&days.label;"/>
<spacer flex="1"/>
<button label="&clearHistory.label;" accesskey="&clearHistory.accesskey;"
oncommand="prefClearGlobalHistory(); this.disabled = true;"
id="browserClearHistory"
prefstring="pref.browser.history.disable_button.clear_hist"/>
</groupbox>
<groupbox>
<caption label="&cache.label;"/>
<label value="&cacheExplanation.label;"/>
<separator class="thin"/>
<hbox align="center">
<label value="&diskCache.label;" accesskey="&diskCache.accesskey;" control="browserCacheDiskCache"/>
<textbox id="browserCacheDiskCache" size="8" preftype="int"
prefstring="browser.cache.disk.capacity" prefattribute="value"/>
<label value="&kbytes;"/>
<spacer flex="1"/>
<button label="&clearCache.label;"
oncommand="clearCache();"
id="clearDiskCache"
prefstring="pref.advanced.cache.disable_button.clear_disk"/>
</hbox>
</groupbox>
<groupbox orient="horizontal">
<caption label="&cookies.label;"/>
<vbox flex="1" align="start">
<label value="&cookieExplanation.label;"/>
<separator class="thin"/>
<checkbox id="enableCookies"
oncommand="document.getElementById('cookieBroadcaster').setAttribute('disabled', this.checked ? 'false' : 'true');"
label="&enableCookies.label;" accesskey="&enableCookies.accesskey;"
prefstring="network.cookie.enable"/>
<checkbox id="enableCookiesForOriginatingSiteOnly" observes="cookieBroadcaster"
label="&forOriginatingSiteOnly.label;" accesskey="&forOriginatingSiteOnly.accesskey;"
prefstring="network.cookie.enableForOriginatingWebsiteOnly"
style="margin-left: 23px;"/>
<checkbox id="enableCookiesForCurrentSessionOnly" observes="cookieBroadcaster"
label="&forCurrentSessionOnly.label;" accesskey="&forCurrentSessionOnly.accesskey;"
prefstring="network.cookie.enableForCurrentSessionOnly"
style="margin-left: 23px;"/>
</vbox>
<vbox>
<button id="manageCookies"
label="&manageCookies.label;" accesskey="&manageCookies.accesskey;"
oncommand="viewCookies();"
prefstring="pref.advanced.cookies.disable_button.view_cookies"/>
</vbox>
</groupbox>
<groupbox orient="horizontal">
<caption label="&images.label;"/>
<vbox flex="1" align="start">
<checkbox id="enableImages"
oncommand="document.getElementById('imageBroadcaster').setAttribute('disabled', this.checked ? 'false' : 'true');"
label="&enableImages.label;" accesskey="&enableImages.accesskey;"
prefstring="network.image.enable"/>
<checkbox id="enableImagesForOriginatingSiteOnly" observes="imageBroadcaster"
label="&forOriginatingSiteOnly.label;"
accesskey="&forOriginatingSiteOnly.accesskey;"
prefstring="network.image.enableForOriginatingWebsiteOnly"
style="margin-left: 23px;"/>
</vbox>
<vbox>
<button id="manageImages"
label="&manageImages.label;" accesskey="&manageImages.accesskey;"
oncommand="viewImages();"
prefstring="pref.advanced.images.disable_button.view_image"/>
</vbox>
</groupbox>
</page>

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

@ -60,76 +60,14 @@
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-languages.xul" label="&languages.label;"/>
<treecell url="chrome://browser/content/pref/pref-privacy.xul" label="&privacy.label;" />
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-applications.xul" label="&applications.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-smart_browsing.xul" label="&smartBrowse.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-download.xul" label="&download.label;"/>
</treerow>
</treeitem>
<!-- Security and Privacy items -->
<treeitem container="true" id="securityItem">
<treerow>
<treecell url="chrome://browser/content/pref/pref-security.xul" label="&security.label;" />
</treerow>
<treechildren id="securityChildren"/>
</treeitem>
<treeitem id="advancedItem">
<treerow>
<treecell url="chrome://browser/content/pref/pref-advanced.xul" label="&advance.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-scripts.xul" label="&scriptsAndWindows.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-cache.xul" label="&cache.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-proxies.xul" label="&proxies.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-smartupdate.xul" label="&smart.label;"/>
</treerow>
</treeitem>
<treeitem container="true" id="debugItem">
<treerow>
<treecell url="chrome://browser/content/pref/pref-debug.xul" label="&debug.label;"/>
</treerow>
<treechildren id="debugChildren">
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-debug1.xul" label="&debug1.label;"/>
</treerow>
</treeitem>
<treeitem>
<treerow>
<treecell url="chrome://browser/content/pref/pref-debug2.xul" label="&debug2.label;"/>
</treerow>
</treeitem>
</treechildren>
</treeitem>
</treechildren>
</tree>

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

@ -30,7 +30,8 @@ browser.jar:
content/browser/pref/pref-proxy-manual.xul (content/pref-proxy-manual.xul)
content/browser/pref/pref-scripts.xul (content/pref-scripts.xul)
content/browser/pref/pref-scripts.js (content/pref-scripts.js)
content/browser/pref/pref-security.xul (content/pref-security.xul)
content/browser/pref/pref-privacy.xul (content/pref-privacy.xul)
content/browser/pref/pref-privacy.js (content/pref-privacy.js)
content/browser/pref/pref-smart_browsing.xul (content/pref-smart_browsing.xul)
content/browser/pref/pref-smart_browsing.js (content/pref-smart_browsing.js)
content/browser/pref/pref-smart_browsing-ac.xul (content/pref-smart_browsing-ac.xul)
@ -64,7 +65,7 @@ en-US.jar:
locale/en-US/browser/pref/pref-proxies.dtd (locale/pref-proxies.dtd)
locale/en-US/browser/pref/pref-proxy-manual.dtd (locale/pref-proxy-manual.dtd)
locale/en-US/browser/pref/pref-scripts.dtd (locale/pref-scripts.dtd)
locale/en-US/browser/pref/pref-security.dtd (locale/pref-security.dtd)
locale/en-US/browser/pref/pref-privacy.dtd (locale/pref-privacy.dtd)
locale/en-US/browser/pref/pref-smart_browsing.dtd (locale/pref-smart_browsing.dtd)
locale/en-US/browser/pref/pref-smartupdate.dtd (locale/pref-smartupdate.dtd)
locale/en-US/browser/pref/prefutilities.properties (locale/prefutilities.properties)

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

@ -0,0 +1,28 @@
<!ENTITY lHeader "Privacy">
<!ENTITY cookies.label "Cookies">
<!ENTITY enableCookies.label "Enable cookies">
<!ENTITY enableCookies.accesskey "c">
<!ENTITY forOriginatingSiteOnly.label "for originating Web site only">
<!ENTITY forOriginatingSiteOnly.accesskey "W">
<!ENTITY forCurrentSessionOnly.label "for the current session only">
<!ENTITY forCurrentSessionOnly.accesskey "s">
<!ENTITY manageCookies.label "Manage Cookies...">
<!ENTITY manageCookies.accesskey "M">
<!ENTITY history.label "History">
<!ENTITY pageHis.label "Remember visited pages for the last">
<!ENTITY pageHis.accesskey "p">
<!ENTITY days.label "days">
<!ENTITY images.label "Images">
<!ENTITY enableImages.label "Enable images">
<!ENTITY enableImages.accesskey "i">
<!ENTITY manageImages.label "Manage Images...">
<!ENTITY manageImages.accesskey "n">
<!ENTITY cache.label "Cache">
<!ENTITY diskCache.label "Use up to:">
<!ENTITY diskCache.accesskey "U">
<!ENTITY kbytes "KB of disk space for the cache.">
<!ENTITY clearCache.label "Clear Cache">
<!ENTITY clearHistory.label "Clear History">
<!ENTITY clearHistory.accesskey "H">
<!ENTITY cacheExplanation.label "Pages you view are stored in the cache for quicker viewing later on.">
<!ENTITY cookieExplanation.label "Cookies are delicious delicacies.">

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

@ -12,7 +12,7 @@
<!ENTITY applications.label "Helper Applications">
<!--LOCALIZATION NOTE (smartBrowse.label): DONT_TRANSLATE -->
<!ENTITY smartBrowse.label "Smart Browsing">
<!ENTITY security.label "Privacy &amp; Security">
<!ENTITY privacy.label "Privacy">
<!ENTITY advance.label "Advanced">
<!ENTITY down.label "Download">
<!ENTITY cache.label "Cache">