Skip to content

Instantly share code, notes, and snippets.

@jgphilpott
Last active September 13, 2023 13:59
Show Gist options
  • Save jgphilpott/5cbf969038e2bc46c3e2fc2e99ce18ca to your computer and use it in GitHub Desktop.
Save jgphilpott/5cbf969038e2bc46c3e2fc2e99ce18ca to your computer and use it in GitHub Desktop.
A helpful interface for the window popup functions.
# Credit: https://www.w3schools.com/js/js_popup.asp
class Popup
constructor: ->
null
alert: (text = "") ->
return window.alert text
confirm: (text = "") ->
return window.confirm text
prompt: (text = "", placeholder = "") ->
return window.prompt text, placeholder
// Credit: https://www.w3schools.com/js/js_popup.asp
var Popup;
Popup = class Popup {
constructor() {
null;
}
alert(text = "") {
return window.alert(text);
}
confirm(text = "") {
return window.confirm(text);
}
prompt(text = "", placeholder = "") {
return window.prompt(text, placeholder);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment