From 72d0ae1c1e88cfac20597c9459d4ad198d66eb67 Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 27 Apr 2009 02:57:09 +0000 Subject: [PATCH] =?UTF-8?q?FullerScreen=202.4=20(=20https://addons.mozilla?= =?UTF-8?q?.org/firefox/addon/4650=20)=20=E3=81=A8=E3=81=AE=E7=AB=B6?= =?UTF-8?q?=E5=90=88=E3=82=92=E8=A7=A3=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4186 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/hacks.js | 11 +++++++++++ content/treestyletab/res/fullScreenCanvas.xul | 7 +++++-- content/treestyletab/treestyletabbrowser.js | 3 --- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/content/treestyletab/hacks.js b/content/treestyletab/hacks.js index 14f2fc34..5e5813f9 100644 --- a/content/treestyletab/hacks.js +++ b/content/treestyletab/hacks.js @@ -92,6 +92,17 @@ TreeStyleTabService.overrideExtensionsPreInit = function() { '{ TreeStyleTabService.init();' )); } + + // FullerScreen + if ('FS_onFullerScreen' in window) { + 'CheckIfFullScreen,FS_onFullerScreen,FS_onMouseMove'.split(',').forEach(function(aFunc) { + if (!(aFunc in window)) return; + eval('window.'+aFunc+' = '+window[aFunc].toSource().replace( + /FS_data.mTabs.(removeAttribute\("moz-collapsed"\)|setAttribute\("moz-collapsed", "true"\));/g, + 'if (gBrowser.getAttribute(TreeStyleTabService.kTABBAR_POSITION) == "top") { $& }' + )); + }, this); + } }; TreeStyleTabService.overrideExtensionsOnInitBefore = function() { diff --git a/content/treestyletab/res/fullScreenCanvas.xul b/content/treestyletab/res/fullScreenCanvas.xul index f34762ce..c83798ac 100644 --- a/content/treestyletab/res/fullScreenCanvas.xul +++ b/content/treestyletab/res/fullScreenCanvas.xul @@ -143,16 +143,19 @@ window.addEventListener('DOMContentLoaded', function() { }, getZoomForFrame : function(aFrame) { - const Prefs = Components.classes['@mozilla.org/preferences;1'].getService(Components.interfaces.nsIPrefBranch);; + const Prefs = Components + .classes['@mozilla.org/preferences;1'] + .getService(Components.interfaces.nsIPrefBranch); try { if (Prefs.getBoolPref('browser.zoom.full')) - return aFrame + var zoom = aFrame .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShell) .contentViewer .QueryInterface(Components.interfaces.nsIMarkupDocumentViewer) .fullZoom; + return zoom; } catch(e) { } diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 439bea41..170f1ddb 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1156,9 +1156,6 @@ TreeStyleTabBrowser.prototype = { scrollBoxObject.getPosition(x, y); this.lastScrollX = x.value; this.lastScrollY = y.value; -// var tab = aEvent.originalTarget; -// var delta = tab.boxObject.height; -// scrollBoxObject.scrollTo(x.value, y.value-delta); } return;