From 67e78bae03b218db17646b5c4ba5c35b3bb2bee4 Mon Sep 17 00:00:00 2001 From: drry Date: Wed, 9 Apr 2008 17:46:19 +0000 Subject: lang/javascript/vimperator-plugins/trunk/commandBookmarklet.js: * 整理しました。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@9230 d0d07461-0603-4401-acd4-de1884942a52 --- commandBookmarklet.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'commandBookmarklet.js') diff --git a/commandBookmarklet.js b/commandBookmarklet.js index 5839b26..9a37c97 100644 --- a/commandBookmarklet.js +++ b/commandBookmarklet.js @@ -7,11 +7,11 @@ (function(){ var filter = "javascript:"; - var items = liberator.bookmarks.get(filter); + var items = liberator.bookmarks.get(filter); if (items.length == 0) { if (filter.length > 0) { - liberator.echoerr("E283: No bookmarks matching \"" + filter + "\""); + liberator.echoerr('E283: No bookmarks matching "' + filter + '"'); } else { liberator.echoerr("No bookmarks set"); } @@ -20,9 +20,10 @@ items.forEach(function(item) { var [url, title] = item; if (width(title) > 50) { - while (width(title) > 47) - title = title.slice(0, -1); - title += "..."; + while (width(title) > 47) { + title = title.slice(0, -2); + } + title += "..."; } title = liberator.util.escapeHTML(title); @@ -33,7 +34,7 @@ "bookmarklet", command, { - shortHelp: "bookmarklet", + shortHelp: "Bookmarklet", } ); }); -- cgit v1.2.3