From 45302a33da999c7beccb5250b6d8d6e0978f5793 Mon Sep 17 00:00:00 2001 From: teramako Date: Mon, 22 Sep 2008 16:03:41 +0000 Subject: * URLのAnchor化 * 画像URLの表示 * YouTubeの表示 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19744 d0d07461-0603-4401-acd4-de1884942a52 --- haiku.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'haiku.js') diff --git a/haiku.js b/haiku.js index e12c356..bc07897 100644 --- a/haiku.js +++ b/haiku.js @@ -84,7 +84,9 @@ ]]>.toSource() .replace(/(?:\r?\n|\r)[ \t]*/g, " ") + statuses.map(function(status) { - var text = status.text.substr(status.keyword.length + 1); + var text = status.text; + if (text.indexOf(status.keyword+"=") == 0) text = status.text.substr(status.keyword.length + 1); + text = convert(text); return <> {status.user.screen_name}'; + } else if (/^http:\/\/www\.youtube\.com\/(?:watch\?v=|v\/)([-\w]+)$/.test(all)){ + var url = "http://www.youtube.com/v/" + RegExp.$1; + str = '' + url + '\n' + + '
' + + '' + + '' + + '' + + '
'; + } else { + str = ''+all+''; + } + return str; + } + return str.replace(/https?:\/\/[^\/]+?\/([^\s]*)/g, createHTML); + } liberator.commands.addUserCommand(["haiku"], "Change Haiku status", function(arg, special){ var password; -- cgit v1.2.3