From 0385c462c4f7b10ba066696d874f7e72f5cbf9e6 Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 29 Oct 2007 15:49:00 +0000 Subject: [PATCH] =?UTF-8?q?=E5=B8=B8=E3=81=AB=E3=81=99=E3=81=B9=E3=81=A6?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=81=A7=E9=96=8B=E3=81=8F=E8=A8=AD=E5=AE=9A=E3=82=84=E3=80=81?= =?UTF-8?q?=E5=B8=B8=E3=81=AB=E3=83=AD=E3=82=B1=E3=83=BC=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=83=90=E3=83=BC=E3=81=AE=E3=81=99=E3=81=B9=E3=81=A6?= =?UTF-8?q?=E3=81=AE=E5=85=A5=E5=8A=9B=E3=82=92=20=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=81=A7=E9=96=8B=E3=81=8F=E8=A8=AD=E5=AE=9A=E3=81=AE=E6=99=82?= =?UTF-8?q?=E3=80=81Ctrl=E3=80=81Command=E3=80=81Alt=E3=81=AA=E3=81=A9?= =?UTF-8?q?=E3=81=AE=E3=83=A2=E3=83=87=E3=82=A3=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=82=A2=E3=82=AD=E3=83=BC=E3=81=AB=E3=82=88=E3=82=8B=E6=8C=99?= =?UTF-8?q?=E5=8B=95=E3=81=AE=E5=8F=8D=E8=BB=A2=E3=81=8C=20=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=81=97=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= 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@1386 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 118 +++++++++++++-------------- 1 file changed, 55 insertions(+), 63 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 6a0fce3b..dc7e56d1 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -141,7 +141,7 @@ var TreeStyleTabService = { return ownerBrowser.__treestyletab__readyToAttachNewTab || ownerBrowser.__treestyletab__readyToAttachNewTabGroup ? true : false ; }, - checkReadyToOpenNewChildTab : function(aInfo) + checkReadyToOpenNewTab : function(aInfo) { /* ̐ @@ -184,29 +184,40 @@ var TreeStyleTabService = { var b = this.getTabBrowserFromFrame(frame); var nextTab = this.getNextSiblingTab(currentTab); - return ( - ( - internal.newTab && - currentHost == targetHost && - currentURI != 'about:blank' && - currentURI.split('#')[0] != info.uri.split('#')[0] && - (this.readyToOpenChildTab( - (parentHost == targetHost && !internal.forceChild ? parentTab : frame), - false, - (parentHost == targetHost && !internal.forceChild && ( - this.getTabById(currentTab.__treestyletab__next, b) || - (nextTab ? (currentTab.__treestyletab__next = nextTab.getAttribute(this.kID), nextTab) : null ) - )) - ), - true) - ) || - ( - external.newTab && - currentHost != targetHost && - currentURI != 'about:blank' && - (external.forceChild ? (this.readyToOpenChildTab(frame), true) : true ) - ) - ); + var openTab = false; + var parent = null; + var insertBefore = null; + + if (info.modifier) openTab = true; + + if ( + internal.newTab && + currentHost == targetHost && + currentURI != 'about:blank' && + currentURI.split('#')[0] != info.uri.split('#')[0] + ) { + openTab = info.modifier && info.invert ? !openTab : true ; + parent = parentHost == targetHost && !internal.forceChild ? parentTab : frame ; + insertBefore = parentHost == targetHost && !internal.forceChild && ( + this.getTabById(currentTab.__treestyletab__next, b) || + (nextTab ? (currentTab.__treestyletab__next = nextTab.getAttribute(this.kID), nextTab) : null ) + ); + } + else if ( + external.newTab && + currentHost != targetHost && + currentURI != 'about:blank' + ) { + openTab = info.modifier && info.invert ? !openTab : true ; + if (external.forceChild) { + parent = frame; + } + } + + if (openTab && parent) { + this.readyToOpenChildTab(parent, false, insertBefore); + } + return openTab; }, /* Utilities */ @@ -827,22 +838,13 @@ catch(e) { window.BrowserLoadURL.toSource().replace( 'aTriggeringEvent && aTriggeringEvent.altKey', <> ) ); @@ -906,32 +908,22 @@ catch(e) { ).replace( /(event.ctrlKey|event.metaKey)/, <> ).replace( 'return false;case 1:', <>