add accesskeys for the cookie confirmation dialog.

b=201743, r=neil, sr=alecf


git-svn-id: svn://10.0.0.236/trunk@148585 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dwitte%stanford.edu 2003-10-30 17:26:44 +00:00
parent 4e316ffad4
commit 48da57a302
8 changed files with 22 additions and 24 deletions

View File

@ -43,9 +43,8 @@ var cookieBundle;
var gDateService = null;
var showDetails = "";
var showDetailsAccessKey = "";
var hideDetails = "";
var hideDetailsAccessKey = "";
var detailsAccessKey = "";
function onload()
{
@ -54,7 +53,9 @@ function onload()
var dialog = document.documentElement;
document.getElementById("ok").label = dialog.getAttribute("acceptLabel");
document.getElementById("ok").accessKey = dialog.getAttribute("acceptKey");
document.getElementById("cancel").label = dialog.getAttribute("cancelLabel");
document.getElementById("cancel").accessKey = dialog.getAttribute("cancelKey");
if (!gDateService) {
const nsScriptableDateFormat_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1";
@ -68,20 +69,18 @@ function onload()
//cache strings
if (!showDetails) {
showDetails = cookieBundle.getString('showDetails');
showDetailsAccessKey = cookieBundle.getString('showDetailsAccessKey');
}
if (!hideDetails) {
hideDetails = cookieBundle.getString('hideDetails');
hideDetailsAccessKey = cookieBundle.getString('hideDetailsAccessKey');
}
detailsAccessKey = cookieBundle.getString('detailsAccessKey');
if (document.getElementById('infobox').hidden) {
document.getElementById('disclosureButton').setAttribute("label",showDetails);
document.getElementById('disclosureButton').setAttribute("accesskey",showDetailsAccessKey);
} else {
document.getElementById('disclosureButton').setAttribute("label",hideDetails);
document.getElementById('disclosureButton').setAttribute("accesskey",hideDetailsAccessKey);
}
document.getElementById('disclosureButton').setAttribute("accesskey",detailsAccessKey);
if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) {
try {
@ -157,11 +156,9 @@ function showhideinfo()
if (infobox.hidden) {
infobox.setAttribute("hidden","false");
document.getElementById('disclosureButton').setAttribute("label",hideDetails);
document.getElementById('disclosureButton').setAttribute("accesskey",hideDetailsAccessKey);
} else {
infobox.setAttribute("hidden","true");
document.getElementById('disclosureButton').setAttribute("label",showDetails);
document.getElementById('disclosureButton').setAttribute("accesskey",showDetailsAccessKey);
}
sizeToContent();
}

View File

@ -46,7 +46,9 @@
<!-- use buttons="disclosure" to hide ok/cancel buttons. Those are added manually later -->
<dialog id="cookieAcceptDialog"
acceptLabel="&button.allow.label;"
acceptKey="&button.allow.accesskey;"
cancelLabel="&button.deny.label;"
cancelKey="&button.deny.accesskey;"
onload="onload();"
ondialogaccept="return doOKButton();"
title="&dialog.title;"

View File

@ -8,7 +8,9 @@
<!ENTITY props.policy.label "Policy:">
<!ENTITY button.allow.label "Allow">
<!ENTITY button.allow.accesskey "A">
<!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">

View File

@ -6,14 +6,12 @@ atEndOfSession=at end of session
showDetails=Show Details
hideDetails=Hide Details
showDetailsAccessKey = S
hideDetailsAccessKey = H
detailsAccessKey=T
permissionToSetACookie = The site %S wants to set a cookie.
permissionToSetSecondCookie = The site %S wants to set a second cookie.
# LOCALIZATION NOTE (PermissionToSetAnotherCookie): First %S: sitename, second %S: number of cookies already present for that site
permissionToSetAnotherCookie = The site %S wants permission to set another cookie.\nYou already have %S cookies from this site.
permissionToSetAnotherCookie = The site %S wants to set another cookie.\nYou already have %S cookies from this site.
permissionToModifyCookie = The site %S wants to modify an existing cookie.
permissionToAcceptImage = The site %S wants to load an image.
rememberThisDecision = Remember this decision

View File

@ -43,9 +43,8 @@ var cookieBundle;
var gDateService = null;
var showDetails = "";
var showDetailsAccessKey = "";
var hideDetails = "";
var hideDetailsAccessKey = "";
var detailsAccessKey = "";
function onload()
{
@ -54,7 +53,9 @@ function onload()
var dialog = document.documentElement;
document.getElementById("ok").label = dialog.getAttribute("acceptLabel");
document.getElementById("ok").accessKey = dialog.getAttribute("acceptKey");
document.getElementById("cancel").label = dialog.getAttribute("cancelLabel");
document.getElementById("cancel").accessKey = dialog.getAttribute("cancelKey");
if (!gDateService) {
const nsScriptableDateFormat_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1";
@ -68,20 +69,18 @@ function onload()
//cache strings
if (!showDetails) {
showDetails = cookieBundle.getString('showDetails');
showDetailsAccessKey = cookieBundle.getString('showDetailsAccessKey');
}
if (!hideDetails) {
hideDetails = cookieBundle.getString('hideDetails');
hideDetailsAccessKey = cookieBundle.getString('hideDetailsAccessKey');
}
detailsAccessKey = cookieBundle.getString('detailsAccessKey');
if (document.getElementById('infobox').hidden) {
document.getElementById('disclosureButton').setAttribute("label",showDetails);
document.getElementById('disclosureButton').setAttribute("accesskey",showDetailsAccessKey);
} else {
document.getElementById('disclosureButton').setAttribute("label",hideDetails);
document.getElementById('disclosureButton').setAttribute("accesskey",hideDetailsAccessKey);
}
document.getElementById('disclosureButton').setAttribute("accesskey",detailsAccessKey);
if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) {
try {
@ -157,11 +156,9 @@ function showhideinfo()
if (infobox.hidden) {
infobox.setAttribute("hidden","false");
document.getElementById('disclosureButton').setAttribute("label",hideDetails);
document.getElementById('disclosureButton').setAttribute("accesskey",hideDetailsAccessKey);
} else {
infobox.setAttribute("hidden","true");
document.getElementById('disclosureButton').setAttribute("label",showDetails);
document.getElementById('disclosureButton').setAttribute("accesskey",showDetailsAccessKey);
}
sizeToContent();
}

View File

@ -46,7 +46,9 @@
<!-- use buttons="disclosure" to hide ok/cancel buttons. Those are added manually later -->
<dialog id="cookieAcceptDialog"
acceptLabel="&button.allow.label;"
acceptKey="&button.allow.accesskey;"
cancelLabel="&button.deny.label;"
cancelKey="&button.deny.accesskey;"
onload="onload();"
ondialogaccept="return doOKButton();"
title="&dialog.title;"

View File

@ -8,7 +8,9 @@
<!ENTITY props.policy.label "Policy:">
<!ENTITY button.allow.label "Allow">
<!ENTITY button.allow.accesskey "A">
<!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">

View File

@ -6,14 +6,12 @@ atEndOfSession=at end of session
showDetails=Show Details
hideDetails=Hide Details
showDetailsAccessKey = S
hideDetailsAccessKey = H
detailsAccessKey=T
permissionToSetACookie = The site %S wants to set a cookie.
permissionToSetSecondCookie = The site %S wants to set a second cookie.
# LOCALIZATION NOTE (PermissionToSetAnotherCookie): First %S: sitename, second %S: number of cookies already present for that site
permissionToSetAnotherCookie = The site %S wants permission to set another cookie.\nYou already have %S cookies from this site.
permissionToSetAnotherCookie = The site %S wants to set another cookie.\nYou already have %S cookies from this site.
permissionToModifyCookie = The site %S wants to modify an existing cookie.
permissionToAcceptImage = The site %S wants to load an image.
rememberThisDecision = Remember this decision