forked from LogicalStoner/TinyChat-Room-Theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTinychatRoomTheme.rtf
4556 lines (4556 loc) · 168 KB
/
TinychatRoomTheme.rtf
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
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\colortbl ;\red0\green0\blue255;}
{\*\generator Riched20 10.0.17763}\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs22\lang9 // ==UserScript==\par
// @name TINYCOLORFUL ROOM THEME\par
// @namespace\par
// @version 2019.115\par
// @description Editing Overall Theme of Tinychat. Install and refresh.\par
// @author LogicalStoner\par
//@match {{\field{\*\fldinst{HYPERLINK https://tinychat.com/* }}{\fldrslt{https://tinychat.com/*\ul0\cf0}}}}\f0\fs22\par
// @match {{\field{\*\fldinst{HYPERLINK https://tinychat.com/room/* }}{\fldrslt{https://tinychat.com/room/*\ul0\cf0}}}}\f0\fs22\par
// @exclude {{\field{\*\fldinst{HYPERLINK https://tinychat.com/room/*?1 }}{\fldrslt{https://tinychat.com/room/*?1\ul0\cf0}}}}\f0\fs22\par
// @grant GM_setValue\par
// @grant GM_getValue\par
// @grant GM_listValues\par
\par
// ==/UserScript==\par
/* jshint -W097 */\par
\par
wsdata = [];\par
chatlogMain = "";\par
userlistLog = \{\};\par
userlistLogQuits = \{\};\par
function tcl(m) \{ console.log(m); \};\par
newline = `\par
`;\par
\par
(function () \{\par
\tab WebSocket.prototype._send = WebSocket.prototype.send;\par
\tab WebSocket.prototype.send = function (data) \{\par
\tab\tab this._send(data);\par
\tab\tab this.addEventListener('message', function (msg) \{\par
\tab\tab\tab try\{\par
\tab\tab\tab if (msg.data.includes('"tc":"msg"') && msg.data.includes('"handle"')) \{\par
\tab\tab\tab\tab var messageArr = JSON.parse(msg.data);\par
\tab\tab\tab\tab var handle = messageArr["handle"];\par
\tab\tab\tab\tab chatlogAdd(userlistLog[handle]["nick"] + ": " + messageArr["text"]);\par
\tab\tab\tab\}\par
\tab\tab\tab if (msg.data.includes('"item"')) \{\par
\tab\tab\tab\tab if (msg.data.includes('tc":"yut_play"')) \{\par
\tab\tab\tab\tab\tab var youtubeArr = JSON.parse(msg.data);\par
\tab\tab\tab\tab\tab var id = youtubeArr["item"]["id"];\par
\tab\tab\tab\tab\tab chatlogAdd("- YouTube video started: " + "{{\field{\*\fldinst{HYPERLINK https://youtube.com/watch?v= }}{\fldrslt{https://youtube.com/watch?v=\ul0\cf0}}}}\f0\fs22 " + id);\par
\tab\tab\tab\tab\}\par
\tab\tab\tab\tab if (msg.data.includes('tc":"yut_stop"')) chatlogAdd("- YouTube video stopped.");\par
\tab\tab\tab\}\par
\tab\tab\tab if (msg.data.match(/"tc":"(?:un)?publish"/)) \{\par
\tab\tab\tab\tab var publishArr = JSON.parse(msg.data);\par
\tab\tab\tab\tab var action = (publishArr["tc"] == "publish") ? "is" : "stopped";\par
\tab\tab\tab\tab var handle = publishArr["handle"];\par
\par
\tab\tab\tab\tab if (userlistLog[handle]) var nick = userlistLog[handle]["nick"];\par
\tab\tab\tab\tab else var nick = userlistLogQuits[handle]["nick"];\par
\par
\tab\tab\tab\tab chatlogAdd("- " + nick + " " + action + " broadcasting.");\par
\tab\tab\tab\}\par
\tab\tab\tab if (msg.data.includes('"tc":"sysmsg"')) \{\par
\tab\tab\tab\tab var systext = JSON.parse(msg.data)["text"];\par
\tab\tab\tab\tab chatlogAdd("-- " + systext);\par
\tab\tab\tab\}\par
\tab\tab\tab if (msg.data.includes('"tc":"userlist"')) \{\par
\tab\tab\tab\tab userlistArr = JSON.parse(msg.data)["users"];\par
\tab\tab\tab\tab for (i=0; i < userlistArr.length; i++) \{\par
\tab\tab\tab\tab\tab var nick = userlistArr[i]["nick"];\par
\tab\tab\tab\tab\tab var handle = userlistArr[i]["handle"];\par
\tab\tab\tab\tab\tab var username = userlistArr[i]["username"];\par
\tab\tab\tab\tab\tab userlistLog[handle] = \{"nick":nick, "username":username\};\par
\tab\tab\tab\tab\}\par
\tab\tab\tab\}\par
\tab\tab\tab if (msg.data.includes('"tc":"join","username":"')) \{\par
\tab\tab\tab\tab var userArr = JSON.parse(msg.data)\par
\tab\tab\tab\tab var nick = userArr["nick"];\par
\tab\tab\tab\tab var handle = userArr["handle"];\par
\tab\tab\tab\tab var username = userArr["username"];\par
\tab\tab\tab\tab userlistLog[handle] = \{"nick":nick, "username":username\};\par
\tab\tab\tab\}\par
\tab\tab\tab if (msg.data.includes('"tc":"quit"')) \{\par
\tab\tab\tab\tab var userArr = JSON.parse(msg.data);\par
\tab\tab\tab\tab var handle = userArr["handle"];\par
\tab\tab\tab\tab userlistLogQuits[handle] = userlistLog[handle];\par
\tab\tab\tab\tab delete userlistLog[handle];\par
\tab\tab\tab\}\par
\tab\tab\tab if (msg.data.includes('"tc":"nick"')) \{\par
\tab\tab\tab\tab var userArr = JSON.parse(msg.data);\par
\tab\tab\tab\tab var handle = userArr["handle"];\par
\tab\tab\tab\tab var nick = userArr["nick"];\par
\tab\tab\tab\tab userlistLog[handle]["nick"] = nick;\par
\tab\tab\tab\}\par
\tab\tab\tab\}catch(e)\{console.log("TES error WS: " + e.message);\}\par
\tab\tab\}, false);\par
\tab\tab this.send = function (data) \{\par
\tab\tab\tab this._send(data);\par
\tab\tab\tab wsdata.push(data);\par
\tab\tab\};\par
\tab\tab wsdata.push(data);\par
\par
\tab\}\par
\par
\tab function chatlogAdd(arg) \{\par
\tab\tab var timestamp = new Date().toLocaleTimeString('en-US', \{ hour12: false \});\par
\tab\tab chatlogMain += "[" + timestamp + "] " + arg + newline;\par
\tab\}\par
\})();\par
\par
var initInterval = setInterval(waitForInit, 500);\par
function waitForInit()\{\par
\tab if (document.querySelector("tinychat-webrtc-app").shadowRoot) \{\par
\tab\tab clearInterval(initInterval);\par
\tab\tab (function() \{\par
\par
// Actual userscript starts here //\par
\par
browserFirefox = (navigator.userAgent.includes("Firefox/") ? true : false);\par
\par
var bodyElem = document.querySelector("body");\par
\par
var webappElem = document.querySelector("tinychat-webrtc-app").shadowRoot;\par
\par
var chatlogOuter = webappElem.querySelector("#room-content");\par
var chatlogOuter2 = webappElem.querySelector("#room-content");\par
var chatlogElem = webappElem.querySelector("tc-chatlog").shadowRoot;\par
var titleElem = webappElem.querySelector("tc-title").shadowRoot;\par
var sidemenuElem = webappElem.querySelector("tc-sidemenu").shadowRoot;\par
var videomoderationElem = sidemenuElem.querySelector("tc-video-moderation").shadowRoot;\par
var videolistElem = webappElem.querySelector("tc-videolist").shadowRoot;\par
\par
var chatlistElem = sidemenuElem.querySelector("tc-chatlist").shadowRoot;\par
var userlistElem = sidemenuElem.querySelector("tc-userlist").shadowRoot;\par
var userContextmenuElem = userlistElem.querySelector("tc-user-contextmenu").shadowRoot;\par
\par
var chatlogCSS = chatlogElem.querySelector("#chat-wrapper");\par
var sidemenuCSS = sidemenuElem.querySelector("#sidemenu");\par
var videomoderationCSS = videomoderationElem.querySelector("#moderatorlist");\par
var webappCSS = webappElem.querySelector("#room");\par
var chatlistCSS = chatlistElem.querySelector("#chatlist");\par
var userlistCSS = userlistElem.querySelector("#userlist");\par
var userContextmenuCSS = userContextmenuElem.querySelector("#main");\par
var titleCSS = titleElem.querySelector("#room-header");\par
var videolistCSS = videolistElem.querySelector("#videolist");\par
var bodyCSS = document.querySelector("body");\par
\par
var resourceDirectory = document.querySelector('link[rel="manifest"]').getAttribute("href").split("manifest")[0]; // \\/([\\d\\.\\-])+\\/\par
\par
var audioPop = new Audio(resourceDirectory + 'sound/pop.mp3');\par
var settingMentions = [];\par
var giftsElemWidth = 127;\par
var freshInstall = (GM_listValues().length == 0);\par
var isModerator = (!userlistElem.querySelector("#button-banlist").classList.contains("hidden"));\par
var isPaidAccount = (sidemenuElem.querySelector("#sidemenu-wider"));\par
\par
var messageQueryString = "#chat-content .message";\par
var camQueryString = ".videos-items:last-child > .js-video";\par
\par
var urlAddress = new URL(window.location.href);\par
var urlPars = urlAddress.searchParams;\par
\par
var roomName = document.querySelector("tinychat-webrtc-app").getAttribute("roomname");\par
var joinTime = getFormattedDateTime(new Date(), "time");\par
var joinDate = getFormattedDateTime(new Date());\par
document.title = roomName + " - Tinychat";\par
\par
\par
var userinfoCont = sidemenuElem.querySelector("#user-info > div");\par
if (userinfoCont.hasAttribute("title")) \{\par
\tab bodyCSS.classList.add("logged-in");\par
\tab sidemenuElem.querySelector("#sidemenu").classList.add("logged-in");\par
\}\par
if (isModerator) \{\par
\tab userlistElem.querySelector("#userlist").classList.add("tes-mod");\par
\tab chatlistElem.querySelector("#chatlist").classList.add("tes-mod");\par
\}\par
\par
\par
var settingsQuick = \{\par
\tab "Autoscroll" : (GM_getValue("tes-Autoscroll") == "true" || GM_getValue("tes-Autoscroll") == undefined),\par
\tab "MentionsMonitor" : (GM_getValue("tes-MentionsMonitor") == "true" || GM_getValue("tes-MentionsMonitor") == undefined),\par
\tab "NotificationsOff" : (GM_getValue("tes-NotificationsOff") == "true"),\par
\tab "ChangeFont" : (GM_getValue("tes-ChangeFont") == "true" || GM_getValue("tes-ChangeFont") == undefined),\par
\par
\tab "NightMode" : (GM_getValue("tes-NightMode") == "true"),\par
\tab "NightModeBlack" : (GM_getValue("tes-NightModeBlack") == "true" || GM_getValue("tes-NightModeBlack") == undefined),\par
\par
"DefaultMode" : (GM_getValue("tes-NighModeBlack") == "false" || GM_getValue("tes-DarkMode") == "false"),\par
"PinkMode" : (GM_getValue("tes-PinkMode") == "true" || GM_getValue("tes-DarkMode") == "false"),\par
"BlueMode" : (GM_getValue("tes-BlueMode") == "true" || GM_getValue("tes-DarkMode") == "false"),\par
"GreenMode" : (GM_getValue("tes-GreenMode") == "true" || GM_getValue("tes-DarkMode") == "false"),\par
"PurpleMode" : (GM_getValue("tes-PurpleMode") == "true" || GM_getValue("tes-DarkMode") == "false"),\par
\par
\par
\par
\par
\tab "MaxedCamLeft" : (GM_getValue("tes-MaxedCamLeft") == "true" || GM_getValue("tes-MaxedCamLeft") == undefined),\par
\tab "BorderlessCams" : (GM_getValue("tes-BorderlessCams") == "true"),\par
"ChatBelow" : (GM_getValue("tes-ChatBelow") == "true" || GM_getValue("tes-ChatBelow") == undefined)\par
\};\par
if (settingsQuick["ChangeFont"]) bodyElem.classList.add("tes-changefont");\par
if (settingsQuick["MaxedCamLeft"]) videolistCSS.classList.add("tes-leftcam");\par
if (settingsQuick["NightMode"]) nightmodeToggle(true);\par
\par
\tab if (settingsQuick["DefaultMode"]) defaultmodeToggle(false) && greenmodeToggle(false) && bluemodeToggle(false) && pinkmodeToggle(false) && purplemodeToggle(false) && orangemodeToggle(false) && redmodeToggle(false) && featureonemodeToggle(false) && featuretwomodeToggle(false) && darkpurplemodeToggle(false);\par
if (settingsQuick["PinkMode"]) pinkmodeToggle(false) && greenmodeToggle(false) && bluemodeToggle(false) && purplemodeToggle(false) && defaultmodeToggle(false) && orangemodeToggle(false) && redmodeToggle(false) && featureonemodeToggle(false) && featuretwomodeToggle(false) && darkpurplemodeToggle(false);\par
if (settingsQuick["BlueMode"]) bluemodeToggle(false) && greenmodeToggle(false) && pinkmodeToggle(false) && purplemodeToggle(false) && defaultmodeToggle(false) && orangemodeToggle(false) && redmodeToggle(false) && featureonemodeToggle(false) && featuretwomodeToggle(false) && darkpurplemodeToggle(false);\par
if (settingsQuick["GreenMode"]) greenmodeToggle(false) && pinkmodeToggle(false) && bluemodeToggle(false) && purplemodeToggle(false) && defaultmodeToggle(false) && orangemodeToggle(false) && redmodeToggle(false) && featureonemodeToggle(false) && featuretwomodeToggle(false) && darkpurplemodeToggle(false);\par
if (settingsQuick["PurpleMode"]) purplemodeToggle(false) && greenmodeToggle(false) && bluemodeToggle(false) && pinkmodeToggle(false) && defaultmodeToggle(false) && orangemodeToggle(false) && redmodeToggle(false) && featureonemodeToggle(false) && featuretwomodeToggle(false) && darkpurplemodeToggle(false);\par
if (settingsQuick["DarkPurpleMode"]) darkpurplemodeToggle(false) && purplemodeToggle(false) && greenmodeToggle(false) && bluemodeToggle(false) && pinkmodeToggle(false) && defaultmodeToggle(false) && orangemodeToggle(false) && redmodeToggle(false) && featureonemodeToggle(false) && featuretwomodeToggle(false);\par
if (settingsQuick["OrangeMode"]) orangemodeToggle(true) && purplemodeToggle(false) && greenmodeToggle(false) && bluemodeToggle(false) && pinkmodeToggle(false) && defaultmodeToggle(false) && redmodeToggle(false) && featureonemodeToggle(false) && featuretwomodeToggle(false) && darkpurplemodeToggle(false);\par
if (settingsQuick["RedMode"]) redmodeToggle(true) && purplemodeToggle(false) && greenmodeToggle(false) && bluemodeToggle(false) && pinkmodeToggle(false) && defaultmodeToggle(false) && orangemodeToggle(false) && featureonemodeToggle(false) && featuretwomodeToggle(false) && darkpurplemodeToggle(false);\par
if (settingsQuick["FeatureOneMode"]) featureonemodeToggle(true) && redmodeToggle(false) && purplemodeToggle(false) && greenmodeToggle(false) && bluemodeToggle(false) && pinkmodeToggle(false) && defaultmodeToggle(false) && orangemodeToggle(false) && featuretwomodeToggle(false) && darkpurplemodeToggle(false);\par
if (settingsQuick["FeatureTwoMode"]) featuretwomodeToggle(true) && redmodeToggle(false) && purplemodeToggle(false) && greenmodeToggle(false) && bluemodeToggle(false) && pinkmodeToggle(false) && defaultmodeToggle(false) && orangemodeToggle(false) && featureonemodeToggle(false) && darkpurplemodeToggle(false);\par
\par
\par
if (settingsQuick["ChatBelow"]) chatBelowToggle(true);\par
if (browserFirefox) \{\par
\tab titleElem.querySelector("#room-header-info").insertAdjacentHTML("afterend", `\par
\tab <div id="tes-firefoxwarning" class="style-scope tinychat-title"\par
\tab style="font-size: .75em; background: white; color: grey; width: 200px; padding: 5px; line-height: 13px;vertical-align: middle;border: #ddd 1px solid;border-width: 0px 1px 0px 1px;">\par
\tab\tab <div class="style-scope tinychat-title" style="display: table;height: 100%;">\par
\tab\tab\tab <span style="display: table-cell; vertical-align: middle;top: 16%;" class="style-scope tinychat-title">\par
\tab\tab\tab Tinychat Enhancement Suite only supports Chrome. Support for Firefox is coming, but for now it only has autoscrolling.\par
\tab\tab\tab </span>\par
\tab\tab </div>\par
\tab </div>\par
\tab `);\par
\}\par
\par
\par
function waitForSettings() \{\par
\tab if (browserFirefox) \{\par
\tab\tab clearInterval(settingsWaitInterval);\par
\tab\tab return;\par
\tab\}\par
\tab settingsVisible = false;\par
\tab if (titleElem.querySelector("#room-header-gifts") != null) \{\par
\tab\tab clearInterval(settingsWaitInterval);\par
\par
\tab\tab giftsElemWidth = titleElem.querySelector("#room-header-gifts").offsetWidth;\par
\tab\tab if (titleElem.querySelector("#room-header-gifts-items") == null) \{\par
\tab\tab\tab giftsElemWidth1000 = giftsElemWidth + 45;\par
\tab\tab\}\par
\tab\tab else \{ giftsElemWidth1000 = giftsElemWidth; \}\par
\tab\tab if (titleCSS.querySelector("#titleCSS")) \{\par
\tab\tab\tab titleCSS.querySelector("#titleCSS").innerHTML += `\par
\tab\tab\tab\tab #tes-settings \{\par
\tab\tab\tab\tab\tab right: ` + giftsElemWidth + `px;\par
\tab\tab\tab\tab\}\par
\tab\tab\tab `;\par
\tab\tab\}\par
\par
\tab\tab settingsElem = titleElem.querySelector("#room-header-gifts").insertAdjacentHTML("beforebegin", `\par
\tab\tab <div id="tes-settings">\par
\tab\tab\tab <div id="tes-settingsBox" class="hidden">\par
\tab\tab\tab\tab <p id="title">Settings - - - - <></p>\par
\tab\tab\tab\tab <div id="tes-settings-mentions" class="tes-setting-container">\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
\tab\tab\tab\tab\tab <span class="label">\par
\tab\tab\tab\tab\tab\tab Alert phrases\par
\tab\tab\tab\tab\tab\tab <span class="info" data-title='A comma-separated list of phrases to alert/highlight for. Example of 3 phrases: "hello,Google Chrome,sky"'>?</span>\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab\tab <div class="inputcontainer">\par
\tab\tab\tab\tab\tab\tab <input class="text"><button class="save blue-button">save</button>\par
\tab\tab\tab\tab\tab </div>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab\tab <div id="tes-settings-autoscroll" class="tes-setting-container">\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
\tab\tab\tab\tab\tab <span class="label">\par
\tab\tab\tab\tab\tab\tab Autoscroll\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab\tab <div id="tes-settings-notifications" class="tes-setting-container">\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
\tab\tab\tab\tab\tab <span class="label">\par
\tab\tab\tab\tab\tab\tab Hide notifications\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab\tab <div id="tes-settings-changefont" class="tes-setting-container">\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
\tab\tab\tab\tab\tab <span class="label">\par
\tab\tab\tab\tab\tab\tab Improve font\par
\tab\tab\tab\tab\tab\tab <span class="info" data-title='The default font is too thin in some browsers'>?</span>\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab\tab <div id="tes-settings-chatbelow" class="tes-setting-container">\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab\tab <div id="tes-settings-nightmode" class="tes-setting-container">\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
\tab\tab\tab\tab\tab <span class="label">\par
\tab\tab\tab\tab\tab\tab Remove Borders\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\par
\par
\par
<!-- RIGHT SIDE -->\par
\par
\par
<div id="modes" class="tes-setting-container right">\par
\tab\tab <div id="Theme Modes">\par
\tab\tab\tab\tab\tab <div class="head">\par
\tab\tab\tab\tab\tab\tab Theme Modes\par
\tab\tab\tab\tab\tab </div>\par
\tab\tab\tab\tab </div>\par
<div id="tes-settings-defaultmode"><label>\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
<span class="checkmark"></span>\par
\tab\tab\tab\tab\tab <span class="label">\par
<div class="foo default">Dark</div></label>\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab <div id="tes-settings-pinkmode"><label>\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
<span class="checkmark"></span>\par
\tab\tab\tab\tab\tab <span class="label">\par
<div class="foo pink">PINK</div></label>\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab <div id="tes-settings-greenmode"><label>\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
<span class="checkmark"></span>\par
\tab\tab\tab\tab\tab <span class="label">\par
<div class="foo green">GREEN</div></label>\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab <div id="tes-settings-bluemode"><label>\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
<span class="checkmark"></span>\par
\tab\tab\tab\tab\tab <span class="label">\par
<div class="foo blue">BLUE</div></label>\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
\tab\tab\tab <div id="tes-settings-purplemode"><label>\par
\tab\tab\tab\tab\tab <input type="checkbox">\par
<span class="checkmark"></span>\par
\tab\tab\tab\tab\tab <span class="label">\par
<div class="foo purple">PURPLE</div></label>\par
\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab </div>\par
</div>\par
\par
\tab\tab\tab\tab <!--\par
\tab\tab\tab\tab\tab <div id="tes-settings-messageanim" class="tes-setting-container">\par
\tab\tab\tab\tab\tab\tab <input type="checkbox">\par
\tab\tab\tab\tab\tab\tab <span class="label">\par
\tab\tab\tab\tab\tab\tab\tab Disable message animation\par
\tab\tab\tab\tab\tab\tab </span>\par
\tab\tab\tab\tab\tab </div>\par
\tab\tab\tab\tab -->\par
\tab\tab\tab </div>\par
\par
\par
<div id="tes-updateNotifier"><a class="tes-closeButtonSmall">?</a><span>New Feature : Color Modes!</span></div>\par
\tab\tab\tab <div id="tes-settingsGear" title="Settings"><span><img src="https://cdn.pixabay.com/photo/2014/03/24/17/20/gear-295455_960_720.png" width="40px"></span></div>\par
</div>\par
</div>\par
\par
\par
\par
\par
\par
\tab\tab `);\par
\par
\tab\tab titleElem.getElementById("tes-settingsGear").addEventListener("click", toggleSettingsDisplay);\par
titleElem.getElementById("tes-updateNotifier").addEventListener("click", function()\{toggleSettingsDisplay("updateNotifier");\} );\par
\tab\tab if (!freshInstall && GM_getValue("tes-updateNotifSeen") != "2018.112") titleElem.getElementById("tes-updateNotifier").classList.add("visible");\par
\tab\tab titleElem.querySelector("#tes-settings #tes-settings-mentions button.save").addEventListener("click", function()\{mentionsManager("save");\} );\par
\tab\tab !browserFirefox ? mentionsManager("load") : void(0);\par
\par
\tab\tab settingsCheckboxUpdate();\par
\tab\tab titleElem.querySelector("#tes-settings-autoscroll input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-autoscroll");\});\par
\tab\tab titleElem.querySelector("#tes-settings-mentions input:first-of-type").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-mentions");\});\par
\tab\tab titleElem.querySelector("#tes-settings-notifications input:first-of-type").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-notifications");\});\par
\tab\tab titleElem.querySelector("#tes-settings-changefont input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-changefont");\});\par
titleElem.querySelector("#tes-settings-nightmode input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-nightmode");\});\par
titleElem.querySelector("#tes-settings-pinkmode input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-pinkmode");\});\par
titleElem.querySelector("#tes-settings-greenmode input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-greenmode");\});\par
titleElem.querySelector("#tes-settings-bluemode input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-bluemode");\});\par
titleElem.querySelector("#tes-settings-purplemode input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-purplemode");\});\par
titleElem.querySelector("#tes-settings-defaultmode input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-defaultmode");\});\par
titleElem.querySelector("#tes-settings-chatbelow input").addEventListener("click", function()\{settingsCheckboxUpdate("tes-settings-chatbelow");\});\par
\par
\tab\tab notificationHider();\par
\tab\}\par
\par
\}\par
function nightmodeToggle(arg) \{\par
\tab try\{\par
\tab var nightmodeClasses = ["tes-nightmode"];\par
\par
\tab if (settingsQuick["NightModeBlack"]) nightmodeClasses.push("blacknight");\par
\par
\tab if (arg == true) \{\par
\tab\tab bodyElem.classList.add(...nightmodeClasses);\par
\tab\tab titleCSS.classList.add(...nightmodeClasses);\par
\tab\tab sidemenuCSS.classList.add(...nightmodeClasses);\par
\tab\tab userlistCSS.classList.add(...nightmodeClasses);\par
\tab\tab webappCSS.classList.add(...nightmodeClasses);\par
\tab\tab videolistCSS.classList.add(...nightmodeClasses);\par
\tab\tab videomoderationCSS.classList.add(...nightmodeClasses);\par
\tab\tab chatlistCSS.classList.add(...nightmodeClasses);\par
\tab\tab chatlogCSS.classList.add(...nightmodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.add(...nightmodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.add(...nightmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.add(...nightmodeClasses);\par
\par
\tab\tab\tab\tab if (camItemCSS.querySelector("#camItemCSS") == null) camItemCSS.insertAdjacentHTML("afterbegin", camItemCSShtml);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab if (arg == false) \{\par
\tab\tab if (!settingsQuick["NightModeBlack"] && settingsQuick["NightMode"]) nightmodeClasses = ["blacknight"];\par
\par
\tab\tab bodyElem.classList.remove(...nightmodeClasses);\par
\tab\tab titleCSS.classList.remove(...nightmodeClasses);\par
\tab\tab sidemenuCSS.classList.remove(...nightmodeClasses);\par
\tab\tab userlistCSS.classList.remove(...nightmodeClasses);\par
\tab\tab webappCSS.classList.remove(...nightmodeClasses);\par
\tab\tab videolistCSS.classList.remove(...nightmodeClasses);\par
\tab\tab videomoderationCSS.classList.remove(...nightmodeClasses);\par
\tab\tab chatlistCSS.classList.remove(...nightmodeClasses);\par
\tab\tab chatlogCSS.classList.remove(...nightmodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.remove(...nightmodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.remove(...nightmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.remove(...nightmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab\}catch(e)\{tcl("error nightmodeToggle: " + e.message);\}\par
\}\par
\par
\par
\par
\par
function pinkmodeToggle(arg) \{\par
\tab try\{\par
\tab var pinkmodeClasses = ["tes-pinkmode"];\par
\par
\tab if (settingsQuick["PinkModeBlack"]) pinkmodeClasses.push("pinknight");\par
\par
\tab if (arg == true) \{\par
\tab\tab bodyElem.classList.add(...pinkmodeClasses);\par
\tab\tab titleCSS.classList.add(...pinkmodeClasses);\par
\tab\tab sidemenuCSS.classList.add(...pinkmodeClasses);\par
\tab\tab userlistCSS.classList.add(...pinkmodeClasses);\par
\tab\tab webappCSS.classList.add(...pinkmodeClasses);\par
\tab\tab videolistCSS.classList.add(...pinkmodeClasses);\par
\tab\tab videomoderationCSS.classList.add(...pinkmodeClasses);\par
\tab\tab chatlistCSS.classList.add(...pinkmodeClasses);\par
\tab\tab chatlogCSS.classList.add(...pinkmodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.add(...pinkmodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.add(...pinkmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.add(...pinkmodeClasses);\par
\par
\tab\tab\tab\tab if (camItemCSS.querySelector("#camItemCSS") == null) camItemCSS.insertAdjacentHTML("afterbegin", camItemCSShtml);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab if (arg == false) \{\par
\tab\tab if (!settingsQuick["PinkModeBlack"] && settingsQuick["PinkMode"]) nightmodeClasses = ["pinknight"];\par
\par
\tab\tab bodyElem.classList.remove(...pinkmodeClasses);\par
\tab\tab titleCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab sidemenuCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab userlistCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab webappCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab videolistCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab videomoderationCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab chatlistCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab chatlogCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.remove(...pinkmodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.remove(...pinkmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab\}catch(e)\{tcl("error pinkmodeToggle: " + e.message);\}\par
\}\par
\par
function greenmodeToggle(arg) \{\par
\tab try\{\par
\tab var greenmodeClasses = ["tes-greenmode"];\par
\par
\tab if (settingsQuick["GreenModeBlack"]) greenmodeClasses.push("greennight");\par
\par
\tab if (arg == true) \{\par
\tab\tab bodyElem.classList.add(...greenmodeClasses);\par
\tab\tab titleCSS.classList.add(...greenmodeClasses);\par
\tab\tab sidemenuCSS.classList.add(...greenmodeClasses);\par
\tab\tab userlistCSS.classList.add(...greenmodeClasses);\par
\tab\tab webappCSS.classList.add(...greenmodeClasses);\par
\tab\tab videolistCSS.classList.add(...greenmodeClasses);\par
\tab\tab videomoderationCSS.classList.add(...greenmodeClasses);\par
\tab\tab chatlistCSS.classList.add(...greenmodeClasses);\par
\tab\tab chatlogCSS.classList.add(...greenmodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.add(...greenmodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.add(...greenmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.add(...greenmodeClasses);\par
\par
\tab\tab\tab\tab if (camItemCSS.querySelector("#camItemCSS") == null) camItemCSS.insertAdjacentHTML("afterbegin", camItemCSShtml);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab if (arg == false) \{\par
\tab\tab if (!settingsQuick["GreenModeBlack"] && settingsQuick["GreenMode"]) nightmodeClasses = ["greennight"];\par
\par
\tab\tab bodyElem.classList.remove(...greenmodeClasses);\par
\tab\tab titleCSS.classList.remove(...greenmodeClasses);\par
\tab\tab sidemenuCSS.classList.remove(...greenmodeClasses);\par
\tab\tab userlistCSS.classList.remove(...greenmodeClasses);\par
\tab\tab webappCSS.classList.remove(...greenmodeClasses);\par
\tab\tab videolistCSS.classList.remove(...greenmodeClasses);\par
\tab\tab videomoderationCSS.classList.remove(...greenmodeClasses);\par
\tab\tab chatlistCSS.classList.remove(...greenmodeClasses);\par
\tab\tab chatlogCSS.classList.remove(...greenmodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.remove(...greenmodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.remove(...greenmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.remove(...greenmodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab\}catch(e)\{tcl("error greenmodeToggle: " + e.message);\}\par
\}\par
\par
function bluemodeToggle(arg) \{\par
\tab try\{\par
\tab var bluemodeClasses = ["tes-bluemode"];\par
\par
\tab if (settingsQuick["BlueModeBlack"]) bluemodeClasses.push("bluenight");\par
\par
\tab if (arg == true) \{\par
\tab\tab bodyElem.classList.add(...bluemodeClasses);\par
\tab\tab titleCSS.classList.add(...bluemodeClasses);\par
\tab\tab sidemenuCSS.classList.add(...bluemodeClasses);\par
\tab\tab userlistCSS.classList.add(...bluemodeClasses);\par
\tab\tab webappCSS.classList.add(...bluemodeClasses);\par
\tab\tab videolistCSS.classList.add(...bluemodeClasses);\par
\tab\tab videomoderationCSS.classList.add(...bluemodeClasses);\par
\tab\tab chatlistCSS.classList.add(...bluemodeClasses);\par
\tab\tab chatlogCSS.classList.add(...bluemodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.add(...bluemodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.add(...bluemodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.add(...bluemodeClasses);\par
\par
\tab\tab\tab\tab if (camItemCSS.querySelector("#camItemCSS") == null) camItemCSS.insertAdjacentHTML("afterbegin", camItemCSShtml);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab if (arg == false) \{\par
\tab\tab if (!settingsQuick["BlueModeBlack"] && settingsQuick["BlueMode"]) nightmodeClasses = ["bluenight"];\par
\par
\tab\tab bodyElem.classList.remove(...bluemodeClasses);\par
\tab\tab titleCSS.classList.remove(...bluemodeClasses);\par
\tab\tab sidemenuCSS.classList.remove(...bluemodeClasses);\par
\tab\tab userlistCSS.classList.remove(...bluemodeClasses);\par
\tab\tab webappCSS.classList.remove(...bluemodeClasses);\par
\tab\tab videolistCSS.classList.remove(...bluemodeClasses);\par
\tab\tab videomoderationCSS.classList.remove(...bluemodeClasses);\par
\tab\tab chatlistCSS.classList.remove(...bluemodeClasses);\par
\tab\tab chatlogCSS.classList.remove(...bluemodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.remove(...bluemodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.remove(...bluemodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.remove(...bluemodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab\}catch(e)\{tcl("error bluemodeToggle: " + e.message);\}\par
\}\par
\par
function purplemodeToggle(arg) \{\par
\tab try\{\par
\tab var purplemodeClasses = ["tes-purplemode"];\par
\par
\tab if (settingsQuick["PurpleModeBlack"]) purplemodeClasses.push("purplenight");\par
\par
\tab if (arg == true) \{\par
\tab\tab bodyElem.classList.add(...purplemodeClasses);\par
\tab\tab titleCSS.classList.add(...purplemodeClasses);\par
\tab\tab sidemenuCSS.classList.add(...purplemodeClasses);\par
\tab\tab userlistCSS.classList.add(...purplemodeClasses);\par
\tab\tab webappCSS.classList.add(...purplemodeClasses);\par
\tab\tab videolistCSS.classList.add(...purplemodeClasses);\par
\tab\tab videomoderationCSS.classList.add(...purplemodeClasses);\par
\tab\tab chatlistCSS.classList.add(...purplemodeClasses);\par
\tab\tab chatlogCSS.classList.add(...purplemodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.add(...purplemodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.add(...purplemodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.add(...purplemodeClasses);\par
\par
\tab\tab\tab\tab if (camItemCSS.querySelector("#camItemCSS") == null) camItemCSS.insertAdjacentHTML("afterbegin", camItemCSShtml);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab if (arg == false) \{\par
\tab\tab if (!settingsQuick["PurpleModeBlack"] && settingsQuick["PurpleMode"]) nightmodeClasses = ["purplenight"];\par
\par
\tab\tab bodyElem.classList.remove(...purplemodeClasses);\par
\tab\tab titleCSS.classList.remove(...purplemodeClasses);\par
\tab\tab sidemenuCSS.classList.remove(...purplemodeClasses);\par
\tab\tab userlistCSS.classList.remove(...purplemodeClasses);\par
\tab\tab webappCSS.classList.remove(...purplemodeClasses);\par
\tab\tab videolistCSS.classList.remove(...purplemodeClasses);\par
\tab\tab videomoderationCSS.classList.remove(...purplemodeClasses);\par
\tab\tab chatlistCSS.classList.remove(...purplemodeClasses);\par
\tab\tab chatlogCSS.classList.remove(...purplemodeClasses);\par
\tab\tab chatlogElem.querySelector("#chat-wider").classList.remove(...purplemodeClasses);\par
\tab\tab // Messages:\par
\tab\tab if (chatlogElem.querySelector(messageQueryString) != null) \{\par
\tab\tab\tab var messageElems = chatlogElem.querySelectorAll(messageQueryString);\par
\tab\tab\tab for (i=0; i < messageElems.length; i++) \{\par
\tab\tab\tab\tab var messageItem = messageElems[i].querySelector("tc-message-html").shadowRoot;\par
\tab\tab\tab\tab var messageItemCSS = messageItem.querySelector(".message");\par
\tab\tab\tab\tab messageItemCSS.classList.remove(...purplemodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\tab // Cams:\par
\tab\tab if (videolistElem.querySelector(camQueryString) != null) \{\par
\tab\tab\tab var camElems = videolistElem.querySelectorAll(camQueryString);\par
\tab\tab\tab for (i=0; i < camElems.length; i++) \{\par
\tab\tab\tab\tab var camItem = camElems[i].querySelector("tc-video-item").shadowRoot;\par
\tab\tab\tab\tab var camItemCSS = camItem.querySelector(".video");\par
\tab\tab\tab\tab camItemCSS.classList.remove(...purplemodeClasses);\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab\}catch(e)\{tcl("error purplemodeToggle: " + e.message);\}\par
\}\par
\par
\par
function toggleSettingsDisplay(arg) \{\par
\tab if (arg == "updateNotifier") \{\par
\tab\tab titleElem.querySelector("#tes-updateNotifier").classList.remove("visible");\par
\tab\tab GM_setValue("tes-updateNotifSeen", "2018.112");\par
\tab\}\par
\par
\tab if (settingsVisible == true) \{\par
\tab\tab titleElem.getElementById("tes-settingsBox").classList.add("hidden");\par
\tab\tab titleElem.getElementById("tes-settings").classList.remove("tes-open");\par
\tab\tab settingsVisible = false;\par
\tab\}\par
\par
\tab else \{\par
\tab\tab titleElem.getElementById("tes-settingsBox").classList.remove("hidden");\par
\tab\tab titleElem.getElementById("tes-settings").classList.add("tes-open");\par
\tab\tab settingsVisible = true;\par
\tab\}\par
\par
\}\par
\par
function settingsCheckboxUpdate(settingName=null, value=null) \{\par
\tab if (settingName == null && value == null) \{\par
\tab\tab titleElem.getElementById("tes-settings-autoscroll").querySelector("input").checked = settingsQuick["Autoscroll"];\par
\tab\tab titleElem.getElementById("tes-settings-mentions").querySelector("input").checked = settingsQuick["MentionsMonitor"];\par
\tab\tab titleElem.getElementById("tes-settings-notifications").querySelector("input").checked = settingsQuick["NotificationsOff"];\par
\tab\tab titleElem.getElementById("tes-settings-changefont").querySelector("input").checked = settingsQuick["ChangeFont"];\par
titleElem.getElementById("tes-settings-nightmode").querySelector("input").checked = settingsQuick["NightMode"];\par
titleElem.getElementById("tes-settings-defaultmode").querySelector("input").checked = settingsQuick["DefaultMode"];\par
titleElem.getElementById("tes-settings-chatbelow").querySelector("input").checked = settingsQuick["ChatBelow"];\par
\par
titleElem.getElementById("tes-settings-defaultmode").querySelector("input").checked = settingsQuick["DefaultMode"];\par
titleElem.getElementById("tes-settings-pinkmode").querySelector("input").checked = settingsQuick["PinkMode"];\par
titleElem.getElementById("tes-settings-greenmode").querySelector("input").checked = settingsQuick["GreenMode"];\par
titleElem.getElementById("tes-settings-bluemode").querySelector("input").checked = settingsQuick["BlueMode"];\par
titleElem.getElementById("tes-settings-purplemode").querySelector("input").checked = settingsQuick["PurpleMode"];\par
\par
\tab\tab return;\par
\tab\}\par
if (settingName == "tes-settings-chatbelow") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-chatbelow").querySelector("input").checked;\par
\tab\tab\tab settingsQuick["ChatBelow"] = newValue;\par
\tab\tab\tab GM_setValue("tes-ChatBelow", newValue.toString());\par
chatBelowToggle(newValue);\par
\tab\tab\}\par
\tab\}\par
\tab if (settingName == "tes-settings-autoscroll") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-autoscroll").querySelector("input").checked;\par
\tab\tab\tab settingsQuick["Autoscroll"] = newValue;\par
\tab\tab\tab GM_setValue("tes-Autoscroll", newValue.toString());\par
\tab\tab\}\par
\tab\}\par
\tab if (settingName == "tes-settings-mentions") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-mentions").querySelector("input:first-of-type").checked;\par
\tab\tab\tab // if (newValue) \{\par
\tab\tab\tab\tab // titleElem.getElementById("tes-settings-mentions").getAttribute("class").includes("setting-disabled");\par
\tab\tab\tab // \}\par
\tab\tab\tab settingsQuick["MentionsMonitor"] = newValue;\par
\tab\tab\tab GM_setValue("tes-MentionsMonitor", newValue.toString());\par
\tab\tab\}\par
\tab\}\par
\tab if (settingName == "tes-settings-notifications") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-notifications").querySelector("input").checked;\par
\tab\tab\tab settingsQuick["NotificationsOff"] = newValue;\par
\tab\tab\tab GM_setValue("tes-NotificationsOff", newValue.toString());\par
\tab\tab\tab notificationHider();\par
\tab\tab\}\par
\tab\}\par
\tab if (settingName == "tes-settings-changefont") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-changefont").querySelector("input").checked;\par
\tab\tab\tab settingsQuick["ChangeFont"] = newValue;\par
\tab\tab\tab GM_setValue("tes-ChangeFont", newValue.toString());\par
\tab\tab\tab fontToggle(newValue);\par
\tab\tab\}\par
\tab\}\par
\tab if (settingName == "tes-settings-nightmode") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-nightmode").querySelector("input").checked;\par
\tab\tab\tab settingsQuick["NightMode"] = newValue;\par
\tab\tab\tab GM_setValue("tes-NightMode", newValue.toString());\par
\tab\tab\tab nightmodeToggle(newValue);\par
\tab\tab\}\par
\tab\}\par
\tab if (settingName == "tes-settings-pinkmode") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-pinkmode").querySelector("input").checked;\par
titleElem.querySelector("#tes-settings-greenmode input").checked = null;\par
titleElem.querySelector("#tes-settings-bluemode input").checked = null;\par
titleElem.querySelector("#tes-settings-purplemode input").checked = null;\par
titleElem.querySelector("#tes-settings-defaultmode input").checked = (!newValue);\par
\tab\tab\tab settingsQuick["PinkMode"] = newValue;\par
\tab\tab\tab GM_setValue("tes-PinkMode", newValue.toString());\par
\tab\tab\tab pinkmodeToggle(newValue);\par
\tab\tab\tab pinkmodeToggle(true);\par
greenmodeToggle(false);\par
bluemodeToggle(false);\par
purplemodeToggle(false);\par
\tab\tab\}\par
\tab\}\par
if (settingName == "tes-settings-greenmode") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-greenmode").querySelector("input").checked;\par
titleElem.querySelector("#tes-settings-pinkmode input").checked = null;\par
titleElem.querySelector("#tes-settings-bluemode input").checked = null;\par
titleElem.querySelector("#tes-settings-purplemode input").checked = null;\par
titleElem.querySelector("#tes-settings-defaultmode input").checked = (!newValue);\par
\tab\tab\tab settingsQuick["GreenMode"] = newValue;\par
\tab\tab\tab GM_setValue("tes-GreenMode", newValue.toString());\par
\tab\tab\tab greenmodeToggle(newValue);\par
\tab\tab\tab greenmodeToggle(true);\par
pinkmodeToggle(false);\par
bluemodeToggle(false);\par
purplemodeToggle(false);\par
\tab\tab\}\par
\tab\}\par
if (settingName == "tes-settings-bluemode") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-bluemode").querySelector("input").checked;\par
titleElem.querySelector("#tes-settings-pinkmode input").checked = null;\par
titleElem.querySelector("#tes-settings-greenmode input").checked = null;\par
titleElem.querySelector("#tes-settings-purplemode input").checked = null;\par
titleElem.querySelector("#tes-settings-defaultmode input").checked = (!newValue);\par
\tab\tab\tab settingsQuick["BlueMode"] = newValue;\par
\tab\tab\tab GM_setValue("tes-BlueMode", newValue.toString());\par
\tab\tab\tab bluemodeToggle(newValue);\par
\tab\tab\tab bluemodeToggle(true);\par
purplemodeToggle(false);\par
pinkmodeToggle(false);\par
greenmodeToggle(false);\par
\tab\tab\}\par
\tab\}\par
if (settingName == "tes-settings-purplemode") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-purplemode").querySelector("input").checked;\par
titleElem.querySelector("#tes-settings-pinkmode input").checked = null;\par
titleElem.querySelector("#tes-settings-greenmode input").checked = null;\par
titleElem.querySelector("#tes-settings-bluemode input").checked = null;\par
titleElem.querySelector("#tes-settings-defaultmode input").checked = (!newValue);\par
\tab\tab\tab settingsQuick["PurpleMode"] = newValue;\par
\tab\tab\tab GM_setValue("tes-PurpleMode", newValue.toString());\par
\tab\tab\tab purplemodeToggle(newValue);\par
\tab\tab\tab purplemodeToggle(true);\par
pinkmodeToggle(false);\par
greenmodeToggle(false);\par
bluemodeToggle(false);\par
\tab\tab\}\par
\}\par
if (settingName == "tes-settings-defaultmode") \{\par
\tab\tab if (value == null) \{\par
\tab\tab\tab var newValue = titleElem.getElementById("tes-settings-defaultmode").querySelector("input").checked;\par
titleElem.querySelector("#tes-settings-purplemode input").checked = null;\par
titleElem.querySelector("#tes-settings-pinkmode input").checked = null;\par
titleElem.querySelector("#tes-settings-greenmode input").checked = null;\par
titleElem.querySelector("#tes-settings-bluemode input").checked = null;\par
\tab\tab\tab settingsQuick["DefaultMode"] = newValue;\par
\tab\tab\tab GM_setValue("tes-DefaultMode", newValue.toString());\par
purplemodeToggle(false);\par
pinkmodeToggle(false);\par
greenmodeToggle(false);\par
bluemodeToggle(false);\par
\tab\tab\}\par
\tab\}\par
\}\par
\par
\par
var settingsWaitInterval = setInterval(waitForSettings,1000);\par
\par
function fontToggle(arg) \{\par
\tab arg ? bodyElem.classList.add("tes-changefont") : bodyElem.classList.remove("tes-changefont");\par
\}\par
function maxCamPositionToggle(arg) \{\par
\tab try\{\par
\tab arg ? videolistCSS.classList.add("tes-leftcam") : videolistCSS.classList.remove("tes-leftcam");\par
\tab\}catch(e)\{tcl("error maxCamPositionToggle: " + e.message);\}\par
\}\par
function notificationHider() \{\par
\tab chatlogContainer = chatlogElem.querySelector("#chat-content");\par
\tab settingsQuick["NotificationsOff"] ? chatlogContainer.classList.add("tes-notif-off") : chatlogContainer.classList.remove("tes-notif-off");\par
\}\par
\par
function chatBelowToggle(arg) \{\par
\tab\tab\tab arg ? chatlogOuter.classList.add("tes-chatbelow") : chatlogOuter.classList.remove("tes-chatbelow");\par
\}\par
\par
function copyChatlog(opt=null) \{\par
\tab try\{\par
\tab if (opt == "close") \{\par
\tab\tab chatlogDisplayElem.classList.remove("show");\par
\tab\tab chatlogDisplayClose.classList.remove("show");\par
\tab\tab setTimeout(function()\{chatlogDisplayCont.classList.remove("show");\}, 300);\par
\tab\tab return;\par
\tab\}\par
\par
\tab var filename = "tinychat_" + roomName + "_" + joinDate + "_" + joinTime.replace(/:/g, ".") + "-chatlog.log";\par
\tab var chatlogText = "Tinychat room " + roomName + " on " + joinDate + " " + joinTime + newline + chatlogMain;\par
\par
\tab var downloadLink = 'data:text/plain;charset=utf-8,' + encodeURIComponent(chatlogText);\par
\tab var downloadElem = document.createElement('a');\par
\tab downloadElem.setAttribute("href", downloadLink);\par
\par
\tab downloadElem.setAttribute("download", filename);\par
\par
\tab if (opt == "download") downloadElem.click();\par
\tab if (opt == "view" || opt == null) \{\par
\tab\tab if (typeof chatlogDisplayCont == "undefined") \{\par
\tab\tab\tab chatlogDisplayCont = chatlogElem.querySelector("#tes-chatlogDisplay");\par
\tab\tab\tab chatlogDisplayElem = chatlogDisplayCont.querySelector("textarea");\par
\tab\tab\tab chatlogDisplayClose = chatlogDisplayCont.querySelector("#close");\par
\tab\tab\}\par
\tab\tab chatlogDisplayElem.value = chatlogText;\par
\tab\tab chatlogDisplayCont.classList.add("show");\par
\tab\tab setTimeout(function()\{\par
\tab\tab\tab chatlogDisplayElem.classList.add("show");\par
\tab\tab\tab chatlogDisplayClose.classList.add("show");\par
\tab\tab\}, 50);\par
\tab\tab chatlogDisplayElem.scrollTop = chatlogDisplayElem.scrollHeight;\par
\tab\}\par
\tab\}catch(e)\{console.log("TES error copyChatlog: " + e.message);\}\par
\}\par
\par
function getFormattedDateTime(d, opt=null) \{\par
\tab if (opt == "time") return d.toLocaleTimeString('en-US', \{ hour12: false \});\par
\tab else return d.toLocaleDateString('zh-CN', \{'year':'numeric', 'month':'2-digit', 'day':'2-digit'\}).replace(/\\//g, "-");\par
\}\par
function mentionsManager(mode) \{\par
\tab var inputElem = titleElem.querySelector("#tes-settings #tes-settings-mentions input.text");\par
\tab // phrases = inputElem.value.split(",");\par
\tab var phrase = inputElem.value;\par
\tab if (phrase.endsWith(",")) \{ phrase = phrase.slice(0, -1); \}\par
\tab if (phrase.startsWith(",")) \{ phrase = phrase.slice(1); \}\par
\par
\tab if (mode == "save") \{\par
\tab\tab GM_setValue("tes-Mentions", phrase);\par
\tab\tab settingMentions = phrase.split(",");\par
\tab\tab inputElem.value = phrase;\par
\tab\}\par
\tab if (mode == "load") \{\par
\tab\tab var loadedMentions = GM_getValue("tes-Mentions");\par
\tab\tab if (loadedMentions != undefined) \{\par
\tab\tab\tab inputElem.value = loadedMentions;\par
\tab\tab\tab settingMentions = loadedMentions.split(",");\par
\tab\tab\}\par