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.

658 lines
19 KiB

  1. //////////////////////////////////////////////////////////////////////////////////////
  2. // Functions in this file contains handler for error pages
  3. //////////////////////////////////////////////////////////////////////////////////////
  4. function ErrorSkipBtnHandler()
  5. {
  6. if (InActivation_AppMode())
  7. {
  8. window.external.Hangup();
  9. ShowIFrame('False');
  10. window.setTimeout("ExitWPA();",1000);
  11. }
  12. else
  13. {
  14. window.external.Hangup();
  15. PopCKPT();
  16. GoCancel();
  17. }
  18. }
  19. // dial error page
  20. function DialErrorNextBtnHandler()
  21. {
  22. GoToDialingPage();
  23. }
  24. // Connection Interrupt page next button handler
  25. // Cnncterr.htm error page
  26. function CnncterrNextBtnHandler()
  27. {
  28. if (g.Callwait != null)
  29. {
  30. TapiObj.set_CallWaiting = g.Callwait.value;
  31. }
  32. window.external.set_DialAlternative(false);
  33. DialErrorNextBtnHandler();
  34. }
  35. var L_EnterValidPhoneNumber_Text = "Cannot delete entire phone number.";
  36. function CheckPhoneNumer(phoneNumber)
  37. {
  38. if (phoneNumber.length == 0)
  39. {
  40. return false;
  41. }
  42. return true;
  43. }
  44. // Toobusy page next button handler
  45. // Toobusy.htm error page
  46. function ToobusyNextBtnHandler()
  47. {
  48. window.external.set_DialAlternative(true);
  49. if (!(g.DialRuleYes.checked)) {
  50. TapiObj.set_DialOut(g.edtOutsideLine.value);
  51. TapiObj.set_CallWaiting(g.edtCallWaiting.value);
  52. }
  53. if (g.DialTone.checked)
  54. {
  55. TapiObj.set_PhoneSystem(1);
  56. }
  57. else
  58. {
  59. TapiObj.set_PhoneSystem(0);
  60. }
  61. DialErrorNextBtnHandler();
  62. }
  63. var gTooBusyHaveError1 = false;
  64. var gTooBusyHaveError2 = false;
  65. var gTooBusyHaveError3 = false;
  66. var L_altnumber_Text = "<u>D</u>ial this alternate number:";
  67. var L_altnumber01_Text = "* <u>D</u>ial this alternate number:";
  68. var L_outsideline_Text = "Include this number to get an <u>o</u>utside line:";
  69. var L_outsideline01_Text = "* Include this number to get an <u>o</u>utside line:";
  70. var L_callwaiting_Text = "Disable <u>c</u>all waiting:";
  71. var L_callwaiting01_Text = "* Disable <u>c</u>all waiting:";
  72. function NewToobusyNextBtnHandler()
  73. {
  74. gTooBusyHaveError1 = false;
  75. gTooBusyHaveError2 = false;
  76. gTooBusyHaveError3 = false;
  77. g.tberrspan1.style.visibility = "hidden";
  78. g.tberrspan2.style.visibility = "hidden";
  79. g.tberrspan3.style.visibility = "hidden";
  80. if (g.cb_altnumber.checked)
  81. {
  82. g_AltnumberHolder = g.edt_altnumber.value;
  83. window.external.set_DialNumber(g.edt_altnumber.value);
  84. if (g.edt_altnumber.value != "")
  85. {
  86. g.lbl_altnumber.innerHTML = L_altnumber_Text;
  87. g.lbl_altnumber.className = "text-primary";
  88. }
  89. else
  90. {
  91. gTooBusyHaveError1 = true;
  92. g.lbl_altnumber.innerHTML = L_altnumber01_Text;
  93. g.lbl_altnumber.className = "text-error";
  94. }
  95. }
  96. else
  97. {
  98. g_AltnumberHolder = "";
  99. window.external.set_DialAlternative(true);
  100. }
  101. if (g.cb_outsideline.checked)
  102. {
  103. g_OutsidelineHolder = g.edt_outsideline.value;
  104. TapiObj.set_DialOut(g.edt_outsideline.value);
  105. if (g.edt_outsideline.value != "")
  106. {
  107. g.lbl_outsideline.innerHTML = L_outsideline_Text;
  108. g.lbl_outsideline.className = "text-primary";
  109. }
  110. else
  111. {
  112. gTooBusyHaveError2 = true;
  113. g.lbl_outsideline.innerHTML = L_outsideline01_Text;
  114. g.lbl_outsideline.className = "text-error";
  115. }
  116. }
  117. else
  118. {
  119. g_OutsidelineHolder = "";
  120. TapiObj.set_DialOut(g.edt_outsideline.value);
  121. }
  122. if (g.cb_callwaiting.checked)
  123. {
  124. g_CallwaitingHolder = g.edt_callwaiting.value;
  125. TapiObj.set_CallWaiting(g.edt_callwaiting.value);
  126. if (g.edt_callwaiting.value != "")
  127. {
  128. g.lbl_callwaiting.innerHTML = L_callwaiting_Text;
  129. g.lbl_callwaiting.className = "text-primary";
  130. }
  131. else
  132. {
  133. gTooBusyHaveError3 = true;
  134. g.lbl_callwaiting.innerHTML = L_callwaiting01_Text;
  135. g.lbl_callwaiting.className = "text-error";
  136. }
  137. }
  138. else
  139. {
  140. g_CallwaitingHolder = "";
  141. TapiObj.set_CallWaiting(g.edt_callwaiting.value);
  142. }
  143. if (g.DialTone.checked)
  144. {
  145. TapiObj.set_PhoneSystem(1);
  146. }
  147. else
  148. {
  149. TapiObj.set_PhoneSystem(0);
  150. }
  151. if ((gTooBusyHaveError1) || (gTooBusyHaveError2) || (gTooBusyHaveError3))
  152. NewToobusy_LoadMe();
  153. else
  154. DialErrorNextBtnHandler(); // this will call GoToDialingPage();
  155. }
  156. function TelError_TelephoneBtnHandler()
  157. {
  158. // Code review: Do we need to pop the current checkpoint?
  159. PopCKPT();
  160. GoNavigate(CKPT_ACTIVSVC)
  161. }
  162. function Enable_TelBtn_ActMode()
  163. {
  164. if (InActivation_AppMode())
  165. {
  166. // Extract Title
  167. GetPageTitle();
  168. g.btnTelephone.style.display = "inline";
  169. g.btnTelephone.onmouseover = HandleButtonMouseOver;
  170. g.btnTelephone.onmouseout = HandleButtonMouseOut;
  171. g.btnTelephone.onclick = TelError_TelephoneBtnHandler;
  172. // Change "Skip" to "Remind me later".
  173. var L_RemindMeLater_Text = "To continue without performing this task, click <b>Remind me later</b>.";
  174. g.RemindMeLaterText.innerHTML = L_RemindMeLater_Text;
  175. var L_RemindMeLater01_Text = " Re<u>m</u>ind me later ";
  176. var AccesskeyRemind_M = "M";
  177. g.btnSkip.innerHTML = L_RemindMeLater01_Text;
  178. g.btnSkip.accessKey = AccesskeyRemind_M;
  179. }
  180. }
  181. function DefaultErr_LoadMe()
  182. {
  183. InitFrameRef();
  184. if (APP_MSN_MODE == window.external.Directions.get_AppMode())
  185. {
  186. var spanCollection = g.document.body.getElementsByTagName("span");
  187. if (spanCollection != 0)
  188. {
  189. for (var i = 0; i < spanCollection.length; i++)
  190. {
  191. if (spanCollection[i].className == "text-primary-btndesc")
  192. {
  193. var styleObj = spanCollection[i].style;
  194. styleObj.position = "relative";
  195. styleObj.top = "0";
  196. styleObj.left = "0";
  197. }
  198. }
  199. }
  200. }
  201. InitButtons();
  202. try
  203. {
  204. if(g.btnRestore != null)
  205. {
  206. if (InReminderMode())
  207. {
  208. g.btnRestore.onmouseover = HandleButtonMouseOver;
  209. g.btnRestore.onmouseout = HandleButtonMouseOut;
  210. g.btnRestore.className="buttons";
  211. }
  212. else
  213. {
  214. g.btnRestore.onmouseover = HandleNextButtonMouseOver;
  215. g.btnRestore.onmouseout = HandleNextButtonMouseOut;
  216. g.btnRestore.onmousedown = HandleNextButtonMouseDown;
  217. g.btnRestore.className="newbuttonsNext";
  218. }
  219. }
  220. } catch (e) {}
  221. Enable_TelBtn_ActMode();
  222. g.btnNext.focus();
  223. window.external.set_DialAlternative(false);
  224. g.btnNext.onclick = DialErrorNextBtnHandler;
  225. g.btnSkip.onclick = ErrorSkipBtnHandler;
  226. }
  227. function Cnncterr_LoadMe()
  228. {
  229. DefaultErr_LoadMe();
  230. g.btnNext.onclick = CnncterrNextBtnHandler;
  231. if (g.Callwait != null)
  232. g.Callwait.value = TapiObj.get_CallWaiting;
  233. }
  234. var g_AltnumberHolder = null;
  235. var g_OutsidelineHolder = null;
  236. var g_CallwaitingHolder = null;
  237. function Toobusy_LoadMe()
  238. {
  239. DefaultErr_LoadMe();
  240. g.spanDisplayNumber.innerText = window.external.get_DialNumber;
  241. g.edtOutsideLine.value = TapiObj.get_DialOut;
  242. g.edtCallWaiting.value = TapiObj.get_CallWaiting;
  243. if (1 == TapiObj.get_PhoneSystem)
  244. {
  245. g.DialTone.checked = true;
  246. }
  247. else
  248. {
  249. g.DialPulse.checked = true;
  250. }
  251. g.btnNext.onclick = ToobusyNextBtnHandler;
  252. SelectDialRule();
  253. }
  254. function NewToobusy_LoadMe()
  255. {
  256. DefaultErr_LoadMe();
  257. // Do some dynamic text stuff here
  258. var L_tbstr1_Text = "Setup cannot connect to this number to activate and register your computer.";
  259. var L_tbstr2_Text = "Setup cannot connect to this number to activate your computer.";
  260. var L_tbstr3_Text = "Setup cannot connect to this number to register your computer.";
  261. var L_tbstr4_Text = "To continue without activating and registering your computer, click <b>Skip</b>.";
  262. var L_tbstr5_Text = "To continue without activating your computer, click <b>Skip</b>.";
  263. var L_tbstr6_Text = "To continue without registering your computer, click <b>Skip</b>.";
  264. if (g_DoActivation)
  265. {
  266. if ((g_PostToMS) || (g_PostToOEM))
  267. {
  268. g.tbpar1.innerHTML = L_tbstr1_Text;
  269. g.tbpar2.innerHTML = L_tbstr4_Text;
  270. }
  271. else
  272. {
  273. g.tbpar1.innerHTML = L_tbstr2_Text;
  274. g.tbpar2.innerHTML = L_tbstr5_Text;
  275. }
  276. }
  277. else
  278. {
  279. g.tbpar1.innerHTML = L_tbstr3_Text;
  280. g.tbpar2.innerHTML = L_tbstr6_Text;
  281. }
  282. // End of dynamic text stuff
  283. var fLoadPhoneNumber = window.external.get_DialNumber;
  284. g.spanDisplayNumber.innerHTML = "&nbsp;&nbsp;<B>" + fLoadPhoneNumber + "</B>";
  285. if (gTooBusyHaveError1)
  286. g.tberrspan1.style.visibility = "visible";
  287. if (gTooBusyHaveError2)
  288. g.tberrspan2.style.visibility = "visible";
  289. if (gTooBusyHaveError3)
  290. g.tberrspan3.style.visibility = "visible";
  291. if (((g_AltnumberHolder == null) || (g_AltnumberHolder == "")) && (!gTooBusyHaveError1))
  292. {
  293. g_AltnumberHolder = "";
  294. g.edt_altnumber.value = "";
  295. g.edt_altnumber.style.backgroundColor = "#dddddd";
  296. g.edt_altnumber.style.disabled = true;
  297. g.cb_altnumber.checked = false;
  298. }
  299. else
  300. {
  301. g.edt_altnumber.disabled = false;
  302. g.edt_altnumber.value = g_AltnumberHolder;
  303. g.edt_altnumber.style.backgroundColor = "#ffffff";
  304. g.cb_altnumber.checked = true;
  305. }
  306. if (!gTooBusyHaveError2)
  307. g_OutsidelineHolder = TapiObj.get_DialOut;
  308. if (((g_OutsidelineHolder == null) || (g_OutsidelineHolder == "")) && (!gTooBusyHaveError2))
  309. {
  310. g_OutsidelineHolder = "";
  311. g.edt_outsideline.value = "";
  312. g.edt_outsideline.style.backgroundColor = "#dddddd";
  313. g.edt_outsideline.disabled = true;
  314. g.cb_outsideline.checked = false;
  315. }
  316. else
  317. {
  318. g.edt_outsideline.disabled = false;
  319. g.edt_outsideline.value = g_OutsidelineHolder;
  320. g.edt_outsideline.style.backgroundColor = "#ffffff";
  321. g.cb_outsideline.checked = true;
  322. }
  323. if (!gTooBusyHaveError3)
  324. g_CallwaitingHolder = TapiObj.get_CallWaiting;
  325. if (((g_CallwaitingHolder == null) || (g_CallwaitingHolder == "")) && (!gTooBusyHaveError3))
  326. {
  327. g_CallwaitingHolder = "";
  328. g.edt_callwaiting.value = "";
  329. g.edt_callwaiting.style.backgroundColor = "#dddddd";
  330. g.edt_callwaiting.disabled = true;
  331. g.cb_callwaiting.checked = false;
  332. }
  333. else
  334. {
  335. g.edt_callwaiting.disabled = false;
  336. g.edt_callwaiting.value = g_CallwaitingHolder;
  337. g.edt_callwaiting.style.backgroundColor = "#ffffff";
  338. g.cb_callwaiting.checked = true;
  339. }
  340. if (1 == TapiObj.get_PhoneSystem)
  341. {
  342. g.DialTone.checked = true;
  343. }
  344. else
  345. {
  346. g.DialPulse.checked = true;
  347. }
  348. g.btnNext.onclick = NewToobusyNextBtnHandler;
  349. }
  350. function Check_cb_altnumber()
  351. {
  352. if (g.cb_altnumber.checked == true)
  353. {
  354. g.edt_altnumber.style.backgroundColor = "#ffffff";
  355. g.edt_altnumber.disabled = false;
  356. g.edt_altnumber.value = g_AltnumberHolder;
  357. g.edt_altnumber.focus();
  358. }
  359. else
  360. {
  361. g_AltnumberHolder = g.edt_altnumber.value;
  362. g.edt_altnumber.value = "";
  363. g.edt_altnumber.style.backgroundColor = "#dddddd";
  364. g.edt_altnumber.disabled = true;
  365. g.lbl_altnumber.innerHTML = L_altnumber_Text;
  366. g.lbl_altnumber.className = "text-primary";
  367. }
  368. }
  369. function Check_cb_outsideline()
  370. {
  371. if (g.cb_outsideline.checked == true)
  372. {
  373. g.edt_outsideline.style.backgroundColor = "#ffffff";
  374. g.edt_outsideline.disabled = false;
  375. g.edt_outsideline.value = g_OutsidelineHolder;
  376. g.edt_outsideline.focus();
  377. }
  378. else
  379. {
  380. g_OutsidelineHolder = g.edt_outsideline.value;
  381. g.edt_outsideline.value = "";
  382. g.edt_outsideline.style.backgroundColor = "#dddddd";
  383. g.edt_outsideline.disabled = true;
  384. g.lbl_outsideline.innerHTML = L_outsideline_Text;
  385. g.lbl_outsideline.className = "text-primary";
  386. }
  387. }
  388. function Check_cb_callwaiting()
  389. {
  390. if (g.cb_callwaiting.checked == true)
  391. {
  392. g.edt_callwaiting.style.backgroundColor = "#ffffff";
  393. g.edt_callwaiting.disabled = false;
  394. g.edt_callwaiting.value = g_CallwaitingHolder;
  395. g.edt_callwaiting.focus();
  396. }
  397. else
  398. {
  399. g_CallwaitingHolder = g.edt_callwaiting.value;
  400. g.edt_callwaiting.value = "";
  401. g.edt_callwaiting.style.backgroundColor = "#dddddd";
  402. g.edt_callwaiting.disabled = true;
  403. g.lbl_callwaiting.innerHTML = L_callwaiting_Text;
  404. g.lbl_callwaiting.className = "text-primary";
  405. }
  406. }
  407. function SelectDialRule()
  408. {
  409. if (g.DialRuleYes.checked)
  410. {
  411. if (g.edtPhoneNumber)
  412. g.edtPhoneNumber.disabled=false;
  413. g.edtOutsideLine.disabled=true;
  414. g.edtCallWaiting.disabled=true;
  415. }
  416. else
  417. {
  418. if (g.edtPhoneNumber)
  419. g.edtPhoneNumber.disabled=true;
  420. g.edtOutsideLine.disabled=false;
  421. g.edtCallWaiting.disabled=false;
  422. }
  423. }
  424. function RestoreDialRule()
  425. {
  426. g.spanDisplayNumber.innerText = window.external.get_DialNumber;
  427. if (g.edtPhoneNumber)
  428. g.edtPhoneNumber.value = window.external.get_PhBkNumber;
  429. g.edtOutsideLine.value = TapiObj.get_DialOut;
  430. g.edtCallWaiting.value = TapiObj.get_CallWaiting;
  431. if (1 == TapiObj.get_PhoneSystem)
  432. {
  433. g.DialTone.checked = true;
  434. }
  435. else
  436. {
  437. g.DialPulse.checked = true;
  438. }
  439. }
  440. // ins error page
  441. function ISPInsError_NextBtnHandler()
  442. {
  443. PopCKPT();
  444. GoNavigate(CKPT_OEMCUST);
  445. }
  446. function ISPInsError_LoadMe()
  447. {
  448. DefaultErr_LoadMe();
  449. g.ins_ISPName1.innerText = window.external.get_ISPName;
  450. g.ins_ISPName2.innerText = window.external.get_ISPName;
  451. g.btnNext.onclick = ISPInsError_NextBtnHandler;
  452. }
  453. // noanswer page next button handler
  454. // noanswer.htm error page
  455. function NoAnswNextBtnHandler()
  456. {
  457. if (g.DialTone.checked)
  458. {
  459. TapiObj.set_PhoneSystem(1);
  460. }
  461. else
  462. {
  463. TapiObj.set_PhoneSystem(0);
  464. }
  465. if (g.DialRuleYes.checked) {
  466. if (CheckPhoneNumer(g.edtPhoneNumber.value))
  467. {
  468. window.external.set_DialNumber(g.edtPhoneNumber.value);
  469. DialErrorNextBtnHandler();
  470. }
  471. else
  472. {
  473. g.edtPhoneNumber.value = window.external.get_DialNumber;
  474. g.error_mesg.innerHTML = L_EnterValidPhoneNumber_Text;
  475. g.error_mesg.style.display="inline";
  476. }
  477. }
  478. else
  479. {
  480. TapiObj.set_DialOut(g.edtOutsideLine.value);
  481. TapiObj.set_CallWaiting(g.edtCallWaiting.value);
  482. window.external.set_DialAlternative(false);
  483. DialErrorNextBtnHandler();
  484. }
  485. }
  486. function NoAnsw_LoadMe()
  487. {
  488. DefaultErr_LoadMe();
  489. g.spanDisplayNumber.innerText = window.external.get_DialNumber;
  490. g.edtPhoneNumber.value = g.spanDisplayNumber.innerText;
  491. g.edtOutsideLine.value = TapiObj.get_DialOut;
  492. g.edtCallWaiting.value = TapiObj.get_CallWaiting;
  493. if (1 == TapiObj.get_PhoneSystem)
  494. {
  495. g.DialTone.checked = true;
  496. }
  497. else
  498. {
  499. g.DialPulse.checked = true;
  500. }
  501. g.btnNext.onclick = NoAnswNextBtnHandler;
  502. SelectDialRule();
  503. }
  504. // noanswer page next button handler
  505. // noanswer.htm error page
  506. function NoModemBtnHandler()
  507. {
  508. window.external.Finish();
  509. }
  510. function NoModem_LoadMe()
  511. {
  512. DefaultErr_LoadMe();
  513. g.btnNext.onclick = NoModemBtnHandler;
  514. }
  515. function Pulse_LoadMe()
  516. {
  517. DefaultErr_LoadMe();
  518. if (1 == TapiObj.set_PhoneSystem)
  519. g.tone.checked = true;
  520. else
  521. g.pulse.checked = true;
  522. }
  523. function DesktopPbErr_LoadMe()
  524. {
  525. InitFrameRef();
  526. if (InActivation_AppMode())
  527. {
  528. GetPageTitle();
  529. }
  530. InitButtons();
  531. var L_DeskpbErrOEMName_Text = g_OEMNameStr;
  532. if (L_DeskpbErrOEMName_Text == "")
  533. {
  534. L_DeskpbErrOEMName_Text = L_MissingOEMName_Text;
  535. }
  536. var L_DeskMainPBerrMsg_Text = "";
  537. if (g_DoActivation)
  538. {
  539. if ((g_PostToMS) && (g_PostToOEM))
  540. {
  541. L_DeskMainPBerrMsg_Text = "Online registration and activation are currently unavailable in your country or region. To register your computer without an Internet connection, please contact %1. You can activate your copy of Windows using an Internet connection or by contacting Microsoft over the telephone.";
  542. g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text);
  543. }
  544. else if ((g_PostToMS) && (!g_PostToOEM))
  545. {
  546. g.Title_Text.innerText = "Unable to activate and register online";
  547. GetPageTitle();
  548. L_DeskMainPBerrMsg_Text = "Online registration and activation are currently unavailable in your country or region. You can activate your copy of Windows using an Internet connection or by contacting Microsoft by telephone. An Internet connection is needed to register your copy of Windows with Microsoft.";
  549. g.Desktoppberr_par1.innerText = L_DeskMainPBerrMsg_Text;
  550. }
  551. else if ((!g_PostToMS) && (g_PostToOEM))
  552. {
  553. L_DeskMainPBerrMsg_Text = "Online activation is currently unavailable in your country or region. You can activate your copy of Windows using an Internet connection or by contacting Microsoft by telephone. To register your computer without an Internet connection, please contact %1.";
  554. g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text);
  555. }
  556. else
  557. {
  558. g.Title_Text.innerText = "Unable to activate online";
  559. GetPageTitle();
  560. // If we're here, it means g_PostToMS=flase and g_PostToOEM=false.
  561. L_DeskMainPBerrMsg_Text = "Online activation is currently unavailable in your country or region. You can activate your copy of Windows using an Internet connection or by contacting Microsoft over the telephone.";
  562. g.Desktoppberr_par1.innerText = L_DeskMainPBerrMsg_Text;
  563. }
  564. }
  565. else
  566. {
  567. if ((!g_PostToMS) && (g_PostToOEM))
  568. {
  569. g.Title_Text.innerText = "Unable to register online";
  570. GetPageTitle();
  571. L_DeskMainPBerrMsg_Text = "Online registration is currently unavailable in your country or region. To register your computer without an Internet connection, please contact %1.";
  572. g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text);
  573. }
  574. }
  575. g.btnBack.focus();
  576. g.btnBack.onclick = window.parent.SimpleNavBack;
  577. }