On FIrefox 9 and later, "bookmark this tree" feature was broken.

This commit is contained in:
Piro / SHIMODA Hiroshi 2012-02-07 01:21:32 +09:00
parent 019ff57aed
commit 6bd6ddeea9
5 changed files with 26 additions and 4 deletions

View File

@ -27,8 +27,19 @@ var TreeStyleTabBookmarksServiceEditable = {
return document.getElementById('treestyletab-parent-blank-item');
},
get isCreatingMultipleBookmarksInFolder()
{
return (
window.arguments.length &&
window.arguments[0] &&
window.arguments[0].type == 'folder'
);
},
init : function TSTBMEditable_init()
{
if (this.isCreatingMultipleBookmarksInFolder) return;
// main browser window
if ('StarUI' in window) {
if ('_doShowEditBookmarkPanel' in StarUI) {
@ -69,7 +80,12 @@ var TreeStyleTabBookmarksServiceEditable = {
initEditUI : function TSTBMEditable_initEditUI()
{
if (this.editUIInitialized || !('gEditItemOverlay' in window)) return;
if (
this.editUIInitialized ||
!('gEditItemOverlay' in window) ||
this.isCreatingMultipleBookmarksInFolder
)
return;
var container = document.getElementById('editBookmarkPanelGrid');
if (!container) return;

View File

@ -6,6 +6,8 @@
in chrome.manifest:
overlay chrome://browser/content/browser.xul
chrome://***/content/bookmarkMultipleTabs.xul
overlay chrome://browser/content/places/bookmarkProperties.xul
chrome://***/content/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
overlay chrome://browser/content/places/bookmarkProperties2.xul
chrome://***/content/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
@ -63,7 +65,7 @@ window.addEventListener('DOMContentLoaded', function() {
var tabs = Array.slice(aTabs).map(this.addBookmarkTabsFilter);
if (aFolderName)
this.Prefs.setCharPref('temp.showMinimalAddMultiBookmarkUI.folderName', unescape(encodeURIComponent(aFolderName)));
if ('showBookmarkDialog' in utils) { // Firefox 11 or later
if ('showBookmarkDialog' in utils) { // Firefox 9 or later
utils.showBookmarkDialog({
action : 'add',
type : 'folder',
@ -72,7 +74,7 @@ window.addEventListener('DOMContentLoaded', function() {
hiddenRows : ['description', 'location', 'loadInSidebar', 'keyword']
}, window);
}
else if ('showMinimalAddMultiBookmarkUI' in utils) { // Firefox 3 - 10
else if ('showMinimalAddMultiBookmarkUI' in utils) { // Firefox 3 - 8
utils.showMinimalAddMultiBookmarkUI(tabs);
}
else {

View File

@ -6,13 +6,15 @@
in chrome.manifest:
overlay chrome://browser/content/browser.xul
chrome://***/content/bookmarkMultipleTabs.xul
overlay chrome://browser/content/places/bookmarkProperties.xul
chrome://***/content/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
overlay chrome://browser/content/places/bookmarkProperties2.xul
chrome://***/content/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
in JS files:
window['piro.sakura.ne.jp'].bookmarkMultipleTabs.addBookmarkFor(tabsArray, folderName);
license: The MIT License, Copyright (c) 2009 SHIMODA "Piro" Hiroshi
license: The MIT License, Copyright (c) 2009-2012 SHIMODA "Piro" Hiroshi
http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/license.txt
original:
http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/bookmarkMultipleTabs.xul

View File

@ -12,6 +12,7 @@ overlay chrome://browser/content/places/bookmarkProperties.xul chrome://treestyl
overlay chrome://multipletab/content/config.xul chrome://treestyletab/content/multipletabConfigOverlay.xul
overlay chrome://browser/content/browser.xul chrome://treestyletab/content/res/bookmarkMultipleTabs.xul
overlay chrome://browser/content/places/bookmarkProperties.xul chrome://treestyletab/content/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
overlay chrome://browser/content/places/bookmarkProperties2.xul chrome://treestyletab/content/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
locale treestyletab en-US jar:chrome/treestyletab.jar!/locale/en-US/treestyletab/

View File

@ -12,6 +12,7 @@ overlay chrome://browser/content/places/bookmarkProperties.xul chrome://treestyl
overlay chrome://multipletab/content/config.xul chrome://treestyletab/content/multipletabConfigOverlay.xul
overlay chrome://browser/content/browser.xul chrome://treestyletab/content/res/bookmarkMultipleTabs.xul
overlay chrome://browser/content/places/bookmarkProperties.xul chrome://treestyletab/content/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
overlay chrome://browser/content/places/bookmarkProperties2.xul chrome://treestyletab/content/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul
locale treestyletab en-US locale/en-US/treestyletab/