Add line breaks for dynamic patches

This commit is contained in:
Piro / YUKI Hiroshi 2012-10-13 02:24:02 +09:00
parent a314e75bdb
commit d66b7083d2
7 changed files with 284 additions and 284 deletions

View File

@ -249,19 +249,19 @@ var TreeStyleTabBookmarksService = {
'if (item.uri) { $& }' 'if (item.uri) { $& }'
).replace( ).replace(
/(browserWindow\.(?:getBrowser\(\)|gBrowser)\.loadTabs\([^;]+\);)/, /(browserWindow\.(?:getBrowser\(\)|gBrowser)\.loadTabs\([^;]+\);)/,
'var TSTResult = browserWindow.TreeStyleTabBookmarksService.handleTabsOpenProcess(where, aEvent, browserWindow, ids, urls, typeof replaceCurrentTab == "undefined" ? undefined : replaceCurrentTab, aFolderTitle);' + 'var TSTResult = browserWindow.TreeStyleTabBookmarksService.handleTabsOpenProcess(where, aEvent, browserWindow, ids, urls, typeof replaceCurrentTab == "undefined" ? undefined : replaceCurrentTab, aFolderTitle);\n' +
'TSTTreeStructure = TSTResult.treeStructure;' + 'TSTTreeStructure = TSTResult.treeStructure;\n' +
'TSTPreviousTabs = TSTResult.previousTabs;' + 'TSTPreviousTabs = TSTResult.previousTabs;\n' +
'TSTOpenGroupBookmarkBehavior = TSTResult.behavior;' + 'TSTOpenGroupBookmarkBehavior = TSTResult.behavior;\n' +
'if (typeof replaceCurrentTab != "undefined")' + 'if (typeof replaceCurrentTab != "undefined")\n' +
' replaceCurrentTab = TSTResult.replaceCurrentTab;' + ' replaceCurrentTab = TSTResult.replaceCurrentTab;\n' +
'$1' '$1'
).replace( ).replace(
/(\}\)?)$/, /(\}\)?)$/,
' if (TSTTreeStructure && TSTPreviousTabs) {' + ' if (TSTTreeStructure && TSTPreviousTabs) {\n' +
' let tabs = browserWindow.TreeStyleTabService.getNewTabsFromPreviousTabsInfo(browserWindow.gBrowser, TSTPreviousTabs);' + ' let tabs = browserWindow.TreeStyleTabService.getNewTabsFromPreviousTabsInfo(browserWindow.gBrowser, TSTPreviousTabs);\n' +
' browserWindow.TreeStyleTabService.applyTreeStructureToTabs(tabs, TSTTreeStructure, TSTOpenGroupBookmarkBehavior & browserWindow.TreeStyleTabBookmarksService.kGROUP_BOOKMARK_EXPAND_ALL_TREE);' + ' browserWindow.TreeStyleTabService.applyTreeStructureToTabs(tabs, TSTTreeStructure, TSTOpenGroupBookmarkBehavior & browserWindow.TreeStyleTabBookmarksService.kGROUP_BOOKMARK_EXPAND_ALL_TREE);\n' +
' }' + ' }\n' +
'$1' '$1'
) )
); );
@ -275,16 +275,16 @@ var TreeStyleTabBookmarksService = {
eval('PlacesUIUtils.'+method+' = '+ eval('PlacesUIUtils.'+method+' = '+
PlacesUIUtils[method].toSource().replace( PlacesUIUtils[method].toSource().replace(
/(this\._openTabset\([^\)]+)(\))/, /(this\._openTabset\([^\)]+)(\))/,
'let (w = "_getTopBrowserWin" in this ?' + 'let (w = "_getTopBrowserWin" in this ?\n' +
' this._getTopBrowserWin() :' + ' this._getTopBrowserWin() :\n' +
' "_getCurrentActiveWin" in this ?' + ' "_getCurrentActiveWin" in this ?\n' +
' this._getCurrentActiveWin() :' + ' this._getCurrentActiveWin() :\n' +
' window) {' + ' window) {\n' +
' let nodes = w.TreeStyleTabBookmarksService.getItemIdsForContainerNode(aNode);' + ' let nodes = w.TreeStyleTabBookmarksService.getItemIdsForContainerNode(aNode);\n' +
' for (let i in nodes) {' + ' for (let i in nodes) {\n' +
' urlsToOpen[i].id = nodes[i];' + ' urlsToOpen[i].id = nodes[i];\n' +
' }' + ' }\n' +
'}' + '}\n' +
'$1, aNode.title$2' '$1, aNode.title$2'
) )
); );
@ -298,29 +298,29 @@ var TreeStyleTabBookmarksService = {
eval('PlacesUIUtils.'+method+' = '+ eval('PlacesUIUtils.'+method+' = '+
PlacesUIUtils[method].toSource().replace( PlacesUIUtils[method].toSource().replace(
'{', '{',
'{' + '{\n' +
' var TSTBS;' + ' var TSTBS;\n' +
' let (w = "_getTopBrowserWin" in this ?' + ' let (w = "_getTopBrowserWin" in this ?\n' +
' this._getTopBrowserWin() :' + ' this._getTopBrowserWin() :\n' +
' "_getCurrentActiveWin" in this ?' + ' "_getCurrentActiveWin" in this ?\n' +
' this._getCurrentActiveWin() :' + ' this._getCurrentActiveWin() :\n' +
' window) {' + ' window) {\n' +
' TSTBS = w.TreeStyleTabBookmarksService;' + ' TSTBS = w.TreeStyleTabBookmarksService;\n' +
' PlacesUtils = w.PlacesUtils;' + ' PlacesUtils = w.PlacesUtils;\n' +
' }' ' }'
).replace( ).replace(
'uri: aNodes[i].uri,', 'uri: aNodes[i].uri,',
'id: aNodes[i].itemId, $&' 'id: aNodes[i].itemId, $&'
).replace( ).replace(
/(this\._openTabset\([^\)]+)(\))/, /(this\._openTabset\([^\)]+)(\))/,
'$1,' + '$1,\n' +
' TSTBS.treeBundle' + ' TSTBS.treeBundle\n' +
' .getFormattedString(' + ' .getFormattedString(\n' +
' PlacesUtils.nodeIsBookmark(aNodes[0]) ?' + ' PlacesUtils.nodeIsBookmark(aNodes[0]) ?\n' +
' "openSelectedPlaces.bookmarks" :' + ' "openSelectedPlaces.bookmarks" :\n' +
' "openSelectedPlaces.history",' + ' "openSelectedPlaces.history",\n' +
' [aNodes[0].title, aNodes.length]' + ' [aNodes[0].title, aNodes.length]\n' +
' )' + ' )\n' +
'$2' '$2'
) )
); );
@ -338,28 +338,28 @@ var TreeStyleTabBookmarksService = {
eval('PlacesCommandHook.bookmarkCurrentPages = '+ eval('PlacesCommandHook.bookmarkCurrentPages = '+
PlacesCommandHook.bookmarkCurrentPages.toSource().replace( PlacesCommandHook.bookmarkCurrentPages.toSource().replace(
'{', '{',
'{' + '{\n' +
' TreeStyleTabBookmarksService.beginAddBookmarksFromTabs((function() {' + ' TreeStyleTabBookmarksService.beginAddBookmarksFromTabs((function() {\n' +
' var tabs = [];' + ' var tabs = [];\n' +
' var seen = {};' + ' var seen = {};\n' +
' var allTabs = getBrowser().mTabContainer.childNodes;' + ' var allTabs = getBrowser().mTabContainer.childNodes;\n' +
' for (let i = 0, maxi = allTabs.length; i < maxi; i++)' + ' for (let i = 0, maxi = allTabs.length; i < maxi; i++)\n' +
' {' + ' {\n' +
' let tab = allTabs[i];' + ' let tab = allTabs[i];\n' +
' let uri = tab.linkedBrowser.currentURI.spec;' + ' let uri = tab.linkedBrowser.currentURI.spec;\n' +
' if (uri in seen) continue;' + ' if (uri in seen) continue;\n' +
' seen[uri] = true;' + ' seen[uri] = true;\n' +
' tabs.push(tab);' + ' tabs.push(tab);\n' +
' }' + ' }\n' +
' return tabs;' + ' return tabs;\n' +
' })());' + ' })());\n' +
' try {' ' try {'
).replace( ).replace(
/(\}\)?)$/, /(\}\)?)$/,
' }' + ' }\n' +
' catch(e) {' + ' catch(e) {\n' +
' }' + ' }\n' +
' TreeStyleTabBookmarksService.endAddBookmarksFromTabs();' + ' TreeStyleTabBookmarksService.endAddBookmarksFromTabs();\n' +
'$1' '$1'
) )
); );

View File

@ -115,7 +115,7 @@ var TreeStyleTabBookmarksServiceEditable = {
eval('gEditItemOverlay._showHideRows = '+gEditItemOverlay._showHideRows.toSource().replace( eval('gEditItemOverlay._showHideRows = '+gEditItemOverlay._showHideRows.toSource().replace(
/(\}\)?)$/, /(\}\)?)$/,
' TreeStyleTabBookmarksServiceEditable.parentRow.collapsed = this._element("keywordRow").collapsed && this._element("folderRow").collapsed;' + ' TreeStyleTabBookmarksServiceEditable.parentRow.collapsed = this._element("keywordRow").collapsed && this._element("folderRow").collapsed;\n' +
'$1' '$1'
)); ));

View File

@ -52,9 +52,9 @@ var TreeStyleTabWindowHelper = {
eval('window.undoCloseTab = '+ eval('window.undoCloseTab = '+
window.undoCloseTab.toSource().replace( window.undoCloseTab.toSource().replace(
/(\btab\s*=\s*[^\.]+\.undoCloseTab\([^;]+\);)/, /(\btab\s*=\s*[^\.]+\.undoCloseTab\([^;]+\);)/,
'gBrowser.__treestyletab__readyToUndoCloseTab = true;' + 'gBrowser.__treestyletab__readyToUndoCloseTab = true;\n' +
'$1' + '$1\n' +
'tab.__treestyletab__restoredByUndoCloseTab = true;' + 'tab.__treestyletab__restoredByUndoCloseTab = true;\n' +
'delete gBrowser.__treestyletab__readyToUndoCloseTab;' 'delete gBrowser.__treestyletab__readyToUndoCloseTab;'
) )
); );
@ -96,9 +96,9 @@ var TreeStyleTabWindowHelper = {
/\.width/g, '[TST.sizeProp]' /\.width/g, '[TST.sizeProp]'
).replace( ).replace(
/(return (?:true|dt.effectAllowed = "copyMove");)/, /(return (?:true|dt.effectAllowed = "copyMove");)/,
'if (!TST.tabbarDNDObserver.canDropTab(arguments[0])) {' + 'if (!TST.tabbarDNDObserver.canDropTab(arguments[0])) {\n' +
' return dt.effectAllowed = "none";' + ' return dt.effectAllowed = "none";\n' +
'}' + '}\n' +
'$1' '$1'
).replace( ).replace(
'sourceNode.parentNode == this &&', 'sourceNode.parentNode == this &&',
@ -140,14 +140,14 @@ var TreeStyleTabWindowHelper = {
eval('nsContextMenu.prototype.openLinkInTab = '+ eval('nsContextMenu.prototype.openLinkInTab = '+
nsContextMenu.prototype.openLinkInTab.toSource().replace( nsContextMenu.prototype.openLinkInTab.toSource().replace(
'{', '{',
'{' + '{\n' +
' TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);' ' TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);'
) )
); );
eval('nsContextMenu.prototype.openFrameInTab = '+ eval('nsContextMenu.prototype.openFrameInTab = '+
nsContextMenu.prototype.openFrameInTab.toSource().replace( nsContextMenu.prototype.openFrameInTab.toSource().replace(
'{', '{',
'{' + '{\n' +
' TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);' ' TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);'
) )
); );
@ -344,8 +344,8 @@ var TreeStyleTabWindowHelper = {
searchbar.doSearch.toSource().toSource().indexOf('TreeStyleTabService') < 0) { searchbar.doSearch.toSource().toSource().indexOf('TreeStyleTabService') < 0) {
eval('searchbar.doSearch = '+searchbar.doSearch.toSource().replace( eval('searchbar.doSearch = '+searchbar.doSearch.toSource().replace(
/(openUILinkIn\(.+?\);)/, /(openUILinkIn\(.+?\);)/,
'TreeStyleTabService.onBeforeBrowserSearch(arguments[0]);' + 'TreeStyleTabService.onBeforeBrowserSearch(arguments[0]);\n' +
'$1' + '$1\n' +
'TreeStyleTabService.stopToOpenChildTab();' 'TreeStyleTabService.stopToOpenChildTab();'
)); ));
} }
@ -408,22 +408,22 @@ var TreeStyleTabWindowHelper = {
'tabPos + 1', 'nextTab._tPos' 'tabPos + 1', 'nextTab._tPos'
).replace( ).replace(
'this.moveTabTo(', 'this.moveTabTo(',
'var descendant = this.treeStyleTab.getDescendantTabs(nextTab);' + 'var descendant = this.treeStyleTab.getDescendantTabs(nextTab);\n' +
'if (descendant.length) {' + 'if (descendant.length) {\n' +
' nextTab = descendant[descendant.length-1];' + ' nextTab = descendant[descendant.length-1];\n' +
'}' + '}\n' +
'$&' '$&'
).replace( ).replace(
'this.moveTabToStart();', 'this.moveTabToStart();',
'this.treeStyleTab.internallyTabMovingCount++;' + 'this.treeStyleTab.internallyTabMovingCount++;\n' +
'var parentTab = this.treeStyleTab.getParentTab(this.mCurrentTab);' + 'var parentTab = this.treeStyleTab.getParentTab(this.mCurrentTab);\n' +
'if (parentTab) {' + 'if (parentTab) {\n' +
' this.moveTabTo(this.mCurrentTab, this.treeStyleTab.getFirstChildTab(parentTab)._tPos);' + ' this.moveTabTo(this.mCurrentTab, this.treeStyleTab.getFirstChildTab(parentTab)._tPos);\n' +
' this.mCurrentTab.focus();' + ' this.mCurrentTab.focus();\n' +
'}' + '}\n' +
'else {' + 'else {\n' +
' $&' + ' $&\n' +
'}' + '}\n' +
'this.treeStyleTab.internallyTabMovingCount--;' 'this.treeStyleTab.internallyTabMovingCount--;'
) )
); );
@ -438,15 +438,15 @@ var TreeStyleTabWindowHelper = {
'tabPos - 1', 'prevTab._tPos' 'tabPos - 1', 'prevTab._tPos'
).replace( ).replace(
'this.moveTabToEnd();', 'this.moveTabToEnd();',
'this.treeStyleTab.internallyTabMovingCount++;' + 'this.treeStyleTab.internallyTabMovingCount++;\n' +
'var parentTab = this.treeStyleTab.getParentTab(this.mCurrentTab);' + 'var parentTab = this.treeStyleTab.getParentTab(this.mCurrentTab);\n' +
'if (parentTab) {' + 'if (parentTab) {\n' +
' this.moveTabTo(this.mCurrentTab, this.treeStyleTab.getLastChildTab(parentTab)._tPos);' + ' this.moveTabTo(this.mCurrentTab, this.treeStyleTab.getLastChildTab(parentTab)._tPos);\n' +
' this.mCurrentTab.focus();' + ' this.mCurrentTab.focus();\n' +
'}' + '}\n' +
'else {' + 'else {\n' +
' $&' + ' $&\n' +
'}' + '}\n' +
'this.treeStyleTab.internallyTabMovingCount--;' 'this.treeStyleTab.internallyTabMovingCount--;'
) )
); );
@ -454,18 +454,18 @@ var TreeStyleTabWindowHelper = {
eval('b.loadTabs = '+ eval('b.loadTabs = '+
b.loadTabs.toSource().replace( b.loadTabs.toSource().replace(
'var tabNum = ', 'var tabNum = ',
'if (this.treeStyleTab.readiedToAttachNewTabGroup)' + 'if (this.treeStyleTab.readiedToAttachNewTabGroup)\n' +
' TreeStyleTabService.readyToOpenChildTab(firstTabAdded || this.selectedTab, true);' + ' TreeStyleTabService.readyToOpenChildTab(firstTabAdded || this.selectedTab, true);\n' +
'$&' '$&'
).replace( ).replace(
'if (!aLoadInBackground)', 'if (!aLoadInBackground)',
'if (TreeStyleTabService.checkToOpenChildTab(this))' + 'if (TreeStyleTabService.checkToOpenChildTab(this))\n' +
' TreeStyleTabService.stopToOpenChildTab(this);' + ' TreeStyleTabService.stopToOpenChildTab(this);\n' +
'$&' '$&'
).replace( ).replace(
'this.selectedTab = firstTabAdded;', 'this.selectedTab = firstTabAdded;',
'this.selectedTab = aURIs[0].indexOf("about:treestyletab-group") < 0 ? ' + 'this.selectedTab = aURIs[0].indexOf("about:treestyletab-group") < 0 ? \n' +
' firstTabAdded :' + ' firstTabAdded :\n' +
' TreeStyleTabService.getNextTab(firstTabAdded) ;' ' TreeStyleTabService.getNextTab(firstTabAdded) ;'
) )
); );
@ -497,9 +497,9 @@ var TreeStyleTabWindowHelper = {
eval('b.mTabContainer.advanceSelectedTab = '+ eval('b.mTabContainer.advanceSelectedTab = '+
source.replace( source.replace(
'{', '{',
'{' + '{\n' +
' var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;' + ' var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;\n' +
' if (treeStyleTab.handleAdvanceSelectedTab(arguments[0], arguments[1]))' + ' if (treeStyleTab.handleAdvanceSelectedTab(arguments[0], arguments[1]))\n' +
' return;' ' return;'
) )
); );
@ -510,10 +510,10 @@ var TreeStyleTabWindowHelper = {
eval('b.mTabContainer._notifyBackgroundTab = '+ eval('b.mTabContainer._notifyBackgroundTab = '+
source.replace( source.replace(
'{', '{',
'{' + '{\n' +
' var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;' + ' var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;\n' +
' if (treeStyleTab.scrollToNewTabMode == 0 ||' + ' if (treeStyleTab.scrollToNewTabMode == 0 ||\n' +
' treeStyleTab.shouldCancelEnsureElementIsVisible())' + ' treeStyleTab.shouldCancelEnsureElementIsVisible())\n' +
' return;' ' return;'
).replace( ).replace(
/\.screenX/g, '[treeStyleTab.screenPositionProp]' /\.screenX/g, '[treeStyleTab.screenPositionProp]'
@ -556,14 +556,14 @@ var TreeStyleTabWindowHelper = {
eval('scrollbox.ensureElementIsVisible = '+ eval('scrollbox.ensureElementIsVisible = '+
source.replace( source.replace(
'{', '{',
'{' + '{\n' +
' var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;' + ' var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;\n' +
' if (treeStyleTab && treeStyleTab.shouldCancelEnsureElementIsVisible())' + ' if (treeStyleTab && treeStyleTab.shouldCancelEnsureElementIsVisible())\n' +
' return;' + ' return;\n' +
' if (' + ' if (\n' +
' treeStyleTab &&' + ' treeStyleTab &&\n' +
' (arguments.length == 1 || arguments[1])' + ' (arguments.length == 1 || arguments[1])\n' +
' )' + ' )\n' +
' return treeStyleTab.scrollToTab(arguments[0]);' ' return treeStyleTab.scrollToTab(arguments[0]);'
) )
); );

View File

@ -45,36 +45,36 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
eval('permaTabs.showPermaTab = '+ eval('permaTabs.showPermaTab = '+
permaTabs.showPermaTab.toSource().replace( permaTabs.showPermaTab.toSource().replace(
/(\}\)?)$/, /(\}\)?)$/,
'(function(tab, id) {' + '(function(tab, id) {\n' +
' if (this.ssWillRestore) return;' + ' if (this.ssWillRestore) return;\n' +
' var TST = TreeStyleTabService;' + ' var TST = TreeStyleTabService;\n' +
' if (this.TSTRestoredPermaTabsInfo === void(0)) {' + ' if (this.TSTRestoredPermaTabsInfo === void(0)) {\n' +
' try {' + ' try {\n' +
' eval("this.TSTRestoredPermaTabsInfo = "+(TST.getTreePref("permaTabsInfo") || "null"));' + ' eval("this.TSTRestoredPermaTabsInfo = "+(TST.getTreePref("permaTabsInfo") || "null"));\n' +
' }' + ' }\n' +
' catch(e) {' + ' catch(e) {\n' +
' }' + ' }\n' +
' }' + ' }\n' +
' if (!this.TSTRestoredPermaTabsInfo) return;' + ' if (!this.TSTRestoredPermaTabsInfo) return;\n' +
' var info = this.TSTRestoredPermaTabsInfo[id];' + ' var info = this.TSTRestoredPermaTabsInfo[id];\n' +
' if (!info) return;' + ' if (!info) return;\n' +
' for (var i in info)' + ' for (var i in info)\n' +
' {' + ' {\n' +
' TST.SessionStore.setTabValue(tab, i, info[i]);' + ' TST.SessionStore.setTabValue(tab, i, info[i]);\n' +
' }' + ' }\n' +
' var count = 0;' + ' var count = 0;\n' +
' window.setTimeout(function() {' + ' window.setTimeout(function() {\n' +
' var b = TST.getTabBrowserFromChild(tab);' + ' var b = TST.getTabBrowserFromChild(tab);\n' +
' if (!b.treeStyleTab) {' + ' if (!b.treeStyleTab) {\n' +
' if (++count < 50)' + ' if (++count < 50)\n' +
' window.setTimeout(arguments.callee, 100);' + ' window.setTimeout(arguments.callee, 100);\n' +
' return;' + ' return;\n' +
' }' + ' }\n' +
' b.treeStyleTab.handleRestoredTab(tab);' + ' b.treeStyleTab.handleRestoredTab(tab);\n' +
' }, 0);' + ' }, 0);\n' +
'}).call(this, tab, id)' + '}).call(this, tab, id)\n' +
'$1' '$1'
) )
); );
@ -83,25 +83,25 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
eval('permaTabs.savePermaTabs = '+ eval('permaTabs.savePermaTabs = '+
permaTabs.savePermaTabs.toSource().replace( permaTabs.savePermaTabs.toSource().replace(
'{', '{',
'{' + '{\n' +
'(function() {' + '(function() {\n' +
' var tabsInfo = {};' + ' var tabsInfo = {};\n' +
' var TST = TreeStyleTabService;' + ' var TST = TreeStyleTabService;\n' +
' var allTabs = getBrowser().mTabContainer.childNodes;' + ' var allTabs = getBrowser().mTabContainer.childNodes;\n' +
' for (let i = 0, maxi = allTabs.length; i < maxi; i++)' + ' for (let i = 0, maxi = allTabs.length; i < maxi; i++)\n' +
' {' + ' {\n' +
' let tab = allTabs[i];' + ' let tab = allTabs[i];\n' +
' let index = this.getPermaTabLocalIndex(tab);' + ' let index = this.getPermaTabLocalIndex(tab);\n' +
' if (index < 0) continue;' + ' if (index < 0) continue;\n' +
' let info = {};' + ' let info = {};\n' +
' for (let i = 0, maxi = TST.extraProperties.length; i < maxi; i++)' + ' for (let i = 0, maxi = TST.extraProperties.length; i < maxi; i++)\n' +
' {' + ' {\n' +
' let property = TST.extraProperties[i];' + ' let property = TST.extraProperties[i];\n' +
' info[property] = TST.getTabValue(tab, property);' + ' info[property] = TST.getTabValue(tab, property);\n' +
' }' + ' }\n' +
' tabsInfo[this.permaTabs[index].id] = info;' + ' tabsInfo[this.permaTabs[index].id] = info;\n' +
' }' + ' }\n' +
' TST.setTreePref("permaTabsInfo", tabsInfo.toSource());' + ' TST.setTreePref("permaTabsInfo", tabsInfo.toSource());\n' +
'}).call(this);' '}).call(this);'
) )
); );
@ -127,52 +127,52 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
eval('sessionData.getTabProperties = '+ eval('sessionData.getTabProperties = '+
sessionData.getTabProperties.toSource().replace( sessionData.getTabProperties.toSource().replace(
'return tabProperties;', 'return tabProperties;',
' for (let i = 0, maxi = this.tabTSTProperties.length; i < maxi; i++)' + ' for (let i = 0, maxi = this.tabTSTProperties.length; i < maxi; i++)\n' +
' {' + ' {\n' +
' let property = this.tabTSTProperties[i];' + ' let property = this.tabTSTProperties[i];\n' +
' tabProperties += "|" + property + "=" + encodeURIComponent(aTab.getAttribute(property));' + ' tabProperties += "|" + property + "=" + encodeURIComponent(aTab.getAttribute(property));\n' +
' }' + ' }\n' +
'$&' '$&'
) )
); );
eval('sessionData.setTabProperties = '+ eval('sessionData.setTabProperties = '+
sessionData.setTabProperties.toSource().replace( sessionData.setTabProperties.toSource().replace(
'{', '{',
'$&' + '$&\n' +
' var TSTProps = tabProperties.split("|");' + ' var TSTProps = tabProperties.split("|");\n' +
' tabProperties = TSTProps.shift();' + ' tabProperties = TSTProps.shift();\n' +
' for (let i = 0, maxi = TSTProps.length; i < maxi; i++)' + ' for (let i = 0, maxi = TSTProps.length; i < maxi; i++)\n' +
' {' + ' {\n' +
' let property = TSTProps[i];' + ' let property = TSTProps[i];\n' +
' let index = property.indexOf("=");' + ' let index = property.indexOf("=");\n' +
' let name = property.substring(0, index);' + ' let name = property.substring(0, index);\n' +
' let value = decodeURIComponent(property.substring(index+1));' + ' let value = decodeURIComponent(property.substring(index+1));\n' +
' if (name && value)' + ' if (name && value)\n' +
' aTab.setAttribute(name, value);' + ' aTab.setAttribute(name, value);\n' +
' }' ' }'
) )
); );
eval('sessionManager.loadOneTab = '+ eval('sessionManager.loadOneTab = '+
sessionManager.loadOneTab.toSource().replace( sessionManager.loadOneTab.toSource().replace(
/(\}\))?$/, /(\}\))?$/,
' if (gBrowser.treeStyleTab.useTMPSessionAPI)' + ' if (gBrowser.treeStyleTab.useTMPSessionAPI)\n' +
' gBrowser.treeStyleTab.handleRestoredTab(aTab);' + ' gBrowser.treeStyleTab.handleRestoredTab(aTab);\n' +
'$1' '$1'
) )
); );
let source = tablib.init.toSource().split('gBrowser.restoreTab = '); let source = tablib.init.toSource().split('gBrowser.restoreTab = ');
source[1] = source[1].replace( source[1] = source[1].replace(
'return newTab;', 'return newTab;',
' if (this.treeStyleTab.useTMPSessionAPI)' + ' if (this.treeStyleTab.useTMPSessionAPI)\n' +
' this.treeStyleTab.handleRestoredTab(newTab);' + ' this.treeStyleTab.handleRestoredTab(newTab);\n' +
'$&' '$&'
); );
eval('tablib.init = '+source.join('gBrowser.restoreTab = ')); eval('tablib.init = '+source.join('gBrowser.restoreTab = '));
eval('sessionManager.loadOneWindow = '+ eval('sessionManager.loadOneWindow = '+
sessionManager.loadOneWindow.toSource().replace( sessionManager.loadOneWindow.toSource().replace(
'gBrowser.tabsToLoad = ', 'gBrowser.tabsToLoad = ',
' gBrowser.treeStyleTab.resetAllTabs(true, true);' + ' gBrowser.treeStyleTab.resetAllTabs(true, true);\n' +
' TreeStyleTabService.restoringTree = true;' + ' TreeStyleTabService.restoringTree = true;\n' +
'$&' '$&'
).replace( ).replace(
/(\}\))?$/, /(\}\))?$/,
@ -198,15 +198,15 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
if ('load' in gSessionManager) { if ('load' in gSessionManager) {
eval('gSessionManager.load = '+gSessionManager.load.toSource().replace( eval('gSessionManager.load = '+gSessionManager.load.toSource().replace(
'var tabcount = ', 'var tabcount = ',
' gBrowser.treeStyleTab.collapseExpandAllSubtree(false, true);' + ' gBrowser.treeStyleTab.collapseExpandAllSubtree(false, true);\n' +
' let (tabs = gBrowser.treeStyleTab.getTabs(gBrowser).slice(1).reverse()) {' + ' let (tabs = gBrowser.treeStyleTab.getTabs(gBrowser).slice(1).reverse()) {\n' +
' for (let i = 0, maxi = tabs.length; i < maxi; i++)' + ' for (let i = 0, maxi = tabs.length; i < maxi; i++)\n' +
' {' + ' {\n' +
' let tab = tabs[i];' + ' let tab = tabs[i];\n' +
' gBrowser.removeTab(tab);' + ' gBrowser.removeTab(tab);\n' +
' }' + ' }\n' +
' }' + ' }\n' +
' TreeStyleTabService.restoringTree = true;' + ' TreeStyleTabService.restoringTree = true;\n' +
'$&' '$&'
)); ));
} }
@ -281,20 +281,20 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
sv.getTreePref('compatibility.OptimozTweaks')) { sv.getTreePref('compatibility.OptimozTweaks')) {
eval('window.mtSidebarStartup = '+window.mtSidebarStartup.toSource().replace( eval('window.mtSidebarStartup = '+window.mtSidebarStartup.toSource().replace(
'{', '{',
'{' + '{\n' +
' document.getElementById("TabsToolbar")' + ' document.getElementById("TabsToolbar")\n' +
' .addEventListener("mousemove", mtMouseMoveListener, false);' ' .addEventListener("mousemove", mtMouseMoveListener, false);'
)); ));
eval('window.mtSidebarShutdown = '+window.mtSidebarShutdown.toSource().replace( eval('window.mtSidebarShutdown = '+window.mtSidebarShutdown.toSource().replace(
'{', '{',
'{' + '{\n' +
' document.getElementById("TabsToolbar")' + ' document.getElementById("TabsToolbar")\n' +
' .removeEventListener("mousemove", mtMouseMoveListener, false);' ' .removeEventListener("mousemove", mtMouseMoveListener, false);'
)); ));
eval('window.mtPreventHiding = '+window.mtPreventHiding.toSource().replace( eval('window.mtPreventHiding = '+window.mtPreventHiding.toSource().replace(
'{', '{',
'{' + '{\n' +
' if (TreeStyleTabService.getTabbarFromEvent(arguments[0]))' + ' if (TreeStyleTabService.getTabbarFromEvent(arguments[0]))\n' +
' return;' ' return;'
)); ));
} }
@ -307,7 +307,7 @@ TreeStyleTabWindowHelper.overrideExtensionsPreInit = function TSTWH_overrideExte
'do_alter' in HideCaption) { 'do_alter' in HideCaption) {
eval('HideCaption.do_alter = '+HideCaption.do_alter.toSource().replace( eval('HideCaption.do_alter = '+HideCaption.do_alter.toSource().replace(
'if (!theSettings) {', 'if (!theSettings) {',
' if (!theSettings ||' + ' if (!theSettings ||\n' +
' gBrowser.treeStyleTab.isVertical) {' ' gBrowser.treeStyleTab.isVertical) {'
)); ));
} }
@ -337,9 +337,9 @@ TreeStyleTabWindowHelper.overrideExtensionsBeforeBrowserInit = function TSTWH_ov
'boxObject[sizeProp]' 'boxObject[sizeProp]'
).replace( ).replace(
'{', '{',
'{' + '{\n' +
' var posProp = gBrowser.treeStyleTab.isVertical ? "y" : "x" ;' + ' var posProp = gBrowser.treeStyleTab.isVertical ? "y" : "x" ;\n' +
' var screenPosProp = gBrowser.treeStyleTab.isVertical ? "screenY" : "screenX" ;' + ' var screenPosProp = gBrowser.treeStyleTab.isVertical ? "screenY" : "screenX" ;\n' +
' var sizeProp = gBrowser.treeStyleTab.isVertical ? "height" : "width" ;' ' var sizeProp = gBrowser.treeStyleTab.isVertical ? "height" : "width" ;'
) )
} }
@ -383,11 +383,11 @@ TreeStyleTabWindowHelper.overrideExtensionsBeforeBrowserInit = function TSTWH_ov
eval('tabberwocky.openSelectedLinks = '+ eval('tabberwocky.openSelectedLinks = '+
tabberwocky.openSelectedLinks.toSource().replace( tabberwocky.openSelectedLinks.toSource().replace(
'links.forEach(', 'links.forEach(',
' TreeStyleTabService.readyToOpenChildTab(aFrame, true)' + ' TreeStyleTabService.readyToOpenChildTab(aFrame, true)\n' +
'$&' '$&'
).replace( ).replace(
/(\}\)?)$/, /(\}\)?)$/,
' TreeStyleTabService.stopToOpenChildTab(aFrame)' + ' TreeStyleTabService.stopToOpenChildTab(aFrame)\n' +
'$1' '$1'
) )
); );
@ -406,8 +406,8 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('selectionlinks.parseSelection = '+ eval('selectionlinks.parseSelection = '+
selectionlinks.parseSelection.toSource().replace( selectionlinks.parseSelection.toSource().replace(
/((?:[^\s:;]+.selectedTab\s*=\s*)?([^\s:;]+).addTab\()/g, /((?:[^\s:;]+.selectedTab\s*=\s*)?([^\s:;]+).addTab\()/g,
' if ($2.treeStyleTab)' + ' if ($2.treeStyleTab)\n' +
' $2.treeStyleTab.readyToOpenChildTab(focusedWindow);' + ' $2.treeStyleTab.readyToOpenChildTab(focusedWindow);\n' +
'$1' '$1'
) )
); );
@ -430,7 +430,7 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('DNDObserver.onDragStart = '+ eval('DNDObserver.onDragStart = '+
DNDObserver.onDragStart.toSource().replace( DNDObserver.onDragStart.toSource().replace(
'event.target.localName != "tab"', 'event.target.localName != "tab"',
' gBrowser.treeStyleTab.tabbarDNDObserver.canDragTabbar(event) ||' + ' gBrowser.treeStyleTab.tabbarDNDObserver.canDragTabbar(event) ||\n' +
' $&' ' $&'
) )
); );
@ -491,9 +491,9 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('superDrag.onDrop = '+ eval('superDrag.onDrop = '+
superDrag.onDrop.toSource().replace( superDrag.onDrop.toSource().replace(
/(var newTab = getBrowser\(\).addTab\([^\)]+\);)/g, /(var newTab = getBrowser\(\).addTab\([^\)]+\);)/g,
' if (aDragSession.sourceNode &&' + ' if (aDragSession.sourceNode &&\n' +
' aDragSession.sourceNode.ownerDocument.defaultView.top == getBrowser().contentWindow)' + ' aDragSession.sourceNode.ownerDocument.defaultView.top == getBrowser().contentWindow)\n' +
' TreeStyleTabService.readyToOpenChildTab(getBrowser());' + ' TreeStyleTabService.readyToOpenChildTab(getBrowser());\n' +
' $1' ' $1'
) )
); );
@ -506,15 +506,15 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('ddg_ges.Open = '+ eval('ddg_ges.Open = '+
ddg_ges.Open.toSource().replace( ddg_ges.Open.toSource().replace(
'if (mode[1] == "h" || mode[1] == "f") {', 'if (mode[1] == "h" || mode[1] == "f") {',
'$&' + '$&\n' +
' if ("sourceNode" in aData) // only for dragging from the content tarea.' + ' if ("sourceNode" in aData) // only for dragging from the content tarea.\n' +
' TreeStyleTabService.readyToOpenChildTab(getBrowser());' ' TreeStyleTabService.readyToOpenChildTab(getBrowser());'
) )
); );
eval('ddg_ges.Search = '+ eval('ddg_ges.Search = '+
ddg_ges.Search.toSource().replace( ddg_ges.Search.toSource().replace(
'if (mode[1] == "h" || mode[1] == "f") {', 'if (mode[1] == "h" || mode[1] == "f") {',
'$&' + '$&\n' +
' TreeStyleTabService.readyToOpenChildTab(getBrowser());' ' TreeStyleTabService.readyToOpenChildTab(getBrowser());'
) )
); );
@ -607,38 +607,38 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
eval('FireGestures.onExtraGesture = '+ eval('FireGestures.onExtraGesture = '+
FireGestures.onExtraGesture.toSource().replace( FireGestures.onExtraGesture.toSource().replace(
'case "keypress-stop":', 'case "keypress-stop":',
'$&' + '$&\n' +
' TreeStyleTabService.readyToOpenChildTab(gBrowser, true);' ' TreeStyleTabService.readyToOpenChildTab(gBrowser, true);'
).replace( ).replace(
'break;case "gesture-timeout":', 'break;case "gesture-timeout":',
' TreeStyleTabService.stopToOpenChildTab(gBrowser);' + ' TreeStyleTabService.stopToOpenChildTab(gBrowser);\n' +
'$&' '$&'
) )
); );
eval('FireGestures._performAction = '+ eval('FireGestures._performAction = '+
FireGestures._performAction.toSource().replace( FireGestures._performAction.toSource().replace(
'gBrowser.loadOneTab(', 'gBrowser.loadOneTab(',
' TreeStyleTabService.readyToOpenChildTab(gBrowser);' + ' TreeStyleTabService.readyToOpenChildTab(gBrowser);\n' +
'$&' '$&'
) )
); );
eval('FireGestures.openURLsInSelection = '+ eval('FireGestures.openURLsInSelection = '+
FireGestures.openURLsInSelection.toSource().replace( FireGestures.openURLsInSelection.toSource().replace(
'var tab =', 'var tab =',
' if (!TreeStyleTabService.checkToOpenChildTab(gBrowser))' + ' if (!TreeStyleTabService.checkToOpenChildTab(gBrowser))\n' +
' TreeStyleTabService.readyToOpenChildTab(gBrowser, true);' + ' TreeStyleTabService.readyToOpenChildTab(gBrowser, true);\n' +
'$&' '$&'
).replace( ).replace(
'if (!flag)', 'if (!flag)',
' if (TreeStyleTabService.checkToOpenChildTab(gBrowser))' + ' if (TreeStyleTabService.checkToOpenChildTab(gBrowser))\n' +
' TreeStyleTabService.stopToOpenChildTab(gBrowser);' + ' TreeStyleTabService.stopToOpenChildTab(gBrowser);\n' +
'$&' '$&'
) )
); );
eval('FireGestures.handleEvent = '+ eval('FireGestures.handleEvent = '+
FireGestures.handleEvent.toSource().replace( FireGestures.handleEvent.toSource().replace(
'gBrowser.loadOneTab(', 'gBrowser.loadOneTab(',
' TreeStyleTabService.readyToOpenChildTab(gBrowser);' + ' TreeStyleTabService.readyToOpenChildTab(gBrowser);\n' +
'$&' '$&'
) )
); );
@ -891,27 +891,27 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
if ('MoveContent' in autoHIDE) { if ('MoveContent' in autoHIDE) {
eval('autoHIDE.MoveContent = '+autoHIDE.MoveContent.toSource().replace( eval('autoHIDE.MoveContent = '+autoHIDE.MoveContent.toSource().replace(
/(;)([^;]*\.setPosition\(0, -\s*ah\.delta\);)/, /(;)([^;]*\.setPosition\(0, -\s*ah\.delta\);)/,
'$1' + '$1\n' +
' if (autoHIDE.winUtil)' + ' if (autoHIDE.winUtil)\n' +
' autoHIDE.winUtil.setRedraw(false, false);' + ' autoHIDE.winUtil.setRedraw(false, false);\n' +
' $2' + ' $2\n' +
' gBrowser.treeStyleTab.autoHide.extraYOffset = ah.delta;' + ' gBrowser.treeStyleTab.autoHide.extraYOffset = ah.delta;\n' +
' window.setTimeout(function() {' + ' window.setTimeout(function() {\n' +
' gBrowser.treeStyleTab.autoHide.redrawContentArea();' + ' gBrowser.treeStyleTab.autoHide.redrawContentArea();\n' +
' if (autoHIDE.winUtil)' + ' if (autoHIDE.winUtil)\n' +
' autoHIDE.winUtil.setRedraw(true, false);' + ' autoHIDE.winUtil.setRedraw(true, false);\n' +
' }, 0);' ' }, 0);'
).replace( ).replace(
/(;)([^;]*\.setPosition\(0, 0\);)/, /(;)([^;]*\.setPosition\(0, 0\);)/,
'$1' + '$1\n' +
' if (autoHIDE.winUtil)' + ' if (autoHIDE.winUtil)\n' +
' autoHIDE.winUtil.setRedraw(false, false);' + ' autoHIDE.winUtil.setRedraw(false, false);\n' +
' $2' + ' $2\n' +
' gBrowser.treeStyleTab.autoHide.extraYOffset = 0;' + ' gBrowser.treeStyleTab.autoHide.extraYOffset = 0;\n' +
' window.setTimeout(function() {' + ' window.setTimeout(function() {\n' +
' gBrowser.treeStyleTab.autoHide.redrawContentArea();' + ' gBrowser.treeStyleTab.autoHide.redrawContentArea();\n' +
' if (autoHIDE.winUtil)' + ' if (autoHIDE.winUtil)\n' +
' autoHIDE.winUtil.setRedraw(true, false);' + ' autoHIDE.winUtil.setRedraw(true, false);\n' +
' }, 0);' ' }, 0);'
)); ));
} }
@ -929,18 +929,18 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
if (func.indexOf('treeStyleTab') < 0) { if (func.indexOf('treeStyleTab') < 0) {
eval('sidewikiWindowHandler.barsContainer_.geometry_.__proto__.getWindowSizeForDrawers = '+func.replace( eval('sidewikiWindowHandler.barsContainer_.geometry_.__proto__.getWindowSizeForDrawers = '+func.replace(
'return {', 'return {',
' if ("treeStyleTab" in this.topLevelDocument_.getElementById("content")) {' + ' if ("treeStyleTab" in this.topLevelDocument_.getElementById("content")) {\n' +
' let b = this.topLevelDocument_.getElementById("content");' + ' let b = this.topLevelDocument_.getElementById("content");\n' +
' let box = b.mPanelContainer.boxObject;' + ' let box = b.mPanelContainer.boxObject;\n' +
' return {' + ' return {\n' +
' height : box.height,' + ' height : box.height,\n' +
' width : box.width,' + ' width : box.width,\n' +
' top : box.y,' + ' top : box.y,\n' +
' left : box.x,' + ' left : box.x,\n' +
' right : this.topLevelWindow_.innerWidth - box.x - box.width,' + ' right : this.topLevelWindow_.innerWidth - box.x - box.width,\n' +
' tabBoxHeight : 0' + ' tabBoxHeight : 0\n' +
' };' + ' };\n' +
' }' + ' }\n' +
'$&' '$&'
)); ));
} }
@ -963,9 +963,9 @@ TreeStyleTabWindowHelper.overrideExtensionsAfterBrowserInit = function TSTWH_ove
'[maxSizeProp]' '[maxSizeProp]'
).replace( ).replace(
'{', '{',
'{' + '{\n' +
' var scrollProp = gBrowser.treeStyleTab.isVertical ? "scrollHeight" : "scrollWidth" ;' + ' var scrollProp = gBrowser.treeStyleTab.isVertical ? "scrollHeight" : "scrollWidth" ;\n' +
' var sizeProp = gBrowser.treeStyleTab.isVertical ? "height" : "width" ;' + ' var sizeProp = gBrowser.treeStyleTab.isVertical ? "height" : "width" ;\n' +
' var maxSizeProp = gBrowser.treeStyleTab.isVertical ? "maxHeight" : "maxWidth" ;' ' var maxSizeProp = gBrowser.treeStyleTab.isVertical ? "maxHeight" : "maxWidth" ;'
) )
} }
@ -1181,18 +1181,18 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte
eval('gBrowser.TMP_openTabNext = '+ eval('gBrowser.TMP_openTabNext = '+
gBrowser.TMP_openTabNext.toSource().replace( gBrowser.TMP_openTabNext.toSource().replace(
'this.mCurrentTab._tPos + this.tabContainer.nextTab', 'this.mCurrentTab._tPos + this.tabContainer.nextTab',
' (function() {' + ' (function() {\n' +
' var tabs = this.treeStyleTab.getDescendantTabs(this.mCurrentTab);' + ' var tabs = this.treeStyleTab.getDescendantTabs(this.mCurrentTab);\n' +
' if (tabs.length) {' + ' if (tabs.length) {\n' +
' var index = this.treeStyleTab.getPref("extensions.tabmix.openTabNextInverse") ?' + ' var index = this.treeStyleTab.getPref("extensions.tabmix.openTabNextInverse") ?\n' +
' tabs[tabs.length - 1]._tPos :' + ' tabs[tabs.length - 1]._tPos :\n' +
' this.mCurrentTab._tPos ;' + ' this.mCurrentTab._tPos ;\n' +
' if (index < aTab._tPos) index++;' + ' if (index < aTab._tPos) index++;\n' +
' return index;' + ' return index;\n' +
' }' + ' }\n' +
' else {' + ' else {\n' +
' return ($&);' + ' return ($&);\n' +
' }' + ' }\n' +
' }).call(this)' ' }).call(this)'
) )
); );
@ -1209,13 +1209,13 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte
eval('MultiLinks_Wrapper.LinksManager.OpenInNewTabs = '+ eval('MultiLinks_Wrapper.LinksManager.OpenInNewTabs = '+
MultiLinks_Wrapper.LinksManager.OpenInNewTabs.toSource().replace( MultiLinks_Wrapper.LinksManager.OpenInNewTabs.toSource().replace(
'{', '{',
'{' + '{\n' +
' if (!TreeStyleTabService.checkToOpenChildTab(getBrowser()))' + ' if (!TreeStyleTabService.checkToOpenChildTab(getBrowser()))\n' +
' TreeStyleTabService.readyToOpenChildTab(getBrowser(), true);' ' TreeStyleTabService.readyToOpenChildTab(getBrowser(), true);'
).replace( ).replace(
/(\}\)?)$/, /(\}\)?)$/,
' if (TreeStyleTabService.checkToOpenChildTab(getBrowser()))' + ' if (TreeStyleTabService.checkToOpenChildTab(getBrowser()))\n' +
' TreeStyleTabService.stopToOpenChildTab(getBrowser());' + ' TreeStyleTabService.stopToOpenChildTab(getBrowser());\n' +
'$1' '$1'
) )
); );

View File

@ -1414,7 +1414,7 @@ var TreeStyleTabBase = {
getTabbarFromChild : function TSTUtils_getTabbarFromChild(aNode) getTabbarFromChild : function TSTUtils_getTabbarFromChild(aNode)
{ {
return this.evaluateXPath( return this.evaluateXPath(
'ancestor-or-self::*[contains(concat(" ", normalize-space(@class), " "), " tabbrowser-strip ")] | '+ 'ancestor-or-self::*[contains(concat(" ", normalize-space(@class), " "), " tabbrowser-strip ")] | ' +
'ancestor-or-self::xul:tabs[@tabbrowser] | ' + 'ancestor-or-self::xul:tabs[@tabbrowser] | ' +
'ancestor-or-self::xul:toolbar/child::xul:tabs[@tabbrowser]', 'ancestor-or-self::xul:toolbar/child::xul:tabs[@tabbrowser]',
aNode, aNode,
@ -1424,7 +1424,7 @@ var TreeStyleTabBase = {
getAncestorTabbarFromChild : function TSTUtils_getAncestorTabbarFromChild(aNode) getAncestorTabbarFromChild : function TSTUtils_getAncestorTabbarFromChild(aNode)
{ {
return this.evaluateXPath( return this.evaluateXPath(
'ancestor-or-self::*[contains(concat(" ", normalize-space(@class), " "), " tabbrowser-strip ")] | '+ 'ancestor-or-self::*[contains(concat(" ", normalize-space(@class), " "), " tabbrowser-strip ")] | ' +
'ancestor-or-self::xul:tabs[@tabbrowser]', 'ancestor-or-self::xul:tabs[@tabbrowser]',
aNode, aNode,
Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE

View File

@ -647,8 +647,8 @@ TreeStyleTabBrowser.prototype = {
let pi = d.createProcessingInstruction( let pi = d.createProcessingInstruction(
'xml-stylesheet', 'xml-stylesheet',
'type="text/css" href="data:text/css,'+encodeURIComponent( 'type="text/css" href="data:text/css,'+encodeURIComponent(
('.tabbrowser-tabbox > tabpanels > notificationbox {' + ('.tabbrowser-tabbox > tabpanels > notificationbox {\n' +
' background-color: %COLOR%;' + ' background-color: %COLOR%;\n' +
'}').replace(/%COLOR%/, color) '}').replace(/%COLOR%/, color)
)+'"' )+'"'
); );

View File

@ -66,20 +66,20 @@ var PseudoTreeBuilder = {
row.className += " "+this.kROOTITEM; row.className += " "+this.kROOTITEM;
tree.setAttribute('onclick', tree.setAttribute('onclick',
('var doc = event.target.ownerDocument;' + ('var doc = event.target.ownerDocument;\n' +
'var label = doc.evaluate(' + 'var label = doc.evaluate(\n' +
' "ancestor-or-self::*[local-name()=\'label\' and contains(@class, \'text-link\')][1]",' + ' "ancestor-or-self::*[local-name()=\'label\' and contains(@class, \'text-link\')][1]",\n' +
' event.target,' + ' event.target,\n' +
' null,' + ' null,\n' +
' Components.interfaces.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE,' + ' Components.interfaces.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE,\n' +
' null' + ' null\n' +
' ).singleNodeValue;' + ' ).singleNodeValue;\n' +
'if (label) {' + 'if (label) {\n' +
' var customEvent = doc.createEvent("DataContainerEvent");' + ' var customEvent = doc.createEvent("DataContainerEvent");\n' +
' customEvent.initEvent(%EVENT_TYPE%, true, true);' + ' customEvent.initEvent(%EVENT_TYPE%, true, true);\n' +
' customEvent.setData("id", label.getAttribute("tab-id"));' + ' customEvent.setData("id", label.getAttribute("tab-id"));\n' +
' customEvent.setData("sourceEvent", event);' + ' customEvent.setData("sourceEvent", event);\n' +
' event.target.dispatchEvent(customEvent);' + ' event.target.dispatchEvent(customEvent);\n' +
'}').replace('%EVENT_TYPE%', this.kTAB_LINK_CLICK.quote())); '}').replace('%EVENT_TYPE%', this.kTAB_LINK_CLICK.quote()));
return tree; return tree;