fix messages with large numbers of recipients.
--HG-- branch : gloda-facet extra : rebase_source : 83bbc843b3c9c71bced59ecdcca2eac805d307ee
This commit is contained in:
Родитель
48764a668c
Коммит
b0f2884e3d
|
@ -1093,10 +1093,8 @@
|
||||||
<binding id="result-message">
|
<binding id="result-message">
|
||||||
<content>
|
<content>
|
||||||
<html:div class="message-header">
|
<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 class="message-line">
|
||||||
|
<html:div class="message-meta">
|
||||||
<html:div anonid="addresses-group" class="message-addresses-group">
|
<html:div anonid="addresses-group" class="message-addresses-group">
|
||||||
<html:div anonid="author-group" class="message-author-group">
|
<html:div anonid="author-group" class="message-author-group">
|
||||||
<html:span anonid="from" class="message-from-label"></html:span>
|
<html:span anonid="from" class="message-from-label"></html:span>
|
||||||
|
@ -1109,6 +1107,7 @@
|
||||||
<html:div anonid="attachments" class="message-attachments"></html:div>
|
<html:div anonid="attachments" class="message-attachments"></html:div>
|
||||||
</html:div>
|
</html:div>
|
||||||
</html:div>
|
</html:div>
|
||||||
|
</html:div>
|
||||||
<html:div class="message-subject-group">
|
<html:div class="message-subject-group">
|
||||||
<html:span anonid="star" class="message-star"></html:span>
|
<html:span anonid="star" class="message-star"></html:span>
|
||||||
<html:span anonid="subject" class="message-subject"></html:span>
|
<html:span anonid="subject" class="message-subject"></html:span>
|
||||||
|
@ -1151,15 +1150,37 @@
|
||||||
anonElem("date").textContent = makeFriendlyDateAgo(message.date);
|
anonElem("date").textContent = makeFriendlyDateAgo(message.date);
|
||||||
|
|
||||||
// - Recipients
|
// - Recipients
|
||||||
|
try {
|
||||||
let recipientsNode = anonElem("recipients");
|
let recipientsNode = anonElem("recipients");
|
||||||
if (message.recipients) {
|
if (message.recipients) {
|
||||||
|
let recipientCount = 0;
|
||||||
|
const MAX_RECIPIENTS = 3;
|
||||||
|
let totalRecipientCount = message.recipients.length;
|
||||||
for each (let [, recip] in Iterator(message.recipients)) {
|
for each (let [, recip] in Iterator(message.recipients)) {
|
||||||
let recipNode = document.createElement("span");
|
let recipNode = document.createElement("span");
|
||||||
recipNode.setAttribute("class", "message-recipient");
|
recipNode.setAttribute("class", "message-recipient");
|
||||||
recipNode.textContent = recip.contact.name;
|
recipNode.textContent = recip.contact.name;
|
||||||
recipNode.setAttribute("title", "BARGH");
|
recipNode.setAttribute("title", "BARGH");
|
||||||
recipientsNode.appendChild(recipNode);
|
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
|
// - Starred
|
||||||
|
|
|
@ -485,6 +485,9 @@ h2 {
|
||||||
float: right;
|
float: right;
|
||||||
padding-left: 2em;
|
padding-left: 2em;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
max-width: 20em;
|
||||||
|
max-height: 5em;
|
||||||
|
overflow: hidden;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
}
|
}
|
||||||
|
@ -508,7 +511,6 @@ h2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-addresses-group {
|
.message-addresses-group {
|
||||||
float: right;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -628,6 +628,7 @@ function summarizeThread(aSelectedMessages)
|
||||||
gSummary.init();
|
gSummary.init();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
dump("Exception in summarizeThread" + e + "\n");
|
dump("Exception in summarizeThread" + e + "\n");
|
||||||
|
logException(e);
|
||||||
Components.utils.reportError(e);
|
Components.utils.reportError(e);
|
||||||
throw(e);
|
throw(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,3 +145,5 @@ glodaFacetView.results.message.sort.relevance=relevance
|
||||||
# LOCALIZATION NOTE(glodaFacetView.results.message.sort.date):
|
# LOCALIZATION NOTE(glodaFacetView.results.message.sort.date):
|
||||||
# a clickable label causing the sort to be done by most recent messages first.
|
# a clickable label causing the sort to be done by most recent messages first.
|
||||||
glodaFacetView.results.message.sort.date=date
|
glodaFacetView.results.message.sort.date=date
|
||||||
|
|
||||||
|
glodaFacetView.results.message.andNOthers=and #1 other;and #1 others
|
Загрузка…
Ссылка в новой задаче