Bug 277097 Tidy up cookie js/xul/pref code (Removing js/xul from extensions/cookie) - history for pref-cookies.xul/dtd and pref-images.xul/dtd can be got from the attic (see bug for details)

p=me r=dwitte/benjamin sr=darin
This commit is contained in:
bugzilla%arlen.demon.co.uk 2006-05-17 02:39:42 +00:00
parent 23273f4fed
commit 57c451839f
7 changed files with 378 additions and 11 deletions

View File

@ -37,28 +37,28 @@
-
- ***** END LICENSE BLOCK ***** -->
<!DOCTYPE overlay SYSTEM "chrome://cookie/locale/cookiePrefsOverlay.dtd" >
<!DOCTYPE overlay SYSTEM "chrome://communicator/locale/pref/permissionsPrefsOverlay.dtd" >
<overlay id="cookiePrefsOverlay"
<overlay id="permissionsPrefsOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<treechildren id="securityChildren">
<treeitem position="1">
<treerow>
<treecell url="chrome://cookie/content/pref-cookies.xul"
<treecell url="chrome://communicator/content/pref/pref-cookies.xul"
label="&cookies.label;"
id="cookiesCell"/>
</treerow>
</treeitem>
<treeitem position="2">
<treerow>
<treecell url="chrome://cookie/content/pref-images.xul"
<treecell url="chrome://communicator/content/pref/pref-images.xul"
label="&images.label;"/>
</treerow>
</treeitem>
<treeitem id="popupspref" position="3">
<treerow>
<treecell url="chrome://cookie/content/pref-popups.xul"
<treecell url="chrome://communicator/content/pref/pref-popups.xul"
label="&popups.label;"/>
</treerow>
</treeitem>

View File

@ -0,0 +1,163 @@
<?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="&lHeader;">
<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>

View File

@ -34,9 +34,9 @@ var fm = {
"chrome://messenger/content/addressbook/pref-addressing.xul": "mail_prefs_addressing",
"chrome://messenger/content/pref-offline.xul": "mail_prefs_offline",
"chrome://communicator/content/pref/pref-security.xul": "sec_gen",
"chrome://cookie/content/pref-cookies.xul": "cookies_prefs",
"chrome://cookie/content/pref-images.xul": "images_prefs",
"chrome://cookie/content/pref-popups.xul": "pop_up_blocking",
"chrome://communicator/content/pref/pref-cookies.xul": "cookies_prefs",
"chrome://communicator/content/pref/pref-images.xul": "images_prefs",
"chrome://communicator/content/pref/pref-popups.xul": "pop_up_blocking",
"chrome://wallet/content/pref-wallet.xul": "forms_prefs",
"chrome://pippki/content/pref-masterpass.xul": "passwords_master",
"chrome://wallet/content/pref-passwords.xul": "passwords_prefs",

View File

@ -0,0 +1,133 @@
<?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 [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % prefImagesDTD SYSTEM "chrome://communicator/locale/pref/pref-images.dtd" >
%prefImagesDTD;
]>
<page id="imagesPanel" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="init();"
headertitle="&lHeader;">
<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-images.xul";
var _elementIDs = ["accOrgImages", "networkImageBehaviour", "imageLooping"];
function init()
{
parent.initPanel('chrome://communicator/content/pref/pref-images.xul');
setDisables();
}
function setDisables()
{
var imageBehavior = document.getElementById("networkImageBehaviour");
// if mailnews is installed then we will have networkImageDisableImagesInMailNews checkbox
var networkImageDisableImagesInMailNews = document.getElementById("networkImageDisableImagesInMailNews");
if (networkImageDisableImagesInMailNews)
{
var prefString = networkImageDisableImagesInMailNews.getAttribute("prefstring");
networkImageDisableImagesInMailNews.disabled = (imageBehavior.value == 2)
|| parent.hPrefWindow.getPrefIsLocked(prefString);
}
}
]]>
</script>
<broadcaster id="haveImageBlocking"/>
<broadcaster id="haveImageBlockingOrMailnews"/>
<groupbox id="imagesArea">
<caption label="&imageBlocking.label;"/>
<description>&imageDetails;</description>
<radiogroup id="networkImageBehaviour"
prefstring="permissions.default.image">
<radio value="2" label="&disableImages.label;"
accesskey="&disableImages.accesskey;"
oncommand="setDisables();"/>
<radio value="3" label="&accOrgImagesRadio.label;"
accesskey="&accOrgImagesRadio.accesskey;"
id="accOrgImages" observes="haveImageBlocking"
oncommand="setDisables();"/>
<radio value="1" label="&accAllImagesRadio.label;"
accesskey="&accAllImagesRadio.accesskey;"
oncommand="setDisables();"/>
</radiogroup>
<separator id="networkImagesBehaviorSeparator" observes="haveImageBlockingOrMailnews"/>
<separator observes="haveImageBlocking"/>
<hbox pack="end">
<button id="viewImages" label="&viewImages.label;"
accesskey="&viewImages.accesskey;" oncommand="viewImages();"
observes="haveImageBlocking"
prefstring="pref.advanced.images.disable_button.view_image"/>
</hbox>
</groupbox>
<groupbox>
<caption label="&animLoopingTitle.label;"/>
<radiogroup id="imageLooping"
preftype="string" prefstring="image.animation_mode">
<radio value="normal" label="&animLoopAsSpecified.label;"
accesskey="&animLoopAsSpecified.accesskey;"/>
<radio value="once" label="&animLoopOnce.label;"
accesskey="&animLoopOnce.accesskey;"/>
<radio value="none" label="&animLoopNever.label;"
accesskey="&animLoopNever.accesskey;"/>
</radiogroup>
</groupbox>
</page>

View File

@ -39,13 +39,13 @@
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<!DOCTYPE page [
<!ENTITY % prefPopupsDTD SYSTEM "chrome://cookie/locale/pref-popups.dtd" >
<!ENTITY % prefPopupsDTD SYSTEM "chrome://communicator/locale/pref/pref-popups.dtd" >
%prefPopupsDTD;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="popupsPanel"
onload="parent.initPanel('chrome://cookie/content/pref-popups.xul');"
onload="parent.initPanel('chrome://communicator/content/pref/pref-popups.xul');"
headertitle="&title;">
<script type="application/x-javascript">
@ -92,7 +92,7 @@
document.getElementById("prefillWhitelist").setAttribute("value", false);
}
if (parent.queuedTag == "chrome://cookie/content/pref-popups.xul") {
if (parent.queuedTag == "chrome://communicator/content/pref/pref-popups.xul") {
// opened from About Popups menuitem
gPolicyCheckbox.checked = true;
parent.queuedTag = null;

View File

@ -0,0 +1,43 @@
<!ENTITY lHeader "Cookies">
<!-- cookies -->
<!ENTITY cookiePolicy.label "Cookie Acceptance Policy">
<!ENTITY accAllCookiesRadio.label "Allow all cookies">
<!ENTITY accAllCookiesRadio.accesskey "c">
<!ENTITY accOrgCookiesRadio.label "Allow cookies for the originating website only">
<!ENTITY accOrgCookiesRadio.accesskey "o">
<!ENTITY accP3PCookiesRadio.label "Allow cookies based on privacy settings">
<!ENTITY accP3PCookiesRadio.accesskey "p">
<!ENTITY disableCookies.label "Block cookies">
<!ENTITY disableCookies.accesskey "B">
<!ENTITY cookieRetentionPolicy.label "Cookie Retention Policy">
<!ENTITY acceptNormally.label "Accept cookies normally">
<!ENTITY acceptNormally.accesskey "n">
<!ENTITY acceptForSession.label "Accept for current session only">
<!ENTITY acceptForSession.accesskey "s">
<!ENTITY acceptforNDays.label "Accept cookies for">
<!ENTITY acceptforNDays.accesskey "f">
<!ENTITY days.label "days">
<!ENTITY warnAboutCookies.label "Ask for each cookie">
<!ENTITY warnAboutCookies.accesskey "A">
<!ENTITY forCurrentSession.label "except for session cookies">
<!ENTITY forCurrentSession.accesskey "e">
<!ENTITY manageCookies.label "Manage Cookies and Sites">
<!ENTITY manageCookiesDescription.label "Allows you to view and manage stored cookies and per-site settings for accepting and rejecting cookies. Per-site settings will override the settings above.">
<!ENTITY viewCookies.label "Cookie Manager">
<!ENTITY viewCookies.accesskey "M">
<!ENTITY viewP3P.label "View Privacy Settings">
<!ENTITY viewP3P.accesskey "V">

View File

@ -0,0 +1,28 @@
<!ENTITY lHeader "Images">
<!ENTITY imageBlocking.label "Image Acceptance Policy">
<!--LOCALIZATION NOTE (onStartLegend.label): Don't translate "&brandShortName;".
Place "&brandShortName;" in the phrase where the name of the application should
appear
-->
<!ENTITY imageDetails "Specify how &brandShortName; handles images.">
<!ENTITY accAllImagesRadio.label "Accept all images">
<!ENTITY accAllImagesRadio.accesskey "A">
<!ENTITY accOrgImagesRadio.label "Accept images that come from the originating server only">
<!ENTITY accOrgImagesRadio.accesskey "r">
<!ENTITY disableImages.label "Do not load any images">
<!ENTITY disableImages.accesskey "n">
<!ENTITY warnAboutImages.label "Ask me before downloading an image">
<!ENTITY warnAboutImages.accesskey "k">
<!ENTITY viewImagesExplanation.label "View list of sites about which image acceptance information is stored">
<!ENTITY viewImages.label "Manage Image Permissions">
<!ENTITY viewImages.accesskey "P">
<!ENTITY animLoopingTitle.label "Animated images should loop">
<!ENTITY animLoopAsSpecified.label "As many times as the image specifies">
<!ENTITY animLoopAsSpecified.accesskey "m">
<!ENTITY animLoopOnce.label "Once">
<!ENTITY animLoopOnce.accesskey "O">
<!ENTITY animLoopNever.label "Never">
<!ENTITY animLoopNever.accesskey "v">