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.

361 lines
7.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. <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
  9. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  10. <LINK ID=Stylesheet_Ref0 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. .Context-Button
  14. {
  15. padding : 2pt;
  16. cursor : hand;
  17. text-overflow : ellipsis;
  18. width : 100%;
  19. }
  20. .Space-Button
  21. {
  22. margin-left : 10px;
  23. }
  24. </STYLE>
  25. </HEAD>
  26. <BODY id=noloc0 tabindex=-1 class="sys-lhp-bgcolor" style="margin: 11px" scroll=no onselectstart="onSelectStart();">
  27. <TABLE border=0 cellPadding=0 cellSpacing=0 WIDTH=100% HEIGHT=100% style="table-layout: fixed">
  28. <TR WIDTH=100%>
  29. <TD>
  30. <DIV id=noloc1 style='width: 100%; text-overflow: ellipsis; overflow: hidden; border : 1pt solid'
  31. class='sys-font-body sys-toppane-color-border sys-toppane-header-color sys-toppane-header-bgcolor'>
  32. <DIV ID=tree_Title style='padding: 0.5em 11px'>
  33. <A class='sys-link-header sys-font-body-bold' tabIndex=1 href="hcp://system/blurbs/favorites.htm" target="HelpCtrContents">Favorites</A>
  34. </DIV>
  35. </DIV>
  36. </TD>
  37. </TR>
  38. <TR>
  39. <TD HEIGHT=100%>
  40. <DIV ID=tree_Children
  41. class='sys-font-body sys-toppane-color-border sys-toppane-bgcolor'
  42. style='width: 100%; height: 100%; overflow: auto; border-left : 1pt solid; border-bottom : 1pt solid; border-right : 1pt solid; padding: 11px'>
  43. </DIV>
  44. </TD>
  45. </TR>
  46. <TR style="padding-top: 11px">
  47. <TD id=noloc2 align="right" WIDTH=100%>
  48. <TABLE border=0 cellPadding=0 cellSpacing=0 WIDTH=100% style="table-layout: fixed">
  49. <TR WIDTH=100%>
  50. <TD>
  51. <BUTTON id=idRename class="Context-Button Space-Button sys-font-body" accesskey="e" onClick="onClick_Rename();" DISABLED title="Rename the favorite item.">R<U>e</U>name</BUTTON>
  52. </TD>
  53. <TD>
  54. <BUTTON id=idRemove class="Context-Button Space-Button sys-font-body" accesskey="R" onClick="onClick_Remove();" DISABLED title="Removes the favorite item."><U>R</U>emove</BUTTON>
  55. </TD>
  56. </TR>
  57. </TABLE>
  58. </TD>
  59. </TR>
  60. </TABLE>
  61. </BODY>
  62. <SCRIPT>
  63. //
  64. // localizable variables/filenames
  65. //
  66. var L_Rename_Text = "Rename...";
  67. var L_Delete_Text = "Delete";
  68. var g_Favorites = null;
  69. var g_SelectedDIV = null;
  70. var g_SelectedObj = null;
  71. function favorites_AbortEdit()
  72. {
  73. if(g_SelectedDIV)
  74. {
  75. RevertEditing( g_SelectedDIV );
  76. }
  77. }
  78. function favorites_ContextSwitch()
  79. {
  80. var ctx = pchealth.HelpSession.CurrentContext;
  81. if(ctx.ContextName == "FAVORITES")
  82. {
  83. DisplayList();
  84. }
  85. }
  86. function favorites_TravelDone()
  87. {
  88. if(g_Favorites == null)
  89. {
  90. DisplayList();
  91. }
  92. }
  93. function onSelectStart()
  94. {
  95. if(event.srcElement.onblur) return; // It's the element being edited.
  96. event.cancelBubble = true;
  97. event.returnValue = false;
  98. }
  99. function onClick_Rename( now )
  100. {
  101. if(!now)
  102. {
  103. window.setTimeout( "onClick_Rename( true )", 100 );
  104. return;
  105. }
  106. if(g_SelectedDIV)
  107. {
  108. PrepareForEdit( g_SelectedDIV );
  109. }
  110. }
  111. function onClick_Remove()
  112. {
  113. if(g_SelectedObj)
  114. {
  115. g_Favorites.Delete( g_SelectedObj );
  116. g_SelectedObj = null;
  117. }
  118. DisplayList();
  119. }
  120. function onClick_KeyPress()
  121. {
  122. if(event.keyCode == 27)
  123. {
  124. RevertEditing( this );
  125. }
  126. if(event.keyCode == 13)
  127. {
  128. if(CommitEditing( this ) == false)
  129. {
  130. if(this != g_SelectedDIV)
  131. {
  132. this.onclick();
  133. }
  134. else
  135. {
  136. onClick_Display();
  137. }
  138. }
  139. }
  140. }
  141. function onClick_ContextMenu()
  142. {
  143. event.cancelBubble = true;
  144. event.returnValue = false;
  145. var cm = pchealth.CreateObject_ContextMenu();
  146. cm.AddItem ( L_Rename_Text , 1, window.top.MF_ENABLED );
  147. cm.AddSeparator( );
  148. cm.AddItem ( L_Delete_Text , 2, window.top.MF_ENABLED );
  149. var res = cm.Display();
  150. switch(res)
  151. {
  152. case "1":
  153. onClick_Select( this );
  154. onClick_Rename();
  155. break;
  156. case "2":
  157. onClick_Select( this );
  158. onClick_Remove();
  159. break;
  160. }
  161. }
  162. function onClick_Select( obj )
  163. {
  164. if(!obj) obj = this;
  165. event.cancelBubble = true;
  166. event.returnValue = false;
  167. // Save the newly selected element.
  168. g_SelectedDIV = obj;
  169. g_SelectedObj = obj.payload;
  170. SetButtonsState();
  171. }
  172. function onClick_Display()
  173. {
  174. favorites_AbortEdit();
  175. g_SelectedDIV = this;
  176. g_SelectedObj = this.payload;
  177. SetButtonsState();
  178. window.setTimeout( onClick_Display_Delayed, 100 );
  179. }
  180. function onClick_Display_Delayed()
  181. {
  182. if(g_SelectedObj)
  183. {
  184. pchealth.UI_Contents.content.Navigate( g_SelectedObj.URL, null, null, null, null );
  185. }
  186. }
  187. ////////////////////
  188. function SetButtonsState( state )
  189. {
  190. if(state == null)
  191. {
  192. state = (g_SelectedObj == null);
  193. }
  194. idRename.disabled = state;
  195. idRemove.disabled = state;
  196. }
  197. function PrepareForEdit( obj )
  198. {
  199. var a = obj.payload_text;
  200. a.state_caller = obj;
  201. a.contentEditable = true;
  202. a.onblur = CommitEditing;
  203. var rng = document.body.createTextRange();
  204. rng.moveToElementText( a );
  205. rng.select();
  206. SetButtonsState( true );
  207. }
  208. function RevertEditing( obj )
  209. {
  210. if(!obj) obj = this.state_caller;
  211. var a = obj.payload_text;
  212. a.onblur = null;
  213. a.contentEditable = false;
  214. a.innerText = obj.payload.Title;
  215. SetButtonsState();
  216. }
  217. function CommitEditing( obj )
  218. {
  219. if(!obj) obj = this.state_caller;
  220. var a = obj.payload_text;
  221. var res = false;
  222. if(a.isContentEditable)
  223. {
  224. event.cancelBubble = true;
  225. event.returnValue = false;
  226. a.contentEditable = false;
  227. a.onblur = null;
  228. PersistRenamedTitle( obj );
  229. res = true;
  230. }
  231. SetButtonsState();
  232. return res;
  233. }
  234. function PersistRenamedTitle( obj )
  235. {
  236. var a = obj.payload_text;
  237. if(obj.payload.Title != a.innerText)
  238. {
  239. g_Favorites.Rename( a.innerText, obj.payload );
  240. }
  241. }
  242. ////////////////////
  243. function DisplayList()
  244. {
  245. var html = "";
  246. var e;
  247. var i;
  248. g_Favorites = pchealth.UserSettings.Favorites;
  249. g_SelectedRow = null;
  250. g_SelectedObj = null;
  251. SetButtonsState( true );
  252. // enumerate all results
  253. for(e = new Enumerator( g_Favorites ); !e.atEnd(); e.moveNext())
  254. {
  255. // get the item and save it into array
  256. var obj = e.item();
  257. html += "<A class='sys-link-normal' tabindex=2 href=#>" + pchealth.TextHelpers.HTMLEscape( obj.Title ) + "</A><DIV>&nbsp</DIV>";
  258. }
  259. tree_Children.innerHTML = html;
  260. i = 0;
  261. for(e = new Enumerator( g_Favorites ); !e.atEnd(); e.moveNext())
  262. {
  263. // get the item and save it into array
  264. var obj = e.item();
  265. var obj2 = tree_Children.children(i);i=i+2;
  266. obj2.payload = obj;
  267. obj2.payload_text = obj2;
  268. obj2.onclick = onClick_Display;
  269. obj2.onkeypress = onClick_KeyPress;
  270. obj2.oncontextmenu = onClick_ContextMenu;
  271. }
  272. }
  273. </SCRIPT>
  274. <helpcenter:events id=idEvents onBeforeNavigate="favorites_AbortEdit();" onBeforeTransition="favorites_AbortEdit();" onBeforeContextSwitch="favorites_AbortEdit();" onContextSwitch="favorites_ContextSwitch();" onTravelDone="favorites_TravelDone();" onFavoritesUpdate="DisplayList();" />
  275. <helpcenter:state id=idState identity="Favorites" />
  276. </HTML>