PageSourceSearch

https://besucherbergwerk-sankt-christoph.de/wp-content/themes/bergwerk18/assets/js/popup-gallery.js?ver=1.8

js besucherbergwerk-sankt-christoph.de collected 2026-10-03 00:31:21 UTC 22,352 bytes, 574 lines download raw bytes

1/* =================================
2 Popup Gallery
3 ==================================== */
4"use strict";
5function ScrollStop() {
6    return false;
7}
8function ScrollStart() {
9    return true;
10}
11/* For remove conflict */
12$ = jQuery.noConflict();
13
14$(document).ready(function () {
15    var isMobile = false;
16    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
17        isMobile = true;
18    }
19
20    /*==============================================================*/
21    //Lightbox gallery - START CODE
22    /*==============================================================*/
23    var lightboxgallerygroups = {};
24    $('.lightboxgalleryitem').each(function() {
25      var id = $(this).attr('data-group');
26      if(!lightboxgallerygroups[id]) {
27        lightboxgallerygroups[id] = [];
28      } 
29      
30      lightboxgallerygroups[id].push( this );
31    });
32
33
34    $.each(lightboxgallerygroups, function() {
35        $(this).magnificPopup({
36            type: 'image',
37            closeOnContentClick: true,
38            closeBtnInside: false,
39            gallery: { enabled:true },
40            image: {
41                titleSrc: function (item) {
42                    var title = '';
43                    var lightbox_caption = '';
44                    if( item.el.attr('title') ){
45                        title = item.el.attr('title');
46                    }
47                    if( item.el.attr('lightbox_caption') ){
48                        lightbox_caption = '<span class="hcode-lightbox-caption">'+item.el.attr('lightbox_caption')+'</span>';
49                    }
50                    return title + lightbox_caption;
51                }
52            },
53            // Remove close on popup bg v1.5
54            callbacks: {
55                open: function () {
56                    $.magnificPopup.instance.close = function() {
57                        if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
58                            $.magnificPopup.proto.close.call(this);
59                        } else {
60                            $('button.mfp-close').click(function() {
61                                $.magnificPopup.proto.close.call(this);
62                            });
63                        }
64                    }
65                }
66            }
67        });
68    });
69    
70    $('.header-search-form').magnificPopup({
71        mainClass: 'mfp-fade',
72        closeOnBgClick: false,
73        preloader: false,
74        // for white backgriund
75        whitebg: true,
76        fixedContentPos: false,
77        callbacks: {
78            open: function () {
79                setTimeout(function () { $('.search-input').focus(); }, 500);
80                
81                $('#search-header').parent().addClass('search-popup');
82                 
83                if (!isMobile) {
84                    $('body').addClass('overflow-hidden');
85                    document.onmousewheel = ScrollStop;
86                } else {
87                    $('body, html').on('touchmove', function(e){
88                        e.preventDefault();
89                    });
90                }
91                $('#search-header input').on('keydown', function(e) {
92                    var $searchval = this.value;
93                    $('.main-search input').val($searchval);
94                });
95            },
96            close: function () {
97                if(!isMobile){
98                    $('body').removeClass('overflow-hidden');
99                    $('#search-header input[type=text]').each(function (index) {
100                        if (index == 0) {
101                            $(this).val('');
102                            $("#search-header").find("input:eq(" + index + ")").css({ "border": "none", "border-bottom": "2px solid #000" });
103                        }
104                    });
105                    document.onmousewheel = ScrollStart;
106                } else {
107                     $('body, html').unbind('touchmove');
108                }
109            }
110        }
111    });
112    /*==============================================================*/
113    //Lightbox gallery - END CODE
114    /*==============================================================*/
115
116    /*==============================================================*/
117    //Ajax MagnificPopup For Onepage Portfolio - START CODE
118    /*==============================================================*/
119    $('.simple-ajax-popup-align-top').magnificPopup({
120        type: 'ajax',
121        alignTop: true,
122        overflowY: 'scroll', // as we know that popup content is tall we set scroll overflow by default to avoid jump
123        callbacks: {
124            open: function () {
125                $('.navbar .collapse').removeClass('in');
126                $('.navbar a.dropdown-toggle').addClass('collapsed');
127
128                // Remove close on popup bg v1.5
129                $.magnificPopup.instance.close = function() {
130                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
131                        $.magnificPopup.proto.close.call(this);
132                    } else {
133                        $('button.mfp-close').click(function() {
134                            $.magnificPopup.proto.close.call(this);
135                        });
136                    }
137                }
138            }
139        }
140    });
141    /*==============================================================*/
142    //Ajax MagnificPopup For Onepage Portfolio - END CODE
143    /*==============================================================*/
144
145    /*==============================================================*/
146    //Ajax MagnificPopup For Menu Link - START CODE
147    /*==============================================================*/
148    $('.hcode-menu-ajax-popup a').magnificPopup({
149        type: 'ajax',
150        alignTop: true,
151        overflowY: 'scroll', // as we know that popup content is tall we set scroll overflow by default to avoid jump
152        callbacks: {
153            open: function () {
154                $('.navbar .collapse').removeClass('in');
155                $('.navbar a.dropdown-toggle').addClass('collapsed');
156
157                // Remove close on popup bg v1.5
158                $.magnificPopup.instance.close = function() {
159                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
160                        $.magnificPopup.proto.close.call(this);
161                    } else {
162                        $('button.mfp-close').click(function() {
163                            $.magnificPopup.proto.close.call(this);
164                        });
165                    }
166                }
167            }
168        }
169    });
170    /*==============================================================*/
171    //Ajax MagnificPopup For Menu Link - END CODE
172    /*==============================================================*/
173
174
175    /*==============================================================*/
176    //Video MagnificPopup - START CODE
177    /*==============================================================*/
178    $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
179        disableOn: 700,
180        type: 'iframe',
181        mainClass: 'mfp-fade',
182        removalDelay: 160,
183        preloader: false,
184        fixedContentPos: false,
185        callbacks: {
186            open: function () {
187                if (!isMobile)
188                    $('body').addClass('overflow-hidden');
189
190                // Remove close on popup bg v1.5
191                $.magnificPopup.instance.close = function() {
192                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
193                        $.magnificPopup.proto.close.call(this);
194                    } else {
195                        $('button.mfp-close').click(function() {
196                            $.magnificPopup.proto.close.call(this);
197                        });
198                    }
199                }
200            },
201            close: function () {
202                if (!isMobile)
203                    $('body').removeClass('overflow-hidden');
204            }
205            // e.t.c.
206        }
207    });
208    /*==============================================================*/
209    //Video MagnificPopup - END CODE
210    /*==============================================================*/
211
212    /*==============================================================*/
213    // magnificPopup - START CODE
214    /*==============================================================*/
215    $('.popup-youtube-landing').magnificPopup({
216        disableOn: 700,
217        type: 'iframe',
218        mainClass: 'mfp-fade',
219        removalDelay: 160,
220        preloader: false,
221        // for black backgriund
222        blackbg: true,
223        fixedContentPos: false,
224        callbacks: {
225            open: function () {
226                if (!isMobile)
227                    $('body').addClass('overflow-hidden');
228
229                // Remove close on popup bg v1.5
230                $.magnificPopup.instance.close = function() {
231                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
232                        $.magnificPopup.proto.close.call(this);
233                    } else {
234                        $('button.mfp-close').click(function() {
235                            $.magnificPopup.proto.close.call(this);
236                        });
237                    }
238                }
239            },
240            close: function () {
241                if (!isMobile)
242                    $('body').removeClass('overflow-hidden');
243            }
244            // e.t.c.
245        }
246    });
247    /*==============================================================*/
248    // magnificPopup - END CODE
249    /*==============================================================*/
250
251    /*==============================================================*/
252    //Single image lightbox - zoom animation - START CODE
253    /*==============================================================*/
254    $('.image-popup-no-margins').magnificPopup({
255        type: 'image',
256        closeOnContentClick: true,
257        fixedContentPos: true,
258        closeBtnInside: false,
259        mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side
260        image: {
261            verticalFit: true,
262            titleSrc: function (item) {
263                    var title = '';
264                    var lightbox_caption = '';
265                    if( item.el.attr('title') ){
266                        title = item.el.attr('title');
267                    }
268                    if( item.el.attr('lightbox_caption') ){
269                        lightbox_caption = '<span class="hcode-lightbox-caption">'+item.el.attr('lightbox_caption')+'</span>';
270                    }
271                    return title + lightbox_caption;
272            }
273        },
274        zoom: {
275            enabled: true,
276            duration: 300 // don't foget to change the duration also in CSS
277        },
278        callbacks: {
279            open: function () {
280                // Remove close on popup bg v1.5
281                $.magnificPopup.instance.close = function() {
282                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
283                        $.magnificPopup.proto.close.call(this);
284                    } else {
285                        $('button.mfp-close').click(function() {
286                            $.magnificPopup.proto.close.call(this);
287                        });
288                    }
289                }
290            },
291        }
292    });
293    /*==============================================================*/
294    //Single image lightbox - zoom animation - END CODE
295    /*==============================================================*/
296
297    /*==============================================================*/
298    //Single image -  fits horizontally and vertically - START CODE
299    /*==============================================================*/
300    $('.image-popup-vertical-fit').magnificPopup({
301        type: 'image',
302        closeOnContentClick: true,
303        mainClass: 'mfp-img-mobile',
304        closeBtnInside: false,
305        image: {
306            verticalFit: true,
307            titleSrc: function (item) {
308                var title = '';
309                var lightbox_caption = '';
310                if( item.el.attr('title') ){
311                    title = item.el.attr('title');
312                }
313                if( item.el.attr('lightbox_caption') ){
314                    lightbox_caption = '<span class="hcode-lightbox-caption">'+item.el.attr('lightbox_caption')+'</span>';
315                }
316                return title + lightbox_caption;
317            }
318        },
319        callbacks: {
320            open: function () {
321                // Remove close on popup bg v1.5
322                $.magnificPopup.instance.close = function() {
323                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
324                        $.magnificPopup.proto.close.call(this);
325                    } else {
326                        $('button.mfp-close').click(function() {
327                            $.magnificPopup.proto.close.call(this);
328                        });
329                    }
330                }
331            },
332        }
333    });
334    /*==============================================================*/
335    //Single image -  fits horizontally and vertically - END CODE
336    /*==============================================================*/
337
338    /*==============================================================*/
339    //Zoom gallery - START CODE
340    /*==============================================================*/
341    $('.product-zoom-gallery').magnificPopup({
342        delegate: 'a',
343        type: 'image',
344        mainClass: 'mfp-with-zoom mfp-img-mobile',
345        closeBtnInside: false,
346        image: {
347            verticalFit: true,
348            titleSrc: function (item) {
349                var title = '';
350                var lightbox_caption = '';
351                if( item.el.attr('title') ){
352                    title = item.el.attr('title');
353                }
354                if( item.el.attr('lightbox_caption') ){
355                    lightbox_caption = '<span class="hcode-lightbox-caption">'+item.el.attr('lightbox_caption')+'</span>';
356                }
357                return title + lightbox_caption;
358            }
359        },
360        gallery: {
361            enabled: true
362        },
363        callbacks: {
364            open: function () {
365                // Remove close on popup bg v1.5
366                $.magnificPopup.instance.close = function() {
367                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
368                        $.magnificPopup.proto.close.call(this);
369                    } else {
370                        $('button.mfp-close').click(function() {
371                            $.magnificPopup.proto.close.call(this);
372                        });
373                    }
374                }
375            },
376        }
377    });
378    /*==============================================================*/
379    //Zoom gallery - END CODE
380    /*==============================================================*/
381
382    /*==============================================================*/
383    //Zoom gallery - START CODE
384    /*==============================================================*/
385    
386    var lightboxzoomgallerygroups = {};
387    $('.lightboxzoomgalleryitem').each(function() {
388      var id = $(this).attr('data-group');
389      if(!lightboxzoomgallerygroups[id]) {
390        lightboxzoomgallerygroups[id] = [];
391      } 
392      
393      lightboxzoomgallerygroups[id].push( this );
394    });
395
396
397    $.each(lightboxzoomgallerygroups, function() {
398        $(this).magnificPopup({
399            type: 'image',
400            mainClass: 'mfp-with-zoom mfp-img-mobile',
401            closeBtnInside: false,
402            image: {
403                verticalFit: true,
404                titleSrc: function (item) {
405                    var title = '';
406                    var lightbox_caption = '';
407                    if( item.el.attr('title') ){
408                        title = item.el.attr('title');
409                    }
410                    if( item.el.attr('lightbox_caption') ){
411                        lightbox_caption = '<span class="hcode-lightbox-caption">'+item.el.attr('lightbox_caption')+'</span>';
412                    }
413                    return title + lightbox_caption;
414                }
415            },
416            gallery: {
417                enabled: true
418            },
419            zoom: {
420                enabled: true,
421                duration: 300, // don't foget to change the duration also in CSS
422                opener: function (element) {
423                    return element.find('img');
424                }
425            },
426            callbacks: {
427                open: function () {
428                    // Remove close on popup bg v1.5
429                    $.magnificPopup.instance.close = function() {
430                        if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
431                            $.magnificPopup.proto.close.call(this);
432                        } else {
433                            $('button.mfp-close').click(function() {
434                                $.magnificPopup.proto.close.call(this);
435                            });
436                        }
437                    }
438                },
439            }
440        })
441    });
442
443    /*==============================================================*/
444    //Zoom gallery - END CODE
445    /*==============================================================*/
446
447    /*==============================================================*/
448    //Popup with form - START CODE
449    /*==============================================================*/
450    $('.popup-with-form').magnificPopup({
451        type: 'inline',
452        preloader: false,
453        closeBtnInside: true,
454        focus: '#name',
455        // When elemened is focused, some mobile browsers in some cases zoom in
456        // It looks not nice, so we disable it:
457        callbacks: {
458            beforeOpen: function () {
459                if ($(window).width() < 700) {
460                    this.st.focus = false;
461                } else {
462                    this.st.focus = '#name';
463                }
464            },
465            open: function () {
466                // Remove close on popup bg v1.5
467                $.magnificPopup.instance.close = function() {
468                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
469                        $.magnificPopup.proto.close.call(this);
470                    } else {
471                        $('button.mfp-close').click(function() {
472                            $.magnificPopup.proto.close.call(this);
473                        });
474                    }
475                }
476            },
477        }
478    });
479    /*==============================================================*/
480    //Popup with form - END CODE
481    /*==============================================================*/
482
483    /*==============================================================*/
484    //Modal popup - START CODE
485    /*==============================================================*/
486    $('.modal-popup').magnificPopup({
487        type: 'inline',
488        preloader: false,
489        // modal: true,
490        blackbg: true,
491        callbacks: {
492            open: function () {
493                // Remove close on popup bg v1.5
494                $.magnificPopup.instance.close = function() {
495                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
496                        $.magnificPopup.proto.close.call(this);
497                    } else {
498                        $('button.mfp-close').click(function() {
499                            $.magnificPopup.proto.close.call(this);
500                        });
501                    }
502                }
503            },
504        }
505    });
506    $(document).on('click', '.popup-modal-dismiss', function (e) {
507        e.preventDefault();
508        $.magnificPopup.proto.close.call(this);
509    });
510    /*==============================================================*/
511    //Modal popup - END CODE
512    /*==============================================================*/
513
514    /*==============================================================*/
515    //Modal popup - zoom animation - START CODE
516    /*==============================================================*/
517    $('.popup-with-zoom-anim').magnificPopup({
518        type: 'inline',
519        fixedContentPos: false,
520        fixedBgPos: true,
521        overflowY: 'auto',
522        closeBtnInside: true,
523        preloader: false,
524        midClick: true,
525        removalDelay: 300,
526        blackbg: true,
527        mainClass: 'my-mfp-zoom-in',
528        callbacks: {
529            open: function () {
530                // Remove close on popup bg v1.5
531                $.magnificPopup.instance.close = function() {
532                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
533                        $.magnificPopup.proto.close.call(this);
534                    } else {
535                        $('button.mfp-close').click(function() {
536                            $.magnificPopup.proto.close.call(this);
537                        });
538                    }
539                }
540            },
541        }
542    });
543
544    $('.popup-with-move-anim').magnificPopup({
545        type: 'inline',
546        fixedContentPos: false,
547        fixedBgPos: true,
548        overflowY: 'auto',
549        closeBtnInside: true,
550        preloader: false,
551        midClick: true,
552        removalDelay: 300,
553        blackbg: true,
554        mainClass: 'my-mfp-slide-bottom',
555        callbacks: {
556            open: function () {
557                // Remove close on popup bg v1.5
558                $.magnificPopup.instance.close = function() {
559                    if (!isMobile && !$('body').hasClass('hcode-custom-popup-close') ){
560                        $.magnificPopup.proto.close.call(this);
561                    } else {
562                        $('button.mfp-close').click(function() {
563                            $.magnificPopup.proto.close.call(this);
564                        });
565                    }
566                }
567            },
568        }
569    });
570    /*==============================================================*/
571    //Modal popup - zoom animation - END CODE
572    /*==============================================================*/
573
574});

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.