aboutsummaryrefslogtreecommitdiffstats
path: root/haiku.js
diff options
context:
space:
mode:
authordrry2008-09-23 16:22:29 +0000
committerdrry2008-09-23 16:22:29 +0000
commitcefb8d9a34b3ff2edef7b2a2d25c298256ac8927 (patch)
treea9ffbf168683e236e2c147f7fc97e92b3d4691bb /haiku.js
parenta819abe04af7dd7efe6c8f029a51d48c2a2a19a7 (diff)
downloadvimperator-plugins-cefb8d9a34b3ff2edef7b2a2d25c298256ac8927.tar.bz2
* YouTube 表示の縦横比を変更しました。
* ほか。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19787 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'haiku.js')
-rw-r--r--haiku.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/haiku.js b/haiku.js
index f0f6a65..ad0679a 100644
--- a/haiku.js
+++ b/haiku.js
@@ -3,7 +3,7 @@
// License: Creative Commons
// Maintainer: mattn <mattn.jp@gmail.com> - http://mattn.kaoriya.net/
//
-// The script allows you to update Haiku status from Vimperator 0.6.*.
+// The script allows you to update Haiku status from Vimperator.
//
// Commands:
// :haiku some thing text
@@ -29,7 +29,7 @@
return Components.utils.evalInSandbox(text, sandbox);
}
}
- } catch(e) { liberator.log('warning: haiku.js is working with unsafe sandbox.'); }
+ } catch (e) { liberator.log('warning: haiku.js is working with unsafe sandbox.'); }
function sprintf(format){
var i = 1, re = /%s/, result = "" + format;
@@ -110,14 +110,15 @@
function createHTML(all){
var str = '';
if (all.indexOf("id:") == 0){
- str = '<a href="http://h.hatena.ne.jp/id/' + all.substring(3) + '">' + all + '</a>'
+ str = '<a href="http://h.hatena.ne.jp/' + all.replace(":", "/") + '">' + all + '</a>'
} else if (/\.(?:jpe?g|gif|png|bmp)$/.test(all)){
str = '<img src="' + all + '"/>';
- } else if (/^http:\/\/www\.youtube\.com\/(?:watch\?v=|v\/)([-\w]+)$/.test(all)){
- var url = "http://www.youtube.com/v/" + RegExp.$1;
+ } else if (/^http:\/\/(?:[^.]+\.)?youtube\.com\/(?:watch\?(?:[^&]+&)*v=|v\/)([^&=#?;\/]+)/.test(all)){
+ var url = "http://www.youtube.com/v/" + RegExp.$1 + "&fs=1";
str = '<a href="#" class="hl-URL">' + url + '</a>\n' +
- '<div><object height="250" width="300" data="' + url + '" type="application/x-shockwave-flash">' +
+ '<div><object width="300" height="243" data="' + url + '" type="application/x-shockwave-flash">' +
'<param name="wmode" value="transparent"/>' +
+ '<param name="allowFullScreen" value="true"/>' +
'</object></div>';
} else {
if (all.charAt(0) == "<")