sogo/UI/WebServerResources/MailerUI+dTree.js
Wolfgang Sourdeau 4e7ed2dab8 Monotone-Parent: c0e690042905295d3b7946d9d917fcf8e91982ef
Monotone-Revision: f8b29d68c36441f92d7ffe8056a95fd25a2fd409

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-10-17T22:29:51
Monotone-Branch: ca.inverse.sogo
2007-10-17 22:29:51 +00:00

37 lines
1.3 KiB
JavaScript

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;
this._addFolderNode(parent, folder.name, folder.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);