aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2010-06-07 11:52:30 +0000
committeranekos2010-06-07 11:52:30 +0000
commit22bcd791f3ee3cc78d67ed8c80a0303c7600f6a5 (patch)
treefe7668923f362ae62ebc715509d4cf3ea7c9d3a9
parent0b24d324809ed06bd642934031aef27d2cbe1a87 (diff)
downloadvimperator-plugins-22bcd791f3ee3cc78d67ed8c80a0303c7600f6a5.tar.bz2
ラベルのショートカット的な補完設定追加
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37817 d0d07461-0603-4401-acd4-de1884942a52
-rwxr-xr-xgmail-commando.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/gmail-commando.js b/gmail-commando.js
index a8b33ca..8c457d0 100755
--- a/gmail-commando.js
+++ b/gmail-commando.js
@@ -140,6 +140,18 @@ let INFO =
function A (list)
Array.slice(list);
+ const Conf = (function () {
+ let gv = liberator.globalVariables;
+ let conf = {};
+ 'label_shortcut'.split(/\s/).forEach(function (n) {
+ conf.__defineGetter__(
+ n.replace(/_./g, function (m) m.slice(1).toUpperCase()),
+ function () gv['gmail_commando_' + n]
+ );
+ });
+ return conf;
+ })();
+
const Languages = [
['af', 'Afrikaans'],
['sq', 'Albanian'],
@@ -325,6 +337,13 @@ let INFO =
];
},
+ labelAndValue: function (context) {
+ KeywordValueCompleter.label(context);
+ context.completions.forEach(function (it) {
+ it[0] = 'label:' + it[0];
+ });
+ },
+
has: simpleValueCompleter('attachment'.split(/\s/).sort()),
is: simpleValueCompleter('read unread starred chat voicemail muted sent'.split(/\s/).sort()),
@@ -372,6 +391,8 @@ let INFO =
context.completions = [
[v + ':', v] for ([, v] in Iterator(GMailSearchKeyword))
];
+ if (Conf.labelShortcut)
+ context.fork('Label+', 0, context, KeywordValueCompleter.labelAndValue);
}
}