Use LF instead of CRLF
This commit is contained in:
parent
c595c8ba22
commit
09f43c8f84
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
<script src="res/tabsDragUtils.js" type="application/javascript"/>
|
<script src="res/tabsDragUtils.js" type="application/javascript"/>
|
||||||
<script src="treestyletab.js" type="application/javascript"/>
|
<script src="treestyletab.js" type="application/javascript"/>
|
||||||
<script src="bookmarksOverlay.js" type="application/javascript"/>
|
<script src="bookmarksOverlay.js" type="application/javascript"/>
|
||||||
</overlay>
|
</overlay>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#infoBox[minimal="true"] #treestyletab-parent-row {
|
#infoBox[minimal="true"] #treestyletab-parent-row {
|
||||||
visibility: collapse;
|
visibility: collapse;
|
||||||
}
|
}
|
||||||
|
@ -1,365 +1,365 @@
|
|||||||
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
|
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||||
XPCOMUtils.defineLazyModuleGetter(this,
|
XPCOMUtils.defineLazyModuleGetter(this,
|
||||||
'TreeStyleTabUtils', 'resource://treestyletab-modules/utils.js');
|
'TreeStyleTabUtils', 'resource://treestyletab-modules/utils.js');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
let { inherit } = Components.utils.import('resource://treestyletab-modules/lib/inherit.jsm', {});
|
let { inherit } = Components.utils.import('resource://treestyletab-modules/lib/inherit.jsm', {});
|
||||||
var TreeStyleTabBookmarksServiceEditable = inherit(TreeStyleTabBookmarksService, {
|
var TreeStyleTabBookmarksServiceEditable = inherit(TreeStyleTabBookmarksService, {
|
||||||
|
|
||||||
instantApply : false,
|
instantApply : false,
|
||||||
canceled : false,
|
canceled : false,
|
||||||
|
|
||||||
get parentRow()
|
get parentRow()
|
||||||
{
|
{
|
||||||
return document.getElementById('treestyletab-parent-row');
|
return document.getElementById('treestyletab-parent-row');
|
||||||
},
|
},
|
||||||
|
|
||||||
get menulist()
|
get menulist()
|
||||||
{
|
{
|
||||||
return document.getElementById('treestyletab-parent-menulist');
|
return document.getElementById('treestyletab-parent-menulist');
|
||||||
},
|
},
|
||||||
get popup()
|
get popup()
|
||||||
{
|
{
|
||||||
return document.getElementById('treestyletab-parent-popup');
|
return document.getElementById('treestyletab-parent-popup');
|
||||||
},
|
},
|
||||||
|
|
||||||
get separator()
|
get separator()
|
||||||
{
|
{
|
||||||
return document.getElementById('treestyletab-parent-blank-item-separator');
|
return document.getElementById('treestyletab-parent-blank-item-separator');
|
||||||
},
|
},
|
||||||
get blankItem()
|
get blankItem()
|
||||||
{
|
{
|
||||||
return document.getElementById('treestyletab-parent-blank-item');
|
return document.getElementById('treestyletab-parent-blank-item');
|
||||||
},
|
},
|
||||||
|
|
||||||
get isCreatingMultipleBookmarksInFolder()
|
get isCreatingMultipleBookmarksInFolder()
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
window.arguments.length &&
|
window.arguments.length &&
|
||||||
window.arguments[0] &&
|
window.arguments[0] &&
|
||||||
window.arguments[0].type == 'folder'
|
window.arguments[0].type == 'folder'
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
init : function TSTBMEditable_init()
|
init : function TSTBMEditable_init()
|
||||||
{
|
{
|
||||||
if (this.isCreatingMultipleBookmarksInFolder) return;
|
if (this.isCreatingMultipleBookmarksInFolder) return;
|
||||||
|
|
||||||
// main browser window
|
// main browser window
|
||||||
if ('StarUI' in window) {
|
if ('StarUI' in window) {
|
||||||
if ('_doShowEditBookmarkPanel' in StarUI) {
|
if ('_doShowEditBookmarkPanel' in StarUI) {
|
||||||
eval('StarUI._doShowEditBookmarkPanel = '+StarUI._doShowEditBookmarkPanel.toSource().replace(
|
eval('StarUI._doShowEditBookmarkPanel = '+StarUI._doShowEditBookmarkPanel.toSource().replace(
|
||||||
'{',
|
'{',
|
||||||
'{ TreeStyleTabBookmarksServiceEditable.initEditUI();'
|
'{ TreeStyleTabBookmarksServiceEditable.initEditUI();'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if ('quitEditMode' in StarUI) {
|
if ('quitEditMode' in StarUI) {
|
||||||
eval('StarUI.quitEditMode = '+StarUI.quitEditMode.toSource().replace(
|
eval('StarUI.quitEditMode = '+StarUI.quitEditMode.toSource().replace(
|
||||||
'{',
|
'{',
|
||||||
'{ TreeStyleTabBookmarksServiceEditable.saveParentFor(this._itemId);'
|
'{ TreeStyleTabBookmarksServiceEditable.saveParentFor(this._itemId);'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if ('cancelButtonOnCommand' in StarUI) {
|
if ('cancelButtonOnCommand' in StarUI) {
|
||||||
eval('StarUI.cancelButtonOnCommand = '+StarUI.cancelButtonOnCommand.toSource().replace(
|
eval('StarUI.cancelButtonOnCommand = '+StarUI.cancelButtonOnCommand.toSource().replace(
|
||||||
'{',
|
'{',
|
||||||
'{ TreeStyleTabBookmarksServiceEditable.canceled = true;'
|
'{ TreeStyleTabBookmarksServiceEditable.canceled = true;'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bookmarks Property dialog
|
// Bookmarks Property dialog
|
||||||
if ('BookmarkPropertiesPanel' in window) {
|
if ('BookmarkPropertiesPanel' in window) {
|
||||||
eval('BookmarkPropertiesPanel._endBatch = '+BookmarkPropertiesPanel._endBatch.toSource().replace(
|
eval('BookmarkPropertiesPanel._endBatch = '+BookmarkPropertiesPanel._endBatch.toSource().replace(
|
||||||
'PlacesUIUtils.ptm.endBatch();',
|
'PlacesUIUtils.ptm.endBatch();',
|
||||||
'$& TreeStyleTabBookmarksServiceEditable.saveParentFor(this._itemId);'
|
'$& TreeStyleTabBookmarksServiceEditable.saveParentFor(this._itemId);'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Places Organizer (Library)
|
// Places Organizer (Library)
|
||||||
if ('PlacesOrganizer' in window) {
|
if ('PlacesOrganizer' in window) {
|
||||||
this.instantApply = true;
|
this.instantApply = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initEditUI();
|
this.initEditUI();
|
||||||
},
|
},
|
||||||
|
|
||||||
initEditUI : function TSTBMEditable_initEditUI()
|
initEditUI : function TSTBMEditable_initEditUI()
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
this.editUIInitialized ||
|
this.editUIInitialized ||
|
||||||
!('gEditItemOverlay' in window) ||
|
!('gEditItemOverlay' in window) ||
|
||||||
this.isCreatingMultipleBookmarksInFolder
|
this.isCreatingMultipleBookmarksInFolder
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var container = document.getElementById('editBookmarkPanelGrid');
|
var container = document.getElementById('editBookmarkPanelGrid');
|
||||||
if (!container) return;
|
if (!container) return;
|
||||||
|
|
||||||
container = container.getElementsByTagName('rows')[0];
|
container = container.getElementsByTagName('rows')[0];
|
||||||
var range = document.createRange();
|
var range = document.createRange();
|
||||||
range.selectNodeContents(container);
|
range.selectNodeContents(container);
|
||||||
range.collapse(false);
|
range.collapse(false);
|
||||||
range.insertNode(range.createContextualFragment(
|
range.insertNode(range.createContextualFragment(
|
||||||
('<row align="center" id="treestyletab-parent-row">' +
|
('<row align="center" id="treestyletab-parent-row">' +
|
||||||
' <label id="treestyletab-parent-label"' +
|
' <label id="treestyletab-parent-label"' +
|
||||||
' control="treestyletab-parent-menulist"/>' +
|
' control="treestyletab-parent-menulist"/>' +
|
||||||
' <menulist id="treestyletab-parent-menulist"' +
|
' <menulist id="treestyletab-parent-menulist"' +
|
||||||
' flex="1"' +
|
' flex="1"' +
|
||||||
' oncommand="TreeStyleTabBookmarksServiceEditable.onParentChange();">' +
|
' oncommand="TreeStyleTabBookmarksServiceEditable.onParentChange();">' +
|
||||||
' <menupopup id="treestyletab-parent-popup">' +
|
' <menupopup id="treestyletab-parent-popup">' +
|
||||||
' <menuseparator id="treestyletab-parent-blank-item-separator"/>' +
|
' <menuseparator id="treestyletab-parent-blank-item-separator"/>' +
|
||||||
' <menuitem id="treestyletab-parent-blank-item"' +
|
' <menuitem id="treestyletab-parent-blank-item"' +
|
||||||
' value=""/>' +
|
' value=""/>' +
|
||||||
' </menupopup>' +
|
' </menupopup>' +
|
||||||
' </menulist>' +
|
' </menulist>' +
|
||||||
'</row>').trim().replace(/>\s+</g, '><')));
|
'</row>').trim().replace(/>\s+</g, '><')));
|
||||||
range.detach();
|
range.detach();
|
||||||
document.getElementById('treestyletab-parent-label').setAttribute('value', TreeStyleTabUtils.treeBundle.getString('bookmarkProperty.parent.label'));
|
document.getElementById('treestyletab-parent-label').setAttribute('value', TreeStyleTabUtils.treeBundle.getString('bookmarkProperty.parent.label'));
|
||||||
this.blankItem.setAttribute('label', TreeStyleTabUtils.treeBundle.getString('bookmarkProperty.parent.blank.label'));
|
this.blankItem.setAttribute('label', TreeStyleTabUtils.treeBundle.getString('bookmarkProperty.parent.blank.label'));
|
||||||
|
|
||||||
|
|
||||||
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;\n' +
|
' TreeStyleTabBookmarksServiceEditable.parentRow.collapsed = this._element("keywordRow").collapsed && this._element("folderRow").collapsed;\n' +
|
||||||
'$1'
|
'$1'
|
||||||
));
|
));
|
||||||
|
|
||||||
eval('gEditItemOverlay.initPanel = '+gEditItemOverlay.initPanel.toSource().replace(
|
eval('gEditItemOverlay.initPanel = '+gEditItemOverlay.initPanel.toSource().replace(
|
||||||
'if (this._itemType == Ci.nsINavBookmarksService.TYPE_BOOKMARK) {',
|
'if (this._itemType == Ci.nsINavBookmarksService.TYPE_BOOKMARK) {',
|
||||||
'$& TreeStyleTabBookmarksServiceEditable.initParentMenuList();'
|
'$& TreeStyleTabBookmarksServiceEditable.initParentMenuList();'
|
||||||
));
|
));
|
||||||
|
|
||||||
eval('gEditItemOverlay.onItemMoved = '+gEditItemOverlay.onItemMoved.toSource().replace(
|
eval('gEditItemOverlay.onItemMoved = '+gEditItemOverlay.onItemMoved.toSource().replace(
|
||||||
'{',
|
'{',
|
||||||
'$& if (aNewParent == this._getFolderIdFromMenuList()) TreeStyleTabBookmarksServiceEditable.initParentMenuList();'
|
'$& if (aNewParent == this._getFolderIdFromMenuList()) TreeStyleTabBookmarksServiceEditable.initParentMenuList();'
|
||||||
));
|
));
|
||||||
|
|
||||||
this.editUIInitialized = true;
|
this.editUIInitialized = true;
|
||||||
},
|
},
|
||||||
editUIInitialized : false,
|
editUIInitialized : false,
|
||||||
|
|
||||||
initParentMenuList : function TSTBMEditable_initParentMenuList()
|
initParentMenuList : function TSTBMEditable_initParentMenuList()
|
||||||
{
|
{
|
||||||
var id = gEditItemOverlay.itemId;
|
var id = gEditItemOverlay.itemId;
|
||||||
|
|
||||||
this.menulist.disabled = true;
|
this.menulist.disabled = true;
|
||||||
this.menulist.setAttribute('label', '...');
|
this.menulist.setAttribute('label', '...');
|
||||||
|
|
||||||
var popup = this.popup;
|
var popup = this.popup;
|
||||||
var range = document.createRange();
|
var range = document.createRange();
|
||||||
range.selectNodeContents(popup);
|
range.selectNodeContents(popup);
|
||||||
range.setEndBefore(this.separator);
|
range.setEndBefore(this.separator);
|
||||||
range.deleteContents();
|
range.deleteContents();
|
||||||
range.detach();
|
range.detach();
|
||||||
|
|
||||||
this.canceled = false;
|
this.canceled = false;
|
||||||
|
|
||||||
// Ignore bookmark in the "unsorted bookmarks" folder, because
|
// Ignore bookmark in the "unsorted bookmarks" folder, because
|
||||||
// there can be very large number of bookmarks and they won't be
|
// there can be very large number of bookmarks and they won't be
|
||||||
// opened as a tree.
|
// opened as a tree.
|
||||||
if (PlacesUtils.bookmarks.getFolderIdForItem(id) == PlacesUtils.unfiledBookmarksFolderId)
|
if (PlacesUtils.bookmarks.getFolderIdForItem(id) == PlacesUtils.unfiledBookmarksFolderId)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._createSiblingsFragment(id, (function(aSiblingsFragment) {
|
this._createSiblingsFragment(id, (function(aSiblingsFragment) {
|
||||||
var range = document.createRange();
|
var range = document.createRange();
|
||||||
range.selectNodeContents(popup);
|
range.selectNodeContents(popup);
|
||||||
range.setEndBefore(this.separator);
|
range.setEndBefore(this.separator);
|
||||||
range.insertNode(aSiblingsFragment);
|
range.insertNode(aSiblingsFragment);
|
||||||
range.detach();
|
range.detach();
|
||||||
|
|
||||||
var selected = popup.getElementsByAttribute('selected', 'true')[0];
|
var selected = popup.getElementsByAttribute('selected', 'true')[0];
|
||||||
this.menulist.disabled = false;
|
this.menulist.disabled = false;
|
||||||
this.menulist.value = (selected || this.blankItem).getAttribute('value');
|
this.menulist.value = (selected || this.blankItem).getAttribute('value');
|
||||||
}).bind(this))
|
}).bind(this))
|
||||||
},
|
},
|
||||||
_doProgressively : function TSTBMEditable__doProgressively(aParams)
|
_doProgressively : function TSTBMEditable__doProgressively(aParams)
|
||||||
{
|
{
|
||||||
var name = aParams.name;
|
var name = aParams.name;
|
||||||
if (this._doProgressivelyTimers[name])
|
if (this._doProgressivelyTimers[name])
|
||||||
window.clearTimeout(this._doProgressivelyTimers[name]);
|
window.clearTimeout(this._doProgressivelyTimers[name]);
|
||||||
|
|
||||||
var interval = 100;
|
var interval = 100;
|
||||||
var step = 10;
|
var step = 10;
|
||||||
var progressiveIteration = (function() {
|
var progressiveIteration = (function() {
|
||||||
try {
|
try {
|
||||||
for (let i = 0; i < step; i++)
|
for (let i = 0; i < step; i++)
|
||||||
{
|
{
|
||||||
aParams.onProgress();
|
aParams.onProgress();
|
||||||
}
|
}
|
||||||
this._doProgressivelyTimers[name] = window.setTimeout(progressiveIteration, interval);
|
this._doProgressivelyTimers[name] = window.setTimeout(progressiveIteration, interval);
|
||||||
}
|
}
|
||||||
catch(e if e instanceof StopIteration) {
|
catch(e if e instanceof StopIteration) {
|
||||||
aParams.onComplete();
|
aParams.onComplete();
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
Components.utils.reportError(e);
|
Components.utils.reportError(e);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
this._doProgressivelyTimers[name] = null;
|
this._doProgressivelyTimers[name] = null;
|
||||||
}
|
}
|
||||||
}).bind(this);
|
}).bind(this);
|
||||||
this._doProgressivelyTimers[name] = window.setTimeout(progressiveIteration, interval);
|
this._doProgressivelyTimers[name] = window.setTimeout(progressiveIteration, interval);
|
||||||
},
|
},
|
||||||
_doProgressivelyTimers : {},
|
_doProgressivelyTimers : {},
|
||||||
_createSiblingsFragment : function TSTBMEditable__createSiblingsFragment(aCurrentItem, aCallback)
|
_createSiblingsFragment : function TSTBMEditable__createSiblingsFragment(aCurrentItem, aCallback)
|
||||||
{
|
{
|
||||||
var itemsIterator = this._getSiblingItemsIterator(aCurrentItem);
|
var itemsIterator = this._getSiblingItemsIterator(aCurrentItem);
|
||||||
var items = [];
|
var items = [];
|
||||||
this._doProgressively({
|
this._doProgressively({
|
||||||
name : '_createSiblingsFragment',
|
name : '_createSiblingsFragment',
|
||||||
onProgress : function() {
|
onProgress : function() {
|
||||||
items.push(itemsIterator.next());
|
items.push(itemsIterator.next());
|
||||||
},
|
},
|
||||||
onComplete : (function() {
|
onComplete : (function() {
|
||||||
this._createSiblingsFragmentInternal(aCurrentItem, items, function(aSiblingsFragment) {
|
this._createSiblingsFragmentInternal(aCurrentItem, items, function(aSiblingsFragment) {
|
||||||
aCallback(aSiblingsFragment);
|
aCallback(aSiblingsFragment);
|
||||||
});
|
});
|
||||||
}).bind(this)
|
}).bind(this)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_createSiblingsFragmentInternal : function TSTBMEditable_createSiblingsFragmentInternal(aCurrentItem, aItems, aCallback)
|
_createSiblingsFragmentInternal : function TSTBMEditable_createSiblingsFragmentInternal(aCurrentItem, aItems, aCallback)
|
||||||
{
|
{
|
||||||
var treeStructure = this.getTreeStructureFromItems(aItems);
|
var treeStructure = this.getTreeStructureFromItems(aItems);
|
||||||
|
|
||||||
var currentIndex = aItems.indexOf(aCurrentItem);
|
var currentIndex = aItems.indexOf(aCurrentItem);
|
||||||
var selected = treeStructure[currentIndex];
|
var selected = treeStructure[currentIndex];
|
||||||
if (selected > -1) {
|
if (selected > -1) {
|
||||||
let offset = treeStructure.lastIndexOf(-1, currentIndex);
|
let offset = treeStructure.lastIndexOf(-1, currentIndex);
|
||||||
let subStructure = treeStructure.slice(offset);
|
let subStructure = treeStructure.slice(offset);
|
||||||
selected = aItems[selected + offset];
|
selected = aItems[selected + offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
var fragment = document.createDocumentFragment();
|
var fragment = document.createDocumentFragment();
|
||||||
|
|
||||||
var itemsIterator = Iterator(aItems);
|
var itemsIterator = Iterator(aItems);
|
||||||
this._doProgressively({
|
this._doProgressively({
|
||||||
name : '_createSiblingsFragment',
|
name : '_createSiblingsFragment',
|
||||||
onProgress : (function() {
|
onProgress : (function() {
|
||||||
let [index, id] = itemsIterator.next();
|
let [index, id] = itemsIterator.next();
|
||||||
|
|
||||||
let label = PlacesUtils.bookmarks.getItemTitle(id);
|
let label = PlacesUtils.bookmarks.getItemTitle(id);
|
||||||
let menuitem = document.createElement('menuitem');
|
let menuitem = document.createElement('menuitem');
|
||||||
menuitem.setAttribute('value', id);
|
menuitem.setAttribute('value', id);
|
||||||
|
|
||||||
let parent = index;
|
let parent = index;
|
||||||
let nest = 0;
|
let nest = 0;
|
||||||
let disabled = false;
|
let disabled = false;
|
||||||
while ((parent = treeStructure[parent]) != -1)
|
while ((parent = treeStructure[parent]) != -1)
|
||||||
{
|
{
|
||||||
nest++;
|
nest++;
|
||||||
if (parent == currentIndex) disabled = true;
|
if (parent == currentIndex) disabled = true;
|
||||||
}
|
}
|
||||||
if (nest)
|
if (nest)
|
||||||
menuitem.setAttribute('style', 'padding-left:'+nest+'em');
|
menuitem.setAttribute('style', 'padding-left:'+nest+'em');
|
||||||
|
|
||||||
if (disabled || id == aCurrentItem) {
|
if (disabled || id == aCurrentItem) {
|
||||||
menuitem.setAttribute('disabled', true);
|
menuitem.setAttribute('disabled', true);
|
||||||
if (id == aCurrentItem)
|
if (id == aCurrentItem)
|
||||||
label = TreeStyleTabUtils.treeBundle.getFormattedString('bookmarkProperty.parent.current.label', [label]);
|
label = TreeStyleTabUtils.treeBundle.getFormattedString('bookmarkProperty.parent.current.label', [label]);
|
||||||
}
|
}
|
||||||
if (id == selected)
|
if (id == selected)
|
||||||
menuitem.setAttribute('selected', true);
|
menuitem.setAttribute('selected', true);
|
||||||
|
|
||||||
menuitem.setAttribute('label', label);
|
menuitem.setAttribute('label', label);
|
||||||
|
|
||||||
fragment.appendChild(menuitem);
|
fragment.appendChild(menuitem);
|
||||||
}).bind(this),
|
}).bind(this),
|
||||||
onComplete : function() {
|
onComplete : function() {
|
||||||
aCallback(fragment);
|
aCallback(fragment);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_getItemsInFolderIterator : function TSTBMEditable_getItemsInFolderIterator(aId)
|
_getItemsInFolderIterator : function TSTBMEditable_getItemsInFolderIterator(aId)
|
||||||
{
|
{
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var item;
|
var item;
|
||||||
try {
|
try {
|
||||||
while((item = PlacesUtils.bookmarks.getIdForItemAt(aId, count++)) != -1)
|
while((item = PlacesUtils.bookmarks.getIdForItemAt(aId, count++)) != -1)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
let uri = PlacesUtils.bookmarks.getBookmarkURI(item);
|
let uri = PlacesUtils.bookmarks.getBookmarkURI(item);
|
||||||
if (uri.spec.indexOf('place:') != 0)
|
if (uri.spec.indexOf('place:') != 0)
|
||||||
yield item;
|
yield item;
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
// this is not a normal bookmark.
|
// this is not a normal bookmark.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_getSiblingItemsIterator : function TSTBMEditable_getSiblingItemsIterator(aId)
|
_getSiblingItemsIterator : function TSTBMEditable_getSiblingItemsIterator(aId)
|
||||||
{
|
{
|
||||||
return this._getItemsInFolderIterator(PlacesUtils.bookmarks.getFolderIdForItem(aId));
|
return this._getItemsInFolderIterator(PlacesUtils.bookmarks.getFolderIdForItem(aId));
|
||||||
},
|
},
|
||||||
|
|
||||||
saveParentFor : function TSTBMEditable_saveParentFor(aId)
|
saveParentFor : function TSTBMEditable_saveParentFor(aId)
|
||||||
{
|
{
|
||||||
var newParentId = parseInt(this.menulist.value || -1);
|
var newParentId = parseInt(this.menulist.value || -1);
|
||||||
if (this.canceled || newParentId == this.getParentItem(aId)) return;
|
if (this.canceled || newParentId == this.getParentItem(aId)) return;
|
||||||
|
|
||||||
var itemsIterator = this._getSiblingItemsIterator(aId);
|
var itemsIterator = this._getSiblingItemsIterator(aId);
|
||||||
var items = [];
|
var items = [];
|
||||||
this._doProgressively({
|
this._doProgressively({
|
||||||
name : '_createSiblingsFragment',
|
name : '_createSiblingsFragment',
|
||||||
onProgress : function() {
|
onProgress : function() {
|
||||||
items.push(itemsIterator.next());
|
items.push(itemsIterator.next());
|
||||||
},
|
},
|
||||||
onComplete : (function() {
|
onComplete : (function() {
|
||||||
this._saveParentForInternal(aId, newParentId, items);
|
this._saveParentForInternal(aId, newParentId, items);
|
||||||
}).bind(this)
|
}).bind(this)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_saveParentForInternal : function TSTBMEditable_saveParentForInternal(aId, aNewParentId, aItems)
|
_saveParentForInternal : function TSTBMEditable_saveParentForInternal(aId, aNewParentId, aItems)
|
||||||
{
|
{
|
||||||
var treeStructure = this.getTreeStructureFromItems(aItems);
|
var treeStructure = this.getTreeStructureFromItems(aItems);
|
||||||
|
|
||||||
var parentIndex = aItems.indexOf(aNewParentId);
|
var parentIndex = aItems.indexOf(aNewParentId);
|
||||||
var newIndex;
|
var newIndex;
|
||||||
if (TreeStyleTabUtils.getTreePref('insertNewChildAt') == this.kINSERT_FISRT) {
|
if (TreeStyleTabUtils.getTreePref('insertNewChildAt') == this.kINSERT_FISRT) {
|
||||||
newIndex = treeStructure.indexOf(parentIndex);
|
newIndex = treeStructure.indexOf(parentIndex);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
do {
|
do {
|
||||||
newIndex = parentIndex;
|
newIndex = parentIndex;
|
||||||
parentIndex = treeStructure.lastIndexOf(parentIndex);
|
parentIndex = treeStructure.lastIndexOf(parentIndex);
|
||||||
}
|
}
|
||||||
while (parentIndex > -1);
|
while (parentIndex > -1);
|
||||||
newIndex++;
|
newIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlacesUtils.setAnnotationsForItem(aId, [{
|
PlacesUtils.setAnnotationsForItem(aId, [{
|
||||||
name : this.kPARENT,
|
name : this.kPARENT,
|
||||||
value : aNewParentId,
|
value : aNewParentId,
|
||||||
expires : PlacesUtils.annotations.EXPIRE_NEVER
|
expires : PlacesUtils.annotations.EXPIRE_NEVER
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
PlacesUtils.bookmarks.moveItem(aId, PlacesUtils.bookmarks.getFolderIdForItem(aId), newIndex);
|
PlacesUtils.bookmarks.moveItem(aId, PlacesUtils.bookmarks.getFolderIdForItem(aId), newIndex);
|
||||||
|
|
||||||
if (this.instantApply) this.initParentMenuList();
|
if (this.instantApply) this.initParentMenuList();
|
||||||
},
|
},
|
||||||
|
|
||||||
onParentChange : function TSTBMEditable_onParentChange()
|
onParentChange : function TSTBMEditable_onParentChange()
|
||||||
{
|
{
|
||||||
if (!this.instantApply) return;
|
if (!this.instantApply) return;
|
||||||
this.saveParentFor(gEditItemOverlay.itemId);
|
this.saveParentFor(gEditItemOverlay.itemId);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleEvent : function TSTBMEditable_handleEvent(aEvent)
|
handleEvent : function TSTBMEditable_handleEvent(aEvent)
|
||||||
{
|
{
|
||||||
switch (aEvent.type)
|
switch (aEvent.type)
|
||||||
{
|
{
|
||||||
case 'DOMContentLoaded':
|
case 'DOMContentLoaded':
|
||||||
window.removeEventListener('DOMContentLoaded', this, false);
|
window.removeEventListener('DOMContentLoaded', this, false);
|
||||||
this.init();
|
this.init();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', TreeStyleTabBookmarksServiceEditable, false);
|
window.addEventListener('DOMContentLoaded', TreeStyleTabBookmarksServiceEditable, false);
|
||||||
|
|
||||||
window.TreeStyleTabBookmarksServiceEditable = TreeStyleTabBookmarksServiceEditable;
|
window.TreeStyleTabBookmarksServiceEditable = TreeStyleTabBookmarksServiceEditable;
|
||||||
})();
|
})();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<?xml-stylesheet href="bookmarksOverlayEditable.css" type="text/css"?>
|
<?xml-stylesheet href="bookmarksOverlayEditable.css" type="text/css"?>
|
||||||
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
<script src="bookmarksOverlayEditable.js" type="application/javascript"/>
|
<script src="bookmarksOverlayEditable.js" type="application/javascript"/>
|
||||||
</overlay>
|
</overlay>
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||||
|
|
||||||
[id="extensions.treestyletab.tabbar.style-radiogroup"] radio[src] .radio-icon {
|
[id="extensions.treestyletab.tabbar.style-radiogroup"] radio[src] .radio-icon {
|
||||||
width: 52px;
|
width: 52px;
|
||||||
height: 62px;
|
height: 62px;
|
||||||
}
|
}
|
||||||
|
|
||||||
[id="extensions.treestyletab.twisty.style-radiogroup"] radio[src] .radio-icon {
|
[id="extensions.treestyletab.twisty.style-radiogroup"] radio[src] .radio-icon {
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
arrowscrollbox[overflow="true"] {
|
arrowscrollbox[overflow="true"] {
|
||||||
border: 1px inset ThreeDFace;
|
border: 1px inset ThreeDFace;
|
||||||
}
|
}
|
||||||
|
@ -1,375 +1,375 @@
|
|||||||
Components.utils.import('resource://gre/modules/Services.jsm');
|
Components.utils.import('resource://gre/modules/Services.jsm');
|
||||||
|
|
||||||
const XULAppInfo = Services.appinfo;
|
const XULAppInfo = Services.appinfo;
|
||||||
const comparator = Services.vc;
|
const comparator = Services.vc;
|
||||||
var Prefs = Services.prefs;
|
var Prefs = Services.prefs;
|
||||||
|
|
||||||
Components.utils.import('resource://treestyletab-modules/lib/animationManager.js', {});
|
Components.utils.import('resource://treestyletab-modules/lib/animationManager.js', {});
|
||||||
Components.utils.import('resource://treestyletab-modules/lib/prefs.js', {});
|
Components.utils.import('resource://treestyletab-modules/lib/prefs.js', {});
|
||||||
Components.utils.import('resource://treestyletab-modules/lib/namespace.jsm');
|
Components.utils.import('resource://treestyletab-modules/lib/namespace.jsm');
|
||||||
var animationManager = getNamespaceFor('piro.sakura.ne.jp')['piro.sakura.ne.jp'].animationManager;
|
var animationManager = getNamespaceFor('piro.sakura.ne.jp')['piro.sakura.ne.jp'].animationManager;
|
||||||
var prefs = getNamespaceFor('piro.sakura.ne.jp')['piro.sakura.ne.jp'].prefs;
|
var prefs = getNamespaceFor('piro.sakura.ne.jp')['piro.sakura.ne.jp'].prefs;
|
||||||
|
|
||||||
|
|
||||||
function syncEnabledState(aElement, aEnabled)
|
function syncEnabledState(aElement, aEnabled)
|
||||||
{
|
{
|
||||||
if (typeof aElement == 'string')
|
if (typeof aElement == 'string')
|
||||||
aElement = document.getElementById(aElement);
|
aElement = document.getElementById(aElement);
|
||||||
if (typeof aEnabled == 'string')
|
if (typeof aEnabled == 'string')
|
||||||
aEnabled = (new Function('return '+aEnabled)).call(aElement);
|
aEnabled = (new Function('return '+aEnabled)).call(aElement);
|
||||||
|
|
||||||
aElement.getAttribute('sync-enabled-state-targets')
|
aElement.getAttribute('sync-enabled-state-targets')
|
||||||
.replace(/$\s+|\s+$/g, '')
|
.replace(/$\s+|\s+$/g, '')
|
||||||
.split(/\s+/)
|
.split(/\s+/)
|
||||||
.map(function(aId) {
|
.map(function(aId) {
|
||||||
if (!aId)
|
if (!aId)
|
||||||
return;
|
return;
|
||||||
var target = document.getElementById(aId);
|
var target = document.getElementById(aId);
|
||||||
if (aEnabled)
|
if (aEnabled)
|
||||||
target.removeAttribute('disabled');
|
target.removeAttribute('disabled');
|
||||||
else
|
else
|
||||||
target.setAttribute('disabled', true);
|
target.setAttribute('disabled', true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var gGroupBookmarkRadio,
|
var gGroupBookmarkRadio,
|
||||||
gGroupBookmarkUnderParent,
|
gGroupBookmarkUnderParent,
|
||||||
gGroupBookmarkType,
|
gGroupBookmarkType,
|
||||||
gGroupBookmarkBehaviorPref;
|
gGroupBookmarkBehaviorPref;
|
||||||
|
|
||||||
function ensureGroupBookmarkItems()
|
function ensureGroupBookmarkItems()
|
||||||
{
|
{
|
||||||
if (gGroupBookmarkBehaviorPref) return;
|
if (gGroupBookmarkBehaviorPref) return;
|
||||||
|
|
||||||
gGroupBookmarkRadio = document.getElementById('openGroupBookmark-radiogroup');
|
gGroupBookmarkRadio = document.getElementById('openGroupBookmark-radiogroup');
|
||||||
gGroupBookmarkUnderParent = document.getElementById('openGroupBookmark.underParent-check');
|
gGroupBookmarkUnderParent = document.getElementById('openGroupBookmark.underParent-check');
|
||||||
gGroupBookmarkType = document.getElementById('openGroupBookmark.subtreeType-menulist');
|
gGroupBookmarkType = document.getElementById('openGroupBookmark.subtreeType-menulist');
|
||||||
gGroupBookmarkBehaviorPref = document.getElementById('extensions.treestyletab.openGroupBookmark.behavior');
|
gGroupBookmarkBehaviorPref = document.getElementById('extensions.treestyletab.openGroupBookmark.behavior');
|
||||||
}
|
}
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
{
|
{
|
||||||
ensureGroupBookmarkItems();
|
ensureGroupBookmarkItems();
|
||||||
|
|
||||||
// sizeToContent();
|
// sizeToContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function initAppearancePane()
|
function initAppearancePane()
|
||||||
{
|
{
|
||||||
onChangeTabbarPosition();
|
onChangeTabbarPosition();
|
||||||
|
|
||||||
var sidebar = document.getElementById('extensions.treestyletab.tabbar.style-sidebar');
|
var sidebar = document.getElementById('extensions.treestyletab.tabbar.style-sidebar');
|
||||||
sidebar.removeAttribute('disabled');
|
sidebar.removeAttribute('disabled');
|
||||||
|
|
||||||
var boxes = [
|
var boxes = [
|
||||||
document.getElementById('extensions.treestyletab.tabbar.style-arrowscrollbox'),
|
document.getElementById('extensions.treestyletab.tabbar.style-arrowscrollbox'),
|
||||||
document.getElementById('extensions.treestyletab.twisty.style-arrowscrollbox')
|
document.getElementById('extensions.treestyletab.twisty.style-arrowscrollbox')
|
||||||
];
|
];
|
||||||
Array.slice(boxes[0].childNodes).concat(Array.slice(boxes[1].childNodes)).forEach(function(aItem) {
|
Array.slice(boxes[0].childNodes).concat(Array.slice(boxes[1].childNodes)).forEach(function(aItem) {
|
||||||
let start = 0;
|
let start = 0;
|
||||||
let delta = 200;
|
let delta = 200;
|
||||||
let radian = 90 * Math.PI / 180;
|
let radian = 90 * Math.PI / 180;
|
||||||
aItem.style.overflow = 'hidden';
|
aItem.style.overflow = 'hidden';
|
||||||
aItem.width = 0;
|
aItem.width = 0;
|
||||||
aItem.style.maxWidth = 0;
|
aItem.style.maxWidth = 0;
|
||||||
let task = function(aTime, aBeginning, aChange, aDuration) {
|
let task = function(aTime, aBeginning, aChange, aDuration) {
|
||||||
var width;
|
var width;
|
||||||
if (aTime >= aDuration) {
|
if (aTime >= aDuration) {
|
||||||
width = start + delta;
|
width = start + delta;
|
||||||
finished = true;
|
finished = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
width = start + (delta * Math.sin(aTime / aDuration * radian));
|
width = start + (delta * Math.sin(aTime / aDuration * radian));
|
||||||
finished = false;
|
finished = false;
|
||||||
}
|
}
|
||||||
aItem.removeAttribute('width');
|
aItem.removeAttribute('width');
|
||||||
aItem.style.maxWidth = parseInt(width)+'px';
|
aItem.style.maxWidth = parseInt(width)+'px';
|
||||||
|
|
||||||
var itemBox = aItem.boxObject;
|
var itemBox = aItem.boxObject;
|
||||||
var parentBox = aItem.parentNode.boxObject;
|
var parentBox = aItem.parentNode.boxObject;
|
||||||
if (
|
if (
|
||||||
parentBox.screenX > itemBox.screenX ||
|
parentBox.screenX > itemBox.screenX ||
|
||||||
parentBox.screenX + parentBox.width < itemBox.screenX + itemBox.width
|
parentBox.screenX + parentBox.width < itemBox.screenX + itemBox.width
|
||||||
) {
|
) {
|
||||||
aItem.parentNode.setAttribute('overflow', true);
|
aItem.parentNode.setAttribute('overflow', true);
|
||||||
if (aItem.selected)
|
if (aItem.selected)
|
||||||
aItem.parentNode.scrollBoxObject.ensureElementIsVisible(aItem);
|
aItem.parentNode.scrollBoxObject.ensureElementIsVisible(aItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (finished) {
|
if (finished) {
|
||||||
start = null;
|
start = null;
|
||||||
delta = null;
|
delta = null;
|
||||||
radian = null;
|
radian = null;
|
||||||
aItem = null;
|
aItem = null;
|
||||||
}
|
}
|
||||||
return finished;
|
return finished;
|
||||||
};
|
};
|
||||||
animationManager.addTask(task, 0, 0, 500, window);
|
animationManager.addTask(task, 0, 0, 500, window);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var gDropLinksOnRadioSet,
|
var gDropLinksOnRadioSet,
|
||||||
gGroupBookmarkRadioSet,
|
gGroupBookmarkRadioSet,
|
||||||
gLastStateIsVertical;
|
gLastStateIsVertical;
|
||||||
var gTabbarPlacePositionInitialized = false;
|
var gTabbarPlacePositionInitialized = false;
|
||||||
|
|
||||||
function initTabPane()
|
function initTabPane()
|
||||||
{
|
{
|
||||||
gDropLinksOnTabRadioSet = new RadioSet(
|
gDropLinksOnTabRadioSet = new RadioSet(
|
||||||
'extensions.treestyletab.dropLinksOnTab.behavior',
|
'extensions.treestyletab.dropLinksOnTab.behavior',
|
||||||
'dropLinksOnTab-radiogroup',
|
'dropLinksOnTab-radiogroup',
|
||||||
'dropLinksOnTab-check',
|
'dropLinksOnTab-check',
|
||||||
'dropLinksOnTab-deck'
|
'dropLinksOnTab-deck'
|
||||||
);
|
);
|
||||||
gGroupBookmarkRadioSet = new RadioSet(
|
gGroupBookmarkRadioSet = new RadioSet(
|
||||||
'extensions.treestyletab.openGroupBookmark.behavior',
|
'extensions.treestyletab.openGroupBookmark.behavior',
|
||||||
'openGroupBookmark-radiogroup',
|
'openGroupBookmark-radiogroup',
|
||||||
'openGroupBookmark-check',
|
'openGroupBookmark-check',
|
||||||
'openGroupBookmark-deck'
|
'openGroupBookmark-deck'
|
||||||
);
|
);
|
||||||
|
|
||||||
var newTabPref = document.getElementById('extensions.treestyletab.autoAttach.newTabButton-box');
|
var newTabPref = document.getElementById('extensions.treestyletab.autoAttach.newTabButton-box');
|
||||||
newTabPref.removeAttribute('hidden');
|
newTabPref.removeAttribute('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSyncGroupBookmarkUIToPref()
|
function onSyncGroupBookmarkUIToPref()
|
||||||
{
|
{
|
||||||
ensureGroupBookmarkItems();
|
ensureGroupBookmarkItems();
|
||||||
var behavior = gGroupBookmarkBehaviorPref.value;
|
var behavior = gGroupBookmarkBehaviorPref.value;
|
||||||
if (behavior & 1) behavior ^= 1;
|
if (behavior & 1) behavior ^= 1;
|
||||||
if (behavior & 2) behavior ^= 2;
|
if (behavior & 2) behavior ^= 2;
|
||||||
if (behavior & 4) behavior ^= 4;
|
if (behavior & 4) behavior ^= 4;
|
||||||
if (behavior & 256) behavior ^= 256;
|
if (behavior & 256) behavior ^= 256;
|
||||||
if (behavior & 512) behavior ^= 512;
|
if (behavior & 512) behavior ^= 512;
|
||||||
|
|
||||||
behavior |= parseInt(gGroupBookmarkRadio.value);
|
behavior |= parseInt(gGroupBookmarkRadio.value);
|
||||||
|
|
||||||
if (gGroupBookmarkUnderParent.checked) behavior |= 256;
|
if (gGroupBookmarkUnderParent.checked) behavior |= 256;
|
||||||
if (gGroupBookmarkType.value == 'true') behavior |= 512;
|
if (gGroupBookmarkType.value == 'true') behavior |= 512;
|
||||||
|
|
||||||
var nodes = [
|
var nodes = [
|
||||||
gGroupBookmarkUnderParent,
|
gGroupBookmarkUnderParent,
|
||||||
gGroupBookmarkType,
|
gGroupBookmarkType,
|
||||||
gGroupBookmarkType.previousSibling,
|
gGroupBookmarkType.previousSibling,
|
||||||
gGroupBookmarkType.nextSibling
|
gGroupBookmarkType.nextSibling
|
||||||
];
|
];
|
||||||
for (let i = 0, maxi = nodes.length; i < maxi; i++)
|
for (let i = 0, maxi = nodes.length; i < maxi; i++)
|
||||||
{
|
{
|
||||||
let node = nodes[i];
|
let node = nodes[i];
|
||||||
if (behavior & 1)
|
if (behavior & 1)
|
||||||
node.removeAttribute('disabled');
|
node.removeAttribute('disabled');
|
||||||
else
|
else
|
||||||
node.setAttribute('disabled', true);
|
node.setAttribute('disabled', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return behavior;
|
return behavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSyncGroupBookmarkPrefToUI()
|
function onSyncGroupBookmarkPrefToUI()
|
||||||
{
|
{
|
||||||
ensureGroupBookmarkItems();
|
ensureGroupBookmarkItems();
|
||||||
var behavior = gGroupBookmarkBehaviorPref.value & 1 ? 1 :
|
var behavior = gGroupBookmarkBehaviorPref.value & 1 ? 1 :
|
||||||
gGroupBookmarkBehaviorPref.value & 2 ? 2 :
|
gGroupBookmarkBehaviorPref.value & 2 ? 2 :
|
||||||
gGroupBookmarkBehaviorPref.value & 4 ? 4 :
|
gGroupBookmarkBehaviorPref.value & 4 ? 4 :
|
||||||
0;
|
0;
|
||||||
gGroupBookmarkUnderParent.checked = !!(gGroupBookmarkBehaviorPref.value & 256);
|
gGroupBookmarkUnderParent.checked = !!(gGroupBookmarkBehaviorPref.value & 256);
|
||||||
gGroupBookmarkType.value = gGroupBookmarkBehaviorPref.value & 512 ? 'true' : 'false' ;
|
gGroupBookmarkType.value = gGroupBookmarkBehaviorPref.value & 512 ? 'true' : 'false' ;
|
||||||
return behavior;
|
return behavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function onChangeTabbarPosition()
|
function onChangeTabbarPosition()
|
||||||
{
|
{
|
||||||
var pos = document.getElementById('extensions.treestyletab.tabbar.position-radiogroup').value;
|
var pos = document.getElementById('extensions.treestyletab.tabbar.position-radiogroup').value;
|
||||||
var invertTab = document.getElementById('extensions.treestyletab.tabbar.invertTab-check');
|
var invertTab = document.getElementById('extensions.treestyletab.tabbar.invertTab-check');
|
||||||
var invertTabContents = document.getElementById('extensions.treestyletab.tabbar.invertTabContents-check');
|
var invertTabContents = document.getElementById('extensions.treestyletab.tabbar.invertTabContents-check');
|
||||||
var invertClosebox = document.getElementById('extensions.treestyletab.tabbar.invertClosebox-check');
|
var invertClosebox = document.getElementById('extensions.treestyletab.tabbar.invertClosebox-check');
|
||||||
|
|
||||||
invertTab.disabled = pos != 'right';
|
invertTab.disabled = pos != 'right';
|
||||||
// invertTabContents.disabled = pos != 'right';
|
// invertTabContents.disabled = pos != 'right';
|
||||||
invertClosebox.setAttribute('label',
|
invertClosebox.setAttribute('label',
|
||||||
invertClosebox.getAttribute(
|
invertClosebox.getAttribute(
|
||||||
(pos == 'right' && invertTabContents.checked) ?
|
(pos == 'right' && invertTabContents.checked) ?
|
||||||
'label-right' :
|
'label-right' :
|
||||||
'label-left'
|
'label-left'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (invertClosebox.checked != document.getElementById('extensions.treestyletab.tabbar.invertClosebox').defaultValue)
|
if (invertClosebox.checked != document.getElementById('extensions.treestyletab.tabbar.invertClosebox').defaultValue)
|
||||||
invertClosebox.removeAttribute('collapsed');
|
invertClosebox.removeAttribute('collapsed');
|
||||||
else
|
else
|
||||||
invertClosebox.setAttribute('collapsed', true);
|
invertClosebox.setAttribute('collapsed', true);
|
||||||
|
|
||||||
var maxTreeLevelH = document.getElementById('maxTreeLevel-horizontal');
|
var maxTreeLevelH = document.getElementById('maxTreeLevel-horizontal');
|
||||||
var maxTreeLevelV = document.getElementById('maxTreeLevel-vertical');
|
var maxTreeLevelV = document.getElementById('maxTreeLevel-vertical');
|
||||||
var collapseCheckH = document.getElementById('extensions.treestyletab.allowSubtreeCollapseExpand.horizontal-check');
|
var collapseCheckH = document.getElementById('extensions.treestyletab.allowSubtreeCollapseExpand.horizontal-check');
|
||||||
var collapseCheckV = document.getElementById('extensions.treestyletab.allowSubtreeCollapseExpand.vertical-check');
|
var collapseCheckV = document.getElementById('extensions.treestyletab.allowSubtreeCollapseExpand.vertical-check');
|
||||||
|
|
||||||
if (pos == 'left' || pos == 'right') {
|
if (pos == 'left' || pos == 'right') {
|
||||||
maxTreeLevelH.setAttribute('collapsed', true);
|
maxTreeLevelH.setAttribute('collapsed', true);
|
||||||
maxTreeLevelV.removeAttribute('collapsed');
|
maxTreeLevelV.removeAttribute('collapsed');
|
||||||
collapseCheckH.setAttribute('collapsed', true);
|
collapseCheckH.setAttribute('collapsed', true);
|
||||||
collapseCheckV.removeAttribute('collapsed');
|
collapseCheckV.removeAttribute('collapsed');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
maxTreeLevelH.removeAttribute('collapsed');
|
maxTreeLevelH.removeAttribute('collapsed');
|
||||||
maxTreeLevelV.setAttribute('collapsed', true);
|
maxTreeLevelV.setAttribute('collapsed', true);
|
||||||
collapseCheckH.removeAttribute('collapsed');
|
collapseCheckH.removeAttribute('collapsed');
|
||||||
collapseCheckV.setAttribute('collapsed', true);
|
collapseCheckV.setAttribute('collapsed', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
gTabbarPlacePositionInitialized = true;
|
gTabbarPlacePositionInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSyncMaxTreeLevelUIToPref(aTarget, aSetPrefValue)
|
function onSyncMaxTreeLevelUIToPref(aTarget, aSetPrefValue)
|
||||||
{
|
{
|
||||||
aTarget = document.getElementById(aTarget);
|
aTarget = document.getElementById(aTarget);
|
||||||
if (aTarget.sync)
|
if (aTarget.sync)
|
||||||
return;
|
return;
|
||||||
aTarget.sync = true;
|
aTarget.sync = true;
|
||||||
|
|
||||||
var textbox = aTarget.parentNode.getElementsByTagName('textbox')[0];
|
var textbox = aTarget.parentNode.getElementsByTagName('textbox')[0];
|
||||||
var prefValue = aTarget.checked ? textbox.value : 0 ;
|
var prefValue = aTarget.checked ? textbox.value : 0 ;
|
||||||
|
|
||||||
if (aSetPrefValue)
|
if (aSetPrefValue)
|
||||||
document.getElementById(aTarget.getAttribute('preference')).value = prefValue;
|
document.getElementById(aTarget.getAttribute('preference')).value = prefValue;
|
||||||
|
|
||||||
aTarget.sync = false;
|
aTarget.sync = false;
|
||||||
return prefValue;
|
return prefValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSyncMaxTreeLevelPrefToUI(aTarget)
|
function onSyncMaxTreeLevelPrefToUI(aTarget)
|
||||||
{
|
{
|
||||||
aTarget = document.getElementById(aTarget);
|
aTarget = document.getElementById(aTarget);
|
||||||
if (aTarget.sync)
|
if (aTarget.sync)
|
||||||
return;
|
return;
|
||||||
aTarget.sync = true;
|
aTarget.sync = true;
|
||||||
|
|
||||||
var pref = document.getElementById(aTarget.getAttribute('preference'));
|
var pref = document.getElementById(aTarget.getAttribute('preference'));
|
||||||
var value = pref.value;
|
var value = pref.value;
|
||||||
var UIValue = value != 0;
|
var UIValue = value != 0;
|
||||||
|
|
||||||
var textbox = aTarget.parentNode.getElementsByTagName('textbox')[0];
|
var textbox = aTarget.parentNode.getElementsByTagName('textbox')[0];
|
||||||
|
|
||||||
if (UIValue)
|
if (UIValue)
|
||||||
textbox.value = value;
|
textbox.value = value;
|
||||||
|
|
||||||
syncEnabledState(aTarget, UIValue);
|
syncEnabledState(aTarget, UIValue);
|
||||||
|
|
||||||
aTarget.sync = false;
|
aTarget.sync = false;
|
||||||
return UIValue;
|
return UIValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function initAutoHidePane()
|
function initAutoHidePane()
|
||||||
{
|
{
|
||||||
syncEnabledState('extensions.treestyletab.tabbar.autoShow.mousemove-check', 'this.checked');
|
syncEnabledState('extensions.treestyletab.tabbar.autoShow.mousemove-check', 'this.checked');
|
||||||
syncEnabledState('extensions.treestyletab.tabbar.autoShow.accelKeyDown-check', 'this.checked');
|
syncEnabledState('extensions.treestyletab.tabbar.autoShow.accelKeyDown-check', 'this.checked');
|
||||||
syncEnabledState('extensions.treestyletab.tabbar.autoShow.feedback-check', 'this.checked');
|
syncEnabledState('extensions.treestyletab.tabbar.autoShow.feedback-check', 'this.checked');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onChangeAutoHideMode(aRadioGroup, aTogglePref)
|
function onChangeAutoHideMode(aRadioGroup, aTogglePref)
|
||||||
{
|
{
|
||||||
if (aRadioGroup.value != 0)
|
if (aRadioGroup.value != 0)
|
||||||
document.getElementById(aTogglePref).value = aRadioGroup.value;
|
document.getElementById(aTogglePref).value = aRadioGroup.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function initTreePane()
|
function initTreePane()
|
||||||
{
|
{
|
||||||
syncEnabledState('extensions.treestyletab.closeParentBehavior-radiogroup', 'this.value == 0');
|
syncEnabledState('extensions.treestyletab.closeParentBehavior-radiogroup', 'this.value == 0');
|
||||||
|
|
||||||
var focusMode = document.getElementById('extensions.treestyletab.focusMode-check');
|
var focusMode = document.getElementById('extensions.treestyletab.focusMode-check');
|
||||||
var focusModePref = document.getElementById('extensions.treestyletab.focusMode');
|
var focusModePref = document.getElementById('extensions.treestyletab.focusMode');
|
||||||
if (focusModePref.value != focusModePref.defaultValue)
|
if (focusModePref.value != focusModePref.defaultValue)
|
||||||
focusMode.removeAttribute('collapsed');
|
focusMode.removeAttribute('collapsed');
|
||||||
else
|
else
|
||||||
focusMode.setAttribute('collapsed', true);
|
focusMode.setAttribute('collapsed', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var gBookmarkDroppedTabsRadioSet,
|
var gBookmarkDroppedTabsRadioSet,
|
||||||
gUndoCloseTabSetRadioSet;
|
gUndoCloseTabSetRadioSet;
|
||||||
|
|
||||||
function initAdvancedPane()
|
function initAdvancedPane()
|
||||||
{
|
{
|
||||||
gBookmarkDroppedTabsRadioSet = new RadioSet(
|
gBookmarkDroppedTabsRadioSet = new RadioSet(
|
||||||
'extensions.treestyletab.bookmarkDroppedTabs.behavior',
|
'extensions.treestyletab.bookmarkDroppedTabs.behavior',
|
||||||
'bookmarkDroppedTabs-radiogroup',
|
'bookmarkDroppedTabs-radiogroup',
|
||||||
'bookmarkDroppedTabs-check',
|
'bookmarkDroppedTabs-check',
|
||||||
'bookmarkDroppedTabs-deck'
|
'bookmarkDroppedTabs-deck'
|
||||||
);
|
);
|
||||||
|
|
||||||
gUndoCloseTabSetRadioSet = new RadioSet(
|
gUndoCloseTabSetRadioSet = new RadioSet(
|
||||||
'extensions.treestyletab.undoCloseTabSet.behavior',
|
'extensions.treestyletab.undoCloseTabSet.behavior',
|
||||||
'undoCloseTabSet-radiogroup',
|
'undoCloseTabSet-radiogroup',
|
||||||
'undoCloseTabSet-check',
|
'undoCloseTabSet-check',
|
||||||
'undoCloseTabSet-deck',
|
'undoCloseTabSet-deck',
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function RadioSet(aPref, aRadio, aCheck, aDeck, aAskFlag)
|
function RadioSet(aPref, aRadio, aCheck, aDeck, aAskFlag)
|
||||||
{
|
{
|
||||||
this.pref = document.getElementById(aPref);
|
this.pref = document.getElementById(aPref);
|
||||||
this.radio = document.getElementById(aRadio);
|
this.radio = document.getElementById(aRadio);
|
||||||
this.check = document.getElementById(aCheck);
|
this.check = document.getElementById(aCheck);
|
||||||
this.deck = document.getElementById(aDeck);
|
this.deck = document.getElementById(aDeck);
|
||||||
this.backup = this.value || 1;
|
this.backup = this.value || 1;
|
||||||
this.askValue = aAskFlag;
|
this.askValue = aAskFlag;
|
||||||
|
|
||||||
if (this.askValue ? this.value & this.askValue : this.value == 0 ) {
|
if (this.askValue ? this.value & this.askValue : this.value == 0 ) {
|
||||||
this.check.checked = true;
|
this.check.checked = true;
|
||||||
this.deck.selectedIndex = 0;
|
this.deck.selectedIndex = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.check.checked = false;
|
this.check.checked = false;
|
||||||
this.deck.selectedIndex = 1;
|
this.deck.selectedIndex = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RadioSet.prototype = {
|
RadioSet.prototype = {
|
||||||
onChange : function(aDontUpdatePref)
|
onChange : function(aDontUpdatePref)
|
||||||
{
|
{
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
this.backup = this.value;
|
this.backup = this.value;
|
||||||
this.deck.selectedIndex = 0;
|
this.deck.selectedIndex = 0;
|
||||||
if (this.askValue) {
|
if (this.askValue) {
|
||||||
this.value |= this.askValue;
|
this.value |= this.askValue;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.value = 0;
|
this.value = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.deck.selectedIndex = 1;
|
this.deck.selectedIndex = 1;
|
||||||
this.value = this.backup;
|
this.value = this.backup;
|
||||||
if (this.askValue && this.value & this.askValue) {
|
if (this.askValue && this.value & this.askValue) {
|
||||||
this.value ^= this.askValue;
|
this.value ^= this.askValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!aDontUpdatePref)
|
if (!aDontUpdatePref)
|
||||||
this.pref.value = this.value;
|
this.pref.value = this.value;
|
||||||
},
|
},
|
||||||
|
|
||||||
get checked()
|
get checked()
|
||||||
{
|
{
|
||||||
return this.check.checked;
|
return this.check.checked;
|
||||||
},
|
},
|
||||||
set checked(aValue)
|
set checked(aValue)
|
||||||
{
|
{
|
||||||
return this.check.checked = aValue;
|
return this.check.checked = aValue;
|
||||||
},
|
},
|
||||||
|
|
||||||
get value()
|
get value()
|
||||||
{
|
{
|
||||||
return parseInt(this.radio.value);
|
return parseInt(this.radio.value);
|
||||||
},
|
},
|
||||||
set value(aValue)
|
set value(aValue)
|
||||||
{
|
{
|
||||||
return this.radio.value = aValue;
|
return this.radio.value = aValue;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,50 +1,50 @@
|
|||||||
<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
|
<?xml-stylesheet type="text/css" href="chrome://global/skin/"?>
|
||||||
<?xml-stylesheet type="text/css" href="chrome://treestyletab/skin/group.css"?>
|
<?xml-stylesheet type="text/css" href="chrome://treestyletab/skin/group.css"?>
|
||||||
<?xml-stylesheet type="text/css" href="chrome://treestyletab/skin/pseudo-tree.css"?>
|
<?xml-stylesheet type="text/css" href="chrome://treestyletab/skin/pseudo-tree.css"?>
|
||||||
<!DOCTYPE page SYSTEM "chrome://treestyletab/locale/treestyletab.dtd">
|
<!DOCTYPE page SYSTEM "chrome://treestyletab/locale/treestyletab.dtd">
|
||||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
title="&group.default;">
|
title="&group.default;">
|
||||||
<commandset>
|
<commandset>
|
||||||
<command id="cmd_enterEdit" oncommand="groupTab.enterEdit()"/>
|
<command id="cmd_enterEdit" oncommand="groupTab.enterEdit()"/>
|
||||||
</commandset>
|
</commandset>
|
||||||
<keyset>
|
<keyset>
|
||||||
<key keycode="VK_F2" command="cmd_enterEdit"/>
|
<key keycode="VK_F2" command="cmd_enterEdit"/>
|
||||||
</keyset>
|
</keyset>
|
||||||
<stack flex="1">
|
<stack flex="1">
|
||||||
<box class="background-image-container">
|
<box class="background-image-container">
|
||||||
<image class="icon background-image"/>
|
<image class="icon background-image"/>
|
||||||
</box>
|
</box>
|
||||||
<vbox class="label-container" flex="1">
|
<vbox class="label-container" flex="1">
|
||||||
<hbox align="center">
|
<hbox align="center">
|
||||||
<deck id="deck" flex="1">
|
<deck id="deck" flex="1">
|
||||||
<hbox align="center">
|
<hbox align="center">
|
||||||
<image class="icon"/>
|
<image class="icon"/>
|
||||||
<label id="label"
|
<label id="label"
|
||||||
flex="1"
|
flex="1"
|
||||||
crop="end"
|
crop="end"
|
||||||
value="&group.default;"
|
value="&group.default;"
|
||||||
tooltiptext="&group.default;"/>
|
tooltiptext="&group.default;"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
<hbox align="center">
|
<hbox align="center">
|
||||||
<image class="icon"/>
|
<image class="icon"/>
|
||||||
<textbox id="editor"
|
<textbox id="editor"
|
||||||
flex="1"
|
flex="1"
|
||||||
value="&group.default;"/>
|
value="&group.default;"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</deck>
|
</deck>
|
||||||
<checkbox id="temporary" label="&group.temporary;"
|
<checkbox id="temporary" label="&group.temporary;"
|
||||||
oncommand="groupTab.temporary = this.checked;"/>
|
oncommand="groupTab.temporary = this.checked;"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
<vbox id="tree"
|
<vbox id="tree"
|
||||||
flex="1"/>
|
flex="1"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
</stack>
|
</stack>
|
||||||
<link xmlns="http://www.w3.org/1999/xhtml" rel="icon"
|
<link xmlns="http://www.w3.org/1999/xhtml" rel="icon"
|
||||||
href="chrome://treestyletab-group/skin/group.png"/>
|
href="chrome://treestyletab-group/skin/group.png"/>
|
||||||
<script type="application/javascript"><![CDATA[
|
<script type="application/javascript"><![CDATA[
|
||||||
|
|
||||||
Components.utils.import('resource://treestyletab-modules/groupTab.js');
|
Components.utils.import('resource://treestyletab-modules/groupTab.js');
|
||||||
new GroupTab(window);
|
new GroupTab(window);
|
||||||
|
|
||||||
]]></script>
|
]]></script>
|
||||||
</page>
|
</page>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
@namespace url("http://www.w3.org/1999/xhtml");
|
@namespace url("http://www.w3.org/1999/xhtml");
|
||||||
|
|
||||||
body > embed[name="plugin"] {
|
body > embed[name="plugin"] {
|
||||||
visibility: hidden !important;
|
visibility: hidden !important;
|
||||||
}
|
}
|
||||||
|
@ -1,35 +1,35 @@
|
|||||||
***** BEGIN LICENSE BLOCK *****
|
***** BEGIN LICENSE BLOCK *****
|
||||||
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
|
||||||
The contents of these files are subject to the Mozilla Public License Version
|
The contents of these files are subject to the Mozilla Public License Version
|
||||||
1.1 (the "License"); you may not use these files except in compliance with
|
1.1 (the "License"); you may not use these files except in compliance with
|
||||||
the License. You may obtain a copy of the License at
|
the License. You may obtain a copy of the License at
|
||||||
http://www.mozilla.org/MPL/
|
http://www.mozilla.org/MPL/
|
||||||
|
|
||||||
Software distributed under the License is distributed on an "AS IS" basis,
|
Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
for the specific language governing rights and limitations under the
|
for the specific language governing rights and limitations under the
|
||||||
License.
|
License.
|
||||||
|
|
||||||
The Original Code is the Tree Style Tab.
|
The Original Code is the Tree Style Tab.
|
||||||
|
|
||||||
The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
Portions created by the Initial Developer are Copyright (C) 2007-2014
|
Portions created by the Initial Developer are Copyright (C) 2007-2014
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
Alice0775 (fixes some compatibility problems)
|
Alice0775 (fixes some compatibility problems)
|
||||||
|
|
||||||
Alternatively, the contents of these files may be used under the terms of
|
Alternatively, the contents of these files may be used under the terms of
|
||||||
either the GNU General Public License Version 2 or later (the "GPL"), or
|
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
in which case the provisions of the GPL or the LGPL are applicable instead
|
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
of those above. If you wish to allow use of your version of these files only
|
of those above. If you wish to allow use of your version of these files only
|
||||||
under the terms of either the GPL or the LGPL, and not to allow others to
|
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
use your version of these files under the terms of the MPL, indicate your
|
use your version of these files under the terms of the MPL, indicate your
|
||||||
decision by deleting the provisions above and replace them with the notice
|
decision by deleting the provisions above and replace them with the notice
|
||||||
and other provisions required by the GPL or the LGPL. If you do not delete
|
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
the provisions above, a recipient may use your version of these files under
|
the provisions above, a recipient may use your version of these files under
|
||||||
the terms of any one of the MPL, the GPL or the LGPL.
|
the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
|
|
||||||
***** END LICENSE BLOCK *****
|
***** END LICENSE BLOCK *****
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE overlay SYSTEM "chrome://treestyletab/locale/treestyletab.dtd">
|
<!DOCTYPE overlay SYSTEM "chrome://treestyletab/locale/treestyletab.dtd">
|
||||||
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
<preferences id="prefpane-selection-menu-preferences">
|
<preferences id="prefpane-selection-menu-preferences">
|
||||||
<preference id="extensions.multipletab.show.multipletab-selection-item-removeTabSubtree"
|
<preference id="extensions.multipletab.show.multipletab-selection-item-removeTabSubtree"
|
||||||
name="extensions.multipletab.show.multipletab-selection-item-removeTabSubtree"
|
name="extensions.multipletab.show.multipletab-selection-item-removeTabSubtree"
|
||||||
type="bool"/>
|
type="bool"/>
|
||||||
<preference id="extensions.multipletab.show.multipletab-selection-item-createSubtree"
|
<preference id="extensions.multipletab.show.multipletab-selection-item-createSubtree"
|
||||||
name="extensions.multipletab.show.multipletab-selection-item-createSubtree"
|
name="extensions.multipletab.show.multipletab-selection-item-createSubtree"
|
||||||
type="bool"/>
|
type="bool"/>
|
||||||
</preferences>
|
</preferences>
|
||||||
<vbox id="prefpane-selection-menu-items">
|
<vbox id="prefpane-selection-menu-items">
|
||||||
<checkbox id="extensions.multipletab.show.multipletab-selection-item-removeTabSubtree-check"
|
<checkbox id="extensions.multipletab.show.multipletab-selection-item-removeTabSubtree-check"
|
||||||
preference="extensions.multipletab.show.multipletab-selection-item-removeTabSubtree"
|
preference="extensions.multipletab.show.multipletab-selection-item-removeTabSubtree"
|
||||||
label="&selection.removeTabSubtree.label;"/>
|
label="&selection.removeTabSubtree.label;"/>
|
||||||
<checkbox id="extensions.multipletab.show.multipletab-selection-item-createSubtree-check"
|
<checkbox id="extensions.multipletab.show.multipletab-selection-item-createSubtree-check"
|
||||||
preference="extensions.multipletab.show.multipletab-selection-item-createSubtree"
|
preference="extensions.multipletab.show.multipletab-selection-item-createSubtree"
|
||||||
label="&selection.createSubtree.label;"/>
|
label="&selection.createSubtree.label;"/>
|
||||||
</vbox>
|
</vbox>
|
||||||
|
|
||||||
</overlay>
|
</overlay>
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||||
|
|
||||||
/* hacks for Tab Mix Plus */
|
/* hacks for Tab Mix Plus */
|
||||||
|
|
||||||
:root[treestyletab-enable-compatibility-tmp="true"]
|
:root[treestyletab-enable-compatibility-tmp="true"]
|
||||||
tabbrowser[treestyletab-mode="vertical"] #vide-bar,
|
tabbrowser[treestyletab-mode="vertical"] #vide-bar,
|
||||||
:root[treestyletab-enable-compatibility-tmp="true"]
|
:root[treestyletab-enable-compatibility-tmp="true"]
|
||||||
tabbrowser[treestyletab-mode="vertical"] #tabs-scroll-up-down-box,
|
tabbrowser[treestyletab-mode="vertical"] #tabs-scroll-up-down-box,
|
||||||
:root[treestyletab-enable-compatibility-tmp="true"]
|
:root[treestyletab-enable-compatibility-tmp="true"]
|
||||||
tabbrowser[treestyletab-mode="vertical"] #alltabs-place-holder,
|
tabbrowser[treestyletab-mode="vertical"] #alltabs-place-holder,
|
||||||
:root[treestyletab-enable-compatibility-tmp="true"]
|
:root[treestyletab-enable-compatibility-tmp="true"]
|
||||||
tabbrowser[treestyletab-mode="vertical"] .tabs-scroll {
|
tabbrowser[treestyletab-mode="vertical"] .tabs-scroll {
|
||||||
visibility: collapse !important;
|
visibility: collapse !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[treestyletab-enable-compatibility-tmp="true"]
|
:root[treestyletab-enable-compatibility-tmp="true"]
|
||||||
tabbrowser[treestyletab-mode="vertical"] tabs[flowing] > * .tabs-frame {
|
tabbrowser[treestyletab-mode="vertical"] tabs[flowing] > * .tabs-frame {
|
||||||
overflow-x: hidden !important;
|
overflow-x: hidden !important;
|
||||||
overflow-y: auto !important;
|
overflow-y: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[treestyletab-enable-compatibility-tmp="true"]
|
:root[treestyletab-enable-compatibility-tmp="true"]
|
||||||
tabbrowser[treestyletab-mode="vertical"] tabs[flowing] > * .tabs-frame {
|
tabbrowser[treestyletab-mode="vertical"] tabs[flowing] > * .tabs-frame {
|
||||||
box-flex: 1 !important;
|
box-flex: 1 !important;
|
||||||
-moz-box-flex: 1 !important;
|
-moz-box-flex: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabbrowser-tab[pinned] > .tab-image-left,
|
.tabbrowser-tab[pinned] > .tab-image-left,
|
||||||
.tabbrowser-tab[pinned] > .tab-drag-indicator-left,
|
.tabbrowser-tab[pinned] > .tab-drag-indicator-left,
|
||||||
.tabbrowser-tab[pinned] > .tab-drag-indicator-right,
|
.tabbrowser-tab[pinned] > .tab-drag-indicator-right,
|
||||||
.tabbrowser-tab[pinned] > .tab-image-right {
|
.tabbrowser-tab[pinned] > .tab-image-right {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,23 +1,23 @@
|
|||||||
(function() {
|
(function() {
|
||||||
/**
|
/**
|
||||||
* On secondary (and later) window, SSWindowStateBusy event can be fired
|
* On secondary (and later) window, SSWindowStateBusy event can be fired
|
||||||
* before DOMContentLoad, on "domwindowopened".
|
* before DOMContentLoad, on "domwindowopened".
|
||||||
*/
|
*/
|
||||||
var SSWindowStateBusyListener = function TSTSSWindowStateBusyListener(aEvent) {
|
var SSWindowStateBusyListener = function TSTSSWindowStateBusyListener(aEvent) {
|
||||||
window.removeEventListener(aEvent.type, TSTSSWindowStateBusyListener, false);
|
window.removeEventListener(aEvent.type, TSTSSWindowStateBusyListener, false);
|
||||||
window.__treestyletab__WindowStateBusy = true;
|
window.__treestyletab__WindowStateBusy = true;
|
||||||
SSWindowStateBusyListener = undefined;
|
SSWindowStateBusyListener = undefined;
|
||||||
};
|
};
|
||||||
window.addEventListener('SSWindowStateBusy', SSWindowStateBusyListener, false);
|
window.addEventListener('SSWindowStateBusy', SSWindowStateBusyListener, false);
|
||||||
window.addEventListener('DOMContentLoad', function onDOMContentLoad(aEvent) {
|
window.addEventListener('DOMContentLoad', function onDOMContentLoad(aEvent) {
|
||||||
window.removeEventListener(aEvent.type, onDOMContentLoad, false);
|
window.removeEventListener(aEvent.type, onDOMContentLoad, false);
|
||||||
if (SSWindowStateBusyListener) {
|
if (SSWindowStateBusyListener) {
|
||||||
window.removeEventListener('SSWindowStateBusy', TSTSSWindowStateBusyListener, false);
|
window.removeEventListener('SSWindowStateBusy', TSTSSWindowStateBusyListener, false);
|
||||||
SSWindowStateBusyListener = undefined;
|
SSWindowStateBusyListener = undefined;
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
var ns = {};
|
var ns = {};
|
||||||
Components.utils.import('resource://treestyletab-modules/window.js', ns);
|
Components.utils.import('resource://treestyletab-modules/window.js', ns);
|
||||||
new ns.TreeStyleTabWindow(window);
|
new ns.TreeStyleTabWindow(window);
|
||||||
})();
|
})();
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<bindings xmlns="http://www.mozilla.org/xbl"
|
<bindings xmlns="http://www.mozilla.org/xbl"
|
||||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||||
|
|
||||||
<binding id="tab-icon"
|
<binding id="tab-icon"
|
||||||
display="xul:stack">
|
display="xul:stack">
|
||||||
<content>
|
<content>
|
||||||
<xul:image xbl:inherits="validate,src" class="tab-icon-image"/>
|
<xul:image xbl:inherits="validate,src" class="tab-icon-image"/>
|
||||||
<xbl:children/>
|
<xbl:children/>
|
||||||
</content>
|
</content>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
If these bindings are unexpectedly re-assigned, then all attributes
|
If these bindings are unexpectedly re-assigned, then all attributes
|
||||||
(including sizes) are lost and the appearance becomes broken.
|
(including sizes) are lost and the appearance becomes broken.
|
||||||
To prevent this problem, the inner box should inherit all attributes
|
To prevent this problem, the inner box should inherit all attributes
|
||||||
given via setTabbrowserAttribute() method, from the parent element.
|
given via setTabbrowserAttribute() method, from the parent element.
|
||||||
See also: https://github.com/piroor/treestyletab/issues/538
|
See also: https://github.com/piroor/treestyletab/issues/538
|
||||||
|
|
||||||
On some versions, these inheritence are done by xbl:constructor.
|
On some versions, these inheritence are done by xbl:constructor.
|
||||||
However, it causes infinitely loop on some environments, so
|
However, it causes infinitely loop on some environments, so
|
||||||
now I use xbl:inherits.
|
now I use xbl:inherits.
|
||||||
See also: https://github.com/piroor/treestyletab/issues/550
|
See also: https://github.com/piroor/treestyletab/issues/550
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<binding id="toolbar"
|
<binding id="toolbar"
|
||||||
extends="chrome://treestyletab/content/base-toolbar-binding.xml#toolbar">
|
extends="chrome://treestyletab/content/base-toolbar-binding.xml#toolbar">
|
||||||
<content><xul:hbox flex="1"
|
<content><xul:hbox flex="1"
|
||||||
xbl:inherits="orient,width,height,treestyletab-allow-subtree-collapse,treestyletab-animation-enabled,treestyletab-closebox-inverted,treestyletab-firsttab-border,treestyletab-invert-scrollbar,treestyletab-max-tree-level,treestyletab-mode,treestyletab-narrow-scrollbar,treestyletab-print-preview,treestyletab-stack-collapsed-tabs,treestyletab-style,treestyletab-tab-contents-inverted,treestyletab-tab-inverted,treestyletab-tabbar-autohide,treestyletab-tabbar-autohide-state,treestyletab-tabbar-fixed,treestyletab-tabbar-fixed-horizontal,treestyletab-tabbar-fixed-vertical,treestyletab-tabbar-position,treestyletab-tabbar-resizing,treestyletab-tabs-indented,treestyletab-twisty-style"
|
xbl:inherits="orient,width,height,treestyletab-allow-subtree-collapse,treestyletab-animation-enabled,treestyletab-closebox-inverted,treestyletab-firsttab-border,treestyletab-invert-scrollbar,treestyletab-max-tree-level,treestyletab-mode,treestyletab-narrow-scrollbar,treestyletab-print-preview,treestyletab-stack-collapsed-tabs,treestyletab-style,treestyletab-tab-contents-inverted,treestyletab-tab-inverted,treestyletab-tabbar-autohide,treestyletab-tabbar-autohide-state,treestyletab-tabbar-fixed,treestyletab-tabbar-fixed-horizontal,treestyletab-tabbar-fixed-vertical,treestyletab-tabbar-position,treestyletab-tabbar-resizing,treestyletab-tabs-indented,treestyletab-twisty-style"
|
||||||
anonid="toolbar-innerbox"
|
anonid="toolbar-innerbox"
|
||||||
class="treestyletab-toolbar-inner-box"><xbl:children/></xul:hbox></content>
|
class="treestyletab-toolbar-inner-box"><xbl:children/></xul:hbox></content>
|
||||||
<implementation>
|
<implementation>
|
||||||
<field name="treeStyleTabToolbarInnerBox" readonly="true">
|
<field name="treeStyleTabToolbarInnerBox" readonly="true">
|
||||||
document.getAnonymousElementByAttribute(this, 'anonid', 'toolbar-innerbox')
|
document.getAnonymousElementByAttribute(this, 'anonid', 'toolbar-innerbox')
|
||||||
</field>
|
</field>
|
||||||
</implementation>
|
</implementation>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<binding id="toolbar-drag"
|
<binding id="toolbar-drag"
|
||||||
extends="chrome://treestyletab/content/base-toolbar-binding.xml#toolbar-drag">
|
extends="chrome://treestyletab/content/base-toolbar-binding.xml#toolbar-drag">
|
||||||
<content><xul:hbox flex="1"
|
<content><xul:hbox flex="1"
|
||||||
xbl:inherits="orient,width,height,treestyletab-allow-subtree-collapse,treestyletab-animation-enabled,treestyletab-closebox-inverted,treestyletab-firsttab-border,treestyletab-invert-scrollbar,treestyletab-max-tree-level,treestyletab-mode,treestyletab-narrow-scrollbar,treestyletab-print-preview,treestyletab-stack-collapsed-tabs,treestyletab-style,treestyletab-tab-contents-inverted,treestyletab-tab-inverted,treestyletab-tabbar-autohide,treestyletab-tabbar-autohide-state,treestyletab-tabbar-fixed,treestyletab-tabbar-fixed-horizontal,treestyletab-tabbar-fixed-vertical,treestyletab-tabbar-position,treestyletab-tabbar-resizing,treestyletab-tabs-indented,treestyletab-twisty-style"
|
xbl:inherits="orient,width,height,treestyletab-allow-subtree-collapse,treestyletab-animation-enabled,treestyletab-closebox-inverted,treestyletab-firsttab-border,treestyletab-invert-scrollbar,treestyletab-max-tree-level,treestyletab-mode,treestyletab-narrow-scrollbar,treestyletab-print-preview,treestyletab-stack-collapsed-tabs,treestyletab-style,treestyletab-tab-contents-inverted,treestyletab-tab-inverted,treestyletab-tabbar-autohide,treestyletab-tabbar-autohide-state,treestyletab-tabbar-fixed,treestyletab-tabbar-fixed-horizontal,treestyletab-tabbar-fixed-vertical,treestyletab-tabbar-position,treestyletab-tabbar-resizing,treestyletab-tabs-indented,treestyletab-twisty-style"
|
||||||
anonid="toolbar-innerbox"
|
anonid="toolbar-innerbox"
|
||||||
class="treestyletab-toolbar-inner-box"><xbl:children/></xul:hbox></content>
|
class="treestyletab-toolbar-inner-box"><xbl:children/></xul:hbox></content>
|
||||||
<implementation>
|
<implementation>
|
||||||
<field name="treeStyleTabToolbarInnerBox" readonly="true">
|
<field name="treeStyleTabToolbarInnerBox" readonly="true">
|
||||||
document.getAnonymousElementByAttribute(this, 'anonid', 'toolbar-innerbox')
|
document.getAnonymousElementByAttribute(this, 'anonid', 'toolbar-innerbox')
|
||||||
</field>
|
</field>
|
||||||
</implementation>
|
</implementation>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
</bindings>
|
</bindings>
|
||||||
|
@ -1,152 +1,152 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<?xml-stylesheet href="treestyletab.css" type="text/css"?>
|
<?xml-stylesheet href="treestyletab.css" type="text/css"?>
|
||||||
<?xml-stylesheet href="treestyletab-tmp.css" type="text/css"?><!-- hacks for Tab Mix Plus -->
|
<?xml-stylesheet href="treestyletab-tmp.css" type="text/css"?><!-- hacks for Tab Mix Plus -->
|
||||||
|
|
||||||
<?xml-stylesheet href="chrome://treestyletab/skin/base.css" type="text/css"?>
|
<?xml-stylesheet href="chrome://treestyletab/skin/base.css" type="text/css"?>
|
||||||
<?xml-stylesheet href="chrome://treestyletab/skin/twisty/twisty.css" type="text/css"?>
|
<?xml-stylesheet href="chrome://treestyletab/skin/twisty/twisty.css" type="text/css"?>
|
||||||
<?xml-stylesheet href="chrome://treestyletab/skin/ui.css" type="text/css"?>
|
<?xml-stylesheet href="chrome://treestyletab/skin/ui.css" type="text/css"?>
|
||||||
<?xml-stylesheet href="chrome://treestyletab/skin/tmp.css" type="text/css"?><!-- hacks for Tab Mix Plus -->
|
<?xml-stylesheet href="chrome://treestyletab/skin/tmp.css" type="text/css"?><!-- hacks for Tab Mix Plus -->
|
||||||
<?xml-stylesheet href="chrome://treestyletab/skin/platform-base.css" type="text/css"?>
|
<?xml-stylesheet href="chrome://treestyletab/skin/platform-base.css" type="text/css"?>
|
||||||
<?xml-stylesheet href="chrome://treestyletab/skin/pseudo-tree.css" type="text/css"?>
|
<?xml-stylesheet href="chrome://treestyletab/skin/pseudo-tree.css" type="text/css"?>
|
||||||
|
|
||||||
<!DOCTYPE overlay SYSTEM "chrome://treestyletab/locale/treestyletab.dtd">
|
<!DOCTYPE overlay SYSTEM "chrome://treestyletab/locale/treestyletab.dtd">
|
||||||
<overlay id="treestyletab-overlay"
|
<overlay id="treestyletab-overlay"
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
<script src="res/stopRendering.js" type="application/javascript"/>
|
<script src="res/stopRendering.js" type="application/javascript"/>
|
||||||
<script src="res/tabsDragUtils.js" type="application/javascript"/>
|
<script src="res/tabsDragUtils.js" type="application/javascript"/>
|
||||||
<script src="treestyletab.js" type="application/javascript"/>
|
<script src="treestyletab.js" type="application/javascript"/>
|
||||||
<script src="windowHelper.js" type="application/javascript"/>
|
<script src="windowHelper.js" type="application/javascript"/>
|
||||||
<script src="windowHelperHacks.js" type="application/javascript"/>
|
<script src="windowHelperHacks.js" type="application/javascript"/>
|
||||||
<script src="bookmarksOverlay.js" type="application/javascript"/>
|
<script src="bookmarksOverlay.js" type="application/javascript"/>
|
||||||
<script src="bookmarksOverlayEditable.js" type="application/javascript"/>
|
<script src="bookmarksOverlayEditable.js" type="application/javascript"/>
|
||||||
|
|
||||||
|
|
||||||
<script type="application/javascript"><![CDATA[
|
<script type="application/javascript"><![CDATA[
|
||||||
// for backward compatibility
|
// for backward compatibility
|
||||||
var TreeStyleTabBrowserAutoHide = TreeStyleTabService.autoHideWindow;
|
var TreeStyleTabBrowserAutoHide = TreeStyleTabService.autoHideWindow;
|
||||||
|
|
||||||
// preload images
|
// preload images
|
||||||
TreeStyleTabService.observe(
|
TreeStyleTabService.observe(
|
||||||
null,
|
null,
|
||||||
'nsPref:changed',
|
'nsPref:changed',
|
||||||
'extensions.treestyletab.tabbar.style'
|
'extensions.treestyletab.tabbar.style'
|
||||||
);
|
);
|
||||||
]]></script>
|
]]></script>
|
||||||
|
|
||||||
|
|
||||||
<!-- Multiple Tab Handler -->
|
<!-- Multiple Tab Handler -->
|
||||||
<menupopup id="multipletab-selection-menu">
|
<menupopup id="multipletab-selection-menu">
|
||||||
<menuitem id="multipletab-selection-item-removeTabSubtree"
|
<menuitem id="multipletab-selection-item-removeTabSubtree"
|
||||||
insertafter="multipletab-selection-removeTabs"
|
insertafter="multipletab-selection-removeTabs"
|
||||||
label="&selection.removeTabSubtree.label;"
|
label="&selection.removeTabSubtree.label;"
|
||||||
accesskey="&selection.removeTabSubtree.accesskey;"
|
accesskey="&selection.removeTabSubtree.accesskey;"
|
||||||
oncommand="TreeStyleTabService.removeTabSubtree(MultipleTabService.getSelectedTabs());"
|
oncommand="TreeStyleTabService.removeTabSubtree(MultipleTabService.getSelectedTabs());"
|
||||||
multipletab-available="selectedTabs.length"/>
|
multipletab-available="selectedTabs.length"/>
|
||||||
<menuitem id="multipletab-selection-item-createSubtree"
|
<menuitem id="multipletab-selection-item-createSubtree"
|
||||||
insertafter="multipletab-selection-splitWindow"
|
insertafter="multipletab-selection-splitWindow"
|
||||||
label="&selection.createSubtree.label;"
|
label="&selection.createSubtree.label;"
|
||||||
accesskey="&selection.createSubtree.accesskey;"
|
accesskey="&selection.createSubtree.accesskey;"
|
||||||
oncommand="TreeStyleTabService.createSubtree(MultipleTabService.getSelectedTabs());"
|
oncommand="TreeStyleTabService.createSubtree(MultipleTabService.getSelectedTabs());"
|
||||||
multipletab-enabled="TreeStyleTabService.canCreateSubtree(selectedTabs)"/>
|
multipletab-enabled="TreeStyleTabService.canCreateSubtree(selectedTabs)"/>
|
||||||
</menupopup>
|
</menupopup>
|
||||||
|
|
||||||
<popupset id="mainPopupSet">
|
<popupset id="mainPopupSet">
|
||||||
<menupopup id="multipletab-tabcontext-menu-template">
|
<menupopup id="multipletab-tabcontext-menu-template">
|
||||||
|
|
||||||
<menuitem id="context-item-reloadTabSubtree"
|
<menuitem id="context-item-reloadTabSubtree"
|
||||||
label="&context.reloadTabSubtree.label;"
|
label="&context.reloadTabSubtree.label;"
|
||||||
accesskey="&context.reloadTabSubtree.accesskey;"
|
accesskey="&context.reloadTabSubtree.accesskey;"
|
||||||
oncommand="TreeStyleTabService.reloadTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);"
|
oncommand="TreeStyleTabService.reloadTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);"
|
||||||
onclick="if (event.button == 1 || (event.button == 0 && TreeStyleTabService.isAccelKeyPressed(event))) {
|
onclick="if (event.button == 1 || (event.button == 0 && TreeStyleTabService.isAccelKeyPressed(event))) {
|
||||||
TreeStyleTabService.reloadTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab, true);
|
TreeStyleTabService.reloadTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab, true);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.parentNode.hidePopup();
|
this.parentNode.hidePopup();
|
||||||
}"
|
}"
|
||||||
multipletab-insertafter="tabContextMenu.querySelector("*[id^='context_reloadTab']")"/>
|
multipletab-insertafter="tabContextMenu.querySelector("*[id^='context_reloadTab']")"/>
|
||||||
<menuitem id="context-item-reloadDescendantTabs"
|
<menuitem id="context-item-reloadDescendantTabs"
|
||||||
label="&context.reloadDescendantTabs.label;"
|
label="&context.reloadDescendantTabs.label;"
|
||||||
accesskey="&context.reloadDescendantTabs.accesskey;"
|
accesskey="&context.reloadDescendantTabs.accesskey;"
|
||||||
oncommand="TreeStyleTabService.reloadTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab, true);"
|
oncommand="TreeStyleTabService.reloadTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab, true);"
|
||||||
onclick="if (event.button == 1 || (event.button == 0 && TreeStyleTabService.isAccelKeyPressed(event))) {
|
onclick="if (event.button == 1 || (event.button == 0 && TreeStyleTabService.isAccelKeyPressed(event))) {
|
||||||
TreeStyleTabService.reloadTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);
|
TreeStyleTabService.reloadTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.parentNode.hidePopup();
|
this.parentNode.hidePopup();
|
||||||
}"
|
}"
|
||||||
multipletab-insertafter="tabContextMenu.querySelector("*[id^='context-item-reloadTabSubtree']")"/>
|
multipletab-insertafter="tabContextMenu.querySelector("*[id^='context-item-reloadTabSubtree']")"/>
|
||||||
|
|
||||||
<menuitem id="context-item-removeTabSubtree"
|
<menuitem id="context-item-removeTabSubtree"
|
||||||
label="&context.removeTabSubtree.label;"
|
label="&context.removeTabSubtree.label;"
|
||||||
accesskey="&context.removeTabSubtree.accesskey;"
|
accesskey="&context.removeTabSubtree.accesskey;"
|
||||||
oncommand="TreeStyleTabService.removeTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);"
|
oncommand="TreeStyleTabService.removeTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);"
|
||||||
onclick="if (event.button == 1 || (event.button == 0 && TreeStyleTabService.isAccelKeyPressed(event))) {
|
onclick="if (event.button == 1 || (event.button == 0 && TreeStyleTabService.isAccelKeyPressed(event))) {
|
||||||
TreeStyleTabService.removeTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab, true);
|
TreeStyleTabService.removeTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab, true);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.parentNode.hidePopup();
|
this.parentNode.hidePopup();
|
||||||
}"
|
}"
|
||||||
multipletab-insertbefore="TreeStyleTabService.evaluateXPath(
|
multipletab-insertbefore="TreeStyleTabService.evaluateXPath(
|
||||||
"(descendant::*[starts-with(@id, 'multipletab-context-removeAll') | starts-with(@id, 'context_closeTab')][1] | child::xul:menuitem[last()])/preceding-sibling::xul:menuseparator[1]"
|
"(descendant::*[starts-with(@id, 'multipletab-context-removeAll') | starts-with(@id, 'context_closeTab')][1] | child::xul:menuitem[last()])/preceding-sibling::xul:menuseparator[1]"
|
||||||
, tabContextMenu, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue"/>
|
, tabContextMenu, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue"/>
|
||||||
<menuitem id="context-item-removeDescendantTabs"
|
<menuitem id="context-item-removeDescendantTabs"
|
||||||
label="&context.removeDescendantTabs.label;"
|
label="&context.removeDescendantTabs.label;"
|
||||||
accesskey="&context.removeDescendantTabs.accesskey;"
|
accesskey="&context.removeDescendantTabs.accesskey;"
|
||||||
oncommand="TreeStyleTabService.removeTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab, true);"
|
oncommand="TreeStyleTabService.removeTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab, true);"
|
||||||
onclick="if (event.button == 1 || (event.button == 0 && TreeStyleTabService.isAccelKeyPressed(event))) {
|
onclick="if (event.button == 1 || (event.button == 0 && TreeStyleTabService.isAccelKeyPressed(event))) {
|
||||||
TreeStyleTabService.removeTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);
|
TreeStyleTabService.removeTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.parentNode.hidePopup();
|
this.parentNode.hidePopup();
|
||||||
}"
|
}"
|
||||||
multipletab-insertafter="tabContextMenu.querySelector("*[id^='context-item-removeTabSubtree']")"/>
|
multipletab-insertafter="tabContextMenu.querySelector("*[id^='context-item-removeTabSubtree']")"/>
|
||||||
<menuitem id="context-item-removeAllTabsButThisTree"
|
<menuitem id="context-item-removeAllTabsButThisTree"
|
||||||
label="&context.removeAllTabsBut.label;"
|
label="&context.removeAllTabsBut.label;"
|
||||||
accesskey="&context.removeAllTabsBut.accesskey;"
|
accesskey="&context.removeAllTabsBut.accesskey;"
|
||||||
oncommand="TreeStyleTabService.removeAllTabsBut(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);"
|
oncommand="TreeStyleTabService.removeAllTabsBut(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);"
|
||||||
multipletab-insertafter="tabContextMenu.querySelector("*[id^='context_closeOtherTabs']")"/>
|
multipletab-insertafter="tabContextMenu.querySelector("*[id^='context_closeOtherTabs']")"/>
|
||||||
|
|
||||||
<menuitem id="context-item-bookmarkTabSubtree"
|
<menuitem id="context-item-bookmarkTabSubtree"
|
||||||
label="&context.bookmarkTabSubtree.label;"
|
label="&context.bookmarkTabSubtree.label;"
|
||||||
accesskey="&context.bookmarkTabSubtree.accesskey;"
|
accesskey="&context.bookmarkTabSubtree.accesskey;"
|
||||||
oncommand="TreeStyleTabBookmarksService.bookmarkTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);"
|
oncommand="TreeStyleTabBookmarksService.bookmarkTabSubtree(TreeStyleTabService.getTabBrowserFromChild(this).mContextTab);"
|
||||||
multipletab-insertafter="TreeStyleTabService.evaluateXPath(
|
multipletab-insertafter="TreeStyleTabService.evaluateXPath(
|
||||||
"descendant::*[starts-with(@id, 'context_bookmarkTab')][1] | descendant::*[@command='Browser:BookmarkAllTabs']/preceding-sibling[1]"
|
"descendant::*[starts-with(@id, 'context_bookmarkTab')][1] | descendant::*[@command='Browser:BookmarkAllTabs']/preceding-sibling[1]"
|
||||||
, tabContextMenu, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue"/>
|
, tabContextMenu, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue"/>
|
||||||
|
|
||||||
|
|
||||||
<!-- simply appended items -->
|
<!-- simply appended items -->
|
||||||
|
|
||||||
<menuseparator id="context-separator-collapseExpandAll"/>
|
<menuseparator id="context-separator-collapseExpandAll"/>
|
||||||
<menuitem id="context-item-collapseAllSubtree"
|
<menuitem id="context-item-collapseAllSubtree"
|
||||||
label="&context.collapseAllSubtree.label;"
|
label="&context.collapseAllSubtree.label;"
|
||||||
accesskey="&context.collapseAllSubtree.accesskey;"
|
accesskey="&context.collapseAllSubtree.accesskey;"
|
||||||
oncommand="TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab.collapseExpandAllSubtree(true);"/>
|
oncommand="TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab.collapseExpandAllSubtree(true);"/>
|
||||||
<menuitem id="context-item-expandAllSubtree"
|
<menuitem id="context-item-expandAllSubtree"
|
||||||
label="&context.expandAllSubtree.label;"
|
label="&context.expandAllSubtree.label;"
|
||||||
accesskey="&context.expandAllSubtree.accesskey;"
|
accesskey="&context.expandAllSubtree.accesskey;"
|
||||||
oncommand="TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab.collapseExpandAllSubtree(false);"/>
|
oncommand="TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab.collapseExpandAllSubtree(false);"/>
|
||||||
|
|
||||||
<menuseparator id="context-separator-toggleAutoHide"/>
|
<menuseparator id="context-separator-toggleAutoHide"/>
|
||||||
<menuitem id="context-item-toggleAutoHide"
|
<menuitem id="context-item-toggleAutoHide"
|
||||||
label="&context.toggleAutoHide.label;"
|
label="&context.toggleAutoHide.label;"
|
||||||
accesskey="&context.toggleAutoHide.accesskey;"
|
accesskey="&context.toggleAutoHide.accesskey;"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
autocheck="false"
|
autocheck="false"
|
||||||
oncommand="TreeStyleTabService.toggleAutoHide(TreeStyleTabService.getTabBrowserFromChild(this));"/>
|
oncommand="TreeStyleTabService.toggleAutoHide(TreeStyleTabService.getTabBrowserFromChild(this));"/>
|
||||||
<menuitem id="context-item-toggleFixed"
|
<menuitem id="context-item-toggleFixed"
|
||||||
label="&context.toggleFixed.label;"
|
label="&context.toggleFixed.label;"
|
||||||
label-horizontal="&context.toggleFixed.label.horizontal;"
|
label-horizontal="&context.toggleFixed.label.horizontal;"
|
||||||
label-vertical="&context.toggleFixed.label.vertical;"
|
label-vertical="&context.toggleFixed.label.vertical;"
|
||||||
accesskey="&context.toggleFixed.accesskey;"
|
accesskey="&context.toggleFixed.accesskey;"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
autocheck="false"
|
autocheck="false"
|
||||||
oncommand="TreeStyleTabService.toggleFixed(TreeStyleTabService.getTabBrowserFromChild(this));"/>
|
oncommand="TreeStyleTabService.toggleFixed(TreeStyleTabService.getTabBrowserFromChild(this));"/>
|
||||||
</menupopup>
|
</menupopup>
|
||||||
<tooltip id="treestyletab-full-tree-tooltip"/>
|
<tooltip id="treestyletab-full-tree-tooltip"/>
|
||||||
<panel id="treestyletab-autohide-content-area-screen"
|
<panel id="treestyletab-autohide-content-area-screen"
|
||||||
treestyletab-ignore-state="true"
|
treestyletab-ignore-state="true"
|
||||||
onpopupshown="if ('setConsumeRollupEvent' in this.popupBoxObject) this.popupBoxObject.setConsumeRollupEvent(Components.interfaces.nsIPopupBoxObject.ROLLUP_NO_CONSUME);"
|
onpopupshown="if ('setConsumeRollupEvent' in this.popupBoxObject) this.popupBoxObject.setConsumeRollupEvent(Components.interfaces.nsIPopupBoxObject.ROLLUP_NO_CONSUME);"
|
||||||
onclick="this.hidePopup();"
|
onclick="this.hidePopup();"
|
||||||
onDOMMouseScroll="this.hidePopup()"/>
|
onDOMMouseScroll="this.hidePopup()"/>
|
||||||
</popupset>
|
</popupset>
|
||||||
|
|
||||||
</overlay>
|
</overlay>
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2808
modules/autoHide.js
2808
modules/autoHide.js
File diff suppressed because it is too large
Load Diff
5150
modules/base.js
5150
modules/base.js
File diff suppressed because it is too large
Load Diff
13624
modules/browser.js
13624
modules/browser.js
File diff suppressed because it is too large
Load Diff
@ -1,127 +1,127 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is the Tree Style Tab.
|
* The Original Code is the Tree Style Tab.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2013
|
* Portions created by the Initial Developer are Copyright (C) 2013
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
* Infocatcher <https://github.com/Infocatcher>
|
* Infocatcher <https://github.com/Infocatcher>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ******/
|
* ***** END LICENSE BLOCK ******/
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ['BrowserUIShowHideObserver'];
|
const EXPORTED_SYMBOLS = ['BrowserUIShowHideObserver'];
|
||||||
|
|
||||||
Components.utils.import('resource://treestyletab-modules/constants.js');
|
Components.utils.import('resource://treestyletab-modules/constants.js');
|
||||||
|
|
||||||
function BrowserUIShowHideObserver(aOwner, aBox) {
|
function BrowserUIShowHideObserver(aOwner, aBox) {
|
||||||
this.owner = aOwner;
|
this.owner = aOwner;
|
||||||
this.box = aBox;
|
this.box = aBox;
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
BrowserUIShowHideObserver.prototype = {
|
BrowserUIShowHideObserver.prototype = {
|
||||||
get MutationObserver()
|
get MutationObserver()
|
||||||
{
|
{
|
||||||
var w = this.box.ownerDocument.defaultView;
|
var w = this.box.ownerDocument.defaultView;
|
||||||
return w.MutationObserver || w.MozMutationObserver;
|
return w.MutationObserver || w.MozMutationObserver;
|
||||||
},
|
},
|
||||||
|
|
||||||
init : function BrowserUIShowHideObserver_onInit()
|
init : function BrowserUIShowHideObserver_onInit()
|
||||||
{
|
{
|
||||||
if (!this.MutationObserver)
|
if (!this.MutationObserver)
|
||||||
return;
|
return;
|
||||||
this.observer = new this.MutationObserver((function(aMutations, aObserver) {
|
this.observer = new this.MutationObserver((function(aMutations, aObserver) {
|
||||||
this.onMutation(aMutations, aObserver);
|
this.onMutation(aMutations, aObserver);
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
this.observer.observe(this.box, {
|
this.observer.observe(this.box, {
|
||||||
childList : true,
|
childList : true,
|
||||||
attributes : true,
|
attributes : true,
|
||||||
subtree : true,
|
subtree : true,
|
||||||
attributeFilter : [
|
attributeFilter : [
|
||||||
'hidden',
|
'hidden',
|
||||||
'collapsed',
|
'collapsed',
|
||||||
'moz-collapsed', // Used in full screen mode
|
'moz-collapsed', // Used in full screen mode
|
||||||
'disablechrome'
|
'disablechrome'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onMutation : function BrowserUIShowHideObserver_onMutation(aMutations, aObserver)
|
onMutation : function BrowserUIShowHideObserver_onMutation(aMutations, aObserver)
|
||||||
{
|
{
|
||||||
aMutations.forEach(function(aMutation) {
|
aMutations.forEach(function(aMutation) {
|
||||||
switch (aMutation.type)
|
switch (aMutation.type)
|
||||||
{
|
{
|
||||||
case 'childList':
|
case 'childList':
|
||||||
if (aMutation.target == this.box)
|
if (aMutation.target == this.box)
|
||||||
this.owner.browser.treeStyleTab.updateFloatingTabbar(TreeStyleTabConstants.kTABBAR_UPDATE_BY_WINDOW_RESIZE);
|
this.owner.browser.treeStyleTab.updateFloatingTabbar(TreeStyleTabConstants.kTABBAR_UPDATE_BY_WINDOW_RESIZE);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'attributes':
|
case 'attributes':
|
||||||
this.onAttributeModified(aMutation, aObserver);
|
this.onAttributeModified(aMutation, aObserver);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy : function BrowserUIShowHideObserver_destroy()
|
destroy : function BrowserUIShowHideObserver_destroy()
|
||||||
{
|
{
|
||||||
if (this.observer) {
|
if (this.observer) {
|
||||||
this.observer.disconnect();
|
this.observer.disconnect();
|
||||||
delete this.observer;
|
delete this.observer;
|
||||||
}
|
}
|
||||||
delete this.box;
|
delete this.box;
|
||||||
delete this.owner;
|
delete this.owner;
|
||||||
},
|
},
|
||||||
|
|
||||||
onAttributeModified : function BrowserUIShowHideObserver_onAttributeModified(aMutation, aObserver)
|
onAttributeModified : function BrowserUIShowHideObserver_onAttributeModified(aMutation, aObserver)
|
||||||
{
|
{
|
||||||
if (this.handlingAttrChange)
|
if (this.handlingAttrChange)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var TST = this.owner.browser.treeStyleTab;
|
var TST = this.owner.browser.treeStyleTab;
|
||||||
if (
|
if (
|
||||||
// I must ignore show/hide of elements managed by TST,
|
// I must ignore show/hide of elements managed by TST,
|
||||||
// to avoid infinity loop.
|
// to avoid infinity loop.
|
||||||
aMutation.target.hasAttribute(TreeStyleTabConstants.kTAB_STRIP_ELEMENT) &&
|
aMutation.target.hasAttribute(TreeStyleTabConstants.kTAB_STRIP_ELEMENT) &&
|
||||||
// However, I have to synchronize visibility of the real
|
// However, I have to synchronize visibility of the real
|
||||||
// tab bar and the placeholder's one. If they have
|
// tab bar and the placeholder's one. If they have
|
||||||
// different visibility, then the tab bar is shown or
|
// different visibility, then the tab bar is shown or
|
||||||
// hidden by "auto hide tab bar" feature of someone
|
// hidden by "auto hide tab bar" feature of someone
|
||||||
// (Pale Moon, Tab Mix Plus, etc.)
|
// (Pale Moon, Tab Mix Plus, etc.)
|
||||||
this.owner.browser.tabContainer.visible != TST.tabStripPlaceHolder.collapsed
|
this.owner.browser.tabContainer.visible != TST.tabStripPlaceHolder.collapsed
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.handlingAttrChange = true;
|
this.handlingAttrChange = true;
|
||||||
|
|
||||||
TST.updateFloatingTabbar(TreeStyleTabConstants.kTABBAR_UPDATE_BY_WINDOW_RESIZE);
|
TST.updateFloatingTabbar(TreeStyleTabConstants.kTABBAR_UPDATE_BY_WINDOW_RESIZE);
|
||||||
|
|
||||||
var w = this.box.ownerDocument.defaultView;
|
var w = this.box.ownerDocument.defaultView;
|
||||||
w.setTimeout((function() {
|
w.setTimeout((function() {
|
||||||
this.handlingAttrChange = false;
|
this.handlingAttrChange = false;
|
||||||
}).bind(this), 10);
|
}).bind(this), 10);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,206 +1,206 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is the Tree Style Tab.
|
* The Original Code is the Tree Style Tab.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010-2014
|
* Portions created by the Initial Developer are Copyright (C) 2010-2014
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ******/
|
* ***** END LICENSE BLOCK ******/
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ['TreeStyleTabConstants'];
|
const EXPORTED_SYMBOLS = ['TreeStyleTabConstants'];
|
||||||
|
|
||||||
const TreeStyleTabConstants = Object.freeze({
|
const TreeStyleTabConstants = Object.freeze({
|
||||||
/* attributes */
|
/* attributes */
|
||||||
kID : 'treestyletab-id',
|
kID : 'treestyletab-id',
|
||||||
kCHILDREN : 'treestyletab-children',
|
kCHILDREN : 'treestyletab-children',
|
||||||
kPARENT : 'treestyletab-parent',
|
kPARENT : 'treestyletab-parent',
|
||||||
kANCESTOR : 'treestyletab-ancestors',
|
kANCESTOR : 'treestyletab-ancestors',
|
||||||
kNEST : 'treestyletab-nest',
|
kNEST : 'treestyletab-nest',
|
||||||
kINSERT_BEFORE : 'treestyletab-insert-before',
|
kINSERT_BEFORE : 'treestyletab-insert-before',
|
||||||
kINSERT_AFTER : 'treestyletab-insert-after',
|
kINSERT_AFTER : 'treestyletab-insert-after',
|
||||||
kCLOSED_SET_ID : 'treestyletab-closed-set-id',
|
kCLOSED_SET_ID : 'treestyletab-closed-set-id',
|
||||||
|
|
||||||
kID_NEW : 'treestyletab-id-new',
|
kID_NEW : 'treestyletab-id-new',
|
||||||
kID_RESTORING : 'treestyletab-id-restoring',
|
kID_RESTORING : 'treestyletab-id-restoring',
|
||||||
kCHILDREN_RESTORING : 'treestyletab-children-restoring',
|
kCHILDREN_RESTORING : 'treestyletab-children-restoring',
|
||||||
|
|
||||||
kSUBTREE_COLLAPSED : 'treestyletab-subtree-collapsed',
|
kSUBTREE_COLLAPSED : 'treestyletab-subtree-collapsed',
|
||||||
kSUBTREE_EXPANDED_MANUALLY : 'treestyletab-subtree-expanded-manually',
|
kSUBTREE_EXPANDED_MANUALLY : 'treestyletab-subtree-expanded-manually',
|
||||||
kCOLLAPSED : 'treestyletab-collapsed',
|
kCOLLAPSED : 'treestyletab-collapsed',
|
||||||
kCOLLAPSED_DONE : 'treestyletab-collapsed-done',
|
kCOLLAPSED_DONE : 'treestyletab-collapsed-done',
|
||||||
kCOLLAPSING_PHASE : 'treestyletab-collapsing-phase',
|
kCOLLAPSING_PHASE : 'treestyletab-collapsing-phase',
|
||||||
kCOLLAPSING_PHASE_TO_BE_COLLAPSED : 'collapse',
|
kCOLLAPSING_PHASE_TO_BE_COLLAPSED : 'collapse',
|
||||||
kCOLLAPSING_PHASE_TO_BE_EXPANDED : 'expand',
|
kCOLLAPSING_PHASE_TO_BE_EXPANDED : 'expand',
|
||||||
kALLOW_COLLAPSE : 'treestyletab-allow-subtree-collapse',
|
kALLOW_COLLAPSE : 'treestyletab-allow-subtree-collapse',
|
||||||
kALLOW_STACK : 'treestyletab-stack-collapsed-tabs',
|
kALLOW_STACK : 'treestyletab-stack-collapsed-tabs',
|
||||||
kREMOVED : 'treestyletab-removed',
|
kREMOVED : 'treestyletab-removed',
|
||||||
|
|
||||||
kX_OFFSET : 'treestyletab-x-offset',
|
kX_OFFSET : 'treestyletab-x-offset',
|
||||||
kY_OFFSET : 'treestyletab-y-offset',
|
kY_OFFSET : 'treestyletab-y-offset',
|
||||||
|
|
||||||
kTABBAR_POSITION : 'treestyletab-tabbar-position',
|
kTABBAR_POSITION : 'treestyletab-tabbar-position',
|
||||||
kMODE : 'treestyletab-mode',
|
kMODE : 'treestyletab-mode',
|
||||||
|
|
||||||
kHIDE_NEWTAB : 'treestyletab-hide-newtab-button',
|
kHIDE_NEWTAB : 'treestyletab-hide-newtab-button',
|
||||||
kSTYLE : 'treestyletab-style',
|
kSTYLE : 'treestyletab-style',
|
||||||
kFIRSTTAB_BORDER : 'treestyletab-firsttab-border',
|
kFIRSTTAB_BORDER : 'treestyletab-firsttab-border',
|
||||||
kFIXED : 'treestyletab-tabbar-fixed',
|
kFIXED : 'treestyletab-tabbar-fixed',
|
||||||
kRESIZING : 'treestyletab-tabbar-resizing',
|
kRESIZING : 'treestyletab-tabbar-resizing',
|
||||||
kINDENTED : 'treestyletab-tabs-indented',
|
kINDENTED : 'treestyletab-tabs-indented',
|
||||||
kMAX_LEVEL : 'treestyletab-max-tree-level',
|
kMAX_LEVEL : 'treestyletab-max-tree-level',
|
||||||
kPRINT_PREVIEW : 'treestyletab-print-preview',
|
kPRINT_PREVIEW : 'treestyletab-print-preview',
|
||||||
kANIMATION_ENABLED : 'treestyletab-animation-enabled',
|
kANIMATION_ENABLED : 'treestyletab-animation-enabled',
|
||||||
kINVERT_SCROLLBAR : 'treestyletab-invert-scrollbar',
|
kINVERT_SCROLLBAR : 'treestyletab-invert-scrollbar',
|
||||||
kNARROW_SCROLLBAR : 'treestyletab-narrow-scrollbar',
|
kNARROW_SCROLLBAR : 'treestyletab-narrow-scrollbar',
|
||||||
kFAVICONIZED : 'treestyletab-faviconized',
|
kFAVICONIZED : 'treestyletab-faviconized',
|
||||||
kBG_NOTIFY_PHASE : 'treestyletab-notifybgtab-phase',
|
kBG_NOTIFY_PHASE : 'treestyletab-notifybgtab-phase',
|
||||||
kIGNORE_POPUP_STATE : 'treestyletab-ignore-state',
|
kIGNORE_POPUP_STATE : 'treestyletab-ignore-state',
|
||||||
kDOM_FULLSCREEN_ACTIVATED : 'treestyletab-dom-fullscreen-activated',
|
kDOM_FULLSCREEN_ACTIVATED : 'treestyletab-dom-fullscreen-activated',
|
||||||
|
|
||||||
kTAB_INVERTED : 'treestyletab-tab-inverted',
|
kTAB_INVERTED : 'treestyletab-tab-inverted',
|
||||||
kTAB_CONTENTS_INVERTED : 'treestyletab-tab-contents-inverted',
|
kTAB_CONTENTS_INVERTED : 'treestyletab-tab-contents-inverted',
|
||||||
kCLOSEBOX_INVERTED : 'treestyletab-closebox-inverted',
|
kCLOSEBOX_INVERTED : 'treestyletab-closebox-inverted',
|
||||||
|
|
||||||
kTWISTY_HOVER : 'treestyletab-twisty-hover',
|
kTWISTY_HOVER : 'treestyletab-twisty-hover',
|
||||||
kTWISTY_STYLE : 'treestyletab-twisty-style',
|
kTWISTY_STYLE : 'treestyletab-twisty-style',
|
||||||
|
|
||||||
kDROP_POSITION : 'treestyletab-drop-position',
|
kDROP_POSITION : 'treestyletab-drop-position',
|
||||||
kDRAG_TYPE_TABBAR : 'application/x-moz-treestyletab-tabbrowser-tabbar',
|
kDRAG_TYPE_TABBAR : 'application/x-moz-treestyletab-tabbrowser-tabbar',
|
||||||
kDROP_POSITION_UNKNOWN : 'unknown',
|
kDROP_POSITION_UNKNOWN : 'unknown',
|
||||||
kTABBAR_MOVE_FORCE : 'force',
|
kTABBAR_MOVE_FORCE : 'force',
|
||||||
kTABBAR_MOVE_NORMAL : 'normal',
|
kTABBAR_MOVE_NORMAL : 'normal',
|
||||||
|
|
||||||
kTAB_STRIP_ELEMENT : 'treestyletab-tabstrip-element',
|
kTAB_STRIP_ELEMENT : 'treestyletab-tabstrip-element',
|
||||||
|
|
||||||
/* classes */
|
/* classes */
|
||||||
kTWISTY : 'treestyletab-twisty',
|
kTWISTY : 'treestyletab-twisty',
|
||||||
kCOUNTER : 'treestyletab-counter',
|
kCOUNTER : 'treestyletab-counter',
|
||||||
kCOUNTER_CONTAINER : 'treestyletab-counter-container',
|
kCOUNTER_CONTAINER : 'treestyletab-counter-container',
|
||||||
kCOUNTER_PAREN : 'treestyletab-counter-paren',
|
kCOUNTER_PAREN : 'treestyletab-counter-paren',
|
||||||
kSPLITTER : 'treestyletab-splitter',
|
kSPLITTER : 'treestyletab-splitter',
|
||||||
kTABBAR_TOGGLER : 'treestyletab-tabbar-toggler',
|
kTABBAR_TOGGLER : 'treestyletab-tabbar-toggler',
|
||||||
kTABBAR_PLACEHOLDER : 'treestyletab-tabbar-placeholder',
|
kTABBAR_PLACEHOLDER : 'treestyletab-tabbar-placeholder',
|
||||||
kTABBAR_TOOLBAR : 'treestyletab-tabbar-toolbar',
|
kTABBAR_TOOLBAR : 'treestyletab-tabbar-toolbar',
|
||||||
kTABBAR_TOOLBAR_READY : 'treestyletab-tabbar-toolbar-ready',
|
kTABBAR_TOOLBAR_READY : 'treestyletab-tabbar-toolbar-ready',
|
||||||
kTABBAR_TOOLBAR_READY_POPUP : 'treestyletab-tabbar-toolbar-ready-popup',
|
kTABBAR_TOOLBAR_READY_POPUP : 'treestyletab-tabbar-toolbar-ready-popup',
|
||||||
|
|
||||||
/* event types, topics */
|
/* event types, topics */
|
||||||
kEVENT_TYPE_TAB_FOCUS_SWITCHING_KEY_DOWN : 'nsDOMTreeStyleTabFocusSwitchingKeyDown',
|
kEVENT_TYPE_TAB_FOCUS_SWITCHING_KEY_DOWN : 'nsDOMTreeStyleTabFocusSwitchingKeyDown',
|
||||||
kEVENT_TYPE_TAB_FOCUS_SWITCHING_START : 'nsDOMTreeStyleTabFocusSwitchingStart',
|
kEVENT_TYPE_TAB_FOCUS_SWITCHING_START : 'nsDOMTreeStyleTabFocusSwitchingStart',
|
||||||
kEVENT_TYPE_TAB_FOCUS_SWITCHING_END : 'nsDOMTreeStyleTabFocusSwitchingEnd',
|
kEVENT_TYPE_TAB_FOCUS_SWITCHING_END : 'nsDOMTreeStyleTabFocusSwitchingEnd',
|
||||||
kTAB_FOCUS_SWITCHING_SCROLL_DOWN : (1 << 0),
|
kTAB_FOCUS_SWITCHING_SCROLL_DOWN : (1 << 0),
|
||||||
kTAB_FOCUS_SWITCHING_SCROLL_UP : (1 << 1),
|
kTAB_FOCUS_SWITCHING_SCROLL_UP : (1 << 1),
|
||||||
kTAB_FOCUS_SWITCHING_STAND_BY : (1 << 2),
|
kTAB_FOCUS_SWITCHING_STAND_BY : (1 << 2),
|
||||||
kTAB_FOCUS_SWITCHING_ONLY_SHIFT_KEY : (1 << 3),
|
kTAB_FOCUS_SWITCHING_ONLY_SHIFT_KEY : (1 << 3),
|
||||||
kEVENT_TYPE_SUBTREE_CLOSING : 'nsDOMTreeStyleTabSubtreeClosing',
|
kEVENT_TYPE_SUBTREE_CLOSING : 'nsDOMTreeStyleTabSubtreeClosing',
|
||||||
kEVENT_TYPE_SUBTREE_CLOSED : 'nsDOMTreeStyleTabSubtreeClosed',
|
kEVENT_TYPE_SUBTREE_CLOSED : 'nsDOMTreeStyleTabSubtreeClosed',
|
||||||
kEVENT_TYPE_TAB_COLLAPSED_STATE_CHANGED : 'nsDOMTreeStyleTabCollapsedStateChange',
|
kEVENT_TYPE_TAB_COLLAPSED_STATE_CHANGED : 'nsDOMTreeStyleTabCollapsedStateChange',
|
||||||
kEVENT_TYPE_TABBAR_INITIALIZED : 'nsDOMTreeStyleTabTabbarInitialized',
|
kEVENT_TYPE_TABBAR_INITIALIZED : 'nsDOMTreeStyleTabTabbarInitialized',
|
||||||
kEVENT_TYPE_TABBAR_POSITION_CHANGING : 'nsDOMTreeStyleTabTabbarPositionChanging',
|
kEVENT_TYPE_TABBAR_POSITION_CHANGING : 'nsDOMTreeStyleTabTabbarPositionChanging',
|
||||||
kEVENT_TYPE_TABBAR_POSITION_CHANGED : 'nsDOMTreeStyleTabTabbarPositionChanged',
|
kEVENT_TYPE_TABBAR_POSITION_CHANGED : 'nsDOMTreeStyleTabTabbarPositionChanged',
|
||||||
kEVENT_TYPE_TABBAR_STATE_CHANGING : 'nsDOMTreeStyleTabTabbarStateChanging',
|
kEVENT_TYPE_TABBAR_STATE_CHANGING : 'nsDOMTreeStyleTabTabbarStateChanging',
|
||||||
kEVENT_TYPE_TABBAR_STATE_CHANGED : 'nsDOMTreeStyleTabTabbarStateChanged',
|
kEVENT_TYPE_TABBAR_STATE_CHANGED : 'nsDOMTreeStyleTabTabbarStateChanged',
|
||||||
kEVENT_TYPE_FOCUS_NEXT_TAB : 'nsDOMTreeStyleTabFocusNextTab',
|
kEVENT_TYPE_FOCUS_NEXT_TAB : 'nsDOMTreeStyleTabFocusNextTab',
|
||||||
kEVENT_TYPE_ATTACHED : 'nsDOMTreeStyleTabAttached',
|
kEVENT_TYPE_ATTACHED : 'nsDOMTreeStyleTabAttached',
|
||||||
kEVENT_TYPE_DETACHED : 'nsDOMTreeStyleTabParted',
|
kEVENT_TYPE_DETACHED : 'nsDOMTreeStyleTabParted',
|
||||||
|
|
||||||
kEVENT_TYPE_PRINT_PREVIEW_ENTERED : 'nsDOMTreeStyleTabPrintPreviewEntered',
|
kEVENT_TYPE_PRINT_PREVIEW_ENTERED : 'nsDOMTreeStyleTabPrintPreviewEntered',
|
||||||
kEVENT_TYPE_PRINT_PREVIEW_EXITED : 'nsDOMTreeStyleTabPrintPreviewExited',
|
kEVENT_TYPE_PRINT_PREVIEW_EXITED : 'nsDOMTreeStyleTabPrintPreviewExited',
|
||||||
kEVENT_TYPE_AUTO_HIDE_STATE_CHANGING : 'nsDOMTreeStyleTabAutoHideStateChanging',
|
kEVENT_TYPE_AUTO_HIDE_STATE_CHANGING : 'nsDOMTreeStyleTabAutoHideStateChanging',
|
||||||
kEVENT_TYPE_AUTO_HIDE_STATE_CHANGE : 'nsDOMTreeStyleTabAutoHideStateChange',
|
kEVENT_TYPE_AUTO_HIDE_STATE_CHANGE : 'nsDOMTreeStyleTabAutoHideStateChange',
|
||||||
|
|
||||||
kTOPIC_INDENT_MODIFIED : 'TreeStyleTab:indentModified',
|
kTOPIC_INDENT_MODIFIED : 'TreeStyleTab:indentModified',
|
||||||
kTOPIC_COLLAPSE_EXPAND_ALL : 'TreeStyleTab:collapseExpandAllSubtree',
|
kTOPIC_COLLAPSE_EXPAND_ALL : 'TreeStyleTab:collapseExpandAllSubtree',
|
||||||
kTOPIC_CHANGE_TREEVIEW_AVAILABILITY : 'TreeStyleTab:changeTreeViewAvailability',
|
kTOPIC_CHANGE_TREEVIEW_AVAILABILITY : 'TreeStyleTab:changeTreeViewAvailability',
|
||||||
|
|
||||||
/* other constant values */
|
/* other constant values */
|
||||||
kFOCUS_ALL : 0,
|
kFOCUS_ALL : 0,
|
||||||
kFOCUS_VISIBLE : 1,
|
kFOCUS_VISIBLE : 1,
|
||||||
|
|
||||||
kDROP_BEFORE : -1,
|
kDROP_BEFORE : -1,
|
||||||
kDROP_ON : 0,
|
kDROP_ON : 0,
|
||||||
kDROP_AFTER : 1,
|
kDROP_AFTER : 1,
|
||||||
|
|
||||||
kACTION_MOVE : 1 << 0,
|
kACTION_MOVE : 1 << 0,
|
||||||
kACTION_STAY : 1 << 1,
|
kACTION_STAY : 1 << 1,
|
||||||
kACTION_DUPLICATE : 1 << 2,
|
kACTION_DUPLICATE : 1 << 2,
|
||||||
kACTION_IMPORT : 1 << 3,
|
kACTION_IMPORT : 1 << 3,
|
||||||
kACTION_NEWTAB : 1 << 4,
|
kACTION_NEWTAB : 1 << 4,
|
||||||
kACTION_ATTACH : 1 << 10,
|
kACTION_ATTACH : 1 << 10,
|
||||||
kACTION_PART : 1 << 11,
|
kACTION_PART : 1 << 11,
|
||||||
kACTIONS_FOR_SOURCE : (1 << 0) | (1 << 1),
|
kACTIONS_FOR_SOURCE : (1 << 0) | (1 << 1),
|
||||||
kACTIONS_FOR_DESTINATION : (1 << 2) | (1 << 3),
|
kACTIONS_FOR_DESTINATION : (1 << 2) | (1 << 3),
|
||||||
|
|
||||||
kTABBAR_TOP : 1 << 0,
|
kTABBAR_TOP : 1 << 0,
|
||||||
kTABBAR_BOTTOM : 1 << 1,
|
kTABBAR_BOTTOM : 1 << 1,
|
||||||
kTABBAR_LEFT : 1 << 2,
|
kTABBAR_LEFT : 1 << 2,
|
||||||
kTABBAR_RIGHT : 1 << 3,
|
kTABBAR_RIGHT : 1 << 3,
|
||||||
|
|
||||||
kTABBAR_HORIZONTAL : (1 << 0) | (1 << 1),
|
kTABBAR_HORIZONTAL : (1 << 0) | (1 << 1),
|
||||||
kTABBAR_VERTICAL : (1 << 2) | (1 << 3),
|
kTABBAR_VERTICAL : (1 << 2) | (1 << 3),
|
||||||
kTABBAR_REGULAR : (1 << 0) | (1 << 2),
|
kTABBAR_REGULAR : (1 << 0) | (1 << 2),
|
||||||
kTABBAR_INVERTED : (1 << 3) | (1 << 4),
|
kTABBAR_INVERTED : (1 << 3) | (1 << 4),
|
||||||
|
|
||||||
kINSERT_FISRT : 0,
|
kINSERT_FISRT : 0,
|
||||||
kINSERT_LAST : 1,
|
kINSERT_LAST : 1,
|
||||||
|
|
||||||
kTABBAR_UPDATE_BY_UNKNOWN_REASON : (1 << 0),
|
kTABBAR_UPDATE_BY_UNKNOWN_REASON : (1 << 0),
|
||||||
kTABBAR_UPDATE_BY_RESET : (1 << 1),
|
kTABBAR_UPDATE_BY_RESET : (1 << 1),
|
||||||
kTABBAR_UPDATE_BY_PREF_CHANGE : (1 << 2),
|
kTABBAR_UPDATE_BY_PREF_CHANGE : (1 << 2),
|
||||||
kTABBAR_UPDATE_BY_APPEARANCE_CHANGE : (1 << 3),
|
kTABBAR_UPDATE_BY_APPEARANCE_CHANGE : (1 << 3),
|
||||||
kTABBAR_UPDATE_BY_SHOWHIDE_TABBAR : (1 << 4),
|
kTABBAR_UPDATE_BY_SHOWHIDE_TABBAR : (1 << 4),
|
||||||
kTABBAR_UPDATE_BY_TABBAR_RESIZE : (1 << 5),
|
kTABBAR_UPDATE_BY_TABBAR_RESIZE : (1 << 5),
|
||||||
kTABBAR_UPDATE_BY_WINDOW_RESIZE : (1 << 6),
|
kTABBAR_UPDATE_BY_WINDOW_RESIZE : (1 << 6),
|
||||||
kTABBAR_UPDATE_BY_FULLSCREEN : (1 << 7),
|
kTABBAR_UPDATE_BY_FULLSCREEN : (1 << 7),
|
||||||
kTABBAR_UPDATE_BY_AUTOHIDE : (1 << 9),
|
kTABBAR_UPDATE_BY_AUTOHIDE : (1 << 9),
|
||||||
kTABBAR_UPDATE_BY_INITIALIZE : (1 << 10),
|
kTABBAR_UPDATE_BY_INITIALIZE : (1 << 10),
|
||||||
kTABBAR_UPDATE_BY_TOGGLE_SIDEBAR : (1 << 11),
|
kTABBAR_UPDATE_BY_TOGGLE_SIDEBAR : (1 << 11),
|
||||||
kTABBAR_UPDATE_NOW : (1 << 5) | (1 << 6) | (1 << 9) | (1 << 10),
|
kTABBAR_UPDATE_NOW : (1 << 5) | (1 << 6) | (1 << 9) | (1 << 10),
|
||||||
kTABBAR_UPDATE_SYNC_TO_TABBAR : (1 << 0) | (1 << 1) | (1 << 2) | (1 << 5) | (1 << 9),
|
kTABBAR_UPDATE_SYNC_TO_TABBAR : (1 << 0) | (1 << 1) | (1 << 2) | (1 << 5) | (1 << 9),
|
||||||
kTABBAR_UPDATE_SYNC_TO_PLACEHOLDER : (1 << 3) | (1 << 4) | (1 << 6) | (1 << 7) | (1 << 10) | (1 << 11),
|
kTABBAR_UPDATE_SYNC_TO_PLACEHOLDER : (1 << 3) | (1 << 4) | (1 << 6) | (1 << 7) | (1 << 10) | (1 << 11),
|
||||||
|
|
||||||
kCLOSE_PARENT_BEHAVIOR_PROMOTE_FIRST_CHILD : 3,
|
kCLOSE_PARENT_BEHAVIOR_PROMOTE_FIRST_CHILD : 3,
|
||||||
kCLOSE_PARENT_BEHAVIOR_PROMOTE_ALL_CHILDREN : 0,
|
kCLOSE_PARENT_BEHAVIOR_PROMOTE_ALL_CHILDREN : 0,
|
||||||
kCLOSE_PARENT_BEHAVIOR_DETACH_ALL_CHILDREN : 1,
|
kCLOSE_PARENT_BEHAVIOR_DETACH_ALL_CHILDREN : 1,
|
||||||
kCLOSE_PARENT_BEHAVIOR_SIMPLY_DETACH_ALL_CHILDREN : 4,
|
kCLOSE_PARENT_BEHAVIOR_SIMPLY_DETACH_ALL_CHILDREN : 4,
|
||||||
kCLOSE_PARENT_BEHAVIOR_CLOSE_ALL_CHILDREN : 2, // onTabRemoved only
|
kCLOSE_PARENT_BEHAVIOR_CLOSE_ALL_CHILDREN : 2, // onTabRemoved only
|
||||||
|
|
||||||
kRESTORE_TREE_LEVEL_NONE : 0,
|
kRESTORE_TREE_LEVEL_NONE : 0,
|
||||||
kRESTORE_TREE_ONLY_VISIBLE : 1,
|
kRESTORE_TREE_ONLY_VISIBLE : 1,
|
||||||
kRESTORE_TREE_ALL : 2,
|
kRESTORE_TREE_ALL : 2,
|
||||||
|
|
||||||
kCOUNTER_ROLE_ALL_TABS : 1,
|
kCOUNTER_ROLE_ALL_TABS : 1,
|
||||||
kCOUNTER_ROLE_CONTAINED_TABS : 2,
|
kCOUNTER_ROLE_CONTAINED_TABS : 2,
|
||||||
|
|
||||||
MAX_TABBAR_SIZE_RATIO : 0.8,
|
MAX_TABBAR_SIZE_RATIO : 0.8,
|
||||||
DEFAULT_SHRUNKEN_WIDTH_RATIO : 0.67,
|
DEFAULT_SHRUNKEN_WIDTH_RATIO : 0.67,
|
||||||
MIN_TABBAR_WIDTH : 24,
|
MIN_TABBAR_WIDTH : 24,
|
||||||
MIN_TABBAR_HEIGHT : 24
|
MIN_TABBAR_HEIGHT : 24
|
||||||
});
|
});
|
||||||
|
@ -1,480 +1,480 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is the Tree Style Tab.
|
* The Original Code is the Tree Style Tab.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2011-2014
|
* Portions created by the Initial Developer are Copyright (C) 2011-2014
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ******/
|
* ***** END LICENSE BLOCK ******/
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ['FullTooltipManager'];
|
const EXPORTED_SYMBOLS = ['FullTooltipManager'];
|
||||||
|
|
||||||
const Cc = Components.classes;
|
const Cc = Components.classes;
|
||||||
const Ci = Components.interfaces;
|
const Ci = Components.interfaces;
|
||||||
|
|
||||||
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
|
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||||
|
|
||||||
Components.utils.import('resource://treestyletab-modules/lib/inherit.jsm');
|
Components.utils.import('resource://treestyletab-modules/lib/inherit.jsm');
|
||||||
Components.utils.import('resource://treestyletab-modules/base.js');
|
Components.utils.import('resource://treestyletab-modules/base.js');
|
||||||
Components.utils.import('resource://treestyletab-modules/pseudoTreeBuilder.js');
|
Components.utils.import('resource://treestyletab-modules/pseudoTreeBuilder.js');
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, 'utils', 'resource://treestyletab-modules/utils.js', 'TreeStyleTabUtils');
|
XPCOMUtils.defineLazyModuleGetter(this, 'utils', 'resource://treestyletab-modules/utils.js', 'TreeStyleTabUtils');
|
||||||
|
|
||||||
XPCOMUtils.defineLazyServiceGetter(this, 'ScreenManager',
|
XPCOMUtils.defineLazyServiceGetter(this, 'ScreenManager',
|
||||||
'@mozilla.org/gfx/screenmanager;1', 'nsIScreenManager');
|
'@mozilla.org/gfx/screenmanager;1', 'nsIScreenManager');
|
||||||
|
|
||||||
function FullTooltipManager(aOwner)
|
function FullTooltipManager(aOwner)
|
||||||
{
|
{
|
||||||
this.init(aOwner);
|
this.init(aOwner);
|
||||||
}
|
}
|
||||||
FullTooltipManager.prototype = inherit(TreeStyleTabBase, {
|
FullTooltipManager.prototype = inherit(TreeStyleTabBase, {
|
||||||
|
|
||||||
kTOOLTIP_MODE_DEFAULT : 0,
|
kTOOLTIP_MODE_DEFAULT : 0,
|
||||||
kTOOLTIP_MODE_COLLAPSED : 1,
|
kTOOLTIP_MODE_COLLAPSED : 1,
|
||||||
kTOOLTIP_MODE_ALWAYS : 2,
|
kTOOLTIP_MODE_ALWAYS : 2,
|
||||||
|
|
||||||
get window()
|
get window()
|
||||||
{
|
{
|
||||||
return this.owner.window;
|
return this.owner.window;
|
||||||
},
|
},
|
||||||
|
|
||||||
get document()
|
get document()
|
||||||
{
|
{
|
||||||
return this.owner.document;
|
return this.owner.document;
|
||||||
},
|
},
|
||||||
|
|
||||||
get tabTooltip()
|
get tabTooltip()
|
||||||
{
|
{
|
||||||
return this.document.getElementById('tabbrowser-tab-tooltip');
|
return this.document.getElementById('tabbrowser-tab-tooltip');
|
||||||
},
|
},
|
||||||
|
|
||||||
get tabFullTooltip()
|
get tabFullTooltip()
|
||||||
{
|
{
|
||||||
return this.document.getElementById('treestyletab-full-tree-tooltip');
|
return this.document.getElementById('treestyletab-full-tree-tooltip');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
init : function FTM_init(aOwner)
|
init : function FTM_init(aOwner)
|
||||||
{
|
{
|
||||||
this.owner = aOwner;
|
this.owner = aOwner;
|
||||||
|
|
||||||
this.tabTooltip.addEventListener('popupshowing', this, true);
|
this.tabTooltip.addEventListener('popupshowing', this, true);
|
||||||
this.tabTooltip.addEventListener('popuphiding', this, true);
|
this.tabTooltip.addEventListener('popuphiding', this, true);
|
||||||
|
|
||||||
this.tabFullTooltip.addEventListener('click', this, false);
|
this.tabFullTooltip.addEventListener('click', this, false);
|
||||||
this.tabFullTooltip.addEventListener(PseudoTreeBuilder.kTAB_LINK_CLICK, this, true);
|
this.tabFullTooltip.addEventListener(PseudoTreeBuilder.kTAB_LINK_CLICK, this, true);
|
||||||
this.tabFullTooltip.addEventListener('popupshown', this, true);
|
this.tabFullTooltip.addEventListener('popupshown', this, true);
|
||||||
this.tabFullTooltip.addEventListener('popuphidden', this, true);
|
this.tabFullTooltip.addEventListener('popuphidden', this, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy : function FTM_destroy()
|
destroy : function FTM_destroy()
|
||||||
{
|
{
|
||||||
this.cancel();
|
this.cancel();
|
||||||
this.stopListenTooltipEvents();
|
this.stopListenTooltipEvents();
|
||||||
|
|
||||||
this.tabTooltip.removeEventListener('popupshowing', this, true);
|
this.tabTooltip.removeEventListener('popupshowing', this, true);
|
||||||
this.tabTooltip.removeEventListener('popuphiding', this, true);
|
this.tabTooltip.removeEventListener('popuphiding', this, true);
|
||||||
|
|
||||||
this.tabFullTooltip.removeEventListener('click', this, false);
|
this.tabFullTooltip.removeEventListener('click', this, false);
|
||||||
this.tabFullTooltip.removeEventListener(PseudoTreeBuilder.kTAB_LINK_CLICK, this, true);
|
this.tabFullTooltip.removeEventListener(PseudoTreeBuilder.kTAB_LINK_CLICK, this, true);
|
||||||
this.tabFullTooltip.removeEventListener('popupshown', this, true);
|
this.tabFullTooltip.removeEventListener('popupshown', this, true);
|
||||||
this.tabFullTooltip.removeEventListener('popuphidden', this, true);
|
this.tabFullTooltip.removeEventListener('popuphidden', this, true);
|
||||||
|
|
||||||
delete this.owner;
|
delete this.owner;
|
||||||
},
|
},
|
||||||
|
|
||||||
handleEvent : function FTM_handleEvent(aEvent)
|
handleEvent : function FTM_handleEvent(aEvent)
|
||||||
{
|
{
|
||||||
switch (aEvent.type)
|
switch (aEvent.type)
|
||||||
{
|
{
|
||||||
case 'click':
|
case 'click':
|
||||||
return this.onClick(aEvent);
|
return this.onClick(aEvent);
|
||||||
|
|
||||||
case PseudoTreeBuilder.kTAB_LINK_CLICK:
|
case PseudoTreeBuilder.kTAB_LINK_CLICK:
|
||||||
return this.onItemClick(aEvent);
|
return this.onItemClick(aEvent);
|
||||||
|
|
||||||
case 'popupshowing':
|
case 'popupshowing':
|
||||||
return this.onDefaultTooltipShowing(aEvent);
|
return this.onDefaultTooltipShowing(aEvent);
|
||||||
|
|
||||||
case 'popuphiding':
|
case 'popuphiding':
|
||||||
return this.onDefaultTooltipHiding(aEvent);
|
return this.onDefaultTooltipHiding(aEvent);
|
||||||
|
|
||||||
case 'popupshown':
|
case 'popupshown':
|
||||||
return this.onShown(aEvent);
|
return this.onShown(aEvent);
|
||||||
|
|
||||||
case 'popuphidden':
|
case 'popuphidden':
|
||||||
return this.onHidden(aEvent);
|
return this.onHidden(aEvent);
|
||||||
|
|
||||||
case 'mousemove':
|
case 'mousemove':
|
||||||
return this.onTooltipMouseMove(aEvent);
|
return this.onTooltipMouseMove(aEvent);
|
||||||
|
|
||||||
case 'mouseover':
|
case 'mouseover':
|
||||||
return this.cancelDelayedHide();
|
return this.cancelDelayedHide();
|
||||||
|
|
||||||
case 'mouseout':
|
case 'mouseout':
|
||||||
return this.hideWithDelay();
|
return this.hideWithDelay();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return this.onTooltipEvent(aEvent);
|
return this.onTooltipEvent(aEvent);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getFullTooltipFromEvent : function FTM_getFullTooltipFromEvent(aEvent)
|
getFullTooltipFromEvent : function FTM_getFullTooltipFromEvent(aEvent)
|
||||||
{
|
{
|
||||||
return this.evaluateXPath(
|
return this.evaluateXPath(
|
||||||
'ancestor-or-self::xul:tooltip[@id="'+this.tabFullTooltip.id+'"]',
|
'ancestor-or-self::xul:tooltip[@id="'+this.tabFullTooltip.id+'"]',
|
||||||
aEvent.target,
|
aEvent.target,
|
||||||
Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE
|
Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE
|
||||||
).singleNodeValue;
|
).singleNodeValue;
|
||||||
},
|
},
|
||||||
|
|
||||||
onClick : function FTM_onClick(aEvent)
|
onClick : function FTM_onClick(aEvent)
|
||||||
{
|
{
|
||||||
this.tabFullTooltip.hidePopup();
|
this.tabFullTooltip.hidePopup();
|
||||||
},
|
},
|
||||||
|
|
||||||
onItemClick : function FTM_onItemClick(aEvent)
|
onItemClick : function FTM_onItemClick(aEvent)
|
||||||
{
|
{
|
||||||
var id = aEvent.detail.id;
|
var id = aEvent.detail.id;
|
||||||
if (id) {
|
if (id) {
|
||||||
let tab = this.getTabById(id, this.owner.browser);
|
let tab = this.getTabById(id, this.owner.browser);
|
||||||
if (tab) {
|
if (tab) {
|
||||||
let event = aEvent.detail.sourceEvent;
|
let event = aEvent.detail.sourceEvent;
|
||||||
if (event.button == 1 ||
|
if (event.button == 1 ||
|
||||||
(event.button == 0 && this.isAccelKeyPressed(event)))
|
(event.button == 0 && this.isAccelKeyPressed(event)))
|
||||||
this.owner.browser.removeTab(tab);
|
this.owner.browser.removeTab(tab);
|
||||||
else if (event.button != 2)
|
else if (event.button != 2)
|
||||||
this.owner.browser.selectedTab = tab;
|
this.owner.browser.selectedTab = tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.tabFullTooltip.hidePopup();
|
this.tabFullTooltip.hidePopup();
|
||||||
},
|
},
|
||||||
|
|
||||||
onDefaultTooltipShowing : function FTM_onDefaultTooltipShowing(aEvent)
|
onDefaultTooltipShowing : function FTM_onDefaultTooltipShowing(aEvent)
|
||||||
{
|
{
|
||||||
this.cancel();
|
this.cancel();
|
||||||
this.handleDefaultTooltip(aEvent);
|
this.handleDefaultTooltip(aEvent);
|
||||||
},
|
},
|
||||||
|
|
||||||
onDefaultTooltipHiding : function FTM_onDefaultTooltipHiding(aEvent)
|
onDefaultTooltipHiding : function FTM_onDefaultTooltipHiding(aEvent)
|
||||||
{
|
{
|
||||||
this.cancel();
|
this.cancel();
|
||||||
},
|
},
|
||||||
|
|
||||||
onShown : function FTM_onShown(aEvent)
|
onShown : function FTM_onShown(aEvent)
|
||||||
{
|
{
|
||||||
this.startListenTooltipEvents();
|
this.startListenTooltipEvents();
|
||||||
|
|
||||||
var tooltip = this.tabFullTooltip;
|
var tooltip = this.tabFullTooltip;
|
||||||
tooltip.setAttribute('popup-shown', true);
|
tooltip.setAttribute('popup-shown', true);
|
||||||
|
|
||||||
var w = {},
|
var w = {},
|
||||||
h = {};
|
h = {};
|
||||||
var box = tooltip.boxObject;
|
var box = tooltip.boxObject;
|
||||||
var scrollBoxObject = tooltip.firstChild.scrollBoxObject;
|
var scrollBoxObject = tooltip.firstChild.scrollBoxObject;
|
||||||
scrollBoxObject.getScrolledSize(w, h);
|
scrollBoxObject.getScrolledSize(w, h);
|
||||||
var currentW = box.width - scrollBoxObject.width + w.value;
|
var currentW = box.width - scrollBoxObject.width + w.value;
|
||||||
var currentH = box.height - scrollBoxObject.height + h.value;
|
var currentH = box.height - scrollBoxObject.height + h.value;
|
||||||
var currentX = box.screenX;
|
var currentX = box.screenX;
|
||||||
var currentY = box.screenY;
|
var currentY = box.screenY;
|
||||||
|
|
||||||
var currentScreen = Cc['@mozilla.org/gfx/screenmanager;1']
|
var currentScreen = Cc['@mozilla.org/gfx/screenmanager;1']
|
||||||
.getService(Ci.nsIScreenManager)
|
.getService(Ci.nsIScreenManager)
|
||||||
.screenForRect(box.screenX, box.screenY, box.width, box.height);
|
.screenForRect(box.screenX, box.screenY, box.width, box.height);
|
||||||
var screenLeft = {},
|
var screenLeft = {},
|
||||||
screenTop = {},
|
screenTop = {},
|
||||||
screenWidth = {},
|
screenWidth = {},
|
||||||
screenHeight = {};
|
screenHeight = {};
|
||||||
currentScreen.GetRect(screenLeft, screenTop, screenWidth, screenHeight);
|
currentScreen.GetRect(screenLeft, screenTop, screenWidth, screenHeight);
|
||||||
|
|
||||||
var style = tooltip.style;
|
var style = tooltip.style;
|
||||||
style.maxWidth = screenWidth.value+'px';
|
style.maxWidth = screenWidth.value+'px';
|
||||||
style.maxHeight = screenHeight.value+'px';
|
style.maxHeight = screenHeight.value+'px';
|
||||||
style.minWidth = 0;
|
style.minWidth = 0;
|
||||||
style.minHeight = 0;
|
style.minHeight = 0;
|
||||||
if (currentX + currentW + screenLeft.value >= screenWidth.value)
|
if (currentX + currentW + screenLeft.value >= screenWidth.value)
|
||||||
style.marginLeft = (Math.max(screenLeft.value, screenWidth.value - currentW) - this.window.screenX)+'px';
|
style.marginLeft = (Math.max(screenLeft.value, screenWidth.value - currentW) - this.window.screenX)+'px';
|
||||||
if (currentY + currentH + screenTop.value >= screenHeight.value)
|
if (currentY + currentH + screenTop.value >= screenHeight.value)
|
||||||
style.marginTop = (Math.max(screenTop.value, screenHeight.value - currentH) - this.window.screenY)+'px';
|
style.marginTop = (Math.max(screenTop.value, screenHeight.value - currentH) - this.window.screenY)+'px';
|
||||||
},
|
},
|
||||||
|
|
||||||
onHidden : function FTM_onHidden(aEvent)
|
onHidden : function FTM_onHidden(aEvent)
|
||||||
{
|
{
|
||||||
this.tabFullTooltip.removeAttribute('popup-shown');
|
this.tabFullTooltip.removeAttribute('popup-shown');
|
||||||
this.stopListenTooltipEvents();
|
this.stopListenTooltipEvents();
|
||||||
this.clear();
|
this.clear();
|
||||||
},
|
},
|
||||||
|
|
||||||
onTooltipMouseMove : function FTM_onTooltipMouseMove(aEvent)
|
onTooltipMouseMove : function FTM_onTooltipMouseMove(aEvent)
|
||||||
{
|
{
|
||||||
if (this.getFullTooltipFromEvent(aEvent))
|
if (this.getFullTooltipFromEvent(aEvent))
|
||||||
this.cancelDelayedHide();
|
this.cancelDelayedHide();
|
||||||
else
|
else
|
||||||
this.hideWithDelay();
|
this.hideWithDelay();
|
||||||
},
|
},
|
||||||
|
|
||||||
onTooltipEvent : function FTM_onTooltipEvent(aEvent)
|
onTooltipEvent : function FTM_onTooltipEvent(aEvent)
|
||||||
{
|
{
|
||||||
if (!this.getFullTooltipFromEvent(aEvent))
|
if (!this.getFullTooltipFromEvent(aEvent))
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
startListenTooltipEvents : function FTM_startListenTooltipEvents()
|
startListenTooltipEvents : function FTM_startListenTooltipEvents()
|
||||||
{
|
{
|
||||||
if (this.listening)
|
if (this.listening)
|
||||||
return;
|
return;
|
||||||
this.window.addEventListener('DOMMouseScroll', this, true);
|
this.window.addEventListener('DOMMouseScroll', this, true);
|
||||||
this.window.addEventListener('keydown', this, true);
|
this.window.addEventListener('keydown', this, true);
|
||||||
this.window.addEventListener('mousedown', this, true);
|
this.window.addEventListener('mousedown', this, true);
|
||||||
this.window.addEventListener('mouseup', this, true);
|
this.window.addEventListener('mouseup', this, true);
|
||||||
this.window.addEventListener('dragstart', this, true);
|
this.window.addEventListener('dragstart', this, true);
|
||||||
this.window.addEventListener('mousemove', this, true);
|
this.window.addEventListener('mousemove', this, true);
|
||||||
this.tabFullTooltip.addEventListener('mouseover', this, false);
|
this.tabFullTooltip.addEventListener('mouseover', this, false);
|
||||||
this.tabFullTooltip.addEventListener('mouseout', this, false);
|
this.tabFullTooltip.addEventListener('mouseout', this, false);
|
||||||
this.listening = true;
|
this.listening = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
stopListenTooltipEvents : function FTM_stopListenTooltipEvents()
|
stopListenTooltipEvents : function FTM_stopListenTooltipEvents()
|
||||||
{
|
{
|
||||||
if (!this.listening)
|
if (!this.listening)
|
||||||
return;
|
return;
|
||||||
this.window.removeEventListener('DOMMouseScroll', this, true);
|
this.window.removeEventListener('DOMMouseScroll', this, true);
|
||||||
this.window.removeEventListener('keydown', this, true);
|
this.window.removeEventListener('keydown', this, true);
|
||||||
this.window.removeEventListener('mousedown', this, true);
|
this.window.removeEventListener('mousedown', this, true);
|
||||||
this.window.removeEventListener('mouseup', this, true);
|
this.window.removeEventListener('mouseup', this, true);
|
||||||
this.window.removeEventListener('dragstart', this, true);
|
this.window.removeEventListener('dragstart', this, true);
|
||||||
this.window.removeEventListener('mousemove', this, true);
|
this.window.removeEventListener('mousemove', this, true);
|
||||||
this.tabFullTooltip.removeEventListener('mouseover', this, false);
|
this.tabFullTooltip.removeEventListener('mouseover', this, false);
|
||||||
this.tabFullTooltip.removeEventListener('mouseout', this, false);
|
this.tabFullTooltip.removeEventListener('mouseout', this, false);
|
||||||
this.listening = false;
|
this.listening = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
handleDefaultTooltip : function FTM_handleDefaultTooltip(aEvent)
|
handleDefaultTooltip : function FTM_handleDefaultTooltip(aEvent)
|
||||||
{
|
{
|
||||||
var tab = this.getTabFromChild(this.document.tooltipNode);
|
var tab = this.getTabFromChild(this.document.tooltipNode);
|
||||||
if (!tab || tab.localName != 'tab')
|
if (!tab || tab.localName != 'tab')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var label;
|
var label;
|
||||||
var collapsed = this.isSubtreeCollapsed(tab);
|
var collapsed = this.isSubtreeCollapsed(tab);
|
||||||
var mode = utils.getTreePref('tooltip.mode');
|
var mode = utils.getTreePref('tooltip.mode');
|
||||||
|
|
||||||
var base = parseInt(tab.getAttribute(this.kNEST) || 0);
|
var base = parseInt(tab.getAttribute(this.kNEST) || 0);
|
||||||
var descendant = this.getDescendantTabs(tab);
|
var descendant = this.getDescendantTabs(tab);
|
||||||
var indentPart = ' ';
|
var indentPart = ' ';
|
||||||
var tree = null;
|
var tree = null;
|
||||||
var fullTooltipExtraLabel = '';
|
var fullTooltipExtraLabel = '';
|
||||||
if (mode > this.kTOOLTIP_MODE_DEFAULT &&
|
if (mode > this.kTOOLTIP_MODE_DEFAULT &&
|
||||||
descendant.length) {
|
descendant.length) {
|
||||||
let tabs = [tab].concat(descendant);
|
let tabs = [tab].concat(descendant);
|
||||||
let tabsToBeListed = tabs.slice(0, Math.max(1, utils.getTreePref('tooltip.maxCount')));
|
let tabsToBeListed = tabs.slice(0, Math.max(1, utils.getTreePref('tooltip.maxCount')));
|
||||||
tree = tabsToBeListed
|
tree = tabsToBeListed
|
||||||
.map(function(aTab) {
|
.map(function(aTab) {
|
||||||
let label = aTab.getAttribute('label');
|
let label = aTab.getAttribute('label');
|
||||||
let indent = '';
|
let indent = '';
|
||||||
let nest = parseInt(aTab.getAttribute(this.kNEST) || 0) - base;
|
let nest = parseInt(aTab.getAttribute(this.kNEST) || 0) - base;
|
||||||
for (let i = 0; i < nest; i++)
|
for (let i = 0; i < nest; i++)
|
||||||
{
|
{
|
||||||
indent += indentPart;
|
indent += indentPart;
|
||||||
}
|
}
|
||||||
return utils.treeBundle.getFormattedString('tooltip.item.label', [label, indent]);
|
return utils.treeBundle.getFormattedString('tooltip.item.label', [label, indent]);
|
||||||
}, this)
|
}, this)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
if (tabs.length != tabsToBeListed.length) {
|
if (tabs.length != tabsToBeListed.length) {
|
||||||
tree += '\n'+indentPart+utils.treeBundle.getFormattedString('tooltip.more', [tabs.length-tabsToBeListed.length]);
|
tree += '\n'+indentPart+utils.treeBundle.getFormattedString('tooltip.more', [tabs.length-tabsToBeListed.length]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var shouldShowTree = mode != this.kTOOLTIP_MODE_DEFAULT && (collapsed || mode == this.kTOOLTIP_MODE_ALWAYS);
|
var shouldShowTree = mode != this.kTOOLTIP_MODE_DEFAULT && (collapsed || mode == this.kTOOLTIP_MODE_ALWAYS);
|
||||||
if ('mOverCloseButton' in tab && tab.mOverCloseButton) {
|
if ('mOverCloseButton' in tab && tab.mOverCloseButton) {
|
||||||
if (descendant.length &&
|
if (descendant.length &&
|
||||||
(collapsed || utils.getTreePref('closeParentBehavior') == this.kCLOSE_PARENT_BEHAVIOR_CLOSE_ALL_CHILDREN)) {
|
(collapsed || utils.getTreePref('closeParentBehavior') == this.kCLOSE_PARENT_BEHAVIOR_CLOSE_ALL_CHILDREN)) {
|
||||||
label = tree || tab.getAttribute('label');
|
label = tree || tab.getAttribute('label');
|
||||||
label = label && shouldShowTree ?
|
label = label && shouldShowTree ?
|
||||||
utils.treeBundle.getFormattedString('tooltip.closeTree.labeled', [label]) :
|
utils.treeBundle.getFormattedString('tooltip.closeTree.labeled', [label]) :
|
||||||
utils.treeBundle.getString('tooltip.closeTree') ;
|
utils.treeBundle.getString('tooltip.closeTree') ;
|
||||||
fullTooltipExtraLabel = utils.treeBundle.getFormattedString('tooltip.closeTree.labeled', ['%TREE%']).split(/\s*%TREE%\s*/);
|
fullTooltipExtraLabel = utils.treeBundle.getFormattedString('tooltip.closeTree.labeled', ['%TREE%']).split(/\s*%TREE%\s*/);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tab.getAttribute(this.kTWISTY_HOVER) == 'true') {
|
else if (tab.getAttribute(this.kTWISTY_HOVER) == 'true') {
|
||||||
let key = collapsed ?
|
let key = collapsed ?
|
||||||
'tooltip.expandSubtree' :
|
'tooltip.expandSubtree' :
|
||||||
'tooltip.collapseSubtree' ;
|
'tooltip.collapseSubtree' ;
|
||||||
label = tree || tab.getAttribute('label');
|
label = tree || tab.getAttribute('label');
|
||||||
label = label && shouldShowTree ?
|
label = label && shouldShowTree ?
|
||||||
utils.treeBundle.getFormattedString(key+'.labeled', [label]) :
|
utils.treeBundle.getFormattedString(key+'.labeled', [label]) :
|
||||||
utils.treeBundle.getString(key) ;
|
utils.treeBundle.getString(key) ;
|
||||||
fullTooltipExtraLabel = utils.treeBundle.getFormattedString(key+'.labeled', ['%TREE%']).split(/\s*%TREE%\s*/);
|
fullTooltipExtraLabel = utils.treeBundle.getFormattedString(key+'.labeled', ['%TREE%']).split(/\s*%TREE%\s*/);
|
||||||
}
|
}
|
||||||
else if (shouldShowTree) {
|
else if (shouldShowTree) {
|
||||||
label = tree;
|
label = tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!label)
|
if (!label)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
aEvent.target.setAttribute('label', label);
|
aEvent.target.setAttribute('label', label);
|
||||||
aEvent.stopPropagation();
|
aEvent.stopPropagation();
|
||||||
|
|
||||||
if (shouldShowTree)
|
if (shouldShowTree)
|
||||||
this.setup(aEvent.target, tab, fullTooltipExtraLabel);
|
this.setup(aEvent.target, tab, fullTooltipExtraLabel);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the window is maximized, screenX and screenY can be out of
|
* If the window is maximized, screenX and screenY can be out of
|
||||||
* visible screen rect. On the other hand,
|
* visible screen rect. On the other hand,
|
||||||
* nsIPopupBoxObject#openPopupAtScreen() automatically reposition
|
* nsIPopupBoxObject#openPopupAtScreen() automatically reposition
|
||||||
* the popup if it is going to be shown out of the visible screen
|
* the popup if it is going to be shown out of the visible screen
|
||||||
* rect. As the result, the popup will be repositioned unexpectedly
|
* rect. As the result, the popup will be repositioned unexpectedly
|
||||||
* if I use the raw screenX and screenY.
|
* if I use the raw screenX and screenY.
|
||||||
* https://github.com/piroor/treestyletab/issues/302
|
* https://github.com/piroor/treestyletab/issues/302
|
||||||
* To prevent such a result, I have to calculate valid base position
|
* To prevent such a result, I have to calculate valid base position
|
||||||
* for the popup.
|
* for the popup.
|
||||||
*/
|
*/
|
||||||
get windowBasePosition() {
|
get windowBasePosition() {
|
||||||
var screen = ScreenManager.screenForRect(
|
var screen = ScreenManager.screenForRect(
|
||||||
this.window.screenX,
|
this.window.screenX,
|
||||||
this.window.screenY,
|
this.window.screenY,
|
||||||
this.window.outerWidth,
|
this.window.outerWidth,
|
||||||
this.window.outerHeight
|
this.window.outerHeight
|
||||||
);
|
);
|
||||||
var screenMinX = {},
|
var screenMinX = {},
|
||||||
screenMinY = {},
|
screenMinY = {},
|
||||||
screenMaxX = {},
|
screenMaxX = {},
|
||||||
screenMaxY = {};
|
screenMaxY = {};
|
||||||
screen.GetAvailRect(screenMinX, screenMinY, screenMaxX, screenMaxY);
|
screen.GetAvailRect(screenMinX, screenMinY, screenMaxX, screenMaxY);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
x: Math.max(this.window.screenX, screenMinX.value),
|
x: Math.max(this.window.screenX, screenMinX.value),
|
||||||
y: Math.max(this.window.screenY, screenMinY.value)
|
y: Math.max(this.window.screenY, screenMinY.value)
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
setup : function FTM_setup(aBaseTooltip, aTab, aExtraLabels)
|
setup : function FTM_setup(aBaseTooltip, aTab, aExtraLabels)
|
||||||
{
|
{
|
||||||
this.cancel();
|
this.cancel();
|
||||||
|
|
||||||
var delay = utils.getTreePref('tooltip.fullTooltipDelay');
|
var delay = utils.getTreePref('tooltip.fullTooltipDelay');
|
||||||
if (delay < 0)
|
if (delay < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._fullTooltipTimer = this.window.setTimeout(function(aSelf) {
|
this._fullTooltipTimer = this.window.setTimeout(function(aSelf) {
|
||||||
var basePosition = aSelf.windowBasePosition;
|
var basePosition = aSelf.windowBasePosition;
|
||||||
var box = aBaseTooltip.boxObject;
|
var box = aBaseTooltip.boxObject;
|
||||||
var x = box.screenX - basePosition.x;
|
var x = box.screenX - basePosition.x;
|
||||||
var y = box.screenY - basePosition.y;
|
var y = box.screenY - basePosition.y;
|
||||||
var w = box.width;
|
var w = box.width;
|
||||||
var h = box.height;
|
var h = box.height;
|
||||||
aBaseTooltip.hidePopup();
|
aBaseTooltip.hidePopup();
|
||||||
|
|
||||||
aSelf.fill(aTab, aExtraLabels);
|
aSelf.fill(aTab, aExtraLabels);
|
||||||
|
|
||||||
var tooltip = aSelf.tabFullTooltip;
|
var tooltip = aSelf.tabFullTooltip;
|
||||||
let (style = tooltip.style) {
|
let (style = tooltip.style) {
|
||||||
style.marginLeft = x+'px';
|
style.marginLeft = x+'px';
|
||||||
style.marginTop = y+'px';
|
style.marginTop = y+'px';
|
||||||
style.maxWidth = style.minWidth = w+'px';
|
style.maxWidth = style.minWidth = w+'px';
|
||||||
style.maxHeight = style.minHeight = h+'px';
|
style.maxHeight = style.minHeight = h+'px';
|
||||||
}
|
}
|
||||||
tooltip.openPopupAtScreen(basePosition.x, basePosition.y, false);
|
tooltip.openPopupAtScreen(basePosition.x, basePosition.y, false);
|
||||||
}, Math.max(delay, 0), this);
|
}, Math.max(delay, 0), this);
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel : function FTM_destroyFullTooltip()
|
cancel : function FTM_destroyFullTooltip()
|
||||||
{
|
{
|
||||||
if (this._fullTooltipTimer) {
|
if (this._fullTooltipTimer) {
|
||||||
this.window.clearTimeout(this._fullTooltipTimer);
|
this.window.clearTimeout(this._fullTooltipTimer);
|
||||||
this._fullTooltipTimer = null;
|
this._fullTooltipTimer = null;
|
||||||
}
|
}
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
hide : function FTM_hide()
|
hide : function FTM_hide()
|
||||||
{
|
{
|
||||||
this.cancelDelayedHide();
|
this.cancelDelayedHide();
|
||||||
this.tabFullTooltip.hidePopup();
|
this.tabFullTooltip.hidePopup();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
hideWithDelay : function FTM_hideWithDelay()
|
hideWithDelay : function FTM_hideWithDelay()
|
||||||
{
|
{
|
||||||
this.cancelDelayedHide();
|
this.cancelDelayedHide();
|
||||||
this._delayedHideTimer = this.window.setTimeout(function(aSelf) {
|
this._delayedHideTimer = this.window.setTimeout(function(aSelf) {
|
||||||
aSelf.hide();
|
aSelf.hide();
|
||||||
}, 500, this);
|
}, 500, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
cancelDelayedHide : function FTM_cancelDelayedHide()
|
cancelDelayedHide : function FTM_cancelDelayedHide()
|
||||||
{
|
{
|
||||||
if (this._delayedHideTimer) {
|
if (this._delayedHideTimer) {
|
||||||
this.window.clearTimeout(this._delayedHideTimer);
|
this.window.clearTimeout(this._delayedHideTimer);
|
||||||
this._delayedHideTimer = null;
|
this._delayedHideTimer = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
fill : function FTM_fill(aTab, aExtraLabels)
|
fill : function FTM_fill(aTab, aExtraLabels)
|
||||||
{
|
{
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|
||||||
var tree = PseudoTreeBuilder.build(aTab);
|
var tree = PseudoTreeBuilder.build(aTab);
|
||||||
var root = this.document.createElement('arrowscrollbox');
|
var root = this.document.createElement('arrowscrollbox');
|
||||||
root.setAttribute('orient', 'vertical');
|
root.setAttribute('orient', 'vertical');
|
||||||
root.setAttribute('flex', 1);
|
root.setAttribute('flex', 1);
|
||||||
|
|
||||||
if (aExtraLabels) {
|
if (aExtraLabels) {
|
||||||
if (typeof aExtraLabels == 'string')
|
if (typeof aExtraLabels == 'string')
|
||||||
aExtraLabels = [aExtraLabels];
|
aExtraLabels = [aExtraLabels];
|
||||||
for (let i = 0, maxi = aExtraLabels.length; i < maxi; i++)
|
for (let i = 0, maxi = aExtraLabels.length; i < maxi; i++)
|
||||||
{
|
{
|
||||||
let label = aExtraLabels[i];
|
let label = aExtraLabels[i];
|
||||||
label = label.trim();
|
label = label.trim();
|
||||||
if (!label)
|
if (!label)
|
||||||
continue;
|
continue;
|
||||||
root.appendChild(this.document.createElement('description'))
|
root.appendChild(this.document.createElement('description'))
|
||||||
.appendChild(this.document.createTextNode(label));
|
.appendChild(this.document.createTextNode(label));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
root.insertBefore(tree, root.firstChild && root.firstChild.nextSibling);
|
root.insertBefore(tree, root.firstChild && root.firstChild.nextSibling);
|
||||||
|
|
||||||
this.tabFullTooltip.appendChild(root);
|
this.tabFullTooltip.appendChild(root);
|
||||||
},
|
},
|
||||||
|
|
||||||
clear : function FTM_clear()
|
clear : function FTM_clear()
|
||||||
{
|
{
|
||||||
var range = this.document.createRange();
|
var range = this.document.createRange();
|
||||||
range.selectNodeContents(this.tabFullTooltip);
|
range.selectNodeContents(this.tabFullTooltip);
|
||||||
range.deleteContents();
|
range.deleteContents();
|
||||||
range.detach();
|
range.detach();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,109 +1,109 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is the Tree Style Tab.
|
* The Original Code is the Tree Style Tab.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2013
|
* Portions created by the Initial Developer are Copyright (C) 2013
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ******/
|
* ***** END LICENSE BLOCK ******/
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ['FullscreenObserver'];
|
const EXPORTED_SYMBOLS = ['FullscreenObserver'];
|
||||||
|
|
||||||
Components.utils.import('resource://treestyletab-modules/utils.js');
|
Components.utils.import('resource://treestyletab-modules/utils.js');
|
||||||
|
|
||||||
function FullscreenObserver(aWindow) {
|
function FullscreenObserver(aWindow) {
|
||||||
this.window = aWindow;
|
this.window = aWindow;
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
FullscreenObserver.prototype = {
|
FullscreenObserver.prototype = {
|
||||||
get MutationObserver()
|
get MutationObserver()
|
||||||
{
|
{
|
||||||
var w = this.window;
|
var w = this.window;
|
||||||
return w.MutationObserver || w.MozMutationObserver;
|
return w.MutationObserver || w.MozMutationObserver;
|
||||||
},
|
},
|
||||||
|
|
||||||
init : function FullscreenObserver_onInit()
|
init : function FullscreenObserver_onInit()
|
||||||
{
|
{
|
||||||
if (!this.MutationObserver)
|
if (!this.MutationObserver)
|
||||||
return;
|
return;
|
||||||
this.observer = new this.MutationObserver((function(aMutations, aObserver) {
|
this.observer = new this.MutationObserver((function(aMutations, aObserver) {
|
||||||
this.onMutation(aMutations, aObserver);
|
this.onMutation(aMutations, aObserver);
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
this.observer.observe(this.window.document.documentElement, {
|
this.observer.observe(this.window.document.documentElement, {
|
||||||
attributes : true,
|
attributes : true,
|
||||||
attributeFilter : ['sizemode']
|
attributeFilter : ['sizemode']
|
||||||
});
|
});
|
||||||
|
|
||||||
this.onSizeModeChange();
|
this.onSizeModeChange();
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy : function FullscreenObserver_destroy()
|
destroy : function FullscreenObserver_destroy()
|
||||||
{
|
{
|
||||||
if (this.observer) {
|
if (this.observer) {
|
||||||
this.observer.disconnect();
|
this.observer.disconnect();
|
||||||
delete this.observer;
|
delete this.observer;
|
||||||
}
|
}
|
||||||
delete this.window;
|
delete this.window;
|
||||||
},
|
},
|
||||||
|
|
||||||
onMutation : function FullscreenObserver_onMutation(aMutations, aObserver)
|
onMutation : function FullscreenObserver_onMutation(aMutations, aObserver)
|
||||||
{
|
{
|
||||||
this.window.setTimeout((function() {
|
this.window.setTimeout((function() {
|
||||||
this.onSizeModeChange();
|
this.onSizeModeChange();
|
||||||
}).bind(this), 10);
|
}).bind(this), 10);
|
||||||
},
|
},
|
||||||
|
|
||||||
onSizeModeChange : function FullscreenObserver_onSizeModeChange()
|
onSizeModeChange : function FullscreenObserver_onSizeModeChange()
|
||||||
{
|
{
|
||||||
var w = this.window;
|
var w = this.window;
|
||||||
var d = w.document;
|
var d = w.document;
|
||||||
if (d.documentElement.getAttribute('sizemode') != 'fullscreen')
|
if (d.documentElement.getAttribute('sizemode') != 'fullscreen')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!w.FullScreen.useLionFullScreen && // see https://github.com/piroor/treestyletab/issues/645
|
!w.FullScreen.useLionFullScreen && // see https://github.com/piroor/treestyletab/issues/645
|
||||||
TreeStyleTabUtils.prefs.getPref('browser.fullscreen.autohide') // see https://github.com/piroor/treestyletab/issues/717
|
TreeStyleTabUtils.prefs.getPref('browser.fullscreen.autohide') // see https://github.com/piroor/treestyletab/issues/717
|
||||||
) {
|
) {
|
||||||
let toolbox = w.gNavToolbox;
|
let toolbox = w.gNavToolbox;
|
||||||
toolbox.style.marginTop = -toolbox.getBoundingClientRect().height + 'px';
|
toolbox.style.marginTop = -toolbox.getBoundingClientRect().height + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
var windowControls = d.getElementById('window-controls');
|
var windowControls = d.getElementById('window-controls');
|
||||||
var navigationToolbar = d.getElementById('nav-bar');
|
var navigationToolbar = d.getElementById('nav-bar');
|
||||||
if (!windowControls ||
|
if (!windowControls ||
|
||||||
!navigationToolbar ||
|
!navigationToolbar ||
|
||||||
windowControls.parentNode == navigationToolbar ||
|
windowControls.parentNode == navigationToolbar ||
|
||||||
(w.gBrowser.treeStyleTab.position == 'top' && w.gBrowser.treeStyleTab.fixed))
|
(w.gBrowser.treeStyleTab.position == 'top' && w.gBrowser.treeStyleTab.fixed))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// the location bar is flex=1, so we should not apply it.
|
// the location bar is flex=1, so we should not apply it.
|
||||||
// windowControls.setAttribute('flex', '1');
|
// windowControls.setAttribute('flex', '1');
|
||||||
navigationToolbar.appendChild(windowControls);
|
navigationToolbar.appendChild(windowControls);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,142 +1,142 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is the Tree Style Tab.
|
* The Original Code is the Tree Style Tab.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2011-2014
|
* Portions created by the Initial Developer are Copyright (C) 2011-2014
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ******/
|
* ***** END LICENSE BLOCK ******/
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ['PseudoTreeBuilder'];
|
const EXPORTED_SYMBOLS = ['PseudoTreeBuilder'];
|
||||||
|
|
||||||
const Cc = Components.classes;
|
const Cc = Components.classes;
|
||||||
const Ci = Components.interfaces;
|
const Ci = Components.interfaces;
|
||||||
|
|
||||||
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
|
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, 'TreeStyleTabBase', 'resource://treestyletab-modules/base.js');
|
XPCOMUtils.defineLazyModuleGetter(this, 'TreeStyleTabBase', 'resource://treestyletab-modules/base.js');
|
||||||
|
|
||||||
var PseudoTreeBuilder = {
|
var PseudoTreeBuilder = {
|
||||||
|
|
||||||
kFAVICON : 'treestyletab-pseudo-tree-favicon',
|
kFAVICON : 'treestyletab-pseudo-tree-favicon',
|
||||||
kROOTITEM : 'treestyletab-pseudo-tree-root-item',
|
kROOTITEM : 'treestyletab-pseudo-tree-root-item',
|
||||||
kTREEITEM : 'treestyletab-pseudo-tree-item',
|
kTREEITEM : 'treestyletab-pseudo-tree-item',
|
||||||
kTREEROW : 'treestyletab-pseudo-tree-row',
|
kTREEROW : 'treestyletab-pseudo-tree-row',
|
||||||
kTREECHILDREN : 'treestyletab-pseudo-tree-children',
|
kTREECHILDREN : 'treestyletab-pseudo-tree-children',
|
||||||
|
|
||||||
kTAB_LINK_CLICK : 'nsDOMTSTPseudoTreeItemClick',
|
kTAB_LINK_CLICK : 'nsDOMTSTPseudoTreeItemClick',
|
||||||
|
|
||||||
build : function TB_build(aTab)
|
build : function TB_build(aTab)
|
||||||
{
|
{
|
||||||
if (!aTab)
|
if (!aTab)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var tree = this.createTabItem(aTab);
|
var tree = this.createTabItem(aTab);
|
||||||
|
|
||||||
var row = tree.querySelector("."+this.kTREEROW);
|
var row = tree.querySelector("."+this.kTREEROW);
|
||||||
if (!row)
|
if (!row)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
row.className += " "+this.kROOTITEM;
|
row.className += " "+this.kROOTITEM;
|
||||||
|
|
||||||
tree.setAttribute('onclick',
|
tree.setAttribute('onclick',
|
||||||
('var doc = event.target.ownerDocument;\n' +
|
('var doc = event.target.ownerDocument;\n' +
|
||||||
'var label = doc.evaluate(\n' +
|
'var label = doc.evaluate(\n' +
|
||||||
' "ancestor-or-self::*[local-name()=\'label\' and contains(@class, \'text-link\')][1]",\n' +
|
' "ancestor-or-self::*[local-name()=\'label\' and contains(@class, \'text-link\')][1]",\n' +
|
||||||
' event.target,\n' +
|
' event.target,\n' +
|
||||||
' null,\n' +
|
' null,\n' +
|
||||||
' Components.interfaces.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE,\n' +
|
' Components.interfaces.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE,\n' +
|
||||||
' null\n' +
|
' null\n' +
|
||||||
' ).singleNodeValue;\n' +
|
' ).singleNodeValue;\n' +
|
||||||
'if (label) {\n' +
|
'if (label) {\n' +
|
||||||
' var customEvent = new doc.defaultView.CustomEvent(%EVENT_TYPE%, {\n' +
|
' var customEvent = new doc.defaultView.CustomEvent(%EVENT_TYPE%, {\n' +
|
||||||
' bubbles : true,\n' +
|
' bubbles : true,\n' +
|
||||||
' cancelable : true,\n' +
|
' cancelable : true,\n' +
|
||||||
' detail : {\n' +
|
' detail : {\n' +
|
||||||
' id : label.getAttribute("tab-id"),\n' +
|
' id : label.getAttribute("tab-id"),\n' +
|
||||||
' sourceEvent : event\n' +
|
' sourceEvent : event\n' +
|
||||||
' }\n' +
|
' }\n' +
|
||||||
' });\n' +
|
' });\n' +
|
||||||
' event.target.dispatchEvent(customEvent);\n' +
|
' 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;
|
||||||
},
|
},
|
||||||
|
|
||||||
createTabItem : function TB_createTabItem(aTab)
|
createTabItem : function TB_createTabItem(aTab)
|
||||||
{
|
{
|
||||||
var doc = aTab.ownerDocument;
|
var doc = aTab.ownerDocument;
|
||||||
var w = doc.defaultView;
|
var w = doc.defaultView;
|
||||||
|
|
||||||
var item = doc.createElement('hbox');
|
var item = doc.createElement('hbox');
|
||||||
item.setAttribute('class', this.kTREEROW);
|
item.setAttribute('class', this.kTREEROW);
|
||||||
|
|
||||||
var favicon = item.appendChild(doc.createElement('image'));
|
var favicon = item.appendChild(doc.createElement('image'));
|
||||||
favicon.setAttribute('src', aTab.getAttribute('image') || 'chrome://mozapps/skin/places/defaultFavicon.png');
|
favicon.setAttribute('src', aTab.getAttribute('image') || 'chrome://mozapps/skin/places/defaultFavicon.png');
|
||||||
favicon.setAttribute('class', this.kFAVICON);
|
favicon.setAttribute('class', this.kFAVICON);
|
||||||
|
|
||||||
var label = item.appendChild(doc.createElement('label'));
|
var label = item.appendChild(doc.createElement('label'));
|
||||||
label.setAttribute('value', aTab.label);
|
label.setAttribute('value', aTab.label);
|
||||||
var tooltip = aTab.label;
|
var tooltip = aTab.label;
|
||||||
var uri = aTab.linkedBrowser.currentURI.spec;
|
var uri = aTab.linkedBrowser.currentURI.spec;
|
||||||
if (w.isBlankPageURL ? !w.isBlankPageURL(uri) : (uri != 'about:blank')) tooltip += '\n' + uri;
|
if (w.isBlankPageURL ? !w.isBlankPageURL(uri) : (uri != 'about:blank')) tooltip += '\n' + uri;
|
||||||
label.setAttribute('tooltiptext', tooltip);
|
label.setAttribute('tooltiptext', tooltip);
|
||||||
label.setAttribute('class', 'text-link '+this.kTREEITEM);
|
label.setAttribute('class', 'text-link '+this.kTREEITEM);
|
||||||
label.setAttribute('tab-id', TreeStyleTabBase.getTabValue(aTab, TreeStyleTabBase.kID));
|
label.setAttribute('tab-id', TreeStyleTabBase.getTabValue(aTab, TreeStyleTabBase.kID));
|
||||||
|
|
||||||
var children = this.createTabChildren(aTab);
|
var children = this.createTabChildren(aTab);
|
||||||
if (children) {
|
if (children) {
|
||||||
let container = doc.createElement('vbox');
|
let container = doc.createElement('vbox');
|
||||||
container.appendChild(item);
|
container.appendChild(item);
|
||||||
container.appendChild(children);
|
container.appendChild(children);
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
createTabChildren : function TB_createTabChildren(aTab)
|
createTabChildren : function TB_createTabChildren(aTab)
|
||||||
{
|
{
|
||||||
var doc = aTab.ownerDocument;
|
var doc = aTab.ownerDocument;
|
||||||
|
|
||||||
var children = TreeStyleTabBase.getChildTabs(aTab);
|
var children = TreeStyleTabBase.getChildTabs(aTab);
|
||||||
if (!children.length)
|
if (!children.length)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var container = doc.createElement('vbox');
|
var container = doc.createElement('vbox');
|
||||||
for (let i = 0, maxi = children.length; i < maxi; i++)
|
for (let i = 0, maxi = children.length; i < maxi; i++)
|
||||||
{
|
{
|
||||||
container.appendChild(this.createTabItem(children[i]));
|
container.appendChild(this.createTabItem(children[i]));
|
||||||
}
|
}
|
||||||
container.setAttribute('class', this.kTREECHILDREN);
|
container.setAttribute('class', this.kTREECHILDREN);
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,168 +1,168 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is the Tree Style Tab.
|
* The Original Code is the Tree Style Tab.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010-2013
|
* Portions created by the Initial Developer are Copyright (C) 2010-2013
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ******/
|
* ***** END LICENSE BLOCK ******/
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ['TabpanelDNDObserver'];
|
const EXPORTED_SYMBOLS = ['TabpanelDNDObserver'];
|
||||||
|
|
||||||
const Cc = Components.classes;
|
const Cc = Components.classes;
|
||||||
const Ci = Components.interfaces;
|
const Ci = Components.interfaces;
|
||||||
|
|
||||||
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
|
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, 'utils', 'resource://treestyletab-modules/utils.js', 'TreeStyleTabUtils');
|
XPCOMUtils.defineLazyModuleGetter(this, 'utils', 'resource://treestyletab-modules/utils.js', 'TreeStyleTabUtils');
|
||||||
|
|
||||||
|
|
||||||
function TabpanelDNDObserver(aTabBrowser)
|
function TabpanelDNDObserver(aTabBrowser)
|
||||||
{
|
{
|
||||||
this.init(aTabBrowser);
|
this.init(aTabBrowser);
|
||||||
}
|
}
|
||||||
|
|
||||||
TabpanelDNDObserver.prototype = {
|
TabpanelDNDObserver.prototype = {
|
||||||
|
|
||||||
getDropPosition : function TabpanelDND_getDropPosition(aEvent)
|
getDropPosition : function TabpanelDND_getDropPosition(aEvent)
|
||||||
{
|
{
|
||||||
var box = this.browser.boxObject;
|
var box = this.browser.boxObject;
|
||||||
var W = box.width;
|
var W = box.width;
|
||||||
var H = box.height;
|
var H = box.height;
|
||||||
var X = box.screenX;
|
var X = box.screenX;
|
||||||
var Y = box.screenY;
|
var Y = box.screenY;
|
||||||
var x = aEvent.screenX - X;
|
var x = aEvent.screenX - X;
|
||||||
var y = aEvent.screenY - Y;
|
var y = aEvent.screenY - Y;
|
||||||
|
|
||||||
if (x > (W * 0.33) &&
|
if (x > (W * 0.33) &&
|
||||||
x < (W * 0.66) &&
|
x < (W * 0.66) &&
|
||||||
y > (H * 0.33) &&
|
y > (H * 0.33) &&
|
||||||
y < (H * 0.66))
|
y < (H * 0.66))
|
||||||
return 'center';
|
return 'center';
|
||||||
|
|
||||||
var isTL = x <= W - (y * W / H);
|
var isTL = x <= W - (y * W / H);
|
||||||
var isBL = x <= y * W / H;
|
var isBL = x <= y * W / H;
|
||||||
return (isTL && isBL) ? 'left' :
|
return (isTL && isBL) ? 'left' :
|
||||||
(isTL && !isBL) ? 'top' :
|
(isTL && !isBL) ? 'top' :
|
||||||
(!isTL && isBL) ? 'bottom' :
|
(!isTL && isBL) ? 'bottom' :
|
||||||
'right' ;
|
'right' ;
|
||||||
},
|
},
|
||||||
|
|
||||||
canDrop : function TabpanelDND_canDrop(aEvent)
|
canDrop : function TabpanelDND_canDrop(aEvent)
|
||||||
{
|
{
|
||||||
var session = this.treeStyleTab.currentDragSession;
|
var session = this.treeStyleTab.currentDragSession;
|
||||||
return !!(
|
return !!(
|
||||||
session &&
|
session &&
|
||||||
session.isDataFlavorSupported(this.treeStyleTab.kDRAG_TYPE_TABBAR) &&
|
session.isDataFlavorSupported(this.treeStyleTab.kDRAG_TYPE_TABBAR) &&
|
||||||
session.sourceNode &&
|
session.sourceNode &&
|
||||||
session.sourceNode.ownerDocument == this.document
|
session.sourceNode.ownerDocument == this.document
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleEvent : function TabpanelDND_handleEvent(aEvent)
|
handleEvent : function TabpanelDND_handleEvent(aEvent)
|
||||||
{
|
{
|
||||||
// ignore drag and drop while toolbar customization
|
// ignore drag and drop while toolbar customization
|
||||||
if (this.treeStyleTab.isToolbarCustomizing)
|
if (this.treeStyleTab.isToolbarCustomizing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (aEvent.type)
|
switch (aEvent.type)
|
||||||
{
|
{
|
||||||
case 'dragleave': return this.onDragLeave(aEvent);
|
case 'dragleave': return this.onDragLeave(aEvent);
|
||||||
case 'dragover': return this.onDragOver(aEvent);
|
case 'dragover': return this.onDragOver(aEvent);
|
||||||
case 'drop': return this.onDrop(aEvent);
|
case 'drop': return this.onDrop(aEvent);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragLeave : function TabpanelDND_onDragLeave(aEvent)
|
onDragLeave : function TabpanelDND_onDragLeave(aEvent)
|
||||||
{
|
{
|
||||||
if (!this.canDrop(aEvent)) return;
|
if (!this.canDrop(aEvent)) return;
|
||||||
var sv = this.treeStyleTab;
|
var sv = this.treeStyleTab;
|
||||||
if (this.browser.hasAttribute(sv.kDROP_POSITION))
|
if (this.browser.hasAttribute(sv.kDROP_POSITION))
|
||||||
sv.setTabbrowserAttribute(sv.kDROP_POSITION, sv.kDROP_POSITION_UNKNOWN);
|
sv.setTabbrowserAttribute(sv.kDROP_POSITION, sv.kDROP_POSITION_UNKNOWN);
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragOver : function TabpanelDND_onDragOver(aEvent)
|
onDragOver : function TabpanelDND_onDragOver(aEvent)
|
||||||
{
|
{
|
||||||
if (!this.canDrop(aEvent)) return;
|
if (!this.canDrop(aEvent)) return;
|
||||||
aEvent.preventDefault();
|
aEvent.preventDefault();
|
||||||
var sv = this.treeStyleTab;
|
var sv = this.treeStyleTab;
|
||||||
sv.setTabbrowserAttribute(sv.kDROP_POSITION, this.getDropPosition(aEvent));
|
sv.setTabbrowserAttribute(sv.kDROP_POSITION, this.getDropPosition(aEvent));
|
||||||
},
|
},
|
||||||
|
|
||||||
onDrop : function TabpanelDND_onDrop(aEvent)
|
onDrop : function TabpanelDND_onDrop(aEvent)
|
||||||
{
|
{
|
||||||
if (!this.canDrop(aEvent)) return;
|
if (!this.canDrop(aEvent)) return;
|
||||||
var sv = this.treeStyleTab;
|
var sv = this.treeStyleTab;
|
||||||
var dt = aEvent.dataTransfer;
|
var dt = aEvent.dataTransfer;
|
||||||
var position = this.getDropPosition(aEvent);
|
var position = this.getDropPosition(aEvent);
|
||||||
if (position != 'center' &&
|
if (position != 'center' &&
|
||||||
position != sv.position) {
|
position != sv.position) {
|
||||||
if (utils.getTreePref('tabbar.fixed.autoCancelOnDrop') &&
|
if (utils.getTreePref('tabbar.fixed.autoCancelOnDrop') &&
|
||||||
dt.getData(sv.kDRAG_TYPE_TABBAR) != sv.kTABBAR_MOVE_FORCE) {
|
dt.getData(sv.kDRAG_TYPE_TABBAR) != sv.kTABBAR_MOVE_FORCE) {
|
||||||
let orient = (position == 'left' || position == 'right') ? 'vertical' : 'horizontal' ;
|
let orient = (position == 'left' || position == 'right') ? 'vertical' : 'horizontal' ;
|
||||||
utils.setTreePref('tabbar.fixed.'+orient, false);
|
utils.setTreePref('tabbar.fixed.'+orient, false);
|
||||||
}
|
}
|
||||||
sv.setPrefForActiveWindow(function() {
|
sv.setPrefForActiveWindow(function() {
|
||||||
sv.position = sv.base.position = position;
|
sv.position = sv.base.position = position;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
aEvent.preventDefault();
|
aEvent.preventDefault();
|
||||||
aEvent.stopPropagation();
|
aEvent.stopPropagation();
|
||||||
},
|
},
|
||||||
|
|
||||||
init : function TabpanelDND_init(aTabBrowser)
|
init : function TabpanelDND_init(aTabBrowser)
|
||||||
{
|
{
|
||||||
this.browser = aTabBrowser;
|
this.browser = aTabBrowser;
|
||||||
this.document = aTabBrowser.ownerDocument;
|
this.document = aTabBrowser.ownerDocument;
|
||||||
this.window = this.document.defaultView;
|
this.window = this.document.defaultView;
|
||||||
this.treeStyleTab = aTabBrowser.treeStyleTab;
|
this.treeStyleTab = aTabBrowser.treeStyleTab;
|
||||||
|
|
||||||
var b = this.treeStyleTab.mTabBrowser;
|
var b = this.treeStyleTab.mTabBrowser;
|
||||||
b.mPanelContainer.addEventListener('dragover', this, true);
|
b.mPanelContainer.addEventListener('dragover', this, true);
|
||||||
b.mPanelContainer.addEventListener('dragleave', this, true);
|
b.mPanelContainer.addEventListener('dragleave', this, true);
|
||||||
b.mPanelContainer.addEventListener('drop', this, true);
|
b.mPanelContainer.addEventListener('drop', this, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy : function TabpanelDND_destroy()
|
destroy : function TabpanelDND_destroy()
|
||||||
{
|
{
|
||||||
var b = this.treeStyleTab.mTabBrowser;
|
var b = this.treeStyleTab.mTabBrowser;
|
||||||
b.mPanelContainer.removeEventListener('dragover', this, true);
|
b.mPanelContainer.removeEventListener('dragover', this, true);
|
||||||
b.mPanelContainer.removeEventListener('dragleave', this, true);
|
b.mPanelContainer.removeEventListener('dragleave', this, true);
|
||||||
b.mPanelContainer.removeEventListener('drop', this, true);
|
b.mPanelContainer.removeEventListener('drop', this, true);
|
||||||
|
|
||||||
delete this.treeStyleTab;
|
delete this.treeStyleTab;
|
||||||
delete this.browser;
|
delete this.browser;
|
||||||
delete this.document;
|
delete this.document;
|
||||||
delete this.window;
|
delete this.window;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,178 +1,178 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is the Tree Style Tab.
|
* The Original Code is the Tree Style Tab.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2011-2013
|
* Portions created by the Initial Developer are Copyright (C) 2011-2013
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ******/
|
* ***** END LICENSE BLOCK ******/
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ['TreeStyleTabThemeManager'];
|
const EXPORTED_SYMBOLS = ['TreeStyleTabThemeManager'];
|
||||||
|
|
||||||
const BASE = 'chrome://treestyletab/skin/';
|
const BASE = 'chrome://treestyletab/skin/';
|
||||||
|
|
||||||
Components.utils.import('resource://treestyletab-modules/base.js');
|
Components.utils.import('resource://treestyletab-modules/base.js');
|
||||||
|
|
||||||
function TreeStyleTabThemeManager(aWindow)
|
function TreeStyleTabThemeManager(aWindow)
|
||||||
{
|
{
|
||||||
this.window = aWindow;
|
this.window = aWindow;
|
||||||
this._preLoadImagesForStyleDone = [];
|
this._preLoadImagesForStyleDone = [];
|
||||||
this._preLoadImagesForStyleDoneImages = [];
|
this._preLoadImagesForStyleDoneImages = [];
|
||||||
}
|
}
|
||||||
TreeStyleTabThemeManager.prototype = {
|
TreeStyleTabThemeManager.prototype = {
|
||||||
destroy : function()
|
destroy : function()
|
||||||
{
|
{
|
||||||
delete this.window;
|
delete this.window;
|
||||||
},
|
},
|
||||||
|
|
||||||
set : function(aStyle, aPosition)
|
set : function(aStyle, aPosition)
|
||||||
{
|
{
|
||||||
if (this._lastStyles) {
|
if (this._lastStyles) {
|
||||||
for (let i = 0, maxi = this._lastStyles.length; i < maxi; i++)
|
for (let i = 0, maxi = this._lastStyles.length; i < maxi; i++)
|
||||||
{
|
{
|
||||||
let style = this._lastStyles[i];
|
let style = this._lastStyles[i];
|
||||||
style.parentNode.removeChild(style);
|
style.parentNode.removeChild(style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._lastStyles = null;
|
this._lastStyles = null;
|
||||||
|
|
||||||
var styles = [];
|
var styles = [];
|
||||||
switch (aStyle)
|
switch (aStyle)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'plain':
|
case 'plain':
|
||||||
case 'flat':
|
case 'flat':
|
||||||
case 'mixed':
|
case 'mixed':
|
||||||
styles.push(BASE+'square/base.css');
|
styles.push(BASE+'square/base.css');
|
||||||
if (aStyle != 'plain') {
|
if (aStyle != 'plain') {
|
||||||
styles.push(BASE+'square/mixed.css');
|
styles.push(BASE+'square/mixed.css');
|
||||||
styles.push(BASE+'square/tab-surface.css');
|
styles.push(BASE+'square/tab-surface.css');
|
||||||
}
|
}
|
||||||
if (aStyle != 'flat')
|
if (aStyle != 'flat')
|
||||||
styles.push(BASE+'square/dropshadow.css');
|
styles.push(BASE+'square/dropshadow.css');
|
||||||
styles.push(BASE+'platform-styled.css');
|
styles.push(BASE+'platform-styled.css');
|
||||||
styles.push(BASE+'square/platform.css');
|
styles.push(BASE+'square/platform.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'vertigo':
|
case 'vertigo':
|
||||||
styles.push(BASE+'square/base.css');
|
styles.push(BASE+'square/base.css');
|
||||||
styles.push(BASE+'square/vertigo.css');
|
styles.push(BASE+'square/vertigo.css');
|
||||||
styles.push(BASE+'platform-styled.css');
|
styles.push(BASE+'platform-styled.css');
|
||||||
styles.push(BASE+'square/platform.css');
|
styles.push(BASE+'square/platform.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'metal':
|
case 'metal':
|
||||||
styles.push(BASE+'metal/base.css');
|
styles.push(BASE+'metal/base.css');
|
||||||
styles.push(BASE+'metal/tab.css');
|
styles.push(BASE+'metal/tab.css');
|
||||||
styles.push(BASE+'metal/aero.css');
|
styles.push(BASE+'metal/aero.css');
|
||||||
styles.push(BASE+'platform-styled.css');
|
styles.push(BASE+'platform-styled.css');
|
||||||
styles.push(BASE+'metal/platform.css');
|
styles.push(BASE+'metal/platform.css');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sidebar':
|
case 'sidebar':
|
||||||
styles.push(BASE+'sidebar/sidebar.css');
|
styles.push(BASE+'sidebar/sidebar.css');
|
||||||
styles.push(BASE+'sidebar/aero.css');
|
styles.push(BASE+'sidebar/aero.css');
|
||||||
styles.push(BASE+'platform-styled.css');
|
styles.push(BASE+'platform-styled.css');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (styles.length) {
|
if (styles.length) {
|
||||||
this._lastStyles = styles.map(function(aStyle) {
|
this._lastStyles = styles.map(function(aStyle) {
|
||||||
var d = this.window.document;
|
var d = this.window.document;
|
||||||
var pi = d.createProcessingInstruction(
|
var pi = d.createProcessingInstruction(
|
||||||
'xml-stylesheet',
|
'xml-stylesheet',
|
||||||
'type="text/css" href="'+aStyle+'"'
|
'type="text/css" href="'+aStyle+'"'
|
||||||
);
|
);
|
||||||
d.insertBefore(pi, d.documentElement);
|
d.insertBefore(pi, d.documentElement);
|
||||||
return pi;
|
return pi;
|
||||||
}, this);
|
}, this);
|
||||||
this.preloadImages(aStyle, aPosition);
|
this.preloadImages(aStyle, aPosition);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
preloadImages : function(aStyle, aPosition)
|
preloadImages : function(aStyle, aPosition)
|
||||||
{
|
{
|
||||||
var key = aStyle+'-'+aPosition;
|
var key = aStyle+'-'+aPosition;
|
||||||
if (!aStyle ||
|
if (!aStyle ||
|
||||||
this._preLoadImagesForStyleDone.indexOf(key) > -1)
|
this._preLoadImagesForStyleDone.indexOf(key) > -1)
|
||||||
return;
|
return;
|
||||||
this._preLoadImagesForStyleDone.push(key);
|
this._preLoadImagesForStyleDone.push(key);
|
||||||
|
|
||||||
var images = key in this._preLoadImages ?
|
var images = key in this._preLoadImages ?
|
||||||
this._preLoadImages[key] :
|
this._preLoadImages[key] :
|
||||||
null ;
|
null ;
|
||||||
if (!images) return;
|
if (!images) return;
|
||||||
|
|
||||||
for (let i = 0, maxi = images.length; i < maxi; i++)
|
for (let i = 0, maxi = images.length; i < maxi; i++)
|
||||||
{
|
{
|
||||||
let image = images[i];
|
let image = images[i];
|
||||||
if (this._preLoadImagesForStyleDoneImages.indexOf(image) > -1)
|
if (this._preLoadImagesForStyleDoneImages.indexOf(image) > -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
(new this.window.Image()).src = image;
|
(new this.window.Image()).src = image;
|
||||||
this._preLoadImagesForStyleDoneImages.push(image);
|
this._preLoadImagesForStyleDoneImages.push(image);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_preLoadImages : {
|
_preLoadImages : {
|
||||||
'metal-left' : [
|
'metal-left' : [
|
||||||
BASE+'metal/tab-active-l.png',
|
BASE+'metal/tab-active-l.png',
|
||||||
BASE+'metal/tab-inactive-l.png',
|
BASE+'metal/tab-inactive-l.png',
|
||||||
BASE+'metal/tab-active-selected-l.png',
|
BASE+'metal/tab-active-selected-l.png',
|
||||||
BASE+'metal/tab-inactive-selected-l.png',
|
BASE+'metal/tab-inactive-selected-l.png',
|
||||||
BASE+'metal/shadow-active-l.png',
|
BASE+'metal/shadow-active-l.png',
|
||||||
BASE+'metal/shadow-inactive-l.png'
|
BASE+'metal/shadow-inactive-l.png'
|
||||||
].concat(
|
].concat(
|
||||||
[
|
[
|
||||||
BASE+'metal/tab-active-middle.png',
|
BASE+'metal/tab-active-middle.png',
|
||||||
BASE+'metal/tab-active-middle-selected.png',
|
BASE+'metal/tab-active-middle-selected.png',
|
||||||
BASE+'metal/tab-inactive-middle.png',
|
BASE+'metal/tab-inactive-middle.png',
|
||||||
BASE+'metal/tab-inactive-middle-selected.png'
|
BASE+'metal/tab-inactive-middle-selected.png'
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
'metal-right' : [
|
'metal-right' : [
|
||||||
BASE+'metal/tab-active-r.png',
|
BASE+'metal/tab-active-r.png',
|
||||||
BASE+'metal/tab-inactive-r.png',
|
BASE+'metal/tab-inactive-r.png',
|
||||||
BASE+'metal/tab-active-selected-r.png',
|
BASE+'metal/tab-active-selected-r.png',
|
||||||
BASE+'metal/tab-inactive-selected-r.png',
|
BASE+'metal/tab-inactive-selected-r.png',
|
||||||
BASE+'metal/shadow-active-r.png',
|
BASE+'metal/shadow-active-r.png',
|
||||||
BASE+'metal/shadow-inactive-r.png'
|
BASE+'metal/shadow-inactive-r.png'
|
||||||
].concat(
|
].concat(
|
||||||
[
|
[
|
||||||
BASE+'metal/tab-active-middle.png',
|
BASE+'metal/tab-active-middle.png',
|
||||||
BASE+'metal/tab-active-middle-selected.png',
|
BASE+'metal/tab-active-middle-selected.png',
|
||||||
BASE+'metal/tab-inactive-middle.png',
|
BASE+'metal/tab-inactive-middle.png',
|
||||||
BASE+'metal/tab-inactive-middle-selected.png'
|
BASE+'metal/tab-inactive-middle-selected.png'
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
612
modules/utils.js
612
modules/utils.js
@ -1,306 +1,306 @@
|
|||||||
/* ***** BEGIN LICENSE BLOCK *****
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License Version
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
* the License. You may obtain a copy of the License at
|
* the License. You may obtain a copy of the License at
|
||||||
* http://www.mozilla.org/MPL/
|
* http://www.mozilla.org/MPL/
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
* for the specific language governing rights and limitations under the
|
* for the specific language governing rights and limitations under the
|
||||||
* License.
|
* License.
|
||||||
*
|
*
|
||||||
* The Original Code is the Tree Style Tab.
|
* The Original Code is the Tree Style Tab.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
* The Initial Developer of the Original Code is YUKI "Piro" Hiroshi.
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2010-2014
|
* Portions created by the Initial Developer are Copyright (C) 2010-2014
|
||||||
* the Initial Developer. All Rights Reserved.
|
* the Initial Developer. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
* Contributor(s): YUKI "Piro" Hiroshi <piro.outsider.reflex@gmail.com>
|
||||||
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
* Tetsuharu OHZEKI <https://github.com/saneyuki>
|
||||||
*
|
*
|
||||||
* Alternatively, the contents of this file may be used under the terms of
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
* of those above. If you wish to allow use of your version of this file only
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
* use your version of this file under the terms of the MPL, indicate your
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
* decision by deleting the provisions above and replace them with the notice
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
* the provisions above, a recipient may use your version of this file under
|
* the provisions above, a recipient may use your version of this file under
|
||||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
*
|
*
|
||||||
* ***** END LICENSE BLOCK ******/
|
* ***** END LICENSE BLOCK ******/
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
let EXPORTED_SYMBOLS = ['TreeStyleTabUtils'];
|
let EXPORTED_SYMBOLS = ['TreeStyleTabUtils'];
|
||||||
|
|
||||||
const Cc = Components.classes;
|
const Cc = Components.classes;
|
||||||
const Ci = Components.interfaces;
|
const Ci = Components.interfaces;
|
||||||
const Cu = Components.utils;
|
const Cu = Components.utils;
|
||||||
|
|
||||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||||
Cu.import('resource://treestyletab-modules/constants.js');
|
Cu.import('resource://treestyletab-modules/constants.js');
|
||||||
|
|
||||||
XPCOMUtils.defineLazyGetter(this, 'window', function() {
|
XPCOMUtils.defineLazyGetter(this, 'window', function() {
|
||||||
Cu.import('resource://treestyletab-modules/lib/namespace.jsm');
|
Cu.import('resource://treestyletab-modules/lib/namespace.jsm');
|
||||||
return getNamespaceFor('piro.sakura.ne.jp');
|
return getNamespaceFor('piro.sakura.ne.jp');
|
||||||
});
|
});
|
||||||
XPCOMUtils.defineLazyGetter(this, 'prefs', function() {
|
XPCOMUtils.defineLazyGetter(this, 'prefs', function() {
|
||||||
Cu.import('resource://treestyletab-modules/lib/prefs.js');
|
Cu.import('resource://treestyletab-modules/lib/prefs.js');
|
||||||
return window['piro.sakura.ne.jp'].prefs;
|
return window['piro.sakura.ne.jp'].prefs;
|
||||||
});
|
});
|
||||||
XPCOMUtils.defineLazyGetter(this, 'stringBundle', function() {
|
XPCOMUtils.defineLazyGetter(this, 'stringBundle', function() {
|
||||||
Cu.import('resource://treestyletab-modules/lib/stringBundle.js', {});
|
Cu.import('resource://treestyletab-modules/lib/stringBundle.js', {});
|
||||||
return window['piro.sakura.ne.jp'].stringBundle;
|
return window['piro.sakura.ne.jp'].stringBundle;
|
||||||
});
|
});
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, 'Task',
|
XPCOMUtils.defineLazyModuleGetter(this, 'Task',
|
||||||
'resource://gre/modules/Task.jsm');
|
'resource://gre/modules/Task.jsm');
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, 'TreeStyleTabConstants',
|
XPCOMUtils.defineLazyModuleGetter(this, 'TreeStyleTabConstants',
|
||||||
'resource://treestyletab-modules/constants.js', 'TreeStyleTabConstants');
|
'resource://treestyletab-modules/constants.js', 'TreeStyleTabConstants');
|
||||||
|
|
||||||
const TST_PREF_PREFIX = 'extensions.treestyletab.';
|
const TST_PREF_PREFIX = 'extensions.treestyletab.';
|
||||||
const TST_PREF_VERSION = 10;
|
const TST_PREF_VERSION = 10;
|
||||||
|
|
||||||
|
|
||||||
let TreeStyleTabUtils = {
|
let TreeStyleTabUtils = {
|
||||||
|
|
||||||
get prefs () {
|
get prefs () {
|
||||||
return prefs;
|
return prefs;
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Save/Load Prefs */
|
/* Save/Load Prefs */
|
||||||
|
|
||||||
getTreePref : function TSTUtils_getTreePref(aPrefstring)
|
getTreePref : function TSTUtils_getTreePref(aPrefstring)
|
||||||
{
|
{
|
||||||
return prefs.getPref(TST_PREF_PREFIX + aPrefstring);
|
return prefs.getPref(TST_PREF_PREFIX + aPrefstring);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTreePref : function TSTUtils_setTreePref(aPrefstring, aNewValue)
|
setTreePref : function TSTUtils_setTreePref(aPrefstring, aNewValue)
|
||||||
{
|
{
|
||||||
return prefs.setPref(TST_PREF_PREFIX + aPrefstring, aNewValue);
|
return prefs.setPref(TST_PREF_PREFIX + aPrefstring, aNewValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
clearTreePref : function TSTUtils_clearTreePref(aPrefstring)
|
clearTreePref : function TSTUtils_clearTreePref(aPrefstring)
|
||||||
{
|
{
|
||||||
return prefs.clearPref(TST_PREF_PREFIX + aPrefstring);
|
return prefs.clearPref(TST_PREF_PREFIX + aPrefstring);
|
||||||
},
|
},
|
||||||
|
|
||||||
migratePrefs : function utils_migratePrefs()
|
migratePrefs : function utils_migratePrefs()
|
||||||
{
|
{
|
||||||
// migrate old prefs
|
// migrate old prefs
|
||||||
var orientalPrefs = [];
|
var orientalPrefs = [];
|
||||||
switch (this.getTreePref('prefsVersion'))
|
switch (this.getTreePref('prefsVersion'))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
orientalPrefs = orientalPrefs.concat([
|
orientalPrefs = orientalPrefs.concat([
|
||||||
'extensions.treestyletab.tabbar.fixed',
|
'extensions.treestyletab.tabbar.fixed',
|
||||||
'extensions.treestyletab.enableSubtreeIndent',
|
'extensions.treestyletab.enableSubtreeIndent',
|
||||||
'extensions.treestyletab.allowSubtreeCollapseExpand'
|
'extensions.treestyletab.allowSubtreeCollapseExpand'
|
||||||
]);
|
]);
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
if (this.getTreePref('urlbar.loadSameDomainToNewChildTab') !== null) {
|
if (this.getTreePref('urlbar.loadSameDomainToNewChildTab') !== null) {
|
||||||
let value = this.getTreePref('urlbar.loadSameDomainToNewChildTab');
|
let value = this.getTreePref('urlbar.loadSameDomainToNewChildTab');
|
||||||
this.setTreePref('urlbar.loadSameDomainToNewTab', value);
|
this.setTreePref('urlbar.loadSameDomainToNewTab', value);
|
||||||
this.setTreePref('urlbar.loadSameDomainToNewTab.asChild', value);
|
this.setTreePref('urlbar.loadSameDomainToNewTab.asChild', value);
|
||||||
if (value) {
|
if (value) {
|
||||||
this.setTreePref('urlbar.loadDifferentDomainToNewTab', value);
|
this.setTreePref('urlbar.loadDifferentDomainToNewTab', value);
|
||||||
}
|
}
|
||||||
this.clearTreePref('urlbar.loadSameDomainToNewChildTab');
|
this.clearTreePref('urlbar.loadSameDomainToNewChildTab');
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
if (this.getTreePref('loadDroppedLinkToNewChildTab') !== null) {
|
if (this.getTreePref('loadDroppedLinkToNewChildTab') !== null) {
|
||||||
this.setTreePref('dropLinksOnTab.behavior',
|
this.setTreePref('dropLinksOnTab.behavior',
|
||||||
this.getTreePref('loadDroppedLinkToNewChildTab.confirm') ?
|
this.getTreePref('loadDroppedLinkToNewChildTab.confirm') ?
|
||||||
TreeStyleTabConstants.kDROPLINK_ASK :
|
TreeStyleTabConstants.kDROPLINK_ASK :
|
||||||
this.getTreePref('loadDroppedLinkToNewChildTab') ?
|
this.getTreePref('loadDroppedLinkToNewChildTab') ?
|
||||||
TreeStyleTabConstants.kDROPLINK_NEWTAB :
|
TreeStyleTabConstants.kDROPLINK_NEWTAB :
|
||||||
TreeStyleTabConstants.kDROPLINK_LOAD
|
TreeStyleTabConstants.kDROPLINK_LOAD
|
||||||
);
|
);
|
||||||
this.clearTreePref('loadDroppedLinkToNewChildTab.confirm');
|
this.clearTreePref('loadDroppedLinkToNewChildTab.confirm');
|
||||||
this.clearTreePref('loadDroppedLinkToNewChildTab');
|
this.clearTreePref('loadDroppedLinkToNewChildTab');
|
||||||
}
|
}
|
||||||
if (this.getTreePref('openGroupBookmarkAsTabSubTree') !== null) {
|
if (this.getTreePref('openGroupBookmarkAsTabSubTree') !== null) {
|
||||||
let behavior = 0;
|
let behavior = 0;
|
||||||
if (this.getTreePref('openGroupBookmarkAsTabSubTree.underParent'))
|
if (this.getTreePref('openGroupBookmarkAsTabSubTree.underParent'))
|
||||||
behavior += TreeStyleTabConstants.kGROUP_BOOKMARK_USE_DUMMY;
|
behavior += TreeStyleTabConstants.kGROUP_BOOKMARK_USE_DUMMY;
|
||||||
if (!this.getTreePref('openGroupBookmarkBehavior.confirm')) {
|
if (!this.getTreePref('openGroupBookmarkBehavior.confirm')) {
|
||||||
behavior += (
|
behavior += (
|
||||||
this.getTreePref('openGroupBookmarkAsTabSubTree') ?
|
this.getTreePref('openGroupBookmarkAsTabSubTree') ?
|
||||||
TreeStyleTabConstants.kGROUP_BOOKMARK_SUBTREE :
|
TreeStyleTabConstants.kGROUP_BOOKMARK_SUBTREE :
|
||||||
TreeStyleTabConstants.kGROUP_BOOKMARK_SEPARATE
|
TreeStyleTabConstants.kGROUP_BOOKMARK_SEPARATE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.setTreePref('openGroupBookmark.behavior', behavior);
|
this.setTreePref('openGroupBookmark.behavior', behavior);
|
||||||
this.clearTreePref('openGroupBookmarkBehavior.confirm');
|
this.clearTreePref('openGroupBookmarkBehavior.confirm');
|
||||||
this.clearTreePref('openGroupBookmarkAsTabSubTree');
|
this.clearTreePref('openGroupBookmarkAsTabSubTree');
|
||||||
this.clearTreePref('openGroupBookmarkAsTabSubTree.underParent');
|
this.clearTreePref('openGroupBookmarkAsTabSubTree.underParent');
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
let (subTreePrefs = [
|
let (subTreePrefs = [
|
||||||
'extensions.treestyletab.autoCollapseExpandSubTreeOnSelect',
|
'extensions.treestyletab.autoCollapseExpandSubTreeOnSelect',
|
||||||
'extensions.treestyletab.autoCollapseExpandSubTreeOnSelect.onCurrentTabRemove',
|
'extensions.treestyletab.autoCollapseExpandSubTreeOnSelect.onCurrentTabRemove',
|
||||||
'extensions.treestyletab.autoCollapseExpandSubTreeOnSelect.whileFocusMovingByShortcut',
|
'extensions.treestyletab.autoCollapseExpandSubTreeOnSelect.whileFocusMovingByShortcut',
|
||||||
'extensions.treestyletab.autoExpandSubTreeOnAppendChild',
|
'extensions.treestyletab.autoExpandSubTreeOnAppendChild',
|
||||||
'extensions.treestyletab.autoExpandSubTreeOnCollapsedChildFocused',
|
'extensions.treestyletab.autoExpandSubTreeOnCollapsedChildFocused',
|
||||||
'extensions.treestyletab.collapseExpandSubTree.dblclick',
|
'extensions.treestyletab.collapseExpandSubTree.dblclick',
|
||||||
'extensions.treestyletab.createSubTree.underParent',
|
'extensions.treestyletab.createSubTree.underParent',
|
||||||
'extensions.treestyletab.show.context-item-reloadTabSubTree',
|
'extensions.treestyletab.show.context-item-reloadTabSubTree',
|
||||||
'extensions.treestyletab.show.context-item-removeTabSubTree',
|
'extensions.treestyletab.show.context-item-removeTabSubTree',
|
||||||
'extensions.treestyletab.show.context-item-bookmarkTabSubTree',
|
'extensions.treestyletab.show.context-item-bookmarkTabSubTree',
|
||||||
'extensions.multipletab.show.multipletab-selection-item-removeTabSubTree',
|
'extensions.multipletab.show.multipletab-selection-item-removeTabSubTree',
|
||||||
'extensions.multipletab.show.multipletab-selection-item-createSubTree'
|
'extensions.multipletab.show.multipletab-selection-item-createSubTree'
|
||||||
]) {
|
]) {
|
||||||
for (let i = 0, maxi = subTreePrefs.length; i < maxi; i++)
|
for (let i = 0, maxi = subTreePrefs.length; i < maxi; i++)
|
||||||
{
|
{
|
||||||
let pref = subTreePrefs[i];
|
let pref = subTreePrefs[i];
|
||||||
let value = prefs.getPref(pref);
|
let value = prefs.getPref(pref);
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
prefs.setPref(pref.replace('SubTree', 'Subtree'), value);
|
prefs.setPref(pref.replace('SubTree', 'Subtree'), value);
|
||||||
prefs.clearPref(pref);
|
prefs.clearPref(pref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 5:
|
case 5:
|
||||||
let (behavior = this.getTreePref('openGroupBookmark.behavior')) {
|
let (behavior = this.getTreePref('openGroupBookmark.behavior')) {
|
||||||
behavior = behavior | 2048;
|
behavior = behavior | 2048;
|
||||||
this.setTreePref('openGroupBookmark.behavior', behavior);
|
this.setTreePref('openGroupBookmark.behavior', behavior);
|
||||||
}
|
}
|
||||||
case 6:
|
case 6:
|
||||||
let (
|
let (
|
||||||
general = this.getTreePref('autoAttachNewTabsAsChildren'),
|
general = this.getTreePref('autoAttachNewTabsAsChildren'),
|
||||||
search = this.getTreePref('autoAttachSearchResultAsChildren')
|
search = this.getTreePref('autoAttachSearchResultAsChildren')
|
||||||
) {
|
) {
|
||||||
if (general !== null)
|
if (general !== null)
|
||||||
this.setTreePref('autoAttach', general);
|
this.setTreePref('autoAttach', general);
|
||||||
if (search !== null)
|
if (search !== null)
|
||||||
this.setTreePref('autoAttach.searchResult', search);
|
this.setTreePref('autoAttach.searchResult', search);
|
||||||
}
|
}
|
||||||
case 7:
|
case 7:
|
||||||
let (
|
let (
|
||||||
enabled = this.getTreePref('autoCollapseExpandSubtreeOnSelect.whileFocusMovingByShortcut'),
|
enabled = this.getTreePref('autoCollapseExpandSubtreeOnSelect.whileFocusMovingByShortcut'),
|
||||||
delay = this.getTreePref('autoCollapseExpandSubtreeOnSelect.whileFocusMovingByShortcut.delay')
|
delay = this.getTreePref('autoCollapseExpandSubtreeOnSelect.whileFocusMovingByShortcut.delay')
|
||||||
) {
|
) {
|
||||||
if (enabled !== null) {
|
if (enabled !== null) {
|
||||||
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut', enabled);
|
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut', enabled);
|
||||||
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut.collapseOthers', enabled);
|
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut.collapseOthers', enabled);
|
||||||
}
|
}
|
||||||
if (delay !== null)
|
if (delay !== null)
|
||||||
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut.delay', delay);
|
this.setTreePref('autoExpandSubtreeOnSelect.whileFocusMovingByShortcut.delay', delay);
|
||||||
}
|
}
|
||||||
case 8:
|
case 8:
|
||||||
orientalPrefs = orientalPrefs.concat([
|
orientalPrefs = orientalPrefs.concat([
|
||||||
'extensions.treestyletab.indent',
|
'extensions.treestyletab.indent',
|
||||||
'extensions.treestyletab.indent.min'
|
'extensions.treestyletab.indent.min'
|
||||||
]);
|
]);
|
||||||
case 9:
|
case 9:
|
||||||
let (behavior = this.getTreePref('openGroupBookmark.behavior')) {
|
let (behavior = this.getTreePref('openGroupBookmark.behavior')) {
|
||||||
if (behavior & 4) {
|
if (behavior & 4) {
|
||||||
behavior ^= 4;
|
behavior ^= 4;
|
||||||
behavior |= 1;
|
behavior |= 1;
|
||||||
this.setTreePref('openGroupBookmark.behavior', behavior);
|
this.setTreePref('openGroupBookmark.behavior', behavior);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
for (let i = 0, maxi = orientalPrefs.length; i < maxi; i++)
|
for (let i = 0, maxi = orientalPrefs.length; i < maxi; i++)
|
||||||
{
|
{
|
||||||
let pref = orientalPrefs[i];
|
let pref = orientalPrefs[i];
|
||||||
let value = prefs.getPref(pref);
|
let value = prefs.getPref(pref);
|
||||||
if (value === null) {
|
if (value === null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
prefs.setPref(pref+'.horizontal', value);
|
prefs.setPref(pref+'.horizontal', value);
|
||||||
prefs.setPref(pref+'.vertical', value);
|
prefs.setPref(pref+'.vertical', value);
|
||||||
prefs.clearPref(pref);
|
prefs.clearPref(pref);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.setTreePref('prefsVersion', TST_PREF_VERSION);
|
this.setTreePref('prefsVersion', TST_PREF_VERSION);
|
||||||
},
|
},
|
||||||
|
|
||||||
/* string bundle */
|
/* string bundle */
|
||||||
get treeBundle () {
|
get treeBundle () {
|
||||||
return stringBundle.get('chrome://treestyletab/locale/treestyletab.properties');
|
return stringBundle.get('chrome://treestyletab/locale/treestyletab.properties');
|
||||||
},
|
},
|
||||||
get tabbrowserBundle () {
|
get tabbrowserBundle () {
|
||||||
return stringBundle.get('chrome://browser/locale/tabbrowser.properties');
|
return stringBundle.get('chrome://browser/locale/tabbrowser.properties');
|
||||||
},
|
},
|
||||||
|
|
||||||
evalInSandbox : function utils_evalInSandbox(aCode, aOwner)
|
evalInSandbox : function utils_evalInSandbox(aCode, aOwner)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
var sandbox = new Cu.Sandbox(aOwner || 'about:blank');
|
var sandbox = new Cu.Sandbox(aOwner || 'about:blank');
|
||||||
return Cu.evalInSandbox(aCode, sandbox);
|
return Cu.evalInSandbox(aCode, sandbox);
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
}
|
}
|
||||||
return void(0);
|
return void(0);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
isTabNotRestoredYet : function utils_isTabNotRestoredYet(aTab)
|
isTabNotRestoredYet : function utils_isTabNotRestoredYet(aTab)
|
||||||
{
|
{
|
||||||
var browser = aTab.linkedBrowser;
|
var browser = aTab.linkedBrowser;
|
||||||
// Firefox 25 and later. See: https://bugzilla.mozilla.org/show_bug.cgi?id=867142
|
// Firefox 25 and later. See: https://bugzilla.mozilla.org/show_bug.cgi?id=867142
|
||||||
if (this.TabRestoreStates &&
|
if (this.TabRestoreStates &&
|
||||||
this.TabRestoreStates.has(browser))
|
this.TabRestoreStates.has(browser))
|
||||||
return (
|
return (
|
||||||
this.TabRestoreStates.isNeedsRestore(browser) ||
|
this.TabRestoreStates.isNeedsRestore(browser) ||
|
||||||
this.TabRestoreStates.isRestoring(browser)
|
this.TabRestoreStates.isRestoring(browser)
|
||||||
);
|
);
|
||||||
|
|
||||||
return !!browser.__SS_restoreState;
|
return !!browser.__SS_restoreState;
|
||||||
},
|
},
|
||||||
isTabNeedToBeRestored : function utils_isTabNeedToBeRestored(aTab)
|
isTabNeedToBeRestored : function utils_isTabNeedToBeRestored(aTab)
|
||||||
{
|
{
|
||||||
var browser = aTab.linkedBrowser;
|
var browser = aTab.linkedBrowser;
|
||||||
// Firefox 25 and later. See: https://bugzilla.mozilla.org/show_bug.cgi?id=867142
|
// Firefox 25 and later. See: https://bugzilla.mozilla.org/show_bug.cgi?id=867142
|
||||||
if (this.TabRestoreStates &&
|
if (this.TabRestoreStates &&
|
||||||
this.TabRestoreStates.has(browser))
|
this.TabRestoreStates.has(browser))
|
||||||
return this.TabRestoreStates.isNeedsRestore(browser);
|
return this.TabRestoreStates.isNeedsRestore(browser);
|
||||||
|
|
||||||
return browser.__SS_restoreState == 1;
|
return browser.__SS_restoreState == 1;
|
||||||
},
|
},
|
||||||
get SessionStoreInternal() {
|
get SessionStoreInternal() {
|
||||||
return this.SessionStoreNS.SessionStoreInternal;
|
return this.SessionStoreNS.SessionStoreInternal;
|
||||||
},
|
},
|
||||||
get TabRestoreStates() {
|
get TabRestoreStates() {
|
||||||
return this.SessionStoreNS.TabRestoreStates;
|
return this.SessionStoreNS.TabRestoreStates;
|
||||||
},
|
},
|
||||||
get SessionStoreNS() {
|
get SessionStoreNS() {
|
||||||
if (!this._SessionStoreNS) {
|
if (!this._SessionStoreNS) {
|
||||||
try {
|
try {
|
||||||
// resource://app/modules/sessionstore/SessionStore.jsm ?
|
// resource://app/modules/sessionstore/SessionStore.jsm ?
|
||||||
this._SessionStoreNS = Components.utils.import('resource:///modules/sessionstore/SessionStore.jsm', {});
|
this._SessionStoreNS = Components.utils.import('resource:///modules/sessionstore/SessionStore.jsm', {});
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
this._SessionStoreNS = {};
|
this._SessionStoreNS = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this._SessionStoreNS;
|
return this._SessionStoreNS;
|
||||||
},
|
},
|
||||||
|
|
||||||
getShortcutOrURI : function utils_getShortcutOrURI(aBrowserWindow, aURI)
|
getShortcutOrURI : function utils_getShortcutOrURI(aBrowserWindow, aURI)
|
||||||
{
|
{
|
||||||
var done = false;
|
var done = false;
|
||||||
aBrowserWindow.getShortcutOrURIAndPostData(aURI, function(aData) {
|
aBrowserWindow.getShortcutOrURIAndPostData(aURI, function(aData) {
|
||||||
aURI = aData.url;
|
aURI = aData.url;
|
||||||
done = true;
|
done = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
// this should be rewritten in asynchronous style...
|
// this should be rewritten in asynchronous style...
|
||||||
var thread = Cc['@mozilla.org/thread-manager;1'].getService().mainThread;
|
var thread = Cc['@mozilla.org/thread-manager;1'].getService().mainThread;
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
thread.processNextEvent(true);
|
thread.processNextEvent(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return aURI;
|
return aURI;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
3544
modules/window.js
3544
modules/window.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user