PageSourceSearch

https://bestsoccertips.com/wp-content/themes/ncmaz/assets/js/style.js?ver=1791227615

js bestsoccertips.com collected 2026-10-05 19:13:56 UTC 43,495 bytes, 2,305 lines download raw bytes

1$(document).ready(function() {
2    $('.slide-image .owl-carousel').owlCarousel({
3        loop: true,
4        margin: 25,
5        nav: false,
6        dots: true,
7        autoplay: true,
8        autoplayTimeout: 10000,
9        autoplayHoverPause: false,
10        responsive: {
11            0: {
12                items: 1
13            },
14            600: {
15
16                items: 1
17
18            },
19
20            1000: {
21
22                items: 1
23
24            }
25
26        }
27
28    });
29
30    $('.slide_rating .owl-carousel').owlCarousel({
31        loop: true,
32        // margin:25,
33        nav: true,
34        dots: true,
35        autoplay: true,
36        autoplayTimeout: 10000,
37        autoplayHoverPause: false,
38        responsive: {
39
40            0: {
41
42                items: 1
43
44            },
45
46            600: {
47
48                items: 1
49
50            },
51
52            1000: {
53
54                items: 2
55
56            }
57
58        }
59
60    });
61
62})
63
64//select time tips
65
66jQuery(document).ready(function() {
67    $("#showTipsDate").change(function() {
68        var selected = $('#showTipsDate').val();
69        $.ajax({
70            type: "post",
71            dataType: "html",
72            url: '/wp-admin/admin-ajax.php',
73            data: {
74                action: 'selectedDate',
75                selected: selected,
76            },
77            context: this,
78            success: function(response) {
79                $('.tips-box.record ul.list').html(response);
80            },
81            error: function(xhr, status, error) {
82                console.error("Error occurred:", error);
83            }
84        })
85    });
86})
87
88
89
90
91//loadMore Record 
92jQuery(document).ready(function() {
93    var offset = 20;
94    var initialSpinClass = $('.fa-spinner').attr('class');
95    $('.load-more').click(function(event) {
96        var spinner = $('.fa-spinner');
97        // spinner.show();
98        $.ajax({
99            type: "post",
100            dataType: "html",
101            async: false,
102            url: '/wp-admin/admin-ajax.php',
103            data: {
104                action: "loadmore",
105                offset: offset,
106            },
107            beforeSend: function() {},
108            success: function(response) {
109                $('.list').append(response);
110                offset = offset + 20;
111            },
112            error: function(jqXHR, textStatus, errorThrown) {
113                console.log('The following error occured: ' + textStatus, errorThrown);
114            }
115        });
116
117    });
118
119});
120
121
122jQuery('#ncmaz_signupform_modal').on('submit', function(e) {
123    e.preventDefault();
124
125    var form = jQuery(this);
126    var username = form.find('#username').val();
127    var password = form.find('#pwd1').val();
128
129    // Gửi yêu cầu AJAX để đăng ký người dùng và đăng nhập tự động
130    jQuery.ajax({
131        url: '/wp-admin/admin-ajax.php',
132        type: 'POST',
133        dataType: 'json',
134        data: {
135            action: 'autoRegisterAndLogin',
136            username: username,
137            password: password
138        },
139        success: function(response) {
140            if (response.success) {
141                // alert(response.data);
142                location.reload();
143            } else {
144                alert(response.data);
145            }
146        },
147        error: function(xhr, status, error) {
148            alert(xhr.responseJSON.data);
149        }
150    });
151});
152
153
154
155
156
157class wintipsScript {
158    // Constructor
159    constructor() {
160            var ajaxurl = $("input[name='ajaxurl']").val();
161            if (typeof(ajaxurl) == "undefined") {
162                ajaxurl = '/wp-admin/admin-ajax.php';
163            }
164            this.ajaxurl = ajaxurl;
165        }
166        // Scroll Fixed Function
167    fixedTabs(className) {
168            if ($(className).length == 0) {
169                return;
170            }
171            var offsetTop = $(className).offset().top;
172            var heightTabs = $(className).height();
173            var widthTabs = $(className).width();
174            $(window).scroll(function() {
175
176                var scrollOffet = $(this).scrollTop();
177
178                if (scrollOffet > offsetTop + heightTabs) {
179
180                    $(className).css("height", heightTabs);
181
182                    $(className).children().css("width", widthTabs + 2);
183
184                    $(className).addClass('active');
185
186                } else {
187
188                    $(className).css("height", "auto");
189
190                    $(className).removeClass('active');
191
192                }
193
194            });
195
196        }
197        // View More Tips
198    viewMoreTips() {
199            alert('Ok');
200        }
201        // sort bookmaker
202    sortBookmaker(type, dom) {
203
204            var self = this;
205
206            $(".sortbookmaker").removeClass("active");
207
208            $(dom).parent().addClass("active");
209
210            $.ajax({
211
212                type: "post",
213
214                dataType: "json",
215
216                url: self.ajaxurl,
217
218                data: {
219
220                    action: 'loadMoreBookmakers',
221
222                    limit: 10,
223
224                    offset: 0,
225
226                    sortType: type
227
228                },
229
230                context: this,
231
232                success: function(res) {
233
234                    $("#list_bookmaker_content").html(res.html);
235
236                    $('.js-vbloadmore-content').attr('row', 1);
237
238                    $('.js-vbloadmore-content').attr('total_row', 10);
239
240                    $("#button_loadmores .button_loadmores").css("display", "block");
241
242                },
243
244            })
245
246        }
247        // suggest league for odd
248    oddLeagueSuggest(event, dom) {
249            var self = this;
250            var name = $(dom).val();
251            var leagueName = $("input[name='list_leage_name']").val();
252            var leagueID = $("input[name='list_leage_id']").val();
253            $.ajax({
254
255                type: "post",
256
257                dataType: "html",
258
259                url: self.ajaxurl,
260
261                data: {
262
263                    action: "oddLeagueSuggest",
264
265                    name: name,
266
267                    leagueName: leagueName,
268
269                    leagueID: leagueID,
270
271                },
272
273                context: this,
274
275                beforeSend: function() {
276
277                },
278
279                success: function(res) {
280
281                    $("#league_suggest").css("display", "block");
282
283                    $("#league_suggest").html(res);
284
285                },
286
287                error: function(jqXHR, textStatus, errorThrown) {
288
289                    console.log('The following error occured: ' + textStatus, errorThrown);
290
291                }
292
293            });
294
295        }
296        // selectOddLeagueSuggest
297    selectOddLeagueSuggest(dom) {
298
299        var name = $(dom).text();
300
301        var id = $(dom).attr("item-id");
302
303        $("input[name='fleague']").val(name);
304
305        $("input[name='fleague_hidden']").val(id);
306
307    }
308
309    // resetAllOddPage
310    resetAllOddPage(event) {
311
312        event.preventDefault();
313
314        // $("#fleague_id").val();
315
316        $("select[name='fcomming-match']").val("");
317
318        $("select[name='fvolatility-time']").val("");
319
320        $("select[name='fperiod']").val("");
321
322
323
324        $("select[name='fhandicap-live-odd']").val("");
325
326        $("select[name='fhandicap-doi-keo-tren']").val("");
327
328        $("select[name='fhandicap-change-spread']").val("");
329
330        $("select[name='fhandicap-change-odd']").val("");
331
332
333
334        $("select[name='foverunder-live-odd']").val("");
335
336        $("select[name='foverunder-change-spread']").val("");
337
338        $("select[name='foverunder-change-odd']").val("");
339
340
341
342        $("select[name='feurope-live-odd']").val("");
343
344        $("select[name='feurope-change-odd']").val("");
345
346
347
348        this.oddPageSubmit(event);
349
350    }
351
352    //oddPageSubmit
353    oddPageSubmit(event) {
354
355        event.preventDefault();
356
357
358
359        var self = this;
360
361
362
363        $("input[name='flag_filter_page_odd']").val(1);
364
365
366
367        var values = $("#odd_page_filter").serialize()
368
369
370
371        $(".button-wait").css('display', 'flex');
372
373        $(".btl-odd-filter .button").css('display', 'none');
374
375
376
377        $.ajax({
378
379            type: "post",
380
381            dataType: "json",
382
383            url: self.ajaxurl,
384
385            data: values,
386
387            context: this,
388
389            beforeSend: function() {
390
391            },
392
393            success: function(res) {
394
395                $(".button-wait").css('display', 'none');
396
397                $(".btl-odd-filter .button").css('display', 'block');
398
399                $("#tbody-data").html(res.HTML);
400
401                $("input[name='load_page_odd']").val(1);
402
403                $("input[name='count_page_odd']").val(res.COUNT_PAGE);
404
405
406
407                $("input[name='flag_filter_page_odd']").val(0);
408
409                $("input[name='flag_load_page_odd']").val(0);
410
411
412
413                $(".odd-page-wait img").css("display", "block");
414
415            },
416
417            error: function(jqXHR, textStatus, errorThrown) {
418
419                console.log('The following error occured: ' + textStatus, errorThrown);
420
421            }
422
423        });
424
425    }
426
427    // setAutoHandicapFilter
428    setAutoHandicapFilter() {
429
430            $("select[name='fhandicap-live-odd']").val("0.80");
431
432            $("select[name='fhandicap-doi-keo-tren']").val("Home");
433
434            $("select[name='fhandicap-change-spread']").val("0.5");
435
436            $("select[name='fhandicap-change-odd']").val("drop_odds");
437
438        }
439        // setAutoOVFilter
440
441    setAutoOVFilter() {
442
443            $("select[name='foverunder-live-odd']").val("0.80");
444
445            $("select[name='foverunder-change-spread']").val("0.5");
446
447            $("select[name='foverunder-change-odd']").val("drop_odds");
448
449        }
450        // setAutoEuropeFilter
451    setAutoEuropeFilter() {
452
453            $("select[name='feurope-live-odd']").val("1.80");
454
455            $("select[name='feurope-change-odd']").val("0.50");
456
457        }
458        /*
459
460         * Hàm vẽ biểu đồ tỷ lệ kèo
461
462         * id - id của div vẽ đồ thị
463
464         * idParent - id của div cha chứa div vẽ đồ thị
465
466         * arPecent - Mảng % các giá trị của kèo
467
468         * arText - Mảng text cho từng cột đồ thị
469
470         * isEmpty - Giá trị thể hiện có vẽ các cột hay không. Nếu biến này có giá trị N thì không vẽ.
471
472         */
473
474    drawOdd(id, idParent, arPrecent, arText, isEmpty) {
475
476        // Khai báo mảng màu cho các cột đồ thị
477
478        var arColor = ["#f73838", "#10b47d", "#0066cc"];
479
480
481
482        // Khai báo mảng màu cho trường hợp đồ thị chỉ có 2 cột
483
484        if (arPrecent.length == 2) {
485
486            arColor = ["#f73838", "#0066cc"];
487
488        }
489
490
491
492        // Khởi tạo biến canvas
493
494        var canvas = document.getElementById(id);
495
496
497
498        // Khởi tạo biến lấy theo thẻ div cha của canvas
499
500        var canvasParent = document.getElementById(idParent);
501
502
503
504        // Gán chiều rộng của canvas bằng chiều rộng của thẻ div cha
505
506        canvas.width = canvasParent.offsetWidth;
507
508
509
510        // Gán chiều cao của canvas bằng chiều cao của thẻ div cha
511
512        canvas.height = canvasParent.offsetHeight;
513
514
515
516        // Khai báo biến chiều rộng
517
518        var width = canvas.width;
519
520
521
522        // Khai báo biến chiều cao
523
524        var height = canvas.height;
525
526
527
528        // Khai báo biến context
529
530        var context = canvas.getContext('2d');
531
532
533
534        // Khai báo tọa độ x, y và biến chiều cao của cột đồ thị
535
536        var x, y, heightCol;
537
538
539
540        // Trường hợp không có tỷ lệ kèo để vẽ đồ thị
541
542        if (isEmpty == "N") {
543
544            // Viết câu text: There are no predictions at the time
545
546            context.font = "14px Roboto";
547
548            context.fillStyle = '#000';
549
550            context.textAlign = "center";
551
552            context.fillText("There are no predictions at the time", width / 2, height - 10);
553
554
555
556            // Vẽ button xám
557
558            x = Math.round(width / 2) - 80;
559
560            y = height - 125;
561
562
563
564            context.beginPath();
565
566            context.fillStyle = '#ddd';
567
568            context.fillRect(x, y, 160, 40);
569
570            context.stroke();
571
572
573
574            // Vẽ đầu bo tròn bên trái của btn
575
576            context.beginPath();
577
578            context.arc(x, y + 20, 19.5, 0, 2 * Math.PI);
579
580            context.fillStyle = '#ddd';
581
582            context.fill();
583
584            context.strokeStyle = '#ddd';
585
586            context.stroke();
587
588
589
590            // Vẽ đầu bo tròn bên phải của btn
591
592            context.beginPath();
593
594            context.arc(x + 160, y + 20, 19.5, 0, 2 * Math.PI);
595
596            context.fillStyle = '#ddd';
597
598            context.fill();
599
600            context.strokeStyle = '#ddd';
601
602            context.stroke();
603
604
605
606            // Viết câu text: Predicting...
607
608            context.font = "18px Roboto";
609
610            context.fillStyle = '#000';
611
612            context.textAlign = "center";
613
614            context.fillText("Predicting...", Math.round(width / 2), height - 100);
615
616
617
618            // Thoát khỏi hàm vẽ
619
620            return;
621
622        }
623
624
625
626        // Tính chiều rộng của 1 cột đồ thị
627
628        var widthChar = Math.round(width / (arPrecent.length * 2 + 1)) * 1.8;
629
630
631
632        // Tính khoảng cách giữa các cột của đồ thị
633
634        var distance = Math.round((width - widthChar * arPrecent.length) / (arPrecent.length + 1));
635
636
637
638        // Vẽ các cột đồ thị
639
640        for (var i = 0; i < arPrecent.length; i++) {
641
642            // Tính tọa độ x
643
644            x = (i + 1) * distance + i * widthChar;
645
646
647
648            // Tính chiều cao cột đồ thị
649
650            heightCol = Math.round(height * parseFloat(arPrecent[i]) / 100);
651
652
653
654            // Chiều cao tối thiểu của một cột là 25
655
656            if (heightCol < 25) {
657
658                heightCol = 25;
659
660            }
661
662
663
664            // Tính tọa độ y
665
666            y = height - heightCol + 6;
667
668
669
670            // Vẽ cột
671
672            context.beginPath();
673
674            context.fillStyle = arColor[i];
675
676            context.fillRect(x, y, widthChar, heightCol);
677
678            context.stroke();
679
680
681
682            context.beginPath();
683
684            context.fillStyle = arColor[i];
685
686            context.fillRect(x + 5, y - 6, widthChar - 10, 6);
687
688            context.stroke();
689
690
691
692            // Vẽ đầu bo tròn trên cột
693
694            context.beginPath();
695
696            context.arc(x + 6, y, 5, 0, 2 * Math.PI);
697
698            context.fillStyle = arColor[i];
699
700            context.fill();
701
702            context.strokeStyle = arColor[i];
703
704            context.stroke();
705
706
707
708            context.beginPath();
709
710            context.arc(x + widthChar - 6, y, 5, 0, 2 * Math.PI);
711
712            context.fillStyle = arColor[i];
713
714            context.fill();
715
716            context.strokeStyle = arColor[i];
717
718            context.stroke();
719
720
721
722            // Viết % chiến thắng
723
724            context.font = "bold 18px Roboto";
725
726            context.fillStyle = '#000';
727
728            context.textAlign = "center";
729
730            context.fillText(arPrecent[i] + "%", x + widthChar / 2, y - 10);
731
732
733
734            // Viết nhãn của cột
735
736            if (heightCol > 20) {
737
738                context.font = "15px Roboto";
739
740                context.fillStyle = '#fff';
741
742                context.textAlign = "center";
743
744                context.fillText(arText[i], x + widthChar / 2, height - 10);
745
746            }
747
748        }
749
750    }
751
752
753
754    // draw H2H
755
756    drawH2H(id, idParent, res, precent, color) {
757
758        var screenWidth = screen.width;
759
760        if (screenWidth < 600) {
761
762            this.drawH2HMobile(id, idParent, res, precent, color);
763
764        } else {
765
766            this.drawH2HPC(id, idParent, res, precent, color);
767
768        }
769
770    }
771
772
773
774    drawH2HPC(id, idParent, res, precent, color) {
775
776        var defaultRadius = 14;
777
778        var defaultFontSize = 15;
779
780        var defaultDeltaCenterY = 8;
781
782
783
784        var canvas = document.getElementById(id);
785
786
787
788        var canvasParent = document.getElementById(idParent);
789
790
791
792        canvas.width = canvasParent.offsetWidth;
793
794
795
796        var context = canvas.getContext('2d');
797
798
799
800        var width = canvas.width;
801
802        var height = canvas.height;
803
804        var col1 = 100;
805
806        var col3 = 80;
807
808
809
810        var widthLine = width - col1 - col3;
811
812
813
814        var x = Math.round(height / 4);
815
816
817
818        // circle Win
819
820        context.beginPath();
821
822        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, x + 2.5, defaultRadius, 0, 2 * Math.PI);
823
824        context.strokeStyle = '#0066cc';
825
826        context.stroke();
827
828        context.fillStyle = "#0066cc";
829
830        context.fill();
831
832
833
834        // border grey
835
836        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
837
838        context.strokeStyle = '#ccc';
839
840        context.stroke();
841
842
843
844        // Win
845
846        context.font = "bold " + defaultFontSize + "px Roboto";
847
848        context.fillStyle = '#fff';
849
850        context.fillText("W", Math.round(col1 / 2) + 1, x + 8);
851
852
853
854        // circle Draw
855
856        context.beginPath();
857
858        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, 2 * x + 2.5, defaultRadius, 0, 2 * Math.PI);
859
860        context.strokeStyle = '#10b47d';
861
862        context.stroke();
863
864        context.fillStyle = "#10b47d";
865
866        context.fill();
867
868
869
870        // border grey
871
872        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, 2 * x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
873
874        context.strokeStyle = '#ccc';
875
876        context.stroke();
877
878
879
880        // Draw
881
882        context.font = "bold " + defaultFontSize + "px Roboto";
883
884        context.fillStyle = '#fff';
885
886        context.fillText("D", Math.round(col1 / 2) + 4, 2 * x + 8);
887
888
889
890        // circle Lose
891
892        context.beginPath();
893
894        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, 3 * x + 2.5, defaultRadius, 0, 2 * Math.PI);
895
896        context.strokeStyle = '#f73838';
897
898        context.stroke();
899
900        context.fillStyle = "#f73838";
901
902        context.fill();
903
904
905
906        // border grey
907
908        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, 3 * x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
909
910        context.strokeStyle = '#ccc';
911
912        context.stroke();
913
914
915
916        // Lose
917
918        context.font = "bold " + defaultFontSize + "px Roboto";
919
920        context.fillStyle = '#fff';
921
922        context.fillText("L", Math.round(col1 / 2) + 4, 3 * x + 8);
923
924
925
926        // line 1
927
928        context.beginPath();
929
930        context.moveTo(col1, x);
931
932        context.lineTo(widthLine, x);
933
934        context.strokeStyle = '#ddd';
935
936        context.lineWidth = 0.5;
937
938        context.stroke();
939
940
941
942        // line 2
943
944        context.beginPath();
945
946        context.moveTo(col1, 2 * x);
947
948        context.lineTo(widthLine, 2 * x);
949
950        context.strokeStyle = '#ddd';
951
952        context.lineWidth = 0.5;
953
954        context.stroke();
955
956
957
958        // line 3
959
960        context.beginPath();
961
962        context.moveTo(col1, 3 * x);
963
964        context.lineTo(widthLine, 3 * x);
965
966        context.strokeStyle = '#ddd';
967
968        context.lineWidth = 0.5;
969
970        context.stroke();
971
972
973
974        var distance = Math.ceil(widthLine / (res.length + 3));
975
976
977
978        context.beginPath();
979
980
981
982        if (res[0] == "W") {
983
984            context.moveTo(col1 + distance, x);
985
986        } else if (res[0] == "D") {
987
988            context.moveTo(col1 + distance, 2 * x);
989
990        } else {
991
992            context.moveTo(col1 + distance, 3 * x);
993
994        }
995
996
997
998        for (var i = 1; i < res.length; i++) {
999
1000            if (res[i] == "W") {
1001
1002                context.lineTo(col1 + (i + 1) * distance, x);
1003
1004            } else if (res[i] == "D") {
1005
1006                context.lineTo(col1 + (i + 1) * distance, 2 * x);
1007
1008            } else {
1009
1010                context.lineTo(col1 + (i + 1) * distance, 3 * x);
1011
1012            }
1013
1014        }
1015
1016
1017
1018        context.strokeStyle = '#ddd';
1019
1020        context.lineWidth = 0.5;
1021
1022        context.stroke();
1023
1024
1025
1026        for (var i = 0; i < res.length; i++) {
1027
1028            if (res[i] == "W") {
1029
1030                context.beginPath();
1031
1032                context.arc(col1 + (i + 1) * distance, x + 2.5, defaultRadius, 0, 2 * Math.PI);
1033
1034                context.fillStyle = "#0066cc";
1035
1036                context.fill();
1037
1038                context.strokeStyle = '#0066cc';
1039
1040                context.stroke();
1041
1042
1043
1044                // border grey
1045
1046                context.arc(col1 + (i + 1) * distance, x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1047
1048                context.strokeStyle = '#fff';
1049
1050                context.stroke();
1051
1052
1053
1054                // border grey
1055
1056                context.arc(col1 + (i + 1) * distance, x + 2.5, defaultRadius + 2, 0, 2 * Math.PI);
1057
1058                context.strokeStyle = '#0066cc57';
1059
1060                context.stroke();
1061
1062
1063
1064                context.font = "bold " + defaultFontSize + "px Roboto";
1065
1066                context.fillStyle = '#ffffff';
1067
1068                context.fillText("W", col1 + (i + 1) * distance - 7, x + 8);
1069
1070            } else if (res[i] == "D") {
1071
1072                context.beginPath();
1073
1074                context.arc(col1 + (i + 1) * distance, 2 * x + 2.5, defaultRadius, 0, 2 * Math.PI);
1075
1076                context.fillStyle = "#10b47d";
1077
1078                context.fill();
1079
1080                context.strokeStyle = '#10b47d';
1081
1082                context.stroke();
1083
1084
1085
1086                // border grey
1087
1088                context.arc(col1 + (i + 1) * distance, 2 * x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1089
1090                context.strokeStyle = '#fff';
1091
1092                context.stroke();
1093
1094
1095
1096                // border grey
1097
1098                context.arc(col1 + (i + 1) * distance, 2 * x + 2.5, defaultRadius + 2, 0, 2 * Math.PI);
1099
1100                context.strokeStyle = '#10b47d5e';
1101
1102                context.stroke();
1103
1104
1105
1106                context.font = "bold " + defaultFontSize + "px Roboto";
1107
1108                context.fillStyle = '#ffffff';
1109
1110                context.fillText("D", col1 + (i + 1) * distance - 5, 2 * x + 8);
1111
1112            } else {
1113
1114                context.beginPath();
1115
1116                context.arc(col1 + (i + 1) * distance, 3 * x + 2.5, defaultRadius, 0, 2 * Math.PI);
1117
1118                context.fillStyle = "#f73838";
1119
1120                context.fill();
1121
1122                context.strokeStyle = '#f73838';
1123
1124                context.stroke();
1125
1126
1127
1128                // border grey
1129
1130                context.arc(col1 + (i + 1) * distance, 3 * x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1131
1132                context.strokeStyle = '#fff';
1133
1134                context.stroke();
1135
1136
1137
1138                // border grey
1139
1140                context.arc(col1 + (i + 1) * distance, 3 * x + 2.5, defaultRadius + 2, 0, 2 * Math.PI);
1141
1142                context.strokeStyle = '#f738385e';
1143
1144                context.stroke();
1145
1146
1147
1148                context.font = "bold " + defaultFontSize + "px Roboto";
1149
1150                context.fillStyle = '#ffffff';
1151
1152                context.fillText("L", col1 + (i + 1) * distance - 5, 3 * x + 7);
1153
1154            }
1155
1156        }
1157
1158
1159
1160
1161
1162        // precent
1163
1164        context.beginPath();
1165
1166        context.arc(col1 + widthLine + Math.round(col3 / 2) - 40, 2 * x, 40, 0, 2 * Math.PI);
1167
1168        context.lineWidth = 8;
1169
1170        context.strokeStyle = '#ddd';
1171
1172        context.stroke();
1173
1174
1175
1176        var startAngle = Math.PI;
1177
1178        var endAngle = parseFloat(precent) / 100 * 2 * Math.PI + Math.PI;
1179
1180        var counterClockwise = false;
1181
1182
1183
1184        context.beginPath();
1185
1186        context.arc(col1 + widthLine + Math.round(col3 / 2) - 40, 2 * x, 40, startAngle, endAngle, counterClockwise);
1187
1188        context.lineWidth = 8;
1189
1190        context.strokeStyle = color;
1191
1192        context.stroke();
1193
1194
1195
1196        context.font = "bold 18px Roboto";
1197
1198        context.fillStyle = '#000';
1199
1200        context.fillText(precent + "%", col1 + widthLine + Math.round(col3 / 2) - 55, 2 * x + 4);
1201
1202    }
1203
1204
1205
1206    drawH2HMobile(id, idParent, res, precent, color) {
1207
1208        var defaultRadius = 8;
1209
1210        var defaultFontSize = 11;
1211
1212        var defaultDeltaCenterY = 4;
1213
1214
1215
1216
1217
1218        var canvas = document.getElementById(id);
1219
1220
1221
1222        var canvasParent = document.getElementById(idParent);
1223
1224
1225
1226        canvas.width = canvasParent.offsetWidth;
1227
1228
1229
1230        var context = canvas.getContext('2d');
1231
1232
1233
1234        var width = canvas.width;
1235
1236        // var height = canvas.height;
1237
1238        var height = 100;
1239
1240        var col1 = 30;
1241
1242        var col3 = 0;
1243
1244
1245
1246        var widthLine = width - col1 - col3;
1247
1248
1249
1250        var x = Math.round(height / 4);
1251
1252
1253
1254        // circle Win
1255
1256        context.beginPath();
1257
1258        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, x + 2.5, defaultRadius, 0, 2 * Math.PI);
1259
1260        context.strokeStyle = '#0066cc';
1261
1262        context.stroke();
1263
1264        context.fillStyle = "#0066cc";
1265
1266        context.fill();
1267
1268
1269
1270        // border grey
1271
1272        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1273
1274        context.strokeStyle = '#ccc';
1275
1276        context.stroke();
1277
1278
1279
1280        // Win
1281
1282        context.font = "bold " + defaultFontSize + "px Roboto";
1283
1284        context.fillStyle = '#fff';
1285
1286        context.fillText("W", Math.round(col1 / 2) - 1, x + 6);
1287
1288
1289
1290        // circle Draw
1291
1292        context.beginPath();
1293
1294        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, 2 * x + 2.5, defaultRadius, 0, 2 * Math.PI);
1295
1296        context.strokeStyle = '#10b47d';
1297
1298        context.stroke();
1299
1300        context.fillStyle = "#10b47d";
1301
1302        context.fill();
1303
1304
1305
1306        // border grey
1307
1308        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, 2 * x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1309
1310        context.strokeStyle = '#ccc';
1311
1312        context.stroke();
1313
1314
1315
1316        // Draw
1317
1318        context.font = "bold " + defaultFontSize + "px Roboto";
1319
1320        context.fillStyle = '#fff';
1321
1322        context.fillText("D", Math.round(col1 / 2) + 1, 2 * x + 6);
1323
1324
1325
1326        // circle Lose
1327
1328        context.beginPath();
1329
1330        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, 3 * x + 2.5, defaultRadius, 0, 2 * Math.PI);
1331
1332        context.strokeStyle = '#f73838';
1333
1334        context.stroke();
1335
1336        context.fillStyle = "#f73838";
1337
1338        context.fill();
1339
1340
1341
1342        // border grey
1343
1344        context.arc(Math.round(col1 / 2) + defaultDeltaCenterY, 3 * x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1345
1346        context.strokeStyle = '#ccc';
1347
1348        context.stroke();
1349
1350
1351
1352        // Lose
1353
1354        context.font = "bold " + defaultFontSize + "px Roboto";
1355
1356        context.fillStyle = '#fff';
1357
1358        context.fillText("L", Math.round(col1 / 2) + 1, 3 * x + 6);
1359
1360
1361
1362        // line 1
1363
1364        context.beginPath();
1365
1366        context.moveTo(col1, x);
1367
1368        context.lineTo(widthLine, x);
1369
1370        context.strokeStyle = '#ddd';
1371
1372        context.lineWidth = 0.5;
1373
1374        context.stroke();
1375
1376
1377
1378        // line 2
1379
1380        context.beginPath();
1381
1382        context.moveTo(col1, 2 * x);
1383
1384        context.lineTo(widthLine, 2 * x);
1385
1386        context.strokeStyle = '#ddd';
1387
1388        context.lineWidth = 0.5;
1389
1390        context.stroke();
1391
1392
1393
1394        // line 3
1395
1396        context.beginPath();
1397
1398        context.moveTo(col1, 3 * x);
1399
1400        context.lineTo(widthLine, 3 * x);
1401
1402        context.strokeStyle = '#ddd';
1403
1404        context.lineWidth = 0.5;
1405
1406        context.stroke();
1407
1408
1409
1410        var distance = Math.ceil(widthLine / (res.length + 3));
1411
1412
1413
1414        context.beginPath();
1415
1416
1417
1418        if (res[0] == "W") {
1419
1420            context.moveTo(col1 + distance, x);
1421
1422        } else if (res[0] == "D") {
1423
1424            context.moveTo(col1 + distance, 2 * x);
1425
1426        } else {
1427
1428            context.moveTo(col1 + distance, 3 * x);
1429
1430        }
1431
1432
1433
1434        for (var i = 1; i < res.length; i++) {
1435
1436            if (res[i] == "W") {
1437
1438                context.lineTo(col1 + (i + 1) * distance, x);
1439
1440            } else if (res[i] == "D") {
1441
1442                context.lineTo(col1 + (i + 1) * distance, 2 * x);
1443
1444            } else {
1445
1446                context.lineTo(col1 + (i + 1) * distance, 3 * x);
1447
1448            }
1449
1450        }
1451
1452
1453
1454        context.strokeStyle = '#ddd';
1455
1456        context.lineWidth = 0.5;
1457
1458        context.stroke();
1459
1460
1461
1462        for (var i = 0; i < res.length; i++) {
1463
1464            if (res[i] == "W") {
1465
1466                context.beginPath();
1467
1468                context.arc(col1 + (i + 1) * distance, x + 2.5, defaultRadius, 0, 2 * Math.PI);
1469
1470                context.fillStyle = "#0066cc";
1471
1472                context.fill();
1473
1474                context.strokeStyle = '#0066cc';
1475
1476                context.stroke();
1477
1478
1479
1480                // border grey
1481
1482                context.arc(col1 + (i + 1) * distance, x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1483
1484                context.strokeStyle = '#fff';
1485
1486                context.stroke();
1487
1488
1489
1490                // border grey
1491
1492                context.arc(col1 + (i + 1) * distance, x + 2.5, defaultRadius + 2, 0, 2 * Math.PI);
1493
1494                context.strokeStyle = '#0066cc57';
1495
1496                context.stroke();
1497
1498
1499
1500                context.font = "bold " + defaultFontSize + "px Roboto";
1501
1502                context.fillStyle = '#ffffff';
1503
1504                context.fillText("W", col1 + (i + 1) * distance - 5, x + 6);
1505
1506            } else if (res[i] == "D") {
1507
1508                context.beginPath();
1509
1510                context.arc(col1 + (i + 1) * distance, 2 * x + 2.5, defaultRadius, 0, 2 * Math.PI);
1511
1512                context.fillStyle = "#10b47d";
1513
1514                context.fill();
1515
1516                context.strokeStyle = '#10b47d';
1517
1518                context.stroke();
1519
1520
1521
1522                // border grey
1523
1524                context.arc(col1 + (i + 1) * distance, 2 * x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1525
1526                context.strokeStyle = '#fff';
1527
1528                context.stroke();
1529
1530
1531
1532                // border grey
1533
1534                context.arc(col1 + (i + 1) * distance, 2 * x + 2.5, defaultRadius + 2, 0, 2 * Math.PI);
1535
1536                context.strokeStyle = '#10b47d5e';
1537
1538                context.stroke();
1539
1540
1541
1542                context.font = "bold " + defaultFontSize + "px Roboto";
1543
1544                context.fillStyle = '#ffffff';
1545
1546                context.fillText("D", col1 + (i + 1) * distance - 3, 2 * x + 6);
1547
1548            } else {
1549
1550                context.beginPath();
1551
1552                context.arc(col1 + (i + 1) * distance, 3 * x + 2.5, defaultRadius, 0, 2 * Math.PI);
1553
1554                context.fillStyle = "#f73838";
1555
1556                context.fill();
1557
1558                context.strokeStyle = '#f73838';
1559
1560                context.stroke();
1561
1562
1563
1564                // border grey
1565
1566                context.arc(col1 + (i + 1) * distance, 3 * x + 2.5, defaultRadius + 1, 0, 2 * Math.PI);
1567
1568                context.strokeStyle = '#fff';
1569
1570                context.stroke();
1571
1572
1573
1574                // border grey
1575
1576                context.arc(col1 + (i + 1) * distance, 3 * x + 2.5, defaultRadius + 2, 0, 2 * Math.PI);
1577
1578                context.strokeStyle = '#f738385e';
1579
1580                context.stroke();
1581
1582
1583
1584                context.font = "bold " + defaultFontSize + "px Roboto";
1585
1586                context.fillStyle = '#ffffff';
1587
1588                context.fillText("L", col1 + (i + 1) * distance - 3, 3 * x + 6);
1589
1590            }
1591
1592        }
1593
1594
1595
1596
1597
1598        // precent
1599
1600        context.beginPath();
1601
1602        context.arc(Math.round(width / 2), 150, 40, 0, 2 * Math.PI);
1603
1604        context.lineWidth = 8;
1605
1606        context.strokeStyle = '#ddd';
1607
1608        context.stroke();
1609
1610
1611
1612        var startAngle = Math.PI;
1613
1614        var endAngle = parseFloat(precent) / 100 * 2 * Math.PI + Math.PI;
1615
1616        var counterClockwise = false;
1617
1618
1619
1620        context.beginPath();
1621
1622        context.arc(Math.round(width / 2), 150, 40, startAngle, endAngle, counterClockwise);
1623
1624        context.lineWidth = 8;
1625
1626        context.strokeStyle = color;
1627
1628        context.stroke();
1629
1630
1631
1632        context.font = "bold 18px Roboto";
1633
1634        context.fillStyle = '#000';
1635
1636        context.fillText(precent + "%", Math.round(width / 2) - 15, 150 + 4);
1637
1638    }
1639
1640
1641
1642
1643
1644
1645
1646    // Hàm thực hiển thị đếm ngược thời gian đến khi bắt đầu trận đấu
1647
1648    coutdown(id) {
1649
1650        // Vòng lặp thự hiện sau mỗi 1 giây
1651
1652        var countDownInterVal = setInterval(function() {
1653
1654            // Đọc thời gian còn lại đến khi bắt đầu trận đấu
1655
1656            var timestamp = parseInt($("#" + id).attr("timestamp"));
1657
1658            // Giảm thời gian 1 giây
1659
1660            var time = timestamp - 1;
1661
1662
1663
1664            if (time < 0) {
1665
1666                clearInterval(countDownInterVal);
1667
1668                $(".timeStart .countdown").html('<span class="live-match">Live</span>');
1669
1670                return;
1671
1672            }
1673
1674
1675
1676            // Tính số ngày
1677
1678            var d = Math.floor(time / 86400);
1679
1680            time = time - d * 86400;
1681
1682
1683
1684            // Tính số giờ
1685
1686            var h = Math.floor(time / 3600);
1687
1688            time = time - h * 3600;
1689
1690
1691
1692            // Tính số phút
1693
1694            var m = Math.floor(time / 60);
1695
1696            time = time - m * 60;
1697
1698
1699
1700            // Tính số giây
1701
1702            var s = time % 60;
1703
1704
1705
1706            // Khai báo biến string hiển thị thời gian
1707
1708            var str;
1709
1710
1711
1712            // Nếu ngày < 10 thì thêm số 0 phía trước
1713
1714            if (d < 10) {
1715
1716                str = "0" + d + "d ";
1717
1718            } else if (d == 0) {
1719
1720                str = "";
1721
1722            } else {
1723
1724                str = d + "d ";
1725
1726            }
1727
1728
1729
1730            // Nếu giờ < 10 thì thêm số 0 phía trước
1731
1732            if (h < 10) {
1733
1734                h = "0" + h;
1735
1736            }
1737
1738
1739
1740            // Cộng thêm giờ cho biến str
1741
1742            str += h + "h ";
1743
1744
1745
1746            // Nếu phút < 10 thì thêm số 0 phía trước
1747
1748            if (m < 10) {
1749
1750                m = "0" + m;
1751
1752            }
1753
1754
1755
1756            // Cộng thêm phút cho biến str
1757
1758            str += m + "m ";
1759
1760
1761
1762            // Nếu giây < 10 thì thêm số 0 phía trước
1763
1764            if (s < 10) {
1765
1766                s = "0" + s;
1767
1768            }
1769
1770
1771
1772            // Cộng thêm giây cho biến str
1773
1774            str += s + "s";
1775
1776
1777
1778            // Gán giá trị cho thẻ div hiển thị thời gian
1779
1780            $("#" + id).text(str);
1781
1782
1783
1784            // Gán giá trị timestamp chi div hiển thị thời gian
1785
1786            $("#" + id).attr("timestamp", timestamp - 1);
1787
1788        }, 1000);
1789
1790    }
1791
1792
1793
1794    nextPostOdd(number) {
1795
1796        var left = parseInt($("#block_odd_detail_more").css("marginLeft").replace('px', ''));
1797
1798
1799
1800        var blockWidth = parseInt($("#block_odd_detail_more").width());
1801
1802        var itemWidth = parseInt($("#block_odd_detail_more .item").width());
1803
1804
1805
1806        var delta;
1807
1808
1809
1810        if (number == 1) {
1811
1812            delta = left + ((-1) * itemWidth - 12);
1813
1814
1815
1816            if (blockWidth + delta < 3 * itemWidth) {
1817
1818                return;
1819
1820            }
1821
1822
1823
1824            $("#block_odd_detail_more").css("marginLeft", delta + "px");
1825
1826            // this.movePostOdd(delta, number);
1827
1828        } else if (number == -1) {
1829
1830            delta = left + (itemWidth + 12);
1831
1832
1833
1834            if (left >= 0) {
1835
1836                return;
1837
1838            }
1839
1840
1841
1842            $("#block_odd_detail_more").css("marginLeft", delta + "px");
1843
1844        }
1845
1846    }
1847
1848
1849
1850    movePostOdd(delta, number) {
1851
1852        var speed = Math.round(Math.abs(delta) / 4);
1853
1854        var left = parseInt($("#block_odd_detail_more").css("marginLeft").replace('px', ''));
1855
1856
1857
1858        var moveInterval = setInterval(function function_name() {
1859
1860            console.log(speed);
1861
1862
1863
1864            speed = speed / 2;
1865
1866
1867
1868            if (speed < 1) {
1869
1870                speed = 1;
1871
1872            }
1873
1874
1875
1876            if (number == 1) {
1877
1878                left = left - speed;
1879
1880
1881
1882                if (left < delta) {
1883
1884                    $("#block_odd_detail_more").css("marginLeft", delta + "px");
1885
1886                } else {
1887
1888                    $("#block_odd_detail_more").css("marginLeft", left + "px");
1889
1890                }
1891
1892
1893
1894                if (left < delta) {
1895
1896                    clearInterval(moveInterval);
1897
1898                    flagMoveOddDetail = 0;
1899
1900                }
1901
1902            } else if (number == -1) {
1903
1904                left = left + speed;
1905
1906
1907
1908                if (left > delta) {
1909
1910                    $("#block_odd_detail_more").css("marginLeft", delta + "px");
1911
1912                } else {
1913
1914                    $("#block_odd_detail_more").css("marginLeft", left + "px");
1915
1916                }
1917
1918
1919
1920                if (left > delta) {
1921
1922                    clearInterval(moveInterval);
1923
1924                    flagMoveOddDetail = 0;
1925
1926                }
1927
1928            }
1929
1930        }, 0.5);
1931
1932    }
1933
1934
1935
1936    /*
1937
1938     * Hàm sắp xếp các cột trang so sánh nhà cái
1939
1940     */
1941
1942    compareBookmakerHeight() {
1943
1944        if ($(".container_sosanhnc .bookmaker-compare-item").length !== 0) {
1945
1946            var arRow = ["bxdbc", "ttcnc", "bxuu", "bxnhuoc", "bxnaptien", "bxrut", "bxctkm", "customer-support", "system-information"];
1947
1948
1949
1950            for (var i = 0; i < arRow.length; i++) {
1951
1952                let classRow = arRow[i];
1953
1954                let max = -1;
1955
1956                $(".container_sosanhnc .bookmaker-compare-item ." + classRow).each(function(argument) {
1957
1958                    let itemHeight = $(this).attr("item-height");
1959
1960
1961
1962                    if (typeof(itemHeight) == 'undefined') {
1963
1964                        itemHeight = parseInt($(this).height());
1965
1966                        $(this).attr("item-height", itemHeight);
1967
1968                    }
1969
1970
1971
1972                    if (max == -1) {
1973
1974                        max = itemHeight;
1975
1976                    } else {
1977
1978                        max = Math.max(max, itemHeight);
1979
1980                    }
1981
1982                });
1983
1984
1985
1986                $(".container_sosanhnc .bookmaker-compare-item ." + classRow).css("height", max + "px");
1987
1988            }
1989
1990        }
1991
1992    }
1993
1994
1995
1996    /*
1997
1998     *
1999
2000     */
2001
2002    chooseBookmakerForCompare(dom) {
2003
2004        var self = this;
2005
2006        var newBookmarkerID = $(dom).val();
2007
2008        var oldBookmarkerID = $(dom).attr("item-id");
2009
2010
2011
2012        $.ajax({
2013
2014            type: "post",
2015
2016            dataType: "html",
2017
2018            url: self.ajaxurl,
2019
2020            data: {
2021
2022                action: "chooseBookmakerForCompare",
2023
2024                id: newBookmarkerID
2025
2026            },
2027
2028            context: this,
2029
2030            beforeSend: function() {
2031
2032            },
2033
2034            success: function(res) {
2035
2036                $("#" + oldBookmarkerID).html(res);
2037
2038                $(dom).attr("item-id", newBookmarkerID);
2039
2040                $(".col_" + oldBookmarkerID + " .bookmaker-compare-item").attr("id", newBookmarkerID);
2041
2042                self.compareBookmakerHeight();
2043
2044            },
2045
2046            error: function(jqXHR, textStatus, errorThrown) {
2047
2048                console.log('The following error occured: ' + textStatus, errorThrown);
2049
2050            }
2051
2052        });
2053
2054    }
2055
2056
2057
2058    /*
2059
2060     * Hiển thị danh sách nhà cái
2061
2062     */
2063
2064    showListBookmarkerCompare(id) {
2065
2066        $("#" + id).css("display", "block");
2067
2068    }
2069
2070
2071
2072    /*
2073
2074     * Hàm xử lý sự kiện chọn nhà cái để so sánh
2075
2076     */
2077
2078    getBookmaker(dom) {
2079
2080        var src = $(dom).children().attr('src');
2081
2082        var bookmarkerID = $(dom).attr('data-id');
2083
2084        var BookmarkerIdex = $(dom).attr('data-index');
2085
2086        var href = $("#btn_bookmaker_compare").attr("href");
2087
2088        var dataID;
2089
2090
2091
2092        if (BookmarkerIdex == "nc1") {
2093
2094
2095
2096
2097
2098            $("#bookmaker_compare_1").css("background-image", "url(" + src + ")");
2099
2100            $("#list_nc1").css("display", "none");
2101
2102
2103
2104            dataID = $("#bookmaker_compare_1").attr("data-id");
2105
2106
2107
2108            $("#bookmaker_compare_1").attr("data-id", bookmarkerID);
2109
2110
2111
2112            href = href.replace("bm1=" + dataID, "bm1=" + bookmarkerID);
2113
2114
2115
2116        } else {
2117
2118            $("#bookmaker_compare_2").css("background-image", "url(" + src + ")");
2119
2120            $("#list_nc2").css("display", "none");
2121
2122
2123
2124            dataID = $("#bookmaker_compare_2").attr("data-id");
2125
2126
2127
2128            $("#bookmaker_compare_2").attr("data-id", bookmarkerID);
2129
2130
2131
2132            href = href.replace("bm2=" + dataID, "bm2=" + bookmarkerID);
2133
2134        }
2135
2136
2137
2138        $("#btn_bookmaker_compare").attr('href', href);
2139
2140    }
2141
2142
2143
2144    /*
2145
2146     * Hàm xử lý sự kiện click button compare nhà cái
2147
2148     */
2149
2150    compareBookmaker(dom) {
2151
2152        var href = $(dom).attr('href');
2153
2154        location.href = href;
2155
2156    }
2157
2158
2159
2160    /*
2161
2162     *
2163
2164     */
2165
2166    showSeach(dom) {
2167        var status = $(dom).attr("status");
2168        if (status == "search") {
2169            $(".topbar_right .cssearch_form_top").css("display", "block");
2170
2171            $(dom).html('<i class="fa fa-close"></i>');
2172
2173            $(dom).attr("status", "close");
2174
2175        } else {
2176
2177            $(".topbar_right .cssearch_form_top").css("display", "none");
2178
2179            $(dom).html('<i class="fa fa-search"></i>');
2180
2181            $(dom).attr("status", "search");
2182
2183        }
2184
2185    }
2186
2187
2188
2189    /*
2190
2191     *
2192
2193     */
2194    bxsidepostfixed() {
2195        if ($(".bxsidepost-single").length == 0) {
2196            return;
2197        }
2198        $('.bxsidepost-single').theiaStickySidebar({
2199            additionalMarginTop: 40,
2200        });
2201    }
2202    chooseTimezone(timezone) {
2203        var self = this;
2204        $(".timezone-cur span").text("GMT " + timezone);
2205        $(".timezone-popup").css("display", "none");
2206        $.ajax({
2207            type: "post",
2208            dataType: "html",
2209            url: self.ajaxurl,
2210            data: {
2211                action: 'addtimezone',
2212                timezone: timezone
2213            },
2214            context: this,
2215            success: function(res) {
2216                location.reload();
2217            },
2218        })
2219    }
2220
2221    showTimezone() {
2222        $(".timezone-popup").css("display", "flex");
2223    }
2224
2225    writeCookie(timezone) {
2226        var now = new Date();
2227        now.setMonth(now.getMonth() + 1);
2228        document.cookie = "timezone=" + timezone + ";expires=" + now.toUTCString() + ";"
2229    }
2230
2231    updateTimezone() {
2232        var self = this;
2233        $.ajax({
2234            type: "post",
2235            dataType: "html",
2236            url: self.ajaxurl,
2237            data: {
2238                action: 'updateTimezone',
2239            },
2240            context: this,
2241            success: function(res) {
2242                $(".timezone-cur span").text("GMT " + res);
2243            },
2244        })
2245    }
2246}
2247
2248
2249
2250var SoccerTipsScript = new wintipsScript();
2251
2252
2253function chooseTimezone(timezone) {
2254    var self = this;
2255    $(".timezone-cur span").text("GMT " + timezone);
2256    $(".timezone-popup").css("display", "none");
2257
2258    writeCookie(timezone);
2259
2260    $.ajax({
2261        type: "post",
2262        dataType: "html",
2263        url: '/wp-admin/admin-ajax.php',
2264        data: {
2265            action: 'addtimezone',
2266            timezone: timezone
2267        },
2268        context: this,
2269        success: function(res) {
2270            location.reload();
2271        },
2272        error: function(xhr, status, error) {
2273            console.log("Error occurred: " + error);
2274        }
2275    });
2276}
2277
2278function updateTimezone() {
2279    var self = this;
2280    $.ajax({
2281        type: "post",
2282        dataType: "html",
2283        url: '/wp-admin/admin-ajax.php',
2284        data: {
2285            action: 'updateTimezone',
2286        },
2287        context: this,
2288        success: function(res) {
2289            $(".timezone-cur span").text("GMT " + res);
2290        },
2291        error: function(xhr, status, error) {
2292            console.log("Error occurred: " + error);
2293        }
2294    });
2295}
2296
2297function showTimezone() {
2298    $(".timezone-popup").css("display", "flex");
2299}
2300
2301function writeCookie(timezone) {
2302    var now = new Date();
2303    now.setMonth(now.getMonth() + 1);
2304    document.cookie = "timezone=" + timezone + ";expires=" + now.toUTCString() + ";";
2305}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.