This commit is contained in:
mconnor%myrealbox.com 2004-03-05 01:31:43 +00:00
Родитель 9f4b7fdd32
Коммит 46d5f57117
6 изменённых файлов: 42 добавлений и 32 удалений

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

@ -49,12 +49,16 @@ var detailsAccessKey = "";
function onload()
{
doSetOKCancel(cookieAccept, cookieDeny);
doSetOKCancel(cookieAcceptNormal, cookieDeny, cookieAcceptSession);
var dialog = document.documentElement;
document.getElementById("Button2").collapsed = false;
document.getElementById("ok").label = dialog.getAttribute("acceptLabel");
document.getElementById("ok").accessKey = dialog.getAttribute("acceptKey");
document.getElementById("Button2").label = dialog.getAttribute("extra1Label");
document.getElementById("Button2").accessKey = dialog.getAttribute("extra1Key");
document.getElementById("cancel").label = dialog.getAttribute("cancelLabel");
document.getElementById("cancel").accessKey = dialog.getAttribute("cancelKey");
@ -164,13 +168,19 @@ function showhideinfo()
sizeToContent();
}
function cookieAccept()
function cookieAcceptNormal()
{
// the cookie was accepted, now check whether it should be session-only and return accordingly
if (document.getElementById('acceptSession').checked)
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_SESSION_COOKIE);
else
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_COOKIE);
// accept the cookie normally
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_COOKIE);
// And remember that when needed
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
window.close();
}
function cookieAcceptSession()
{
// accept for the session only
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_SESSION_COOKIE);
// And remember that when needed
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
window.close();

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

@ -47,6 +47,8 @@
<dialog id="cookieAcceptDialog"
acceptLabel="&button.allow.label;"
acceptKey="&button.allow.accesskey;"
extra1Label="&button.session.label;"
extra1Key="&button.session.accesskey;"
cancelLabel="&button.deny.label;"
cancelKey="&button.deny.accesskey;"
onload="onload();"
@ -71,13 +73,6 @@
<description id="dialog-header" class="header"/>
</vbox>
<hbox id="acceptSessionContainer">
<checkbox id="acceptSession"
label="&dialog.acceptSession.label;"
accesskey="&dialog.acceptSession.accesskey;"
persist="checked"/>
</hbox>
<hbox id="checkboxContainer">
<checkbox id="persistDomainAcceptance"
label="&dialog.remember.label;"

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

@ -9,11 +9,11 @@
<!ENTITY button.allow.label "Allow">
<!ENTITY button.allow.accesskey "A">
<!ENTITY button.session.label "Allow for Session">
<!ENTITY button.session.accesskey "S">
<!ENTITY button.deny.label "Deny">
<!ENTITY button.deny.accesskey "D">
<!ENTITY dialog.title "Confirm">
<!ENTITY dialog.remember.label "Use my choice for all cookies from this site">
<!ENTITY dialog.remember.accesskey "U">
<!ENTITY dialog.acceptSession.label "Accept for the current session only">
<!ENTITY dialog.acceptSession.accesskey "S">

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

@ -49,12 +49,16 @@ var detailsAccessKey = "";
function onload()
{
doSetOKCancel(cookieAccept, cookieDeny);
doSetOKCancel(cookieAcceptNormal, cookieDeny, cookieAcceptSession);
var dialog = document.documentElement;
document.getElementById("Button2").collapsed = false;
document.getElementById("ok").label = dialog.getAttribute("acceptLabel");
document.getElementById("ok").accessKey = dialog.getAttribute("acceptKey");
document.getElementById("Button2").label = dialog.getAttribute("extra1Label");
document.getElementById("Button2").accessKey = dialog.getAttribute("extra1Key");
document.getElementById("cancel").label = dialog.getAttribute("cancelLabel");
document.getElementById("cancel").accessKey = dialog.getAttribute("cancelKey");
@ -164,13 +168,19 @@ function showhideinfo()
sizeToContent();
}
function cookieAccept()
function cookieAcceptNormal()
{
// the cookie was accepted, now check whether it should be session-only and return accordingly
if (document.getElementById('acceptSession').checked)
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_SESSION_COOKIE);
else
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_COOKIE);
// accept the cookie normally
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_COOKIE);
// And remember that when needed
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
window.close();
}
function cookieAcceptSession()
{
// accept for the session only
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, nsICookiePromptService.ACCEPT_SESSION_COOKIE);
// And remember that when needed
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
window.close();

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

@ -47,6 +47,8 @@
<dialog id="cookieAcceptDialog"
acceptLabel="&button.allow.label;"
acceptKey="&button.allow.accesskey;"
extra1Label="&button.session.label;"
extra1Key="&button.session.accesskey;"
cancelLabel="&button.deny.label;"
cancelKey="&button.deny.accesskey;"
onload="onload();"
@ -71,13 +73,6 @@
<description id="dialog-header" class="header"/>
</vbox>
<hbox id="acceptSessionContainer">
<checkbox id="acceptSession"
label="&dialog.acceptSession.label;"
accesskey="&dialog.acceptSession.accesskey;"
persist="checked"/>
</hbox>
<hbox id="checkboxContainer">
<checkbox id="persistDomainAcceptance"
label="&dialog.remember.label;"

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

@ -9,11 +9,11 @@
<!ENTITY button.allow.label "Allow">
<!ENTITY button.allow.accesskey "A">
<!ENTITY button.session.label "Allow for Session">
<!ENTITY button.session.accesskey "S">
<!ENTITY button.deny.label "Deny">
<!ENTITY button.deny.accesskey "D">
<!ENTITY dialog.title "Confirm">
<!ENTITY dialog.remember.label "Use my choice for all cookies from this site">
<!ENTITY dialog.remember.accesskey "U">
<!ENTITY dialog.acceptSession.label "Accept for the current session only">
<!ENTITY dialog.acceptSession.accesskey "S">