diff options
author | drry | 2009-01-22 19:32:06 +0000 |
---|---|---|
committer | drry | 2009-01-22 19:32:06 +0000 |
commit | dcca60ea0cd7939f3e9aa7657bd3ae30bf909608 (patch) | |
tree | 28dfd9a8076b11ca9a98dd880f86406a7ec4302c /hatenabookmark_show.js | |
parent | 9cf3cdfadf889ef6d3007d5d287fa1f3926945e5 (diff) | |
download | vimperator-plugins-dcca60ea0cd7939f3e9aa7657bd3ae30bf909608.tar.bz2 |
* cosmetic changes.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28871 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'hatenabookmark_show.js')
-rw-r--r-- | hatenabookmark_show.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/hatenabookmark_show.js b/hatenabookmark_show.js index b4e22f8..5c943be 100644 --- a/hatenabookmark_show.js +++ b/hatenabookmark_show.js @@ -1,16 +1,16 @@ -// Vimperator plugin: 'Show Hatena Bookmark Comments'
+// Vimperator plugin: "Show Hatena Bookmark Comments"
// Last Change: 21-Mar-2008. Jan 2008
// License: Creative Commons
// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid
//
-// show hatena bookmark comments script for Vimperator 2.0pre
+// show Hatena Bookmark comments script for Vimperator 2.0pre
(function(){
function showComments(url){
const endPoint = "http://b.hatena.ne.jp/entry/json/";
var xhr = new XMLHttpRequest();
var tagString,showString = "<div>";
- xhr.open("GET",endPoint + url.replace(/#/,"%23") ,false);
+ xhr.open("GET",endPoint + url.replace(/#/,"%23"),false);
xhr.send(null);
var response;
if(!(response = window.eval(xhr.responseText))){
@@ -21,26 +21,26 @@ bookmarks.forEach(function(bookmark){
tagString = bookmark.tags.length ? "[" + bookmark.tags.join("][") + "]":"";
- showString += "<dt style=\"float:left;clear:both;width:10%;margin:0;\">" + bookmark.user + "</dt>";
- showString += "<dd style=\"margin:0 0 0 10%;width:90%;border-left:1px solid;\"> "
+ showString += '<dt style="float:left;clear:both;width:10%;margin:0;">' + bookmark.user + "</dt>";
+ showString += '<dd style="margin:0 0 0 10%;width:90%;border-left:1px solid;"> '
showString += tagString + (bookmark.tags.length > 0 && bookmark.comment ? "<br/> ":"") + bookmark.comment + "</dd>";
});
showString += "</dl></div>";
- liberator.modules.commandline.echo(showString, liberator.modules.commandline.HL_NORMAL, liberator.modules.commandline.FORCE_MULTILINE);
+ liberator.modules.commandline.echo(showString,liberator.modules.commandline.HL_NORMAL,liberator.modules.commandline.FORCE_MULTILINE);
}
- liberator.modules.commands.addUserCommand(["hbinfo"], "show hatena bookmark comments",
+ liberator.modules.commands.addUserCommand(["hbinfo"],"show Hatena Bookmark comments",
function(arg,special){
var clipboard = readFromClipboard();
var url = arg.string;
- if(special)
+ if(special)
url = window.content.document.getSelection() || clipboard;
showComments(url ? encodeURIComponent(url): liberator.modules.buffer.URL);
- },{
+ },{
completer: liberator.modules.completion.url,
bang: true
}
);
- liberator.modules.mappings.addUserMap([liberator.modules.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 }
|