Bug 206356: cookies refused by default if you just close dialog.

makes the "do you want to accept this cookie?" dialog more user-friendly, by not touching the permission list if you dismiss the dialog without clicking a button.

patch by mvl, r=neil, sr=jag, a=asa.
This commit is contained in:
dwitte%stanford.edu 2003-05-22 00:37:48 +00:00
Родитель efc98e6607
Коммит d31b372b38
4 изменённых файлов: 30 добавлений и 20 удалений

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

@ -49,7 +49,7 @@ var hideDetailsAccessKey = "";
function onload()
{
doSetOKCancel(cookieAccept);
doSetOKCancel(cookieAccept, cookieDeny);
var dialog = document.documentElement;
@ -126,9 +126,6 @@ function onload()
messageParent.appendChild(descriptionNode);
}
// Must we remember the decision?
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
if (cookie) {
document.getElementById('ifl_name').setAttribute("value",cookie.name);
document.getElementById('ifl_value').setAttribute("value",cookie.value);
@ -146,6 +143,8 @@ function onload()
}
// set default result to not accept the cookie
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 0);
// and to not persist
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, 0);
} catch (e) {
}
}
@ -167,15 +166,21 @@ function showhideinfo()
sizeToContent();
}
function onChangePersistence()
{
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
}
function cookieAccept()
{
// say that the cookie was accepted
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 1);
// And remember that when needed
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
window.close();
}
function cookieDeny()
{
// say that the cookie was rejected
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 0);
// And remember that when needed
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
window.close();
}

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

@ -70,7 +70,7 @@
</vbox>
<hbox id="checkboxContainer">
<checkbox id="persistDomainAcceptance" oncommand="onChangePersistence();"
<checkbox id="persistDomainAcceptance"
label="&dialog.remember.label;" accesskey="&dialog.remember.accesskey;"
persist="checked"/>
</hbox>

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

@ -49,7 +49,7 @@ var hideDetailsAccessKey = "";
function onload()
{
doSetOKCancel(cookieAccept);
doSetOKCancel(cookieAccept, cookieDeny);
var dialog = document.documentElement;
@ -126,9 +126,6 @@ function onload()
messageParent.appendChild(descriptionNode);
}
// Must we remember the decision?
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
if (cookie) {
document.getElementById('ifl_name').setAttribute("value",cookie.name);
document.getElementById('ifl_value').setAttribute("value",cookie.value);
@ -146,6 +143,8 @@ function onload()
}
// set default result to not accept the cookie
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 0);
// and to not persist
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, 0);
} catch (e) {
}
}
@ -167,15 +166,21 @@ function showhideinfo()
sizeToContent();
}
function onChangePersistence()
{
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
}
function cookieAccept()
{
// say that the cookie was accepted
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 1);
// And remember that when needed
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
window.close();
}
function cookieDeny()
{
// say that the cookie was rejected
params.SetInt(nsICookieAcceptDialog.ACCEPT_COOKIE, 0);
// And remember that when needed
params.SetInt(nsICookieAcceptDialog.REMEMBER_DECISION, document.getElementById('persistDomainAcceptance').checked);
window.close();
}

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

@ -70,7 +70,7 @@
</vbox>
<hbox id="checkboxContainer">
<checkbox id="persistDomainAcceptance" oncommand="onChangePersistence();"
<checkbox id="persistDomainAcceptance"
label="&dialog.remember.label;" accesskey="&dialog.remember.accesskey;"
persist="checked"/>
</hbox>