add the user agent header back in under a pref. set mailnews.headers.showUserAgent to true in your prefs

if you want to see the user agent string.
This commit is contained in:
mscott%netscape.com 2000-04-01 00:40:53 +00:00
Родитель 0111dba11b
Коммит cc9495c839
2 изменённых файлов: 59 добавлений и 23 удалений

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

@ -38,6 +38,7 @@ var abAddressCollectorProgID = "component://netscape/addressbook/services/addre
var msgPaneData;
var currentHeaderData;
var gNumAddressesToShow = 3;
var gShowUserAgent = false;
var msgHeaderParser = Components.classes[msgHeaderParserProgID].getService(Components.interfaces.nsIMsgHeaderParser);
var abAddressCollector = Components.classes[abAddressCollectorProgID].getService(Components.interfaces.nsIAbAddressCollecter);
@ -82,11 +83,16 @@ function OnLoadMsgHeaderPane()
msgPaneData.NewsgroupBox = document.getElementById("NewsgroupBox");
msgPaneData.NewsgroupValue = document.getElementById("NewsgroupValue");
msgPaneData.UserAgentBox = document.getElementById("UserAgentBox");
msgPaneData.UserAgentValue = document.getElementById("UserAgentValue");
}
// load any preferences that at are global with regards to
// displaying a message...
gNumAddressesToShow = pref.GetIntPref("mailnews.max_header_display_length");
gShowUserAgent = pref.GetBoolPref("mailnews.headers.showUserAgent");
}
// The messageHeaderSink is the class that gets notified of a message's headers as we display the message
@ -140,28 +146,32 @@ var messageHeaderSink = {
{
currentHeaderData.SubjectValue = headerValue;
}
if (headerName == "from")
else if (headerName == "from")
{
currentHeaderData.FromValue = headerValue;
if (headerValue && abAddressCollector)
abAddressCollector.collectUnicodeAddress(headerValue);
}
if (headerName == "date")
else if (headerName == "date")
{
currentHeaderData.DateValue = headerValue;
}
if (headerName == "to")
else if (headerName == "to")
{
currentHeaderData.ToValue = headerValue;
}
if (headerName == "cc")
else if (headerName == "cc")
{
currentHeaderData.CcValue = headerValue;
}
if (headerName == "newsgroups")
else if (headerName == "newsgroups")
{
currentHeaderData.NewsgroupsValue = headerValue;
}
else if (headerName == "user-agent")
{
currentHeaderData.UserAgentValue = headerValue;
}
},
handleAttachment: function(url, displayName, uri, notDownloaded)
@ -401,6 +411,9 @@ function UpdateMessageHeaders()
OutputEmailAddresses(msgPaneData.ToBox, msgPaneData.ToValueShort, currentHeaderData.ToValue, true, msgPaneData.ToValueLong, msgPaneData.ToValueToggleIcon );
OutputEmailAddresses(msgPaneData.CcBox, msgPaneData.CcValueShort, currentHeaderData.CcValue, true, msgPaneData.CcValueLong, msgPaneData.CcValueToggleIcon );
hdrViewSetNodeWithBox(msgPaneData.NewsgroupBox, msgPaneData.NewsgroupValue, currentHeaderData.NewsgroupsValue);
if (gShowUserAgent)
hdrViewSetNodeWithBox(msgPaneData.UserAgentBox, msgPaneData.UserAgentValue, currentHeaderData.UserAgentValue);
FinishEmailProcessing();
}
@ -412,6 +425,7 @@ function ClearCurrentHeaders()
currentHeaderData.ToValue = "";
currentHeaderData.CcValue = "";
currentHeaderData.NewsgroupsValue = "";
currentHeaderData.UserAgentValue = "";
}
function ShowMessageHeaderPane()
@ -422,6 +436,9 @@ function ShowMessageHeaderPane()
node = document.getElementById("headerPart2");
if (node)
node.removeAttribute("hide");
node = document.getElementById("headerPart3");
if (node)
node.removeAttribute("hide");
}
function HideMessageHeaderPane()
@ -432,6 +449,9 @@ function HideMessageHeaderPane()
node = document.getElementById("headerPart2");
if (node)
node.setAttribute("hide", "true");
node = document.getElementById("headerPart3");
if (node)
node.setAttribute("hide", "true");
}
// ToggleLongShortAddresses is used to toggle between showing

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

@ -85,33 +85,49 @@ Rights Reserved.
<toolbar id="headerPart2" hide="true">
<box class="header-part2" align="vertical" flex="1">
<box id="ToBox" class="headerBox" align="horizontal" hide="true">
<html:div class="headerdisplayname">&toField.label;</html:div>
<html:div class="headerValue" id="ToValueShort" flex="1">
<titledbutton class="showMoreAddressesButton" id="ToValueToggleIcon"
<text class="headerdisplayname" value="&toField.label;"/>
<html:div class="headervalue" id="ToValueShort" flex="1">
<titledbutton class="showMoreAddressesButton" id="ToValueToggleIcon"
onclick="ToggleLongShortAddresses('ToValueShort', 'ToValueLong');"/>
</html:div>
<html:div class="headerValue" id="ToValueLong" flex="1" hide="true">
<titledbutton class="showFewerAddressesButton"
onclick="ToggleLongShortAddresses('ToValueShort', 'ToValueLong');"/>
<html:div class="headervalue" id="ToValueLong" hide="true" flex="1">
<titledbutton class="showFewerAddressesButton"
onclick="ToggleLongShortAddresses('ToValueShort', 'ToValueLong');"/>
</html:div>
</box>
<box id="CcBox" class="headerBox" align="horizontal" hide="true">
<html:div class="headerdisplayname">&ccField.label;</html:div>
<html:div class="headerValue" id="CcValueShort" flex="1">
<titledbutton class="showMoreAddressesButton" id="CcValueToggleIcon"
onclick="ToggleLongShortAddresses('CcValueShort', 'CcValueLong');"/>
</html:div>
<html:div class="headerValue" id="CcValueLong" flex="1" hide="true">
<titledbutton class="showFewerAddressesButton"
onclick="ToggleLongShortAddresses('CcValueShort', 'CcValueLong');"/>
</html:div>
<text class="headerdisplayname" value="&ccField.label;"/>
<html:div class="headervalue" id="CcValueShort" flex="1">
<titledbutton class="showMoreAddressesButton" id="CcValueToggleIcon"
onclick="ToggleLongShortAddresses('CcValueShort', 'CcValueLong');"/>
</html:div>
<html:div class="headervalue" id="CcValueLong" hide="true" flex="1">
<titledbutton class="showFewerAddressesButton"
onclick="ToggleLongShortAddresses('CcValueShort', 'CcValueLong');"/>
</html:div>
</box>
<box id="NewsgroupBox" class="headerBox" align="horizontal" hide="true">
<html:div class="headerdisplayname">&newsgroupsField.label;</html:div>
<html:div class="headerValue" id="NewsgroupValue" flex="1">*</html:div>
</box>
<text class="headerdisplayname" value="&newsgroupsField.label;"/>
<html:div class="headervalue" id="NewsgroupValue"/>
</box>
</box>
</toolbar>
<toolbar id="headerPart3" hide="true">
<box class="header-part3" align="vertical" flex="1">
<box id="UserAgentBox" class="headerBox" align="horizontal" hide="true">
<text class="headerdisplayname" value="&userAgentField.label;"/>
<html:div class="headervalue" id="UserAgentValue" flex="1">*</html:div>
</box>
</box>
</toolbar>
</toolbox>
</overlay>