From b99a31711c4a5f6967630d103d2245628619d2e2 Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 2 Dec 2008 12:07:57 +0000 Subject: Follow CVS Head. etc. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25706 d0d07461-0603-4401-acd4-de1884942a52 --- feedSomeKeys_2.js | 4 ++-- toggler.js | 4 ++-- twitterView.js | 10 +++++----- umihara.js | 20 +++++++------------- 4 files changed, 16 insertions(+), 22 deletions(-) diff --git a/feedSomeKeys_2.js b/feedSomeKeys_2.js index 927c0e6..67177a7 100644 --- a/feedSomeKeys_2.js +++ b/feedSomeKeys_2.js @@ -203,7 +203,7 @@ function destroy(){ feedMaps.forEach(function(map){ mappings.remove(map.modes[0],map.names[0]); }); - }catch(e){ log(map); } + }catch(e){ liberator.log(map); } origMaps.forEach(function(map){ addUserMap(map); }); @@ -257,7 +257,7 @@ function feedKeyIntoContent(keys, useVkey){ var charCode = keys.charCodeAt(i); keyCode = 0; } - if (keys[i] == '<'){ + if (keys[i] == '<'){ var matches = keys.substr(i + 1).match(/^((?:[ACMSacms]-)*)([^>]+)/); if (matches) { if (matches[1]) { diff --git a/toggler.js b/toggler.js index c7c9154..aa50625 100644 --- a/toggler.js +++ b/toggler.js @@ -6,7 +6,7 @@ * ==/VimperatorPlugin== * * 何かしらの設定をクルクル変更したい人へ - * + * * まず、最初に以下の例ように.vimperatorrcに定義する js < - http://unsigned.g.hatena.ne.jp/Trapezoid // -// show Twitter on statusesbar script for Vimperator 0.6.* +// show Twitter on statusesbar script for Vimperator 2.0pre (function(){ const checkTime = 90 * 1000; @@ -106,10 +106,10 @@ } } - liberator.mappings.addUserMap([liberator.modes.NORMAL],[",r"], + liberator.modules.mappings.add([liberator.modules.modes.NORMAL],[",r"], "Reply to current user", - function (){ liberator.commandline.open(":","twitter @" + lastestStatus.user.screen_name + " ",liberator.modes.EX); }); - liberator.mappings.addUserMap([liberator.modes.NORMAL],[",f"], + function (){ liberator.modules.commandline.open(":","twitter @" + lastestStatus.user.screen_name + " ",liberator.modules.modes.EX); }); + liberator.modules.mappings.add([liberator.modules.modes.NORMAL],[",f"], "Favorite to current user", function (){ favoriteStatus(lastestStatus.id); }); })(); diff --git a/umihara.js b/umihara.js index 49a871b..ef3f41b 100644 --- a/umihara.js +++ b/umihara.js @@ -22,7 +22,7 @@ const re = /(\d+:\d+)<\/td>([\d,]+\.[\d,]+)<\/td>([\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 -- cgit v1.2.3