windows-nt/Source/XPSP1/NT/admin/pchealth/helpctr/content/systempages/headlines.htm
2020-09-26 16:20:57 +08:00

184 lines
5.8 KiB
HTML

<HTML XMLNS:helpcenter>
<HEAD>
<!--
Copyright (c) 2000 Microsoft Corporation
-->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=windows-1252">
<META HTTP-EQUIV=PICS-Label CONTENT='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l comment "RSACi North America Server" by "inet@microsoft.com" r (n 0 s 0 v 0 l 0))'>
<TITLE>Headlines</TITLE>
<OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
<LINK ID=Stylesheet_Ref2 href="hcp://system/css/shared.css" rel=STYLESHEET type=text/css>
<LINK ID=Stylesheet_Ref1 href="hcp://system/css/Behaviors.css" rel=STYLESHEET type=text/css>
<STYLE>
.ColorLightGray
{
COLOR: #bfbfbf
}
</STYLE>
</HEAD>
<BODY class="sys-rhp-bgcolor">
<DIV ID=idNews style="margin-top:24px; margin-left:16px; margin-right:16px;"></DIV>
</BODY>
<SCRIPT LANGUAGE="JavaScript" DEFER>
// variables for localization
var L_HeadlinesDESKTOP_Text = "Did you know?";
var L_HeadlinesSERVER_Text = "News and information";
var L_Updated_Text = "Updated: ";
var L_Provider_Text = "Visit Content Provider's Web site";
function PopulateNews()
{
var title; // output buffer
// display the title according to the SKU
title = "<DIV NOWRAP class='sys-font-heading2 sys-rhp-color-title'>" + (pchealth.UserSettings.IsDesktopVersion ? L_HeadlinesDESKTOP_Text : L_HeadlinesSERVER_Text) + "</DIV>";
idNews.innerHTML = title;
try
{
// get News
var stream = pchealth.UserSettings.News;
if (stream)
{
var dispstr; //output buffer
var xmlNews = new ActiveXObject("MSXML.DOMDocument");
// load the headlines as XML
xmlNews.load(stream);
//
// Get the date
//
var Datestr = xmlNews.documentElement.getAttribute("DATE");
var Dt = new Date( new Number( Datestr ) );
dispstr = "<DIV class='sys-font-body sys-color-body' style='margin-bottom:2em'> " + L_Updated_Text;
dispstr += Dt.toLocaleDateString() + "</DIV>";
//
// Get the list of Newsblocks to display
//
var lstBlocks = xmlNews.getElementsByTagName("NEWSBLOCK");
lstBlocks.nextNode; //skip the first newsblock
// form table
dispstr += "<TABLE>";
// horizontal line
dispstr += "<HR class='ColorLightGray' style='height:1px;width:100%'>";
while (Newsblock = lstBlocks.nextNode)
{
// form table row
dispstr += "<TR><TD style='width:40%; padding:1em 14px 0.5em 0; vertical-align:top'>";
//
// Get the Newsblock attributes
//
var strProv = Newsblock.getAttribute("PROVIDER");
var strLink = Newsblock.getAttribute("LINK");
var strIcon = Newsblock.getAttribute("ICON");
var strPosition = Newsblock.getAttribute("POSITION");
// display the Icon
if (strIcon != "")
{
switch (strPosition) {
case "recommended":
dispstr += "<TABLE><TR><TD>" +
"<IMG SRC='" + strIcon + "' style='width:48px; height:48px;'></TD>";
dispstr += "<TD style='padding:0 0 0 1.5em; vertical-align:top'>";
dispstr += "<DIV class='sys-font-body-bold sys-color-body' style='margin-bottom:0.5em'>" + strProv + "</DIV>";
if(strLink)
{
dispstr += "<A HREF='" + strLink + "'><DIV class='sys-font-body sys-link-normal'>" + L_Provider_Text + "</DIV></A>";
}
dispstr += "</TD></TR></TABLE>";
break;
case "horizontal":
dispstr += "<IMG SRC='" + strIcon + "' style='width:200px; height:45px; margin-bottom:1.5em'>";
dispstr += "<DIV class='sys-font-body-bold sys-color-body' style='margin-bottom:0.5em'>" + strProv + "</DIV>";
if(strLink)
{
dispstr += "<A HREF='" + strLink + "'><DIV class='sys-font-body sys-link-normal'>" + L_Provider_Text + "</DIV></A>";
}
break;
case "vertical":
dispstr += "<TABLE><TR><TD>" +
"<IMG SRC='" + strIcon + "' style='width:48px; height:96px;'></TD>";
dispstr += "<TD style='padding:0 0 0 1.5em; vertical-align:top'>";
dispstr += "<DIV class='sys-font-body-bold sys-color-body' style='margin-bottom:0.5em'>" + strProv + "</DIV>";
if(strLink)
{
dispstr += "<A HREF='" + strLink + "'><DIV class='sys-font-body sys-link-normal'>" + L_Provider_Text + "</DIV></A>";
}
dispstr += "</TD></TR></TABLE>";
break;
default:
dispstr += "<DIV class='sys-font-body-bold sys-color-body' style='margin-bottom:0.5em'>" + strProv + "</DIV>";
if(strLink)
{
dispstr += "<A HREF='" + strLink + "'><DIV class='sys-font-body sys-link-normal'>" + L_Provider_Text + "</DIV></A>";
}
}
}
dispstr += "</TD><TD style='width:60%; padding:1em 0 0.5em 22px'>";
//
// Get the list of Headlines
//
var lstHeadlines = Newsblock.getElementsByTagName("HEADLINE");
// display all the headlines
while (Headline = lstHeadlines.nextNode)
{
var strTitle = Headline.getAttribute("TITLE");
var strLink = Headline.getAttribute("LINK");
var strDesc = Headline.getAttribute("DESCRIPTION");
dispstr += "<A HREF='" + strLink + "'>";
dispstr += "<DIV class='sys-font-body-bold sys-link-normal' style='margin-bottom:0.5em'>" + strTitle;
dispstr += "<helpcenter:bitmap style='margin-left: 1em; position: relative; top: 1px; width: 12px; height: 12px' SRCNORMAL='hcp://system/images/icon_newwindow_12x.bmp'></helpcenter:bitmap></DIV></A>";
dispstr += "<DIV class='sys-font-body sys-color-body' style='margin-bottom:1em'>" + strDesc + "</DIV>";
}
dispstr += "</TD></TR>";
// horizontal rule
dispstr += "<TR><TD COLSPAN=2><HR class='ColorLightGray' style='height:1px;width:100%'></TD></TR>";
}
dispstr += "</TABLE>";
// display the headlines
idNews.innerHTML = title + dispstr;
}
}
catch (e) {
if ( e.number == -2147024726)
window.setTimeout("PopulateNews()", 500);
//else
// end if we get other error
}
}
PopulateNews();
</SCRIPT>
</HTML>