fix messages with large numbers of recipients.

--HG--
branch : gloda-facet
extra : rebase_source : 83bbc843b3c9c71bced59ecdcca2eac805d307ee
This commit is contained in:
David Ascher 2009-09-03 12:25:33 -07:00
Родитель 48764a668c
Коммит b0f2884e3d
4 изменённых файлов: 40 добавлений и 14 удалений

Просмотреть файл

@ -1093,20 +1093,19 @@
<binding id="result-message">
<content>
<html:div class="message-header">
<html:div class="message-meta">
<html:div anonid="oldestMessageDate" class="message-oldestMessageDate"></html:div>
</html:div>
<html:div class="message-line">
<html:div anonid="addresses-group" class="message-addresses-group">
<html:div anonid="author-group" class="message-author-group">
<html:span anonid="from" class="message-from-label"></html:span>
<html:span anonid="author" class="message-author"></html:span>
</html:div>
<html:div anonid="recipients-group" class="message-recipients-group">
<html:span anonid="to" class="message-to-label"></html:span>
<html:div anonid="recipients" class="message-recipients"/>
<html:div anonid="date" class="message-date"></html:div>
<html:div anonid="attachments" class="message-attachments"></html:div>
<html:div class="message-meta">
<html:div anonid="addresses-group" class="message-addresses-group">
<html:div anonid="author-group" class="message-author-group">
<html:span anonid="from" class="message-from-label"></html:span>
<html:span anonid="author" class="message-author"></html:span>
</html:div>
<html:div anonid="recipients-group" class="message-recipients-group">
<html:span anonid="to" class="message-to-label"></html:span>
<html:div anonid="recipients" class="message-recipients"/>
<html:div anonid="date" class="message-date"></html:div>
<html:div anonid="attachments" class="message-attachments"></html:div>
</html:div>
</html:div>
</html:div>
<html:div class="message-subject-group">
@ -1151,16 +1150,38 @@
anonElem("date").textContent = makeFriendlyDateAgo(message.date);
// - Recipients
try {
let recipientsNode = anonElem("recipients");
if (message.recipients) {
let recipientCount = 0;
const MAX_RECIPIENTS = 3;
let totalRecipientCount = message.recipients.length;
for each (let [, recip] in Iterator(message.recipients)) {
let recipNode = document.createElement("span");
recipNode.setAttribute("class", "message-recipient");
recipNode.textContent = recip.contact.name;
recipNode.setAttribute("title", "BARGH");
recipientsNode.appendChild(recipNode);
recipientCount++;
if (recipientCount == MAX_RECIPIENTS)
break;
}
if (totalRecipientCount > MAX_RECIPIENTS) {
let nOthers = totalRecipientCount - recipientCount;
let andNOthers = document.createElement("span");
andNOthers.setAttribute("class", "message-recipients-andothers");
let andOthersLabel= PluralForm.get(nOthers, glodaFacetStrings.get(
"glodaFacetView.results.message.andNOthers"))
.replace("#1", nOthers);
andNOthers.textContent = andOthersLabel;
recipientsNode.appendChild(andNOthers);
}
}
} catch (e) {
logException(e);
}
// - Starred
let starNode = anonElem("star");

Просмотреть файл

@ -485,6 +485,9 @@ h2 {
float: right;
padding-left: 2em;
text-align: right;
max-width: 20em;
max-height: 5em;
overflow: hidden;
color: #999;
font-size: 90%;
}
@ -508,7 +511,6 @@ h2 {
}
.message-addresses-group {
float: right;
text-align: right;
}

Просмотреть файл

@ -628,6 +628,7 @@ function summarizeThread(aSelectedMessages)
gSummary.init();
} catch (e) {
dump("Exception in summarizeThread" + e + "\n");
logException(e);
Components.utils.reportError(e);
throw(e);
}

Просмотреть файл

@ -145,3 +145,5 @@ glodaFacetView.results.message.sort.relevance=relevance
# LOCALIZATION NOTE(glodaFacetView.results.message.sort.date):
# a clickable label causing the sort to be done by most recent messages first.
glodaFacetView.results.message.sort.date=date
glodaFacetView.results.message.andNOthers=and #1 other;and #1 others