From bfc2de9a88c4c5cdbdf9322ef2e75d949af71bb3 Mon Sep 17 00:00:00 2001
From: anekos
Date: Wed, 31 Mar 2010 11:30:09 +0000
Subject: timecode に "n%" 表記追加
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37130 d0d07461-0603-4401-acd4-de1884942a52
---
stella.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
(limited to 'stella.js')
diff --git a/stella.js b/stella.js
index d5925dc..b78faef 100644
--- a/stella.js
+++ b/stella.js
@@ -39,7 +39,7 @@ let PLUGIN_INFO =
すてら
For Niconico/YouTube/Vimeo, Add control commands and information display(on status line).
ニコニコ動画/YouTube/Vimeo 用。操作コマンドと情報表示(ステータスライン上に)追加します。
- 0.25.1
+ 0.26.0
anekos
new BSD License (Please read the source code comments of this plugin)
修正BSDライセンス (ソースコードのコメントを参照してください)
@@ -378,8 +378,10 @@ Thanks:
},
// 上手い具合に秒数に直すよ
- fromTimeCode: function (code) {
+ fromTimeCode: function (code, max) {
var m;
+ if (max && (m = /^(\d+(?:\.\d)?)%/(code)))
+ return Math.round(max * (parseFloat(m[1]) / 100));
if (m = /^(([-+]?)\d+):(\d+)$/(code))
return parseInt(m[1], 10) * 60 + (m[2] == '-' ? -1 : 1) * parseInt(m[3], 10);
if (m = /^([-+]?\d+\.\d+)$/(code))
@@ -683,7 +685,7 @@ Thanks:
},
seek: function (v) {
- v = U.fromTimeCode(v);
+ v = U.fromTimeCode(v, this.totalTime);
if (v < 0)
v = this.totalTime + v;
return this.currentTime = Math.min(Math.max(v, 0), this.totalTime);
--
cgit v1.2.3