Monotone-Parent: c465e35fc5f42324c08780dae83f7d225dca6e6a
Monotone-Revision: b3afbde30d88c6ea366307b2bb45202fe90bd36f

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-09-26T21:08:26
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-09-26 21:08:26 +00:00
parent 9edd16c0f4
commit 133259425a
19 changed files with 70 additions and 45 deletions
+5 -15
View File
@@ -1373,39 +1373,29 @@ function updateMailboxTreeInPage() {
}
}
if (Mailer.quotas) {
// Build quota indicator
// Build quota indicator, show values in MB
var percents = (Math.round(Mailer.quotas.usedSpace * 10000 / Mailer.quotas.maxQuota) / 100);
var level = (percents > 85)? "alert" : (percents > 70)? "warn" : "ok";
var format = labels["quotasFormat"];
var text = format.formatted(Mailer.quotas.usedSpace, Mailer.quotas.maxQuota, percents);
var text = format.formatted(percents,
Math.round(Mailer.quotas.maxQuota/10.24)/100);
var quotaDiv = new Element('div', { 'class': 'quota', 'info': text });
var levelDiv = new Element('div', { 'class': 'level' });
var valueDiv = new Element('div', { 'class': 'value ' + level, 'style': 'width: ' + ((percents > 100)?100:percents) + '%' });
var marksDiv = new Element('div', { 'class': 'marks' });
var textP = new Element('p').update(text);
marksDiv.appendChild(new Element('div'));
marksDiv.appendChild(new Element('div'));
marksDiv.appendChild(new Element('div'));
levelDiv.appendChild(valueDiv);
levelDiv.appendChild(marksDiv);
levelDiv.appendChild(textP);
quotaDiv.appendChild(levelDiv);
treeContent.insertBefore(quotaDiv, tree);
quotaDiv.observe("mouseover", onViewQuota);
quotaDiv.observe("mouseout", function(event) { $("quotaDialog").hide(); });
}
}
function onViewQuota(event) {
var div = $("quotaDialog");
if (div.visible()) return;
var position = this.cumulativeOffset();
position[0] += this.getWidth();
div.down("p").update(this.readAttribute("info"));
div.setStyle({ left: position[0] + "px",
top: position[1] + "px" });
div.show();
}
function mailboxMenuNode(type, name) {
var newNode = document.createElement("li");
var icon = MailerUIdTreeExtension.folderIcons[type];