home *** CD-ROM | disk | FTP | other *** search
/ Chip: Shareware for Win 95 / Chip-Shareware-Win95.bin / komunik / ie40 / ie4nt_s2.cab / IE4NT_2.CAB / MSHTML.DLL / 2110 / FIND.DLG < prev    next >
Encoding:
Text File  |  1997-07-12  |  9.9 KB  |  371 lines

  1. <HTML id=dlgFind STYLE="font-family: ms sans serif; font-size: 8pt;
  2. width: 33.5em; height: 11.2em">
  3. <HEAD>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <TITLE id=dialogTitle>
  6. Find
  7. </TITLE>
  8. <SCRIPT LANGUAGE="JavaScript" defer>
  9. function callHelp(elm)
  10. {
  11. if (null != elm.helpid)
  12. {
  13.  window.showHelp(elm.helpfile, "" + parseInt(elm.helpid));
  14. }
  15. else
  16. {
  17.  if ("BODY" != elm.tagName)
  18.  {
  19.   callHelp(elm.parentElement);
  20.  }
  21. }
  22. function btnCancelClick()
  23. {
  24. window.close();
  25. function getTextRange(elm)
  26. {
  27. var r = elm.parentTextEdit.createTextRange();
  28. r.moveToElementText(elm);
  29. return r;
  30. function mouseClick()
  31. {
  32. if (window.event.srcElement.id.substring(0,3)
  33.  == "txt")
  34. {
  35.  return;
  36. }
  37. if (window.event.button == 2)
  38. {
  39.  callHelp(window.event.srcElement);
  40. }
  41. function txtDefaultESC()
  42. {
  43. if (event.keyCode == 27)
  44. {
  45.  window.close();
  46.  return;
  47. }
  48. function setFindState(fKeyPress) { var htmlKeyAlt = 18; if (!fKeyPress || htmlKeyAlt != event.keyCode) { if (("" == txtFindText.value) == g_fFindEnabled) { btnFind.disabled = g_fFindEnabled; g_fFindEnabled = !g_fFindEnabled; } } else { window.setTimeout("set" + "Find" + "State(false)", 50); } }
  49. var g_fFindEnabled = false; 
  50. function findFlags()
  51. {
  52. var htmlMatchWord = 2;
  53. var htmlMatchCase = 4;
  54. return (htmlMatchWord * document.all.chkWholeWord.checked)
  55.  | (htmlMatchCase * document.all.chkMatchCase.checked)
  56. function docPosition(doc)
  57. {
  58. var index;
  59. var fraParent = window.dialogArguments.unsecuredWindowOfDocument.frames;
  60. for (index = 0; index < fraParent.length; ++index)
  61. {
  62.  if (fraParent[index].document == doc)
  63.  {
  64.   return index;
  65.  }
  66. }
  67. return -1;
  68. function nextDoc(doc)
  69. {
  70. var winParent = window.dialogArguments.unsecuredWindowOfDocument;
  71. var docTemp;
  72. var nPosition;
  73. nPosition = docPosition(doc);
  74. if (nPosition == -1)
  75. {
  76. return null;
  77. }
  78. if (nPosition < winParent.frames.length - 1)
  79. {
  80.  return winParent.frames[nPosition + 1].document;
  81. }
  82. else
  83. {
  84.  if (winParent.document.parentWindow 
  85.   == txtFindText.topDoc.parentWindow)
  86.  {
  87.   return doc;
  88.  }
  89.  docTemp = doc;
  90.  while (docPosition(docTemp) == winParent.frames.length - 1)
  91.  {
  92.   docTemp = winParent.document;
  93.   if (docTemp.parentWindow 
  94.    == txtFindText.topDoc.parentWindow)
  95.   {
  96.    return doc;
  97.   }
  98.   winParent = docTemp.parentWindow.parent;
  99.  }
  100.  return winParent.frames[docPosition(docTemp) + 1].document;
  101. function prevDoc(doc)
  102. {
  103. var winParent = window.dialogArguments.unsecuredWindowOfDocument;
  104. var docTemp;
  105. var nPosition;
  106. nPosition = docPosition(doc);
  107. if (nPosition != 0)
  108. {
  109.  return winParent.frames[nPosition - 1].document;
  110. }
  111. else
  112. {
  113.  if (winParent.document.parentWindow 
  114.   == txtFindText.topDoc.parentWindow)
  115.  {
  116.   return doc;
  117.  }
  118.  docTemp = doc;
  119.  while (docPosition(docTemp) == 0)
  120.  {
  121.   docTemp = winParent.document;
  122.   if (docTemp.parentWindow 
  123.    == txtFindText.topDoc.parentWindow)
  124.   {
  125.    return doc;
  126.   }
  127.   winParent = docTemp.parentWindow.parent;
  128.  }
  129.  return winParent.frames[docPosition(docTemp) - 1].document;
  130. }
  131. function btnFindClick()
  132. {
  133. var docSearch 
  134.  = window.dialogArguments.unsecuredWindowOfDocument.document;
  135. var L_FinishedDocument_Text = "Finished searching the document.";
  136. var intDirection;  
  137. var rngWorking; 
  138. var rngFoundText;  
  139. var fFoundText = false; 
  140. var fFrameset = false; 
  141. var fIframe = docSearch.all.tags("IFRAME").length;
  142. var index;
  143. if (!fIframe && docSearch.parentWindow.frames.length)
  144. {
  145.  fFrameset = true;
  146.  if (0 == txtFindText.docLastSearched)
  147.  {
  148.   while (docSearch.parentWindow.frames.length)
  149.   {
  150.    docSearch = docSearch.parentWindow.frames[0].document;
  151.   }
  152.   txtFindText.docLastSearched = docSearch;
  153.  }
  154.  else
  155.  {
  156.   docSearch = txtFindText.docLastSearched;
  157. if (docSearch == null)
  158. {
  159. alert(L_FinishedDocument_Text);
  160. return;
  161. }
  162. while (docSearch.parentWindow.frames.length)
  163.   {
  164.    if (radDirection[0].checked) 
  165.    {
  166.     docSearch = docSearch.parentWindow.
  167.      frames[docSearch.parentWindow.
  168.      frames.length - 1].document;
  169.    }
  170.    else       
  171.    {
  172.     docSearch = docSearch.parentWindow.frames[0].document;
  173.    }
  174.   }
  175.   txtFindText.docLastSearched = docSearch;
  176.  }
  177. }
  178. rngWorking = docSearch.selection.createRange();
  179. if (docSearch.queryCommandState("BrowseMode")
  180.  && rngWorking.text.length == 0)
  181. {
  182.  rngWorking = docSearch.body.createTextRange();
  183. }
  184. fFoundText = (docSearch.selection.type == "Text");
  185. if (radDirection[0].checked) 
  186. {
  187.  if (fFoundText)
  188.  {
  189.   rngWorking.moveEnd("character" , -1);
  190.  }
  191.  while (0 != rngWorking.moveStart("textedit", -1))
  192.  {
  193.  }
  194.  intDirection = -1 * rngWorking.text.length; 
  195. }
  196. else       
  197. {
  198.  if (fFoundText)
  199.  {
  200.   rngWorking.moveStart("character", 1);
  201.  }
  202.  while (0 != rngWorking.moveEnd("textedit", 1))
  203.  {
  204.  }
  205.  intDirection = rngWorking.text.length 
  206. }
  207. rngFoundText = rngWorking.duplicate();
  208. success = rngFoundText.findText(txtFindText.value, 
  209.  intDirection, findFlags());
  210. if (!intDirection)
  211. {
  212.  success = false;
  213. }
  214. if (!success) 
  215. {
  216.  if (fFrameset)
  217.  {
  218.   if (radDirection[0].checked) 
  219.   {
  220.    if (prevDoc(docSearch) != docSearch)
  221.    {
  222.     txtFindText.docLastSearched = prevDoc(docSearch);
  223. if (txtFindText.docLastSearched != null)
  224. {
  225. btnFindClick();
  226. return;
  227. }
  228. else
  229. {
  230. alert(L_FinishedDocument_Text);
  231. return;
  232. }
  233.    }
  234.   }
  235.   else       
  236.   {
  237.    if (nextDoc(docSearch) != docSearch)
  238.    {
  239.     txtFindText.docLastSearched = nextDoc(docSearch);
  240.     btnFindClick();
  241.     return;
  242.    }
  243.   }
  244.  }
  245.  alert(L_FinishedDocument_Text);
  246. }
  247. else      
  248. {
  249.  if (fFrameset)
  250.  {
  251.   txtFindText.docLastFound.execCommand("Unselect", false);
  252.   txtFindText.docLastFound = docSearch;
  253.  }
  254.  rngFoundText.select();
  255.  rngFoundText.scrollIntoView(true);
  256. }
  257. function loadBdy()
  258. {
  259. var docSearch = window.dialogArguments.unsecuredWindowOfDocument.document;
  260. var rng = docSearch.selection.createRange();
  261. btnFind.onclick  = new 
  262.  Function("btnFindClick()");
  263. btnCancel.onclick = new Function("btnCancelClick()");
  264. document.onhelp  = new Function("callHelp(window.event.srcElement)");
  265. document.onmouseup = new Function("mouseClick()");
  266. txtFindText.onkeyup = new Function("setFindState(true)");
  267. txtFindText.onfocus = new Function("txtFindText.select()");
  268. txtFindText.onkeypress = new Function("txtDefaultESC()");
  269. txtFindText.topDoc 
  270.  = window.dialogArguments.unsecuredWindowOfDocument.document;
  271. txtFindText.topIframeDoc 
  272.  = window.dialogArguments.unsecuredWindowOfDocument.document;
  273. txtFindText.docLastSearched = 0; 
  274. txtFindText.docLastFound = txtFindText.topDoc; 
  275. setFindState(false);
  276. </SCRIPT>
  277. </HEAD>
  278. <BODY ID=bdy onLoad="loadBdy()" style="font-family: 'ms sans serif';
  279. font-size: '8pt'; background: threedface;" topmargin=0>
  280. <BUTTON id=btnFind ACCESSKEY=f DISABLED=1 tabIndex=55 helpid=50026
  281. helpfile="iexplore.hlp"
  282. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  283. left: 24.78em; top: 1.0647em; width: 7em; height: 2.1294em; " type=submit>
  284. <U>F</U>ind Next
  285. </BUTTON>
  286. <DIV align=absMiddle
  287. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  288. left: 0.98em; top: 1.2168em; width: 4.8em; height: 1.2168em; ">
  289. <LABEL FOR=txtFindText ID=lblFindText tabIndex=-1 helpid=50027
  290. helpfile="iexplore.hlp">
  291. Fi<U>n</U>d what:
  292. </LABEL>
  293. </DIV>
  294. <INPUT type=text id=txtFindText ACCESSKEY=n tabIndex=15 helpid=50027
  295. helpfile="iexplore.hlp"
  296. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  297. left: 6.16em; top: 1.0647em; width: 17.36em; height: 2.1294em; ">
  298. <BUTTON id=btnCancel tabIndex=60 helpid="0x6F1C" helpfile="windows.hlp"
  299. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  300. left: 24.78em; top: 3.6504em; width: 7em; height: 2.1294em; " type=reset>
  301. Cancel
  302. </BUTTON>
  303. <INPUT id=chkWholeWord ACCESSKEY=w type=checkbox tabIndex=25 
  304. helpfile="iexplore.hlp" helpid=50022
  305. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  306. left: 0.68em; top: 3.8588em; width: 1em; height: 1em; ">
  307. <INPUT ACCESSKEY=c type=checkbox tabIndex=35 helpid=50023
  308. helpfile="iexplore.hlp"
  309. id=chkMatchCase style="font-family: ms sans serif; font-size: 8pt;
  310. position: absolute; left: 0.68em; top: 5.684em; width: 1em;
  311. height: 1em; ">
  312. <DIV
  313. style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  314. left: 2.6em; top: 4.2588em; width: 12.46em; height: 1.521em; ">
  315. <LABEL FOR=chkWholeWord ID=lblWholeWord tabIndex=-1 helpid=50022
  316. helpfile="iexplore.hlp">
  317. Match <U>w</U>hole word only
  318. </LABEL>
  319. </DIV>
  320. <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  321. left: 2.6em; top: 6.084em; width: 7.42em; height: 1.521em; ">
  322. <LABEL FOR=chkMatchCase ID=lblMatchCase tabIndex=-1 helpid=50023
  323. helpfile="iexplore.hlp">
  324. Match <U>c</U>ase
  325. </LABEL>
  326. </DIV>
  327. <FIELDSET id=fldDirection style="font-family: ms sans serif; font-size: 8pt; 
  328. position: absolute; left: 13.7em; top: 3.5em; width: 9.7em; 
  329. height: 4.2em;">
  330. <LEGEND>
  331. Direction
  332. </LEGEND>
  333. </FIELDSET>
  334.  <INPUT id=radDirectionUp type=radio name=radDirection ACCESSKEY=u
  335.  tabIndex=42 helpid=50025 helpfile="iexplore.hlp"
  336.  style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  337.  left: 14.26em; top: 5.1235em; width: 1em; height: 1em; ">
  338.  <DIV style="font-family: ms sans serif; font-size: 8pt;
  339.  position: absolute; left: 16.2em; top: 5.3235em; width: 3.5em;
  340.  height: 1.521em; ">
  341.  <LABEL style="font-family: 'ms sans serif'; font-size: '8pt'"
  342.  FOR=radDirectionUp ID=lblDirectionUp
  343.  tabIndex=45 helpid=50025
  344.  helpfile="iexplore.hlp"> <U>U</U>p </LABEL>
  345.  </DIV>
  346.  <INPUT id=radDirectionDown type=radio CHECKED name=radDirection
  347.  ACCESSKEY=d tabIndex=47 helpid=50024 helpfile="iexplore.hlp"
  348.  style="font-family: ms sans serif; font-size: 8pt; position: absolute;
  349.  left: 18.18em; top: 5.1235em; width: 1em; height: 1em; ">
  350.  <DIV style="font-family: ms sans serif; font-size: 8pt;
  351.  position: absolute; left: 20.1em; top: 5.3235em; width: 4.9em;
  352.  height: 1.521em; ">
  353.  <LABEL style="font-family: 'ms sans serif'; font-size: '8pt'"
  354.  FOR=radDirectionDown helpid=50024 helpfile="iexplore.hlp"
  355.  ID=lblDirectionDown tabIndex=50> <U>D</U>own </LABEL>
  356.  </DIV>
  357. </BODY>
  358. </HTML>
  359.