From aa320a7c5328354ec23950fc7e8a3329cdc4a415 Mon Sep 17 00:00:00 2001 From: "Stefan.Borggraefe%gmx.de" Date: Mon, 29 Nov 2004 18:04:23 +0000 Subject: [PATCH] Bug 252698 Use buttonlabel attributes in s r=glazou, sr=neil git-svn-id: svn://10.0.0.236/trunk@165892 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ui/composer/locale/en-US/editor.properties | 6 ------ mozilla/editor/ui/dialogs/content/EdInsSrc.js | 9 ++------- mozilla/editor/ui/dialogs/content/EdInsSrc.xul | 2 ++ mozilla/editor/ui/dialogs/content/EdInsertChars.js | 13 ------------- mozilla/editor/ui/dialogs/content/EdInsertChars.xul | 2 ++ mozilla/editor/ui/dialogs/content/EdLinkChecker.js | 2 -- mozilla/editor/ui/dialogs/content/EdLinkChecker.xul | 1 + mozilla/editor/ui/dialogs/content/EdTableProps.js | 11 ++--------- mozilla/editor/ui/dialogs/content/EdTableProps.xul | 3 +++ mozilla/editor/ui/dialogs/content/EditorPublish.js | 5 ----- mozilla/editor/ui/dialogs/content/EditorPublish.xul | 1 + .../ui/dialogs/content/EditorPublishProgress.js | 5 ++++- .../ui/dialogs/content/EditorPublishProgress.xul | 1 + .../ui/dialogs/locale/en-US/EdLinkChecker.dtd | 1 + .../ui/dialogs/locale/en-US/EditorInsertChars.dtd | 2 ++ .../ui/dialogs/locale/en-US/EditorInsertSource.dtd | 2 ++ .../ui/dialogs/locale/en-US/EditorPublish.dtd | 2 ++ .../dialogs/locale/en-US/EditorPublishProgress.dtd | 1 + .../dialogs/locale/en-US/EditorTableProperties.dtd | 3 +++ 19 files changed, 29 insertions(+), 43 deletions(-) diff --git a/mozilla/editor/ui/composer/locale/en-US/editor.properties b/mozilla/editor/ui/composer/locale/en-US/editor.properties index 9b8e8bdb864..0fb03b3daf2 100644 --- a/mozilla/editor/ui/composer/locale/en-US/editor.properties +++ b/mozilla/editor/ui/composer/locale/en-US/editor.properties @@ -8,9 +8,6 @@ # Yes=Yes No=No -Cancel=Cancel -Insert=Insert -InsertAccessKey=I Save=Save DontSave=Don't Save More=More @@ -201,7 +198,6 @@ Clear=Clear Click=Click Drag=Drag Unknown=Unknown -Close=Close # # LOCALIZATION NOTE "RemoveTextStylesAccesskey" is used for both # menu items: "RemoveTextStyles" and "StopTextStyles" @@ -219,8 +215,6 @@ NoFormAction=It is recommended that you enter an action for this form. Self-post NoAltText=If the image is relevant to the content of the document, you must supply alternate text that will appear in text-only browsers, and that will appear in other browsers when an image is loading or when image loading is disabled. SaveImageAs=Save Image (%NAME%)... NoSeparatorCharacter=Please enter a single character to use for separating into columns -Apply=Apply -ApplyAccessKey=A # # LOCALIZATION NOTE please do not translate %brand%, it will be used programmatically # download spelling dictionaries confirmation dialog diff --git a/mozilla/editor/ui/dialogs/content/EdInsSrc.js b/mozilla/editor/ui/dialogs/content/EdInsSrc.js index 0e9e405eb7c..7b9f5d03f2b 100644 --- a/mozilla/editor/ui/dialogs/content/EdInsSrc.js +++ b/mozilla/editor/ui/dialogs/content/EdInsSrc.js @@ -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"); diff --git a/mozilla/editor/ui/dialogs/content/EdInsSrc.xul b/mozilla/editor/ui/dialogs/content/EdInsSrc.xul index 57351c03c39..f1c4a4559c3 100644 --- a/mozilla/editor/ui/dialogs/content/EdInsSrc.xul +++ b/mozilla/editor/ui/dialogs/content/EdInsSrc.xul @@ -47,6 +47,8 @@ diff --git a/mozilla/editor/ui/dialogs/content/EdInsertChars.js b/mozilla/editor/ui/dialogs/content/EdInsertChars.js index 2158bb88adf..84e61b6de30 100644 --- a/mozilla/editor/ui/dialogs/content/EdInsertChars.js +++ b/mozilla/editor/ui/dialogs/content/EdInsertChars.js @@ -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; diff --git a/mozilla/editor/ui/dialogs/content/EdInsertChars.xul b/mozilla/editor/ui/dialogs/content/EdInsertChars.xul index 034d0031f32..ef0ee2d0ad0 100644 --- a/mozilla/editor/ui/dialogs/content/EdInsertChars.xul +++ b/mozilla/editor/ui/dialogs/content/EdInsertChars.xul @@ -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();"> diff --git a/mozilla/editor/ui/dialogs/content/EdLinkChecker.js b/mozilla/editor/ui/dialogs/content/EdLinkChecker.js index e092ac07413..5f925854874 100644 --- a/mozilla/editor/ui/dialogs/content/EdLinkChecker.js +++ b/mozilla/editor/ui/dialogs/content/EdLinkChecker.js @@ -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 diff --git a/mozilla/editor/ui/dialogs/content/EdLinkChecker.xul b/mozilla/editor/ui/dialogs/content/EdLinkChecker.xul index e2d06439092..73702ca18c3 100644 --- a/mozilla/editor/ui/dialogs/content/EdLinkChecker.xul +++ b/mozilla/editor/ui/dialogs/content/EdLinkChecker.xul @@ -47,6 +47,7 @@ diff --git a/mozilla/editor/ui/dialogs/content/EdTableProps.js b/mozilla/editor/ui/dialogs/content/EdTableProps.js index ad8d511096b..bcb7cd614ce 100644 --- a/mozilla/editor/ui/dialogs/content/EdTableProps.js +++ b/mozilla/editor/ui/dialogs/content/EdTableProps.js @@ -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; } } diff --git a/mozilla/editor/ui/dialogs/content/EdTableProps.xul b/mozilla/editor/ui/dialogs/content/EdTableProps.xul index cfb164154ca..d13906a033e 100644 --- a/mozilla/editor/ui/dialogs/content/EdTableProps.xul +++ b/mozilla/editor/ui/dialogs/content/EdTableProps.xul @@ -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();" diff --git a/mozilla/editor/ui/dialogs/content/EditorPublish.js b/mozilla/editor/ui/dialogs/content/EditorPublish.js index e6c9f135bea..c3601b40822 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublish.js +++ b/mozilla/editor/ui/dialogs/content/EditorPublish.js @@ -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; diff --git a/mozilla/editor/ui/dialogs/content/EditorPublish.xul b/mozilla/editor/ui/dialogs/content/EditorPublish.xul index ca5af60f456..aacff07c73f 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublish.xul +++ b/mozilla/editor/ui/dialogs/content/EditorPublish.xul @@ -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();"> diff --git a/mozilla/editor/ui/dialogs/content/EditorPublishProgress.js b/mozilla/editor/ui/dialogs/content/EditorPublishProgress.js index 2223afdb43d..fe42de42eec 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublishProgress.js +++ b/mozilla/editor/ui/dialogs/content/EditorPublishProgress.js @@ -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"); diff --git a/mozilla/editor/ui/dialogs/content/EditorPublishProgress.xul b/mozilla/editor/ui/dialogs/content/EditorPublishProgress.xul index 505145a7031..47b8b566bb1 100644 --- a/mozilla/editor/ui/dialogs/content/EditorPublishProgress.xul +++ b/mozilla/editor/ui/dialogs/content/EditorPublishProgress.xul @@ -47,6 +47,7 @@ diff --git a/mozilla/editor/ui/dialogs/locale/en-US/EdLinkChecker.dtd b/mozilla/editor/ui/dialogs/locale/en-US/EdLinkChecker.dtd index ef7f7372f09..f79d5727b1f 100644 --- a/mozilla/editor/ui/dialogs/locale/en-US/EdLinkChecker.dtd +++ b/mozilla/editor/ui/dialogs/locale/en-US/EdLinkChecker.dtd @@ -43,3 +43,4 @@ + diff --git a/mozilla/editor/ui/dialogs/locale/en-US/EditorInsertChars.dtd b/mozilla/editor/ui/dialogs/locale/en-US/EditorInsertChars.dtd index c7015639d1c..a7201a633ea 100644 --- a/mozilla/editor/ui/dialogs/locale/en-US/EditorInsertChars.dtd +++ b/mozilla/editor/ui/dialogs/locale/en-US/EditorInsertChars.dtd @@ -48,3 +48,5 @@ + + diff --git a/mozilla/editor/ui/dialogs/locale/en-US/EditorInsertSource.dtd b/mozilla/editor/ui/dialogs/locale/en-US/EditorInsertSource.dtd index 81043de2325..05772a43072 100644 --- a/mozilla/editor/ui/dialogs/locale/en-US/EditorInsertSource.dtd +++ b/mozilla/editor/ui/dialogs/locale/en-US/EditorInsertSource.dtd @@ -44,3 +44,5 @@ + + diff --git a/mozilla/editor/ui/dialogs/locale/en-US/EditorPublish.dtd b/mozilla/editor/ui/dialogs/locale/en-US/EditorPublish.dtd index dedfa98a1dc..aee8f6a1814 100644 --- a/mozilla/editor/ui/dialogs/locale/en-US/EditorPublish.dtd +++ b/mozilla/editor/ui/dialogs/locale/en-US/EditorPublish.dtd @@ -43,6 +43,8 @@ + + diff --git a/mozilla/editor/ui/dialogs/locale/en-US/EditorPublishProgress.dtd b/mozilla/editor/ui/dialogs/locale/en-US/EditorPublishProgress.dtd index 18e92a4aea7..f38e40f9e0b 100644 --- a/mozilla/editor/ui/dialogs/locale/en-US/EditorPublishProgress.dtd +++ b/mozilla/editor/ui/dialogs/locale/en-US/EditorPublishProgress.dtd @@ -51,3 +51,4 @@ + diff --git a/mozilla/editor/ui/dialogs/locale/en-US/EditorTableProperties.dtd b/mozilla/editor/ui/dialogs/locale/en-US/EditorTableProperties.dtd index 3429b19e4ce..f89f8b37ee0 100644 --- a/mozilla/editor/ui/dialogs/locale/en-US/EditorTableProperties.dtd +++ b/mozilla/editor/ui/dialogs/locale/en-US/EditorTableProperties.dtd @@ -36,6 +36,9 @@ - ***** END LICENSE BLOCK ***** --> + + +