aboutsummaryrefslogtreecommitdiffstats
path: root/hatenabookmark_show.js
diff options
context:
space:
mode:
authorsnaka2009-01-18 12:20:03 +0000
committersnaka2009-01-18 12:20:03 +0000
commit34ec065a9b8a9b4c96e136b7329ab15d9b3cb561 (patch)
tree686c69e63326cbf306115b28fbb78d1af89afcdd /hatenabookmark_show.js
parent45b1f779e8af5cef8a1b3ebff57d09efb2e2bb61 (diff)
downloadvimperator-plugins-34ec065a9b8a9b4c96e136b7329ab15d9b3cb561.tar.bz2
2.0preに対応とともに1.2用のコードをbranchに移動。
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28614 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'hatenabookmark_show.js')
-rw-r--r--hatenabookmark_show.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/hatenabookmark_show.js b/hatenabookmark_show.js
index e5ce846..b4e22f8 100644
--- a/hatenabookmark_show.js
+++ b/hatenabookmark_show.js
@@ -3,7 +3,7 @@
// License: Creative Commons
// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid
//
-// show hatena bookmark comments script for Vimperator 0.6
+// show hatena bookmark comments script for Vimperator 2.0pre
(function(){
function showComments(url){
@@ -26,17 +26,21 @@
showString += tagString + (bookmark.tags.length > 0 && bookmark.comment ? "<br/> ":"") + bookmark.comment + "</dd>";
});
showString += "</dl></div>";
- liberator.commandline.echo(showString, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE);
+ liberator.modules.commandline.echo(showString, liberator.modules.commandline.HL_NORMAL, liberator.modules.commandline.FORCE_MULTILINE);
}
- liberator.commands.addUserCommand(["hbinfo"], "show hatena bookmark comments",
+ liberator.modules.commands.addUserCommand(["hbinfo"], "show hatena bookmark comments",
function(arg,special){
var clipboard = readFromClipboard();
- if(special)
- arg = window.content.document.getSelection() || clipboard;
- showComments(arg?encodeURIComponent(arg):liberator.buffer.URL);
- },{ completer: liberator.completion.url }
+ var url = arg.string;
+ if(special)
+ url = window.content.document.getSelection() || clipboard;
+ showComments(url ? encodeURIComponent(url): liberator.modules.buffer.URL);
+ },{
+ completer: liberator.modules.completion.url,
+ bang: true
+ }
);
- liberator.mappings.addUserMap([liberator.modes.VISUAL], [",h"], "show hatena bookmark comments",
+ liberator.modules.mappings.addUserMap([liberator.modules.modes.VISUAL], [",h"], "show hatena bookmark comments",
function(count){
showComments(window.content.document.getSelection());
},{ noremap: true }