aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteramako2010-12-08 23:17:42 +0900
committerteramako2010-12-08 23:17:42 +0900
commit655c65007f100043275af1285a1916091d16dd15 (patch)
tree47145b8966c2cc3da6378e5e993185a914aa2497
parent4d26d67055f203b397019be0a80623e642a44980 (diff)
parenta530c0a45adf80f39b76c02b45af007feacf697d (diff)
downloadvimperator-plugins-655c65007f100043275af1285a1916091d16dd15.tar.bz2
Merge branch 'master' of github.com:vimpr/vimperator-plugins
-rw-r--r--twittperator.js47
1 files changed, 36 insertions, 11 deletions
diff --git a/twittperator.js b/twittperator.js
index ccf0556..6f7efca 100644
--- a/twittperator.js
+++ b/twittperator.js
@@ -28,7 +28,7 @@ let PLUGIN_INFO =
<name>Twittperator</name>
<description>Twitter Client using OAuth and Streaming API</description>
<description lang="ja">OAuth/StreamingAPI対応Twitterクライアント</description>
- <version>1.10.1</version>
+ <version>1.11.0</version>
<minVersion>2.3</minVersion>
<maxVersion>3.0</maxVersion>
<author mail="teramako@gmail.com" homepage="http://d.hatena.ne.jp/teramako/">teramako</author>
@@ -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);
}, // }}}
@@ -1803,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();
@@ -1892,7 +1898,7 @@ let PLUGIN_INFO =
"^" +
this.command.map(function(c)
let (r = util.escapeRegex(c))
- (/^\W$/(c) ? r : r + " ")
+ (/^\W$/(c) ? r : r + "( |$)")
).join("|")
);
},
@@ -2038,6 +2044,25 @@ 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) {
+ 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)
+ }),
]; // }}}
function findSubCommand(s) { // {{{