aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2010-01-22 08:07:36 +0000
committeranekos2010-01-22 08:07:36 +0000
commit31e1826c3203e57b19d7838603ea374e70b51b2c (patch)
tree7eeb5901284eab74a4088c76b832b7b778dd40c8
parent91f23dafe2a344841052d9d137c5325614215961 (diff)
downloadvimperator-plugins-31e1826c3203e57b19d7838603ea374e70b51b2c.tar.bz2
ニコニコ動画でフルスクリーンから復帰したときに、スクロール位置も復帰するようにした
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36511 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--stella.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/stella.js b/stella.js
index c326ff7..c08eb29 100644
--- a/stella.js
+++ b/stella.js
@@ -39,7 +39,7 @@ let PLUGIN_INFO =
<name lang="ja">すてら</name>
<description>For Niconico/YouTube, Add control commands and information display(on status line).</description>
<description lang="ja">ニコニコ動画/YouTube 用。操作コマンドと情報表示(ステータスライン上に)追加します。</description>
- <version>0.20.11</version>
+ <version>0.21.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>
@@ -958,7 +958,13 @@ Thanks:
get large () this.player.ext_getVideoSize() === NicoPlayer.SIZE_LARGE,
set large (value) {
+ if (value && !this.large) {
+ let win = Buffer.findScrollableWindow();
+ this.storage.scrollPositionBeforeLarge = {x: win.scrollX, y: win.scrollY};
+ }
this.player.ext_setVideoSize(value ? NicoPlayer.SIZE_LARGE : NicoPlayer.SIZE_NORMAL);
+ let (pos = this.storage.scrollPositionBeforeLarge)
+ (value || typeof pos == "undefined" || buffer.scrollTo(pos.x, pos.y));
return this.large;
},
@@ -1474,9 +1480,11 @@ Thanks:
onIconDblClick: function () this.player.toggle('fullscreen'),
onLargeClick: function () {
+ // XXX fullscreen と large の実装が同じ場合に問題になるので、toggle は使わない
+ let old = this.player.large;
if (this.player.fullscreen)
this.player.fullscreen = false;
- this.player.toggle('large');
+ this.player.large = !old;
},
onLocationChange: function () {