Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
5.8 KiB

  1. <HTML XMLNS:helpcenter>
  2. <HEAD>
  3. <!--
  4. Copyright (c) 2000 Microsoft Corporation
  5. -->
  6. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=windows-1252">
  7. <META HTTP-EQUIV=PICS-Label CONTENT='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l comment "RSACi North America Server" by "[email protected]" r (n 0 s 0 v 0 l 0))'>
  8. <TITLE>Headlines</TITLE>
  9. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  10. <LINK ID=Stylesheet_Ref2 href="hcp://system/css/shared.css" rel=STYLESHEET type=text/css>
  11. <LINK ID=Stylesheet_Ref1 href="hcp://system/css/Behaviors.css" rel=STYLESHEET type=text/css>
  12. <STYLE>
  13. .ColorLightGray
  14. {
  15. COLOR: #bfbfbf
  16. }
  17. </STYLE>
  18. </HEAD>
  19. <BODY class="sys-rhp-bgcolor">
  20. <DIV ID=idNews style="margin-top:24px; margin-left:16px; margin-right:16px;"></DIV>
  21. </BODY>
  22. <SCRIPT LANGUAGE="JavaScript" DEFER>
  23. // variables for localization
  24. var L_HeadlinesDESKTOP_Text = "Did you know?";
  25. var L_HeadlinesSERVER_Text = "News and information";
  26. var L_Updated_Text = "Updated: ";
  27. var L_Provider_Text = "Visit Content Provider's Web site";
  28. function PopulateNews()
  29. {
  30. var title; // output buffer
  31. // display the title according to the SKU
  32. title = "<DIV NOWRAP class='sys-font-heading2 sys-rhp-color-title'>" + (pchealth.UserSettings.IsDesktopVersion ? L_HeadlinesDESKTOP_Text : L_HeadlinesSERVER_Text) + "</DIV>";
  33. idNews.innerHTML = title;
  34. try
  35. {
  36. // get News
  37. var stream = pchealth.UserSettings.News;
  38. if (stream)
  39. {
  40. var dispstr; //output buffer
  41. var xmlNews = new ActiveXObject("MSXML.DOMDocument");
  42. // load the headlines as XML
  43. xmlNews.load(stream);
  44. //
  45. // Get the date
  46. //
  47. var Datestr = xmlNews.documentElement.getAttribute("DATE");
  48. var Dt = new Date( new Number( Datestr ) );
  49. dispstr = "<DIV class='sys-font-body sys-color-body' style='margin-bottom:2em'> " + L_Updated_Text;
  50. dispstr += Dt.toLocaleDateString() + "</DIV>";
  51. //
  52. // Get the list of Newsblocks to display
  53. //
  54. var lstBlocks = xmlNews.getElementsByTagName("NEWSBLOCK");
  55. lstBlocks.nextNode; //skip the first newsblock
  56. // form table
  57. dispstr += "<TABLE>";
  58. // horizontal line
  59. dispstr += "<HR class='ColorLightGray' style='height:1px;width:100%'>";
  60. while (Newsblock = lstBlocks.nextNode)
  61. {
  62. // form table row
  63. dispstr += "<TR><TD style='width:40%; padding:1em 14px 0.5em 0; vertical-align:top'>";
  64. //
  65. // Get the Newsblock attributes
  66. //
  67. var strProv = Newsblock.getAttribute("PROVIDER");
  68. var strLink = Newsblock.getAttribute("LINK");
  69. var strIcon = Newsblock.getAttribute("ICON");
  70. var strPosition = Newsblock.getAttribute("POSITION");
  71. // display the Icon
  72. if (strIcon != "")
  73. {
  74. switch (strPosition) {
  75. case "recommended":
  76. dispstr += "<TABLE><TR><TD>" +
  77. "<IMG SRC='" + strIcon + "' style='width:48px; height:48px;'></TD>";
  78. dispstr += "<TD style='padding:0 0 0 1.5em; vertical-align:top'>";
  79. dispstr += "<DIV class='sys-font-body-bold sys-color-body' style='margin-bottom:0.5em'>" + strProv + "</DIV>";
  80. if(strLink)
  81. {
  82. dispstr += "<A HREF='" + strLink + "'><DIV class='sys-font-body sys-link-normal'>" + L_Provider_Text + "</DIV></A>";
  83. }
  84. dispstr += "</TD></TR></TABLE>";
  85. break;
  86. case "horizontal":
  87. dispstr += "<IMG SRC='" + strIcon + "' style='width:200px; height:45px; margin-bottom:1.5em'>";
  88. dispstr += "<DIV class='sys-font-body-bold sys-color-body' style='margin-bottom:0.5em'>" + strProv + "</DIV>";
  89. if(strLink)
  90. {
  91. dispstr += "<A HREF='" + strLink + "'><DIV class='sys-font-body sys-link-normal'>" + L_Provider_Text + "</DIV></A>";
  92. }
  93. break;
  94. case "vertical":
  95. dispstr += "<TABLE><TR><TD>" +
  96. "<IMG SRC='" + strIcon + "' style='width:48px; height:96px;'></TD>";
  97. dispstr += "<TD style='padding:0 0 0 1.5em; vertical-align:top'>";
  98. dispstr += "<DIV class='sys-font-body-bold sys-color-body' style='margin-bottom:0.5em'>" + strProv + "</DIV>";
  99. if(strLink)
  100. {
  101. dispstr += "<A HREF='" + strLink + "'><DIV class='sys-font-body sys-link-normal'>" + L_Provider_Text + "</DIV></A>";
  102. }
  103. dispstr += "</TD></TR></TABLE>";
  104. break;
  105. default:
  106. dispstr += "<DIV class='sys-font-body-bold sys-color-body' style='margin-bottom:0.5em'>" + strProv + "</DIV>";
  107. if(strLink)
  108. {
  109. dispstr += "<A HREF='" + strLink + "'><DIV class='sys-font-body sys-link-normal'>" + L_Provider_Text + "</DIV></A>";
  110. }
  111. }
  112. }
  113. dispstr += "</TD><TD style='width:60%; padding:1em 0 0.5em 22px'>";
  114. //
  115. // Get the list of Headlines
  116. //
  117. var lstHeadlines = Newsblock.getElementsByTagName("HEADLINE");
  118. // display all the headlines
  119. while (Headline = lstHeadlines.nextNode)
  120. {
  121. var strTitle = Headline.getAttribute("TITLE");
  122. var strLink = Headline.getAttribute("LINK");
  123. var strDesc = Headline.getAttribute("DESCRIPTION");
  124. dispstr += "<A HREF='" + strLink + "'>";
  125. dispstr += "<DIV class='sys-font-body-bold sys-link-normal' style='margin-bottom:0.5em'>" + strTitle;
  126. 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>";
  127. dispstr += "<DIV class='sys-font-body sys-color-body' style='margin-bottom:1em'>" + strDesc + "</DIV>";
  128. }
  129. dispstr += "</TD></TR>";
  130. // horizontal rule
  131. dispstr += "<TR><TD COLSPAN=2><HR class='ColorLightGray' style='height:1px;width:100%'></TD></TR>";
  132. }
  133. dispstr += "</TABLE>";
  134. // display the headlines
  135. idNews.innerHTML = title + dispstr;
  136. }
  137. }
  138. catch (e) {
  139. if ( e.number == -2147024726)
  140. window.setTimeout("PopulateNews()", 500);
  141. //else
  142. // end if we get other error
  143. }
  144. }
  145. PopulateNews();
  146. </SCRIPT>
  147. </HTML>