Skip to content

Commit d9d1b27

Browse files
author
Chris K
committed
DFL-3417 Dialog raised by "Pretty print JavaScript" button should have Yes : No as options
1 parent eb3eccf commit d9d1b27

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

src/ecma-debugger/eventlisteners/evlistenertooltip.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ cls.EventListenerTooltip = function()
4949
var _reload_script_dialog = function(event, target)
5050
{
5151
new ConfirmDialog(ui_strings.D_RELOAD_SCRIPTS,
52-
function(){ window.runtimes.reloadWindow(); }).show();
52+
function() { window.runtimes.reloadWindow(); },
53+
null,
54+
ui_strings.S_BUTTON_YES,
55+
ui_strings.S_BUTTON_NO).show();
5356
};
5457

5558
var _init = function(view)

src/ecma-debugger/stop_at.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ cls.EcmascriptDebugger["6.0"].StopAt = function()
101101
if (msg.key == 'reformat_javascript')
102102
{
103103
new ConfirmDialog(ui_strings.D_REFORMAT_SCRIPTS,
104-
function() { window.runtimes.reloadWindow(); }).show();
104+
function() { window.runtimes.reloadWindow(); },
105+
null,
106+
ui_strings.S_BUTTON_YES,
107+
ui_strings.S_BUTTON_NO).show();
105108
}
106109
}
107110
};

src/ui-scripts/dialog.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,21 @@ BaseDialog.prototype = new function()
101101
/**
102102
* @constructor
103103
*/
104-
function ConfirmDialog(template, ok_callback, cancel_callback) {
105-
this._init(template, ok_callback, cancel_callback);
104+
function ConfirmDialog(template, ok_callback, cancel_callback, ok_label, cancel_label) {
105+
this._init(template, ok_callback, cancel_callback, ok_label, cancel_label);
106106
};
107107

108108
function ConfirmDialogPrototype()
109109
{
110-
this._init = function(template, ok_callback, cancel_callback)
110+
this._init = function(template, ok_callback, cancel_callback, ok_label, cancel_label)
111111
{
112112
var buttons = [
113113
{
114-
label: ui_strings.S_BUTTON_OK,
114+
label: ok_label || ui_strings.S_BUTTON_OK,
115115
handler: ok_callback,
116116
},
117117
{
118-
label: ui_strings.S_BUTTON_CANCEL,
118+
label: cancel_label || ui_strings.S_BUTTON_CANCEL,
119119
handler: cancel_callback,
120120
}
121121
];

src/ui-strings/ui_strings-en.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,3 +1740,8 @@ ui_strings.S_TOGGLE_PAUSED_UPDATING_NETWORK_VIEW = "Pause updating network activ
17401740
/* DESC: String shown instead of filename when file name is missing */
17411741
ui_strings.S_UNKNOWN_SCRIPT = "(Unknown script)";
17421742

1743+
/* DESC: Generic label for a yes button */
1744+
ui_strings.S_BUTTON_YES = "Yes";
1745+
1746+
/* DESC: Generic label for a no button */
1747+
ui_strings.S_BUTTON_NO = "No";

0 commit comments

Comments
 (0)