PageSourceSearch

https://www.spadia.cz/scripts/custom/custom.js?v=2021-02-08

js spadia.cz collected 2026-10-05 02:10:28 UTC 7,816 bytes, 227 lines download raw bytes

1(function ($) {
2    "use strict"; // Start of use strict
3
4    // Closes responsive menu when a scroll trigger link is clicked
5    $('.js-scroll-trigger').click(function () {
6        $('.navbar-collapse').collapse('hide');
7    });
8
9    // Activate scrollspy to add active class to navbar items on scroll
10    $('body').scrollspy({
11        target: '#header-fixed',
12        offset: 36
13    });
14
15    // Collapse Navbar
16    var navbarCollapse = function () {
17        if ($("#header-fixed").offset()) {
18            if ($("#header-fixed").offset().top > 37) {
19                $("#header-fixed").addClass("navbar-shrink");
20            } else {
21                $("#header-fixed").removeClass("navbar-shrink");
22            }
23        }
24    };
25    // Collapse now if page is not at top
26    navbarCollapse();
27    // Collapse the navbar when page is scrolled
28    $(window).scroll(navbarCollapse);
29
30})(jQuery); // End of use strict
31
32
33
34$(function () {
35    $('[data-toggle="tooltip"]').tooltip();
36});
37
38
39// BACK BUTTON 
40$(window).scroll(function () {
41    if ($(this).scrollTop() >= 600) {        // If page is scrolled more than 300px
42        $('#return-to-top').fadeIn(200);    // Fade in the arrow
43    } else {
44        $('#return-to-top').fadeOut(200);   // Else fade out the arrow
45    }
46});
47
48$('#return-to-top').click(function () {
49    $(window.opera ? 'html' : 'html, body').animate({
50        scrollTop: 0
51    }, 'slow');
52});
53
54
55$(document).ready(function () {
56    $('.zoom-it').magnificPopup(magnificPopUpGallerySettings);
57    $('.zoom-single').magnificPopup(magnificPopUpGallerySettings);
58});
59
60// Konfig pro MagnificPopUp galerie + videa
61var magnificPopUpGallerySettings = {
62    delegate: 'a',
63    type: 'image',
64    gallery: {
65        enabled: true,
66        navigateByImgClick: true,
67        preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
68    },
69    
70    iframe: {
71        patterns: {
72            youtube: {
73                index: 'youtube.com/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index).
74
75                id: 'v=', // String that splits URL in a two parts, second part should be %id%
76                // Or null - full URL will be returned
77                // Or a function that should return %id%, for example:
78                // id: function(url) { return 'parsed id'; }
79
80                src: '//www.youtube.com/embed/%id%?autoplay=1' // URL that will be set as a source for iframe.
81            }
82        }
83        ,
84        markup: '<div  class="mfp-iframe-scaler iframe-designer">' +
85        '<div class="mfp-close"></div>' +
86        '<iframe class="mfp-iframe iframe-designer" frameborder="0" allowfullscreen="false"></iframe>' +
87        '</div>' // HTML markup of popup, `mfp-close` will be replaced by the close 
88    },
89
90    callbacks: {
91        elementParse: function (item) {
92            console.log('GallerySettings elementParse: ' + item.el[0].className);
93            if (item.el[0].className === 'video') {
94                //alert('Parsing video');
95                item.type = 'iframe',
96                    //item.mainClass = 'iframe-designer';
97                    item.iframe = {
98                        markup: '<div id="amenit" class="mfp-iframe-scaler iframe-designer">' +
99                            '<div class="mfp-close"></div>' +
100                            '<iframe class="mfp-iframe iframe-designer" frameborder="0" allowfullscreen="false"></iframe>' +
101                            '</div>' // HTML markup of popup, `mfp-close` will be replaced by the close 
102                    };
103            } else {
104                // image funguje out of box
105            }
106
107        }
108        
109
110    }
111};
112
113
114
115
116// Grayscale Images fix for IE10-IE11
117var GrayScaleFix = (function () {
118    var needToFix = /(MSIE 10)|(Trident.*rv:11\.0)|( Edge\/[\d\.]+$)/.test(navigator.userAgent);
119
120    function replaceImage(image) {
121        var tmpImage = new Image();
122        tmpImage.onload = function () {
123            var imgWrapper = document.createElement('span'),
124                svgTemplate =
125                    '<svg xmlns="http://www.w3.org/2000/svg" id="svgroot" viewBox="0 0 ' + tmpImage.width + ' ' + tmpImage.height + '" width="100%" height="100%">' +
126                    '<defs>' +
127                    '<filter id="gray">' +
128                    '<feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0" />' +
129                    '</filter>' +
130                    '</defs>' +
131                    '<image filter="url(&quot;#gray&quot;)" x="0" y="0" width="' + tmpImage.width + '" height="' + tmpImage.height + '" preserveAspectRatio="none" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="' + tmpImage.src + '" />' +
132                    '</svg>';
133
134            imgWrapper.innerHTML = svgTemplate;
135            imgWrapper.className = 'grayscale-fix';
136            image.parentNode.insertBefore(imgWrapper, image);
137
138            image.style.cssText += 'visibility:hidden;display:block';
139            imgWrapper.querySelector('svg').style.position = 'absolute';
140            imgWrapper.style.cssText = 'display:inline-block;position:relative;';
141            imgWrapper.appendChild(image);
142        };
143        tmpImage.src = image.src;
144    }
145
146    function replaceAll() {
147        var images = document.querySelectorAll('img.grayscale');
148        for (var i = 0; i < images.length; i++) {
149            replaceImage(images[i]);
150        }
151    }
152
153    if (needToFix) {
154        document.addEventListener('DOMContentLoaded', replaceAll);
155    }
156
157    return {
158        replace: replaceImage,
159        refresh: replaceAll
160    };
161}());
162
163// Share link functionality for social links
164function sharedPage(service) {
165    var shareUrl = window.location;
166    var title = encodeURIComponent(document.title);
167    var url;
168    switch (service) {
169        case 'facebook':
170            url = "http://www.facebook.com/share.php?u=" + shareUrl + "&t=" + title;
171            window.open(url, "_blank");
172            break;
173        case 'google':
174            url = "http://www.google.com/bookmarks/mark?op=add&bkmk=" + shareUrl + "&title=" + title;
175            window.open(url, "_blank");
176            break;
177        case 'twitter':
178            url = "http://twitter.com/intent/tweet?url=" + shareUrl + "&text=" + title;
179            window.open(url, "_blank");
180            break;
181        case 'linkedin':
182            url = "https://www.linkedin.com/shareArticle?mini=true&url=" + shareUrl + "&title=" + title;
183            window.open(url, "_blank");
184            break;
185    }
186}
187
188
189// defining flags
190var isCtrl = false;
191var isShift = false;
192// helpful function that outputs to the container
193function log(str) {
194    console.log(str);
195}
196
197// the magic :)
198$(document).ready(function () {
199    log("Ready. Try Ctrl+Shift+F2!");
200
201    // action on key up
202    $(document).keyup(function (e) {
203        if (e.which === 17 || e.which === 91) {
204            isCtrl = false;
205        }
206        if (e.which === 16) {
207            isShift = false;
208        }
209    });
210    // action on key down
211    $(document).keydown(function (e) {
212        if (e.which === 17 || e.which === 91) {
213            isCtrl = true;
214        }
215        if (e.which === 16) {
216            isShift = true;
217        }
218        if (e.which === 113 && isCtrl && isShift) {
219            log("Ctrl+Shift+F2 detected !");
220            $('.btn-edit').toggle();
221        }
222        //log("KeyDown: " + e.which + ', shift: ' + isShift + ', ctrl: '+isCtrl);
223    });
224    $('.edit-button-card').on('click', function () {
225        $('.btn-edit').toggle();
226    });
227});

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.