diff options
author | anekos | 2010-03-31 11:30:09 +0000 |
---|---|---|
committer | anekos | 2010-03-31 11:30:09 +0000 |
commit | bfc2de9a88c4c5cdbdf9322ef2e75d949af71bb3 (patch) | |
tree | 6dfe4891c93164f365be9ecccab2285531d6ac5f /stella.js | |
parent | d47d6b96c96543608ded0d2e1f85c897db772089 (diff) | |
download | vimperator-plugins-bfc2de9a88c4c5cdbdf9322ef2e75d949af71bb3.tar.bz2 |
timecode に "n%" 表記追加
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37130 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'stella.js')
-rw-r--r-- | stella.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -39,7 +39,7 @@ let PLUGIN_INFO = <name lang="ja">すてら</name> <description>For Niconico/YouTube/Vimeo, Add control commands and information display(on status line).</description> <description lang="ja">ニコニコ動画/YouTube/Vimeo 用。操作コマンドと情報表示(ステータスライン上に)追加します。</description> - <version>0.25.1</version> + <version>0.26.0</version> <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> <license>new BSD License (Please read the source code comments of this plugin)</license> <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license> @@ -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); |