From 0687798706c98c3fa09ddc37f7930f76ec057c49 Mon Sep 17 00:00:00 2001 From: drry Date: Sun, 23 Nov 2008 21:08:10 +0000 Subject: * fixed regexes. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24718 d0d07461-0603-4401-acd4-de1884942a52 --- ldrize_cooperation_fetch_flv.js | 4 ++-- stella.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ldrize_cooperation_fetch_flv.js b/ldrize_cooperation_fetch_flv.js index 28d31ce..fa6ee39 100644 --- a/ldrize_cooperation_fetch_flv.js +++ b/ldrize_cooperation_fetch_flv.js @@ -13,7 +13,7 @@ function NiconicoFlvHandler(url, title) { const nicoApiEndPoint = 'http://www.nicovideo.jp/api/getflv?v='; const nicoWatchEndPoint = 'http://www.nicovideo.jp/watch/'; let videoId = url.match(/\w{2}\d+/)[0]; - let fileName = title.replace(/[?\\\*\/:<>\|\"]/g, '_') + '.flv'; + let fileName = title.replace(/[?\\*\/:<>|"]/g, '_') + '.flv'; httpGET( nicoApiEndPoint + videoId, @@ -88,7 +88,7 @@ liberator.modules.commands.addUserCommand( httpGET( arg.string || liberator.modules.buffer.URL, function (responseText) { - let [, title] = responseText.match(/(.*?)<\/title>/i); + let [, title] = responseText.match(/<title(?:[ \t\r\n][^>]*)?>([^<]*)<\/title[ \t\n\r]*>/i); liberator.log(title); NiconicoFlvHandler(arg.string || liberator.modules.buffer.URL, title); } diff --git a/stella.js b/stella.js index 37e1185..6b6771f 100644 --- a/stella.js +++ b/stella.js @@ -51,7 +51,7 @@ function () f.apply(_this, arguments); function capitalize (s) - s.replace(/^./, String.toUpperCase); + s.replace(/^[a-z]/, String.toUpperCase); // }}} @@ -82,7 +82,7 @@ play: '', pause: '', muted: '', - repeating: '', + repeating: '' }, icon: null, @@ -160,7 +160,7 @@ play: 'x', pause: 'x', muted: 'rwt', - repeating: 'rw', + repeating: 'rw' }, toggles: ['muted'], @@ -286,7 +286,7 @@ const ContextMenuVolume = []; for (let i = 0; i <= 100; i += 10) - ContextMenuVolume.push({name: 'setVolume', label: i + '%', attributes: {volume: i}}) + ContextMenuVolume.push({name: 'setVolume', label: i + '%', attributes: {volume: i}}) const ContextMenuTree = [ 'play', -- cgit v1.2.3