From a8d952d3be690c4325e19d8b555ef79429adea51 Mon Sep 17 00:00:00 2001 From: drry Date: Tue, 23 Sep 2008 15:44:23 +0000 Subject: * fixed regexes. * et cetera. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19784 d0d07461-0603-4401-acd4-de1884942a52 --- nicontroller.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'nicontroller.js') diff --git a/nicontroller.js b/nicontroller.js index 283d433..3923e3d 100644 --- a/nicontroller.js +++ b/nicontroller.js @@ -103,8 +103,8 @@ function NicoPlayerController(){} NicoPlayerController.prototype = { constants: { VERSION: '0.41', - WATCH_URL: '^http://www\.nicovideo\.jp/watch/[a-z][a-z]\\d+', - TAG_URL: '^http://www\.nicovideo\.jp/tag/', + WATCH_URL: '^http://www\\.nicovideo\\.jp/watch/[a-z]{2}\\d+', + TAG_URL: '^http://www\\.nicovideo\\.jp/tag/', WATCH_PAGE: 1, TAG_PAGE: 2, COMMAND_NORMAL: [ @@ -147,9 +147,7 @@ NicoPlayerController.prototype = { throw 'current tab is not nicovideo.jp'; }, - getURL: function() { - return liberator.buffer.URL; - }, + getURL: function() { return liberator.buffer.URL; }, _flvplayer: function() { if(this.pagecheck() === this.constants.WATCH_PAGE) { @@ -450,7 +448,7 @@ function expandExCommand(arg) { } // ex_command is putted in braces - if(comment.match(/^\{([^\}]+)\}(.+)/)) { + if(comment.match(/^\{([^{}]+)\}(.+)/)) { var exCommand = RegExp.$1; var text = RegExp.$2; @@ -511,7 +509,7 @@ function analysisExCommand(exCommand) { // line if(exCommand.match(/\bline(-?\d+)\b/)) { var line = parseInt(RegExp.$1, 10); - if(line < 0) line = properties.max + line + 1; + if(line < 0) line = properties.max + line + 1; if(line > properties.max) line = properties.max; properties.line = line; } -- cgit v1.2.3