From cefb8d9a34b3ff2edef7b2a2d25c298256ac8927 Mon Sep 17 00:00:00 2001 From: drry Date: Tue, 23 Sep 2008 16:22:29 +0000 Subject: * YouTube 表示の縦横比を変更しました。 * ほか。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19787 d0d07461-0603-4401-acd4-de1884942a52 --- haiku.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'haiku.js') 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 - 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 = '' + all + '' + str = '' + all + '' } else if (/\.(?:jpe?g|gif|png|bmp)$/.test(all)){ str = ''; - } 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 = '' + url + '\n' + - '
' + + '
' + '' + + '' + '
'; } else { if (all.charAt(0) == "<") -- cgit v1.2.3