git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1930 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2008-02-27 01:26:38 +00:00
parent 6c44f84308
commit 59a639853c
2 changed files with 51 additions and 61 deletions

View File

@ -41,12 +41,12 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
if ('MultipleTabService' in window) { // Multiple Tab Handler if ('MultipleTabService' in window) { // Multiple Tab Handler
eval('MultipleTabService.showHideMenuItems = '+ eval('MultipleTabService.showHideMenuItems = '+
MultipleTabService.showHideMenuItems.toSource().replace( MultipleTabService.showHideMenuItems.toSource().replace(
/var separators = /, 'var separators = ',
<><![CDATA[ <><![CDATA[
if (aPopup.id == 'multipletab-selection-menu') { if (aPopup.id == 'multipletab-selection-menu') {
TreeStyleTabService.showHideRemoveSubTreeMenuItem(document.getElementById(TreeStyleTabService.kMENUITEM_REMOVESUBTREE_SELECTION), MultipleTabService.getSelectedTabs()); TreeStyleTabService.showHideRemoveSubTreeMenuItem(document.getElementById(TreeStyleTabService.kMENUITEM_REMOVESUBTREE_SELECTION), MultipleTabService.getSelectedTabs());
} }
var separators = ]]></> $&]]></>
) )
); );
} }
@ -100,8 +100,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
eval('autoHIDE.EndFull = '+ eval('autoHIDE.EndFull = '+
autoHIDE.EndFull.toSource().replace( autoHIDE.EndFull.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
var appcontent = document.getElementById('appcontent'); var appcontent = document.getElementById('appcontent');
if (appcontent.__treestyletab__resized) { if (appcontent.__treestyletab__resized) {
appcontent.__treestyletab__resized = false; appcontent.__treestyletab__resized = false;
@ -114,8 +113,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
eval('autoHIDE.SetMenu = '+ eval('autoHIDE.SetMenu = '+
autoHIDE.SetMenu.toSource().replace( autoHIDE.SetMenu.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
if (arguments.length && arguments[0]) { if (arguments.length && arguments[0]) {
var treeStyleTabSplitter = document.getAnonymousElementByAttribute(gBrowser, 'class', TreeStyleTabService.kSPLITTER); var treeStyleTabSplitter = document.getAnonymousElementByAttribute(gBrowser, 'class', TreeStyleTabService.kSPLITTER);
gBrowser.treeStyleTab.tabbarWidth = gBrowser.mStrip.boxObject.width + gBrowser.treeStyleTab.tabbarWidth = gBrowser.mStrip.boxObject.width +
@ -127,8 +125,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
eval('autoHIDE.MoveC = '+ eval('autoHIDE.MoveC = '+
autoHIDE.MoveC.toSource().replace( autoHIDE.MoveC.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
var treeStyleTabPos = gBrowser.getAttribute(TreeStyleTabService.kTABBAR_POSITION); var treeStyleTabPos = gBrowser.getAttribute(TreeStyleTabService.kTABBAR_POSITION);
if (!arguments.length) { if (!arguments.length) {
var appcontent = document.getElementById('appcontent'); var appcontent = document.getElementById('appcontent');
@ -215,8 +212,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
eval('window.TMP_TabDragGesture = '+ eval('window.TMP_TabDragGesture = '+
window.TMP_TabDragGesture.toSource().replace( window.TMP_TabDragGesture.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) { if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) {
nsDragAndDrop.startDrag(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver )); nsDragAndDrop.startDrag(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver ));
aEvent.stopPropagation(); aEvent.stopPropagation();
@ -228,8 +224,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
eval('window.TMP_TabDragOver = '+ eval('window.TMP_TabDragOver = '+
window.TMP_TabDragOver.toSource().replace( window.TMP_TabDragOver.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) { if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) {
nsDragAndDrop.dragOver(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver )); nsDragAndDrop.dragOver(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver ));
aEvent.stopPropagation(); aEvent.stopPropagation();
@ -241,8 +236,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
eval('window.TMP_TabDragDrop = '+ eval('window.TMP_TabDragDrop = '+
window.TMP_TabDragDrop.toSource().replace( window.TMP_TabDragDrop.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) { if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) {
nsDragAndDrop.drop(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver )); nsDragAndDrop.drop(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver ));
aEvent.stopPropagation(); aEvent.stopPropagation();
@ -254,8 +248,7 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() {
eval('window.TMP_TabDragExit = '+ eval('window.TMP_TabDragExit = '+
window.TMP_TabDragExit.toSource().replace( window.TMP_TabDragExit.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) { if (TreeStyleTabService.getPref('extensions.tabmix.tabBarMode', 1) != 2) {
nsDragAndDrop.dragExit(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver )); nsDragAndDrop.dragExit(aEvent, (gBrowser.getAttribute(TreeStyleTabService.kMODE) == 'vertical' ? gBrowser : TabDNDObserver ));
aEvent.stopPropagation(); aEvent.stopPropagation();

View File

@ -961,7 +961,7 @@ catch(e) {
forceChild : TreeStyleTabService.getTreePref('urlbar.loadDifferentDomainToNewTab.asChild') forceChild : TreeStyleTabService.getTreePref('urlbar.loadDifferentDomainToNewTab.asChild')
}, },
internal : { newTab : TreeStyleTabService.getTreePref('urlbar.loadSameDomainToNewChildTab') }, internal : { newTab : TreeStyleTabService.getTreePref('urlbar.loadSameDomainToNewChildTab') },
modifier : aTriggeringEvent && aTriggeringEvent.altKey, modifier : $&,
invert : TreeStyleTabService.getTreePref('urlbar.invertDefaultBehavior') invert : TreeStyleTabService.getTreePref('urlbar.invertDefaultBehavior')
}) })
]]></> ]]></>
@ -977,8 +977,7 @@ catch(e) {
eval('nsContextMenu.prototype.openLinkInTab = '+ eval('nsContextMenu.prototype.openLinkInTab = '+
nsContextMenu.prototype.openLinkInTab.toSource().replace( nsContextMenu.prototype.openLinkInTab.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView); TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
]]></> ]]></>
) )
@ -986,8 +985,7 @@ catch(e) {
eval('nsContextMenu.prototype.openFrameInTab = '+ eval('nsContextMenu.prototype.openFrameInTab = '+
nsContextMenu.prototype.openFrameInTab.toSource().replace( nsContextMenu.prototype.openFrameInTab.toSource().replace(
'{', '{',
<><![CDATA[ <><![CDATA[$&
{
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView); TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
]]></> ]]></>
) )
@ -998,7 +996,7 @@ catch(e) {
<><![CDATA[ <><![CDATA[
if (String(whereToOpenLink(e, false, true)).indexOf('tab') == 0) if (String(whereToOpenLink(e, false, true)).indexOf('tab') == 0)
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView); TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
openUILink(]]></> $&]]></>
) )
); );
eval('nsContextMenu.prototype.viewBGImage = '+ eval('nsContextMenu.prototype.viewBGImage = '+
@ -1007,7 +1005,7 @@ catch(e) {
<><![CDATA[ <><![CDATA[
if (String(whereToOpenLink(e, false, true)).indexOf('tab') == 0) if (String(whereToOpenLink(e, false, true)).indexOf('tab') == 0)
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView); TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
openUILink(]]></> $&]]></>
) )
); );
eval('nsContextMenu.prototype.addDictionaries = '+ eval('nsContextMenu.prototype.addDictionaries = '+
@ -1016,7 +1014,7 @@ catch(e) {
<><![CDATA[ <><![CDATA[
if (where.indexOf('tab') == 0) if (where.indexOf('tab') == 0)
TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView); TreeStyleTabService.readyToOpenChildTab(this.target.ownerDocument.defaultView);
openUILinkIn(]]></> $&]]></>
) )
); );
@ -1026,10 +1024,10 @@ catch(e) {
if (funcs[i] in window && /^function handleLinkClick/.test(window[funcs[i]].toString())) if (funcs[i] in window && /^function handleLinkClick/.test(window[funcs[i]].toString()))
eval('window.'+funcs[i]+' = '+ eval('window.'+funcs[i]+' = '+
window[funcs[i]].toSource().replace( window[funcs[i]].toSource().replace(
/openNewTabWith\(/g, /(openNewTabWith\()/g,
<><![CDATA[ <><![CDATA[
if (!TreeStyleTabService.checkToOpenChildTab(event.target.ownerDocument.defaultView)) TreeStyleTabService.readyToOpenChildTab(event.target.ownerDocument.defaultView); if (!TreeStyleTabService.checkToOpenChildTab(event.target.ownerDocument.defaultView)) TreeStyleTabService.readyToOpenChildTab(event.target.ownerDocument.defaultView);
openNewTabWith(]]></> $1]]></>
).replace( ).replace(
/(event.ctrlKey|event.metaKey)/, /(event.ctrlKey|event.metaKey)/,
<><![CDATA[ <><![CDATA[
@ -1111,11 +1109,11 @@ catch(e) {
/^function (gotoHistoryIndex|BrowserForward|BrowserBack)/.test(window[funcs[i]].toString())) /^function (gotoHistoryIndex|BrowserForward|BrowserBack)/.test(window[funcs[i]].toString()))
eval('window.'+funcs[i]+' = '+ eval('window.'+funcs[i]+' = '+
window[funcs[i]].toSource().replace( window[funcs[i]].toSource().replace(
/openUILinkIn\(/g, /(openUILinkIn\()/g,
<><![CDATA[ <><![CDATA[
if (where == 'tab' || where == 'tabshifted') if (where == 'tab' || where == 'tabshifted')
TreeStyleTabService.readyToOpenChildTab(); TreeStyleTabService.readyToOpenChildTab();
openUILinkIn(]]></> $1]]></>
) )
); );
} }
@ -1130,7 +1128,7 @@ catch(e) {
'gBrowser.loadTabs(', 'gBrowser.loadTabs(',
<><![CDATA[ <><![CDATA[
TreeStyleTabService.readyToOpenNewTabGroup(gBrowser); TreeStyleTabService.readyToOpenNewTabGroup(gBrowser);
gBrowser.loadTabs(]]></> $&]]></>
) )
); );
}; };
@ -1141,14 +1139,13 @@ catch(e) {
eval('nsBrowserAccess.prototype.openURI = '+ eval('nsBrowserAccess.prototype.openURI = '+
nsBrowserAccess.prototype.openURI.toSource().replace( nsBrowserAccess.prototype.openURI.toSource().replace(
/switch\s*\(aWhere\)/, /(switch\s*\(aWhere\))/,
<><![CDATA[ <><![CDATA[
if (aOpener && if (aOpener &&
aWhere == Components.interfaces.nsIBrowserDOMWindow.OPEN_NEWTAB) { aWhere == Components.interfaces.nsIBrowserDOMWindow.OPEN_NEWTAB) {
TreeStyleTabService.readyToOpenChildTab(aOpener); TreeStyleTabService.readyToOpenChildTab(aOpener);
} }
switch(aWhere) $1]]></>
]]></>
) )
); );
window.QueryInterface(Components.interfaces.nsIDOMChromeWindow).browserDOMWindow = null; window.QueryInterface(Components.interfaces.nsIDOMChromeWindow).browserDOMWindow = null;
@ -1160,7 +1157,7 @@ catch(e) {
<><![CDATA[ <><![CDATA[
if (String(whereToOpenLink(event, false, true)).indexOf('tab') == 0) if (String(whereToOpenLink(event, false, true)).indexOf('tab') == 0)
TreeStyleTabService.readyToOpenChildTab(gBrowser); TreeStyleTabService.readyToOpenChildTab(gBrowser);
openUILink(]]></> $&]]></>
) )
); );
}, },