PageSourceSearch

https://www.nlagmluz.cc/usr/plugins/ArtPlayer/assets/verify.js

js nlagmluz.cc collected 2026-10-10 00:39:15 UTC 3,788 bytes, 108 lines download raw bytes

1; (function ($) {
2    $.fn.slideVerify = function (options) {
3        const cfg = $.extend({
4            minWidth: null, 
5            successText: '验证完成',
6            onSuccess: function () { }
7        }, options);
8
9        return this.each(function () {
10            const $box = $(this);
11            const $track = $box.find('.dxgs-bufferss-image-verify-layers-box-iframe');
12            const $btn = $box.find('.dxgs-bufferss-image-verify-layers-box-iframe-btn');
13            if (!$track.length || !$btn.length) return;
14
15            let locked = false;
16            let startX = 0, moveX = 0, leftBase = 0;
17            const minW = cfg.minWidth || $btn[0].offsetWidth;
18
19            init();
20
21            $btn[0].ondragstart = () => false;
22            $btn[0].onselectstart = () => false;
23
24            // PC
25            $btn.on('mousedown.sv', function (e) {
26                if (locked) return;
27                const boxW = $box[0].offsetWidth;
28                const boxLeft = $box.offset().left;
29
30                $(document)
31                    .on('mousemove.sv', function (ev) {
32                        let w = (ev.pageX - boxLeft);
33                        if (w < minW) w = minW;
34                        if (w > boxW) w = boxW;
35                        $btn.width(w);
36                    })
37                    .one('mouseup.sv', function (ev) {
38                        let w = (ev.pageX - boxLeft);
39                        if (w >= boxW) {
40                            w = boxW;
41                            success();
42                        } else {
43                            w = minW;
44                            resetButtonFace();
45                        }
46                        $btn.width(w);
47                        $(document).off('mousemove.sv');
48                    });
49            });
50
51            $btn.on({
52                'touchstart.sv': function (e) {
53                    if (locked) return;
54                    const t = e.originalEvent.targetTouches[0];
55                    const boxLeft = $box.offset().left;
56                    startX = moveX = t.pageX;
57                    leftBase = boxLeft;
58                },
59                'touchmove.sv': function (e) {
60                    if (locked) return;
61                    e.preventDefault();
62                    const boxW = $box[0].offsetWidth;
63                    moveX = e.originalEvent.targetTouches[0].pageX;
64                    let w = (moveX - leftBase);
65                    if (w < minW) w = minW;
66                    if (w > boxW) w = boxW;
67                    $btn.width(w);
68                },
69                'touchend.sv': function () {
70                    if (locked) return;
71                    const boxW = $box[0].offsetWidth;
72                    let w = (moveX - leftBase);
73                    if (w >= boxW) {
74                        w = boxW;
75                        success();
76                    } else {
77                        w = minW;
78                        resetButtonFace();
79                    }
80                    $btn.width(w);
81                }
82            });
83
84            function success() {
85                locked = true;
86                $btn.width($box[0].offsetWidth);
87                $btn.text(cfg.successText);
88                cfg.onSuccess.call($box[0]);
89            }
90
91            function resetButtonFace() {
92                $btn.text('');
93            }
94
95            function init() {
96                locked = false;
97                $btn.width(minW).text('');
98                if ($track.text().trim() === '' || /验证完成|成功/.test($track.text())) {
99                    $track.text('>>向右滑动验证');
100                }
101            }
102
103            this.resetSlideVerify = function () {
104                init();
105            };
106        });
107    };
108})(jQuery);

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.