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.

138 lines
3.6 KiB

  1. // Functions for the Config page
  2. /*-------------------------------------------------------------------------
  3. Purpose: Called when the Config page is loaded
  4. */
  5. function Config_Activate(bExec)
  6. {
  7. // We need some utility functions
  8. LoadScriptFile("idScriptUtil", "util.js");
  9. // Should we show the post-setup list?
  10. if (bExec)
  11. {
  12. // No
  13. _RunOCMgr();
  14. return;
  15. }
  16. g_docAll.idTrHeadMargin_Config.style.display = 'block';
  17. g_docAll.idTrHeadComponents1_Config.style.display = 'block';
  18. g_docAll.idTrHeadComponents2_Config.style.display = 'block';
  19. g_docAll.idTrHeadServices_Config.style.display = 'block';
  20. g_docAll.idTrBody_Config.style.display = 'block';
  21. if (false == g_bConfigPageLoaded)
  22. {
  23. // Check policy restrictions to show the right sections. Use the visibility
  24. // style to maintain text flow.
  25. if (Dso_IsRestricted("NoComponents"))
  26. {
  27. g_docAll.idTrHeadComponents1_Config.style.visibility = 'hidden';
  28. g_docAll.idTrHeadComponents2_Config.style.visibility = 'hidden';
  29. }
  30. // Connect the config listbox to the datasource
  31. g_docAll.idConfigListbox.dataSource = "idCtlAppsDso.ocsetup";
  32. /* Fake version
  33. g_docAll.idConfigListbox.dataSource = "idCtlOcsetup";
  34. */
  35. // Set the initial focus on the listbox
  36. g_docAll.idConfigListbox.Refresh();
  37. g_docAll.idBtnNTOptions.onclick = _RunOCMgr;
  38. g_bConfigPageLoaded = true;
  39. }
  40. Config_SetFocus();
  41. }
  42. /*-------------------------------------------------------------------------
  43. Purpose: Set the initial focus
  44. */
  45. function Config_SetFocus()
  46. {
  47. g_docAll.idConfigListbox.focus();
  48. }
  49. /*-------------------------------------------------------------------------
  50. Purpose: Called when the Config page is switched away
  51. */
  52. function Config_Deactivate()
  53. {
  54. g_docAll.idTrHeadMargin_Config.style.display = 'none';
  55. g_docAll.idTrHeadComponents1_Config.style.display = 'none';
  56. g_docAll.idTrHeadComponents2_Config.style.display = 'none';
  57. g_docAll.idTrHeadServices_Config.style.display = 'none';
  58. g_docAll.idTrBody_Config.style.display = 'none';
  59. }
  60. /*-------------------------------------------------------------------------
  61. Purpose: Handler for the 'onSetFocus' listbox event.
  62. */
  63. function Config_OnSetFocus()
  64. {
  65. var evt = window.event;
  66. ApplyExtraStyles(evt.srcChild, evt.bFocus);
  67. }
  68. /*-------------------------------------------------------------------------
  69. Purpose: Handler for the 'onCustomDraw' listbox event. Fixup the element objects
  70. as appropriate.
  71. */
  72. function Config_OnCustomDraw()
  73. {
  74. var evt = window.event;
  75. var tblElem = evt.srcChild; // the contents of the row is another table
  76. if (evt.bSelected && 'postpaint' == evt.drawStage)
  77. {
  78. // Attach events and stuff now that the elements have been added
  79. // to the document tree.
  80. tblElem.all('idBtnConfig').onclick = _Configure;
  81. }
  82. }
  83. /*-------------------------------------------------------------------------
  84. Purpose: Run the Optional Components Manager
  85. */
  86. function _RunOCMgr()
  87. {
  88. g_docAll.idCtlAppsDso.Exec('ocsetup', 'ntoptions', 0);
  89. /* Fake version
  90. alert("Run OCManager");
  91. */
  92. }
  93. /*-------------------------------------------------------------------------
  94. Purpose: Configure the current component
  95. */
  96. function _Configure()
  97. {
  98. var rsCur = Dso_GetRecordset("ocsetup");
  99. g_docAll.idCtlAppsDso.Exec("ocsetup", "install", rsCur.AbsolutePosition);
  100. /* Fake version
  101. alert('Configure ' + rsCur("displayname"));
  102. */
  103. Dso_Refresh("ocsetup");
  104. }