Bug 1590153 - Remove keywordrelated code from SM mail. r=frg
This commit is contained in:
Родитель
3909e4d703
Коммит
df54d003c6
|
@ -30,9 +30,6 @@ var gAccountCentralLoaded = true;
|
||||||
|
|
||||||
var gOfflineManager;
|
var gOfflineManager;
|
||||||
|
|
||||||
// cache the last keywords
|
|
||||||
var gLastKeywords = "";
|
|
||||||
|
|
||||||
function OnMailWindowUnload()
|
function OnMailWindowUnload()
|
||||||
{
|
{
|
||||||
RemoveMailOfflineObserver();
|
RemoveMailOfflineObserver();
|
||||||
|
@ -627,46 +624,6 @@ function GetSearchSession()
|
||||||
return null;
|
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)
|
function MailSetCharacterSet(aEvent)
|
||||||
{
|
{
|
||||||
if (aEvent.target.hasAttribute("charset")) {
|
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
|
ClearPendingReadTimer(); // we are loading / selecting a new message so kill the mark as read timer for the currently viewed message
|
||||||
gCurrentMessageUri = gDBView.URIForFirstSelectedMessage;
|
gCurrentMessageUri = gDBView.URIForFirstSelectedMessage;
|
||||||
UpdateStandAloneMessageCounts();
|
UpdateStandAloneMessageCounts();
|
||||||
SetKeywords(aKeywords);
|
|
||||||
goUpdateCommand("button_delete");
|
goUpdateCommand("button_delete");
|
||||||
goUpdateCommand("button_junk");
|
goUpdateCommand("button_junk");
|
||||||
goUpdateCommand("button_goBack");
|
goUpdateCommand("button_goBack");
|
||||||
|
|
|
@ -129,9 +129,9 @@
|
||||||
oncommand="CopyWebsiteAddress(document.popupNode);"/>
|
oncommand="CopyWebsiteAddress(document.popupNode);"/>
|
||||||
</menupopup>
|
</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>
|
<rows>
|
||||||
<row flex="1"/>
|
<row flex="1"/>
|
||||||
</rows>
|
</rows>
|
||||||
|
@ -146,7 +146,9 @@
|
||||||
<column id="collapsedsubjectBox" collapsed="true" flex="1">
|
<column id="collapsedsubjectBox" collapsed="true" flex="1">
|
||||||
<hbox>
|
<hbox>
|
||||||
<label class="collapsedHeaderDisplayName" value="&subjectField.label;" control="collapsedsubjectValue"/>
|
<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>
|
</hbox>
|
||||||
</column>
|
</column>
|
||||||
|
|
||||||
|
@ -158,13 +160,15 @@
|
||||||
|
|
||||||
<column id = "collapseddateBox" collapsed="true">
|
<column id = "collapseddateBox" collapsed="true">
|
||||||
<hbox align="start">
|
<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>
|
</hbox>
|
||||||
</column>
|
</column>
|
||||||
|
|
||||||
<column id="collapsedKeywordBox">
|
<column id="collapsedKeywordBox">
|
||||||
<hbox align="start">
|
<hbox align="start">
|
||||||
<image id="collapsedKeywordImage" keywordrelated="true" originalclass="none"/>
|
<image id="collapsedKeywordImage"/>
|
||||||
</hbox>
|
</hbox>
|
||||||
</column>
|
</column>
|
||||||
|
|
||||||
|
@ -176,39 +180,51 @@
|
||||||
</columns>
|
</columns>
|
||||||
</grid>
|
</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">
|
<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-multi-emailHeaderField id="expandedfromBox" label="&fromField.label;" collapsed="true"/>
|
||||||
<mail-emailheaderfield id="expandedsenderBox" label="&senderField.label;" collapsed="true"/>
|
<mail-emailheaderfield id="expandedsenderBox" label="&senderField.label;" collapsed="true"/>
|
||||||
<mail-headerfield id="expandedorganizationBox" label="&organizationField.label;" collapsed="true"/>
|
<mail-headerfield id="expandedorganizationBox" label="&organizationField.label;" collapsed="true"/>
|
||||||
<mail-multi-emailHeaderField id="expandedreply-toBox" label="&replyToField.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="expandedtoBox" label="&toField.label;" collapsed="true"/>
|
||||||
<mail-multi-emailHeaderField id="expandedccBox" label="&ccField.label;" collapsed="true"/>
|
<mail-multi-emailHeaderField id="expandedccBox" label="&ccField.label;" collapsed="true"/>
|
||||||
<mail-multi-emailHeaderField id="expandedbccBox" label="&bccField.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 id="expandednewsgroupsBox"
|
||||||
<mail-headerfield keywordrelated="true" id="expandedfollowup-toBox" label="&followupToField.label;" collapsed="true"/>
|
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="expandedmessage-idBox" label="&messageIdField.label;" collapsed="true"/>
|
||||||
<mail-messageids-headerfield id="expandedin-reply-toBox" label="&inReplyToField.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-messageids-headerfield id="expandedreferencesBox" label="&referencesField.label;" collapsed="true"/>
|
||||||
<mail-tagfield id="expandedtagsBox" label="&tagsHdr.label;" collapsed="true"/>
|
<mail-tagfield id="expandedtagsBox" label="&tagsHdr.label;" collapsed="true"/>
|
||||||
<mail-urlfield id="expandedcontent-baseBox" label="&originalWebsite.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>
|
||||||
|
|
||||||
<vbox id="expandedKeywordBox">
|
<vbox id="expandedKeywordBox">
|
||||||
<spacer flex="1"/>
|
<spacer flex="1"/>
|
||||||
<image id="expandedKeywordImage" keywordrelated="true" originalclass="none" />
|
<image id="expandedKeywordImage"/>
|
||||||
<spacer flex="1"/>
|
<spacer flex="1"/>
|
||||||
</vbox>
|
</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"/>
|
<spacer flex="1"/>
|
||||||
<button id="editMessageButton"
|
<button id="editMessageButton"
|
||||||
label="&editMessage.label;"
|
label="&editMessage.label;"
|
||||||
|
@ -223,7 +239,7 @@
|
||||||
<spacer flex="1"/>
|
<spacer flex="1"/>
|
||||||
</vbox>
|
</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"
|
<label id="attachmentText"
|
||||||
value="&attachmentsTree.label;"
|
value="&attachmentsTree.label;"
|
||||||
accesskey="&attachmentsTree.accesskey;"
|
accesskey="&attachmentsTree.accesskey;"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче