From b69233e32640b480232f5624c226221ef873b777 Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 8 Dec 2010 21:29:30 +0900 Subject: Twittperator.confirm 追加 --- twittperator.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'twittperator.js') 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); }, // }}} -- cgit v1.2.3