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.

308 lines
5.0 KiB

  1. /*
  2. ******************************************************************
  3. Copyright (c) 2001 Microsoft Corporation
  4. Module Name:
  5. System Restore
  6. File:
  7. RestoreUI.js
  8. Abstract:
  9. Common JavaScript code
  10. ******************************************************************
  11. */
  12. var nLowResScreenHeight = 540 ;
  13. var bToggleDisplay = true;
  14. //
  15. // Load a link for learn more about system restore
  16. //
  17. function OnLink_About()
  18. {
  19. OnLink("app_system_restore_welcome.htm");
  20. }
  21. function OnLink_Choose()
  22. {
  23. OnLink("app_system_restore_select.htm");
  24. }
  25. function OnLink_Confirm(IsUndo)
  26. {
  27. if (IsUndo) {
  28. OnLink("app_system_restore_confirm_undo.htm");
  29. } else {
  30. OnLink("app_system_restore_confirm_select.htm");
  31. }
  32. }
  33. function OnLink_Success(IsUndo)
  34. {
  35. if (IsUndo) {
  36. OnLink("app_system_restore_undo_complete.htm");
  37. } else {
  38. OnLink("app_system_restore_complete.htm");
  39. }
  40. }
  41. function OnLink_Failure()
  42. {
  43. OnLink("app_system_restore_unsuccessful2.htm");
  44. }
  45. function OnLink_Interrupt()
  46. {
  47. OnLink("app_system_restore_unsuccessful3.htm");
  48. }
  49. function OnLink_CreateRP()
  50. {
  51. OnLink("app_system_restore_createRP.htm");
  52. }
  53. function OnLink_CreatedRP()
  54. {
  55. OnLink("app_system_restore_created.htm");
  56. }
  57. function OnLink_Renamed()
  58. {
  59. OnLink("app_system_restore_renamedFolder.htm");
  60. }
  61. //
  62. // Load a link for help in the help center
  63. //
  64. function OnLink(link_name)
  65. {
  66. var strURL;
  67. var fso = new ActiveXObject("Scripting.FileSystemObject");
  68. var shell = new ActiveXObject( "Wscript.Shell" );
  69. strURL = "hcp://services/layout/contentonly?topic=ms-its:" + fso.GetSpecialFolder(0) + "\\help\\SR_ui.chm::/" + link_name ;
  70. // strURL = "hcp://system/taxonomy.htm?path=Troubleshooting/Using_System_Restore_to_undo_changes_made_to_your_computer&topic=" + escape("ms-its:" + fso.GetSpecialFolder(0) + "\\help\\windows.chm::/" + link_name) ;
  71. shell.Run(strURL);
  72. }
  73. //
  74. // Used by CSS to set background based on screen size
  75. //
  76. function fnSetBodyBackgroundColor()
  77. {
  78. if ( screen.height <= nLowResScreenHeight )
  79. {
  80. return "#aabfaa";
  81. }
  82. else
  83. {
  84. return "#8c9c94";
  85. }
  86. }
  87. //
  88. // Used by CSS to set display of help column for low res
  89. //
  90. function fnSetHighResDisplayStyle()
  91. {
  92. if ( screen.height <= nLowResScreenHeight )
  93. {
  94. return "none";
  95. }
  96. else
  97. {
  98. return "";
  99. }
  100. }
  101. //
  102. // Used by CSS to set display of help column for low res
  103. //
  104. function fnSetLowResDisplayStyle()
  105. {
  106. if ( screen.height <= nLowResScreenHeight )
  107. {
  108. return "";
  109. }
  110. else
  111. {
  112. return "none";
  113. }
  114. }
  115. //
  116. // Used by CSS to set display of restore message
  117. //
  118. function fnSetTextPrimaryDisplayStyle()
  119. {
  120. if(bToggleDisplay == true)
  121. {
  122. return "";
  123. }
  124. else
  125. {
  126. return "none";
  127. }
  128. }
  129. //
  130. // Used by CSS to set display of undo section
  131. //
  132. function fnSetTextPrimaryUndoDisplayStyle()
  133. {
  134. if(bToggleDisplay == false)
  135. {
  136. return "";
  137. }
  138. else
  139. {
  140. return "none";
  141. }
  142. }
  143. //
  144. // Used by CSS to set height of content
  145. //
  146. function fnSetContentTableHeight()
  147. {
  148. if ( screen.height <= nLowResScreenHeight )
  149. {
  150. return "410px";
  151. }
  152. else
  153. {
  154. return "450px";
  155. }
  156. }
  157. //
  158. // Used by CSS to set height restore implications list
  159. //
  160. function fnSetRestoreImplicationListHeight()
  161. {
  162. if ( screen.height <= nLowResScreenHeight )
  163. {
  164. return "70px";
  165. }
  166. else
  167. {
  168. return "90px";
  169. }
  170. }
  171. //
  172. // Used by CSS to set width restore implications list
  173. //
  174. function fnSetRestoreImplicationListWidth()
  175. {
  176. if ( screen.height <= nLowResScreenHeight )
  177. {
  178. return "430px";
  179. }
  180. else
  181. {
  182. return "500px";
  183. }
  184. }
  185. //
  186. // Used by CSS to set width of the restore point list
  187. //
  188. function fnSetRestorePointListWidth()
  189. {
  190. if ( screen.height <= nLowResScreenHeight )
  191. {
  192. return "250px";
  193. }
  194. else
  195. {
  196. return "300px";
  197. }
  198. }
  199. //
  200. // Colors
  201. //
  202. function fnGetColor(str)
  203. {
  204. if ( str == 'logo' )
  205. return "#2f6790";
  206. if ( str == 'text-red' )
  207. return "b00a20";
  208. if ( str == 'light-back' )
  209. return "#b7d7f0";
  210. if ( str == 'dark-back' )
  211. return "#296695";
  212. return str ;
  213. }
  214. //
  215. // Enable navigation
  216. //
  217. function fnEnableNavigation()
  218. {
  219. ObjSystemRestore.CanNavigatePage = true ;
  220. }
  221. //
  222. // Diable navigation
  223. //
  224. function fnDisableNavigation()
  225. {
  226. ObjSystemRestore.CanNavigatePage = false ;
  227. }
  228. function fnSetLowColorImage()
  229. {
  230. if ( screen.colorDepth <= 8 )
  231. {
  232. // TdBranding.background = "16branding.gif";
  233. // ImgGreenUR.src = "16green_ur.gif";
  234. // ImgBlueLL.src = "16blue_ll.gif";
  235. // ImgOrange.src = "16orange.gif";
  236. // ImgOrangeLR.src = "16orange_lr.gif";
  237. }
  238. }