PageSourceSearch

https://pokrova.pl.ua/media/modals/js/script.js?a92f0c

js pokrova.pl.ua collected 2026-10-02 01:09:36 UTC 11,566 bytes, 304 lines download raw bytes

1/**
2 * @package         Modals
3 * @version         15.0.0PRO
4 * 
5 * @author          Peter van Westen <[email protected]>
6 * @link            https://regularlabs.com
7 * @copyright       Copyright © 2025 Regular Labs All Rights Reserved
8 * @license         GNU General Public License version 2 or later
9 */
10
11import {Modal} from './modules/modal.js?15.0.0.p';
12import {Helper} from './modules/helper.js?15.0.0.p';
13
14(function() {
15    'use strict';
16
17    window.RegularLabs = window.RegularLabs || {};
18
19    window.RegularLabs.Modals = window.RegularLabs.Modals || {
20        defaults: {
21            theme                    : 'dark',
22            width                    : '',
23            height                   : '',
24            iframeWidth              : '100%',
25            iframeHeight             : '100%',
26            videoWidth               : '100vw',
27            videoHeight              : '56.25vw',
28            position                 : 'center',
29            openEffect               : 'zoom',
30            closeEffect              : 'zoom',
31            nextEffect               : 'slideForward',
32            previousEffect           : 'slideBackward',
33            titlePosition            : 'top',
34            descriptionPosition      : 'bottom',
35            dimensionsIncludeTitle   : false,
36            titleTagType             : 'h3',
37            showCloseButton          : true,
38            closeOnOutsideClick      : true,
39            keyboardNavigation       : true,
40            scrollNavigation         : false,
41            pagination               : 'buttons',
42            paginationAsImages       : true,
43            paginationTextDivider    : '/',
44            showCountdown            : false,
45            slideshow                : false,
46            slideshowInterval        : 5000,
47            slideshowResume          : true,
48            slideshowResumeTimeout   : 10000,
49            minimumTouchSlideMovement: 50,
50            disableOnNarrow          : false,
51            disableBasedOn           : 'window',
52            disableBreakPoint        : 576,
53            imageZoom                : false,
54            cssEffects               : {
55                fade         : {
56                    in : 'fade-in',
57                    out: 'fade-out'
58                },
59                zoom         : {
60                    in : 'zoom-in',
61                    out: 'zoom-out'
62                },
63                slideForward : {
64                    // use left/right depending on the direction of the language
65                    in : document.documentElement.getAttribute('dir') === 'rtl' ? 'slide-in-to-right' : 'slide-in-to-left',
66                    out: document.documentElement.getAttribute('dir') === 'rtl' ? 'slide-out-to-right' : 'slide-out-to-left'
67                },
68                slideBackward: {
69                    // use left/right depending on the direction of the language
70                    in : document.documentElement.getAttribute('dir') === 'rtl' ? 'slide-in-to-left' : 'slide-in-to-right',
71                    out: document.documentElement.getAttribute('dir') === 'rtl' ? 'slide-out-to-left' : 'slide-out-to-right'
72                },
73                legacy       : {
74                    in : 'fade-in',
75                    out: 'hide'
76                },
77                none         : {
78                    in : 'show',
79                    out: 'hide'
80                }
81            },
82            htmlTemplates            : {
83                modal           : `
84                    <div data-modals-element="modal" class="hidden" tabindex="-1" role="dialog" aria-hidden="true">
85                        <div data-modals-element="overlay" data-modals-close-on-click></div>
86                        <div data-modals-element="spinner"></div>
87                        <div data-modals-element="container" data-modals-close-on-click>
88                            <div data-modals-element="main" data-modals-close-on-click>
89                                <div data-modals-element="left">
90                                    <button type="button" data-modals-element="previous" class="hidden" aria-label="${Joomla.Text._('MDL_MODALTXT_PREVIOUS')}" data-modals-taborder="3"></button>
91                                </div>
92                                <div data-modals-element="center" data-modals-close-on-click>
93                                    <div data-modals-element="slides" data-modals-close-on-click></div>
94                                </div>
95                                <div data-modals-element="right">
96                                    <button type="button" data-modals-element="next" class="hidden" aria-label="${Joomla.Text._('MDL_MODALTXT_NEXT')}" data-modals-taborder="2"></button>
97                                </div>
98                            </div>
99                            <div data-modals-element="pagination-bar" data-modals-close-on-click>
100                                <div data-modals-element="pagination"></div>
101                            </div>
102                            <div data-modals-element="close-bar" data-modals-close-on-click>
103                                <button type="button" data-modals-element="close" class="hidden" aria-label="${Joomla.Text._('MDL_MODALTXT_CLOSE')}" data-modals-taborder="1"></button>
104                            </div>
105                        </div>
106                    </div>
107                    `,
108                slide           : `
109                    <div data-modals-element="slide" class="hidden" data-modals-close-on-click>
110                        <div data-modals-element="slide-container" data-modals-close-on-click>
111                            <div data-modals-element="slide-before" class="hidden"></div>
112                            <div data-modals-element="slide-content">
113                                <div data-modals-element="slide-content-inner"></div>
114                                <div data-modals-element="countdown" class="hidden"></div>
115                            </div>
116                            <div data-modals-element="slide-after" class="hidden"></div>
117                        </div>
118                    </div>
119                    `,
120                paginationButton: '<button type="button" data-modals-element="pagination-button">%number%</button>',
121                paginationText  : `
122                    <div data-modals-element="pagination-text">
123                        <span data-modals-element="pagination-text-number"></span>
124                        <span data-modals-element="pagination-text-divider"></span>
125                        <span data-modals-element="pagination-text-total"></span>
126                    </div>
127                    `,
128                title           : '<%titleTagType% data-modals-element="slide-title"></%titleTagType%>',
129                description     : '<div data-modals-element="slide-description"></div>',
130            }
131        },
132
133        settings    : {},
134        modals      : [],
135        bodyElements: [],
136        groupCounter: 0,
137
138        init: async function(settings) {
139            const setSettings = (settings) => {
140                return new Promise(resolve => {
141                    if (this.settings.length) {
142                        return;
143                    }
144
145                    this.settings = {...this.defaults};
146
147                    if (
148                        typeof Joomla !== 'undefined'
149                        && typeof Joomla.getOptions !== 'undefined'
150                    ) {
151                        this.settings = {
152                            ...this.settings,
153                            ...Joomla.getOptions('rl_modals')
154                        };
155                    }
156
157                    this.settings = {
158                        ...this.settings,
159                        ...settings
160                    };
161
162                    resolve();
163                });
164            };
165
166            const createModalsFromLinks = async () => {
167                const links = document.querySelectorAll('[data-modals]');
168
169                for (const link of links) {
170                    await RegularLabs.Modals.createModalFromLink(link);
171                }
172            };
173
174            const setBodyElements = () => {
175                if (this.bodyElements.length) {
176                    return;
177                }
178
179                const children = document.body.childNodes;
180
181                children.forEach((child) => {
182                    if (child.parentNode === document.body
183                        && child.nodeName.charAt(0) !== '#'
184                        && child.hasAttribute
185                        && ! child.hasAttribute('aria-hidden')
186                    ) {
187                        this.bodyElements.push(child);
188                    }
189                });
190            };
191
192            setBodyElements();
193            await setSettings(settings);
194            await createModalsFromLinks();
195        },
196
197        createModalFromLink: async function(link) {
198            return new Promise(async (resolve) => {
199                if ( ! (link instanceof Element)) {
200                    resolve();
201                    return;
202                }
203
204                if (Helper.getData(link, 'done')) {
205                    resolve();
206                    return;
207                }
208
209                const group = this.getGroupFromLink(link);
210
211                if ( ! group) {
212                    resolve();
213                    return;
214                }
215
216                this.modals[group] = this.modals[group] || new Modal(link, group);
217
218                resolve();
219            });
220        },
221
222        getGroupFromLink: function(link) {
223            if ( ! (link instanceof Element)) {
224                return false;
225            }
226
227            let group = Helper.getData(link, 'group');
228
229            if ( ! group) {
230                group = '_group_' + RegularLabs.Modals.groupCounter++;
231                Helper.setData(link, 'group', group);
232            }
233
234            return group;
235        },
236
237        hideBodyElements: function() {
238            if ( ! this.bodyElements.length) {
239                return;
240            }
241
242            this.bodyElements.forEach((element) => {
243                element.setAttribute('aria-hidden', 'true');
244            });
245        },
246
247        showBodyElements: function() {
248            if ( ! this.bodyElements.length) {
249                return;
250            }
251
252            this.bodyElements.forEach((element) => {
253                element.removeAttribute('aria-hidden');
254            });
255        },
256
257        open: function(link) {
258            const modal = this.getModalByLink(link);
259
260            if ( ! modal) {
261                return;
262            }
263
264            modal.open();
265        },
266
267        close: function(link) {
268            if ( ! link) {
269                this.closeAll();
270                return;
271            }
272
273            const modal = this.getModalByLink(link);
274
275            if ( ! modal) {
276                return;
277            }
278
279            modal.close();
280        },
281
282        closeAll: function() {
283            for (const group in this.modals) {
284                this.modals[group].close();
285            }
286        },
287
288        getModalByLink: function(link) {
289            for (const group in this.modals) {
290                if (this.modals[group].link === link) {
291                    return this.modals[group];
292                }
293            }
294
295            return null;
296        },
297    };
298
299    RegularLabs.Modals.init();
300})();
301
302window.RLModals = window.RLModals || (function(options) {
303    return RegularLabs.Modals.init(options);
304});

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.