/*let lang = ""; let mess = ""; let controller = ""; let action = ""; */ let lang = "cs"; let mess = "Děkujeme za váš dotaz. Ozveme se Vám"; let controller = "clanky"; let action = "detail"; $(window).load(function(){ $(".dot-wrapper").trigger("update.dot"); }); $(document).ready(function(){ // Call the function on page load fixMisplacedAnchor(); $(".fancybox").jqPhotoSwipe({ galleryOpen: function (gallery) { //with `gallery` object you can access all methods and properties described here http://photoswipe.com/documentation/api.html //console.log(gallery); //console.log(gallery.currItem); //console.log(gallery.getCurrentIndex()); //gallery.zoomTo(1, {x:gallery.viewportSize.x/2,y:gallery.viewportSize.y/2}, 500); //gallery.toggleDesktopZoom(); } }); $('.flexslider').flexslider({ animation: "fade", autoplay: true, slideshowSpeed: 5000, animationSpeed: 2000, initDelay: 1500, randomize: false, pauseOnAction: true, pauseOnHover: true, touch: true }); $(".dot-wrapper").dotdotdot({ watch: "window" }); $('input#od, input#do').pickadate( { selectMonths: true, selectYears: true } ); $("input#b_kontaktformsubmit").click(function () { var f_jmeno = $("#jmeno").val(); var f_email = $("#email").val(); var f_predmet = $("#predmet").val(); var f_otazka = $("#otazka").val(); var f_response = grecaptcha.getResponse(widgetId1); //console.log(f_response); $.ajax({ type: "POST", url: "/cs/kontakt/kontakt-form", data: ({ jmeno: f_jmeno, email: f_email, predmet: f_predmet, otazka: f_otazka, g_captcha_response_field: f_response }), success: function (msg) { $('div#ajax-msg-box-kontakt').html(msg); // nulujeme form if (msg == '
Děkujeme za váš dotaz. Ozveme se Vám.
') { // Děkujeme, váš dotaz bude zodpovězen v nejkratším možném termínu /*$("#jmeno").val(""); $("#email").val(""); $("#predmet").val(""); $("#otazka").val("");*/ window.location.href = '/cs/kontakt/formular-odeslan'; } $("div#ajax-msg-box-kontakt:hidden").show("fast"); grecaptcha.reset(widgetId1); // $("html, body").animate({scrollTop: 360}, "slow"); }, error: function (msg) { $('div#ajax-msg-box-kontakt').html(msg); $("div#ajax-msg-box-kontakt:hidden").show("fast"); // $("html, body").animate({scrollTop: 360}, "slow"); grecaptcha.reset(widgetId1); window.scrollTo('#form-anchor-id'); return false; } }); }); /*jQuery.extend( jQuery.fn.pickatime.defaults, { clear: 'vymazat' });*/ /* $(".flip").flip({ trigger: 'hover', axis: 'x' });*/ // ošetřujeme lazy loading obrázků $( 'article img').not('img.banner').not('img.setmeup').each(function( index ) { var src = $( this ).attr('src'); //prepend '/' to the relative 'uc/' path if not already there var subSrc = src.substring(0,3); if(subSrc === 'uc/'){ var changedSrc = src.replace('uc/', '/uc/'); src = changedSrc; } $( this ).attr('data-original', src); $( this ).attr('src', '/ui/images/transparent.gif'); $( this ).removeClass( 'lazyload' ); $( this ).addClass( 'lazyload' ); }); $( 'img.lazyload' ).lazyload({ /*effect : "fadeIn"*/ }); $('.slick-news').slick({ slidesToShow: 4, slidesToScroll: 4, infinite: false, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 3, infinite: false, prevArrow: '', nextArrow: '', } }, { breakpoint: 860, /*settings: "unslick"*/ settings: { slidesToShow: 3, slidesToScroll: 3, infinite: false, prevArrow: '', nextArrow: '', } }, { breakpoint: 640, /*settings: "unslick"*/ settings: { slidesToShow: 2, slidesToScroll: 2, infinite: false, prevArrow: '', nextArrow: '' } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1, infinite: false, prevArrow: '', nextArrow: '' } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); $('.flipper-strip').slick({ slidesToShow: 4, slidesToScroll: 4, infinite: true, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 3, infinite: true } }, { breakpoint: 860, /*settings: "unslick"*/ settings: { prevArrow: '', nextArrow: '' } }, { breakpoint: 840, /*settings: "unslick"*/ settings: { slidesToShow: 2, slidesToScroll: 2, infinite: true, prevArrow: '', nextArrow: '' } }, { breakpoint: 480, /*settings: "unslick"*/ settings: { slidesToShow: 1, slidesToScroll: 1, infinite: true, prevArrow: '', nextArrow: '' } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); //flipperSlider.slick("slickSetOption", "prevArrow", '', true); //flipperSlider.slick("slickSetOption", "nextArrow", '', true); /*$("footer .ico").mouseenter(function () { console.log('hover'); var currentImage = $('img', this).attr("src"); var hoverImage = currentImage.replace('.svg', '-over.svg'); $('img', this).data("orig", currentImage) .attr("src", hoverImage); }).mouseleave(function () { var original = $('img', this).data("orig"); $('img', this).attr("src", original); });*/ $("a.b-lupa").on('click', function(event){ //prevent the default action for the click event event.preventDefault(); $("form#top-query-form").submit(); }); $("a.b-date-clear").on('click', function(event){ //prevent the default action for the click event event.preventDefault(); $(this).parent().parent().children('input#od').val(''); $(this).parent().children('input#do').val(''); }); $("a.b-date-clear.query").on('click', function(event){ //prevent the default action for the click event event.preventDefault(); $(this).parent().children('input#query').val(''); }); $("a.openMarker").on('click', function(event){ //prevent the default action for the click event event.preventDefault(); var id = $(this).attr('data-id'); var aTag = $("a[name='gMap']"); $('html,body').animate({scrollTop: aTag.offset().top}, 'slow', function () { if (id) { //console.log('bound click'); openMarker(id); } }); }); // FILTRY $(".filtry-bar-up").on('click', function(event){ $(".filtry-bar-up").addClass('hidden'); $(".filtry-bar-down").removeClass('hidden'); $(".box-filtry").slideDown('slow', function(){ //$(".filtry-buttons").show(); $(".filtry-bar-up").unbind('click', function(){ }); }); }); $(".filtry-bar-down").on('click', function(event){ //$(".filtry-buttons").hide(); $(".box-filtry").slideUp('slow', function(){ $(".filtry-bar-down").addClass('hidden'); $(".filtry-bar-up").removeClass('hidden'); }); }); }); /* * Fix Misplaced Anchor * * This script checks if an anchor is misplaced in the URL and performs a redirect to the corrected URL. * It ensures that the anchor appears after any query parameters, following best practices for URL structure. * It helps enhance the user experience by seamlessly redirecting them to the correct URL if an anchor is misplaced. */ function fixMisplacedAnchor() { const hashPos = window.location.href.indexOf('#'); const queryPos = window.location.href.indexOf('?'); if (hashPos !== -1 && (queryPos === -1 || hashPos < queryPos)) { const baseUrl = window.location.href.substring(0, hashPos); const query = window.location.href.substring(queryPos !== -1 ? queryPos : window.location.href.length); const hash = window.location.href.substring(hashPos, queryPos !== -1 ? queryPos : window.location.href.length); const correctedURL = baseUrl + query + hash; // Check if the anchor is misplaced and perform a redirect if (correctedURL !== window.location.href) { window.location.href = correctedURL; } } }