PageSourceSearch

https://www.terazteatr.pl/js/onload.js

js terazteatr.pl collected 2026-10-02 11:12:09 UTC 20,507 bytes, 605 lines download raw bytes

1jQuery(document).ready(function () {
2    $('.your_vote').TTMark();
3
4    var mixPanelData = {
5      'controller': $('body').attr('data-controller'),
6      'action': $('body').attr('data-action')
7    }
8
9    $('.provider-tt').click(function() {
10      mixPanelData.theater_id = $(this).attr('data-theater-id');
11      mixPanelData.theater_name = $(this).attr('data-theater-name');
12      mixPanelData.theater_phone = $(this).attr('data-theater-phone');
13
14      mixpanel.track("Klik na button Kup Bilet TT", mixPanelData);
15      var modal = $('#contactModal');
16      modal.find('h2.title a').text($(this).attr('data-theater-name'))
17      modal.find('span').text($(this).attr('data-theater-phone'))
18      modal.modal();
19    })
20    $('.provider-ebilet').click(function() {
21      mixpanel.track("Klik na button E-bilet", mixPanelData);
22    })
23    $('.provider-bilety24').click(function() {
24      mixpanel.track("Klik na button Bilety24", mixPanelData);
25    })
26    $('.provider-groupon').click(function() {
27      mixpanel.track("Klik na button Groupon", mixPanelData);
28    })
29    $('.provider-other').click(function() {
30      mixpanel.track("Klik na button Kup Bilet - inne", mixPanelData);
31    })
32    $('[data-mixpanel]').click(function() {
33      mixpanel.track($(this).attr('data-mixpanel'), mixPanelData);
34    })
35
36    // Geolocation
37    // var head = document.getElementsByTagName('head')[0];
38    // var script = document.createElement('script');
39    // script.src = '//maps.googleapis.com/maps/api/js';
40    // head.appendChild(script);
41    // script.onload = function() {
42    //   if (navigator.geolocation) {
43    //     navigator.geolocation.getCurrentPosition(function(pos) {
44    //       var point = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);
45    //       new google.maps.Geocoder().geocode({
46    //         'latLng': point
47    //       }, function(res, status) {
48    //         if (status == google.maps.GeocoderStatus.OK && typeof res[0] !== 'undefined') {
49    //           $.each(res[0].address_components, function (i, e) {
50    //             if (e.types[0] == "locality") {
51    //               console.log(e.long_name);
52    //               return false;
53    //             }
54    //           });
55    //         }
56    //       });
57    //     }, function(err) {
58    //       fail(err.message);
59    //     });
60    //   }
61    //
62    //   function fail(err) {
63    //     console.log('err', err);
64    //   }
65    // };
66
67
68    if ($('#fs-wojewodztwo').length) {
69        $('#fs-wojewodztwo').change(function () {
70            $('#fs-miasto option:first').prop('selected', true);
71            $('#fs-miasto').next('.customSelect').find('.customSelectInner').text($('#fs-miasto option:selected').text());
72            if (!$(this).val()) {
73                $('#fs-miasto optgroup, #fs-miasto optgroup option').show();
74            } else {
75                $('#fs-miasto optgroup, #fs-miasto optgroup option').hide();
76                $("#fs-miasto optgroup[label='" + $(this).val() + "']").show();
77                $("#fs-miasto optgroup[label='" + $(this).val() + "'] option").show();
78            }
79        });
80    }
81
82//			$('.box_plays').infinitescroll({
83//				navSelector  : '#pagination',    // selector for the paged navigation
84//				nextSelector : '#pagination a',  // selector for the NEXT link (to page 2)
85//				itemSelector : '.box',     // selector for all items you'll retrieve
86//				loading: {
87//					finishedMsg: 'No more pages to load.',
88//					img: 'http://i.imgur.com/6RMhx.gif'
89//					}
90//				},
91//				// trigger Masonry as a callback
92//				function( newElements ) {
93//					// hide new items while they are loading
94//					var $newElems = $( newElements ).css({ opacity: 0 });
95//					// ensure that images load before adding to masonry layout
96//					$newElems.imagesLoaded(function(){
97//					// show elems now they're ready
98//					$newElems.animate({ opacity: 1 });
99//					$container.masonry( 'appended', $newElems, true );
100//					});
101//				}
102//			);
103
104    $('form').validate();
105
106    $('#likeboxWrapper').hover(
107            function () {
108                if ($(this).hasClass('right')) {
109                    $(this).stop().animate({right: "0"}, "medium");
110                } else {
111                    $(this).stop().animate({left: "0"}, "medium");
112                }
113            },
114            function () {
115                if ($(this).hasClass('right')) {
116                    $(this).stop().animate({right: "-209"}, "medium");
117                } else {
118                    $(this).stop().animate({left: "-209"}, "medium");
119                }
120            },
121            500
122            );
123
124    $('.colorbox a').colorbox({
125        rel: 'media_image',
126        photo: true,
127        current: "{current} z {total}",
128        previous: "poprzednie",
129        next: "następne",
130        close: "zamknij",
131        xhrError: "Błąd podczas ładwoania treści.",
132        imgError: "Nie można załadować obrazka",
133        maxWidth: '95%',
134        maxHeight: '95%'
135    });
136
137    $('.transform_select').customSelect();
138    if ($('#top_menu .menu').hasClass('open_submenu')) {
139        var had_open_submenu = true;
140    }
141
142    $('#top_menu .menu li').each(function (index, el) {
143        if ($(el).find('ul').length > 0) {
144            $(el).hover(
145                    function () {
146                        if (!had_open_submenu) {
147                            //$('#top_menu .menu').addClass('open_submenu');
148                        }
149
150                        $('#top_menu .menu ul').css('z-index', '10');
151                        $(el).find('ul').css('z-index', '11');
152                    },
153                    function () {
154                        if (!had_open_submenu) {
155                            //$('#top_menu .menu').removeClass('open_submenu');
156                        }
157
158                        $('#top_menu .menu ul').css('z-index', '10');
159                    }
160            );
161        }
162    });
163
164    $('.my_city a').click(function (event) {
165        event.preventDefault();
166
167        $('#cities').slideToggle();
168    });
169
170    $('.box_scroll_items').tinyscrollbar();
171
172
173    $('.box_slider').each(function (index, el) {
174        $(el).find('.items_list').owlCarousel({
175            'items': 3,
176            'dots': false,
177            'nav': true,
178            'responsive': {
179                0: {
180                    'items': 1
181                },
182                '450': {
183                    'items': 2,
184                },
185                768: {
186                    'items': 3
187                }
188            }
189        });
190
191
192        /*
193        $(el).hsSlide({
194            'elements_wrapper': $(el).find('.items_list_wrapper'),
195            'elements_container': $(el).find('.items_list'),
196            'elements': $(el).find('.item_type_1'),
197            'per_row': 3,
198            'arrow_left': $(el).find('.arrow_left'),
199            'arrow_right': $(el).find('.arrow_right')
200        });
201        */
202    });
203
204    $('.box_search input[type="text"]').inputValue();
205    $('.content_menu:not(.letters, .months)').menuFullWidth();
206
207    $('.change_font li').click(function (event) {
208        event.preventDefault();
209
210        switch ($(this).attr('class')) {
211            case 'small':
212                $('body').css('font-size', '0.9em');
213                break;
214
215            case 'medium':
216                $('body').css('font-size', '1em');
217                break;
218
219            case 'big':
220                $('body').css('font-size', '1.125em');
221                break;
222        }
223    });
224
225
226
227    $.cookiesDirective({
228        privacyPolicyUri: '/zasady/polityka-cookies',
229        message: 'Ta strona używa plików Cookies w celu poprawnego wyświetlania zawartości ',
230        position: 'bottom',
231        duration: 10, // display time in seconds
232        limit: 0, // limit disclosure appearances, 0 is forever
233        fontFamily: 'Tahoma', // font style for disclosure panel
234        fontColor: '#FFFFFF', // font color for disclosure panel
235        fontSize: '11px', // font size for disclosure panel
236        backgroundColor: '#000000', // background color of disclosure panel
237        backgroundOpacity: '99', // opacity of disclosure panel
238        linkColor: '#ffffff' // link color in disclosure panel
239    });
240    jQuery(window).scroll(function(){
241        if(jQuery(window).scrollTop() + jQuery(window).height() > jQuery('body').height() - 200){
242            jQuery('#to_top').show();
243        }
244        else {
245            jQuery('#to_top').hide();
246        }
247    });
248
249    jQuery('#to_top').click(function(event){
250        event.preventDefault();
251
252        jQuery('html, body').animate({ scrollTop: 0 }, 500);
253    });
254});
255
256jQuery(window).load(function () {
257    jQuery('.zone_repertoire_full').repertoireFixedHeader();
258});
259
260(function ($) {
261
262    /* ------------- */
263    /* repertoireFixedHeader */
264    /* ------------- */
265
266    $.fn.repertoireFixedHeader = function (options) {
267
268        var settings = {
269        }
270
271        $.extend(settings, options);
272
273
274        if($(this).length > 0){
275            var box = $(this);
276            var fixed_header = $('#repertoire_header_fixed');
277
278            var boxes = box.find('.box_plays_repertoire');
279
280            attach();
281            check_scroll();
282        }
283
284        function attach(){
285
286            $(window).scroll(function(){
287                check_scroll();
288            });
289
290            boxes.each(function(index, el){
291                var waypoint1 = $(el).waypoint(function (direction) {
292                    if(direction == 'down'){
293                        set_current($(this.element));
294                    }
295                }, {
296                    offset: '0%'
297                });
298                var waypoint2 = $(el).waypoint(function (direction) {
299                    if(direction == 'up'){
300                        set_current($(this.element));
301                    }
302                }, {
303                    offset: function() {
304                        return -this.element.clientHeight
305                    }
306                });
307            });
308        }
309
310        function check_scroll(){
311            var offset_top = box.offset().top;
312            var offset_bottom = offset_top + box.height();
313
314            var s_t = $(window).scrollTop();
315
316            if(s_t > offset_top && s_t < offset_bottom){
317                fixed_header.addClass('can_display');
318            }
319            else {
320                fixed_header.removeClass('can_display');
321            }
322        }
323        function set_current(el){
324            $('#repertoire_header_fixed').html(el.find('.header_repertoire_date').html());
325        }
326
327    },
328
329    /* ------------- */
330    /* menuFullWidth */
331    /* ------------- */
332
333    $.fn.menuFullWidth = function (options) {
334
335        var settings = {
336        }
337
338        $.extend(settings, options);
339
340        var main = $(this);
341        var headers = main.find('li');
342
343        calculate();
344
345        $(window).resize(function () {
346            calculate();
347        });
348
349        function calculate() {
350            var header_new_width = (main.width() - headers.length) / headers.length;
351            headers.width(header_new_width);
352
353            var diff = main.parent().width() - main.width();
354            headers.eq(headers.length - 1).width(header_new_width + 0.95);
355        }
356
357//headers.find('a').width((main.width() - 3)/headers.length );
358
359    },
360            /* ------------- */
361            /* TT Mark */
362            /* ------------- */
363
364            $.fn.TTMark = function (options) {
365
366                var settings = {
367                }
368
369                $.extend(settings, options);
370
371                var main = $(this);
372
373                if (main.length > 0) {
374                    var number = main.find('.vote_numbers strong');
375                    var faces = main.find('.voting_faces');
376                    var faces_full = main.find('.voting_faces_full');
377                    faces_full.width(faces_full.attr('data-base-percentage') + '%');
378                    number.html(faces_full.attr('data-base-percentage') / 10 > 0 ? faces_full.attr('data-base-percentage') / 10 : '...');
379                    var faces_left = faces.offset().left;
380                    var step = 169 / 10;
381
382                    attach();
383                }
384
385                function attach() {
386
387
388                    $(window).resize(function(event){
389                        event.preventDefault();
390
391                        faces_left = faces.offset().left;
392                    });
393
394                    faces.mousemove(function (e) {
395
396                        var pos_left = e.pageX - faces_left;
397
398                        var percentage = calculate(pos_left);
399                        faces_full.width(percentage + '%');
400                        number.html(percentage / 10);
401                    });
402
403                    faces_full.mouseout(function () {
404                        if (faces_full.attr('data-base-percentage') > 0) {
405                            faces_full.width(faces_full.attr('data-base-percentage') + '%');
406                            number.html(faces_full.attr('data-base-percentage') / 10);
407                        } else {
408                            faces_full.width(0 + '%');
409                            number.html('...');
410                        }
411
412                    });
413
414                    faces.click(function (e) {
415                        var pos_left = e.pageX - faces_left;
416                        var percentage = calculate(pos_left);
417
418                        faces_full.attr('data-base-percentage', percentage);
419                        number.html(percentage / 10);
420                        $('#rvote').prop('checked', true);
421
422                        // ajax
423                        $.post('/glosuj', {id: faces_full.attr('data-reactid'), r: percentage / 10}, function (data) {
424                            mixpanel.track("Klik na maskę " + faces_full.attr('data-reacttype'), mixPanelData);
425                            if (data.redirect) {
426                                window.location.href = data.redirect;
427                            } else {
428                                window.location.href = window.location.origin + window.location.pathname;
429                            }
430                        });
431                    });
432                }
433
434                function calculate(pos_left) {
435                    //var i = 148;
436                    var i = 0;
437                    return Math.ceil(((pos_left - i) * 100 / 169) / 10) * 10;
438                }
439            },
440            /* ------------- */
441            /* HS Slide */
442            /* ------------- */
443
444            $.fn.hsSlide = function (options) {
445
446                var settings = {
447                    'per_row': 1
448                }
449
450                $.extend(settings, options);
451
452                var current_page = 0;
453
454                var main = $(this);
455                var elements_wrapper = settings['elements_wrapper'];
456                var elements_container = settings['elements_container'];
457                var elements = settings['elements'];
458
459                var per_row = settings['per_row'];
460                var nr_pages;
461
462                calculate_nr_pages();
463                calculate_dimensions()
464
465                scroll_to(0);
466
467                attach();
468
469                function calculate_nr_pages() {
470                    if (elements_wrapper.width() < 450) {
471                        per_row = 1;
472                    } else if (elements_wrapper.width() < 600 && elements_wrapper.width() > 451) {
473                        per_row = 2;
474                    } else {
475                        per_row = settings['per_row'];
476                    }
477
478                    nr_pages = Math.ceil(elements.length / per_row);
479                }
480
481                function attach() {
482
483                    if (settings['arrow_left']) {
484                        settings['arrow_left'].click(function (event) {
485                            event.preventDefault();
486
487                            previous();
488                        });
489                    }
490
491                    if (settings['arrow_right']) {
492                        settings['arrow_right'].click(function (event) {
493                            event.preventDefault();
494
495                            next();
496                        });
497                    }
498
499                    if (settings['navigation']) {
500                        settings['navigation'].click(function (event) {
501                            event.preventDefault();
502
503                            current_page = $(this).index() - 1;
504
505                            scroll_to(current_page);
506                        });
507                    }
508
509                    $(window).resize(function () {
510                        calculate_nr_pages();
511                        calculate_dimensions();
512                    });
513                }
514
515                function calculate_dimensions() {
516                    //elements.width(elements_container.width());
517                    var whole_width = 0;
518
519                    elements.each(function (index, el) {
520                        whole_width += $(el).width() + parseInt($(el).css('borderLeftWidth')) + parseInt($(el).css('borderRightWidth')) + parseInt($(el).css('margin-left')) + parseInt($(el).css('margin-right'));
521                    });
522
523                    //element_width = elements.eq(0).width();
524
525                    //elements_container.height(elements.getMaxHeight());
526                    //elements_container.width(elements.length * element_width);
527                    elements_container.width(whole_width);
528
529                }
530
531                function next() {
532                    if (current_page == nr_pages - 1) {
533                        current_page = 0;
534                    } else {
535                        current_page += 1;
536                    }
537
538                    scroll_to(current_page);
539                }
540
541                function previous() {
542                    if (current_page == 0) {
543                        current_page = nr_pages - 1;
544                    } else {
545                        current_page -= 1;
546                    }
547
548                    scroll_to(current_page);
549                }
550
551                function scroll_to(current_page) {
552                    if (settings['navigation']) {
553                        settings['navigation'].removeClass('current');
554                        settings['navigation'].eq(current_page).addClass('current');
555                    }
556
557                    var elements_scolling_index = per_row * current_page;
558
559                    if (elements_scolling_index > elements.length - 1) {
560                        elements_scolling_index = elements.length - 1;
561                    }
562
563                    elements_wrapper.scrollTo(elements.eq(elements_scolling_index), 500, {axis: 'x'});
564                }
565
566            },
567            /* ------------- */
568            /* inputValue */
569            /* ------------- */
570
571            $.fn.inputValue = function (options) {
572
573                var settings = {
574                }
575
576                $.extend(settings, options);
577
578                $(this).each(function (index, el) {
579                    var default_value = $(el).val();
580
581                    $(el).focus(function () {
582                        if ($(this).val() == default_value) {
583                            $(this).val('');
584                        }
585                    });
586
587                    $(el).blur(function () {
588                        if ($(this).val() == '') {
589                            $(this).val(default_value);
590                        }
591                    });
592                });
593            },
594            $.fn.getMaxHeight = function () {
595                return (Math.max.apply(this, $.map(this, function (e) {
596                    return $(e).height()
597                })));
598            };
599
600    $.fn.setAllToMaxHeight = function () {
601        return this.height(Math.max.apply(this, $.map(this, function (e) {
602            return $(e).height()
603        })));
604    };
605})(jQuery);

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.