gecko-dev/browser/components/prefwindow/content/pref-privacy.xul

166 строки
7.6 KiB
XML

<?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">
<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">
<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>