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.

667 lines
20 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 L_AccesskeyRemindM_Text = "M";
  177. g.btnSkip.innerHTML = L_RemindMeLater01_Text;
  178. g.btnSkip.accessKey = L_AccesskeyRemindM_Text;
  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. if (InActivation_AppMode())
  223. {
  224. g_FirstFocusElement = g.btnNext;
  225. window.setTimeout("DoFocus();",1000);
  226. }
  227. else
  228. {
  229. g.btnNext.focus();
  230. }
  231. window.external.set_DialAlternative(false);
  232. g.btnNext.onclick = DialErrorNextBtnHandler;
  233. g.btnSkip.onclick = ErrorSkipBtnHandler;
  234. }
  235. function Cnncterr_LoadMe()
  236. {
  237. DefaultErr_LoadMe();
  238. g.btnNext.onclick = CnncterrNextBtnHandler;
  239. if (g.Callwait != null)
  240. g.Callwait.value = TapiObj.get_CallWaiting;
  241. }
  242. var g_AltnumberHolder = null;
  243. var g_OutsidelineHolder = null;
  244. var g_CallwaitingHolder = null;
  245. function Toobusy_LoadMe()
  246. {
  247. DefaultErr_LoadMe();
  248. g.spanDisplayNumber.innerText = window.external.get_DialNumber;
  249. g.edtOutsideLine.value = TapiObj.get_DialOut;
  250. g.edtCallWaiting.value = TapiObj.get_CallWaiting;
  251. if (1 == TapiObj.get_PhoneSystem)
  252. {
  253. g.DialTone.checked = true;
  254. }
  255. else
  256. {
  257. g.DialPulse.checked = true;
  258. }
  259. g.btnNext.onclick = ToobusyNextBtnHandler;
  260. SelectDialRule();
  261. }
  262. function NewToobusy_LoadMe()
  263. {
  264. DefaultErr_LoadMe();
  265. // Do some dynamic text stuff here
  266. var L_tbstr1_Text = "Setup cannot connect to this number to activate and register your computer.";
  267. var L_tbstr2_Text = "Setup cannot connect to this number to activate your computer.";
  268. var L_tbstr3_Text = "Setup cannot connect to this number to register your computer.";
  269. var L_tbstr4_Text = "To continue without activating and registering your computer, click <b>Skip</b>.";
  270. var L_tbstr5_Text = "To continue without activating your computer, click <b>Skip</b>.";
  271. var L_tbstr6_Text = "To continue without registering your computer, click <b>Skip</b>.";
  272. if (g_DoActivation)
  273. {
  274. if ((g_PostToMS) || (g_PostToOEM))
  275. {
  276. g.tbpar1.innerHTML = L_tbstr1_Text;
  277. g.tbpar2.innerHTML = L_tbstr4_Text;
  278. }
  279. else
  280. {
  281. g.tbpar1.innerHTML = L_tbstr2_Text;
  282. g.tbpar2.innerHTML = L_tbstr5_Text;
  283. }
  284. }
  285. else
  286. {
  287. g.tbpar1.innerHTML = L_tbstr3_Text;
  288. g.tbpar2.innerHTML = L_tbstr6_Text;
  289. }
  290. // End of dynamic text stuff
  291. var fLoadPhoneNumber = window.external.get_DialNumber;
  292. g.spanDisplayNumber.innerHTML = "&nbsp;&nbsp;<B>" + fLoadPhoneNumber + "</B>";
  293. if (gTooBusyHaveError1)
  294. g.tberrspan1.style.visibility = "visible";
  295. if (gTooBusyHaveError2)
  296. g.tberrspan2.style.visibility = "visible";
  297. if (gTooBusyHaveError3)
  298. g.tberrspan3.style.visibility = "visible";
  299. if (((g_AltnumberHolder == null) || (g_AltnumberHolder == "")) && (!gTooBusyHaveError1))
  300. {
  301. g_AltnumberHolder = "";
  302. g.edt_altnumber.value = "";
  303. g.edt_altnumber.style.backgroundColor = "#dddddd";
  304. g.edt_altnumber.style.disabled = true;
  305. g.cb_altnumber.checked = false;
  306. }
  307. else
  308. {
  309. g.edt_altnumber.disabled = false;
  310. g.edt_altnumber.value = g_AltnumberHolder;
  311. g.edt_altnumber.style.backgroundColor = "#ffffff";
  312. g.cb_altnumber.checked = true;
  313. }
  314. if (!gTooBusyHaveError2)
  315. g_OutsidelineHolder = TapiObj.get_DialOut;
  316. if (((g_OutsidelineHolder == null) || (g_OutsidelineHolder == "")) && (!gTooBusyHaveError2))
  317. {
  318. g_OutsidelineHolder = "";
  319. g.edt_outsideline.value = "";
  320. g.edt_outsideline.style.backgroundColor = "#dddddd";
  321. g.edt_outsideline.disabled = true;
  322. g.cb_outsideline.checked = false;
  323. }
  324. else
  325. {
  326. g.edt_outsideline.disabled = false;
  327. g.edt_outsideline.value = g_OutsidelineHolder;
  328. g.edt_outsideline.style.backgroundColor = "#ffffff";
  329. g.cb_outsideline.checked = true;
  330. }
  331. if (!gTooBusyHaveError3)
  332. g_CallwaitingHolder = TapiObj.get_CallWaiting;
  333. if (((g_CallwaitingHolder == null) || (g_CallwaitingHolder == "")) && (!gTooBusyHaveError3))
  334. {
  335. g_CallwaitingHolder = "";
  336. g.edt_callwaiting.value = "";
  337. g.edt_callwaiting.style.backgroundColor = "#dddddd";
  338. g.edt_callwaiting.disabled = true;
  339. g.cb_callwaiting.checked = false;
  340. }
  341. else
  342. {
  343. g.edt_callwaiting.disabled = false;
  344. g.edt_callwaiting.value = g_CallwaitingHolder;
  345. g.edt_callwaiting.style.backgroundColor = "#ffffff";
  346. g.cb_callwaiting.checked = true;
  347. }
  348. if (1 == TapiObj.get_PhoneSystem)
  349. {
  350. g.DialTone.checked = true;
  351. }
  352. else
  353. {
  354. g.DialPulse.checked = true;
  355. }
  356. g.btnNext.onclick = NewToobusyNextBtnHandler;
  357. }
  358. function Check_cb_altnumber()
  359. {
  360. if (g.cb_altnumber.checked == true)
  361. {
  362. g.edt_altnumber.style.backgroundColor = "#ffffff";
  363. g.edt_altnumber.disabled = false;
  364. g.edt_altnumber.value = g_AltnumberHolder;
  365. g.edt_altnumber.focus();
  366. }
  367. else
  368. {
  369. g_AltnumberHolder = g.edt_altnumber.value;
  370. g.edt_altnumber.value = "";
  371. g.edt_altnumber.style.backgroundColor = "#dddddd";
  372. g.edt_altnumber.disabled = true;
  373. g.lbl_altnumber.innerHTML = L_altnumber_Text;
  374. g.lbl_altnumber.className = "text-primary";
  375. }
  376. }
  377. function Check_cb_outsideline()
  378. {
  379. if (g.cb_outsideline.checked == true)
  380. {
  381. g.edt_outsideline.style.backgroundColor = "#ffffff";
  382. g.edt_outsideline.disabled = false;
  383. g.edt_outsideline.value = g_OutsidelineHolder;
  384. g.edt_outsideline.focus();
  385. }
  386. else
  387. {
  388. g_OutsidelineHolder = g.edt_outsideline.value;
  389. g.edt_outsideline.value = "";
  390. g.edt_outsideline.style.backgroundColor = "#dddddd";
  391. g.edt_outsideline.disabled = true;
  392. g.lbl_outsideline.innerHTML = L_outsideline_Text;
  393. g.lbl_outsideline.className = "text-primary";
  394. }
  395. }
  396. function Check_cb_callwaiting()
  397. {
  398. if (g.cb_callwaiting.checked == true)
  399. {
  400. g.edt_callwaiting.style.backgroundColor = "#ffffff";
  401. g.edt_callwaiting.disabled = false;
  402. g.edt_callwaiting.value = g_CallwaitingHolder;
  403. g.edt_callwaiting.focus();
  404. }
  405. else
  406. {
  407. g_CallwaitingHolder = g.edt_callwaiting.value;
  408. g.edt_callwaiting.value = "";
  409. g.edt_callwaiting.style.backgroundColor = "#dddddd";
  410. g.edt_callwaiting.disabled = true;
  411. g.lbl_callwaiting.innerHTML = L_callwaiting_Text;
  412. g.lbl_callwaiting.className = "text-primary";
  413. }
  414. }
  415. function SelectDialRule()
  416. {
  417. if (g.DialRuleYes.checked)
  418. {
  419. if (g.edtPhoneNumber)
  420. g.edtPhoneNumber.disabled=false;
  421. g.edtOutsideLine.disabled=true;
  422. g.edtCallWaiting.disabled=true;
  423. }
  424. else
  425. {
  426. if (g.edtPhoneNumber)
  427. g.edtPhoneNumber.disabled=true;
  428. g.edtOutsideLine.disabled=false;
  429. g.edtCallWaiting.disabled=false;
  430. }
  431. }
  432. function RestoreDialRule()
  433. {
  434. g.spanDisplayNumber.innerText = window.external.get_DialNumber;
  435. if (g.edtPhoneNumber)
  436. g.edtPhoneNumber.value = window.external.get_PhBkNumber;
  437. g.edtOutsideLine.value = TapiObj.get_DialOut;
  438. g.edtCallWaiting.value = TapiObj.get_CallWaiting;
  439. if (1 == TapiObj.get_PhoneSystem)
  440. {
  441. g.DialTone.checked = true;
  442. }
  443. else
  444. {
  445. g.DialPulse.checked = true;
  446. }
  447. }
  448. // ins error page
  449. function ISPInsError_NextBtnHandler()
  450. {
  451. PopCKPT();
  452. GoNavigate(CKPT_OEMCUST);
  453. }
  454. function ISPInsError_LoadMe()
  455. {
  456. DefaultErr_LoadMe();
  457. g.ins_ISPName1.innerText = window.external.get_ISPName;
  458. g.ins_ISPName2.innerText = window.external.get_ISPName;
  459. g.btnNext.onclick = ISPInsError_NextBtnHandler;
  460. }
  461. // noanswer page next button handler
  462. // noanswer.htm error page
  463. function NoAnswNextBtnHandler()
  464. {
  465. if (g.DialTone.checked)
  466. {
  467. TapiObj.set_PhoneSystem(1);
  468. }
  469. else
  470. {
  471. TapiObj.set_PhoneSystem(0);
  472. }
  473. if (g.DialRuleYes.checked) {
  474. if (CheckPhoneNumer(g.edtPhoneNumber.value))
  475. {
  476. window.external.set_DialNumber(g.edtPhoneNumber.value);
  477. DialErrorNextBtnHandler();
  478. }
  479. else
  480. {
  481. g.edtPhoneNumber.value = window.external.get_DialNumber;
  482. g.error_mesg.innerHTML = L_EnterValidPhoneNumber_Text;
  483. g.error_mesg.style.display="inline";
  484. }
  485. }
  486. else
  487. {
  488. TapiObj.set_DialOut(g.edtOutsideLine.value);
  489. TapiObj.set_CallWaiting(g.edtCallWaiting.value);
  490. window.external.set_DialAlternative(false);
  491. DialErrorNextBtnHandler();
  492. }
  493. }
  494. function NoAnsw_LoadMe()
  495. {
  496. DefaultErr_LoadMe();
  497. g.spanDisplayNumber.innerText = window.external.get_DialNumber;
  498. g.edtPhoneNumber.value = g.spanDisplayNumber.innerText;
  499. g.edtOutsideLine.value = TapiObj.get_DialOut;
  500. g.edtCallWaiting.value = TapiObj.get_CallWaiting;
  501. if (1 == TapiObj.get_PhoneSystem)
  502. {
  503. g.DialTone.checked = true;
  504. }
  505. else
  506. {
  507. g.DialPulse.checked = true;
  508. }
  509. g.btnNext.onclick = NoAnswNextBtnHandler;
  510. SelectDialRule();
  511. }
  512. // noanswer page next button handler
  513. // noanswer.htm error page
  514. function NoModemBtnHandler()
  515. {
  516. window.external.Finish();
  517. }
  518. function NoModem_LoadMe()
  519. {
  520. DefaultErr_LoadMe();
  521. g.btnNext.onclick = NoModemBtnHandler;
  522. }
  523. function Pulse_LoadMe()
  524. {
  525. DefaultErr_LoadMe();
  526. if (1 == TapiObj.set_PhoneSystem)
  527. g.tone.checked = true;
  528. else
  529. g.pulse.checked = true;
  530. }
  531. function DesktopPbErr_LoadMe()
  532. {
  533. InitFrameRef();
  534. if (InActivation_AppMode())
  535. {
  536. GetPageTitle();
  537. }
  538. InitButtons();
  539. var L_DeskpbErrOEMName_Text = g_OEMNameStr;
  540. if (L_DeskpbErrOEMName_Text == "")
  541. {
  542. L_DeskpbErrOEMName_Text = L_MissingOEMName_Text;
  543. }
  544. var L_DeskMainPBerrMsg_Text = "";
  545. if (g_DoActivation)
  546. {
  547. if ((g_PostToMS) && (g_PostToOEM))
  548. {
  549. 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.";
  550. g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text);
  551. }
  552. else if ((g_PostToMS) && (!g_PostToOEM))
  553. {
  554. g.Title_Text.innerText = "Unable to activate and register online";
  555. GetPageTitle();
  556. 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.";
  557. g.Desktoppberr_par1.innerText = L_DeskMainPBerrMsg_Text;
  558. }
  559. else if ((!g_PostToMS) && (g_PostToOEM))
  560. {
  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 by telephone. To register your computer without an Internet connection, please contact %1.";
  562. g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text);
  563. }
  564. else
  565. {
  566. g.Title_Text.innerText = "Unable to activate online";
  567. GetPageTitle();
  568. // If we're here, it means g_PostToMS=flase and g_PostToOEM=false.
  569. 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.";
  570. g.Desktoppberr_par1.innerText = L_DeskMainPBerrMsg_Text;
  571. }
  572. }
  573. else
  574. {
  575. if ((!g_PostToMS) && (g_PostToOEM))
  576. {
  577. g.Title_Text.innerText = "Unable to register online";
  578. GetPageTitle();
  579. L_DeskMainPBerrMsg_Text = "Online registration is currently unavailable in your country or region. To register your computer without an Internet connection, please contact %1.";
  580. g.Desktoppberr_par1.innerText = ApiObj.FormatMessage(L_DeskMainPBerrMsg_Text, L_DeskpbErrOEMName_Text);
  581. }
  582. }
  583. g.btnBack.focus();
  584. g.btnBack.onclick = window.parent.SimpleNavBack;
  585. }