ドラッグ中はツールチップを表示しないように
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@3937 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
d6dd971eaa
commit
94c1e11844
@ -142,11 +142,11 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('MultipleTabService.showHideMenuItems = '+
|
||||
MultipleTabService.showHideMenuItems.toSource().replace(
|
||||
'var separators = ',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (aPopup.id == 'multipletab-selection-menu') {
|
||||
TreeStyleTabService.showHideSubTreeMenuItem(document.getElementById(TreeStyleTabService.kMENUITEM_REMOVESUBTREE_SELECTION), MultipleTabService.getSelectedTabs());
|
||||
}
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -159,7 +159,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
'{ var treeStyleTabPos = gBrowser.getAttribute(TreeStyleTabService.kTABBAR_POSITION);'
|
||||
).replace(
|
||||
/e.screenY <= ((autoHIDE|ah).Win.boxObject).screenY \+ (autoHIDE.space|ah.senseArea)/,
|
||||
<><![CDATA[(e.screenY <= $1.screenY + $3 ||
|
||||
<![CDATA[(e.screenY <= $1.screenY + $3 ||
|
||||
(
|
||||
treeStyleTabPos == 'left' ?
|
||||
(e.screenX <= $1.screenX + $3) :
|
||||
@ -168,10 +168,10 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
treeStyleTabPos == 'bottom' ?
|
||||
(e.screenY >= $1.screenY + $1.height - $3) :
|
||||
false
|
||||
))]]></>
|
||||
))]]>
|
||||
).replace( // for old version
|
||||
'e.screenY > getBrowser().mCurrentBrowser.boxObject.screenY + 25',
|
||||
<><![CDATA[(e.screenY > gBrowser.mCurrentBrowser.boxObject.screenY + 25 &&
|
||||
<![CDATA[(e.screenY > gBrowser.mCurrentBrowser.boxObject.screenY + 25 &&
|
||||
(
|
||||
treeStyleTabPos == 'left' ?
|
||||
(e.screenX > gBrowser.mCurrentBrowser.boxObject.screenX + 25) :
|
||||
@ -180,10 +180,10 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
treeStyleTabPos == 'bottom' ?
|
||||
(e.screenY < gBrowser.mCurrentBrowser.boxObject.screenY + gBrowser.mCurrentBrowser.boxObject.height - 25) :
|
||||
true
|
||||
))]]></>
|
||||
))]]>
|
||||
).replace( // for new version
|
||||
'e.screenY > yCondition',
|
||||
<><![CDATA[(e.screenY > yCondition &&
|
||||
<![CDATA[(e.screenY > yCondition &&
|
||||
(
|
||||
treeStyleTabPos == 'left' ?
|
||||
(e.screenX > gBrowser.mCurrentBrowser.boxObject.screenX + 50) :
|
||||
@ -192,13 +192,13 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
treeStyleTabPos == 'bottom' ?
|
||||
(e.screenY < gBrowser.mCurrentBrowser.boxObject.screenY + gBrowser.mCurrentBrowser.boxObject.height - 50) :
|
||||
true
|
||||
))]]></>
|
||||
))]]>
|
||||
)
|
||||
);
|
||||
eval('autoHIDE.HideToolbar = '+
|
||||
autoHIDE.HideToolbar.toSource().replace(
|
||||
/if \(((this|ah).Show)\) \{/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
window.setTimeout('gBrowser.treeStyleTab.checkTabsIndentOverflow();', 0);
|
||||
var treeStyleTabPos = gBrowser.getAttribute(TreeStyleTabService.kTABBAR_POSITION);
|
||||
if ($1) {
|
||||
@ -207,40 +207,40 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
appcontent.__treestyletab__resized = false;
|
||||
appcontent.style.margin = 0;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
func = 'RemoveAttrib' in autoHIDE ? 'RemoveAttrib' : 'EndFull' ;
|
||||
eval('autoHIDE.'+func+' = '+
|
||||
autoHIDE[func].toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
var appcontent = document.getElementById('appcontent');
|
||||
if (appcontent.__treestyletab__resized) {
|
||||
appcontent.__treestyletab__resized = false;
|
||||
appcontent.style.margin = 0;
|
||||
}
|
||||
window.setTimeout('gBrowser.treeStyleTab.checkTabsIndentOverflow();', 0);
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
eval('autoHIDE.SetMenu = '+
|
||||
autoHIDE.SetMenu.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (arguments.length && arguments[0]) {
|
||||
var treeStyleTabSplitter = document.getAnonymousElementByAttribute(gBrowser, 'class', TreeStyleTabService.kSPLITTER);
|
||||
gBrowser.treeStyleTab.tabbarWidth = gBrowser.mStrip.boxObject.width +
|
||||
(treeStyleTabSplitter ? treeStyleTabSplitter.boxObject.width : 0 );
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
func = 'MoveContent' in autoHIDE ? 'MoveContent' : 'MoveC' ;
|
||||
eval('autoHIDE.'+func+' = '+
|
||||
autoHIDE[func].toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
var treeStyleTabPos = gBrowser.getAttribute(TreeStyleTabService.kTABBAR_POSITION);
|
||||
if (!arguments.length) {
|
||||
var appcontent = document.getElementById('appcontent');
|
||||
@ -257,17 +257,17 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
window.setTimeout('autoHIDE.MoveC(true);', 100);
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/.(move|setPosition)\(0, - (this|ah).delta\)/,
|
||||
<><![CDATA[.$1(
|
||||
<![CDATA[.$1(
|
||||
(
|
||||
treeStyleTabPos == 'left' ? -gBrowser.treeStyleTab.tabbarWidth :
|
||||
treeStyleTabPos == 'right' ? gBrowser.treeStyleTab.tabbarWidth :
|
||||
0
|
||||
),
|
||||
-$2.delta
|
||||
)]]></>
|
||||
)]]>
|
||||
)
|
||||
);
|
||||
var autoHideEventListener = {
|
||||
@ -305,10 +305,10 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('window.TMupdateSettings = '+
|
||||
window.TMupdateSettings.toSource().replace(
|
||||
/(\{aTab.removeAttribute\("tabxleft"\);\})(\})/,
|
||||
<><![CDATA[$1
|
||||
<![CDATA[$1
|
||||
gBrowser.treeStyleTab.initTabAttributes(aTab);
|
||||
gBrowser.treeStyleTab.initTabContentsOrder(aTab);
|
||||
$2]]></>
|
||||
$2]]>
|
||||
)
|
||||
);
|
||||
|
||||
@ -316,10 +316,10 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('window.tabxTabAdded = '+
|
||||
window.tabxTabAdded.toSource().replace(
|
||||
/(\})(\)?)$/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
gBrowser.treeStyleTab.initTabAttributes(aTab);
|
||||
gBrowser.treeStyleTab.initTabContentsOrder(aTab);
|
||||
$1$2]]></>
|
||||
$1$2]]>
|
||||
)
|
||||
);
|
||||
gBrowser.mTabContainer.addEventListener('DOMNodeInserted', tabxTabAdded, true);
|
||||
@ -327,49 +327,49 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('window.TMP_TabDragGesture = '+
|
||||
window.TMP_TabDragGesture.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) {
|
||||
nsDragAndDrop.startDrag(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver ));
|
||||
aEvent.stopPropagation();
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
eval('window.TMP_TabDragOver = '+
|
||||
window.TMP_TabDragOver.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) {
|
||||
nsDragAndDrop.dragOver(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver ));
|
||||
aEvent.stopPropagation();
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
eval('window.TMP_TabDragDrop = '+
|
||||
window.TMP_TabDragDrop.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) {
|
||||
nsDragAndDrop.drop(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver ));
|
||||
aEvent.stopPropagation();
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
eval('window.TMP_TabDragExit = '+
|
||||
window.TMP_TabDragExit.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) {
|
||||
nsDragAndDrop.dragExit(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver ));
|
||||
aEvent.stopPropagation();
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
@ -402,19 +402,19 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
'var TSTTabBrowser = gBrowser;'
|
||||
).replace(
|
||||
/(var newIndex =)/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (isTabReorder && TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, aDragSession.sourceNode))
|
||||
return;
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/(aTab = gBrowser.addTab\(url\));/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, $1);
|
||||
return;
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/(aTab = event.target;)/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
$1
|
||||
if (
|
||||
aTab.getAttribute('locked') == 'true' ||
|
||||
@ -424,7 +424,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, TSTTabBrowser.loadOneTab(url, null, null, null, bgLoad, false));
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/aEvent/g, 'event'
|
||||
).replace(
|
||||
@ -435,32 +435,32 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('window.TM_BrowserHome = '+
|
||||
window.TM_BrowserHome.toSource().replace(
|
||||
/(var bgLoad = )/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TreeStyleTabService.readyToOpenChildTab(firstTabAdded, true);
|
||||
$1
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/(\})(\)?)$/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TreeStyleTabService.stopToOpenChildTab(firstTabAdded);
|
||||
$1$2
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
eval('window.TMP_openURL = '+
|
||||
window.TMP_openURL.toSource().replace(
|
||||
/(var firstTab = [^\(]+\([^\)]+\))/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
$1;
|
||||
TreeStyleTabService.readyToOpenChildTab(firstTab, true);
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/(anyBrowser.mTabContainer.nextTab)/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TreeStyleTabService.stopToOpenChildTab(firstTab);
|
||||
$1
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
@ -477,25 +477,25 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('TMP_Bookmark.openGroup = '+
|
||||
TMP_Bookmark.openGroup.toSource().replace(
|
||||
'index = prevTab._tPos + 1;',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
index = gBrowser.treeStyleTab.getNextSiblingTab(gBrowser.treeStyleTab.getRootTab(prevTab));
|
||||
if (tabToSelect == aTab) index = gBrowser.treeStyleTab.getNextSiblingTab(index);
|
||||
index = index ? index._tPos : (prevTab._tPos + 1);
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/(prevTab = aTab;)/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
$1
|
||||
if (tabToSelect == aTab && TreeStyleTabService.getTreePref('openGroupBookmarkAsTabSubTree')) {
|
||||
TreeStyleTabService.readyToOpenChildTab(tabToSelect, true, gBrowser.treeStyleTab.getNextSiblingTab(tabToSelect));
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/(browser.mTabContainer.nextTab)/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (TreeStyleTabService.getTreePref('openGroupBookmarkAsTabSubTree'))
|
||||
TreeStyleTabService.stopToOpenChildTab(tabToSelect);
|
||||
$1]]></>
|
||||
$1]]>
|
||||
)
|
||||
);
|
||||
|
||||
@ -512,12 +512,12 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('window.getRowHeight = '+
|
||||
window.getRowHeight.toSource().replace(
|
||||
'var tabs = getBrowser().mTabContainer.childNodes;',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
var tabsResult = TreeStyleTabService.getVisibleTabs(getBrowser().selectedTab);
|
||||
var tabs = [];
|
||||
for (var t = 0, maxt = tabsResult.snapshotLength; t < maxt; t++)
|
||||
tabs.push(tabsResult.snapshotItem(t));
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/tabs.item\(([^\)]+)\)/g,
|
||||
'tabs[$1]'
|
||||
@ -585,12 +585,12 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('superDrag.onDrop = '+
|
||||
superDrag.onDrop.toSource().replace(
|
||||
/(var newTab = getBrowser\(\).addTab\([^\)]+\);)/g,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (aDragSession.sourceNode &&
|
||||
aDragSession.sourceNode.ownerDocument.defaultView.top == getBrowser().contentWindow)
|
||||
TreeStyleTabService.readyToOpenChildTab(getBrowser());
|
||||
$1
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -611,18 +611,18 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('ddg_ges.Open = '+
|
||||
ddg_ges.Open.toSource().replace(
|
||||
'if (mode[1] == "h" || mode[1] == "f") {',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if ('sourceNode' in aData) // only for dragging from the content tarea.
|
||||
TreeStyleTabService.readyToOpenChildTab(getBrowser());
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
eval('ddg_ges.Search = '+
|
||||
ddg_ges.Search.toSource().replace(
|
||||
'if (mode[1] == "h" || mode[1] == "f") {',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
TreeStyleTabService.readyToOpenChildTab(getBrowser());
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -655,45 +655,45 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
|
||||
eval('FireGestures.onExtraGesture = '+
|
||||
FireGestures.onExtraGesture.toSource().replace(
|
||||
'case "keypress-stop":',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
TreeStyleTabService.readyToOpenChildTab(gBrowser, true);
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
'break;case "gesture-timeout":',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TreeStyleTabService.stopToOpenChildTab(gBrowser);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
eval('FireGestures._performAction = '+
|
||||
FireGestures._performAction.toSource().replace(
|
||||
'gBrowser.loadOneTab(',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TreeStyleTabService.readyToOpenChildTab(gBrowser);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
eval('FireGestures.openURLsInSelection = '+
|
||||
FireGestures.openURLsInSelection.toSource().replace(
|
||||
'var tab =',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (!TreeStyleTabService.checkToOpenChildTab(gBrowser))
|
||||
TreeStyleTabService.readyToOpenChildTab(gBrowser, true);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
).replace(
|
||||
'if (!flag)',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (TreeStyleTabService.checkToOpenChildTab(gBrowser))
|
||||
TreeStyleTabService.stopToOpenChildTab(gBrowser);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
eval('FireGestures.handleEvent = '+
|
||||
FireGestures.handleEvent.toSource().replace(
|
||||
'gBrowser.loadOneTab(',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TreeStyleTabService.readyToOpenChildTab(gBrowser);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -963,12 +963,12 @@ var TreeStyleTabService = {
|
||||
eval('nsBrowserAccess.prototype.openURI = '+
|
||||
nsBrowserAccess.prototype.openURI.toSource().replace(
|
||||
/(switch\s*\(aWhere\))/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (aOpener &&
|
||||
aWhere == Components.interfaces.nsIBrowserDOMWindow.OPEN_NEWTAB) {
|
||||
TreeStyleTabService.readyToOpenChildTab(aOpener);
|
||||
}
|
||||
$1]]></>
|
||||
$1]]>
|
||||
)
|
||||
);
|
||||
|
||||
@ -1040,7 +1040,7 @@ var TreeStyleTabService = {
|
||||
/\.height/g, '[TreeStyleTabService.getTabBrowserFromChild(TSTTabBrowser).treeStyleTab.invertedSizeProp]'
|
||||
).replace(
|
||||
/(return (?:true|dt.effectAllowed = "copyMove");)/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (!(function(aSelf) {
|
||||
try{
|
||||
var node = TST_DRAGSESSION.sourceNode;
|
||||
@ -1065,7 +1065,7 @@ catch(e) {
|
||||
return TST_DRAGDROP_DISALLOW_RETRUN_VALUE;
|
||||
}
|
||||
$1
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/TST_DRAGSESSION/g,
|
||||
(canDropFunctionName == 'canDrop' ?
|
||||
@ -1087,7 +1087,7 @@ catch(e) {
|
||||
eval('aObserver.'+dragOverFunctionName+' = '+
|
||||
aObserver[dragOverFunctionName].toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
{
|
||||
var TSTTabBrowser = this;
|
||||
if ((function(aSelf) {
|
||||
@ -1118,7 +1118,7 @@ catch(e) {
|
||||
})(TSTTabBrowser)) {
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/TST_DRAGSESSION/g,
|
||||
(canDropFunctionName == 'canDrop' ?
|
||||
@ -1150,48 +1150,48 @@ catch(e) {
|
||||
eval('aObserver.'+dropFunctionName+' = '+
|
||||
aObserver[dropFunctionName].toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
{
|
||||
var TSTTabBrowser = this;
|
||||
TSTTabBrowser.treeStyleTab.clearDropPosition();
|
||||
var dropActionInfo = TSTTabBrowser.treeStyleTab.getDropAction(aEvent, TST_DRAGSESSION);
|
||||
]]></>
|
||||
]]>
|
||||
).replace( // Firefox 2
|
||||
/(if \(aDragSession[^\)]+\) \{)/,
|
||||
<><![CDATA[$1
|
||||
<![CDATA[$1
|
||||
if (TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, TST_DRAGSESSION.sourceNode))
|
||||
return;
|
||||
]]></>
|
||||
]]>
|
||||
).replace( // Firefox 3.0.x, 3.1 or later
|
||||
/(if \((accelKeyPressed|isCopy|dropEffect == "copy")\) {)/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, draggedTab))
|
||||
return;
|
||||
$1]]></>
|
||||
$1]]>
|
||||
).replace( // Firefox 3, duplication of tab
|
||||
/(this.selectedTab = newTab;)(\s*\})?/g,
|
||||
<><![CDATA[$1;
|
||||
<![CDATA[$1;
|
||||
if (dropActionInfo.position == TreeStyleTabService.kDROP_ON)
|
||||
TSTTabBrowser.treeStyleTab.attachTabTo(newTab, dropActionInfo.target);
|
||||
$2]]></>
|
||||
$2]]>
|
||||
).replace( // Firefox 3, dragging tab from another window
|
||||
'else if (draggedTab) {',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, draggedTab))
|
||||
return;
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/(this.loadOneTab\([^;]+\));/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, $1);
|
||||
return;
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
'document.getBindingParent(aEvent.originalTarget).localName != "tab"',
|
||||
'!TreeStyleTabService.getTabFromEvent(aEvent)'
|
||||
).replace(
|
||||
'var tab = aEvent.target;',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (
|
||||
tab.getAttribute('locked') == 'true' || // Tab Mix Plus
|
||||
TreeStyleTabService.getTreePref('loadDroppedLinkToNewChildTab') ||
|
||||
@ -1200,7 +1200,7 @@ catch(e) {
|
||||
TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, TSTTabBrowser.loadOneTab(getShortcutOrURI(url), null, null, null, bgLoad, false));
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/TST_DRAGSESSION/g,
|
||||
(canDropFunctionName == 'canDrop' ?
|
||||
@ -1263,45 +1263,45 @@ catch(e) {
|
||||
eval('nsContextMenu.prototype.openLinkInTab = '+
|
||||
nsContextMenu.prototype.openLinkInTab.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
eval('nsContextMenu.prototype.openFrameInTab = '+
|
||||
nsContextMenu.prototype.openFrameInTab.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
var viewImageMethod = ('viewImage' in nsContextMenu.prototype) ? 'viewImage' : 'viewMedia' ;
|
||||
eval('nsContextMenu.prototype.'+viewImageMethod+' = '+
|
||||
nsContextMenu.prototype[viewImageMethod].toSource().replace(
|
||||
'openUILink(',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (String(whereToOpenLink(e, false, true)).indexOf('tab') == 0)
|
||||
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
eval('nsContextMenu.prototype.viewBGImage = '+
|
||||
nsContextMenu.prototype.viewBGImage.toSource().replace(
|
||||
'openUILink(',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (String(whereToOpenLink(e, false, true)).indexOf('tab') == 0)
|
||||
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
eval('nsContextMenu.prototype.addDictionaries = '+
|
||||
nsContextMenu.prototype.addDictionaries.toSource().replace(
|
||||
'openUILinkIn(',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (where.indexOf('tab') == 0)
|
||||
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
|
||||
@ -1314,12 +1314,12 @@ catch(e) {
|
||||
eval('window.'+funcs[i]+' = '+
|
||||
window[funcs[i]].toSource().replace(
|
||||
/(openNewTabWith\()/g,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (!TreeStyleTabService.checkToOpenChildTab(event.target.ownerDocument.defaultView)) TreeStyleTabService.readyToOpenChildTab(event.target.ownerDocument.defaultView);
|
||||
$1]]></>
|
||||
$1]]>
|
||||
).replace(
|
||||
/(event.ctrlKey|event.metaKey)/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TreeStyleTabService.checkReadyToOpenNewTab({
|
||||
uri : href,
|
||||
external : {
|
||||
@ -1332,12 +1332,12 @@ catch(e) {
|
||||
modifier : $1,
|
||||
invert : TreeStyleTabService.getTreePref('link.invertDefaultBehavior')
|
||||
}) ? true : (TreeStyleTabService.readyToOpenChildTab(), false)
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/* あらゆるリンクからタブを開く設定の時に、アクセルキーが押されていた場合は
|
||||
反転された動作(通常のリンク読み込み)を行う */
|
||||
'return false;case 1:',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (!('TMP_contentAreaClick' in window) && // do nothing for Tab Mix Plus
|
||||
TreeStyleTabService.checkToOpenChildTab()) {
|
||||
TreeStyleTabService.stopToOpenChildTab();
|
||||
@ -1356,7 +1356,7 @@ catch(e) {
|
||||
}
|
||||
return false;
|
||||
case 1:
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
break;
|
||||
@ -1370,7 +1370,7 @@ catch(e) {
|
||||
eval(aName + ' = '+
|
||||
overwroteFunc.toSource().replace(
|
||||
/((openWebPanel\([^\;]+\);|PlacesUIUtils.showMinimalAddBookmarkUI\([^;]+\);)event.preventDefault\(\);return false;\})/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
$1
|
||||
else if (!('TMP_contentAreaClick' in window) && // do nothing for Tab Mix Plus
|
||||
TreeStyleTabService.checkReadyToOpenNewTab({
|
||||
@ -1388,7 +1388,7 @@ catch(e) {
|
||||
handleLinkClick(event, wrapper.href, linkNode);
|
||||
return true;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
};
|
||||
@ -1410,10 +1410,10 @@ catch(e) {
|
||||
eval('window.'+funcs[i]+' = '+
|
||||
window[funcs[i]].toSource().replace(
|
||||
/(openUILinkIn\()/g,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (where == 'tab' || where == 'tabshifted')
|
||||
TreeStyleTabService.readyToOpenChildTab();
|
||||
$1]]></>
|
||||
$1]]>
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1426,9 +1426,9 @@ catch(e) {
|
||||
eval(aName + ' = '+
|
||||
overwroteFunc.toSource().replace(
|
||||
'gBrowser.loadTabs(',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
TreeStyleTabService.readyToOpenNewTabGroup(gBrowser);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
};
|
||||
@ -1440,10 +1440,10 @@ catch(e) {
|
||||
eval('FeedHandler.loadFeed = '+
|
||||
FeedHandler.loadFeed.toSource().replace(
|
||||
'openUILink(',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (String(whereToOpenLink(event, false, true)).indexOf('tab') == 0)
|
||||
TreeStyleTabService.readyToOpenChildTab(gBrowser);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -185,29 +185,29 @@ TreeStyleTabBrowser.prototype = {
|
||||
eval('b.mTabContainer.'+selectNewTab+' = '+
|
||||
b.mTabContainer[selectNewTab].toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (arguments[0].__treestyletab__preventSelect) {
|
||||
arguments[0].__treestyletab__preventSelect = false;
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
eval('b.mTabContainer.adjustTabstrip = '+
|
||||
b.mTabContainer.adjustTabstrip.toSource().replace(
|
||||
/(\})(\)?)$/,
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
var b = TreeStyleTabService.getTabBrowserFromChild(this);
|
||||
b.treeStyleTab.updateInvertedTabContentsOrder(true);
|
||||
$1$2]]></>
|
||||
$1$2]]>
|
||||
)
|
||||
);
|
||||
|
||||
eval('b.mTabContainer.advanceSelectedTab = '+
|
||||
b.mTabContainer.advanceSelectedTab.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if (TreeStyleTabService.getTreePref('focusMode') == TreeStyleTabService.kFOCUS_VISIBLE) {
|
||||
(function(aDir, aWrap, aSelf) {
|
||||
var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(aSelf).treeStyleTab;
|
||||
@ -230,14 +230,14 @@ TreeStyleTabBrowser.prototype = {
|
||||
})(arguments[0], arguments[1], this);
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
eval('b.mTabContainer._handleTabSelect = '+
|
||||
b.mTabContainer._handleTabSelect.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
if ((function(aTabs) {
|
||||
var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(aTabs).treeStyleTab;
|
||||
var tab = aTabs.selectedItem;
|
||||
@ -249,7 +249,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
})(this)) {
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
@ -259,11 +259,11 @@ TreeStyleTabBrowser.prototype = {
|
||||
eval('b.mTabContainer.mTabstrip.ensureElementIsVisible = '+
|
||||
b.mTabContainer.mTabstrip.ensureElementIsVisible.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
var browser = TreeStyleTabService.getTabBrowserFromChild(this);
|
||||
var startProp = browser.treeStyleTab.isVertical ? 'top' : 'left' ;
|
||||
var endProp = browser.treeStyleTab.isVertical ? 'bottom' : 'right' ;
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
/\.left/g, '[startProp]'
|
||||
).replace(
|
||||
@ -275,15 +275,15 @@ TreeStyleTabBrowser.prototype = {
|
||||
eval('b.mTabContainer.mTabstrip._smoothScrollByPixels = '+
|
||||
b.mTabContainer.mTabstrip._smoothScrollByPixels.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[$&
|
||||
<![CDATA[$&
|
||||
var TST = TreeStyleTabService.getTabBrowserFromChild(this);
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
'scrollBy(distance, 0)',
|
||||
<><![CDATA[scrollBy(
|
||||
<![CDATA[scrollBy(
|
||||
(TST.isVertical ? 0 : distance ),
|
||||
(TST.isVertical ? distance : 0 )
|
||||
)]]></>
|
||||
)]]>
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -320,15 +320,15 @@ TreeStyleTabBrowser.prototype = {
|
||||
'tabPos + 1', 'nextTab._tPos'
|
||||
).replace(
|
||||
'this.moveTabTo(',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
var descendant = this.treeStyleTab.getDescendantTabs(nextTab);
|
||||
if (descendant.length) {
|
||||
nextTab = descendant[descendant.length-1];
|
||||
}
|
||||
$&]]></>
|
||||
$&]]>
|
||||
).replace(
|
||||
'this.moveTabToStart();',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
this.treeStyleTab.internallyTabMoving = true;
|
||||
var parentTab = this.treeStyleTab.getParentTab(this.mCurrentTab);
|
||||
if (parentTab) {
|
||||
@ -339,7 +339,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
$&
|
||||
}
|
||||
this.treeStyleTab.internallyTabMoving = false;
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
@ -353,7 +353,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
'tabPos - 1', 'prevTab._tPos'
|
||||
).replace(
|
||||
'this.moveTabToEnd();',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
this.treeStyleTab.internallyTabMoving = true;
|
||||
var parentTab = this.treeStyleTab.getParentTab(this.mCurrentTab);
|
||||
if (parentTab) {
|
||||
@ -364,58 +364,58 @@ TreeStyleTabBrowser.prototype = {
|
||||
$&
|
||||
}
|
||||
this.treeStyleTab.internallyTabMoving = false;
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
eval('b._keyEventHandler.handleEvent = '+
|
||||
b._keyEventHandler.handleEvent.toSource().replace(
|
||||
'this.tabbrowser.moveTabOver(aEvent);',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (!this.tabbrowser.treeStyleTab.isVertical ||
|
||||
!this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) {
|
||||
$&
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
'this.tabbrowser.moveTabForward();',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (this.tabbrowser.treeStyleTab.isVertical ||
|
||||
!this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) {
|
||||
$&
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
).replace(
|
||||
'this.tabbrowser.moveTabBackward();',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (this.tabbrowser.treeStyleTab.isVertical ||
|
||||
!this.tabbrowser.treeStyleTab.moveTabLevel(aEvent)) {
|
||||
$&
|
||||
}
|
||||
]]></>
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
eval('b.loadTabs = '+
|
||||
b.loadTabs.toSource().replace(
|
||||
'var tabNum = ',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (this.treeStyleTab.readyToAttachNewTabGroup)
|
||||
TreeStyleTabService.readyToOpenChildTab(firstTabAdded || this.selectedTab, true);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
).replace(
|
||||
'if (!aLoadInBackground)',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
if (TreeStyleTabService.checkToOpenChildTab(this))
|
||||
TreeStyleTabService.stopToOpenChildTab(this);
|
||||
$&]]></>
|
||||
$&]]>
|
||||
)
|
||||
);
|
||||
|
||||
eval('b.createTooltip = '+
|
||||
b.createTooltip.toSource().replace(
|
||||
'if (tn.hasAttribute("label")) {',
|
||||
<><![CDATA[
|
||||
<![CDATA[
|
||||
else if (tn.getAttribute(TreeStyleTabService.kTWISTY_HOVER) == 'true') {
|
||||
var key = tn.getAttribute(TreeStyleTabService.kSUBTREE_COLLAPSED) == 'true' ? 'tooltip.expandSubtree' : 'tooltip.collapseSubtree' ;
|
||||
event.target.setAttribute(
|
||||
@ -429,7 +429,17 @@ TreeStyleTabBrowser.prototype = {
|
||||
);
|
||||
return true;
|
||||
}
|
||||
$&]]></>
|
||||
$&]]>
|
||||
).replace(
|
||||
'{',
|
||||
<![CDATA[$&
|
||||
if ((function(aTabBrowser) {
|
||||
var TST = aTabBrowser.treeStyleTab;
|
||||
var session = TST.getCurrentDragSession();
|
||||
return session && TST.getTabFromChild(session.sourceNode);
|
||||
})(this))
|
||||
return false;
|
||||
]]>
|
||||
)
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user