From 4e9a8e7feb83685631dead401957eec9d73548bb Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 30 Jul 2009 14:48:56 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=81=AE?= =?UTF-8?q?=E4=B8=A6=E3=81=B3=E9=A0=86=E3=82=92=E5=A4=89=E6=9B=B4?= 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@4837 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 71 ++++++++++++++-------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 8c7af162..75072864 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -497,41 +497,6 @@ var TreeStyleTabService = { aNewPosition = aNewPosition.toLowerCase(); this.setTreePref('tabbar.position', aNewPosition); }, - - beginAddBookmarksFromTabs : function(aTabs) /* PUBLIC API */ - { - this._addingBookmarks = []; - this._addingBookmarkTreeStructure = aTabs.map(function(aTab) { - var parent = this.getParentTab(aTab); - return aTabs.indexOf(parent); - }, this); - - this.BookmarksService.addObserver(this, false); - }, - endAddBookmarksFromTabs : function() /* PUBLIC API */ - { - this.BookmarksService.removeObserver(this); - - // this is adding bookmark folder from tabs, so ignroe the first item! - if ( - this._addingBookmarks.length == this._addingBookmarkTreeStructure.length+1 && - this.BookmarksService.getItemType(this._addingBookmarks[0].id) == this.BookmarksService.TYPE_FOLDER - ) - this._addingBookmarks.shift(); - - if (this._addingBookmarks.length == this._addingBookmarkTreeStructure.length) { - this._addingBookmarks.forEach(function(aItem, aIndex) { - let index = this._addingBookmarkTreeStructure[aIndex]; - PlacesUtils.setAnnotationsForItem(aItem.id, [{ - name : this.kPARENT, - value : (index > -1 ? this._addingBookmarks[index].id : -1 ), - expires : PlacesUtils.annotations.EXPIRE_NEVER - }]); - }, this); - } - this._addingBookmarks = []; - this._addingBookmarkTreeStructure = []; - }, /* backward compatibility */ getTempTreeStyleTab : function(aTabBrowser) @@ -2594,6 +2559,42 @@ catch(e) { /* bookmarks and tabs */ + beginAddBookmarksFromTabs : function(aTabs) /* PUBLIC API */ + { + this._addingBookmarks = []; + this._addingBookmarkTreeStructure = aTabs.map(function(aTab) { + var parent = this.getParentTab(aTab); + return aTabs.indexOf(parent); + }, this); + + this.BookmarksService.addObserver(this, false); + }, + + endAddBookmarksFromTabs : function() /* PUBLIC API */ + { + this.BookmarksService.removeObserver(this); + + // this is adding bookmark folder from tabs, so ignroe the first item! + if ( + this._addingBookmarks.length == this._addingBookmarkTreeStructure.length+1 && + this.BookmarksService.getItemType(this._addingBookmarks[0].id) == this.BookmarksService.TYPE_FOLDER + ) + this._addingBookmarks.shift(); + + if (this._addingBookmarks.length == this._addingBookmarkTreeStructure.length) { + this._addingBookmarks.forEach(function(aItem, aIndex) { + let index = this._addingBookmarkTreeStructure[aIndex]; + PlacesUtils.setAnnotationsForItem(aItem.id, [{ + name : this.kPARENT, + value : (index > -1 ? this._addingBookmarks[index].id : -1 ), + expires : PlacesUtils.annotations.EXPIRE_NEVER + }]); + }, this); + } + this._addingBookmarks = []; + this._addingBookmarkTreeStructure = []; + }, + // based on PlacesUtils.getURLsForContainerNode() getItemIdsForContainerNode: function(aNode) {