PageSourceSearch

https://www.iway.ch/wp-content/themes/iwaytwo/assets/js/iway-popup-qr.js?ver=1790855780

js iway.ch collected 2026-10-01 11:58:21 UTC 3,071 bytes, 80 lines download raw bytes

1/*
2    11.12.24/PK - Automatisch Mobile-Store-Links finden und auf Desktop-Auflösung ein Popup mit QR aufmachen
3*/
4(function() {
5    var 
6        modalDialog,
7        modalBack,
8        desktopSize = 1024,
9        links = document.querySelectorAll('a[class*="qr-id-"]'),
10        init = function () {
11            for (let i = 0; i < links.length; i++) {
12                if (!links[i].classList.contains('event-added')) {
13                    links[i].classList.add('event-added');
14                    links[i].addEventListener('click', openPopUp, false);
15                }
16            }
17        },
18        openPopUp = function (event) {
19            event.preventDefault();
20            var 
21                trigger = event.target
22            ;
23            modalDialog = getQRPopup(trigger.classList);
24            modalDialog.setAttribute('aria-modal', 'true');
25            modalDialog.setAttribute('role', 'dialog');
26            modalDialog.parentNode.removeChild(modalDialog);
27            document.body.appendChild(modalDialog);
28            modalBack = document.body.appendChild(createElement('div', { className: 'popup-modal-bg popup-modal-bg-qr'}));
29            modalBack.addEventListener('click', unloadPopUp, false);
30            modalDialog.addEventListener('click', unloadPopUp, false);
31            modalDialog.style.display = 'block';
32            setPos(trigger, modalDialog);
33        },
34        unloadPopUp = function (event) {
35            if (event) {event.preventDefault();}
36            if (modalBack) {
37                document.body.removeChild(modalBack);
38                modalBack = null;
39                modalDialog.style.display = 'none';
40                document.body.style.overflow = 'auto';
41            }
42        },
43        setPos = function (trigger, element) {
44            let 
45                pos = trigger.getBoundingClientRect(),
46                posLeft = pos.left + window.scrollX,
47                posTop = pos.bottom + window.scrollY
48            ;
49            element.style.left = (posLeft - 35) + 'px';
50            element.style.top = (posTop + 10) + 'px';
51        },
52        getQRPopup = function (className) {
53            for (let i = 0; i < className.length; i++){
54                if (className[i].includes('qr-id-')) {
55                    return document.querySelector('div.' + className[i]);
56                }
57            }
58            return null;
59        }
60        createElement = function (element, attributes, content) {
61            let
62                node = document.createElement(element)
63            ;
64            if (attributes) {
65                for (const [key, value] of Object.entries(attributes)) {
66                    if (key == 'className') {
67                        node.className = value;
68                    } else {
69                        node.setAttribute(key, value);
70                    }
71                }
72            }
73            if (content) {
74                node.appendChild(content);
75            }
76            return node;
77        }
78    ;
79    document.addEventListener('DOMContentLoaded', init, false);
80}());  

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.