aboutsummaryrefslogtreecommitdiffstats
path: root/nicontroller.js
diff options
context:
space:
mode:
authordrry2008-09-23 15:44:23 +0000
committerdrry2008-09-23 15:44:23 +0000
commita8d952d3be690c4325e19d8b555ef79429adea51 (patch)
tree4e5f0e037b4ee34eff16d8ed26e2460aeb4020a3 /nicontroller.js
parent77f31047e50b48e82188277e54838d54a2a2c2d1 (diff)
downloadvimperator-plugins-a8d952d3be690c4325e19d8b555ef79429adea51.tar.bz2
* fixed regexes.
* et cetera. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19784 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'nicontroller.js')
-rw-r--r--nicontroller.js12
1 files changed, 5 insertions, 7 deletions
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;
}