mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-29 02:07:36 +00:00
Monotone-Parent: 2303b51b776f8ba14da83e3a05e92f43b13279cc
Monotone-Revision: eeacd02d8b13bdfa77275e74d14f7175e508e254 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-25T21:12:46 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
var MailerUIdTreeExtension = {
|
||||
elementCounter: 1,
|
||||
folderIcons: { account: "tbtv_account_17x17.gif",
|
||||
inbox: "tbtv_inbox_17x17.gif",
|
||||
sent: "tbtv_sent_17x17.gif",
|
||||
draft: "tbtv_drafts_17x17.gif",
|
||||
trash: "tbtv_trash_17x17.gif" },
|
||||
folderNames: { inbox: labels["InboxFolderName"],
|
||||
sent: labels["SentFolderName"],
|
||||
draft: labels["DraftsFolderName"],
|
||||
trash: labels["TrashFolderName"] },
|
||||
_addFolderNode: function (parent, name, fullName, type) {
|
||||
var icon = this.folderIcons[type];
|
||||
if (icon)
|
||||
icon = ResourcesURL + "/" + icon;
|
||||
else
|
||||
icon = "";
|
||||
var displayName = this.folderNames[type];
|
||||
if (!displayName)
|
||||
displayName = name;
|
||||
this.add(this.elementCounter, parent, displayName, 1, '#', fullName,
|
||||
type, '', '', icon, icon);
|
||||
this.elementCounter++;
|
||||
},
|
||||
_addFolder: function (parent, folder) {
|
||||
var thisCounter = this.elementCounter;
|
||||
var fullName = "";
|
||||
var currentFolder = folder;
|
||||
while (currentFolder) {
|
||||
fullName = "/" + currentFolder.name + fullName;
|
||||
currentFolder = currentFolder.parentFolder;
|
||||
}
|
||||
this._addFolderNode(parent, folder.name, fullName, folder.type);
|
||||
for (var i = 0; i < folder.children.length; i++)
|
||||
this._addFolder(thisCounter, folder.children[i]);
|
||||
},
|
||||
addMailAccount: function (mailAccount) {
|
||||
this._addFolder(0, mailAccount);
|
||||
}
|
||||
};
|
||||
|
||||
Object.extend(dTree.prototype, MailerUIdTreeExtension);
|
||||
Reference in New Issue
Block a user