aboutsummaryrefslogtreecommitdiffstats
path: root/googlekanji.js
diff options
context:
space:
mode:
authoranekos2008-11-23 00:35:01 +0000
committeranekos2008-11-23 00:35:01 +0000
commit00b1f584a13c4cae8b0b84b6e3ffc67f7b9d037b (patch)
tree0030344502fe3b267f13964659ad43160629ae9a /googlekanji.js
parentc9148677771aa64b1169866b9631a2b5946ca79e (diff)
downloadvimperator-plugins-00b1f584a13c4cae8b0b84b6e3ffc67f7b9d037b.tar.bz2
follow the new completer.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24676 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'googlekanji.js')
-rw-r--r--googlekanji.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/googlekanji.js b/googlekanji.js
index c5acc26..481c7d6 100644
--- a/googlekanji.js
+++ b/googlekanji.js
@@ -2,7 +2,7 @@
// @name Google-Kanji
// @description-ja グーグルを使って漢字を検索
// @license Creative Commons 2.1 (Attribution + Share Alike)
-// @version 1.0
+// @version 1.1
// ==/VimperatorPlugin==
//
// Usage:
@@ -21,9 +21,7 @@
var re = /[\u4e00-\u9fa0]+/g; // 一-龠
var ignore = /\u691c\u7d22|\u95a2\u9023/; // 検索|関連
var req = new XMLHttpRequest();
- liberator.log(word);
var word = encodeURIComponent(word);
- liberator.log(word);
req.open('GET', 'http://www.google.co.jp/search?hl=ja&q=' + word + '&lr=lang_ja', true);
var f = function () {
var cnt = {};
@@ -56,7 +54,9 @@
commands.addUserCommand(
['gkanji', 'googlekanji'],
'Google kanji',
- function (arg) getKanji(arg.string)
+ function (arg) getKanji(arg.string),
+ {},
+ true
);
function copyToClipboard (copytext) {
@@ -76,7 +76,13 @@
['gkcopy'],
'Google kanji',
copyToClipboard,
- { completer: function (args) [0, copycompl] }
+ {
+ completer: function (context) {
+ context.title = ['kanji', 'count'];
+ context.items = copycompl;
+ }
+ },
+ true
);