aboutsummaryrefslogtreecommitdiffstats
path: root/twittperator.js
diff options
context:
space:
mode:
authoranekos2010-12-08 21:29:30 +0900
committeranekos2010-12-08 21:36:31 +0900
commitb69233e32640b480232f5624c226221ef873b777 (patch)
tree0ac32479b116c838048444eec307ec15ce623075 /twittperator.js
parent0099079328c5a4cd363e295a79e870701d740142 (diff)
downloadvimperator-plugins-b69233e32640b480232f5624c226221ef873b777.tar.bz2
Twittperator.confirm 追加
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);
}, // }}}