メソッドの並び順を変更

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4837 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-07-30 14:48:56 +00:00
parent 4b269023bf
commit 4e9a8e7feb

View File

@ -498,41 +498,6 @@ var TreeStyleTabService = {
this.setTreePref('tabbar.position', aNewPosition); 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 */ /* backward compatibility */
getTempTreeStyleTab : function(aTabBrowser) getTempTreeStyleTab : function(aTabBrowser)
{ {
@ -2594,6 +2559,42 @@ catch(e) {
/* bookmarks and tabs */ /* 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() // based on PlacesUtils.getURLsForContainerNode()
getItemIdsForContainerNode: function(aNode) getItemIdsForContainerNode: function(aNode)
{ {