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.

587 lines
16 KiB

  1. #ifndef UNIX
  2. <HTML id=dlgError STYLE="font-family:ms sans serif; font-size:8pt; width:41.0025em; height:13.7em;">
  3. #else
  4. <HTML id=dlgError STYLE="font-family:ms sans serif; font-size:8pt; width:43.0025em; height:14.7em;">
  5. #endif
  6. <HEAD>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  8. <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
  9. <TITLE id=dialogTitle>
  10. Internet Explorer
  11. </TITLE>
  12. <style type="text/css">
  13. p,td,input,button { font:8pt MS Shell Dlg; cursor:default}
  14. body { font:8pt MS Shell Dlg; color: windowtext;
  15. background:menu;}
  16. </style>
  17. <SCRIPT LANGUAGE="JavaScript" defer>
  18. window.onerror = HandleError
  19. document.ondragstart = NoDragging
  20. function NoDragging()
  21. {
  22. window.event.returnValue = false;
  23. }
  24. var g_errList;
  25. var g_detailsPaneOpen;
  26. //+-------------------------------------------------------------------
  27. //
  28. // Synopsis: Turns off error messages in dialogs
  29. //
  30. // Arguments: none
  31. //
  32. // returns: true (tells browser not to handle message)
  33. //
  34. //--------------------------------------------------------------------
  35. function HandleError(message, url, line)
  36. {
  37. var L_Dialog_ErrorMessage = "An error has occurred in this dialog.";
  38. var L_ErrorNumber_Text = "Error: ";
  39. var str = L_Dialog_ErrorMessage + "\n\n"
  40. + L_ErrorNumber_Text + line + "\n"
  41. + message;
  42. alert (str);
  43. window.close();
  44. return true;
  45. }
  46. //+----------------------------------------------------------------------
  47. //
  48. // Synopsis: Binds events to controls and do some last minute
  49. // dialog formatting
  50. //
  51. // Arguments: none.
  52. //
  53. // Returns: nothing.
  54. //
  55. //-----------------------------------------------------------------------
  56. function updateTabIndices()
  57. {
  58. if (g_detailsPaneOpen)
  59. {
  60. var nextIndex = 3;
  61. if (!btnPrevErr.disabled)
  62. {
  63. btnPrevErr.tabindex = nextIndex++;
  64. }
  65. if (!btnNextErr.disabled)
  66. {
  67. btnNextErr.tabindex = nextIndex++;
  68. }
  69. chkAlwaysShowErrs.tabindex = nextIndex;
  70. }
  71. else
  72. {
  73. btnPrevErr.tabindex = -1;
  74. btnNextErr.tabindex = -1;
  75. chkAlwaysShowErrs.tabindex = 3;
  76. }
  77. }
  78. function loadBdy()
  79. {
  80. g_errList = window.dialogArguments;
  81. chkAlwaysShowErrs.checked = g_errList.getPerErrorDisplay();
  82. // if the key didn't exist we got a default. if we took a
  83. // default, it needs to become a real setting (non-default)
  84. // because the nonexistence of the key indicates to us that
  85. // we need to display the dialog but default to having
  86. // "never show me again" checked. obviously we only want
  87. // this behavioral exception to happen once. to make it
  88. // become a non-default value, just write it out...
  89. g_errList.setPerErrorDisplay(chkAlwaysShowErrs.checked);
  90. // if the IEAK has locked the advanced options settings,
  91. // then disable the checkbox so that people can't change
  92. // the "Always present script error notifications" setting
  93. // via the checkbox
  94. chkAlwaysShowErrs.disabled = g_errList.getAlwaysShowLockState();
  95. //
  96. // set the details pane to be open or closed
  97. // the easiest way to make sure all controls
  98. // are set to their proper state is to just
  99. // call the click function
  100. //
  101. g_detailsPaneOpen = g_errList.getDetailsPaneOpen();
  102. assureControlState();
  103. //
  104. // Bind event to controls
  105. //
  106. btnOK.onclick = new Function("btnOKClick()");
  107. btnOK.onkeydown = new Function("SwitchFocus()");
  108. btnDetails.onclick = new Function("btnDetailsClick()");
  109. btnDetails.onkeydown = new Function("SwitchFocus()");
  110. btnNextErr.onclick = new Function("btnNextErrClick()");
  111. btnNextErr.onkeydown = new Function("SwitchFocus()");
  112. btnPrevErr.onclick = new Function("btnPrevErrClick()");
  113. btnPrevErr.onkeydown = new Function("SwitchFocus()");
  114. //
  115. // Fill the dialog with error information
  116. //
  117. updateErrorInfo();
  118. //
  119. // set prev and next button's disabled state
  120. //
  121. if (!g_errList.canRetreatError())
  122. {
  123. btnPrevErr.disabled = true;
  124. }
  125. if (!g_errList.canAdvanceError())
  126. {
  127. btnNextErr.disabled = true;
  128. }
  129. btnOK.focus();
  130. } // loadBdy
  131. //+-----------------------------------------------------------------------
  132. //
  133. // Sysopsis: sets all the error specific controls to be in sync with
  134. // the current error index
  135. //
  136. // Arguments: none
  137. //
  138. // Returns: nothing
  139. //
  140. //------------------------------------------------------------------------
  141. function updateErrorInfo()
  142. {
  143. spnLine.innerText = g_errList.getErrorLine();
  144. spnCharacter.innerText = g_errList.getErrorChar();
  145. spnCode.innerText = g_errList.getErrorCode();
  146. divError.innerText = g_errList.getErrorMsg();
  147. divURL.innerText = g_errList.getErrorUrl();
  148. }
  149. //+-----------------------------------------------------------------------
  150. //
  151. // Synopsis: Handles keyboard-related shifting of focus among the
  152. // varioud dialog controls.
  153. //
  154. // Notes: We're trying to pretend to be just like a normal dialog.
  155. // Therefore, we need tab groups within which up/left
  156. // shifts focus in the shift-tab diection, and right/down
  157. // shifts focus in the tab direction. And we need a global
  158. // tab order for tab and shift-tab to follow.
  159. //
  160. // Arguments: none
  161. //
  162. // Returns: nothing
  163. //
  164. //------------------------------------------------------------------------
  165. function SwitchFocus()
  166. {
  167. var HTML_KEY_ARROWLEFT = 37;
  168. var HTML_KEY_ARROWUP = 38;
  169. var HTML_KEY_ARROWRIGHT = 39;
  170. var HTML_KEY_ARROWDOWN = 40;
  171. var iCode = event.keyCode;
  172. var strSourceID = event.srcElement.id;
  173. var fTabForward;
  174. if (iCode < HTML_KEY_ARROWLEFT || iCode > HTML_KEY_ARROWDOWN)
  175. {
  176. return;
  177. }
  178. var fTabForward = iCode == HTML_KEY_ARROWRIGHT ||
  179. iCode == HTML_KEY_ARROWDOWN;
  180. if (g_detailsPaneOpen)
  181. {
  182. // arrow keys move back and forth between:
  183. // 1) ok - details
  184. // 2) previous - next
  185. if (fTabForward)
  186. {
  187. if (strSourceID == "btnPrevErr")
  188. {
  189. if (!btnNextErr.disabled)
  190. {
  191. btnNextErr.focus();
  192. }
  193. }
  194. else if (strSourceID == "btnOK")
  195. {
  196. btnDetails.focus();
  197. }
  198. else if (strSourceID == "chkAlwaysShowErrs")
  199. {
  200. btnOK.focus();
  201. }
  202. }
  203. else
  204. {
  205. if (strSourceID == "btnNextErr")
  206. {
  207. if (!btnPrevErr.disabled)
  208. {
  209. btnPrevErr.focus();
  210. }
  211. }
  212. else if (strSourceID == "btnDetails")
  213. {
  214. btnOK.focus();
  215. }
  216. else if (strSourceID == "btnOK")
  217. {
  218. chkAlwaysShowErrs.focus();
  219. }
  220. }
  221. }
  222. }
  223. //+-------------------------------------------------------------------
  224. //
  225. // Synopsis: Closes the dialog
  226. //
  227. // Arguments: none
  228. //
  229. // Returns: nothing
  230. //
  231. //---------------------------------------------------------------------
  232. function btnOKClick()
  233. {
  234. g_errList.setPerErrorDisplay(chkAlwaysShowErrs.checked);
  235. g_errList.setDetailsPaneOpen(g_detailsPaneOpen);
  236. window.close();
  237. }
  238. //+-------------------------------------------------------------------
  239. //
  240. // Synopsis: make sure things which are affected by the state
  241. // of the details pane are in sync with the current
  242. // state of the details pane
  243. //
  244. // Arguments: none
  245. //
  246. // Returns: nothing
  247. //
  248. //--------------------------------------------------------------------
  249. function assureControlState()
  250. {
  251. #ifndef UNIX
  252. var L_DetailsExpand_Text = "Show <u>D</u>etails &gt&gt";
  253. var L_DetailsCollapse_Text = "Hide <u>D</u>etails &lt&lt";
  254. #else
  255. var L_DetailsExpand_Text = "Show <u>D</u>etails";
  256. var L_DetailsCollapse_Text = "Hide <u>D</u>etails";
  257. #endif
  258. if (g_detailsPaneOpen)
  259. {
  260. // update the button text
  261. btnDetails.innerHTML = L_DetailsCollapse_Text;
  262. // enlarge the window to show the error info
  263. window.dialogHeight = 27.2;
  264. // assure details info is visible
  265. divDetails.style.display = "";
  266. divButtons2.style.display = "";
  267. trHR.style.display = "";
  268. }
  269. else
  270. {
  271. // update the button text
  272. btnDetails.innerHTML = L_DetailsExpand_Text;
  273. // assure details info is hidden
  274. divDetails.style.display = "none";
  275. divButtons2.style.display = "none";
  276. trHR.style.display = "none";
  277. // shrink the window to hide the error info
  278. window.dialogHeight = 13.7;
  279. }
  280. }
  281. //+-------------------------------------------------------------------
  282. //
  283. // Synopsis: provides user with details about accumulated script
  284. // errors
  285. //
  286. // Arguments: none
  287. //
  288. // Returns: nothing
  289. //
  290. //--------------------------------------------------------------------
  291. function btnDetailsClick()
  292. {
  293. g_detailsPaneOpen = !g_detailsPaneOpen;
  294. assureControlState();
  295. if (g_detailsPaneOpen)
  296. {
  297. // give focus to the "next" button if possible,
  298. // otherwise try "previous", finally "ok"
  299. if (!btnNextErr.disabled)
  300. {
  301. btnNextErr.focus();
  302. }
  303. else if (!btnPrevErr.disabled)
  304. {
  305. btnPrevErr.focus();
  306. }
  307. else
  308. {
  309. btnOK.focus();
  310. }
  311. }
  312. else
  313. {
  314. // give focus to the "details" button
  315. btnDetails.focus();
  316. }
  317. updateTabIndices();
  318. }
  319. //+-------------------------------------------------------------------
  320. //
  321. // Synopsis: updates error info to correspond to the next error
  322. //
  323. // Arguments: none
  324. //
  325. // Returns: nothing
  326. //
  327. //--------------------------------------------------------------------
  328. function btnNextErrClick()
  329. {
  330. g_errList.advanceError();
  331. updateErrorInfo();
  332. if (btnPrevErr.disabled)
  333. {
  334. // no longer at beginning of error list
  335. btnPrevErr.disabled = false;
  336. }
  337. if (!g_errList.canAdvanceError())
  338. {
  339. // at end of error list
  340. btnNextErr.disabled = true;
  341. btnPrevErr.focus();
  342. }
  343. updateTabIndices();
  344. }
  345. function btnPrevErrClick()
  346. {
  347. g_errList.retreatError();
  348. updateErrorInfo();
  349. if (btnNextErr.disabled)
  350. {
  351. // no longer at end of error list
  352. btnNextErr.disabled = false;
  353. }
  354. if (!g_errList.canRetreatError())
  355. {
  356. // at beginning of error list
  357. btnPrevErr.disabled = true;
  358. btnNextErr.focus();
  359. }
  360. updateTabIndices();
  361. }
  362. function BodyOnKeyPress(nCode)
  363. {
  364. if (nCode == 27) //ESC
  365. {
  366. window.close();
  367. return;
  368. }
  369. }
  370. </SCRIPT>
  371. </HEAD>
  372. <BODY ID=bdy style="background: threedface" onLoad=loadBdy() onkeydown=BodyOnKeyPress(event.keyCode) onkeypress=BodyOnKeyPress(event.keyCode) topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>
  373. <table id=tblMain tabindex=-1 cellspacing=0 border=0 style="background:buttonface; border-collapse:collapse; width:26.1em;">
  374. <TR>
  375. <!-- Icon image -->
  376. <TD id=tdIcon valign=top style="padding-left:0.9625em; padding-top:0.9295em; padding-right:0.385em;">
  377. <img id=imgIcon src=warning.gif>
  378. </TD>
  379. <TD style="padding-top:0.5577em;">
  380. <!-- Inner table start -->
  381. <table tabindex=-1 cellspacing=0 border=0 style="background:buttonface; border-collapse:collapse">
  382. <!-- Error message dialog -->
  383. <TR>
  384. <TD id=tdMsg style="padding-left:0.48125em; padding-right:0em">
  385. Problems with this Web page might prevent it from being
  386. displayed properly or functioning properly. In the
  387. future, you can display this message by double-clicking
  388. the warning icon displayed in the status bar.
  389. </TD>
  390. </TR>
  391. <!-- Checkbox -->
  392. <TR>
  393. <TD style="padding-top:0.46475em;">
  394. <input id=chkAlwaysShowErrs tabindex=5 accesskey=a type=checkbox>
  395. <label for=chkAlwaysShowErrs id=labelChk>
  396. <u>A</u>lways display this message when a page contains errors.
  397. </label>
  398. </TD>
  399. </TR>
  400. <!-- OK button -->
  401. <TR>
  402. <TD id=Buttons align=right style="padding-top:1.20835em;">
  403. <table id=tblMain tabindex=-1 cellspacing=0 border=0 style="background:buttonface; border-collapse:collapse;">
  404. <tr>
  405. <td style="padding-right:0.385em; padding-left:0em">
  406. <button id=btnOK tabindex=1
  407. style="width:8em; height:2.2em;"
  408. type=submit>
  409. OK
  410. </button>
  411. </td>
  412. <td>
  413. <button id=btnDetails tabindex=2
  414. style="width:8em; height:2.2em;"
  415. accesskey=d>
  416. Show <u>D</u>etails &gt&gt
  417. </button>
  418. </td>
  419. </tr>
  420. </table>
  421. </TD>
  422. </TR>
  423. </TABLE>
  424. <!-- Inner table end -->
  425. </TD>
  426. </TR>
  427. <!-- HR -->
  428. <TR id=trHR style="display:none;">
  429. <TD colspan=2 style="padding-left:1.155em; padding-top:0.09295em; padding-right:0.28875em;">
  430. <hr>
  431. </TD>
  432. </TR>
  433. </TABLE>
  434. #ifndef UNIX
  435. <DIV id=divDetails tabindex=-1 style="border:inset; overflow:auto; position:absolute; background:threedface; font-family:ms sans serif;
  436. font-size:8pt; top:12.4553em; width:37.9225em; height:8.1796em; margin-left:1.155em; margin-right: 0em; display:none">
  437. #else
  438. <DIV id=divDetails tabindex=-1 style="border:inset; overflow:auto; position:absolute; background:threedface; font-family:ms sans serif; font-size:8pt; top:14.4553em; width:40.9225em; height:9.1796em; margin-left:1.155em; margin-right:0em">
  439. #endif
  440. <TABLE id=tbl2 tabindex=-1 cellspacing=0 border=0 style="border-collapse:collapse; background:buttonface; font-family:ms sans serif;
  441. font-size:8pt;">
  442. <TBODY>
  443. <TR valign=top>
  444. <TD id=tdLine nowrap style="padding-top:0.3718em; padding-left:0.48125em; padding-right:0em">
  445. Line:
  446. </TD>
  447. <TD id=tdSpanLine style="padding-top:0.46475em;">
  448. <SPAN id=spnLine></SPAN>
  449. </TD>
  450. </TR>
  451. <TR valign=top>
  452. <TD id=tdChar nowrap style="padding-left:0.48125em; padding-right:0em">
  453. Char:
  454. </TD>
  455. <TD id=tdSpanCharacter>
  456. <SPAN id=spnCharacter></SPAN>
  457. </TD>
  458. </TR>
  459. <TR valign=top>
  460. <TD id=tdError nowrap style="padding-left:0.48125em; padding-right:0em">
  461. Error:
  462. </TD>
  463. <TD id=tdSpanError>
  464. <DIV id=divError tabindex=-1 style="background: threedface;
  465. font-family: ms sans serif; font-size:8pt; width:32.1475em;"></DIV>
  466. </TD>
  467. </TR>
  468. <TR valign=top>
  469. <TD id=tdCode nowrap style="padding-left:0.48125em; padding-right:0em">
  470. Code:
  471. </TD>
  472. <TD id=tdSpanCode>
  473. <SPAN id=spnCode></SPAN>
  474. </TD>
  475. </TR>
  476. <TR valign=top>
  477. <TD id=tdURL nowrap style="padding-left:0.48125em; padding-right:0em; padding-bottom:0.09295em;">
  478. URL:
  479. </TD>
  480. <TD id=tdSpanURL>
  481. <DIV id=divURL tabindex=-1 style="background:threedface; font-family:ms sans serif; font-size:8pt; width:32.1475em;"></DIV>
  482. </TEXTAREA>
  483. </TD>
  484. </TR>
  485. </TBODY>
  486. </TABLE>
  487. </DIV>
  488. #ifndef UNIX
  489. <DIV id=divButtons2 tabindex=-1 align=right style="background:buttonface; position:absolute; font-family:ms sans serif; font-size:8pt; top:21.1926em;
  490. width:38.01875em; margin-left:1.155em; margin-right:0em; display:none">
  491. #else
  492. <DIV id=divButtons2 tabindex=-1 align=right style="background:buttonface; position:absolute; font-family:ms sans serif; font-size:8pt; top:24.1926em; width:41.01875em; margin-left:1.155em; margin-right:0em">
  493. #endif
  494. <table id=tblMain tabindex=-1 cellspacing=0 border=0 style="background:buttonface; border-collapse:collapse;">
  495. <tr>
  496. <td style="padding-right:0.385em; padding-left:0em">
  497. <button id=btnPrevErr tabindex=3 type=reset accesskey=p
  498. style="font-family: ms sans serif; font-size:8pt; width:8em; height:2.2em;">
  499. <u>P</u>revious
  500. </button>
  501. </td>
  502. <td>
  503. <button id=btnNextErr tabindex=4 type=reset accesskey=n
  504. style="font-family: ms sans serif; font-size:8pt; width:8em; height:2.2em;">
  505. <u>N</u>ext
  506. </button>
  507. </td>
  508. </tr>
  509. </table>
  510. </DIV>
  511. </BODY>
  512. </HTML>