From 34ec065a9b8a9b4c96e136b7329ab15d9b3cb561 Mon Sep 17 00:00:00 2001 From: snaka Date: Sun, 18 Jan 2009 12:20:03 +0000 Subject: 2.0preに対応とともに1.2用のコードをbranchに移動。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28614 d0d07461-0603-4401-acd4-de1884942a52 --- hatenabookmark_show.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'hatenabookmark_show.js') 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 - 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 ? "
":"") + bookmark.comment + ""; }); showString += ""; - 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 } -- cgit v1.2.3