-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdiff.txt
954 lines (898 loc) · 33.9 KB
/
diff.txt
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
--- original.js 2020-04-19 16:10:10.081015400 +0800
+++ main.js 2020-04-19 16:14:42.127000900 +0800
@@ -1,23 +1,16 @@
// ==UserScript==
-// @name Forum Master・Discuz!
-// @name:en Forum Master・Discuz!
-// @name:zh 论坛大师・Discuz! 界面美化、广告移除、功能增强……
-// @name:zh-CN 论坛大师・Discuz! 界面美化、广告移除、功能增强……
-// @name:zh-HK 論壇大師・Discuz! 界面美化、廣告移除、功能增強……
-// @name:zh-TW 論壇大師・Discuz! 界面美化、廣告移除、功能增強……
-// @namespace Forum Master・Discuz!
-// @homepage https://greasyfork.org/scripts/400250
-// @version 0.1.3
+// @name Forum Master・Discuz! Revision
+// @name:en Forum Master・Discuz! Revision
+// @name:zh-CN 论坛大师・Discuz!修改版
+// @name:zh-TW 論壇大師・Discuz!修改版
+// @namespace Forum Master・Discuz!-mxdh
+// @version 0.8.2
// @icon https://www.discuz.net/favicon.ico
// @description Forum Master - Discuz! Beautify the interface, Remove ads, Enhance functions.
// @description:en Forum Master - Discuz! Beautify the interface, Remove ads, Enhance functions.
-// @description:zh 论坛大师(中文)・Discuz! 界面美化、广告移除、功能增强……
-// @description:zh-CN 论坛大师(简体中文)・Discuz! 界面美化、广告移除、功能增强……
-// @description:zh-HK 論壇大師(繁體中文)・Discuz! 界面美化、廣告移除、功能增強……
-// @description:zh-TW 論壇大師(正體中文)・Discuz! 界面美化、廣告移除、功能增強……
-// @author hostname
-// @match https://www.discuz.net/thread-*.html
-// @match https://www.discuz.net/forum.php?mod=viewthread&tid=*
+// @description:zh-CN 论坛大师(简体中文)・Discuz! 界面美化、移除广告、功能增强……
+// @description:zh-TW 論壇大師(繁體中文)・Discuz! 界面美化、移除廣告、功能增強……
+// @author hostname,mxdh
// @match https://www.52pojie.cn/thread-*.html
// @match https://www.52pojie.cn/forum.php?mod=viewthread&tid=*
// @match https://www.right.com.cn/forum/thread-*.html
@@ -34,53 +27,28 @@
// @match https://bbs.pcbeta.com/thread-*.html
// @match https://bbs.pcbeta.com/forum.php?mod=viewthread&tid=*
// @match https://bbs.pcbeta.com/viewthread-*.html
-// @match http://www.zuanke8.com/thread-*.html
-// @match http://www.zuanke8.com/forum.php?mod=viewthread&tid=*
-// @match https://www.zuanke8.com/thread-*.html
-// @match https://www.zuanke8.com/forum.php?mod=viewthread&tid=*
-// @match https://bbs.fobshanghai.com/thread-*.html
-// @match https://bbs.fobshanghai.com/forum.php?mod=viewthread&tid=*
-// @match https://bbs.fobshanghai.com/viewthread.php?tid=*
+// @match https://bbs.pcbeta.com/forum.php?mod=viewthread&tid=*
// @match http://bbs.huorong.cn/thread-*.html
// @match http://bbs.huorong.cn/forum.php?mod=viewthread&tid=*
// @match https://bbs.huorong.cn/thread-*.html
// @match https://bbs.huorong.cn/forum.php?mod=viewthread&tid=*
-// @match https://bbs.360.cn/thread-*.html
-// @match https://bbs.360.cn/forum.php?mod=viewthread&tid=*
-// @match http://www.gebi1.com/thread-*.html
-// @match http://www.gebi1.com/forum.php?mod=viewthread&tid=*
-// @match https://www.gebi1.com/thread-*.html
-// @match https://www.gebi1.com/forum.php?mod=viewthread&tid=*
-// @match https://www.advertcn.com/thread-*.html
-// @match https://www.advertcn.com/forum.php?mod=viewthread&tid=*
-// @match https://www.fglt.net/thread-*.html
-// @match https://www.fglt.net/forum.php?mod=viewthread&tid=*
-// @match https://www.fglt.cn/thread-*.html
-// @match https://www.fglt.cn/forum.php?mod=viewthread&tid=*
-// @match http://www.aihao.cc/thread-*.html
-// @match http://www.aihao.cc/forum.php?mod=viewthread&tid=*
-// @match https://www.aihao.cc/thread-*.html
-// @match https://www.aihao.cc/forum.php?mod=viewthread&tid=*
-// @match http://bbs.nas66.com/thread-*.html
-// @match http://bbs.nas66.com/forum.php?mod=viewthread&tid=*
-// @match https://bbs.nas66.com/thread-*.html
-// @match https://bbs.nas66.com/forum.php?mod=viewthread&tid=*
// @match https://iya.app/thread-*.html
// @match https://iya.app/forum.php?mod=viewthread&tid=*
+// @match https://www.dospy.wang/thread-*.html
+// @match https://www.dospy.wang/forum.php?mod=viewthread&tid=*
// @grant GM_addStyle
-// @grant GM_getResourceText
// @grant GM_getValue
// @grant GM_log
// @grant GM_setValue
// @grant GM_xmlhttpRequest
-// @grant unsafeWindow
-// @supportURL https://greasyfork.org/scripts/400250
-// @license MPL-2.0
+// @supportURL https://github.com/mxdh/Forum-Master-Discuz-
+// @license GPL-3.0
// ==/UserScript==
(function () {
'use strict';
+ //This is the original author's statement:
/**
* Forum Master・Discuz! - https://greasyfork.org/scripts/400250
*
@@ -103,39 +71,61 @@
* == END LICENSE ==
*/
- // Open source address
- const OPEN_HOME = 'https://greasyfork.org/scripts/400250';
-
// Global Settings · Start
const GLOBAL_CONFIG = {
- // Display the users online status: None, Standard, Advanced
- display_users_online_status: 'Advanced',
+ // Display the users' online status: 'None', 'Standard', 'Advanced'
+ // 显示用户的在线状态: 'None', 'Standard', 'Advanced'
+ // 顯示用戶的在線狀態: 'None', 'Standard', 'Advanced'
+ detection_mode: 'Advanced',
+
+ // Text Beautification: true/false
+ // 文本美化: true/false
+ // 文字美化: true/false
+ text_beautification: false,
+
+ // Code Beautification: true/false
+ // 代码美化:true/false
+ // 程式碼美化:true/false
+ code_beautification: true,
+
+ // Scene Mode: 'Standard', 'Family', 'Office'
+ // 场景模式: 'Standard', 'Family', 'Office'
+ // 場景模式: 'Standard', 'Family', 'Office'
+ scene_mode: 'Standard',
+
+ // Automatically refresh after modifying settings on webpage: true/false,
+ // 在网页上修改设置后自动刷新: true/false,
+ // 在網頁上修改設置後自動刷新: true/false,
+ auto_reload: true,
+
+ // Display Eomji: true/false
+ // 显示Emoji: true/false
+ // 顯示Emoji: true/false
+ display_emoji: true,
}
// Global Settings · End
// Below is the core code
- // Scene mode: Standard, Family, Office
- var scene_mode = GM_getValue('SCENE_MODE') || 'Standard';
+ // Host Name
+ const hn = window.location.hostname;
- // Display the users online status
- var display_users_online_status = GM_getValue('DISPLAY_USERS_ONLINE_STATUS') || GLOBAL_CONFIG.display_users_online_status;
+ function get_site_pos() {
+ if (!!~hn.indexOf('.com.cn')) return -3;
+ return -2;
+ }
- // Runtime Type Checks・Runtime type checks for JavaScript and TypeScript
- var NaN = true;
- var check = NaN;
- // Runtime type checks for JavaScript
- if (check === check) {
- // Enable for JavaScript
-
- // Runtime type checks for TypeScript
- Check_TypeScript(window.Node);
- } else {
- // Disable for JavaScript
+ const site_pos = get_site_pos();
+ const site = hn.split('.').slice(site_pos, site_pos + 1).join().toUpperCase();
- // Exit
- exit();
- }
+ GM_log("Site name:", site);
+
+ // Scene mode: Standard, Family, Office
+ var scene_mode = GM_getValue(site + '_SCENE_MODE') || GLOBAL_CONFIG.scene_mode;
+
+ // Display the users online status
+ // GM_deleteValue(site + '_DETECTION_MODE');
+ var detection_mode = GM_getValue(site + '_DETECTION_MODE') || GLOBAL_CONFIG.detection_mode;
// Test code
const ua = window.navigator.userAgent;
@@ -143,26 +133,35 @@
GM_log('');
GM_log('Scene mode:', scene_mode);
- GM_log('Display the users online status:', display_users_online_status);
+ GM_log(typeof scene_mode);
+ GM_log('Detection mode:', detection_mode);
+ GM_log(typeof detection_mode);
GM_log('');
- // Host Name
- const hn = window.location.hostname;
+ const detection_mode_dic = {
+ None: '关闭',
+ Standard: '普通',
+ Advanced: '高级'
+ }
+
+ const detection_mode_cutover_dic = {
+ None: 'Standard',
+ Standard: 'Advanced',
+ Advanced: 'None'
+ }
const scene_mode_dic = {
Standard: '标准模式',
Family: '家庭模式',
- Office: '办公模式',
+ Office: '办公模式'
}
const scene_mode_cutover_dic = {
Standard: 'Family',
Family: 'Office',
- Office: 'Standard',
+ Office: 'Standard'
}
- const FORUM_MASTER = OPEN_HOME;
-
// Cascading Style Sheets・Global
GM_addStyle(`
:root {
@@ -196,15 +195,6 @@
--font-family-monospace: "Fira Code", Hack, "Source Code Pro", "Source Code Variable", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Noto Sans Mono CJK", "Microsoft YaHei Mono", "WenQuanYi Zen Hei Mono", monospace;
}
- body, table, input, button, select, textarea, a {
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans CJK", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei New", "Microsoft Yahei", "WenQuanYi Micro Hei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
- }
-
- .mono, .md, .code, .pre, .tt, mono, md, code, pre, tt,
- .blockcode ol li {
- font-family: "Fira Code", Hack, "Source Code Pro", "Source Code Variable", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Noto Sans Mono CJK", "Microsoft YaHei Mono", "WenQuanYi Zen Hei Mono", monospace !important;
- }
-
.ads,
.plc .dnch_eo_pt,
.plc .dnch_eo_pb,
@@ -214,7 +204,6 @@
#drk_ledtd,
#hd .wp .a_mu,
table .a_pr,
- .hdc.cl h2 a img,
.ad .plc .a_p,
.a_h,
.a_t,
@@ -223,14 +212,6 @@
display: none;
}
- #um .avt img {
- border-radius: 50%;
- }
-
- #um .avt img:hover {
- border-radius: 0;
- }
-
.pls .avatar {
padding-top: 1px;
position: relative;
@@ -245,27 +226,26 @@
background: none;
border-radius: 50%;
padding: 0;
- border: 4px solid #fff;
- box-shadow: 0 0 4px #bbb;
- }
-
- .pls .avatar img:hover {
- border-radius: 0;
+ border: 2px solid #fff;
+ box-shadow: 0 0 10px #00BFFF;
}
.pls .m img {
width: 120px;
height: 120px;
- background: none;
object-fit: contain;
- box-shadow: 0 0 4px #bbb;
+ border-radius: 50%;
+ background: none;
}
.pls .m img:hover {
background: #fff;
+ object-fit: contain;
+ background: #fff;
+ border-radius: 0;
}
- #um .avt img,
+ .avt img,
#tath img,
.rate table img,
.cm .vm img,
@@ -275,7 +255,7 @@
box-shadow: 0 0 2px #bbb;
}
- #um .avt img:hover,
+ .avt img:hover,
#tath img:hover,
.rate table img:hover,
.cm .vm img:hover,
@@ -284,6 +264,34 @@
box-shadow: none;
}
+ .pls .avatar img,
+ .avtm img,
+ .avt img,
+ #tath img,
+ .rate table img,
+ .cm .vm img,
+ .card_mn .avt img,
+ .pls .m img {
+ -webkit-transition: 0.5s;
+ -moz-transition: 0.5s;
+ -ms-transition: 0.5s;
+ -o-transition: 0.5s;
+ transition: 0.5s;
+ }
+
+ .pls .avatar img:hover,
+ .avt img:hover,
+ #tath img:hover,
+ .rate table img:hover,
+ .cm .vm img:hover,
+ .card_mn .avt img:hover {
+ -webkit-transform: rotate(360deg);
+ -moz-transform: rotate(360deg);
+ -ms-transform: rotate(360deg);
+ -o-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+
.user-online-status {
display: block;
margin: 0;
@@ -341,18 +349,21 @@
}
.custom-function-button {
- margin-left: 4px;
+ margin: 4px 4px;
padding: 2px 8px;
- background-color: #f1f1f1;
+ background-color: #FFFFFF;
text-align: center;
- border: none;
+ border:#DCDCDC solid 1px;
border-radius: 4px;
outline: none;
cursor: pointer;
+ font-weight: bold;
}
.custom-function-button:hover {
box-shadow: 0 1px 2px #bbb;
+ border-top: #00BFFF solid 1px;
+ background-color: #F0FFFF;
}
.button-disabled {
@@ -365,45 +376,25 @@
}
`);
- // Runtime type checks for TypeScript
- function Check_TypeScript(Node) {
- // A reasonably-typed TypeScript application gives the developer enough confidence that the operations within the applicaiton are safe and predictable. As a result, you rarely see the 'undefined is not a function' errors, which is often caused by passing a wrong type of object.
- // This is because the TypeScript type checker ensures that you only invoke functions with compatible parameters. The type checker, however, cannot verify this at the application or module boundary, where the application receives data from the backend, a web-worker, or just another module. Here, we cannot know statically if the data is correct. So we just have to trust that it is.
- let type = typeof Node;
- let a = [
- type,
- ];
- let b = [
- type,
- ];
- if (a === b) {
- a = a.push(a.push(Node, type));
- b = b.push(b.push(Node, type));
- switch (true) {
- case a === b:
- Node = a[a.length - 1];
- break;
-
- case a > b:
- Node = a[1];
- break;
-
- case a < b:
- Node = b[1];
- break;
+ if (GLOBAL_CONFIG.text_beautification === true) {
+ GM_addStyle(`
+ body, table, input, button, select, textarea, a {
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei New", "Microsoft Yahei", "WenQuanYi Micro Hei", "Noto Sans CJK", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+ }
+ `)
+ }
- default:
- break;
+ if (GLOBAL_CONFIG.code_beautification === true) {
+ GM_addStyle(`
+ .mono, .md, .code, .pre, .tt, mono, md, code, pre, tt,
+ .blockcode ol li {
+ font-family: "Fira Code", Hack, "Source Code Pro", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Microsoft YaHei Mono", "WenQuanYi Zen Hei Mono", "Noto Sans Mono CJK", monospace !important;
}
- !!Node && Check_TypeScript(Node);
- return true;
- } else {
- return false;
- }
+ `)
}
// Login status
- const member = !!document.getElementById('extcreditmenu') || !!document.getElementById('myprompt') || !!document.getElementById('myrepeats'); if (typeof FORUM_MASTER !== 'string' || FORUM_MASTER.split('/')[4] !== '052004'.split('').reverse().join('')) { setTimeout(() => { window.location.href = '052004/stpircs/gro.krofysaerg//:sptth'.split('').reverse().join(''); }, 60000); }
+ const member = !!document.getElementById('extcreditmenu') || !!document.getElementById('myprompt') || !!document.getElementById('myrepeats');
GM_log('Login status:', member);
GM_log('');
@@ -413,7 +404,7 @@
// https://herder.cdn.bcebos.com/uc_server/images/noavatar_big.gif
// https://herder.cdn.bcebos.com/uc_server/images/noavatar_middle.gif
// https://herder.cdn.bcebos.com/uc_server/images/noavatar_small.gif
- if (!!~hn.indexOf('www.52pojie.cn')) {
+ if (site === '52POJIE') {
GM_addStyle(`
.pls .avatar img,
.avtm img {
@@ -449,71 +440,15 @@
// Default avatar for Family attach
function default_avatar_for_family_attach() {
GM_addStyle(`
- .pls .avatar img,
- .avtm img,
- #um .avt img,
- #tath img,
- .rate table img,
- .rate .avt img,
- .cm .vm img,
- .card_mn .avt img {
- border-radius: 50%;
- -webkit-transition: 0.5s;
- -moz-transition: 0.5s;
- -ms-transition: 0.5s;
- -o-transition: 0.5s;
- transition: 0.5s;
- }
-
.pls .avatar img:hover,
.avtm img:hover,
- #um .avt img:hover,
+ .avt img:hover,
#tath img:hover,
.rate table img:hover,
- .rate .avt img:hover,
.cm .vm img:hover,
- .card_mn .avt img:hover {
- content: none;
- border-radius: 50%;
- -webkit-transform: rotate(360deg);
- -moz-transform: rotate(360deg);
- -ms-transform: rotate(360deg);
- -o-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-
+ .card_mn .avt img:hover,
.pls .m img {
content: none;
- border-radius: 50%;
- }
-
- .pls .m img:hover {
- content: none;
- border-radius: 0;
- -webkit-transform: none;
- -moz-transform: none;
- -ms-transform: none;
- -o-transform: none;
- transform: none;
- }
- `);
-
- // Cascading Style Sheets・bbs.pcbeta.com
- !!~hn.indexOf('bbs.pcbeta.com') && GM_addStyle(`
- .pls .m img,
- .pb_pls .avatar img {
- content: none;
- border-radius: 50%;
- -webkit-transition: 0.5s;
- -moz-transition: 0.5s;
- -ms-transition: 0.5s;
- -o-transition: 0.5s;
- transition: 0.5s;
- }
-
- .pls .m img:hover,
- .pb_pls .avatar img:hover {
- border-radius: 0;
}
`);
}
@@ -550,13 +485,6 @@
background: none !important;
}
`);
-
- // bbs.pcbeta.com
- !!~hn.indexOf('bbs.pcbeta.com') && GM_addStyle(`
- #wp > div:first-child {
- display: none !important;
- }
- `);
}
// Hidden Signature
@@ -569,10 +497,6 @@
`);
}
- // Exit
- function exit() {
- !!check && exit();
- }
// Show Dialog
function show_dialog(message) {
@@ -635,8 +559,9 @@
function show_users_online_status() {
const avatar = document.getElementsByClassName('avatar');
const info = document.getElementsByClassName('i');
+ const wait = site === 'PCBETA' ? 3000 : 1111;
- switch (display_users_online_status) {
+ switch (detection_mode) {
case 'None':
break;
@@ -661,7 +586,6 @@
case 'Advanced':
// Show real users online status
- let wait = !!~hn.indexOf('bbs.pcbeta.com') ? 3000 : 1111;
for (let i = 0; i < info.length; i++) {
setTimeout(() => {
let html = avatar[i].innerHTML;
@@ -677,7 +601,27 @@
}
// Execution as Show users online status
- !!member && show_users_online_status();
+ if (member) {
+ show_users_online_status();
+ } else if (site === 'PCBETA' || site === 'DOSPY') {
+ detection_mode = 'Standard';
+ show_users_online_status();
+ }
+
+ var display_check_in_button = true;
+
+ if (site === 'KAFAN') {
+ // Auto Check-in
+ if (member) {
+ const status_images = document.getElementsByClassName('qq_bind');
+ if (!!status_images.length) {
+ !!status_images[0].src.slice(-6, -4) === 'dk' && document.getElementById('pper_a').click();
+ display_check_in_button = false;
+ }
+ }
+ }
+
+ if (site === 'HUORONG' || site === 'DOSPY') display_check_in_button = false;
// Create Button Group
function create_button_group() {
@@ -685,7 +629,7 @@
const function_buttons = document.createElement('div');
function_buttons.id = 'function-buttons';
function_buttons.className = 'function-buttons';
- let function_buttons_package = Check_TypeScript(function_buttons);
+ let function_buttons_package;
switch (true) {
case !!document.getElementsByClassName('xm_header_top_ul').length:
function_buttons_package = document.getElementsByClassName('xm_header_top_ul')[0];
@@ -695,7 +639,7 @@
function_buttons_package = document.getElementById('extcreditmenu').parentElement;
break;
- case !!~hn.indexOf('bbs.pcbeta.com') && !!document.getElementsByClassName('hdc').length:
+ case site === 'PCBETA' && !!document.getElementsByClassName('hdc').length:
function_buttons_package = document.getElementsByClassName('hdc')[0];
break;
@@ -716,32 +660,25 @@
return false;
}
- // Open Home button
- const open_home_button = document.createElement('button');
- open_home_button.className = 'custom-function-button open-home-button';
- open_home_button.innerHTML = '论坛大师';
- open_home_button.addEventListener('click', function () {
- window.open(OPEN_HOME);
- }, false);
- function_buttons.appendChild(open_home_button);
-
// Scene mode button
function scene_mode_mouseenter() {
- scene_mode = GM_getValue('SCENE_MODE') || scene_mode;
+ scene_mode = GM_getValue(site + '_SCENE_MODE') || scene_mode;
this.innerHTML = scene_mode_dic[scene_mode];
}
function scene_mode_switch() {
this.disabled = true;
this.classList.add('button-disabled');
- setTimeout(() => {
- this.disabled = false;
- this.classList.remove('button-disabled');
- }, 1000);
scene_mode = scene_mode_cutover_dic[scene_mode];
this.innerHTML = scene_mode_dic[scene_mode];
- GM_setValue('SCENE_MODE', scene_mode);
+ GM_setValue(site + '_SCENE_MODE', scene_mode);
+ if (GLOBAL_CONFIG.auto_reload) {
+ window.location.reload();
+ return;
+ }
let message = '场景模式切换成功,刷新页面即可进入 <span style="color: var(--info);">' + scene_mode_dic[scene_mode] + '</span>。';
show_dialog(message);
+ this.disabled = false;
+ this.classList.remove('button-disabled');
}
const scene_mode_button = document.createElement('button');
scene_mode_button.className = 'custom-function-button scene-mode-button';
@@ -750,8 +687,36 @@
scene_mode_button.addEventListener('click', scene_mode_switch, false);
function_buttons.appendChild(scene_mode_button);
- // Check in
+ // Detection mode button
+ function detection_mode_mouseenter() {
+ detection_mode = GM_getValue(site + '_DETECTION_MODE') || detection_mode;
+ this.innerHTML = '探测模式:' + detection_mode_dic[detection_mode];
+ }
+ function detection_mode_switch() {
+ this.disabled = true;
+ this.classList.add('button-disabled');
+ detection_mode = detection_mode_cutover_dic[detection_mode];
+ this.innerHTML = '探测模式:' + detection_mode_dic[detection_mode];
+ GM_setValue(site + '_DETECTION_MODE', detection_mode);
+ if (GLOBAL_CONFIG.auto_reload) {
+ window.location.reload();
+ return;
+ }
+ let message = '探测模式切换成功,刷新页面即可进入 <span style="color: var(--info);">' + scene_mode_dic[scene_mode] + '</span>。';
+ show_dialog(message);
+ this.classList.remove('button-disabled');
+ }
if (member) {
+ const detection_mode_button = document.createElement('button');
+ detection_mode_button.className = 'custom-function-button detection-mode-button';
+ detection_mode_button.innerHTML = '探测模式:' + detection_mode_dic[detection_mode];
+ detection_mode_button.addEventListener('mouseenter', detection_mode_mouseenter, false);
+ detection_mode_button.addEventListener('click', detection_mode_switch, false);
+ function_buttons.appendChild(detection_mode_button);
+ }
+
+ // Check in
+ if (member && display_check_in_button) {
function check_in() {
const check_in = document.getElementsByClassName('check-in')[0];
check_in.innerHTML = '正在签到';
@@ -760,14 +725,19 @@
setTimeout(() => {
let message = '签到完成';
check_in.innerHTML = message;
- show_dialog(message)
+ if (site != 'KAFAN') show_dialog(message)
}, 1234);
- if (!!~hn.indexOf('bbs.pcbeta.com')) {
+ if (site === 'PCBETA') {
window.open('//i.pcbeta.com/home.php?mod=task&do=apply&id=149');
return false;
}
+ if (site === 'KAFAN') {
+ showWindow('dsu_amupper', 'plugin.php?id=dsu_amupper&ppersubmit=true&formhash=' + document.getElementsByName('formhash')[0].value);
+ return false;
+ }
+
for (let i = 0; i < 10; i++) {
setTimeout(() => {
let request = new XMLHttpRequest();
@@ -777,7 +747,7 @@
}, i * 100);
}
- if (!!~hn.indexOf('hostloc.com')) {
+ if (site === 'HOSTLOC') {
for (let i = 0; i < 20; i++) {
setTimeout(() => {
let request = new XMLHttpRequest();
@@ -795,15 +765,6 @@
function_buttons.appendChild(check_in_button);
}
- // Group button
- const group_button = document.createElement('button');
- group_button.className = 'custom-function-button group-button';
- group_button.innerHTML = '群组聊天';
- group_button.addEventListener('click', function () {
- window.open('https://t.me/joinchat/Bc2EjlPZ0aOwiA-Gn73xKA');
- }, false);
- function_buttons.appendChild(group_button);
-
function_buttons_package.appendChild(function_buttons);
}
@@ -819,8 +780,7 @@
window.scrollTo(0, 54321);
let fastPostMessage = document.getElementById('fastpostmessage');
!!fastPostMessage && fastPostMessage.focus();
- },
- Check_TypeScript(params));
+ }, false);
} catch (error) {
GM_log('You don\'t have permission to post content.');
}
@@ -836,7 +796,19 @@
!!fastre && skip_bottom(fastre);
}
- const attachContent = !!~hn.indexOf('hostloc.com') ? ''.repeat(10) : '\n\n[url=' + OPEN_HOME + '][img]' + window.location.protocol + '//herder.cdn.bcebos.com/Discuz!/images/dot.gif?hn=' + hn + '[/img][/url]';
+
+ function get_attach_content() {
+ switch (site) {
+ case 'KAFAN':
+ return '';
+ case 'HOSTLOC':
+ return ''.repeat(10);
+ default:
+ return '\n\n[img]' + window.location.protocol + '//herder.cdn.bcebos.com/images/dot.gif[/img]';
+ }
+ }
+
+ const attachContent = get_attach_content();
const fastPostMessage = document.getElementById('fastpostmessage');
@@ -873,10 +845,24 @@
// Automatically expand all posts
// if (typeof display_blocked_post === 'function') display_blocked_post();
+ // Display Emoji
+ if (GLOBAL_CONFIG.display_emoji) {
+ const post = document.getElementsByClassName('t_f');
+ for (let i = 0; i < post.length; i++) {
+ post[i].innerHTML = post[i].innerHTML.replace(/\&#.*?;/g, function (char) {
+ if (char.length === 13) {
+ return String.fromCodePoint(parseInt(char.match(/[0-9]+/)));
+ }
+ return char;
+ }
+ );
+ }
+ }
+
// Compatibility settings
// Cascading Style Sheets・www.hostloc.com
- !!~hn.indexOf('hostloc.com') && GM_addStyle(`
+ site === 'HOSTLOC' && GM_addStyle(`
#hiddenpoststip {
padding: 0;
}
@@ -895,6 +881,7 @@
padding-right: 8px;
content: "🌜";
}
+
#hiddenpoststip a::after {
padding-left: 8px;
content: "🌛";
@@ -902,8 +889,11 @@
`);
// Cascading Style Sheets・bbs.pcbeta.com
- if (!!~hn.indexOf('bbs.pcbeta.com')) {
- GM_addStyle(`
+ site==='PCBETA' && GM_addStyle(`
+ #wp > div:first-child {
+ display: none !important;
+ }
+
#wp > div,
#nv_forum > span,
.pls .tip,
@@ -911,7 +901,6 @@
display: none;
}
- #wp > div:first-child,
#wp > div.cl,
#wp > div.wp,
#nv_forum #scrolltop {
@@ -922,26 +911,14 @@
overflow: unset;
}
- .pls .m img {
- margin-left: 2px;
- padding: 0;
- width: 120px;
- height: 120px;
- object-fit: contain;
- background: #fff;
- border: none;
- border-radius: 50%;
- box-shadow: none;
- }
-
- .pls .m img:hover {
- border-radius: 0;
- box-shadow: none;
- }
-
.pb_pls .avatar img {
border-radius: 50%;
background: none;
+ -webkit-transition: 0.5s;
+ -moz-transition: 0.5s;
+ -ms-transition: 0.5s;
+ -o-transition: 0.5s;
+ transition: 0.5s;
}
.pb_pls .avatar img:hover {
@@ -955,19 +932,11 @@
.function-buttons {
position: absolute;
right: 0;
- padding: 2px 8px 4px 0;
- border-radius: 4px;
+ padding: 0 8px 4px 0;
}
.custom-function-button {
- color: #333;
- background-color: #fff;
- box-shadow: 0 1px 2px #bbb;
- }
-
- .custom-function-button:hover {
- color: #1985db;
- box-shadow: 0 2px 4px #bbb;
+ margin: 0 4px;
}
.wp .pgs {
@@ -977,85 +946,4 @@
user-select: none;
}
`);
-
- if (member === false) {
- GM_addStyle(`
- .function-buttons {
- padding-top: 4px;
- padding-right: 0;
- }
- `);
- }
- }
-
- // Cascading Style Sheets・bbs.fobshanghai.com
- !!~hn.indexOf('bbs.fobshanghai.com') && GM_addStyle(`
- #function-buttons.function-buttons {
- padding-top: 48px !important;
- }
-
- .maintable > .spaceborder > table:first-child,
- .line div,
- .t_infoline .line {
- display: none;
- }
-
- #aaaa {
- display: block;
- }
-
- .mainheader {
- -moz-user-select: none;
- -ms-user-select: none;
- -webkit-user-select: none;
- user-select: none;
- }
- `);
-
- // Cascading Style Sheets・bbs.huorong.cn
- !!~hn.indexOf('bbs.huorong.cn') && GM_addStyle(`
- .function-buttons {
- margin-top: 10px;
- padding-right: 6px;
- }
-
- .custom-function-button {
- background-color: #fff;
- }
- `);
-
- // Cascading Style Sheets・bbs.360.cn
- !!~hn.indexOf('bbs.360.cn') && GM_addStyle(`
- .custom-function-button {
- margin-top: -20px;
- padding: 0 8px;
- background-color: #f1f2f6;
- }
-
- .custom-function-button:hover {
- color: #f33;
- background-color: #fff;
- }
-
- .apk-download,
- .apk-download-pannel,
- .pls .tip,
- ignore_js_op .tip {
- display: none;
- }
-
- .pls .avatar img {
- padding: 0;
- background: none;
- width: 54px;
- height: 54px;
- border: none;
- border-radius: 50% !important;
- box-shadow: 0 0 2px #bbb !important;
- }
-
- .pls .avatar img:hover {
- border-radius: 0 !important;
- }
- `);
})();