Leaked source code of windows server 2003
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.

139 lines
4.8 KiB

  1. //
  2. // Copyright (c) 2000 Microsoft Corporation
  3. //
  4. // variables for localization
  5. var L_Updating_Text = "Updating...";
  6. var L_Updated_Text = "Updated: %DATE%";
  7. var L_MoreNews_Text = "View more headlines";
  8. //Center-specific loc strings for Connection.js.
  9. var L_TopicIntroWU_Text = "Get the latest updates for your computer's operating system, software, and hardware. Windows Update scans your computer and provides you with a selection of updates tailored just for you.";
  10. var L_TopicTitleWU_Text = "Windows Update";
  11. var L_TopicIntroCompat_Text = "Research which hardware and software works best with the Windows Server 2003 family and related Windows products.";
  12. var L_TopicTitleCompat_Text = "Compatible Hardware and Software";
  13. var L_TopicTitleErrMsg_Text = "Error and Event Log Messages";
  14. var REG_HEADLINES_POLICY_KEY = "HKCU\\Software\\Policies\\Microsoft\\PCHealth\\HelpSvc\\Headlines";
  15. function PopulateNews()
  16. {
  17. var fDisplayHeadlines = true;
  18. try
  19. {
  20. var dwRegVal = pchealth.RegRead( REG_HEADLINES_POLICY_KEY );
  21. // If dwRegVal is 1 then the policy has been enabled - in this case do not display the news
  22. if(dwRegVal == 1) fDisplayHeadlines = false;
  23. }
  24. catch(e)
  25. {
  26. }
  27. // check if the Headlines are enabled
  28. try
  29. {
  30. if(fDisplayHeadlines && pchealth.UserSettings.AreHeadlinesEnabled)
  31. {
  32. idNews.style.display = "";
  33. idNews_Status.innerText = L_Updating_Text;
  34. try
  35. {
  36. // get News
  37. var stream = pchealth.UserSettings.News;
  38. if(stream)
  39. {
  40. var g_NavBar = pchealth.UI_NavBar.content.parentWindow;
  41. var dispstr = ""; // output buffer
  42. var xmlNews = new ActiveXObject( "MSXML.DOMDocument" );
  43. // load the headlines as XML
  44. xmlNews.load( stream );
  45. //
  46. // Get the date
  47. //
  48. var Datestr = xmlNews.documentElement.getAttribute( "DATE" );
  49. var Dt = new Date( new Number( Datestr ) );
  50. {
  51. var text = L_Updated_Text;
  52. text = text.replace( /%DATE%/g, Dt.toLocaleDateString() );
  53. idNews_Status.innerText = text;
  54. }
  55. //
  56. // Get the first newsblock to display
  57. //
  58. var lstBlocks = xmlNews.getElementsByTagName("NEWSBLOCK");
  59. var lstHeadlines = lstBlocks(0).getElementsByTagName("HEADLINE");
  60. // display all the Headlines
  61. dispstr += "<TABLE border=0 cellPadding=0 cellSpacing=0>";
  62. while (Headline = lstHeadlines.nextNode)
  63. {
  64. var strTitle = pchealth.TextHelpers.HTMLEscape( Headline.getAttribute("TITLE") );
  65. var strLink = g_NavBar.SanitizeLink( Headline.getAttribute("LINK") );
  66. dispstr += "<TR style='padding-top : .5em' class='sys-font-body'><TD VALIGN=top><LI></TD><TD><A class='sys-link-homepage sys-font-body' HREF='" + strLink + "'>" + strTitle + "</A></TD></TR>";
  67. }
  68. dispstr += "</TABLE>";
  69. // last bullet with link to headlines.htm
  70. if(lstBlocks.length > 1)
  71. {
  72. dispstr += "<DIV id=idViewMore style='margin-top: 15px'><A class='sys-link-homepage sys-font-body' HREF='hcp://system/Headlines.htm'>" + L_MoreNews_Text + "</A></DIV>";
  73. }
  74. //display the headlines
  75. idNews_Body.innerHTML = dispstr;
  76. }
  77. else
  78. {
  79. idNews_Status.innerText = "";
  80. idNews_Error.style.display = "";
  81. }
  82. }
  83. catch (e)
  84. {
  85. if(e.number == -2147024726)
  86. {
  87. window.setTimeout("PopulateNews()", 500);
  88. }
  89. }
  90. }
  91. }
  92. catch (e)
  93. {
  94. if(e.number == -2147024726)
  95. {
  96. window.setTimeout( "PopulateNews()", 500 );
  97. }
  98. }
  99. }
  100. function OpenConnWizard()
  101. {
  102. try
  103. {
  104. var oShell = new ActiveXObject( "WScript.Shell" );
  105. var sShellCmd_NCW = "rundll32 netshell.dll,StartNCW 0";
  106. oShell.Run( sShellCmd_NCW );
  107. }
  108. catch( e ){ }
  109. }
  110. function SafeCenterConnect( linkid, center, title, intro )
  111. {
  112. var sURL = "http://go.microsoft.com/fwlink/?LinkId=" + linkid + "&mode=" + center + "&lcid=" + pchealth.UserSettings.CurrentSKU.Language;
  113. pchealth.Connectivity.NavigateOnline( sURL, title, intro );
  114. }