aboutsummaryrefslogtreecommitdiffstats
path: root/haiku.js
diff options
context:
space:
mode:
authorteramako2008-10-04 13:06:02 +0000
committerteramako2008-10-04 13:06:02 +0000
commit2ca6931857620ee894f002573af4dc7231b4a61b (patch)
tree3c351f4739cdaeb10fef07b225ab081e7699b440 /haiku.js
parent0db074fb37fee5d47613f011ccde2fbb635c81c6 (diff)
downloadvimperator-plugins-2ca6931857620ee894f002573af4dc7231b4a61b.tar.bz2
はてなスターの表示
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@20707 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'haiku.js')
-rw-r--r--haiku.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/haiku.js b/haiku.js
index 8f8f945..d945e33 100644
--- a/haiku.js
+++ b/haiku.js
@@ -128,6 +128,7 @@
statuses.map(function(status) {
var text = status.text;
var keyword = status.keyword;
+ var star = status.favorited > 0 ? '<img src="http://s.hatena.ne.jp/images/star.gif"/><span style="color:orange;">x' + status.favorited + '</span>' : '';
if (text.indexOf(keyword+"=") == 0) text = status.text.substr(keyword.length + 1);
text = convert(text);
keyword = convert(keyword);
@@ -139,6 +140,7 @@
<strong>{status.user.name}&#x202C;</strong>
</>.toSource()
.replace(/(?:\r?\n|\r)[ \t]*/g, " ") +
+ star +
sprintf(': <span class="haiku entry-title">%s</span><br /><span class="haiku entry-content">%s&#x202C;</span><hr />',
keyword, text)
}).join("");