Bug 1590153 - Remove keywordrelated code from SM mail. r=frg

This commit is contained in:
Ian Neal 2019-10-30 19:04:41 +01:00
Родитель 3909e4d703
Коммит df54d003c6
3 изменённых файлов: 30 добавлений и 58 удалений

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

@ -30,9 +30,6 @@ var gAccountCentralLoaded = true;
var gOfflineManager;
// cache the last keywords
var gLastKeywords = "";
function OnMailWindowUnload()
{
RemoveMailOfflineObserver();
@ -627,46 +624,6 @@ function GetSearchSession()
return null;
}
function SetKeywords(aKeywords)
{
// we cache the last keywords.
// if there is no chagne, we do nothing.
// most of the time, this will be the case.
if (aKeywords == gLastKeywords)
return;
// these are the UI elements who care about keywords
var elements = document.getElementsByAttribute("keywordrelated","true");
var len = elements.length;
for (var i=0; i<len; i++) {
var element = elements[i];
var originalclass = element.getAttribute("originalclass");
// we use XBL for certain headers.
// if the element has keywordrelated="true"
// but no original class, it's an XBL widget
// so to get the real element, use getAnonymousElementByAttribute()
if (!originalclass) {
element = document.getAnonymousElementByAttribute(element, "keywordrelated", "true");
originalclass = element.getAttribute("originalclass");
}
if (aKeywords) {
if (element.getAttribute("appendoriginalclass") == "true") {
aKeywords += " " + originalclass;
}
element.setAttribute("class", aKeywords);
}
else {
// if no keywords, reset class to the original class
element.setAttribute("class", originalclass);
}
}
// cache the keywords
gLastKeywords = aKeywords;
}
function MailSetCharacterSet(aEvent)
{
if (aEvent.target.hasAttribute("charset")) {

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

@ -148,7 +148,6 @@ nsMsgDBViewCommandUpdater.prototype =
ClearPendingReadTimer(); // we are loading / selecting a new message so kill the mark as read timer for the currently viewed message
gCurrentMessageUri = gDBView.URIForFirstSelectedMessage;
UpdateStandAloneMessageCounts();
SetKeywords(aKeywords);
goUpdateCommand("button_delete");
goUpdateCommand("button_junk");
goUpdateCommand("button_goBack");

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

@ -129,9 +129,9 @@
oncommand="CopyWebsiteAddress(document.popupNode);"/>
</menupopup>
<hbox id="msgHeaderView" keywordrelated="true" originalclass="none" persist="state">
<hbox id="msgHeaderView" persist="state">
<grid id="collapsedHeaderView" class="header-part1" keywordrelated="true" originalclass="header-part1" flex="1" collapsed="true">
<grid id="collapsedHeaderView" class="header-part1" flex="1" collapsed="true">
<rows>
<row flex="1"/>
</rows>
@ -146,7 +146,9 @@
<column id="collapsedsubjectBox" collapsed="true" flex="1">
<hbox>
<label class="collapsedHeaderDisplayName" value="&subjectField.label;" control="collapsedsubjectValue"/>
<textbox id="collapsedsubjectValue" keywordrelated="true" class="collapsedHeaderValue plain" originalclass="collapsedHeaderValue plain" readonly="true" crop="right" appendoriginalclass="true" flex="1"/>
<textbox id="collapsedsubjectValue"
class="collapsedHeaderValue plain"
readonly="true" crop="right" flex="1"/>
</hbox>
</column>
@ -158,13 +160,15 @@
<column id = "collapseddateBox" collapsed="true">
<hbox align="start">
<textbox id="collapseddateValue" keywordrelated="true" class="collapsedHeaderValue plain" originalclass="collapsedHeaderValue plain" appendoriginalclass="true" readonly="true"/>
<textbox id="collapseddateValue"
class="collapsedHeaderValue plain"
readonly="true"/>
</hbox>
</column>
<column id="collapsedKeywordBox">
<hbox align="start">
<image id="collapsedKeywordImage" keywordrelated="true" originalclass="none"/>
<image id="collapsedKeywordImage"/>
</hbox>
</column>
@ -176,39 +180,51 @@
</columns>
</grid>
<hbox id="expandedHeaderView" class="header-part1" keywordrelated="true" originalclass="header-part1" flex="1" collapsed="true">
<hbox id="expandedHeaderView" class="header-part1" flex="1" collapsed="true">
<vbox id="expandedHeaders" flex="1">
<mail-toggle-headerfield keywordrelated="true" id="expandedsubjectBox" class="subjectvalue" label="&subjectField.label;" ontwistyclick="ToggleHeaderView();" collapsed="true"/>
<mail-toggle-headerfield id="expandedsubjectBox"
class="subjectvalue"
label="&subjectField.label;"
ontwistyclick="ToggleHeaderView();"
collapsed="true"/>
<mail-multi-emailHeaderField id="expandedfromBox" label="&fromField.label;" collapsed="true"/>
<mail-emailheaderfield id="expandedsenderBox" label="&senderField.label;" collapsed="true"/>
<mail-headerfield id="expandedorganizationBox" label="&organizationField.label;" collapsed="true"/>
<mail-multi-emailHeaderField id="expandedreply-toBox" label="&replyToField.label;" collapsed="true"/>
<mail-headerfield keywordrelated="true" id="expandeddateBox" label="&dateField.label;" collapsed="true"/>
<mail-headerfield id="expandeddateBox"
label="&dateField.label;"
collapsed="true"/>
<mail-multi-emailHeaderField id="expandedtoBox" label="&toField.label;" collapsed="true"/>
<mail-multi-emailHeaderField id="expandedccBox" label="&ccField.label;" collapsed="true"/>
<mail-multi-emailHeaderField id="expandedbccBox" label="&bccField.label;" collapsed="true"/>
<mail-headerfield keywordrelated="true" id="expandednewsgroupsBox" label="&newsgroupsField.label;" collapsed="true"/>
<mail-headerfield keywordrelated="true" id="expandedfollowup-toBox" label="&followupToField.label;" collapsed="true"/>
<mail-headerfield id="expandednewsgroupsBox"
label="&newsgroupsField.label;"
collapsed="true"/>
<mail-headerfield id="expandedfollowup-toBox"
label="&followupToField.label;"
collapsed="true"/>
<mail-messageids-headerfield id="expandedmessage-idBox" label="&messageIdField.label;" collapsed="true"/>
<mail-messageids-headerfield id="expandedin-reply-toBox" label="&inReplyToField.label;" collapsed="true"/>
<mail-messageids-headerfield id="expandedreferencesBox" label="&referencesField.label;" collapsed="true"/>
<mail-tagfield id="expandedtagsBox" label="&tagsHdr.label;" collapsed="true"/>
<mail-urlfield id="expandedcontent-baseBox" label="&originalWebsite.label;" collapsed="true"/>
<mail-headerfield keywordrelated="true" id="expandeduser-agentBox" label="&userAgentField.label;" collapsed="true"/>
<mail-headerfield id="expandeduser-agentBox"
label="&userAgentField.label;"
collapsed="true"/>
</vbox>
<vbox id="expandedKeywordBox">
<spacer flex="1"/>
<image id="expandedKeywordImage" keywordrelated="true" originalclass="none" />
<image id="expandedKeywordImage"/>
<spacer flex="1"/>
</vbox>
<vbox id="editMessageBox" class="header-part1" keywordrelated="true" originalclass="header-part1" collapsed="true">
<vbox id="editMessageBox" class="header-part1" collapsed="true">
<spacer flex="1"/>
<button id="editMessageButton"
label="&editMessage.label;"
@ -223,7 +239,7 @@
<spacer flex="1"/>
</vbox>
<vbox id="expandedAttachmentBox" class="header-part1" keywordrelated="true" originalclass="header-part1" collapsed="true">
<vbox id="expandedAttachmentBox" class="header-part1" collapsed="true">
<label id="attachmentText"
value="&attachmentsTree.label;"
accesskey="&attachmentsTree.accesskey;"