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.

1259 lines
40 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_Ref1 href="hcp://system/css/Behaviors.css" rel=STYLESHEET type=text/css>
  11. <LINK ID=Stylesheet_Ref2 href="hcp://system/css/shared.css" rel=STYLESHEET type=text/css>
  12. <STYLE>
  13. .Search-Headline
  14. {
  15. height : 2em;
  16. padding-left : 11px;
  17. padding-right : 11px;
  18. }
  19. .Search-StopButton
  20. {
  21. padding : 2pt;
  22. cursor : hand;
  23. text-overflow : ellipsis;
  24. width : 100%;
  25. }
  26. .Search-ProviderPane
  27. {
  28. border-style : solid;
  29. border-left-width : 1px;
  30. border-right-width : 1px;
  31. border-top-width : 1px;
  32. border-bottom-width : 1px;
  33. border-top-color : threedhighlight;
  34. border-left-color : threedhighlight;
  35. border-bottom-color : threedshadow;
  36. border-right-color : threedshadow;
  37. background-color : threedface;
  38. padding-left : 11px;
  39. padding-top : 5px;
  40. padding-bottom : 5px;
  41. cursor : hand;
  42. }
  43. .Search-ResultCell
  44. {
  45. background-color : window;
  46. height : 100%;
  47. width : 100%;
  48. border-top-width : 0px;
  49. border-left-width : 1px;
  50. border-right-width : 1px;
  51. border-bottom-width : 1px;
  52. border-style : solid;
  53. border-color : threedshadow;
  54. }
  55. .Search-ResultDisplay
  56. {
  57. width : 100%;
  58. height : 100%;
  59. overflow : auto;
  60. }
  61. .Search-ResultFrameCell
  62. {
  63. height : 100%;
  64. padding-left : 11px;
  65. padding-right : 11px;
  66. }
  67. .Search-SearchStatusCell
  68. {
  69. width : 100%;
  70. padding-left : 11px;
  71. padding-top : 11px;
  72. padding-bottom : 11px;
  73. }
  74. .Search-OuterTableAll
  75. {
  76. border-top-width : 1px;
  77. border-left-width : 1px;
  78. border-right-width : 1px;
  79. border-bottom-width : 1px;
  80. border-style : solid;
  81. }
  82. .Search-OuterTableLeft
  83. {
  84. border-top-width : 0px;
  85. border-left-width : 1px;
  86. border-right-width : 0px;
  87. border-bottom-width : 0px;
  88. border-style : solid;
  89. }
  90. .Search-OuterTableRight
  91. {
  92. border-top-width : 0px;
  93. border-left-width : 0px;
  94. border-right-width : 1px;
  95. border-bottom-width : 0px;
  96. border-style : solid;
  97. }
  98. .Search-OuterTableLeftRight
  99. {
  100. border-top-width : 0px;
  101. border-left-width : 1px;
  102. border-right-width : 1px;
  103. border-bottom-width : 0px;
  104. border-style : solid;
  105. }
  106. .Search-OuterTableLeftRightBottom
  107. {
  108. border-top-width : 0px;
  109. border-left-width : 1px;
  110. border-right-width : 1px;
  111. border-bottom-width : 1px;
  112. border-style : solid;
  113. }
  114. .Search-ProvListBoxCell
  115. {
  116. border-top-width : 0px;
  117. border-left-width : 1px;
  118. border-right-width : 1px;
  119. border-bottom-width : 0px;
  120. border-style : solid;
  121. }
  122. </STYLE>
  123. </HEAD>
  124. <BODY tabindex=-1 SCROLL=NO class='sys-lhp-bgcolor'>
  125. <DIV id=idResultsPane WIDTH=100% HEIGHT=100%>
  126. <TABLE class='sys-font-body' cellspacing=0 cellpadding=0 WIDTH=100% HEIGHT=100% style='table-layout:fixed;'>
  127. <TR>
  128. <TD colspan=2>
  129. <DIV id=noloc1 class='sys-color-body' style='width: 100%; text-overflow: ellipsis; overflow-x: hidden;height:1em;padding-top:11px;padding-left:7px;'>
  130. <DIV id=locPreviousResults title="Specifies whether to search only the content included in the results of your most recent search." NOWRAP>
  131. <INPUT id=idSearchWithinResults TYPE=checkbox title="Search within previous results"> Search within previous results
  132. </DIV>
  133. </DIV>
  134. </TD>
  135. </TR>
  136. <TR>
  137. <TD id=noloc2 colspan=2 style='height:11px;'> </TD>
  138. </TR>
  139. <TR height=100%>
  140. <TD id=noloc3 colspan=2 style='padding-left : 11px; padding-right : 11px;'>
  141. <TABLE id="ResultTable" onresize="SwitchProvDisplay()" class='sys-font-body' WIDTH=100% HEIGHT=100% cellspacing=0 cellpadding=0 style='table-layout:fixed;'>
  142. <TR>
  143. <TD class='sys-toppane-color-border Search-OuterTableAll' colspan=3>
  144. <TABLE cellspacing=0 cellpadding=0 border=0 class='sys-font-body-bold sys-toppane-header-color sys-toppane-header-bgcolor Search-Headline' >
  145. <TR>
  146. <TD id='SearchResultsCell' WIDTH=100% id=locTitle>
  147. <DIV id=noloc4 style='width: 100%; text-overflow: ellipsis; overflow: hidden;'>
  148. <DIV NOWRAP id=locSearchResults>Search Results</DIV>
  149. </DIV>
  150. </TD>
  151. <TD NOWRAP>
  152. <DIV id=locTips><a class="sys-link-header" target='HelpCtrContents' href='hcp://system/blurbs/searchtips.htm'>Tips</a></DIV>
  153. </TD>
  154. </TR>
  155. </TABLE>
  156. </TD>
  157. </TR>
  158. <TR>
  159. <TD colspan=2 class='Search-SearchStatusCell sys-toppane-bgcolor sys-toppane-color-border Search-OuterTableLeft'>
  160. <DIV id=noloc5 style='width: 100%; text-overflow: ellipsis; overflow: hidden;'>
  161. <DIV NOWRAP class='sys-font-body sys-color-body' id='idSearchStatus'></DIV>
  162. </DIV>
  163. </TD>
  164. <TD align='right' class='sys-toppane-bgcolor sys-toppane-color-border Search-OuterTableRight' style='padding:11px;' id=noloc6>
  165. <BUTTON id=idStopSearch class="Search-StopButton sys-font-body" accesskey="t" disabled="true" onClick="UserAbort();">S<U>t</U>op</BUTTON>
  166. </TD>
  167. </TR>
  168. <TR>
  169. <TD class='sys-toppane-color-border Search-ResultFrameCell sys-toppane-bgcolor Search-OuterTableLeftRight' colspan=3>
  170. <DIV id=idResultSet class="sys-toppane-bgcolor"></DIV>
  171. </TD>
  172. </TR>
  173. <TR>
  174. <TD id=noloc7 colspan=3 class='sys-toppane-bgcolor sys-toppane-color-border Search-OuterTableLeftRightBottom' style='height:11px;'> </TD>
  175. </TR>
  176. </TABLE>
  177. </TD>
  178. </TR>
  179. <TR>
  180. <TD id=noloc8 colspan=2 style='height:11px;'> </TD>
  181. </TR>
  182. </TABLE>
  183. </DIV>
  184. </BODY>
  185. <SCRIPT id=Script_Ref0 SRC="hcp://system/scripts/wrapperparam.js"></SCRIPT>
  186. <SCRIPT>
  187. //
  188. // localizable variables/filenames
  189. //
  190. var L_SearchAborted_Text = 'Search was stopped.';
  191. var L_ResultsFound_Text = 'results found for';
  192. var L_ReturnZeroResults_Text = " returned 0 results for ";
  193. var L_QuickHints_Text = "Quick hints:<BR><BR><UL style='margin-left:15px;'><LI style='list-style-position:outside'>Check your spelling.</LI><BR><LI style='list-style-position:outside'>Try using a different word, like 'Web' instead of 'Internet'.</LI><BR><LI style='list-style-position:outside'>Make your search more general, or consult the search <a target='HelpCtrContents' href='hcp://system/blurbs/searchtips.htm'>Tips</a>.</LI></UL>";
  194. var L_Matches_Text = 'no matches';
  195. var L_Result1_Text = " (";
  196. var L_Result2_Text = " results)";
  197. var L_EnableWrapperError_Text = 'You must have at least one search provider selected in order to search Help and Support Center.\nPlease go to the Search Options page, and then select a search provider or engine.';
  198. var L_ServiceUnavailable_Text = 'Help and Support Search cannot continue because the Help Service is temporarily not working.\nPlease restart Help and Support Center to try again.';
  199. var L_YourSearchResults_Text = 'Your search results for';
  200. var L_NoLongerAvailable_Text = 'is no longer available. Please perform the query again.';
  201. var L_HelpInformation_Text = "Help and Information";
  202. var L_CommonQuestions_Text = "Common Questions";
  203. var L_Troubleshooting_Text = "Troubleshooting";
  204. var L_TechnicalArticles_Text = "Technical Articles";
  205. var L_Tutorials_Text = "Tutorials";
  206. var L_Helpfiles_Text = "Helpfiles";
  207. var L_FixProblem_Text = "Fix a Problem";
  208. var L_PickTask_Text = "Pick a task";
  209. var L_Overviews_Text = "Overviews, Articles and Tutorials";
  210. var L_References_Text = "References";
  211. var L_NotConnected_Text = "To access content from this search provider, you must be connected to the Internet.<BR><BR><A HREF=\"javascript:ShowLearnMore('hcp://system/updatectr/learninternet.htm')\">Tell me more about connecting to the Internet</A>.";
  212. // Other variables
  213. var g_ContentTypes = [];
  214. g_ContentTypes[1] = L_HelpInformation_Text;
  215. g_ContentTypes[2] = L_CommonQuestions_Text;
  216. g_ContentTypes[3] = L_Troubleshooting_Text;
  217. g_ContentTypes[4] = L_TechnicalArticles_Text;
  218. g_ContentTypes[5] = L_Tutorials_Text;
  219. g_ContentTypes[6] = L_Helpfiles_Text;
  220. g_ContentTypes[7] = L_FixProblem_Text;
  221. g_ContentTypes[8] = L_PickTask_Text;
  222. g_ContentTypes[9] = L_Overviews_Text;
  223. g_ContentTypes[10] = L_References_Text;
  224. var g_NAVBAR = pchealth.UI_NavBar.content.parentWindow;
  225. var g_oLearnDlg = null;
  226. var g_oEnumEngine = null;
  227. var g_semgr = null;
  228. var g_Timer_Timeout = null;
  229. var g_Timer_Print = null;
  230. var SEARCH_TIMEOUT = 30000; // 30 second timeout
  231. var g_bSearchInProgress = false;
  232. var g_lTotalNumResults = 0;
  233. var g_aEngID;
  234. var g_aEngName;
  235. var g_aDescription;
  236. var g_iEngCount;
  237. var g_WrapperSelected = "";
  238. var g_NewResults = false;
  239. var g_bResultClick = false;
  240. var g_bResultTravel = false;
  241. var g_strResultClickID = "";
  242. var g_bFrameCreated = false;
  243. var g_SearchTerms = null;
  244. var g_aBullet = null;
  245. var g_aResultEnum = null;
  246. var g_aWrapperState = null;
  247. var g_aContentType = null;
  248. var g_aWrapperList = null;
  249. var g_bPrinting = false;
  250. var PRINT_DELAY = 10; // 10 millisecond delay per call
  251. var WRAPPER_STATE_QUERYING = 0;
  252. var WRAPPER_STATE_PRINTING = 1;
  253. var WRAPPER_STATE_DONE = 2;
  254. var WRAPPER_NUM_RESULT_PRINT = 2;
  255. var REGKEY_WRAPPER_DISPLAY = "HKLM\\SOFTWARE\\Microsoft\\PCHealth\\HelpSvc\\WrapperDisplay";
  256. // Server DCR : Add option to select default wrapper
  257. var g_idWrapperDisplay = "";
  258. var g_bKeywordWrapperReturned = false;
  259. var g_bFTSWrapperReturned = false;
  260. function OpenConnWizard()
  261. {
  262. try
  263. {
  264. var g_oWShell = new ActiveXObject( "WScript.Shell" );
  265. var sShellCmd_NCW = "rundll32 netshell.dll,StartNCW 0";
  266. g_oWShell.Run( sShellCmd_NCW );
  267. }
  268. catch( e ){}
  269. }
  270. function ShowLearnMore( sTopicURL )
  271. {
  272. if ((!sTopicURL) || (sTopicURL == ""))
  273. return;
  274. g_oLearnDlg = window.showModelessDialog( sTopicURL, window, "help:no;status:no;resizable:no;dialogWidth:385px;dialogHeight:440px" );
  275. // pchealth.UI_Contents.content.Navigate( sTopicURL, null, null, null, null );
  276. }
  277. function GenerateResultFrame()
  278. {
  279. var resultHTML = "<TABLE class='sys-font-body' cellspacing=0 cellpadding=0 border=0 WIDTH=100% HEIGHT=100% style='table-layout:fixed'>";
  280. var iIndex;
  281. var oWrapper = null;
  282. var strListBoxDisplay;
  283. var strProviderDisplay;
  284. if (g_bFrameCreated)
  285. return;
  286. g_bFrameCreated = true;
  287. // delete the arrays and create new ones
  288. g_aEngID = new Array();
  289. g_aEngName = new Array();
  290. g_aDescription = new Array();
  291. g_iEngCount = 0;
  292. // Initialize search eng and get data
  293. for(var oEnumEngine = new Enumerator(g_oEnumEngine); !oEnumEngine.atEnd(); oEnumEngine.moveNext())
  294. {
  295. var oSearchEng = oEnumEngine.item();
  296. // Display the search engine only if it has been enabled
  297. if (oSearchEng.Enabled)
  298. {
  299. g_aEngID [g_iEngCount] = oSearchEng.ID;
  300. g_aEngName[g_iEngCount] = oSearchEng.Name;
  301. g_aDescription[g_iEngCount] = oSearchEng.Description;
  302. g_iEngCount++;
  303. }
  304. }
  305. if (IsResultSpaceEnough())
  306. {
  307. strListBoxDisplay = " style='display:none' ";
  308. strProviderDisplay = "";
  309. }
  310. else
  311. {
  312. strListBoxDisplay = "";
  313. strProviderDisplay = " style='display:none' ";
  314. }
  315. // Create a drop down list box
  316. resultHTML += "<TR id='ProvListBox' " + strListBoxDisplay + "><TD class='sys-font-body sys-color-body Search-ProvListBoxCell sys-toppane-color-border' style='background-color:threedface' TABINDEX=0 style='cursor:hand;' WIDTH=100%>";
  317. resultHTML += "<SELECT style='width:100%;' class='sys-font-body sys-color-body sys-toppane-bgcolor' ID='ProviderList' SIZE=1 onchange='ProviderListChange();'>";
  318. for (iIndex = 0; iIndex < g_iEngCount; iIndex++)
  319. {
  320. resultHTML += '<OPTION WIDTH=100% VALUE="' + pchealth.TextHelpers.HTMLEscape( g_aEngID[iIndex] ) + '">' + pchealth.TextHelpers.HTMLEscape(g_aEngName[iIndex]);
  321. }
  322. resultHTML += "</SELECT></TD></TR>";
  323. g_WrapperSelected = "";
  324. // Create a row for each wrapper
  325. for (iIndex = 0; iIndex < g_iEngCount; iIndex++)
  326. {
  327. // Check to see if there is a result number for the wrapper
  328. var strNumResults = g_NAVBAR.GetWrapperVar("g_numResult" + g_aEngID[iIndex]);
  329. resultHTML += '<TR id="ProvCell' + pchealth.TextHelpers.HTMLEscape( g_aEngID[iIndex] ) + '"' + strProviderDisplay + '><TD class="sys-font-body sys-color-body Search-ProviderPane" TITLE="' + pchealth.TextHelpers.HTMLEscape( g_aDescription[iIndex] ) + '" onClick=\'WrapperClick("' + pchealth.TextHelpers.HTMLEscape( g_aEngID[iIndex] ) + '");\' onkeydown=\'WrapperKeyDown("' + pchealth.TextHelpers.HTMLEscape( g_aEngID[iIndex] ) + '")\' TABINDEX=0 style="cursor:hand;" id="div' + pchealth.TextHelpers.HTMLEscape( g_aEngID[iIndex] ) + '" WIDTH=100%><DIV style="width: 100%; text-overflow: ellipsis; overflow: hidden;"><DIV NOWRAP>' + pchealth.TextHelpers.HTMLEscape(g_aEngName[iIndex]) + '</DIV></DIV></TD></TR>';
  330. // if it is the last one, display the result cell
  331. resultHTML += '<TR id="idResultCell' + pchealth.TextHelpers.HTMLEscape( g_aEngID[iIndex] ) + '"';
  332. if (iIndex == g_iEngCount - 1)
  333. {
  334. g_WrapperSelected = g_aEngID[iIndex];
  335. }
  336. else
  337. {
  338. resultHTML += " style='display:none;'";
  339. }
  340. resultHTML += '><TD class="sys-font-body Search-ResultCell"><DIV class="Search-ResultDisplay" id="idResultDIV' + pchealth.TextHelpers.HTMLEscape( g_aEngID[iIndex] ) + '"></DIV></TD></TR>';
  341. }
  342. // Insert the HTML
  343. idResultSet.innerHTML = resultHTML + "</TABLE>";
  344. }
  345. function ProviderListChange()
  346. {
  347. var oOptions = event.srcElement.options(event.srcElement.selectedIndex);
  348. WrapperClick(oOptions.value);
  349. }
  350. function IsResultSpaceEnough()
  351. {
  352. // Compute the total height occupied by the provider cells
  353. // Use the search result cell because other cells may not be avail and it is about the same height
  354. var iResultDisplay = 50;
  355. var iNumProviders = g_iEngCount + 4; // there are about 4 spaces roughly equal to each provider space
  356. return (ResultTable.offsetHeight > ((SearchResultsCell.offsetHeight * iNumProviders) + iResultDisplay));
  357. }
  358. function SwitchProvDisplay()
  359. {
  360. if (IsResultSpaceEnough())
  361. {
  362. // Enough space, use provider cells instead
  363. // Hide the drop down list
  364. oProvListBox = idResultSet.all.item("ProvListBox");
  365. if (oProvListBox)
  366. oProvListBox.style.display = "none";
  367. // Show the provider cells
  368. for (iIndex = 0; iIndex < g_iEngCount; iIndex++)
  369. {
  370. var oProvDiv = idResultSet.all.item("ProvCell" + g_aEngID[iIndex]);
  371. if (oProvDiv)
  372. oProvDiv.style.display = "inline";
  373. }
  374. }
  375. else
  376. {
  377. // Not enough space, so use drop down list instead
  378. // Show the drop down list
  379. var oProvListBox = idResultSet.all.item("ProvListBox");
  380. if (oProvListBox)
  381. oProvListBox.style.display = "inline";
  382. // Hide the provider cells
  383. for (iIndex = 0; iIndex < g_iEngCount; iIndex++)
  384. {
  385. var oProvDiv = idResultSet.all.item("ProvCell" + g_aEngID[iIndex]);
  386. if (oProvDiv)
  387. oProvDiv.style.display = "none";
  388. }
  389. }
  390. }
  391. ////////////////////
  392. function SetTimer_Print()
  393. {
  394. g_Timer_Print = window.setTimeout( GenerateResultItem, PRINT_DELAY );
  395. }
  396. function ClearTimer_Print()
  397. {
  398. if(g_Timer_Print)
  399. {
  400. window.clearTimeout( g_Timer_Print ); g_Timer_Print = null;
  401. }
  402. }
  403. function GenerateResult(oWrapper)
  404. {
  405. try
  406. {
  407. g_aBullet [oWrapper.ID] = oWrapper.GetParam("UI_BULLET");
  408. }
  409. catch(e)
  410. { ; }
  411. if (g_aBullet[oWrapper.ID])
  412. idResultSet.all.item("idResultDIV" + oWrapper.ID).innerHTML = '<DIV class="sys-rhp-bgcolor" style="height:100%;width:100%;"><UL class="sys-color-body" style="margin-left:25px;" id="list' + pchealth.TextHelpers.HTMLEscape( oWrapper.ID ) + '"></UL>';
  413. else
  414. idResultSet.all.item("idResultDIV" + oWrapper.ID).innerHTML = '<DIV class="sys-rhp-bgcolor" style="height:100%;width:100%;"><OL class="sys-color-body" id="list' + pchealth.TextHelpers.HTMLEscape( oWrapper.ID ) + '"></OL>';
  415. // Get the UI instructions for Button display from the wrapper
  416. try
  417. {
  418. g_aResultEnum [oWrapper.ID] = new Enumerator( oWrapper.Result(0, g_semgr.NumResult) );
  419. g_aContentType [oWrapper.ID] = -1;
  420. g_aWrapperState [oWrapper.ID] = WRAPPER_STATE_PRINTING;
  421. g_aWrapperList [oWrapper.ID] = idResultSet.all.item("list" + oWrapper.ID);
  422. }
  423. catch(e)
  424. { ; }
  425. GenerateResultItem();
  426. }
  427. function GenerateResultItem()
  428. {
  429. var bContinuePrinting = false;
  430. // If already printing, return
  431. if(g_bPrinting) return;
  432. ClearTimer_Print();
  433. g_bPrinting = true;
  434. // loop through all the wrappers
  435. for(var iIndex = 0; iIndex < g_iEngCount; iIndex++)
  436. {
  437. var wrapperID = g_aEngID[iIndex];
  438. var wrapper = g_aWrapperList[wrapperID];
  439. var result = g_aResultEnum[wrapperID];
  440. // Print out results
  441. for(var iResult = 0; iResult < WRAPPER_NUM_RESULT_PRINT; iResult++)
  442. {
  443. // Check if wrapper is ready to print results
  444. if (g_aWrapperState[wrapperID] == WRAPPER_STATE_PRINTING)
  445. {
  446. bContinuePrinting = true;
  447. // Get the result
  448. var oResult = result.item();
  449. // If error, display error string
  450. if (oResult.ContentType < 0)
  451. {
  452. // Create an error element
  453. var oNewNode = document.createElement("DIV");
  454. oNewNode.style.paddingTop = "15px";
  455. if (oResult.ContentType == -2)
  456. {
  457. oNewNode.innerHTML = "<TABLE><TR><TD VALIGN='top'><IMG SRC='hcp://system/images/16x16/warning.gif'></TD><TD><DIV class='sys-font-body sys-link-normal'>" + L_NotConnected_Text + "</DIV></TD></TR></TABLE>";
  458. }
  459. else
  460. {
  461. oNewNode.innerHTML = pchealth.TextHelpers.HTMLEscape(oResult.Description);
  462. }
  463. wrapper.style.marginLeft = "15px";
  464. wrapper.appendChild(oNewNode);
  465. }
  466. else
  467. {
  468. // Associate title and URL
  469. pchealth.HelpSession.SetTitle(oResult.URI, oResult.Title);
  470. // Add the content type
  471. var iContentType = oResult.ContentType;
  472. if ((iContentType == 0) && (g_aContentType[wrapperID] == -1))
  473. {
  474. // Add a line space
  475. var oContentSpace = document.createElement("DIV");
  476. oContentSpace.className = "sys-font-body-bold";
  477. oContentSpace.innerHTML = "&nbsp;";
  478. wrapper.appendChild(oContentSpace);
  479. // Change the content type stored
  480. g_aContentType[wrapperID] = 1;
  481. }
  482. if ((iContentType != 0) && (iContentType != g_aContentType[wrapperID]))
  483. {
  484. var strCT = g_ContentTypes[iContentType]; if(!strCT) strCT = " ";
  485. // Add a line space
  486. var oContentSpace = document.createElement("DIV");
  487. oContentSpace.className = "sys-font-body-bold sys-color-body";
  488. oContentSpace.innerHTML = "&nbsp;";
  489. wrapper.appendChild(oContentSpace);
  490. // Add the content type
  491. var oContentNode = document.createElement("DIV");
  492. oContentNode.className = "sys-font-body-bold sys-color-body";
  493. oContentNode.innerText = strCT;
  494. wrapper.appendChild(oContentNode);
  495. // Save the displayed content type so that it doesn't appear again
  496. g_aContentType[wrapperID] = iContentType;
  497. }
  498. // Create the element
  499. var oNewNode = document.createElement("LI");
  500. oNewNode.style.lineHeight = "1.5em";
  501. // Place the rank
  502. if ((oResult.Rank > 0) && (oResult.Rank <= 1))
  503. {
  504. var dRank = Math.ceil(oResult.Rank * 100);
  505. var oInnerDIV = document.createElement("DIV");
  506. oInnerDIV.style.color = "gray";
  507. oInnerDIV.className = "sys-font-body";
  508. oInnerDIV.innerText = "(" + dRank + "%)";
  509. oNewNode.appendChild(oInnerDIV);
  510. }
  511. // Place the title, URL, tooltip
  512. var oInnerDIV = document.createElement("DIV");
  513. oInnerDIV.className = "sys-font-body";
  514. var oInnerLink = document.createElement("A");
  515. oInnerLink.onclick = ResultClick;
  516. oInnerLink.className = "sys-link-normal";
  517. oInnerLink.wrapperID = wrapperID;
  518. oInnerLink.tabIndex = 0;
  519. oInnerLink.target = "HelpCtrContents";
  520. oInnerLink.href = oResult.URI;
  521. if(oResult.Description != "") oInnerLink.title = oResult.Description;
  522. // Place the location
  523. if ((oResult.Location != "") && (!pchealth.UserSettings.IsDesktopVersion))
  524. oInnerLink.innerText = oResult.Title + " : " + oResult.Location;
  525. else
  526. oInnerLink.innerText = oResult.Title;
  527. oNewNode.appendChild(oInnerLink);
  528. wrapper.appendChild(oNewNode);
  529. }
  530. // Advance to the next result
  531. result.moveNext();
  532. // Check if all results have been printed
  533. if(result.atEnd())
  534. {
  535. g_aWrapperState[wrapperID] = WRAPPER_STATE_DONE;
  536. continue;
  537. }
  538. }
  539. }
  540. }
  541. g_bPrinting = false;
  542. if(bContinuePrinting) SetTimer_Print();
  543. }
  544. function WrapperKeyDown(strID)
  545. {
  546. // Check if it is the space or return key being pressed
  547. if ((event.keyCode == 13) || (event.keyCode == 32))
  548. WrapperClick(strID);
  549. }
  550. function WrapperClick(strID)
  551. {
  552. // Make sure that the list box selection is sync'ed
  553. var oProvList = idResultSet.all.item("ProviderList");
  554. for(var iIndex = 0; iIndex < g_iEngCount; iIndex++)
  555. {
  556. if (g_aEngID[iIndex] == strID)
  557. {
  558. oProvList.selectedIndex = iIndex;
  559. break;
  560. }
  561. }
  562. if (g_WrapperSelected == strID)
  563. return;
  564. var strPrevWrapper = g_WrapperSelected;
  565. g_WrapperSelected = strID;
  566. // Turn results on
  567. if (g_WrapperSelected != "")
  568. idResultSet.all.item("idResultCell" + g_WrapperSelected).style.display = "";
  569. // Turn results off
  570. if (strPrevWrapper != "")
  571. idResultSet.all.item("idResultCell" + strPrevWrapper).style.display = "none";
  572. }
  573. function InitializeGlobals()
  574. {
  575. // Get the search engine if null
  576. if(g_semgr == null)
  577. {
  578. g_semgr = g_NAVBAR.GetSearchEngineManager();
  579. // Check if it has been initialized
  580. if(g_NAVBAR.GetWrapperVar("SEMgrInit") != "true")
  581. {
  582. LoadWrapperParams( g_semgr );
  583. g_NAVBAR.SetWrapperVar("SEMgrInit", "true");
  584. }
  585. g_oEnumEngine = g_semgr.EnumEngine();
  586. }
  587. }
  588. ////////////////////
  589. function SetTimer_Timeout()
  590. {
  591. g_Timer_Timeout = window.setTimeout( AbortFromTimeout, SEARCH_TIMEOUT );
  592. }
  593. function ClearTimer_Timeout()
  594. {
  595. if(g_Timer_Timeout)
  596. {
  597. window.clearTimeout( g_Timer_Timeout ); g_Timer_Timeout = null;
  598. }
  599. }
  600. function UserAbort()
  601. {
  602. AbortQuery();
  603. SetSearchStatus( L_SearchAborted_Text, L_SearchAborted_Text, true );
  604. }
  605. function AbortQuery()
  606. {
  607. ClearTimer_Timeout();
  608. ClearTimer_Print ();
  609. idResultsPane.style.cursor = "default";
  610. idStopSearch.disabled = true;
  611. g_bSearchInProgress = false;
  612. if(g_semgr)
  613. {
  614. g_semgr.onWrapperComplete = SENull;
  615. g_semgr.onComplete = SENull;
  616. g_semgr.AbortQuery();
  617. }
  618. }
  619. ////////////////////
  620. function UpdateSearchStatus()
  621. {
  622. if(g_NAVBAR.GetWrapperVar("SearchStatus"))
  623. {
  624. idSearchStatus.innerHTML = g_NAVBAR.GetWrapperVar("SearchStatus");
  625. idSearchStatus.title = g_NAVBAR.GetWrapperVar("SearchStatus_Tooltip");
  626. }
  627. else
  628. {
  629. idSearchStatus.innerHTML = L_Matches_Text;
  630. idSearchStatus.title = L_Matches_Text;
  631. }
  632. }
  633. function SetSearchStatus( text, title, now )
  634. {
  635. if(now)
  636. {
  637. idSearchStatus.innerHTML = text;
  638. idSearchStatus.title = title;
  639. }
  640. else
  641. {
  642. g_NAVBAR.SetWrapperVar( "SearchStatus" , text );
  643. g_NAVBAR.SetWrapperVar( "SearchStatus_Tooltip", title );
  644. }
  645. }
  646. function SEWrapperComplete( oWrapper )
  647. {
  648. // Get the actual total number of results
  649. var iTotalResult = oWrapper.Result(0, g_semgr.NumResult).Count;
  650. // Check if the wrapper has returned an error
  651. var oEnumResult = new Enumerator( oWrapper.Result(0, 1) );
  652. var oResult = oEnumResult.item();
  653. var bErrorResult = false;
  654. // Check if error on the first item
  655. try
  656. {
  657. if (oResult.ContentType < 0)
  658. {
  659. iTotalResult -= 1;
  660. bErrorResult = true;
  661. }
  662. }
  663. catch(e)
  664. { ; }
  665. // Save the number of results for this wrapper
  666. g_NAVBAR.SetWrapperVar("g_numResult" + oWrapper.ID, iTotalResult.toString());
  667. // tally number of results
  668. g_lTotalNumResults += iTotalResult;
  669. SetSearchStatus( g_lTotalNumResults + " " + L_ResultsFound_Text + " <B>" + pchealth.TextHelpers.HTMLEscape(g_semgr.QueryString) + "</B>" ,
  670. g_lTotalNumResults + " " + L_ResultsFound_Text + " \'" + pchealth.TextHelpers.HTMLEscape(g_semgr.QueryString) + "\'" , false );
  671. // Print out the number of results for the wrapper in the tab
  672. var item = idResultSet.all.item("div" + oWrapper.ID);
  673. var resTxt = pchealth.TextHelpers.HTMLEscape(oWrapper.Name) + L_Result1_Text + pchealth.TextHelpers.HTMLEscape( iTotalResult ) + L_Result2_Text;
  674. item.title = resTxt + "\n\n" + oWrapper.Description;
  675. item.innerHTML = "<DIV style='width: 100%; text-overflow: ellipsis; overflow: hidden;'><DIV NOWRAP>" + resTxt + "</DIV></DIV>";
  676. if (iTotalResult || bErrorResult)
  677. GenerateResult(oWrapper);
  678. else
  679. idResultSet.all.item("idResultDIV" + oWrapper.ID).innerHTML = "<DIV style='padding:11px'>" + pchealth.TextHelpers.HTMLEscape(oWrapper.Name) + L_ReturnZeroResults_Text + "<B>" + pchealth.TextHelpers.HTMLEscape(g_semgr.QueryString) + "</B>.<BR><BR><BR>" + L_QuickHints_Text + "</DIV>";
  680. // *************************************************
  681. // Server DCR : Add option to select default wrapper
  682. // Begin
  683. //
  684. // Check to see if there is a wrapper to display first
  685. var idWrapperDisplay = g_NAVBAR.GetDefaultWrapper();
  686. // If no default wrapper to display
  687. if (idWrapperDisplay == "" || idWrapperDisplay == "none" || idWrapperDisplay == undefined)
  688. {
  689. // if desktop sku
  690. if (pchealth.UserSettings.IsDesktopVersion)
  691. {
  692. // Store the first wrapper to return results > 0
  693. if((g_idWrapperDisplay == "") && (oWrapper.ID != g_NAVBAR.ID_KEYWORD) && (iTotalResult > 0)) g_idWrapperDisplay = oWrapper.ID;
  694. // Check if keyword is Enabled
  695. if (FindWrapper(g_NAVBAR.ID_KEYWORD).Enabled)
  696. {
  697. // if it is keyword and num results is zero, display FTS wrapper
  698. if (oWrapper.ID == g_NAVBAR.ID_KEYWORD)
  699. {
  700. if (iTotalResult == 0)
  701. {
  702. if(g_idWrapperDisplay == "")
  703. {
  704. g_bKeywordWrapperReturned = true;
  705. }
  706. else
  707. {
  708. WrapperClick(g_idWrapperDisplay);
  709. }
  710. }
  711. else
  712. {
  713. WrapperClick(g_NAVBAR.ID_KEYWORD);
  714. }
  715. }
  716. else
  717. {
  718. if(g_bKeywordWrapperReturned)
  719. {
  720. if(g_idWrapperDisplay) WrapperClick(g_idWrapperDisplay);
  721. }
  722. }
  723. }
  724. else
  725. {
  726. if ((g_WrapperSelected == "") && (iTotalResult > 0))
  727. WrapperClick(oWrapper.ID);
  728. }
  729. }
  730. else // If not desktop sku
  731. {
  732. // Store the first wrapper to return results > 0
  733. if((g_idWrapperDisplay == "") && (oWrapper.ID != g_NAVBAR.ID_FTS) && (iTotalResult > 0)) g_idWrapperDisplay = oWrapper.ID;
  734. // Check if keyword is Enabled
  735. if (FindWrapper(g_NAVBAR.ID_FTS).Enabled)
  736. {
  737. // if it is keyword and num results is zero, display FTS wrapper
  738. if (oWrapper.ID == g_NAVBAR.ID_FTS)
  739. {
  740. if(iTotalResult == 0)
  741. {
  742. if(g_idWrapperDisplay == "")
  743. {
  744. g_bFTSWrapperReturned = true;
  745. }
  746. else
  747. {
  748. WrapperClick(g_idWrapperDisplay);
  749. }
  750. }
  751. else
  752. {
  753. WrapperClick(g_NAVBAR.ID_FTS);
  754. }
  755. }
  756. else
  757. {
  758. if(g_bFTSWrapperReturned)
  759. {
  760. if(g_idWrapperDisplay) WrapperClick(g_idWrapperDisplay);
  761. }
  762. }
  763. }
  764. else
  765. {
  766. if ((g_WrapperSelected == "") && (iTotalResult > 0))
  767. WrapperClick(oWrapper.ID);
  768. }
  769. }
  770. }
  771. else // If there is a default wrapper to display
  772. {
  773. // Check if the wrapper returned is indeed the default wrapper
  774. if (idWrapperDisplay == oWrapper.ID)
  775. {
  776. WrapperClick(oWrapper.ID);
  777. }
  778. }
  779. // End
  780. // Server DCR : Add option to select default wrapper
  781. // *************************************************
  782. // Display status only if search has ended
  783. if(!g_bSearchInProgress) UpdateSearchStatus();
  784. GenerateResultItem();
  785. }
  786. function SEMgrComplete(lSucceeded)
  787. {
  788. ClearTimer_Timeout();
  789. g_bSearchInProgress = false;
  790. // Set the cursor
  791. idResultsPane.style.cursor = "default";
  792. // Disable abort key
  793. idStopSearch.disabled = true;
  794. UpdateSearchStatus();
  795. GenerateResultItem();
  796. }
  797. function SENull()
  798. {
  799. }
  800. function AbortFromTimeout()
  801. {
  802. AbortQuery();
  803. SEMgrComplete(0);
  804. }
  805. function ExecuteQuery( strQuery )
  806. {
  807. var bEnableSearch = false;
  808. // Init print arrays
  809. g_aBullet = new Array();
  810. g_aResultEnum = new Array();
  811. g_aWrapperState = new Array();
  812. g_aContentType = new Array();
  813. g_aWrapperList = new Array();
  814. // Init global vars
  815. g_bFrameCreated = false;
  816. g_NewResults = true;
  817. g_bSearchInProgress = true;
  818. g_WrapperSelected = "";
  819. idResultsPane.style.cursor = "wait";
  820. g_lTotalNumResults = 0;
  821. // Initialize variables for Server DCR
  822. g_idWrapperDisplay = "";
  823. g_bKeywordWrapperReturned = false;
  824. g_bFTSWrapperReturned = false;
  825. // Create the query
  826. if (idSearchWithinResults.checked)
  827. {
  828. if (g_NAVBAR.GetWrapperVar("HCPrevQuery") == strQuery)
  829. g_semgr.QueryString = strQuery;
  830. else
  831. if (g_NAVBAR.GetWrapperVar("HCPrevQuery") != "")
  832. g_semgr.QueryString = "(" + g_NAVBAR.GetWrapperVar("HCPrevQuery") + ") and " + strQuery;
  833. else
  834. g_semgr.QueryString = strQuery;
  835. }
  836. else
  837. g_semgr.QueryString = strQuery;
  838. // Save query
  839. g_NAVBAR.SetWrapperVar("HCPrevQuery", g_semgr.QueryString);
  840. // Check if at least one wrapper is enabled
  841. var iSWCount = 0;
  842. for(var oEnumEngine = new Enumerator(g_oEnumEngine); !oEnumEngine.atEnd(); oEnumEngine.moveNext())
  843. {
  844. var oSearchEng = oEnumEngine.item();
  845. // Check whether enabled
  846. if(oSearchEng.Enabled) bEnableSearch = true;
  847. // reset the number of results
  848. g_NAVBAR.SetWrapperVar("g_numResult" + oSearchEng.ID, "");
  849. // set the subsite info
  850. oSearchEng.AddParam("SUBSITE", g_NAVBAR.GetWrapperVar("SUBSITE"));
  851. // set the state of the wrapper
  852. g_aWrapperState[oSearchEng.ID] = WRAPPER_STATE_QUERYING;
  853. // set the query and current query
  854. oSearchEng.AddParam("SubQuery", idSearchWithinResults.checked);
  855. oSearchEng.AddParam("CurrentQuery", strQuery);
  856. iSWCount++;
  857. }
  858. // Generate the tabs
  859. GenerateResultFrame();
  860. // Execute the query
  861. if (bEnableSearch)
  862. {
  863. // set the search status string
  864. SetSearchStatus( "<img src='hcp://system/images/progbar.gif'>", "", true );
  865. idStopSearch.disabled = false;
  866. idStopSearch.focus();
  867. ClearTimer_Timeout();
  868. ClearTimer_Print ();
  869. try
  870. {
  871. // Execute the search
  872. g_semgr.onWrapperComplete = SEWrapperComplete;
  873. g_semgr.onComplete = SEMgrComplete;
  874. g_semgr.ExecuteAsynchQuery();
  875. // create new timer for new query
  876. SetTimer_Timeout();
  877. }
  878. catch(e)
  879. {
  880. // abort, try again
  881. AbortQuery();
  882. }
  883. }
  884. else
  885. {
  886. SetSearchStatus( "", "", true );
  887. pchealth.MessageBox( iSWCount ? L_EnableWrapperError_Text : L_ServiceUnavailable_Text, "OK" );
  888. idResultsPane.style.cursor = "default";
  889. g_bSearchInProgress = false;
  890. }
  891. }
  892. function search_ContextSwitch()
  893. {
  894. var ctx = pchealth.HelpSession.CurrentContext;
  895. if(ctx.ContextName == "SEARCH")
  896. {
  897. // Check if a search is already in progress.
  898. if(g_bSearchInProgress) return;
  899. // Check if the previous context is not search
  900. var ctxPrev = event.srcElement.data.PreviousContext;
  901. if(!ctxPrev || ctxPrev.ContextName != "SEARCH")
  902. {
  903. idSearchWithinResults.checked = false;
  904. }
  905. InitializeGlobals();
  906. if(ctx.ContextInfo) ExecuteQuery( ctx.ContextInfo );
  907. }
  908. }
  909. function ResultClick()
  910. {
  911. g_bResultClick = true;
  912. g_bResultTravel = true;
  913. g_strResultClickID = this.wrapperID;
  914. }
  915. function search_PersistSave()
  916. {
  917. // Check if a search is already in progress.
  918. if(g_bSearchInProgress) return;
  919. if(g_NewResults)
  920. {
  921. // Save the last query
  922. idState.stateProperty("HCPrevQuery") = g_NAVBAR.GetWrapperVar("HCPrevQuery");
  923. // Save the html of results
  924. g_NAVBAR.SetWrapperVar("ResultDisplay", idResultSet.innerHTML);
  925. g_NewResults = false;
  926. }
  927. }
  928. function search_PersistLoad()
  929. {
  930. // Check if a search is already in progress.
  931. if(g_bSearchInProgress) return;
  932. if (g_bResultClick)
  933. {
  934. // Save the last query
  935. idState.stateProperty("HCPrevQuery") = g_NAVBAR.GetWrapperVar("HCPrevQuery");
  936. g_bResultClick = false;
  937. return;
  938. }
  939. // Check if there is anything to display
  940. if(!idState.stateProperty("HCPrevQuery") || idState.stateProperty("HCPrevQuery") == "")
  941. {
  942. InitializeGlobals();
  943. GenerateResultFrame();
  944. return;
  945. }
  946. // Recreate the display
  947. if (idState.stateProperty("HCPrevQuery") == g_NAVBAR.GetWrapperVar("HCPrevQuery"))
  948. {
  949. idResultSet.innerHTML = g_NAVBAR.GetWrapperVar("ResultDisplay");
  950. InitGlobalsForRecreateDisplay();
  951. UpdateSearchStatus();
  952. }
  953. else
  954. {
  955. InitializeGlobals();
  956. GenerateResultFrame();
  957. SetSearchStatus( "", "", true );
  958. // Put unavailable message
  959. for (iIndex = 0; iIndex < g_iEngCount; iIndex++)
  960. {
  961. idResultSet.all.item("idResultDIV" + g_aEngID[iIndex]).innerHTML = "<DIV style='padding:11px'>" + L_YourSearchResults_Text + " <B>" + pchealth.TextHelpers.HTMLEscape(idState.stateProperty("HCPrevQuery")) + "</B> " + L_NoLongerAvailable_Text + "</DIV>";
  962. }
  963. }
  964. }
  965. function FindWrapper(strID)
  966. {
  967. // Find the wrapper
  968. for(var oEnumEngine = new Enumerator(g_semgr.EnumEngine()); !oEnumEngine.atEnd(); oEnumEngine.moveNext())
  969. {
  970. var oWrapper = oEnumEngine.item();
  971. if (oWrapper.ID == strID)
  972. {
  973. return oWrapper;
  974. }
  975. }
  976. }
  977. function search_TravelDone()
  978. {
  979. if (g_bResultTravel)
  980. {
  981. if (g_strResultClickID)
  982. {
  983. var oWrapper = FindWrapper(g_strResultClickID);
  984. g_SearchTerms = oWrapper.SearchTerms;
  985. if (oWrapper)
  986. window.setTimeout( search_Highlight, 500);
  987. }
  988. g_bResultTravel = false;
  989. }
  990. }
  991. function search_Highlight()
  992. {
  993. if(g_NAVBAR.g_SearchHighlight)
  994. {
  995. pchealth.HighlightWords( null, g_SearchTerms );
  996. }
  997. }
  998. function search_Abort()
  999. {
  1000. if(g_bSearchInProgress)
  1001. {
  1002. UserAbort();
  1003. }
  1004. }
  1005. function InitGlobalsForRecreateDisplay()
  1006. {
  1007. // Get the search engine if null
  1008. if(g_semgr == null)
  1009. {
  1010. g_semgr = g_NAVBAR.GetSearchEngineManager();
  1011. // Check if it has been initialized
  1012. if(g_NAVBAR.GetWrapperVar("SEMgrInit") != "true")
  1013. {
  1014. LoadWrapperParams( g_semgr );
  1015. g_NAVBAR.SetWrapperVar("SEMgrInit", "true");
  1016. }
  1017. g_oEnumEngine = g_semgr.EnumEngine();
  1018. }
  1019. g_bFrameCreated = true;
  1020. // delete the arrays and create new ones
  1021. g_aEngID = new Array();
  1022. g_aEngName = new Array();
  1023. g_aDescription = new Array();
  1024. g_iEngCount = 0;
  1025. // Initialize search eng and get data
  1026. for(var oEnumEngine = new Enumerator(g_oEnumEngine); !oEnumEngine.atEnd(); oEnumEngine.moveNext())
  1027. {
  1028. var oSearchEng = oEnumEngine.item();
  1029. // Display the search engine only if it has been enabled
  1030. if (oSearchEng.Enabled)
  1031. {
  1032. g_aEngID [g_iEngCount] = oSearchEng.ID;
  1033. g_aEngName[g_iEngCount] = oSearchEng.Name;
  1034. g_aDescription[g_iEngCount] = oSearchEng.Description;
  1035. g_iEngCount++;
  1036. }
  1037. }
  1038. var oProvList = idResultSet.all.item("ProviderList");
  1039. for(var iIndex = 0; iIndex < g_iEngCount; iIndex++)
  1040. {
  1041. if (oProvList.selectedIndex == iIndex)
  1042. {
  1043. g_WrapperSelected = g_aEngID[iIndex];
  1044. break;
  1045. }
  1046. }
  1047. }
  1048. </SCRIPT>
  1049. <helpcenter:events id=idEvents onContextSwitch="search_ContextSwitch();" onTravelDone="search_TravelDone();" onPersistSave="search_PersistSave();" onPersistLoad="search_PersistLoad();" onBeforeContextSwitch="search_Abort();"/>
  1050. <helpcenter:state id=idState identity="Search" />
  1051. </HTML>