From 94c1e11844409df2ad996e22e25530af1ed0aacc Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 26 Mar 2009 15:30:00 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=89=E3=83=A9=E3=83=83=E3=82=B0=E4=B8=AD?= =?UTF-8?q?=E3=81=AF=E3=83=84=E3=83=BC=E3=83=AB=E3=83=81=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=97=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= 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@3937 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/hacks.js | 140 ++++++++++---------- content/treestyletab/treestyletab.js | 88 ++++++------ content/treestyletab/treestyletabbrowser.js | 74 ++++++----- 3 files changed, 156 insertions(+), 146 deletions(-) diff --git a/content/treestyletab/hacks.js b/content/treestyletab/hacks.js index 17a45e98..14f2fc34 100644 --- a/content/treestyletab/hacks.js +++ b/content/treestyletab/hacks.js @@ -142,11 +142,11 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('MultipleTabService.showHideMenuItems = '+ MultipleTabService.showHideMenuItems.toSource().replace( 'var separators = ', - <> + $&]]> ) ); } @@ -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)/, - <>= $1.screenY + $1.height - $3) : false - ))]]> + ))]]> ).replace( // for old version 'e.screenY > getBrowser().mCurrentBrowser.boxObject.screenY + 25', - <> gBrowser.mCurrentBrowser.boxObject.screenY + 25 && + 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', - <> yCondition && + 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)\) \{/, - <> + ]]> ) ); func = 'RemoveAttrib' in autoHIDE ? 'RemoveAttrib' : 'EndFull' ; eval('autoHIDE.'+func+' = '+ autoHIDE[func].toSource().replace( '{', - <> + ]]> ) ); eval('autoHIDE.SetMenu = '+ autoHIDE.SetMenu.toSource().replace( '{', - <> + ]]> ) ); func = 'MoveContent' in autoHIDE ? 'MoveContent' : 'MoveC' ; eval('autoHIDE.'+func+' = '+ autoHIDE[func].toSource().replace( '{', - <> + ]]> ).replace( /.(move|setPosition)\(0, - (this|ah).delta\)/, - <> + )]]> ) ); var autoHideEventListener = { @@ -305,10 +305,10 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('window.TMupdateSettings = '+ window.TMupdateSettings.toSource().replace( /(\{aTab.removeAttribute\("tabxleft"\);\})(\})/, - <> + $2]]> ) ); @@ -316,10 +316,10 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('window.tabxTabAdded = '+ window.tabxTabAdded.toSource().replace( /(\})(\)?)$/, - <> + $1$2]]> ) ); gBrowser.mTabContainer.addEventListener('DOMNodeInserted', tabxTabAdded, true); @@ -327,49 +327,49 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('window.TMP_TabDragGesture = '+ window.TMP_TabDragGesture.toSource().replace( '{', - <> + ]]> ) ); eval('window.TMP_TabDragOver = '+ window.TMP_TabDragOver.toSource().replace( '{', - <> + ]]> ) ); eval('window.TMP_TabDragDrop = '+ window.TMP_TabDragDrop.toSource().replace( '{', - <> + ]]> ) ); eval('window.TMP_TabDragExit = '+ window.TMP_TabDragExit.toSource().replace( '{', - <> + ]]> ) ); @@ -402,19 +402,19 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { 'var TSTTabBrowser = gBrowser;' ).replace( /(var newIndex =)/, - <> + ]]> ).replace( /(aTab = gBrowser.addTab\(url\));/, - <> + ]]> ).replace( /(aTab = event.target;)/, - <> + ]]> ).replace( /aEvent/g, 'event' ).replace( @@ -435,32 +435,32 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('window.TM_BrowserHome = '+ window.TM_BrowserHome.toSource().replace( /(var bgLoad = )/, - <> + ]]> ).replace( /(\})(\)?)$/, - <> + ]]> ) ); eval('window.TMP_openURL = '+ window.TMP_openURL.toSource().replace( /(var firstTab = [^\(]+\([^\)]+\))/, - <> + ]]> ).replace( /(anyBrowser.mTabContainer.nextTab)/, - <> + ]]> ) ); @@ -477,25 +477,25 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('TMP_Bookmark.openGroup = '+ TMP_Bookmark.openGroup.toSource().replace( 'index = prevTab._tPos + 1;', - <> + ]]> ).replace( /(prevTab = aTab;)/, - <> + ]]> ).replace( /(browser.mTabContainer.nextTab)/, - <> + $1]]> ) ); @@ -512,12 +512,12 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('window.getRowHeight = '+ window.getRowHeight.toSource().replace( 'var tabs = getBrowser().mTabContainer.childNodes;', - <> + ]]> ).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, - <> + ]]> ) ); } @@ -611,18 +611,18 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('ddg_ges.Open = '+ ddg_ges.Open.toSource().replace( 'if (mode[1] == "h" || mode[1] == "f") {', - <> + ]]> ) ); eval('ddg_ges.Search = '+ ddg_ges.Search.toSource().replace( 'if (mode[1] == "h" || mode[1] == "f") {', - <> + ]]> ) ); } @@ -655,45 +655,45 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { eval('FireGestures.onExtraGesture = '+ FireGestures.onExtraGesture.toSource().replace( 'case "keypress-stop":', - <> + ]]> ).replace( 'break;case "gesture-timeout":', - <> + $&]]> ) ); eval('FireGestures._performAction = '+ FireGestures._performAction.toSource().replace( 'gBrowser.loadOneTab(', - <> + $&]]> ) ); eval('FireGestures.openURLsInSelection = '+ FireGestures.openURLsInSelection.toSource().replace( 'var tab =', - <> + $&]]> ).replace( 'if (!flag)', - <> + $&]]> ) ); eval('FireGestures.handleEvent = '+ FireGestures.handleEvent.toSource().replace( 'gBrowser.loadOneTab(', - <> + $&]]> ) ); } diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index c3f3098f..7c9c4f23 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -963,12 +963,12 @@ var TreeStyleTabService = { eval('nsBrowserAccess.prototype.openURI = '+ nsBrowserAccess.prototype.openURI.toSource().replace( /(switch\s*\(aWhere\))/, - <> + $1]]> ) ); @@ -1040,7 +1040,7 @@ var TreeStyleTabService = { /\.height/g, '[TreeStyleTabService.getTabBrowserFromChild(TSTTabBrowser).treeStyleTab.invertedSizeProp]' ).replace( /(return (?:true|dt.effectAllowed = "copyMove");)/, - <> + ]]> ).replace( /TST_DRAGSESSION/g, (canDropFunctionName == 'canDrop' ? @@ -1087,7 +1087,7 @@ catch(e) { eval('aObserver.'+dragOverFunctionName+' = '+ aObserver[dragOverFunctionName].toSource().replace( '{', - <> + ]]> ).replace( /TST_DRAGSESSION/g, (canDropFunctionName == 'canDrop' ? @@ -1150,48 +1150,48 @@ catch(e) { eval('aObserver.'+dropFunctionName+' = '+ aObserver[dropFunctionName].toSource().replace( '{', - <> + ]]> ).replace( // Firefox 2 /(if \(aDragSession[^\)]+\) \{)/, - <> + ]]> ).replace( // Firefox 3.0.x, 3.1 or later /(if \((accelKeyPressed|isCopy|dropEffect == "copy")\) {)/, - <> + $1]]> ).replace( // Firefox 3, duplication of tab /(this.selectedTab = newTab;)(\s*\})?/g, - <> + $2]]> ).replace( // Firefox 3, dragging tab from another window 'else if (draggedTab) {', - <> + ]]> ).replace( /(this.loadOneTab\([^;]+\));/, - <> + ]]> ).replace( 'document.getBindingParent(aEvent.originalTarget).localName != "tab"', '!TreeStyleTabService.getTabFromEvent(aEvent)' ).replace( 'var tab = aEvent.target;', - <> + ]]> ).replace( /TST_DRAGSESSION/g, (canDropFunctionName == 'canDrop' ? @@ -1263,45 +1263,45 @@ catch(e) { eval('nsContextMenu.prototype.openLinkInTab = '+ nsContextMenu.prototype.openLinkInTab.toSource().replace( '{', - <> + ]]> ) ); eval('nsContextMenu.prototype.openFrameInTab = '+ nsContextMenu.prototype.openFrameInTab.toSource().replace( '{', - <> + ]]> ) ); var viewImageMethod = ('viewImage' in nsContextMenu.prototype) ? 'viewImage' : 'viewMedia' ; eval('nsContextMenu.prototype.'+viewImageMethod+' = '+ nsContextMenu.prototype[viewImageMethod].toSource().replace( 'openUILink(', - <> + $&]]> ) ); eval('nsContextMenu.prototype.viewBGImage = '+ nsContextMenu.prototype.viewBGImage.toSource().replace( 'openUILink(', - <> + $&]]> ) ); eval('nsContextMenu.prototype.addDictionaries = '+ nsContextMenu.prototype.addDictionaries.toSource().replace( 'openUILinkIn(', - <> + $&]]> ) ); @@ -1314,12 +1314,12 @@ catch(e) { eval('window.'+funcs[i]+' = '+ window[funcs[i]].toSource().replace( /(openNewTabWith\()/g, - <> + $1]]> ).replace( /(event.ctrlKey|event.metaKey)/, - <> + ]]> ).replace( /* あらゆるリンクからタブを開く設定の時に、アクセルキーが押されていた場合は 反転された動作(通常のリンク読み込み)を行う */ 'return false;case 1:', - <> + ]]> ) ); break; @@ -1370,7 +1370,7 @@ catch(e) { eval(aName + ' = '+ overwroteFunc.toSource().replace( /((openWebPanel\([^\;]+\);|PlacesUIUtils.showMinimalAddBookmarkUI\([^;]+\);)event.preventDefault\(\);return false;\})/, - <> + ]]> ) ); }; @@ -1410,10 +1410,10 @@ catch(e) { eval('window.'+funcs[i]+' = '+ window[funcs[i]].toSource().replace( /(openUILinkIn\()/g, - <> + $1]]> ) ); } @@ -1426,9 +1426,9 @@ catch(e) { eval(aName + ' = '+ overwroteFunc.toSource().replace( 'gBrowser.loadTabs(', - <> + $&]]> ) ); }; @@ -1440,10 +1440,10 @@ catch(e) { eval('FeedHandler.loadFeed = '+ FeedHandler.loadFeed.toSource().replace( 'openUILink(', - <> + $&]]> ) ); diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 8bb65872..3421dfb6 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -185,29 +185,29 @@ TreeStyleTabBrowser.prototype = { eval('b.mTabContainer.'+selectNewTab+' = '+ b.mTabContainer[selectNewTab].toSource().replace( '{', - <> + ]]> ) ); eval('b.mTabContainer.adjustTabstrip = '+ b.mTabContainer.adjustTabstrip.toSource().replace( /(\})(\)?)$/, - <> + $1$2]]> ) ); eval('b.mTabContainer.advanceSelectedTab = '+ b.mTabContainer.advanceSelectedTab.toSource().replace( '{', - <> + ]]> ) ); eval('b.mTabContainer._handleTabSelect = '+ b.mTabContainer._handleTabSelect.toSource().replace( '{', - <> + ]]> ) ); @@ -259,11 +259,11 @@ TreeStyleTabBrowser.prototype = { eval('b.mTabContainer.mTabstrip.ensureElementIsVisible = '+ b.mTabContainer.mTabstrip.ensureElementIsVisible.toSource().replace( '{', - <> + ]]> ).replace( /\.left/g, '[startProp]' ).replace( @@ -275,15 +275,15 @@ TreeStyleTabBrowser.prototype = { eval('b.mTabContainer.mTabstrip._smoothScrollByPixels = '+ b.mTabContainer.mTabstrip._smoothScrollByPixels.toSource().replace( '{', - <> + ]]> ).replace( 'scrollBy(distance, 0)', - <> + )]]> ) ); } @@ -320,15 +320,15 @@ TreeStyleTabBrowser.prototype = { 'tabPos + 1', 'nextTab._tPos' ).replace( 'this.moveTabTo(', - <> + $&]]> ).replace( 'this.moveTabToStart();', - <> + ]]> ) ); @@ -353,7 +353,7 @@ TreeStyleTabBrowser.prototype = { 'tabPos - 1', 'prevTab._tPos' ).replace( 'this.moveTabToEnd();', - <> + ]]> ) ); eval('b._keyEventHandler.handleEvent = '+ b._keyEventHandler.handleEvent.toSource().replace( 'this.tabbrowser.moveTabOver(aEvent);', - <> + ]]> ).replace( 'this.tabbrowser.moveTabForward();', - <> + ]]> ).replace( 'this.tabbrowser.moveTabBackward();', - <> + ]]> ) ); eval('b.loadTabs = '+ b.loadTabs.toSource().replace( 'var tabNum = ', - <> + $&]]> ).replace( 'if (!aLoadInBackground)', - <> + $&]]> ) ); eval('b.createTooltip = '+ b.createTooltip.toSource().replace( 'if (tn.hasAttribute("label")) {', - <> + $&]]> + ).replace( + '{', + ) );