-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialmgr.js
762 lines (607 loc) · 18.4 KB
/
dialmgr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
var PAGE_DIAL_READY = 40;
var PAGE_DIAL_UP = 41;
var gNextChkPt = 0;
var APP_OOBE_MODE = 0;
var APP_REG_MODE = 2;
var APP_ACT_MODE = 5;
var REMIND_REG = 0;
var REMIND_ISP = 1;
var APP_MSN_MODE = 4;
var L_REGSRV_Text = "Your computer is connecting to the registration server.";
var L_ACTSRV_Text = "Your computer is connecting to the activation server.";
var L_ACT_REG_SRV_Text = "Your computer is connecting to the activation and registration server.";
var L_REGCOM_Text = "Registering Windows... ";
var L_REGCOM2_Text = "Registering your computer... ";
var L_ACTCOM_Text = "Activating Windows... ";
var L_ACTREGCOM_Text = "Activating and registering Windows... ";
var g_CustomPhoneBook = null;
var g_CustomDialingPage = null;
function SetCustomDialing(PhoneBook, DialingPage)
{
g_CustomDialingPage = DialingPage;
g_CustomPhoneBook = PhoneBook;
}
function InActivation_AppMode()
{
return (APP_ACT_MODE == window.external.Directions.get_AppMode());
}
function InReminderMode()
{
return (APP_REG_MODE == window.external.Directions.get_AppMode() ||
APP_ACT_MODE == window.external.Directions.get_AppMode()
);
}
function ShowAregDial()
{
Navigate("actsetup\\aregdial.htm");
SetTimerShowIFrame(500);
}
function GoToDialingPage()
{
if ( APP_REG_MODE == window.external.Directions.get_AppMode() ) {
Navigate("regsetup\\rregdial.htm");
} else if ( APP_ACT_MODE == window.external.Directions.get_AppMode() ) {
ShowIFrame('False');
window.setTimeout("ShowAregDial();",500);
} else {
DisableAllButtons();
switch (g_CurrentCKPT)
{
case CKPT_MIGDIAL:
Navigate("setup\\migdial.htm");
break;
case CKPT_REFDIAL:
if (true == StatusObj.get_Status(REFERALDLCOMPLETED))
{
GoNavigate(CKPT_MIGLIST);
}
else
{
Navigate("setup\\refdial.htm");
}
break;
case CKPT_REGDIAL:
Navigate("setup\\regdial.htm");
break;
case CKPT_ISPDIAL:
if (g_CustomDialingPage)
{
Navigate(g_CustomDialingPage);
}
else
{
Navigate("setup\\dialup.htm");
}
break;
default:
break;
}
}
}
function DialRdy_OutsideLineClicked( )
{
try
{
if (null == g.event)
return;
}
catch(e)
{
return;
}
DialRdy_SetOutsideLine( );
}
function DialRdy_SetOutsideLine( )
{
if (true == g.radioOutsideLineYes.checked &&
"visible" == g.spnOutsideLine.style.visibility)
{
g.spnOutsideLineNumber.style.visibility = "visible";
g.edtOutsideLineNumber.style.visibility = "visible";
g.edtOutsideLineNumber.value = TapiObj.get_DialOut;
if (0 == g.edtOutsideLineNumber.value.length)
{
g.edtOutsideLineNumber.value = "9";
}
}
else
{
g.edtOutsideLineNumber.value = "";
g.spnOutsideLineNumber.style.visibility = "hidden";
g.spnOutsideLine.style.visibility = "hidden";
}
}
function Dial_NextBtnHandler()
{
switch (gCurrPage)
{
case PAGE_DIAL_READY:
{
if (g.DialRdy_ctrl1.style.visibility=="visible")
{
TapiObj.set_AreaCode = g.edtAreaCode.value;
TapiObj.set_CountryIndex = g.selCountry.selectedIndex;
if (g.PulseToneDialing.style.visibility != "hidden")
{
if (g.radioTouchToneYes.checked)
TapiObj.set_PhoneSystem = 1;
else
TapiObj.set_PhoneSystem = 0;
}
}
if ("visible" == g.spnOutsideLine.style.visibility &&
true == g.radioOutsideLineYes.checked &&
"visible" == g.spnOutsideLineNumber.style.visibility
)
{
TapiObj.set_DialOut = g.edtOutsideLineNumber.value;
}
if (window.external.CheckPhoneBook(
(g_CustomPhoneBook == null) ? "msobe.isp" : g_CustomPhoneBook
))
{
GoToDialingPage();
}
else
{
if (InReminderMode())
{
Navigate("regerror\\rpberr.htm");
}
else
{
if (g_CurrentCKPT == CKPT_ISPDIAL)
{
Navigate("isperror\\isppberr.htm");
}
else
{
Navigate("error\\pberr.htm");
}
}
}
break;
}
case PAGE_DIAL_UP:
{
break;
}
}
}
var g_IgnoreDialErr = true;
function Dial_BackBtnHandler()
{
switch (gCurrPage)
{
case PAGE_DIAL_READY:
{
break;
}
case PAGE_DIAL_UP:
{
g_IgnoreDialErr = true;
ResetDialing();
GoBack();
break;
}
}
}
function Dial_SkipBtnHandler()
{
PopCKPT(CKPT_ISPDIAL);
PopCKPT(CKPT_REGDIAL);
switch (gCurrPage)
{
case PAGE_DIAL_READY:
{
GoCancel();
break;
}
case PAGE_DIAL_UP:
{
ResetDialing();
GoCancel();
break;
}
}
}
function DialRdy_LoadMe()
{
if (InActivation_AppMode())
ShowIFrame();
gCurrPage = PAGE_DIAL_READY;
InitFrameRef();
if (InActivation_AppMode())
CheckContrastMode();
if (g != null)
{
g_FirstFocusElement = g.btnNext;
if (InActivation_AppMode())
window.setTimeout("DoFocus();",1000);
else
g_FirstFocusElement.focus();
}
InitButtons();
var fTapi = TapiObj.IsTAPIConfigured;
if (!fTapi && !g_bTapiDone)
{
g.DialRdy_ctrl1.style.visibility="visible";
if(g_CountryIdx < 0)
{
g_CountryIdx = TapiObj.get_CountryIndex;
}
g.edtAreaCode.value = TapiObj.get_AreaCode;
g.selCountry.selectedIndex = g_CountryIdx;
if(1 == TapiObj.get_PhoneSystem)
g.radioTouchToneYes.checked = true;
else
g.radioTouchToneNo.checked = true;
}
if (true == ApiObj.get_OOBEDebugMode)
{
g.spnOutsideLine.style.visibility = "visible";
}
DialRdy_SetOutsideLine( );
g.btnNext.onclick = Dial_NextBtnHandler;
g.btnSkip.onclick = Dial_SkipBtnHandler;
if ((APP_MSN_MODE == window.external.Directions.get_AppMode()) &&
window.external.CalledFromMsn())
{
g.btnBack.style.visibility = "hidden";
g.BackBtnLocalText.style.visibility = "hidden";
}
}
var L_PostToOEMandMS_Text = "We'll now dial a telephone number to register your new computer with Microsoft and %1. ";
var L_PostToMS_Text = "We'll now dial a telephone number to register your new computer with Microsoft. ";
var L_PostToOEM_Text = "We'll now dial a telephone number to register your new computer with %1. ";
var L_PrepToActRegOnline_Text = "Preparing to activate and register Online";
var L_PrepToActReg_Text = "Windows will now dial a telephone number to activate and register Windows with Microsoft.";
var L_PrepToActReg2_Text = "Windows will now dial a telephone number to activate Windows with Microsoft and register with %1. ";
var L_PrepToActReg3_Text = "Windows will now dial a telephone number to activate and register Windows with Microsoft and register with %1. ";
var L_PrepToAct_Text = "Windows will now dial a telephone number to activate Windows with Microsoft.";
var OemNameStr = window.external.Signup.get_OEMName();
function RegDialRdy_LoadMe()
{
DialRdy_LoadMe();
if (InActivation_AppMode())
{
if (g_PostToMS)
{
g.Title_Text.innerText = L_PrepToActRegOnline_Text;
g.RegDialReadyIntro.innerText = L_PrepToActReg_Text;
}
var L_RemindMeLater01_Text = " Re<u>m</u>ind me later ";
var AccesskeyRemind_M = "M";
g.btnSkip.innerHTML = L_RemindMeLater01_Text;
g.btnSkip.accessKey = AccesskeyRemind_M;
}
if (!InReminderMode())
{
if (g_DoActivation)
{
if (g_PostToMS && !g_PostToOEM)
g.RegDialReadyIntro.innerText = L_PrepToActReg_Text;
else if (!g_PostToMS && g_PostToOEM)
g.RegDialReadyIntro.innerText = ApiObj.FormatMessage(L_PrepToActReg2_Text, OemNameStr);
else if (g_PostToMS && g_PostToOEM)
g.RegDialReadyIntro.innerText = ApiObj.FormatMessage(L_PrepToActReg3_Text, OemNameStr);
else if (!g_PostToMS && !g_PostToOEM)
g.RegDialReadyIntro.innerText = L_PrepToAct_Text;
}
else
{
if (g_PostToMS && g_PostToOEM)
{
g.RegDialReadyIntro.innerText = ApiObj.FormatMessage(L_PostToOEMandMS_Text, OemNameStr);
}
else if (g_PostToMS)
{
g.RegDialReadyIntro.innerText = L_PostToMS_Text;
}
else
{
g.RegDialReadyIntro.innerText = ApiObj.FormatMessage(L_PostToOEM_Text, OemNameStr);
}
}
}
else
{
GetPageTitle();
if (1 == RegisterObj.get_PostToOEM)
{
if (g_PostToOEM)
{
if (g_PostToMS)
{
g.RegDialReadyIntro.innerText = ApiObj.FormatMessage(L_PostToOEMandMS_Text, OemNameStr);
}
else
{
g.RegDialReadyIntro.innerText = ApiObj.FormatMessage(L_PostToOEM_Text, OemNameStr);
}
}
}
}
}
var L_ConnectToOnlineAct_Text = "Connecting to online activation";
var L_ConnectToOnlineActReg_Text = "Connecting to online activation and registration";
var L_ConnectToOnlineReg_Text = "Connecting to online registration";
function RegDial_LoadMe()
{
gCurrPage = PAGE_DIAL_UP;
InitFrameRef();
if (InActivation_AppMode())
CheckContrastMode();
g.btnNext.disabled = true;
if (g != null)
{
g_FirstFocusElement = g.btnBack;
}
if (InActivation_AppMode())
{
GetPageTitle();
}
if (!InReminderMode())
{
if (g_DoActivation)
{
if (g_PostToMS || g_PostToOEM)
g.regdial_title.innerText = L_ConnectToOnlineActReg_Text;
else
g.regdial_title.innerText = L_ConnectToOnlineAct_Text;
}
else
{
g.regdial_title.innerText = L_ConnectToOnlineReg_Text;
}
}
InitButtons();
setTimeout("DoRegistrationDial()" , 40);
g.btnNext.onclick = Dial_NextBtnHandler;
g.btnBack.onclick = Dial_BackBtnHandler;
g.btnSkip.onclick = Dial_SkipBtnHandler;
}
function DoRegistrationDial()
{
g_IgnoreDialErr = false;
window.external.DialEx(CONNECTED_REGISTRATION, "reg.isp");
}
function Dialup_LoadMe()
{
gCurrPage = PAGE_DIAL_UP;
InitFrameRef();
g.btnNext.disabled = true;
if (g != null)
{
g_FirstFocusElement = g.btnBack;
}
InitButtons();
setTimeout("DoDialExternal()" , 40);
g.btnNext.onclick = Dial_NextBtnHandler;
g.btnBack.onclick = Dial_BackBtnHandler;
g.btnSkip.onclick = Dial_SkipBtnHandler;
}
function ResetDialing()
{
g_bRedial = false;
g_LineProblem = 0;
g_bFirstServerError = true;
g_strISPFile = "";
g_IgnoreDialErr = true;
window.external.Hangup();
}
function SetDialing(strISPFile)
{
g_strISPFile = strISPFile;
g_DialCKPT = g_CurrentCKPT;
g_ModalDialogUp = false;
}
function DoDialExternal()
{
SetDialing((g_CustomPhoneBook == null) ? "msobe.isp" : g_CustomPhoneBook);
DoDial();
}
function DoDial()
{
g_IgnoreDialErr = false;
if (g_bRedial)
{
window.external.ReDialEx(CONNECTED_ISP_SIGNUP, g_strISPFile);
}
else
{
window.external.DialEx(CONNECTED_ISP_SIGNUP, g_strISPFile);
}
}
function Redial()
{
DoDial();
}
<!--REQUIRED FUNCTION NAME-->
function OnDialing()
{
switch (g_CurrentCKPT)
{
case CKPT_REGDIAL:
if (g != null && g.spnISPName != null)
{
if (InActivation_AppMode())
{
if (g_PostToMS)
g.spnISPName.innerText = L_ACT_REG_SRV_Text;
else
g.spnISPName.innerText = L_ACTSRV_Text;
}
else
if (!InReminderMode())
{
if (g_DoActivation)
{
if (g_PostToMS || g_PostToOEM)
g.spnISPName.innerText = L_ACT_REG_SRV_Text;
else
g.spnISPName.innerText = L_ACTSRV_Text;
}
else
{
g.spnISPName.innerText = L_REGSRV_Text;
}
}
else
{
g.spnISPName.innerText = L_REGSRV_Text;
}
}
if (g != null && g.spnDialing != null)
{
g.spnDialing.innerText = window.external.get_DialNumber;
}
break;
}
}
<!--REQUIRED FUNCTION NAME-->
function OnConnecting()
{
switch (g_CurrentCKPT)
{
case CKPT_REGDIAL:
if (g != null && g.spnRegDialStatus != null)
{
if (InActivation_AppMode())
{
if (g_PostToMS)
g.spnRegDialStatus.innerText = L_ACTREGCOM_Text;
else
g.spnRegDialStatus.innerText = L_ACTCOM_Text;
g_AfterConnectionDone = true;
}
else
if (!InReminderMode())
{
if (g_DoActivation)
{
if (g_PostToMS || g_PostToOEM)
g.spnRegDialStatus.innerText = L_ACTREGCOM_Text;
else
g.spnRegDialStatus.innerText = L_ACTCOM_Text;
}
else
{
g.spnRegDialStatus.innerText = L_REGCOM2_Text;
}
}
else
{
g.spnRegDialStatus.innerText = L_REGCOM_Text;
}
}
break;
}
}
<!--REQUIRED FUNCTION NAME-->
function OnConnected()
{
g_bTapiDone = true;
switch (g_CurrentCKPT)
{
case CKPT_REGDIAL:
if ( g_DoActivation )
{
window.external.AsyncActivate( g_PostToMS );
return;
}
else if (g_PostToMS)
{
window.external.PostRegData(POST_TO_MS);
StatusObj.set_Status(MS_REGISTRATION, true);
}
ActivationComplete( );
break;
}
}
<!--REQUIRED FUNCTION NAME-->
function OnDownloading()
{
}
<!--REQUIRED FUNCTION NAME-->
function OnDisconnect()
{
}
<!--REQUIRED FUNCTION NAME-->
function OnDialingError(derr)
{
window.external.Hangup();
if (g_IgnoreDialErr)
return;
if (InReminderMode())
{
g_AfterConnectionDone = false;
switch (derr)
{
case DERR_PORT_OR_DEVICE:
case DERR_PORT_ALREADY_OPEN:
case DERR_HARDWARE_FAILURE:
case DERR_DIALTONE:
Navigate("regerror\\rdtone.htm");
break;
case DERR_BUSY:
Navigate("regerror\\rtoobusy.htm");
break;
case DERR_VOICEANSWER:
case DERR_PPP_TIMEOUT:
Navigate("regerror\\rhndshk.htm");
break;
case DERR_NO_CARRIER:
Navigate("regerror\\rpulse.htm");
break;
case DERR_REMOTE_DISCONNECT:
Navigate("regerror\\rcnterr.htm");
break;
case DERR_NOANSWER:
Navigate("regerror\\rnoansw.htm");
break;
default:
Navigate("regerror\\rhndshk.htm");
break;
}
}
else
{
switch (derr)
{
case DERR_PORT_OR_DEVICE:
case DERR_PORT_ALREADY_OPEN:
case DERR_HARDWARE_FAILURE:
case DERR_DIALTONE:
Navigate("error\\dialtone.htm");
break;
case DERR_BUSY:
Navigate("error\\toobusy.htm");
break;
case DERR_VOICEANSWER:
case DERR_PPP_TIMEOUT:
Navigate("error\\hndshake.htm");
break;
case DERR_NO_CARRIER:
Navigate("error\\pulse.htm");
break;
case DERR_REMOTE_DISCONNECT:
Navigate("error\\cnncterr.htm");
break;
case DERR_NOANSWER:
Navigate("error\\noanswer.htm");
break;
default:
Navigate("error\\hndshake.htm");
break;
}
}
}
<!--REQUIRED FUNCTION NAME -->
function OnServerError(derr)
{
window.external.Hangup();
if (g_IgnoreDialErr)
return;
Navigate("error\\isp2busy.htm");
}