From 610c86a54babe600bcd1f33f7c64ddc7941b95a4 Mon Sep 17 00:00:00 2001 From: piro Date: Wed, 24 Mar 2010 18:22:28 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=BB=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=AE=E5=88=86=E3=81=8B=E3=82=8C=E7=9B=AE=E3=82=92=E5=88=86?= =?UTF-8?q?=E3=81=8B=E3=82=8A=E3=82=84=E3=81=99=E3=81=8F?= 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@6432 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 87 ++++++++++++++-------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 477a2416..d8620264 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -718,54 +718,53 @@ catch(e) { return; } - if (draggedTab) - return; - - // dropping of urls - var url; - for (let i = 0; i < tabbar._supportedLinkDropTypes.length; i++) { - let dataType = tabbar._supportedLinkDropTypes[i]; - let isURLList = dataType == 'text/uri-list'; - let urlData = dt.mozGetDataAt(isURLList ? 'URL' : dataType , 0); - if (urlData) { - url = transferUtils.retrieveURLFromData(urlData, isURLList ? 'text/plain' : dataType); - break; - } - } - - if (!url || !url.length || url.indexOf(' ', 0) != -1 || /^\s*(javascript|data):/.test(url)) - return; - - nsDragAndDrop.dragDropSecurityCheck(aEvent, sv.getCurrentDragSession(), url); - - var bgLoad = this.getPref('browser.tabs.loadInBackground'); - if (aEvent.shiftKey) bgLoad = !bgLoad; - - var tab = sv.getTabFromEvent(aEvent); - if (!tab || dt.dropEffect == 'copy') { - sv.performDrop(dropActionInfo, b.loadOneTab(getShortcutOrURI(url), { inBackground: bgLoad })); - } - else { - let locked = tab.getAttribute('locked') == 'true'; - let loadDroppedLinkToNewChildTab = dropActionInfo.position != sv.kDROP_ON || locked; - if (!loadDroppedLinkToNewChildTab && - dropActionInfo.position == sv.kDROP_ON) - loadDroppedLinkToNewChildTab = sv.dropLinksOnTabBehavior() == sv.kDROPLINK_NEWTAB; - - try { - if (loadDroppedLinkToNewChildTab || locked) { - sv.performDrop(dropActionInfo, b.loadOneTab(getShortcutOrURI(url), { inBackground: bgLoad })); - } - else { - tab.linkedBrowser.loadURI(getShortcutOrURI(url)); - if (!bgLoad) - b.selectedTab = tab; + if (!draggedTab) { + // dropping of urls + var url; + for (let i = 0; i < tabbar._supportedLinkDropTypes.length; i++) { + let dataType = tabbar._supportedLinkDropTypes[i]; + let isURLList = dataType == 'text/uri-list'; + let urlData = dt.mozGetDataAt(isURLList ? 'URL' : dataType , 0); + if (urlData) { + url = transferUtils.retrieveURLFromData(urlData, isURLList ? 'text/plain' : dataType); + break; } } - catch(e) { + + if (!url || !url.length || url.indexOf(' ', 0) != -1 || /^\s*(javascript|data):/.test(url)) + return; + + nsDragAndDrop.dragDropSecurityCheck(aEvent, sv.getCurrentDragSession(), url); + + var bgLoad = this.getPref('browser.tabs.loadInBackground'); + if (aEvent.shiftKey) bgLoad = !bgLoad; + + var tab = sv.getTabFromEvent(aEvent); + if (!tab || dt.dropEffect == 'copy') { + sv.performDrop(dropActionInfo, b.loadOneTab(getShortcutOrURI(url), { inBackground: bgLoad })); } + else { + let locked = tab.getAttribute('locked') == 'true'; + let loadDroppedLinkToNewChildTab = dropActionInfo.position != sv.kDROP_ON || locked; + if (!loadDroppedLinkToNewChildTab && + dropActionInfo.position == sv.kDROP_ON) + loadDroppedLinkToNewChildTab = sv.dropLinksOnTabBehavior() == sv.kDROPLINK_NEWTAB; + + try { + if (loadDroppedLinkToNewChildTab || locked) { + sv.performDrop(dropActionInfo, b.loadOneTab(getShortcutOrURI(url), { inBackground: bgLoad })); + } + else { + tab.linkedBrowser.loadURI(getShortcutOrURI(url)); + if (!bgLoad) + b.selectedTab = tab; + } + } + catch(e) { + } + } + aEvent.stopPropagation(); } - aEvent.stopPropagation(); }, overrideGlobalFunctions : function TSTService_overrideGlobalFunctions()