From b9c3f17ce3ee465d9b13fbed645ffed624d6ef5b Mon Sep 17 00:00:00 2001 From: anekos Date: Sat, 21 Mar 2009 08:51:32 +0000 Subject: 自動フルスクリーンの修正と微妙な仕様変更 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@31429 d0d07461-0603-4401-acd4-de1884942a52 --- stella.js | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'stella.js') diff --git a/stella.js b/stella.js index 438bb6a..4b54d0d 100644 --- a/stella.js +++ b/stella.js @@ -39,7 +39,7 @@ let PLUGIN_INFO = すてら Show video informations on the status line. ステータスラインに動画の再生時間などを表示する。 - 0.20.1 + 0.20.2 anekos new BSD License (Please read the source code comments of this plugin) 修正BSDライセンス (ソースコードのコメントを参照してください) @@ -174,7 +174,7 @@ Thanks: * Const {{{ *********************************************************************************/ - const ID_PREFIX = 'anekos-stela-'; + const ID_PREFIX = 'anekos-stella-'; const InVimperator = !!(liberator && modules && modules.liberator); const DOUBLE_CLICK_INTERVAL = 300; @@ -364,17 +364,31 @@ Thanks: }; + // }}} + + /********************************************************************************* + * Setting {{{ + *********************************************************************************/ + + function Setting () { + this.niconico = { + autoFullscreenDelay: 4000 + }; + } + // }}} /********************************************************************************* * Player {{{ *********************************************************************************/ - function Player () { + function Player (stella) { let self = this; this.initialize.apply(this, arguments); + this.stella = stella; + this.last = { fullscreen: false }; @@ -1288,8 +1302,9 @@ Thanks: * Stella {{{ *********************************************************************************/ - function Stella () { + function Stella (setting) { this.initialize.apply(this, arguments); + this.setting = setting; } Stella.MAIN_PANEL_ID = ID_PREFIX + 'main-panel', @@ -1302,8 +1317,8 @@ Thanks: let self = this; this.players = { - niconico: new NicoPlayer(), - youtube: new YouTubePlayer() + niconico: new NicoPlayer(this.stella), + youtube: new YouTubePlayer(this.stella) }; this.createStatusPanel(); @@ -1474,7 +1489,7 @@ Thanks: let stbar = document.getElementById('status-bar'); stbar.insertBefore(panel, document.getElementById('liberator-statusline').nextSibling); - let relmenu = document.getElementById('anekos-stela-relations-menupopup'); + let relmenu = document.getElementById('anekos-stella-relations-menupopup'); panel.addEventListener('DOMMouseScroll', U.bindr(this, this.onMouseScroll), true); }, @@ -1623,7 +1638,10 @@ Thanks: if (!this.player.ready) return; clearInterval(this.__autoFullscreenTimer) - setTimeout(U.bindr(this, function () (this.player.fullscreen = true), 1000)); + setTimeout( + U.bindr(this, function () (this.player.fullscreen = true)), + this.stella.setting.niconico.autoFullscreenDelay + ); delete this.__autoFullscreenTimer; }), 200 @@ -1643,7 +1661,7 @@ Thanks: if (!this.player) return; - let relmenu = document.getElementById('anekos-stela-relations-menupopup'); + let relmenu = document.getElementById('anekos-stella-relations-menupopup'); let rels = this.player.relations; while (relmenu.firstChild) @@ -1700,7 +1718,7 @@ Thanks: let estella = liberator.globalVariables.stella; let install = function () { - let stella = liberator.globalVariables.stella = new Stella(); + let stella = liberator.globalVariables.stella = new Stella(new Setting()); stella.addUserCommands(); liberator.log('Stella: installed.'); }; -- cgit v1.2.3