-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom label for buttons #14
Comments
Hi, it is an interesting idea :), we can add exports.prompt = (title, msg, value = '', options) => {
const type = getType(options);
const val = String(value)
.replace(/"/g, '"');
const valueStr = `<input type="${ type }" value="${ val }" data-name="js-input">`;
const buttons = options.buttons || BUTTON_OK_CANCEL;
return showDialog(title, msg, valueStr, buttons, options);
}; I think we should also add function const buttons = getButtons(options) || BUTTON_OK_CANCEL;
return showDialog(title, msg, valueStr, buttons, options); Also tests should be added. And ofcourse all this stuf would not work work smalltalk.native. It is a great idea for a pull request :) |
Hi @coderaiser I just modified the code, but I don't understand how to run test. Could you please explain me? |
@paologf, you can run |
Hello,
is it possible add into the
options
parameter ofconfirm
function a dictionary with a custom label for each button?Maybe something like
{"cancel":"Cancel Button Label","close":"Cancel Button Label","ok":"Ok Button Label"}
, pass into thegetTemplate
function thislabels
dictionary and use calllabels[name] || name
.Thanks
Paolo
The text was updated successfully, but these errors were encountered: