From ff6b6e1aff5ae04a2551be8de1d59e9265dc16c7 Mon Sep 17 00:00:00 2001 From: anekos Date: Mon, 8 Dec 2008 12:02:12 +0000 Subject: ようつべのフルスクリーンをマシにした git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@26125 d0d07461-0603-4401-acd4-de1884942a52 --- stella.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/stella.js b/stella.js index ecb9465..5bd7f35 100644 --- a/stella.js +++ b/stella.js @@ -409,22 +409,25 @@ var PLUGIN_INFO = let (as = content.document.defaultView.wrappedJSObject.swfArgs) ('http://www.youtube.com/get_video?fmt=22&video_id=' + as.video_id + '&t=' + as.t), - get fullscreen () this.player.__stella_fullscreen, - // FIXME - 元に戻らない + get fullscreen () this.storage.fullscreen, + // FIXME - 元に戻らない&スクロールバーが出たまま set fullscreen () { - this.player.__stella_fullscreen = !this.player.__stella_fullscreen; + this.storage.fullscreen = !this.storage.fullscreen; + let p = this.player; + let r = p.getBoundingClientRect(); if (this.fullscreen) { - liberator.log('full'); - storeStyle(this.player, { - position: 'fixed', - left: '0px', - top: '0px', + if (this.storage.r === undefined) + this.storage.r = /r/.test(options['guioptions']); + storeStyle(p, { + marginLeft: -r.left + 'px', + marginTop: -r.top + 'px', width: content.innerWidth + 'px', - height: content.innerHeight + 'px' + height: content.innerHeight + 'px', }); + p.setSize(content.innerWidth, content.innerHeight); } else { - liberator.log('normal'); - restoreStyle(this.player); + p.setSize(640, 385); + restoreStyle(p); } }, @@ -923,10 +926,11 @@ var PLUGIN_INFO = } return arg; })(); - liberator.open(url, arg.bang ? liberator.NEW_TAB : liberator.CURRENT_TAB); + liberator.open(url, args.bang ? liberator.NEW_TAB : liberator.CURRENT_TAB); }, { argCount: '*', + bang: true, completer: function (context, args) { if (!self.isValid) raise('Stella: Current page is not supported'); -- cgit v1.2.3