Bug 252698 Use buttonlabel attributes in <dialog>s
r=glazou, sr=neil git-svn-id: svn://10.0.0.236/trunk@165892 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -48,13 +48,8 @@ function Startup()
|
||||
return;
|
||||
}
|
||||
|
||||
var okButton = document.documentElement.getButton("accept");
|
||||
if (okButton)
|
||||
{
|
||||
okButton.removeAttribute("default");
|
||||
okButton.setAttribute("label",GetString("Insert"));
|
||||
okButton.setAttribute("accesskey",GetString("InsertAccessKey"));
|
||||
}
|
||||
document.documentElement.getButton("accept").removeAttribute("default");
|
||||
|
||||
// Create dialog object to store controls for easy access
|
||||
gDialog.srcInput = document.getElementById("srcInput");
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
<dialog title="&windowTitle.label;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload = "Startup()"
|
||||
buttonlabelaccept="&insertButton.label;"
|
||||
buttonaccesskeyaccept="&insertButton.accesskey;"
|
||||
ondialogaccept="return onAccept();"
|
||||
ondialogcancel="return onCancel();">
|
||||
|
||||
|
||||
@@ -61,19 +61,6 @@ function Startup()
|
||||
|
||||
StartupLatin();
|
||||
|
||||
// Dialog is non-modal:
|
||||
// Change button text: "Ok" to "Insert"; "Cancel" to "Close"
|
||||
var insertButton = document.documentElement.getButton("accept");
|
||||
if (insertButton)
|
||||
{
|
||||
insertButton.setAttribute("label", GetString("Insert"));
|
||||
insertButton.setAttribute("accesskey", GetString("InsertAccessKey"));
|
||||
}
|
||||
|
||||
var cancelButton = document.getElementById("insertCharsDlg").getButton("cancel");
|
||||
if (cancelButton)
|
||||
cancelButton.setAttribute("label", GetString("Close"));
|
||||
|
||||
// Set a variable on the opener window so we
|
||||
// can track ownership of close this window with it
|
||||
window.opener.InsertCharWindow = window;
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload = "Startup()"
|
||||
onfocus = "onFocus()"
|
||||
buttonlabelaccept="&insertButton.label;"
|
||||
buttonlabelcancel="&closeButton.label;"
|
||||
ondialogaccept = "return onAccept();"
|
||||
ondialogcancel = "return onClose();">
|
||||
|
||||
|
||||
@@ -97,7 +97,6 @@ function Startup()
|
||||
}
|
||||
|
||||
gDialog.LinksList = document.getElementById("LinksList");
|
||||
gDialog.Close = document.documentElement.getButton("cancel");
|
||||
|
||||
// Set window location relative to parent window (based on persisted attributes)
|
||||
SetWindowLocation();
|
||||
@@ -176,7 +175,6 @@ function LinkCheckTimeOut()
|
||||
break;
|
||||
}
|
||||
}
|
||||
gDialog.Close.setAttribute("label", GetString("Close"));
|
||||
}
|
||||
|
||||
// Add url to list of links to check
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<dialog title="&windowTitle.label;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Startup()"
|
||||
buttonlabelcancel="&closeButton.label;"
|
||||
ondialogaccept="return onAccept();"
|
||||
ondialogcancel="return onCancelLinkChecker();">
|
||||
|
||||
|
||||
@@ -292,14 +292,6 @@ function Startup()
|
||||
|
||||
function InitDialog()
|
||||
{
|
||||
// turn on extra1 to be "apply"
|
||||
var applyButton = document.documentElement.getButton("extra1");
|
||||
if (applyButton)
|
||||
{
|
||||
applyButton.label = GetString("Apply");
|
||||
applyButton.setAttribute("accesskey", GetString("ApplyAccessKey"));
|
||||
}
|
||||
|
||||
// Get Table attributes
|
||||
gDialog.TableRowsInput.value = gRowCount;
|
||||
gDialog.TableColumnsInput.value = gColCount;
|
||||
@@ -1285,7 +1277,8 @@ function SetCloseButton()
|
||||
// Change text on "Cancel" button after Apply is used
|
||||
if (!gApplyUsed)
|
||||
{
|
||||
document.documentElement.getButton("cancel").setAttribute("label",GetString("Close"));
|
||||
document.documentElement.setAttribute("buttonlabelcancel",
|
||||
document.documentElement.getAttribute("buttonlabelclose"));
|
||||
gApplyUsed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,9 @@
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Startup()"
|
||||
buttons="accept,extra1,cancel,help"
|
||||
buttonlabelclose="&closeButton.label;"
|
||||
buttonlabelextra1="&applyButton.label;"
|
||||
buttonaccesskeyextra1="&applyButton.accesskey;"
|
||||
ondialogaccept="return onAccept();"
|
||||
ondialogextra1="return Apply();"
|
||||
ondialogcancel="return onCancel();"
|
||||
|
||||
@@ -86,11 +86,6 @@ function Startup()
|
||||
gDialog.PasswordInput = document.getElementById("PasswordInput");
|
||||
gDialog.SavePassword = document.getElementById("SavePassword");
|
||||
|
||||
gDialog.PublishButton = document.documentElement.getButton("accept");
|
||||
|
||||
// Change 'Ok' button to 'Publish'
|
||||
gDialog.PublishButton.setAttribute("label", GetString("Publish"));
|
||||
|
||||
gPasswordManagerOn = GetBoolPref("signon.rememberSignons");
|
||||
gDialog.SavePassword.disabled = !gPasswordManagerOn;
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="Startup()"
|
||||
buttons="accept,cancel,help"
|
||||
buttonlabelaccept="&publishButton.label;"
|
||||
ondialogaccept="return onAccept();"
|
||||
ondialogcancel="return onCancel();"
|
||||
ondialoghelp="return doHelpButton();">
|
||||
|
||||
@@ -294,7 +294,10 @@ function SetProgressFinished(filename, networkStatus)
|
||||
else if (!filename)
|
||||
{
|
||||
gFinished = true;
|
||||
gDialog.Close.setAttribute("label", GetString("Close"));
|
||||
|
||||
document.documentElement.setAttribute("buttonlabelcancel",
|
||||
document.documentElement.getAttribute("buttonlabelclose"));
|
||||
|
||||
if (!gStatusMessage)
|
||||
gStatusMessage = GetString(gPublishingFailed ? "UnknownPublishError" : "AllFilesPublished");
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<dialog title=""
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
buttons="cancel"
|
||||
buttonlabelclose="&closeButton.label;"
|
||||
onload="Startup()"
|
||||
ondialogaccept="return onEnterKey();"
|
||||
ondialogcancel="return onClose();">
|
||||
|
||||
@@ -43,3 +43,4 @@
|
||||
<!ENTITY changeUrlButton.label "Change Location of Selected Item">
|
||||
<!ENTITY succeeded.label "Succeeded">
|
||||
<!ENTITY failed.label "Failed">
|
||||
<!ENTITY closeButton.label "Close">
|
||||
|
||||
@@ -48,3 +48,5 @@
|
||||
<!ENTITY otherUpper.label "Other Uppercase">
|
||||
<!ENTITY otherLower.label "Other Lowercase">
|
||||
<!ENTITY commonSymbols.label "Common Symbols">
|
||||
<!ENTITY insertButton.label "Insert">
|
||||
<!ENTITY closeButton.label "Close">
|
||||
|
||||
@@ -44,3 +44,5 @@
|
||||
<!-- LOCALIZATION NOTE (exampleCloseTag.label): DONT_TRANSLATE: they are text for HTML tagnames: "<i>" and "</i>" -->
|
||||
<!ENTITY exampleCloseTag.label "</i>">
|
||||
<!ENTITY exampleText.label "Hello World!">
|
||||
<!ENTITY insertButton.label "Insert">
|
||||
<!ENTITY insertButton.accesskey "I">
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
<!ENTITY publishTab.label "Publish">
|
||||
<!ENTITY settingsTab.label "Settings">
|
||||
|
||||
<!ENTITY publishButton.label "Publish">
|
||||
|
||||
<!-- Publish Tab Panel -->
|
||||
<!ENTITY siteList.label "Site Name:">
|
||||
<!ENTITY siteList.tooltip "Choose the site that you want to publish to">
|
||||
|
||||
@@ -51,3 +51,4 @@
|
||||
<!ENTITY troubleshooting.accessKey "T">
|
||||
|
||||
<!ENTITY keepOpen "Keep this window open after publishing is complete.">
|
||||
<!ENTITY closeButton.label "Close">
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<!ENTITY tableWindow.title "Table Properties">
|
||||
<!ENTITY applyButton.label "Apply">
|
||||
<!ENTITY applyButton.accesskey "A">
|
||||
<!ENTITY closeButton.label "Close">
|
||||
<!ENTITY tableTab.label "Table">
|
||||
<!ENTITY cellTab.label "Cells">
|
||||
<!ENTITY tableRows.label "Rows:">
|
||||
|
||||
Reference in New Issue
Block a user