From a1a9f7ae53b03fd397de357929024cc21b72d46f Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 8 Dec 2010 21:18:25 +0900 Subject: サブコマンドの正規表現バグ修正 --- twittperator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twittperator.js b/twittperator.js index ccf0556..d250d91 100644 --- a/twittperator.js +++ b/twittperator.js @@ -1892,7 +1892,7 @@ let PLUGIN_INFO = "^" + this.command.map(function(c) let (r = util.escapeRegex(c)) - (/^\W$/(c) ? r : r + " ") + (/^\W$/(c) ? r : r + "( |$)") ).join("|") ); }, -- cgit v1.2.3 From 0099079328c5a4cd363e295a79e870701d740142 Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 8 Dec 2010 21:19:02 +0900 Subject: :tw!resetoauth 追加。OAuthの認証情報を削除する --- twittperator.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/twittperator.js b/twittperator.js index d250d91..411905b 100644 --- a/twittperator.js +++ b/twittperator.js @@ -2038,6 +2038,20 @@ let PLUGIN_INFO = timelineCompleter: true, completer: Completers.id(function (it) it.in_reply_to_status_id) }), + SubCommand({ + command: ["resetoauth"], + description: "Reset OAuth Information", + action: function(arg) { + Store.remove("consumerKey"); + Store.remove("consumerSecret"); + Store.remove("token"); + Store.remove("tokenSecret"); + Store.save(); + Twittperator.echo("OAuth information were reset."); + }, + timelineCompleter: false, + completer: Completers.id(function (it) it.in_reply_to_status_id) + }), ]; // }}} function findSubCommand(s) { // {{{ -- cgit v1.2.3 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(+) 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 From a530c0a45adf80f39b76c02b45af007feacf697d Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 8 Dec 2010 21:35:55 +0900 Subject: :tw!resetoauth で confirm を通すようにした --- twittperator.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/twittperator.js b/twittperator.js index 90d0876..6f7efca 100644 --- a/twittperator.js +++ b/twittperator.js @@ -28,7 +28,7 @@ let PLUGIN_INFO = Twittperator Twitter Client using OAuth and Streaming API OAuth/StreamingAPI対応Twitterクライアント - 1.10.1 + 1.11.0 2.3 3.0 teramako @@ -1815,17 +1815,11 @@ let PLUGIN_INFO = } }, // }}} withProtectedUserConfirmation: function(check, actionName, action) { // {{{ - function canceled() - Twittperator.echo("Canceled."); - let protectedUserName = Twittperator.isProtected(check); if (protectedUserName) { - commandline.input( - protectedUserName + " is protected user! Do you really want to " + actionName + '? Input "yes" if you want. => ', - function(s) (s === "yes" ? action : canceled)(), - { - onCancel: canceled - } + Twittperator.confirm( + protectedUserName + " is protected user! Do you really want to " + actionName + '?', + action ); } else { action(); @@ -2054,12 +2048,17 @@ let PLUGIN_INFO = command: ["resetoauth"], description: "Reset OAuth Information", action: function(arg) { - Store.remove("consumerKey"); - Store.remove("consumerSecret"); - Store.remove("token"); - Store.remove("tokenSecret"); - Store.save(); - Twittperator.echo("OAuth information were reset."); + Twittperator.confirm( + 'Do you want to reset OAuth information?', + function () { + Store.remove("consumerKey"); + Store.remove("consumerSecret"); + Store.remove("token"); + Store.remove("tokenSecret"); + Store.save(); + Twittperator.echo("OAuth information were reset."); + } + ); }, timelineCompleter: false, completer: Completers.id(function (it) it.in_reply_to_status_id) -- cgit v1.2.3