From 7543cfc6863832c79870ea494c81b63aadc78ef3 Mon Sep 17 00:00:00 2001 From: drry Date: Tue, 16 Dec 2008 14:48:43 +0000 Subject: * fixed regexes. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26897 d0d07461-0603-4401-acd4-de1884942a52 --- haiku.js | 2 +- matanico.js | 6 +++--- nico_related_videos.js | 2 +- nicontroller.js | 2 +- stella.js | 4 +--- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/haiku.js b/haiku.js index 410e97b..39176c9 100644 --- a/haiku.js +++ b/haiku.js @@ -177,7 +177,7 @@ '
'; - } else if (/^http:\/\/www\.nicovideo\.jp\/watch\/([-\w]+)$/.test(all)){ + } else if (/^http:\/\/[^.]+\.nicovideo\.jp\/watch\/([-\w]+)$/.test(all)){ str = ''; } else if (all.charAt(0) == "["){ diff --git a/matanico.js b/matanico.js index 2d94ab0..625c66e 100644 --- a/matanico.js +++ b/matanico.js @@ -121,10 +121,10 @@ NicoScraper.prototype = { _constants: { VERSION: '0.70', PAGECHECK: { - watch: '^http://(es|www)\\.nicovideo\\.jp/watch/', + watch: '^http://[^.]+\\.nicovideo\\.jp/watch/', live: '^http://live\\.nicovideo\\.jp/watch/', - tag: '^http://(es|www)\\.nicovideo\\.jp/tag/', - relatedTag: '^http://(es|www)\\.nicovideo\\.jp/related_tag/', + tag: '^http://[^.]+\\.nicovideo\\.jp/tag/', + relatedTag: '^http://[^.]+\\.nicovideo\\.jp/related_tag/', }, }, diff --git a/nico_related_videos.js b/nico_related_videos.js index ce0cc1a..40700ec 100644 --- a/nico_related_videos.js +++ b/nico_related_videos.js @@ -26,7 +26,7 @@ (function () { function getVideoId () { - let m = buffer.URL.match(/^http:\/\/www\.nicovideo\.jp\/watch\/([a-z0-9]+)/); + let m = buffer.URL.match(/^http:\/\/(?:tw|es|de|www)\.nicovideo\.jp\/watch\/([a-z0-9]+)/); return m && m[1]; } diff --git a/nicontroller.js b/nicontroller.js index 02c0836..4add0bf 100644 --- a/nicontroller.js +++ b/nicontroller.js @@ -193,7 +193,7 @@ NicoPlayerController.prototype = { NICO_DOMAIN: '.nicovideo.jp', NICO_URL: 'http://www.nicovideo.jp/', - WATCH_URL: 'http://www.nicovideo.jp/watch/', + WATCH_URL: '^http://[^.]+\.nicovideo\.jp/watch/', WATCH_PAGE: 1, FLVPLAYER_NODE_ID: 'flvplayer', diff --git a/stella.js b/stella.js index ee38c7c..d0b3939 100644 --- a/stella.js +++ b/stella.js @@ -45,8 +45,6 @@ var PLUGIN_INFO =