From aa80bfbf3f3981de2649ef2a2b4da3a0a217e812 Mon Sep 17 00:00:00 2001 From: piro Date: Sat, 20 Oct 2007 19:24:34 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=86=E3=82=AD=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=82=84=E6=88=BB?= =?UTF-8?q?=E3=82=8B=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AA=E3=81=A9=E3=81=8B?= =?UTF-8?q?=E3=82=89=E9=96=8B=E3=81=8F=E3=82=BF=E3=83=96=E3=82=82=E3=83=84?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=81=AB=E7=B5=84=E3=81=BF=E8=BE=BC=E3=82=80?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= 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@1255 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 82 ++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 10 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index d90349e5..6a4b4e2c 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -249,20 +249,71 @@ var TreeStyleTabService = { this.addPrefListener(this); this.observe(null, 'nsPref:changed', 'extensions.treestyletab.levelMargin'); + eval('nsContextMenu.prototype.openLinkInTab = '+ + nsContextMenu.prototype.openLinkInTab.toSource().replace( + '{', + <> + ) + ); + eval('nsContextMenu.prototype.openFrameInTab = '+ + nsContextMenu.prototype.openFrameInTab.toSource().replace( + '{', + <> + ) + ); + + eval('window.handleLinkClick = '+ + window.handleLinkClick.toSource().replace( + /openNewTabWith/g, + <> + ) + ); + + eval('window.gotoHistoryIndex = '+ + window.gotoHistoryIndex.toSource().replace( + /openUILinkIn/g, + <> + ) + ); + + eval('window.BrowserForward = '+ + window.BrowserForward.toSource().replace( + /openUILinkIn/g, + <> + ) + ); + + eval('window.BrowserBack = '+ + window.BrowserBack.toSource().replace( + /openUILinkIn/g, + <> + ) + ); + eval('window.nsBrowserAccess.prototype.openURI = '+ window.nsBrowserAccess.prototype.openURI.toSource().replace( /switch\s*\(aWhere\)/, <> @@ -1513,6 +1564,17 @@ catch(e) { } }, + readyToOpenChildTab : function(aFrame) + { + if (!aFrame) + aFrame = TreeStyleTabService.browser.contentWindow; + + var ownerBrowser = ('SplitBrowser' in window) ? this.getTabBrowserFromChildren(SplitBrowser.getSubBrowserAndBrowserFromFrame(aFrame.top).browser) : gBrowser ; + ownerBrowser.__treestyletab__readyToAttachNewTab = true; + ownerBrowser.__treestyletab__readyToAttachMultiple = false; + ownerBrowser.__treestyletab__parentTab = this.getTabFromFrame(aFrame, ownerBrowser).getAttribute(this.kID); + }, + /* attach/part */ attachTabTo : function(aChild, aParent, aInfo) @@ -1866,7 +1928,7 @@ catch(e) { }, /* scroll */ - + scrollTo : function(aTabBrowser, aEndX, aEndY) { if (this.getPref('extensions.treestyletab.tabbar.scroll.smooth')) @@ -1940,7 +2002,7 @@ catch(e) { scrollBoxObject.scrollTo(newX, newY); }, - + scrollToTab : function(aTab) { if (!aTab || this.isTabVisible(aTab)) return;