-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
3229 lines (2636 loc) · 177 KB
/
index.html
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
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!--<?xml version="1.0" encoding="UTF-8" standalone="no" ?>-->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
/*
.ui-dialog {
background-color: rgba(255,255,255,0.5);
}
*/
#dialog {
background: rgb( 255, 0, 0 ); /* fallback for not-rgba-supporting browsers */
background: rgba( 255, 0, 0, 0.05 );
}
/*
#dialog {
background-image: linear-gradient(to bottom right, red, yellow);
}*/
body {
/*overflow: hidden;*/ /*new version Hide scrollbars --------------- */
/*background: linear-gradient(to left top, blue, red) fixed;*/
}
.debug {
visibility: hidden;
border-radius: 4px;
width: 150px;
}
button {
border-radius: 4px;
width: 150px;
}
/* #mainBody {
background-image: linear-gradient(to bottom right, red, yellow);
}*/
/*
.outMessages {
visibility: hidden;
}*/
.imgClass {
margin: 0px;
padding: 0px;
position: absolute;
top: 10%;
left: 40%;
width: 30%;
height: 30%;
/* top: 0px;
left: 0px;
width: 100%;
height: 100%;*/
}
.alertClass {
visibility: hidden;
font-size: 50px;
font-weight: bold;
background-color: tomato;
color: white;
border: 2px solid black;
margin: 20px;
padding: 20px;
position: absolute;
top: 100px;
left: 50px;
z-index: 10;
border-radius: 25px;
}
/* .imgClass {
margin: 0px;
padding: 0px;
position: absolute;
top: 200px;
left: 750px;
width: 200px;
}*/
#messages {
background-color: yellow;
font-size: 3px;
font-weight: bold;
line-height: 140%;
visibility: visible;
}
#status {
background-color: red;
font-size: 4px;
font-weight: bold;
color: white;
line-height: 140%;
}
</style>
<!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>-->
<title>Stock Viewer</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="manifest" href="/manifest.json" />
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
};
</script>
<script type="text/javascript">
//var mqtt;
//var mqttFTP = null;
var safeaddCounter = 100;
var reconnectTimeout = 2000;
//var MQTThost = "broker.hivemq.com";
var MQTThost = "mqttbroker"; //default
var port = 8000;
var useSSL = false;
//test.mosquitto.org
// websocket 8080
// tls websocket 8081
//broker.emqx.io
// websocket 8083
// tls websocket 8084
//broker.hivemq.com
// websocket 8000
if ((window.isSecureContext == true) && (window.location.protocol === "https:")) {
useSSL = true;
}
if ((window.isSecureContext == true) && (window.location.protocol === "http:")) {
useSSL = false;
}
if ((window.isSecureContext == true) && (window.location.protocol === "file:")) {
useSSL = false;
}
switch (location.hostname) {
case "localhost":
case "mrouter":
//case "dlaptop":
MQTThost = "mqttbroker";
useSSL = false;
port = 8000;
break;
default:
// MQTThost = "broker.hivemq.com";
//MQTThost = "mqttbroker";
MQTThost = "test.mosquitto.org";
if (useSSL) {
port = 8081;
} else {
port = 8080;
}
break;
}
var row = 0;
var ftpCounter = 100;
var globalVolume = .8;
//var userName = "WebViewer"
// mqtt user name admin password admin
/**
* http://www.openjs.com/scripts/events/keyboard_shortcuts/
* Version : 2.01.B
* By Binny V A
* License : BSD
*/
shortcut = {
'all_shortcuts': {},//All the shortcuts are stored in this array
'add': function (shortcut_combination, callback, opt) {
//Provide a set of default options
var default_options = {
'type': 'keydown',
'propagate': false,
'disable_in_input': false,
'target': document,
'keycode': false
}
if (!opt) opt = default_options;
else {
for (var dfo in default_options) {
if (typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo];
}
}
var ele = opt.target;
if (typeof opt.target == 'string') ele = document.getElementById(opt.target);
var ths = this;
shortcut_combination = shortcut_combination.toLowerCase();
//The function to be called at keypress
var func = function (e) {
e = e || window.event;
if (opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields
var element;
if (e.target) element = e.target;
else if (e.srcElement) element = e.srcElement;
if (element.nodeType == 3) element = element.parentNode;
if (element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
}
//Find Which key is pressed
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
var character = String.fromCharCode(code).toLowerCase();
if (code == 188) character = ","; //If the user presses , when the type is onkeydown
if (code == 190) character = "."; //If the user presses , when the type is onkeydown
var keys = shortcut_combination.split("+");
//Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked
var kp = 0;
//Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken
var shift_nums = {
"`": "~",
"1": "!",
"2": "@",
"3": "#",
"4": "$",
"5": "%",
"6": "^",
"7": "&",
"8": "*",
"9": "(",
"0": ")",
"-": "_",
"=": "+",
";": ":",
"'": "\"",
",": "<",
".": ">",
"/": "?",
"\\": "|"
}
//Special Keys - and their codes
var special_keys = {
'esc': 27,
'escape': 27,
'tab': 9,
'space': 32,
'return': 13,
'enter': 13,
'backspace': 8,
'scrolllock': 145,
'scroll_lock': 145,
'scroll': 145,
'capslock': 20,
'caps_lock': 20,
'caps': 20,
'numlock': 144,
'num_lock': 144,
'num': 144,
'pause': 19,
'break': 19,
'insert': 45,
'home': 36,
'delete': 46,
'end': 35,
'pageup': 33,
'page_up': 33,
'pu': 33,
'pagedown': 34,
'page_down': 34,
'pd': 34,
'left': 37,
'up': 38,
'right': 39,
'down': 40,
'f1': 112,
'f2': 113,
'f3': 114,
'f4': 115,
'f5': 116,
'f6': 117,
'f7': 118,
'f8': 119,
'f9': 120,
'f10': 121,
'f11': 122,
'f12': 123
}
var modifiers = {
shift: { wanted: false, pressed: false },
ctrl: { wanted: false, pressed: false },
alt: { wanted: false, pressed: false },
meta: { wanted: false, pressed: false } //Meta is Mac specific
};
if (e.ctrlKey) modifiers.ctrl.pressed = true;
if (e.shiftKey) modifiers.shift.pressed = true;
if (e.altKey) modifiers.alt.pressed = true;
if (e.metaKey) modifiers.meta.pressed = true;
for (var i = 0; k = keys[i], i < keys.length; i++) {
//Modifiers
if (k == 'ctrl' || k == 'control') {
kp++;
modifiers.ctrl.wanted = true;
} else if (k == 'shift') {
kp++;
modifiers.shift.wanted = true;
} else if (k == 'alt') {
kp++;
modifiers.alt.wanted = true;
} else if (k == 'meta') {
kp++;
modifiers.meta.wanted = true;
} else if (k.length > 1) { //If it is a special key
if (special_keys[k] == code) kp++;
} else if (opt['keycode']) {
if (opt['keycode'] == code) kp++;
} else { //The special keys did not match
if (character == k) kp++;
else {
if (shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
character = shift_nums[character];
if (character == k) kp++;
}
}
}
}
if (kp == keys.length &&
modifiers.ctrl.pressed == modifiers.ctrl.wanted &&
modifiers.shift.pressed == modifiers.shift.wanted &&
modifiers.alt.pressed == modifiers.alt.wanted &&
modifiers.meta.pressed == modifiers.meta.wanted) {
callback(e);
if (!opt['propagate']) { //Stop the event
//e.cancelBubble is supported by IE - this will kill the bubbling process.
e.cancelBubble = true;
e.returnValue = false;
//e.stopPropagation works in Firefox.
if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
return false;
}
}
}
this.all_shortcuts[shortcut_combination] = {
'callback': func,
'target': ele,
'event': opt['type']
};
//Attach the function with the event
if (ele.addEventListener) ele.addEventListener(opt['type'], func, false);
else if (ele.attachEvent) ele.attachEvent('on' + opt['type'], func);
else ele['on' + opt['type']] = func;
},
//Remove the shortcut - just specify the shortcut and I will remove the binding
'remove': function (shortcut_combination) {
shortcut_combination = shortcut_combination.toLowerCase();
var binding = this.all_shortcuts[shortcut_combination];
delete (this.all_shortcuts[shortcut_combination])
if (!binding) return;
var type = binding['event'];
var ele = binding['target'];
var callback = binding['callback'];
if (ele.detachEvent) ele.detachEvent('on' + type, callback);
else if (ele.removeEventListener) ele.removeEventListener(type, callback, false);
else ele['on' + type] = false;
}
}
var prefs = {
data: {},
load: function () {
var the_cookie = document.cookie.split(';');
if (the_cookie.length > 0) {
var tmp;
var gotJson = false;
for (var i = 0; i < the_cookie.length; i++) {
try {
tmp = JSON.parse(the_cookie[i]);
if (tmp.username) {
gotJson = true;
break;
}
}
catch (err) {
}
}
if (gotJson) {
this.data = tmp;
//alert("GotData");
}
}
return this.data;
},
save: function (expires, path) {
var d = expires || new Date(2022, 02, 02);
var p = path || '/';
// documentcookie = JSON.stringify(escape(this.data))
document.cookie = JSON.stringify(this.data)
+ ";second=true" + "; expires=Thu, 18 Dec 2023 12:00:00 UTC";
// + ';path=' + p
// + ';expires=' + d.toUTCString();
}
}
// document.cookie = "username=" + escape(UniqueID)
//+ ";second=true" + "; expires=Thu, 18 Dec 2023 12:00:00 UTC";
////////function clearListCookies() {
//////// var cookies = document.cookie.split(";");
//////// for (var i = 0; i < cookies.length; i++) {
//////// var spcook = cookies[i].split("=");
//////// deleteCookie(spcook[0]);
//////// }
//////// function deleteCookie(cookiename) {
//////// var d = new Date();
//////// d.setDate(d.getDate() - 1);
//////// var expires = ";expires=" + d;
//////// var name = cookiename;
//////// //alert(name);
//////// var value = "";
//////// document.cookie = name + "=" + value + expires + "; path=/acc/html";
//////// }
//////// window.location = ""; // TO REFRESH THE PAGE
////////}
////////clearListCookies();
prefs.data.username = "kenny";
prefs.data.fullscreen = true;
prefs.data.broker = "mqttbroker"; //cookie
prefs.save();
var preferences = prefs.load();
var b = preferences.broker;
////////// save
////////prefs.data.something = "one"; // save one
////////// ... do other stuff ...
////////prefs.data.another = "two";
////////// ready to store?
////////prefs.save();
////////// another syntax
////////var to_save = {
//////// one: 1,
//////// two: 2,
////////}
////////prefs.data = to_save;
////////prefs.save();
////////// delete
////////var date_in_the_past = new Date(2000, 02, 02);
////////prefs.save(date_in_the_past);
////////// read
////////var what = prefs.load();
////////// load populates prefs.data and also returns
////////alert(what.something);
////////// or ...
////////alert(prefs.data.something);
//var kpf = {};
//kpf.username = "KENNY";
//var json = JSON.stringify(kpf);
//var rrr = JSON.parse(json);
SafeAddToListbox("Starting Web Page ...");
if (!String.prototype.startsWith) {
String.prototype.startsWith = function (searchString, position) {
position = position || 0;
return this.indexOf(searchString, position) === position;
};
}
var loudClick = new Audio("data:audio/mpeg;base64,SUQzAwAAAAAAJVRQRTEAAAAbAAAAU291bmRKYXkuY29tIFNvdW5kIEVmZmVjdHP / +5QEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAAAYAAAqAACoqKioqKioqKioqKioqKipVVVVVVVVVVVVVVVVVVVVVVYCAgICAgICAgICAgICAgICqqqqqqqqqqqqqqqqqqqqqqtXV1dXV1dXV1dXV1dXV1dXV/////////////////////wAAADlMQU1FMy45OXIBqgAAAAAAAAAAFIAkBouGAACAAAAKgJKO20kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/+5QEAAACFh3GjSRgADOgCUqhhAANKSFRuPaAAaIlLXce0AIAYQ8IIGMmgIBQFAQAABgMEh1wNz4R//XdERP//67u4AAAAAAAgCAPg+D8u8QAg4EDniAEHeUOcH+UBD/if4n9APh8AACRCUS3QfUCAIFAQBAEAQeXggAwfWD8Tn/icPu6Q/8pKO+oMf8uD/iAEP/xOD4flAQDG1uCYzGYzGg0GoGICAMrOtx2UBLhzsSvR49GJp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ce4LdBe8iBuZmBmVdZJVAmuCk8tt/qOi8Ax4QjgywDYEMM0dkkUkqQ1gGCpaf/nTgoQH36vpkMflE7/KRj+k/0n5DiDPS+3///qf////7JizRCya////WaGLygCl0lqppwAH1n/pGM6MCPFK7JP2qJpsz/9EfgHUN4bYUo8kVfxZDd/9ZqXSi31/WXW51D+ZG37/pNycMDbnf///+JaiWbxwJAADEAgAWBoRJquMpaxJQFeTcU+X7VxL3MGIJe//uSZBAABBVs0ftaa3BCS+udTaVvjLV5W+w1rdk5r6x89rW+Bx4xGI3LIG/dK42coANwBynnsZ4f//+t3GfrnRJKgCTLdi1m1ZprMZymUETN4tj3+//9FQEMDmX9L5qVmlaiKVfx3FJ/mH5dfphw6b////60P////qWkMQEfIZq////sMESP4H4fCE0SSBAnknkX+pZzSS2dv1KPN/6hdAJUhIjzKL1L2sDqST/+gwF//ir8REf5h35f2bmDz3//////////jAGKcREwKMQI+VWsj7qNCFp0Zk9ibgh82rKj/JEIFmShuSZMMxk6Jew7BLOh/6wWk1EaAK4nJszopGpdUYh9EYN2/0zQYYnhvJt1j1+pPzpr/TKHXs3z6WdE1N0pm/o///9f/////MpkiIiBeCALJpkgpbKFme7rvPs1/vwM0yWmeNn75xH/+BkEIWITktZ+ijXEi//nC8XQ8v9D5wez86Xv6SL/Lv5ePcrIOl////1/////84bPG1/BwAHSMrAmlSw9S3OfrGMy51bTgmVmHAFtAmCmRg2s1LzmAP/7kmQSgAM9Xs5rM2twXG2Z70IKbg09fT2nva3xgq/mtRe1ui8AFVGaC/9EawNnhihesNgE5E6kir3GVFlof+tEQEpf/rMH50lv5WPH6k2+XX4JUKRpn9Xq//+7f////x3CyAX/4LIzvDgdgAEbFbAc0rGqTO2p1zoKA22l8tFMiuo2RRBOMzZv+mUA2MiAyglI3b9ZwZ0G7jqlt/OcDIKX+/1NblSX+VKfQfP8xuJJGk7////rf////+PgXTv///1JThJJQainmySAB6imUyuVbVttUo7T4Csa821OuF88f62+CZHFnGf///mQgYIE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ftClick() {
try {
//softClick.play();
loudClick.play();
}
catch (err) {
displayToast("Audio Disabled");
}
}
function f1() {
SlideShowMode = false;
playSoftClick();
kennyFisher("mqtt://scrn1.png", function (png) {
if (png.length > 0) {
var t = "data:image/png;base64," + arrayBufferToBase64(png)
fadeNextImage(t);
}
});
}
function f2() {
SlideShowMode = false;
playSoftClick();
kennyFisher("mqtt://scrn2.png", function (png) {
if (png.length > 0) {
var t = "data:image/png;base64," + arrayBufferToBase64(png)
fadeNextImage(t);
}
});
}
function f3() {
SlideShowMode = false;
playSoftClick();
kennyFisher("mqtt://scrn3.png", function (png) {
if (png.length > 0) {
var t = "data:image/png;base64," + arrayBufferToBase64(png)
fadeNextImage(t);
}
});
}
function f4() {
SlideShowMode = false;
playSoftClick();
kennyFisher("mqtt://scrn4.png", function (png) {
if (png.length > 0) {
var t = "data:image/png;base64," + arrayBufferToBase64(png)
fadeNextImage(t);
}
});
}
function f5() {
sayString("Kenny Fisher Is A High Roller");
}
function f6() {
playSoftClick();
//KPFSendMessage("function", "say status");
mainConnection.SendMessage("function", "say status");
}
function f7() {
//kennyFisher("mqtt://scrn1.png", function (png) { //startSlideShow
// if (png.length > 0) {
// var t = "data:image/png;base64," + arrayBufferToBase64(png)
// document.getElementById("ItemPreview").src = t;
// fadeNextImage(t);
// }
//});
}
function f9() {
playSoftClick();
const synth = window.speechSynthesis;
displayToast("Oh No, You Big Dummy!!!");
playDummy();
}
function f10() {
playSoftClick();
playMafia();
}
shortcut.add("F1", f1);
shortcut.add("F2", f2);
shortcut.add("F3", f3);
shortcut.add("F4", f4);
shortcut.add("F5", f5);
shortcut.add("F6", f6);
shortcut.add("F7", f7);
shortcut.add("F9", f9);
shortcut.add("F10", f10);
shortcut.add("Ctrl+F10", function () {
displayToast("Control F10");
});
shortcut.add("Alt+F10", function () {
displayToast("Alt F10");
});
//////var availableVoices = ["Google US English", "Google US English Female",
////// "Google US English Male", "Google UK English Female",
////// "Google UK English Male","Microsoft Anna - English (United States)",
//////]
var availableVoices = ["Google US English",
"Google UK English Female",
"Google UK English Male",
"Microsoft Anna - English (United States)",
]
//var availableVoices = ["Google US English", "Google UK English Female",
// "Microsoft Anna - English (United States)",
//]
var voiceCounter = 0;
var voices;
function sayString(s) {
if (window) {
if ('speechSynthesis' in window) {
if (voices == null) {
voices = window.speechSynthesis.getVoices();
for (var i = 0; i < voices.length; i++) {
SafeAddToListbox("Voice: " + voices[i].name);
// console.log(voices[i].name)
}
}
else {
if (voices.length == 0) {
voices = window.speechSynthesis.getVoices();
for (var i = 0; i < voices.length; i++) {
SafeAddToListbox("Voice: " + voices[i].name);
// console.log(voices[i].name)
}
}
}
var speech = new SpeechSynthesisUtterance(s);
//SafeAddToListbox("Vol = " + speech.volume);
if (voices.length > 0) {
voiceCounter++;
if (voiceCounter >= availableVoices.length) voiceCounter = 0;
var voiceName = availableVoices[voiceCounter];
var found = false;
for (i = 0; i < voices.length; i++) {
if (voices[i].name === voiceName) {
speech.voice = voices[i];
//displayToast(voiceName);
found = true;
}
}
if (found == false) {
displayToast("Could Not Find:" + voiceName);
}
}
else {
SafeAddToListbox("No Voices Available");
}
speech.volume = globalVolume;
speech.lang = 'en-US';
//SafeAddToListbox("TTS: " + s);
window.speechSynthesis.speak(speech);
}
else {
SafeAddToListbox("No TTS Available");
}
}
else {
SafeAddToListbox("Window is null");
}
}
//"Google US English"
//"Google US English Female"
//"Google US English Male"
//"Google UK English Female"
//"Google UK English Male"
// Microsoft Anna - English (United States)
//////function saySomething(whatToSay) {
////// const synth = window.speechSynthesis;
////// // enter your voice here, because voices list loads asynchronously.. check the console.log below.
////// getVoice("Google US English", synth)
////// .then(voice => {
////// var utterThis = new SpeechSynthesisUtterance(whatToSay);
////// utterThis.voice = voice;
////// synth.speak(utterThis);
////// })
////// .catch(error => console.log("error: ", error));
//////}
//////function getVoice(voiceName, synth) {
////// var voices = window.speechSynthesis.getVoices();
////// for (let i = 0; i < voices.length; i++) {
////// SafeAddToListbox("Voice: " + voices[i].name);
////// // console.log(voices[i].name)
////// }
////// ////SafeAddToListbox("In getVoice ....");
////// ////return new Promise((resolve, reject) => {
////// //// synth.onvoiceschanged = function () {
////// //// SafeAddToListbox("Changed");
////// //// const voices = synth.getVoices();
////// //// // console.log("see all available languages and voices on your system: ", voices);
////// //// SafeAddToListbox("Before Loop");
////// //// for (let i = 0; i < voices.length; i++) {
////// //// SafeAddToListbox("Voice: " + voices[i].name);
////// //// // console.log(voices[i].name)
////// //// if (voices[i].name == voiceName) {
////// //// resolve(voices[i]);
////// //// }
////// //// }
////// //// }
////// ////synth.getVoices();
////// ////});
//////}
//const synth = window.speechSynthesis;
//getVoice("Google US English", synth);
function generateUID() {
// I generate the UID from two parts here
// to ensure the random number provide enough bits.
var firstPart = (Math.random() * 46656) | 0;
var secondPart = (Math.random() * 46656) | 0;
firstPart = ("000" + firstPart.toString(36)).slice(-3);
secondPart = ("000" + secondPart.toString(36)).slice(-3);
return firstPart + secondPart;
}
//var MachineID = "KENNY";
var MachineID = generateUID();
////MachineID = MachineID.substring(0, 8);
////function uuidv4() {
//// return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
//// (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
//// );
////}
/**
* Calculate a 32 bit FNV-1a hash
* Found here: https://gist.github.com/vaiorabbit/5657561
* Ref.: http://isthe.com/chongo/tech/comp/fnv/
*
* @param {string} str the input value
* @param {boolean} [asString=false] set to true to return the hash value as
* 8-digit hex string instead of an integer
* @param {integer} [seed] optionally pass the hash of the previous chunk
* @returns {integer | string}
*/
function hashFnv32a(str, asString, seed) {
/*jshint bitwise:false */
var i, l,
hval = (seed === undefined) ? 0x811c9dc5 : seed;
for (i = 0, l = str.length; i < l; i++) {
hval ^= str.charCodeAt(i);
hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);
}
if (asString) {
// Convert to 8 digit hex string
return ("0000000" + (hval >>> 0).toString(16)).substr(-8);
}
return hval >>> 0;
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
var UniqueID = getCookie("username");
if (UniqueID == null || UniqueID == "") {
var UniqueID = hashFnv32a(navigator.userAgent, true, 0);
}
//SafeAddToListbox(UniqueID);
var context = null;
var audioVolume = null;
function createAudioContext() {
//context = new (window.AudioContext || window.webkitAudioContext)();
//return;
var AudioContext = window.AudioContext // Default
|| window.webkitAudioContext // Safari and old versions of Chrome
|| false;
if (AudioContext) {
// Do whatever you want using the Web Audio API
context = new AudioContext();
audioVolume = context.createGain();
context.onstatechange = function () {
SafeAddToListbox("Audio Context State Changed: " + context.state);
}
// ...
} else {
// Web Audio API is not supported
// Alert the user
displayToast("Sorry, but the Web Audio API is not supported by your browser. Please, consider upgrading to the latest version or downloading Google Chrome or Mozilla Firefox");
}
}
createAudioContext();
//var context = new (window.AudioContext || window.webkitAudioContext)();
//if (context != null) {
// var audioVolume = context.createGain();
// context.onstatechange = function () {
// SafeAddToListbox("Audio Context State Changed: " + context.state);
// }
//}
//function isAudioRunning() {
// SafeAddToListbox("State: " + context.state);
// if (context.state == "running") return true;
// return true;
//}
//== Event Listeners =====
window.addEventListener('load', init, false);
function init() {
//connectToMQTT();
displayToast("Double-Click For Menu, SSL = " + useSSL);
}
document.addEventListener('touchstart', function () {
SafeAddToListbox("touch start");
}, false);
document.addEventListener('touchend', function () {
SafeAddToListbox("touch end");
playSoftClick();
//if ($('#dialog').dialog('isOpen') == false) {
displayDialog();
//}
}, false);
window.addEventListener('click', function () {
//SafeAddToListbox("mouse click");
}, false);
document.addEventListener('mousedown', function () {
//SafeAddToListbox("mouse down");
}, false);
window.addEventListener('dblclick', function (e) {
var al = document.getElementById('kenny');
al.focus();
displayDialog();
});
// ------------------------ pwa stuff ------------------------------------------------
//if ('serviceWorker' in navigator) {
// window.addEventListener('load', function () {
// navigator.serviceWorker.register('/sw.js').then(function (registration) {
// // Registration was successful
// console.log('ServiceWorker registration successful with scope: ', registration.scope);
// }, function (err) {
// // registration failed :(
// console.log('ServiceWorker registration failed: ', err);
// });
// });
//}
//Now you can check that a service worker is
//enabled by going to
//chrome://inspect/#service-workers and looking for your site
//chrome://serviceworker-internals
let deferredPrompt;
window.addEventListener('beforeinstallprompt', (e) => {
displayToast("In beforeinstallprompt");
SafeAddToListbox("beforeinstallprompt");
// Prevent the mini-infobar from appearing on mobile
e.preventDefault();
// Stash the event so it can be triggered later.
deferredPrompt = e;
// Update UI notify the user they can install the PWA
//showInstallPromotion();
});
window.addEventListener('appinstalled', (evt) => {