From a8c9189abc0c73940740d8a87f5577cd3f2d116f Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 9 Jul 2009 04:26:36 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=B5=E3=83=96=E3=83=84=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=82=92=E3=83=96=E3=83=83=E3=82=AF=E3=83=9E=E3=83=BC=E3=82=AF?= =?UTF-8?q?=E3=81=AB=E4=BF=9D=E5=AD=98=E3=81=99=E3=82=8B=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=83=A9=E3=82=A4=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=83=AA=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4694 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- chrome.manifest | 3 + .../treestyletab/res/bookmarkMultipleTabs.xul | 115 ++++++++++++++++++ ...MultipleTabs_bookmarkPropertiesOverlay.xul | 50 ++++++++ content/treestyletab/treestyletab.js | 78 +----------- 4 files changed, 173 insertions(+), 73 deletions(-) create mode 100644 content/treestyletab/res/bookmarkMultipleTabs.xul create mode 100644 content/treestyletab/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul diff --git a/chrome.manifest b/chrome.manifest index e38487ff..fdb59d0b 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -5,6 +5,9 @@ overlay chrome://browser/content/browser.xul chrome://treestyletab/content/trees overlay chrome://browser/content/bookmarks/bookmarksPanel.xul chrome://treestyletab/content/bookmarksOverlay.xul 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/bookmarkProperties2.xul chrome://treestyletab/content/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul + style chrome://browser/content/browser.xul chrome://treestyletab/content/treestyletab-3.5.css appversion>=3.1 locale treestyletab en-US jar:chrome/treestyletab.jar!/locale/en-US/treestyletab/ diff --git a/content/treestyletab/res/bookmarkMultipleTabs.xul b/content/treestyletab/res/bookmarkMultipleTabs.xul new file mode 100644 index 00000000..3715ad74 --- /dev/null +++ b/content/treestyletab/res/bookmarkMultipleTabs.xul @@ -0,0 +1,115 @@ + + + + + diff --git a/content/treestyletab/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul b/content/treestyletab/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul new file mode 100644 index 00000000..234b5f9d --- /dev/null +++ b/content/treestyletab/res/bookmarkMultipleTabs_bookmarkPropertiesOverlay.xul @@ -0,0 +1,50 @@ + + + + + diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 66dbccec..21b3358d 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -2170,86 +2170,18 @@ catch(e) { tabs = [aTabOrTabs]; } - var folderName = null; - if (this.isGroupTab(tabs[0], true)) { - folderName = tabs[0].label; - tabs.splice(0, 1); - } + var folderName = this.isGroupTab(tabs[0], true) ? tabs[0].label : 0 ; var b = this.getTabBrowserFromChild(tabs[0]); var bookmarkedTabs = []; - tabs.forEach(function(aTab) { - if (!this.isGroupTab(aTab)) bookmarkedTabs.push(aTab); + tabs.forEach(function(aTab, aIndex) { + if (!this.isGroupTab(aTab, aIndex == 0)) bookmarkedTabs.push(aTab); bookmarkedTabs = bookmarkedTabs.concat(b.treeStyleTab.getDescendantTabs(aTab)); }, this); - if ('MultipleTabService' in window && - 'addBookmarkFor' in MultipleTabService) { - MultipleTabService.addBookmarkFor(bookmarkedTabs, folderName); - } - else { - this._addBookmarkFor(bookmarkedTabs, folderName); - } + window['piro.sakura.ne.jp'].bookmarkMultipleTabs.addBookmarkFor(bookmarkedTabs, folderName); }, - - _addBookmarkFor : function(aTabs, aFolder) // from Multiple Tab Handler - { - if (!aTabs) return; - - var b = this.getTabBrowserFromChild(aTabs[0]); - - if ('PlacesUIUtils' in window || 'PlacesUtils' in window) { // Firefox 3 - var utils = 'PlacesUIUtils' in window ? PlacesUIUtils : PlacesUtils ; - utils.showMinimalAddMultiBookmarkUI(Array.slice(aTabs).map(this.addBookmarkTabsFilter)); - return; - } - - var currentTabInfo; - var tabsInfo = Array.slice(aTabs) - .filter(function(aTab) { - return aTab.parentNode; // ignore removed tabs - }) - .map(function(aTab) { - var webNav = aTab.linkedBrowser.webNavigation; - var url = webNav.currentURI.spec; - var name = ''; - var charSet, description; - try { - var doc = webNav.document; - name = doc.title || url; - charSet = doc.characterSet; - description = BookmarksUtils.getDescriptionFromDocument(doc); - } - catch (e) { - name = url; - } - return { - name : name, - url : url, - charset : charSet, - description : description - }; - }); - - window.openDialog( - 'chrome://browser/content/bookmarks/addBookmark2.xul', - '', - BROWSER_ADD_BM_FEATURES, - (aTabs.length == 1 ? - tabsInfo[0] : - { - name : (aFolderName || gNavigatorBundle.getString('bookmarkAllTabsDefault')), - bBookmarkAllTabs : true, - objGroup : tabsInfo - } - ) - ); - }, - addBookmarkTabsFilter : function(aTab) - { - return aTab.linkedBrowser.currentURI; - }, - + openSelectionLinks : function(aFrame) { aFrame = this.getCurrentFrame(aFrame);