aboutsummaryrefslogtreecommitdiffstats
path: root/twittperator.js
diff options
context:
space:
mode:
Diffstat (limited to 'twittperator.js')
-rw-r--r--twittperator.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/twittperator.js b/twittperator.js
index 411905b..90d0876 100644
--- a/twittperator.js
+++ b/twittperator.js
@@ -1592,6 +1592,18 @@ let PLUGIN_INFO =
}, // }}}
}; // }}}
let Twittperator = { // {{{
+ confirm: function(msg, onYes, onNo, onCancel) {
+ if (!onNo)
+ onNo = function () Twittperator.echo('canceled.');
+
+ commandline.input(
+ msg + " (input 'yes/no'): ",
+ function(s) (s === "yes" ? onYes : onNo)(),
+ {
+ onCancel: onCancel || onNo
+ }
+ );
+ },
echo: function(msg) { // {{{
liberator.echo("[Twittperator] " + msg);
}, // }}}