PageSourceSearch

https://aicomics.ru/static/modules/vote/default/js/modal.js

js aicomics.ru collected 2026-10-07 15:39:29 UTC 2,124 bytes, 80 lines download raw bytes

1(function(w, d){
2    
3    var modal;
4    var modalOverlay;
5    var modalContent;
6
7    function createmodal()
8    {
9        modalOverlay = document.createElement('div');
10        modalOverlay.classList.add('vote-modal-overlay');
11        modalOverlay.addEventListener('click', function(event){
12
13            if (event.target.closest('.vote-modal-content')) {
14                return;
15            }
16
17            dropmodal();
18        })
19
20        modal = document.createElement('div');
21        modal.classList.add('vote-modal');
22
23        var close = document.createElement('button');
24        close.type = 'button';
25        close.classList.add('app-btn', 'app-btn--icon', 'close');
26        close.innerHTML = '×';
27        close.addEventListener('click', function(event) {
28            dropmodal();
29        })
30
31        modal.appendChild(close)
32
33        modalContent = document.createElement('div');
34        modalContent.classList.add('vote-modal-content');
35        modal.appendChild(modalContent)
36
37        modalOverlay.appendChild(modal);
38
39        d.body.style.marginRight = (w.innerWidth - d.body.offsetWidth) + 'px';
40        d.body.classList.add('vote-body-overflow');
41
42        setTimeout(function(){
43            modalOverlay.classList.add('open');
44        }, 20);
45
46        d.body.append(modalOverlay)
47    }
48
49    function dropmodal()
50    {
51        if (modal) {
52
53            modalOverlay.classList.remove('open');
54            setTimeout(() => {
55                modalOverlay.parentNode.removeChild(modalOverlay);
56                modalOverlay = null;
57                modalContent = null;
58                modal = null;
59                document.body.classList.remove('vote-body-overflow');
60                document.body.style.marginRight = null;
61            }, parseFloat(w.getComputedStyle(modalOverlay).transitionDuration)*1000)
62        }
63    }
64
65    function setTextmodal(text, tag)
66    {
67        if (!modal) {
68            createmodal();
69        }
70
71        modalContent.innerHTML = text;
72
73        if (tag) {
74            modalContent.appendChild(tag);
75        }
76    }
77
78    window.voteShowModal = setTextmodal;
79
80})(window, document);

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.