aboutsummaryrefslogtreecommitdiffstats
path: root/umihara.js
diff options
context:
space:
mode:
authoranekos2008-12-02 12:07:57 +0000
committeranekos2008-12-02 12:07:57 +0000
commitb99a31711c4a5f6967630d103d2245628619d2e2 (patch)
tree354fd2afc98aacf58e309fe98a45c1173784dc18 /umihara.js
parenteae4fae848458cfd438f7746c302f877e03ebec1 (diff)
downloadvimperator-plugins-b99a31711c4a5f6967630d103d2245628619d2e2.tar.bz2
Follow CVS Head.
etc. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25706 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'umihara.js')
-rw-r--r--umihara.js20
1 files changed, 7 insertions, 13 deletions
diff --git a/umihara.js b/umihara.js
index 49a871b..ef3f41b 100644
--- a/umihara.js
+++ b/umihara.js
@@ -22,7 +22,7 @@
const re = /<td nowrap>(\d+:\d+)<\/td><td>([\d,]+\.[\d,]+)<\/td><td><b>([\d,]+\.[\d,]+)<\/b><\/td><\/tr><\/table><\/div>/;
- const cl = [
+ const ContryCodes = [
['USD', '\u30a2\u30e1\u30ea\u30ab\u30c9\u30eb'],
['GBP', '\u30a4\u30ae\u30ea\u30b9 \u30dd\u30f3\u30c9'],
['INR', '\u30a4\u30f3\u30c9 \u30eb\u30d4\u30fc'],
@@ -93,17 +93,11 @@
let extra = {
argCount: '+',
bang: true,
- completer: function (context, arg, bang) {
+ completer: function (context, args) {
let last = context.contextList.slice(-1)[0];
- context.title = ['Country Code'];
+ context.title = ['Country Code', 'Country Name'];
context.advance(last.offset - last.caret);
- context.items = completion.filter(cl, last.filter);
- /*
- if (!(arg = commands.parseArgs(arg, extra.options, extra.argCount)))
- return [0, []];
- let m = arg.string.match(/\s(\w+)$/);
- return [(m ? m.index : arg.string.length) + 1, m ? completion.filter(cl, m[1]) : cl];
- */
+ context.completions = ContryCodes;
}
};
@@ -111,10 +105,10 @@
commands.addUserCommand(
['kawase'],
'Umihara Kawase Meow',
- function (arg, clipboard) {
- let [value, from, to] = arg.arguments;
+ function (args) {
+ let [value, from, to] = args;
value = eval(value);
- kawase(value, clipboard, from, to);
+ kawase(value, args.bang, from, to);
},
extra,
true