home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2003 May
/
PCWorld_2003-05_cd.bin
/
Komunik
/
phoenix
/
chrome
/
browser.jar
/
content
/
browser
/
pref
/
pref-privacy.xul
< prev
next >
Wrap
Extensible Markup Language
|
2002-11-16
|
6KB
|
132 lines
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/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",
"enableCookiesButAskFirst"];
function Startup() {
var cookiesEnabled = document.getElementById("enableCookies").checked;
updateBroadcaster(!cookiesEnabled);
var clearHistButton = document.getElementById("browserClearHistory");
try {
var isBtnLocked = parent.hPrefWindow.getPrefIsLocked(clearHistButton.getAttribute("prefstring"));
var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"]
.getService(Components.interfaces.nsIBrowserHistory);
clearHistButton.disabled = ( globalHistory.count == 0) || isBtnLocked;
}
catch(ex) {
}
}
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();
}
function updateBroadcaster(aDisable)
{
var broadcaster = document.getElementById("cookieBroadcaster");
var checkbox1 = document.getElementById("enableCookiesForOriginatingSiteOnly");
var checkbox2 = document.getElementById("enableCookiesForCurrentSessionOnly");
var checkbox3 = document.getElementById("enableCookiesButAskFirst");
if (aDisable) {
broadcaster.setAttribute("disabled", "true");
checkbox1.checked = false;
checkbox2.checked = false;
checkbox3.checked = false;
}
else
broadcaster.removeAttribute("disabled");
}
]]>
</script>
<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="updateBroadcaster(!this.checked);"
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;"/>
<checkbox id="enableCookiesButAskFirst" observes="cookieBroadcaster"
label="&butAskFirst.label;" accesskey="&butAskFirst.accesskey;"
prefstring="network.cookie.warnAboutCookies"
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>
</page>