mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 12:15:51 +00:00
3450896f3f
p=giacomo.magnini@portalis.it r=kairo sr=neil.parkwaycc.co.uk a=chofmann
164 lines
7.0 KiB
XML
164 lines
7.0 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<!-- ***** BEGIN LICENSE BLOCK *****
|
|
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
The contents of this file are subject to the Mozilla 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/MPL/
|
|
|
|
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 the Initial Developer are Copyright (C) 1998-1999
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
Contributor(s):
|
|
Håkan Waara <hwaara@chello.se>
|
|
Peter Annema <disttsc@bart.nl>
|
|
|
|
Alternatively, the contents of this file may be used under the terms of
|
|
either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
in which case the provisions of the GPL or the LGPL are applicable instead
|
|
of those above. If you wish to allow use of your version of this file only
|
|
under the terms of either the GPL or the LGPL, and not to allow others to
|
|
use your version of this file under the terms of the MPL, indicate your
|
|
decision by deleting the provisions above and replace them with the notice
|
|
and other provisions required by the GPL or the LGPL. If you do not delete
|
|
the provisions above, a recipient may use your version of this file under
|
|
the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
***** END LICENSE BLOCK ***** -->
|
|
|
|
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
|
|
|
<!DOCTYPE page SYSTEM "chrome://communicator/locale/pref/pref-cookies.dtd">
|
|
|
|
<page id="cookiesPanel" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
onload="init();"
|
|
headertitle="&pref.cookies.title;">
|
|
|
|
<script type="application/x-javascript" src="chrome://communicator/content/permissions/permissionsOverlay.js"/>
|
|
|
|
<script type="application/x-javascript">
|
|
<![CDATA[
|
|
var panel = "chrome://communicator/content/pref/pref-cookies.xul";
|
|
var _elementIDs = ["networkCookieBehavior", "networkCookieLifetime",
|
|
"alwaysAcceptSession", "lifetimeDays"];
|
|
|
|
function init()
|
|
{
|
|
parent.initPanel('chrome://communicator/content/pref/pref-cookies.xul');
|
|
setDisables(false);
|
|
|
|
const NS_COOKIECONSENT_CONTRACTID = '@mozilla.org/cookie-consent;1';
|
|
if (NS_COOKIECONSENT_CONTRACTID in Components.classes) {
|
|
var p3pRadioButton = document.getElementById("p3pRadioButton");
|
|
p3pRadioButton.removeAttribute("hidden");
|
|
}
|
|
}
|
|
|
|
const cookies_disabled = "2";
|
|
const cookies_no_third_party = "1";
|
|
const cookies_p3p = "3";
|
|
const cookies_enabled = "0";
|
|
|
|
const accept_normally = "0";
|
|
const accept_session = "2";
|
|
const accept_for_n_days = "3";
|
|
const ask_before_accepting = "1";
|
|
|
|
function setDisables(setFocus)
|
|
{
|
|
var cookieBehavior = document.getElementById("networkCookieBehavior");
|
|
|
|
var p3pButton = document.getElementById("p3pDialog");
|
|
p3pButton.disabled = (cookieBehavior.value != cookies_p3p);
|
|
if (parent.hPrefWindow.getPrefIsLocked(p3pButton.getAttribute("prefstring")) )
|
|
p3pButton.disabled = true;
|
|
|
|
var cookieLifetime = document.getElementById("networkCookieLifetime");
|
|
var lifetimeDays = document.getElementById("lifetimeDays");
|
|
var alwaysAcceptSession = document.getElementById("alwaysAcceptSession");
|
|
|
|
var cookiesDisabled = (cookieBehavior.value == cookies_disabled);
|
|
cookieLifetime.disabled = cookiesDisabled;
|
|
lifetimeDays.disabled = cookiesDisabled || (cookieLifetime.value != accept_for_n_days);
|
|
alwaysAcceptSession.disabled = cookiesDisabled || (cookieLifetime.value != ask_before_accepting);
|
|
|
|
if (parent.hPrefWindow.getPrefIsLocked(alwaysAcceptSession.getAttribute("prefstring")) )
|
|
alwaysAcceptSession.disabled = true;
|
|
|
|
if (parent.hPrefWindow.getPrefIsLocked(lifetimeDays.getAttribute("prefstring")) )
|
|
lifetimeDays.disabled = true;
|
|
|
|
if (parent.hPrefWindow.getPrefIsLocked(cookieLifetime.getAttribute("prefstring")) )
|
|
cookieLifetime.disabled = true;
|
|
|
|
if (!lifetimeDays.disabled && setFocus)
|
|
lifetimeDays.focus();
|
|
}
|
|
]]>
|
|
</script>
|
|
|
|
<groupbox id="networkCookieAcceptPolicy">
|
|
<caption label="&cookiePolicy.label;"/>
|
|
<radiogroup id="networkCookieBehavior"
|
|
prefstring="network.cookie.cookieBehavior">
|
|
<radio value="2" label="&disableCookies.label;"
|
|
accesskey="&disableCookies.accesskey;" oncommand="setDisables(false);"/>
|
|
<radio value="1" label="&accOrgCookiesRadio.label;"
|
|
accesskey="&accOrgCookiesRadio.accesskey;" oncommand="setDisables(false);"/>
|
|
<hbox id="p3pRadioButton" hidden="true">
|
|
<radio value="3" label="&accP3PCookiesRadio.label;"
|
|
accesskey="&accP3PCookiesRadio.accesskey;" oncommand="setDisables(false);"/>
|
|
<button label="&viewP3P.label;" accesskey="&viewP3P.accesskey;" oncommand="viewP3P();"
|
|
id="p3pDialog"
|
|
prefstring="pref.advanced.cookies.disable_button.more_info"/>
|
|
</hbox>
|
|
<radio value="0" label="&accAllCookiesRadio.label;"
|
|
accesskey="&accAllCookiesRadio.accesskey;" oncommand="setDisables(false);"/>
|
|
</radiogroup>
|
|
</groupbox>
|
|
<groupbox id="networkCookieLifetimePolicy">
|
|
<caption label="&cookieRetentionPolicy.label;"/>
|
|
<radiogroup id="networkCookieLifetime"
|
|
prefstring="network.cookie.lifetimePolicy">
|
|
<radio value="0" label="&acceptNormally.label;" accesskey="&acceptNormally.accesskey;" oncommand="setDisables(false);"/>
|
|
<radio value="2" label="&acceptForSession.label;" accesskey="&acceptForSession.accesskey;" oncommand="setDisables(false);"/>
|
|
<hbox align="center">
|
|
<radio value="3" accesskey="&acceptforNDays.accesskey;" label="&acceptforNDays.label;"
|
|
oncommand="setDisables(true);"/>
|
|
<textbox id="lifetimeDays" pref="true" size="4"
|
|
preftype="int" prefstring="network.cookie.lifetime.days"/>
|
|
<label value="&days.label;" control="lifetimeDays"/>
|
|
</hbox>
|
|
<hbox>
|
|
<radio value="1" label="&warnAboutCookies.label;"
|
|
accesskey="&warnAboutCookies.accesskey;" oncommand="setDisables(false);"/>
|
|
<checkbox id="alwaysAcceptSession" label="&forCurrentSession.label;"
|
|
accesskey="&forCurrentSession.accesskey;"
|
|
prefstring="network.cookie.alwaysAcceptSessionCookies"/>
|
|
</hbox>
|
|
</radiogroup>
|
|
</groupbox>
|
|
<groupbox id="manageCookiesAndSites">
|
|
<caption label="&manageCookies.label;"/>
|
|
<description>&manageCookiesDescription.label;</description>
|
|
<hbox pack="end">
|
|
<button label="&viewCookies.label;" accesskey="&viewCookies.accesskey;" oncommand="viewCookies();"
|
|
id="viewCookieButton"
|
|
prefstring="pref.advanced.cookies.disable_button.view_cookies"/>
|
|
</hbox>
|
|
</groupbox>
|
|
</page>
|