mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-31 03:07:17 +00:00
Monotone-Parent: b485f305175502819e660d9557bad5fa6d20222f
Monotone-Revision: a5370a41693bc2294eb25921c8e19dda7570a063 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-07-11T05:05:03 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -461,6 +461,10 @@ function openMailbox(mailbox, reload, idx) {
|
||||
document.messageListAjaxRequest
|
||||
= triggerAjaxRequest(url, messageListCallback,
|
||||
currentMessages[mailbox]);
|
||||
|
||||
var quotasUrl = ApplicationBaseURL + mailbox + "/quotas";
|
||||
document.quotasAjaxRequest
|
||||
= triggerAjaxRequest(quotasUrl, quotasCallback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,6 +513,30 @@ function messageListCallback(http) {
|
||||
log("messageListCallback: problem during ajax request (readyState = " + http.readyState + ", status = " + http.status + ")");
|
||||
}
|
||||
|
||||
function quotasCallback(http) {
|
||||
if (http.readyState == 4
|
||||
&& http.status == 200) {
|
||||
var hasQuotas = false;
|
||||
|
||||
var quotas = http.responseText.evalJSON(true);
|
||||
for (var i in quotas) {
|
||||
hasQuotas = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (hasQuotas) {
|
||||
var treePath = currentMailbox.split("/");
|
||||
var mbQuotas = quotas["/" + treePath[2]];
|
||||
var used = mbQuotas["usedSpace"];
|
||||
var max = mbQuotas["maxQuota"];
|
||||
var percents = (Math.round(used * 10000 / max) / 100);
|
||||
var format = labels["quotasFormat"].decodeEntities();
|
||||
var text = format.formatted(used, max, percents);
|
||||
window.status = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onMessageContextMenu(event) {
|
||||
var menu = $('messageListMenu');
|
||||
Event.observe(menu, "hideMenu", onMessageContextMenuHide);
|
||||
@@ -815,18 +843,6 @@ function onMenuViewMessageSource(event) {
|
||||
function newContactFromEmail(event) {
|
||||
var mailto = document.menuTarget.innerHTML;
|
||||
|
||||
// var emailre
|
||||
// = /([a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])/g;
|
||||
// emailre.exec(mailto);
|
||||
// email = RegExp.$1;
|
||||
|
||||
// var namere = /(\w[\w\ _-]+)\ (<|<)/;
|
||||
// var c_name = '';
|
||||
// if (namere.test(mailto)) {
|
||||
// namere.exec(mailto);
|
||||
// c_name += RegExp.$1;
|
||||
// }
|
||||
|
||||
var email = extractEmailAddress(mailto);
|
||||
var c_name = extractEmailName(mailto);
|
||||
if (email.length > 0)
|
||||
@@ -841,7 +857,7 @@ function newContactFromEmail(event) {
|
||||
}
|
||||
|
||||
return false; /* stop following the link */
|
||||
}
|
||||
}
|
||||
|
||||
function newEmailTo(sender) {
|
||||
return openMailTo(document.menuTarget.innerHTML);
|
||||
|
||||
Reference in New Issue
Block a user