зеркало из https://github.com/mozilla/gecko-dev.git
Bug 516387: nsPromptService dialogs should not have '&' shortcuts in labels, r=gavin
This commit is contained in:
Родитель
177729f9d9
Коммит
bf92bef041
|
@ -11,7 +11,7 @@
|
|||
</scrollbox>
|
||||
<hbox id="prompt-alert-checkbox-box" collapsed="true" align="center">
|
||||
<checkbox class="toggle-dark" id="prompt-alert-checkbox"/>
|
||||
<label id="prompt-alert-checkbox-msg"/>
|
||||
<description id="prompt-alert-checkbox-msg"/>
|
||||
</hbox>
|
||||
<hbox pack="center">
|
||||
<button class="button-dark" label="&ok.label;"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</scrollbox>
|
||||
<hbox id="prompt-confirm-checkbox-box" collapsed="true" align="center">
|
||||
<checkbox class="toggle-dark" id="prompt-confirm-checkbox"/>
|
||||
<label id="prompt-confirm-checkbox-msg"/>
|
||||
<description id="prompt-confirm-checkbox-msg"/>
|
||||
</hbox>
|
||||
<hbox pack="center" id="prompt-confirm-button-box">
|
||||
<button class="button-dark" label="&ok.label;"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<textbox id="prompt-prompt-textbox"/>
|
||||
<hbox id="prompt-prompt-checkbox-box" collapsed="true" align="center">
|
||||
<checkbox class="toggle-dark" id="prompt-prompt-checkbox"/>
|
||||
<label id="prompt-prompt-checkbox-msg"/>
|
||||
<description id="prompt-prompt-checkbox-msg"/>
|
||||
</hbox>
|
||||
<hbox pack="center" id="prompt-prompt-button-box">
|
||||
<button class="button-dark" label="&ok.label;"
|
||||
|
|
|
@ -101,7 +101,7 @@ promptService.prototype = {
|
|||
this.sizeScrollableMsg("prompt-alert-message", 25);
|
||||
|
||||
doc.getElementById("prompt-alert-checkbox").checked = aCheckState.value;
|
||||
doc.getElementById("prompt-alert-checkbox-msg").value = aCheckMsg;
|
||||
this.setLabelForNode(doc.getElementById("prompt-alert-checkbox-msg"), aCheckMsg);
|
||||
this.sizeElement("prompt-alert-checkbox-msg", 50);
|
||||
doc.getElementById("prompt-alert-checkbox-box").removeAttribute("collapsed");
|
||||
|
||||
|
@ -134,7 +134,7 @@ promptService.prototype = {
|
|||
this.sizeScrollableMsg("prompt-confirm-message", 25);
|
||||
|
||||
doc.getElementById("prompt-confirm-checkbox").checked = aCheckState.value;
|
||||
doc.getElementById("prompt-confirm-checkbox-msg").value = aCheckMsg;
|
||||
this.setLabelForNode(doc.getElementById("prompt-confirm-checkbox-msg"), aCheckMsg);
|
||||
this.sizeElement("prompt-confirm-checkbox-msg", 50);
|
||||
doc.getElementById("prompt-confirm-checkbox-box").removeAttribute("collapsed");
|
||||
|
||||
|
@ -149,7 +149,7 @@ promptService.prototype = {
|
|||
//
|
||||
// Copied from chrome://global/content/commonDialog.js
|
||||
//
|
||||
setLabelForNode: function(aNode, aLabel, aIsLabelFlag) {
|
||||
setLabelForNode: function(aNode, aLabel) {
|
||||
// This is for labels which may contain embedded access keys.
|
||||
// If we end in (&X) where X represents the access key, optionally preceded
|
||||
// by spaces and/or followed by the ':' character, store the access key and
|
||||
|
@ -172,8 +172,11 @@ promptService.prototype = {
|
|||
|
||||
// && is the magic sequence to embed an & in your label.
|
||||
aLabel = aLabel.replace(/\&\&/g, "&");
|
||||
if (aIsLabelFlag) { // Set text for <label> element
|
||||
if (aNode instanceof Ci.nsIDOMXULLabelElement) {
|
||||
aNode.setAttribute("value", aLabel);
|
||||
} else if (aNode instanceof Ci.nsIDOMXULDescriptionElement) {
|
||||
text = aNode.ownerDocument.createTextNode(aLabel);
|
||||
aNode.appendChild(text);
|
||||
} else { // Set text for other xul elements
|
||||
aNode.setAttribute("label", aLabel);
|
||||
}
|
||||
|
@ -200,7 +203,7 @@ promptService.prototype = {
|
|||
this.sizeScrollableMsg("prompt-confirm-message", 25);
|
||||
|
||||
doc.getElementById("prompt-confirm-checkbox").checked = aCheckState.value;
|
||||
doc.getElementById("prompt-confirm-checkbox-msg").value = aCheckMsg;
|
||||
this.setLabelForNode(doc.getElementById("prompt-confirm-checkbox-msg"), aCheckMsg);
|
||||
this.sizeElement("prompt-confirm-checkbox-msg", 50);
|
||||
if (aCheckMsg) {
|
||||
doc.getElementById("prompt-confirm-checkbox-box").removeAttribute("collapsed");
|
||||
|
@ -242,7 +245,7 @@ promptService.prototype = {
|
|||
|
||||
if (bTitle) {
|
||||
let button = doc.createElement("button");
|
||||
this.setLabelForNode(button, bTitle, false);
|
||||
this.setLabelForNode(button, bTitle);
|
||||
button.setAttribute("class", "button-dark");
|
||||
button.setAttribute("oncommand",
|
||||
"document.getElementById('prompt-confirm-dialog').PromptHelper.closeConfirm(" + i + ")");
|
||||
|
@ -269,7 +272,7 @@ promptService.prototype = {
|
|||
this.sizeScrollableMsg("prompt-prompt-message", 25);
|
||||
|
||||
doc.getElementById("prompt-prompt-checkbox").checked = aCheckState.value;
|
||||
doc.getElementById("prompt-prompt-checkbox-msg").value = aCheckMsg;
|
||||
this.setLabelForNode(doc.getElementById("prompt-prompt-checkbox-msg"), aCheckMsg);
|
||||
this.sizeElement("prompt-prompt-checkbox-msg", 50);
|
||||
doc.getElementById("prompt-prompt-textbox").value = aValue.value;
|
||||
if (aCheckMsg) {
|
||||
|
@ -309,7 +312,7 @@ promptService.prototype = {
|
|||
doc.getElementById("prompt-password-password").value = aPassword.value;
|
||||
if (aCheckMsg) {
|
||||
doc.getElementById("prompt-password-checkbox-box").removeAttribute("collapsed");
|
||||
doc.getElementById("prompt-password-checkbox-msg").appendChild(doc.createTextNode(aCheckMsg));
|
||||
this.setLabelForNode(doc.getElementById("prompt-password-checkbox-msg"), aCheckMsg);
|
||||
this.sizeElement("prompt-password-checkbox-msg", 50);
|
||||
this.sizeElement("prompt-password-checkbox-box", 50);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче