This repository was archived by the owner on Oct 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.js
More file actions
5483 lines (5167 loc) · 194 KB
/
chat.js
File metadata and controls
5483 lines (5167 loc) · 194 KB
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
var soundboardEnabled = true;
function handleErrors(e) {
//Handle errors and display them to the user,
//also log inside the devloper tools console
//to try to give further information about this error.
document.body.style.color = "red";
document.body.style.background = "black";
document.body.style.fontFamily = "arial";
document.body.innerHTML =
"<h1>Whoops!</h1>" +
e +
"<hr>" +
"The page encountered an unhandled error. This means that Random Rants could not start successfully. Try reloading by clicking the refresh button on your browser, or click the button below to preform a refresh.<br>" +
"Try clearing your browser cookies if this error continues.<br>If you're a developer, check the developer console for further details about this error message.<br>" +
'<button onclick="window.location.reload()">Refresh</button>';
console.error(e);
}
var dialog = window.dialog;
var rrLoadingStatus = document.getElementById("rrLoadingStatusSpan");
var stunServerList = [
{
label: "Google Server",
value: "stun:stun.l.google.com:19302",
},
{
label: "Freecall.com",
value: "stun:stun.freecall.com:3478",
},
{
label: "Aeta.com",
value: "stun:stun.aeta.com:3478",
},
{
label: "Awa-shima.com",
value: "stun:stun.awa-shima.com:3478",
},
{
label: "Cope.es",
value: "stun:stun.cope.es:3478",
},
{
label: "Stunprotocol.org",
value: "stun:stun.stunprotocol.org:3478",
},
{
label: "Twilio.com",
value: "stun:global.stun.twilio.com:3478",
},
];
(async function () {
try {
rrLoadingStatus.textContent = "Loading...";
var acp = "egg123";
var activationDiv = document.getElementById("activationDiv");
var messages = document.getElementById("messages");
var screenCaptureUsername = document.getElementById(
"screenCaptureUsername"
);
var loadingCVS = document.createElement("canvas");
var loadingCTX = loadingCVS.getContext("2d");
var img = document.createElement("img");
img.onload = function () {
loadingCVS.width = this.width * 2;
loadingCVS.height = this.height * 2;
loadingCTX.fillStyle = "black";
loadingCTX.fillRect(0, 0, this.width, this.height);
loadingCTX.drawImage(
this,
this.width / -2 + loadingCVS.width / 2,
this.height / -2 + loadingCVS.height / 2,
this.width,
this.height
);
};
img.src = "webrtc.svg";
var specialRTCIDChars = "abcdefghijklmnopqrstuvwxyz123456789";
var specialRTCID = "";
var ind = 0;
while (ind < 9) {
specialRTCID +=
specialRTCIDChars[
Math.round(Math.random() * (specialRTCIDChars.length - 1))
];
ind += 1;
}
var loadingStream = loadingCVS.captureStream(60);
var soundboardButtons = document.getElementById("soundboardButtons");
var mainModes = [
{
label: "None (Let browser decide)",
value: "",
},
{ label: "Store tempomarily (Clears when page closes)", value: "memory" },
{
label: "Store in browser (Clears when you clear cookies)",
value: "storage",
},
{ label: "Both (Do both of them)", value: "both" },
];
var preloader = {
preloaded: {},
groupSettings: {},
fileLoaded: function (data, url) {},
groups: [
{
id: "profilePictures",
name: "Profile pictures",
discription:
"Profile pictures for every user (including server messages).",
modes: mainModes,
default: "none",
},
{
id: "sounds",
name: "Random rants sounds",
discription: "Every sound used by Random Rants.",
modes: mainModes,
default: "none",
},
{
id: "serverCheck",
name: "Server check during page loading",
discription:
"Warns you if the file server is down, or unaccessable during loading. Disabling will make loading times faster, but with a cost of waiting longer for profile pictures to load (unless they are preloaded with storage).",
modes: [
{
label: "On",
value: "on",
},
{
label: "Off",
value: "off",
},
],
default: "off",
},
{
id: "disableWebrtc",
name: "Disable WebRTC",
discription:
"WARNING!!!! This disables the screenshare functionality and camera functions.",
modes: [
{
label: "On",
value: "on",
},
{
label: "Off",
value: "off",
},
],
default: "off",
},
{
id: "webrtcServer",
name: "WebRTC Stun server",
discription:
"(RELOAD RECOMMENDED IF CHANGED) This only changes the server used to send and recive data between WebRTC connections. However, if the server used for WebRTC is blocked/unavailiable for the host, or you, then you won't be able to see their WebRTC content.",
modes: stunServerList,
default: stunServerList[0].value,
},
],
clearPreloadStorage: function clearPreloadStorage() {
var thingsCleared = 0;
for (var key in localStorage) {
if (!localStorage.hasOwnProperty(key)) continue;
if (key.startsWith("preload_")) {
localStorage.removeItem(key);
thingsCleared += 1;
}
}
return thingsCleared;
},
getURL: function getURL(url, group) {
return new Promise(async (accept, reject) => {
try {
if (
preloader.groupSettings[group] !== "storage" &&
preloader.groupSettings[group] !== "both"
) {
accept(url);
return;
}
if (
preloader.groupSettings[group] == "storage" ||
preloader.groupSettings[group] == "both"
) {
var preloadLocalStorage = localStorage.getItem("preload_" + url);
if (preloadLocalStorage) {
preloader.fileLoaded(preloadLocalStorage, url);
accept(preloadLocalStorage);
}
}
if (!preloader.preloaded[url]) {
var a = await fetch(url);
var b = await a.blob();
if (!a.ok) {
accept(url);
return;
}
var reader = new FileReader();
reader.onload = function () {
if (
preloader.groupSettings[group] == "memory" ||
preloader.groupSettings[group] == "both"
) {
preloader.preloaded[url] = reader.result;
}
if (
preloader.groupSettings[group] == "storage" ||
preloader.groupSettings[group] == "both"
) {
if (reader.result.length < 3000) {
localStorage.setItem("preload_" + url, reader.result);
}
}
preloader.fileLoaded(reader.result, url);
accept(reader.result);
};
reader.onerror = function () {
accept(url);
};
reader.readAsDataURL(b);
} else {
preloader.fileLoaded(preloader.preloaded[url], url);
accept(preloader.preloaded[url]);
}
} catch (e) {
accept(url);
}
});
},
};
window.preloader = preloader;
setInterval(() => {
if (window.screenShareClient) {
if (preloader.groupSettings.webrtcServer) {
window.screenShareClient.iceServers[0].urls =
preloader.groupSettings.webrtcServer;
}
}
}, 1000 / 30);
var fileLoadingSettings = document.getElementById("fileLoadingSettings");
var fileLoadingSettingsExit = document.getElementById(
"fileLoadingSettingsExit"
);
var loadingSettingsProperties = document.getElementById(
"loadingSettingsProperties"
);
var loadingSettingsSize = document.getElementById("loadingSettingsSize");
var clearLoadingStorage = document.getElementById("clearLoadingStorage");
clearLoadingStorage.onclick = function () {
dialog.confirm("Do you really want to do this?").then((confirmed) => {
if (confirmed) {
var cleared = preloader.clearPreloadStorage();
dialog.alert(
`Cleared ${cleared} cached files. Reloading Random Rants is recommended.`
);
}
});
};
var preloaderSettingsSelections = {};
function savePreloaderSettings() {
localStorage.setItem(
"preloaderSettings",
JSON.stringify(preloader.groupSettings, null, "")
);
}
var loadedSize = 0;
function updateSizeText() {
loadingSettingsSize.textContent =
Math.round(loadedSize * 1) / 1 + "MB (May not be accurate)";
}
preloader.fileLoaded = function (data) {
loadedSize += data.length / 1e6;
updateSizeText();
};
updateSizeText();
function makeGroupDiv(group) {
var div = document.createElement("div");
div.className = "storageSettingOption";
var textDiv = document.createElement("div");
textDiv.style.maxWidth = "300px";
textDiv.style.width = "100%";
div.append(textDiv);
var name = document.createElement("span");
name.textContent = group.name;
name.setAttribute("cssheader", "");
textDiv.append(name);
textDiv.append(document.createElement("br"));
var discription = document.createElement("span");
discription.textContent = group.discription;
discription.setAttribute("cssdiscription", "");
textDiv.append(discription);
var selectContainer = document.createElement("div");
selectContainer.setAttribute("selectcontainer", "");
div.append(selectContainer);
var select = document.createElement("select");
select.className = "roundborder inputText1";
selectContainer.append(select);
for (var mode of group.modes) {
var option = document.createElement("option");
option.textContent = mode.label;
option.value = mode.value;
if (group.default == mode.value) {
option.selected = true;
}
if (typeof preloader.groupSettings[group.id] !== "undefined") {
if (preloader.groupSettings[group.id] == mode.value) {
option.selected = true;
} else {
option.selected = false;
}
} else {
preloader.groupSettings[group.id] = mode.default;
}
select.append(option);
}
select.oninput = function () {
preloader.groupSettings[group.id] = select.value;
savePreloaderSettings();
};
preloaderSettingsSelections[group.id] = select;
return div;
}
function setupLoadingSettingsProperties() {
for (var child of loadingSettingsProperties.children) {
child.remove();
}
for (var group of preloader.groups) {
var div = makeGroupDiv(group);
loadingSettingsProperties.append(div);
}
}
if (localStorage.getItem("preloaderSettings")) {
preloader.groupSettings = JSON.parse(
localStorage.getItem("preloaderSettings")
);
}
setupLoadingSettingsProperties();
window.openFileLoadingSettings = function () {
fileLoadingSettings.hidden = false;
};
fileLoadingSettingsExit.onclick = function () {
fileLoadingSettings.hidden = true;
};
window.specialCommandsActivated = false;
function addVIPRoom() {
var serverselect = document.getElementById("Server");
var option = document.createElement("option");
option.textContent = "VIP/Admin room";
option.setAttribute("title", "VIP/Admin room");
option.setAttribute("value", "viproom");
option.selected = true; // Set the new option as selected
serverselect.append(option); // Append the option to the dropdown
}
if (localStorage.getItem("activated") == acp) {
window.specialCommandsActivated = true;
activationDiv.hidden = true;
addVIPRoom();
}
var activateCommandPassword = document.getElementById(
"activateCommandPassword"
);
var activateCommandsInput = document.getElementById(
"activateCommandsPassword"
);
activateCommandPassword.onclick = function () {
if (window.specialCommandsActivated) {
dialog.alert("Already activated!");
} else {
if (acp == activateCommandsInput.value) {
window.specialCommandsActivated = true;
activationDiv.hidden = true;
dialog.alert("Activation successful!");
localStorage.setItem("activated", acp);
addVIPRoom();
if (window.updateServerList) {
window.updateServerList();
}
} else {
dialog.alert("Sorry, this is not the password.");
}
}
};
var emojiserver = ""; //Leave this empty for this site as the server.
function gvbvdxxChatEmoji(gcimg) {
return `https://jasonglenevans.github.io/GvbvdxxChatEmojis/${gcimg}`;
}
var emojisV2Emojis = {};
var emojisV2 = [
{
type: "header",
label: "Sonic Icons",
},
{
type: "emoji",
},
];
var gcEmojis = [
"I_EGG.ICO",
"I_EGG2.ICO",
"I_KNACK.ICO",
"I_KNACS2.ICO",
"I_MILES.ICO",
"I_MILES2.ICO",
"I_SONIC.ICO",
"I_SONIC2.ICO",
"SONIC_SCREAM.png",
"SONIC_BLUE_SPHERE.png",
"sonic-tails.gif",
"MSG_1.gif",
"MSG_2.png",
"MSG_3.png",
"MSG_4.png",
"MSG_5.png",
"MSG_6.png",
"MSG_7.png",
"MSG_8.png",
"MSG_9.png",
"CATTO_BOI.gif",
"CHEESEPUFFS.jpg",
];
var gcEmojisURL = [];
for (var img of gcEmojis) {
gcEmojisURL.push(gvbvdxxChatEmoji(img));
}
var firstGCEmoji = gvbvdxxChatEmoji(gcEmojis[0]);
var sections = {
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/costume1.svg?v=1725635781707":
"Random Rants Emojis",
"https://random-rants-chat.github.io/randomrants-emojis/icons/audio.svg":
"Random Rants Icon Emojis",
"https://random-rants-chat.github.io/randomrants-emojis/img/smw-bored.png":
"Pixel Emojis",
};
sections[firstGCEmoji] = "Gvbvdxx Chat Emojis";
var emojis = gcEmojisURL.concat([
//Place urls in quotes, and make sure to add commas at the end of the quotes to prevent random errors from happening.
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/costume1.svg?v=1725635781707",
"https://random-rants-chat.github.io/randomrants-emojis/img/guy_pointing.svg",
"https://random-rants-chat.github.io/randomrants-emojis/img/mrbeaast.svg",
"https://random-rants-chat.github.io/randomrants-emojis/img/obama.svg",
"https://random-rants-chat.github.io/randomrants-emojis/img/whatthe.jpg",
"https://random-rants-chat.github.io/randomrants-emojis/img/anotherthing.svg",
"https://random-rants-chat.github.io/randomrants-emojis/img/sad.svg",
"https://random-rants-chat.github.io/randomrants-emojis/img/thing.svg",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/amogus.svg?v=1725635605024",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/_ROCK%20(1).svg?v=1725635989147",
"https://random-rants-chat.github.io/randomrants-emojis/img/dance.gif",
"https://random-rants-chat.github.io/randomrants-emojis/img/sonk.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/2.png",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/uVnwhMjZTg1uk3vsdiCc.jpeg?v=1724254756623",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/sonic-sonic-the-hedgehog.gif?v=1714953946021",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/ezgif-4-71ea9f9245.gif?v=1714954639819",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/sonic-dance-fast-goofy-meme.gif?v=1714954633775",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/tails-sonic%20(1).gif?v=1714954866938",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/loaf.png?v=1714955508974",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/spongebob-squarepants-leaving.gif?v=1714955760113",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/Delete that Right Now Sonic Meme?v=1714955952963",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/Those games are very cool Mario loves you?v=1714956681859",
"https://cdn.glitch.global/7c96d5e9-c306-40b6-a0ef-5f5da70ecb6b/Sad2.png?v=1715340685313",
"https://cdn.glitch.global/fa5e6d1e-8b42-4a21-81e8-03fd7cd6401a/sonic-shocked.gif?v=1714955288854",
"https://cdn.glitch.global/7c96d5e9-c306-40b6-a0ef-5f5da70ecb6b/cat.png?v=1715342049891",
"https://random-rants-chat.github.io/randomrants-emojis/icons/audio.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/clearchat.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/image.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/import.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/mail.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/mic-active.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/mic.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/nomail.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/screenshare.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/send.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/sendhidden.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/stopscreenshare.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/video.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-angry.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-crying.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-eyebrow.svg?n=1",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-hmm.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-laughing.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-meh.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-oh.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-sad.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-sad2.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-slightcry.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-straightface.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-wink.svg",
"https://random-rants-chat.github.io/randomrants-emojis/icons/emoji-nerd.svg",
"https://random-rants-chat.github.io/randomrants-emojis/img/smw-bored.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/smw-grin.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/smw-laugh.gif",
"https://random-rants-chat.github.io/randomrants-emojis/img/smw-smile.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/smw-straightface.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/smw-uhoh.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/smw-uhoh2.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/coin.gif",
"https://random-rants-chat.github.io/randomrants-emojis/img/num0.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num1.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num2.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num3.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num4.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num5.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num6.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num7.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num8.png",
"https://random-rants-chat.github.io/randomrants-emojis/img/num9.png",
]);
var notifcationLogo = "favicon.png";
function bin2String(array) {
var result = "";
for (var i = 0; i < array.length; i++) {
result += String.fromCharCode(parseInt(array[i], 2));
}
return result;
}
function string2Bin(str) {
var result = [];
for (var i = 0; i < str.length; i++) {
result.push(str.charCodeAt(i));
}
return result;
}
var cssFonts = [
{
label: "Arial",
value: "arial",
},
{
label: "Times New Roman",
value: "serif",
},
{
label: "Sans Serif",
value: "sans-serif",
},
{
label: "Monospace",
value: "monospace",
},
{
label: "Cursive",
value: "cursive",
},
{
label: "Fantasy",
value: "fantasy",
},
{
label: "Microsoft Comic Sans",
value: "comicsansms",
},
{
label: "Jersey 15 (Google Fonts)",
value: '"Jersey 15"',
},
{
label: "Jacquard 12 (Google Fonts)",
value: '"Jacquard 12 Charted"',
},
{
label: "Pixelify Sans (Google Fonts)",
value: '"Pixelify Sans"',
},
{
label: "Permanent Marker (Google Fonts)",
value: '"Permanent Marker"',
},
{
label: "Tektur (Google Fonts)",
value: '"Tektur"',
},
{
label: "Pixel (Scratch 3.0 Fonts)",
value: '"Pixel"',
},
];
var defaultCssProperties = {
"--bg-color": {
label: "Main background color",
iniSection: "MainStyles",
iniName: "BGColor",
type: "color",
value: "#b8b8b8",
},
"--header-color": {
label: "Header color",
iniSection: "HeaderStyles",
iniName: "BGColor",
type: "color",
value: "#b8b8b8",
},
"--main-font": {
label: "Default font",
iniSection: "MainStyles",
iniName: "FontName",
type: "font",
value: "arial",
},
"--main-text-color": {
label: "Default text color",
iniSection: "MainStyles",
iniName: "TextColor",
type: "color",
value: "black",
},
"--input-bg-color": {
label: "Input background color",
iniSection: "InputStyles",
iniName: "BGColor",
type: "color",
value: "#363636",
},
"--input-text-color": {
label: "Input text color",
iniSection: "InputStyles",
iniName: "TextColor",
type: "color",
value: "#c9c9c9",
},
"--input-border-color": {
label: "Input border color",
iniSection: "InputStyles",
iniName: "BorderColor",
type: "color",
value: "#1f1f1f",
},
"--input-border-width": {
label: "Input border width",
type: "number",
value: 3,
min: 0,
max: 20,
end: "px",
iniSection: "InputStyles",
iniName: "BorderWidth",
},
"--messages-bg-color": {
label: "Messages box background color",
type: "color",
value: "#919191",
iniSection: "MessageBoxStyles",
iniName: "BGColor",
},
"--messages-text-color": {
label: "Messages default text color",
type: "color",
value: "#fcfcfc",
iniSection: "MessageStyles",
iniName: "TextColor",
},
"--profile-background": {
label: "Profile picture background color",
type: "color",
value: "#969696",
iniSection: "ProfileStyles",
iniName: "BGColor",
},
"--profile-border-color": {
label: "Profile picture border color",
type: "color",
value: "#7d7d7d",
iniSection: "ProfileStyles",
iniName: "BorderColor",
},
"--separator-color": {
label: "Seperator color",
type: "color",
value: "#696969",
iniSection: "SeperatorStyles",
iniName: "Color",
},
"--textbox-bg-color": {
label: "Textbox background color",
type: "color",
value: "#e0e0e0",
iniSection: "TextboxInputStyles",
iniName: "BGColor",
},
"--textbox-border-color": {
label: "Textbox border color",
type: "color",
value: "#696969",
iniSection: "TextboxInputStyles",
iniName: "BorderColor",
},
"--button-bg-color": {
label: "Button background color",
type: "color",
value: "#e0e0e0",
iniSection: "ButtonStyles",
iniName: "BGColor",
},
"--button-text-color": {
label: "Button text color",
type: "color",
value: "#696969",
iniSection: "ButtonStyles",
iniName: "TextColor",
},
"--button-hover-bg-color": {
label: "Button background color (When cursor over button)",
type: "color",
value: "#f2f2f2",
iniSection: "ButtonStyles",
iniName: "HoverBGColor",
},
"--button-disabled-color": {
label: "Button background color (When disabled/off)",
type: "color",
value: "#5e5e5e",
iniSection: "ButtonStyles",
iniName: "DisabledBGColor",
},
"--loading-spinner-color": {
label: "Loading spinner color",
type: "color",
value: "#878787",
iniSection: "LoadingSpinnerStyles",
iniName: "Color",
},
"--border-radius": {
label: "Default border radius",
type: "number",
value: 3,
min: 0,
max: 20,
end: "px",
iniSection: "MainStyles",
iniName: "BorderRadius",
},
"--profile-border-radius": {
label: "Profile border radius",
type: "number",
value: 64,
min: 0,
max: 100,
end: "px",
iniSection: "ProfileStyles",
iniName: "BorderRadius",
},
"--popup-box-bg-color": {
label: "Popup dialog background color",
type: "color",
value: "#FFFFFF",
iniSection: "PopupBoxStyles",
iniName: "BGColor",
},
"--popup-box-text-color": {
label: "Popup dialog text color",
type: "color",
value: "#000000",
iniSection: "PopupBoxStyles",
iniName: "TextColor",
},
"--link-text-color": {
label: "Link text color",
type: "color",
value: "#4287f5",
iniSection: "LinkStyles",
iniName: "TextColor",
},
"--main-font-size": {
label: "Default font size (in pixels)",
type: "number",
value: 15,
min: 0,
max: 150,
end: "px",
iniSection: "MainStyles",
iniName: "MainFontSize",
},
"--selected-emoji-popup-dialog-bg-color": {
label: "Emoji Added Popup (Background Color)",
type: "color",
value: "#15e64d",
iniSection: "EmojiAddedDialogStyles",
iniName: "BGColor",
},
"--selected-emoji-popup-dialog-border-color": {
label: "Emoji Added Popup (Border Color)",
type: "color",
value: "#23a646",
iniSection: "EmojiAddedDialogStyles",
iniName: "BorderColor",
},
"--selected-emoji-popup-dialog-text-color": {
label: "Emoji Added Popup (Text Color)",
type: "color",
value: "#e6ffec",
iniSection: "EmojiAddedDialogStyles",
iniName: "TextColor",
},
"--selected-emoji-popup-dialog-border-width": {
label: "Emoji Added Popup (Border Width)",
type: "number",
value: 2,
min: 0,
max: 150,
end: "px",
iniSection: "EmojiAddedDialogStyles",
iniName: "BorderWidth",
},
"--server-notifcation-color": {
label: "Server Notifcation Color",
type: "color",
value: "#ffd000",
iniSection: "ServerNotifcationStyles",
iniName: "Color",
},
"--default-font-weight": {
label: "Main font weight",
type: "number",
value: 0,
min: 0,
max: 1000,
iniSection: "MainStyles",
iniName: "FontWeight",
},
"--connection-status-normal-color": {
label: "(Connection Status) Normal Color",
type: "color",
value: "#000000",
iniSection: "ConnectionStatusStyles",
iniName: "NormalColor",
},
"--connection-status-connected-color": {
label: "(Connection Status) Success Color",
type: "color",
value: "#039e00",
iniSection: "ConnectionStatusStyles",
iniName: "SuccessColor",
},
"--connection-status-error-color": {
label: "(Connection Status) Error Color",
type: "color",
value: "#9e0000",
iniSection: "ConnectionStatusStyles",
iniName: "ErrorColor",
},
"--color-select-bg-color": {
label: "(Color selection box) Background Color",
type: "color",
value: "#9e9e9e",
iniSection: "ColorSelectorBoxStyles",
iniName: "BGColor",
},
"--color-select-border-color": {
label: "(Color selection box) Border Color",
type: "color",
value: "#858585",
iniSection: "ColorSelectorBoxStyles",
iniName: "BorderColor",
},
"--color-select-highlight-color": {
label: "(Color selection box) Highlight Border Color",
type: "color",
value: "#FFFFFF",
iniSection: "ColorSelectorBoxStyles",
iniName: "HighlightColor",
},
"--soundboard-button-bgcolor": {
label: "(Soundboard) Button background color",
type: "color",
value: "#a1a1a1",
iniSection: "SoundboardStyles",
iniName: "ButtonColor",
},
"--soundboard-button-hover-bgcolor": {
label: "(Soundboard) Button hover background color",
type: "color",
value: "#bfbfbf",
iniSection: "SoundboardStyles",
iniName: "HoveredButtonColor",
},
"--soundboard-button-border-color": {
label: "(Soundboard) Button hover border color",
type: "color",
value: "#545454",
iniSection: "SoundboardStyles",
iniName: "ButtonBorderColor",
},
"--soundboard-stop-button-bgcolor": {
label: "(Soundboard) Stop Button background color",
type: "color",
value: "#d90000",
iniSection: "SoundboardStyles",
iniName: "ButtonColor",
},
"--soundboard-stop-button-hover-bgcolor": {
label: "(Soundboard) Stop Button hover background color",
type: "color",
value: "#ff0000",
iniSection: "SoundboardStyles",
iniName: "HoveredButtonColor",
},
"--soundboard-stop-button-border-color": {
label: "(Soundboard) Stop Button hover border color",
type: "color",
value: "#750000",
iniSection: "SoundboardStyles",
iniName: "ButtonBorderColor",
},
/*"--usercolors-1": {
label: "(User Pallete Colors) Color 1",
type: "color",
value: "#ed1c1c",
iniSection: "UserColorPallete",
iniName: "Color1",
},
"--usercolors-2": {
label: "(User Pallete Colors) Color 2",
type: "color",
value: "#ed811c",
iniSection: "UserColorPallete",
iniName: "Color2",
},
"--usercolors-3": {
label: "(User Pallete Colors) Color 3",
type: "color",
value: "#eddf1c",
iniSection: "UserColorPallete",
iniName: "Color3",
},
"--usercolors-4": {
label: "(User Pallete Colors) Color 4",
type: "color",
value: "#b5ed1c",
iniSection: "UserColorPallete",
iniName: "Color4",
},
"--usercolors-5": {
label: "(User Pallete Colors) Color 5",
type: "color",
value: "#69ed1c",
iniSection: "UserColorPallete",
iniName: "Color5",
},
"--usercolors-6": {
label: "(User Pallete Colors) Color 6",
type: "color",
value: "#1ced58",
iniSection: "UserColorPallete",
iniName: "Color6",
},
"--usercolors-7": {
label: "(User Pallete Colors) Color 7",
type: "color",
value: "#1cedbc",
iniSection: "UserColorPallete",
iniName: "Color7",
},