diff --git a/content/treestyletab/config.xul b/content/treestyletab/config.xul
index 2b9ee5b1..fd30102a 100644
--- a/content/treestyletab/config.xul
+++ b/content/treestyletab/config.xul
@@ -68,6 +68,9 @@
+
@@ -98,6 +101,15 @@
+
+
+
+
+
+
+
diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js
index 016ff7a0..52a14659 100644
--- a/content/treestyletab/treestyletab.js
+++ b/content/treestyletab/treestyletab.js
@@ -85,7 +85,7 @@ var TreeStyleTabService = {
_ObserverService : null,
/* API */
-
+
readyToOpenChildTab : function(aFrameOrTabBrowser, aMultiple)
{
var frame = this.getFrameFromTabBrowserElements(aFrameOrTabBrowser);
@@ -118,7 +118,7 @@ var TreeStyleTabService = {
},
/* Utilities */
-
+
isEventFiredOnTabIcon : function(aEvent)
{
var tab = this.getTabFromEvent(aEvent);
@@ -251,7 +251,7 @@ var TreeStyleTabService = {
return frame;
},
-
+
isTabVertical : function(aTabOrChild)
{
var b = this.getTabBrowserFromChildren(aTabOrChild);
@@ -288,7 +288,7 @@ var TreeStyleTabService = {
},
/* Initializing */
-
+
init : function()
{
if (!('gBrowser' in window)) return;
@@ -304,142 +304,8 @@ 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\)/,
- <>>
- )
- );
- window.QueryInterface(Components.interfaces.nsIDOMChromeWindow).browserDOMWindow = null;
- window.QueryInterface(Components.interfaces.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess();
-
- eval('BookmarksCommand.openGroupBookmark = '+
- BookmarksCommand.openGroupBookmark.toSource().replace(
- 'browser.addTab(uri);',
- <>>
- ).replace(
- 'if (index == index0)',
- <>>
- )
- );
-
-
-
- if ('MultipleTabService' in window) {
- eval('MultipleTabService.showHideMenuItems = '+
- MultipleTabService.showHideMenuItems.toSource().replace(
- /var separators = /,
- <>>
- )
- );
- }
+ this.overrideGlobalFunctions();
+ this.overrideExtensions();
this.initTabBrowser(gBrowser);
},
@@ -456,7 +322,7 @@ var TreeStyleTabService = {
aTabBrowser.mTabContainer.addEventListener('dblclick', this, true);
aTabBrowser.mTabContainer.addEventListener('mousedown', this, true);
aTabBrowser.mTabContainer.addEventListener('select', this, true);
- aTabBrowser.mPanelContainer.addEventListener('click', this, true);
+// aTabBrowser.mPanelContainer.addEventListener('click', this, true);
aTabBrowser.__treestyletab__levelMargin = -1;
@@ -619,7 +485,8 @@ catch(e) {
'var tab = aEvent.target;',
<>>
+ )
+ );
+ 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\)/,
+ <>>
+ )
+ );
+ window.QueryInterface(Components.interfaces.nsIDOMChromeWindow).browserDOMWindow = null;
+ window.QueryInterface(Components.interfaces.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess();
+
+ eval('BookmarksCommand.openGroupBookmark = '+
+ BookmarksCommand.openGroupBookmark.toSource().replace(
+ 'browser.addTab(uri);',
+ <>>
+ ).replace(
+ 'if (index == index0)',
+ <>>
+ )
+ );
+ },
+
+ overrideExtensions : function()
+ {
+ if ('MultipleTabService' in window) {
+ eval('MultipleTabService.showHideMenuItems = '+
+ MultipleTabService.showHideMenuItems.toSource().replace(
+ /var separators = /,
+ <>>
+ )
+ );
+ }
+
+ if ('autoHIDE' in window) {
+ }
+ },
+
destroy : function()
{
this.destroyTabBrowser(gBrowser);
@@ -843,7 +854,7 @@ catch(e) {
this.destroyTab(tabs[i]);
}
},
-
+
destroyTabBrowser : function(aTabBrowser)
{
aTabBrowser.__treestyletab__observer.destroy();
@@ -866,7 +877,7 @@ catch(e) {
aTabBrowser.mTabContainer.removeEventListener('dblclick', this, true);
aTabBrowser.mTabContainer.removeEventListener('mousedown', this, true);
aTabBrowser.mTabContainer.removeEventListener('select', this, true);
- aTabBrowser.mPanelContainer.removeEventListener('click', this, true);
+// aTabBrowser.mPanelContainer.removeEventListener('click', this, true);
},
destroyTab : function(aTab, aTabBrowser)
@@ -901,6 +912,7 @@ catch(e) {
this.onTabClick(aEvent);
return;
}
+/*
var isMiddleClick = (
aEvent.button == 1 ||
aEvent.button == 0 && (aEvent.ctrlKey || aEvent.metaKey)
@@ -914,6 +926,7 @@ catch(e) {
var b = this.getTabBrowserFromChildren(aEvent.currentTarget);
this.readyToOpenChildTab(b.selectedTab);
}
+*/
return;
case 'dblclick':
diff --git a/defaults/preferences/treestyletab.js b/defaults/preferences/treestyletab.js
index 02b3fb4c..25947434 100644
--- a/defaults/preferences/treestyletab.js
+++ b/defaults/preferences/treestyletab.js
@@ -1,16 +1,19 @@
+pref("extensions.treestyletab.tabbar.width", 200);
+pref("extensions.treestyletab.tabbar.position", "left");
+pref("extensions.treestyletab.tabbar.scroll.smooth", true);
+pref("extensions.treestyletab.tabbar.scroll.timeout", 250);
+pref("extensions.treestyletab.tabbar.style", "default");
+pref("extensions.treestyletab.levelMargin", 12);
+
+pref("extensions.treestyletab.openGroupBookmarkAsTabSubTree", true);
+pref("extensions.treestyletab.loadDroppedLinkToNewChildTab", false);
+
pref("extensions.treestyletab.autoCollapseExpandSubTreeOnSelect", true);
pref("extensions.treestyletab.collapseExpandSubTree.dblclick", false);
pref("extensions.treestyletab.autoExpandSubTreeOnAppendChild", true);
pref("extensions.treestyletab.attachChildrenToGrandParentOnRemoveTab", true);
// 0 = default, 1 = only visible tabs
pref("extensions.treestyletab.focusMode", 1);
-pref("extensions.treestyletab.levelMargin", 12);
-pref("extensions.treestyletab.tabbar.width", 200);
-pref("extensions.treestyletab.tabbar.position", "left");
-pref("extensions.treestyletab.tabbar.scroll.smooth", true);
-pref("extensions.treestyletab.tabbar.scroll.timeout", 250);
-pref("extensions.treestyletab.openGroupBookmarkAsTabSubTree", true);
-pref("extensions.treestyletab.tabbar.style", "default");
pref("browser.link.open_newwindow.restriction", 0);
diff --git a/locale/en-US/treestyletab/treestyletab.dtd b/locale/en-US/treestyletab/treestyletab.dtd
index 493544d6..5919ac81 100644
--- a/locale/en-US/treestyletab/treestyletab.dtd
+++ b/locale/en-US/treestyletab/treestyletab.dtd
@@ -30,6 +30,10 @@
+
+
+
+
diff --git a/locale/ja/treestyletab/treestyletab.dtd b/locale/ja/treestyletab/treestyletab.dtd
index d13e6a8d..e7f17bb9 100644
--- a/locale/ja/treestyletab/treestyletab.dtd
+++ b/locale/ja/treestyletab/treestyletab.dtd
@@ -30,6 +30,10 @@
+
+
+
+