var lang = "en"; var searchString = "Search"+"…"; $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded',social_tools:false, deeplinking: false}); /* *** focus find field *** */ var query = $( '#hledat' ).val(); if(query === '') { $('#hledat').focus(); } $('div#clients-content').load('/' + lang + '/index/ajaxgetclients/limit/4'); $('div#partners-content').load('/' + lang + '/index/ajaxgetpartners/limit/4'); /* *** CAMERA arrows on window.resize *** */ handleCameraArrowsPosition(); $(window).on('resize', handleCameraArrowsPosition); function handleCameraArrowsPosition() { setTimeout(function () { var margin = 60; var win = $(this); //this = window var viewPort = $('#camera_both'); var wWin = win.width(); var wPort = viewPort.width(); // fix for max arrows distance var wWinCustom = 1170 + (4 * margin); if(wWin >= wWinCustom){ wWin = wWinCustom; } //window.alert('wWidth: ' + win.width() + ', wHeight: ' + win.height() + ', pWidth: ' + viewPort.width() + ', pHeight: ' + viewPort.height()); if(wWin < 750){ var margin = 10; }else if(wWin < 1000){ var margin = 30; } var pos = (wPort - wWin) / 2 + margin; $('#camera_prev').css({'left':pos}); $('#camera_next').css({'right':pos}); }, 100); }; // initialize SVG icons /*[].slice.call( document.querySelectorAll( '.si-icon' ) ).forEach( function( el ) { var svgicon = new svgIcon( el, svgIconConfig ); } ); new svgIcon( document.querySelector( '.si-icons-easing .si-icon-hamburger-cross' ), svgIconConfig, { easing : mina.elastic, speed: 600 } );*/ // jQuery('.content portray').unbind('click'); // removes/detaches any click events from the elements with 'content portray' //class. Because the canvas has this class. // kraceni pro jednotlive stranky if ($(".shortplease.title").length){ $(".shortplease.title").ThreeDots({ max_rows: 1 }); } if ($(".shortplease.title1").length){ $(".shortplease.title1").ThreeDots({ max_rows: 1 }); } if ($(".shortplease.title2").length){ $(".shortplease.title2").ThreeDots({ max_rows: 2 }); } if ($(".shortplease.dsc2").length){ $(".shortplease.dsc2").ThreeDots({ max_rows: 2 }); } if ($(".shortplease.dsc3").length){ $(".shortplease.dsc3").ThreeDots({ max_rows: 3 }); } if ($(".shortplease.dsc5").length){ $(".shortplease.dsc5").ThreeDots({ max_rows: 4 }); } $("input#hledat").click(function(){ var hledat = $("input#hledat").val(); if(hledat == searchString){ $("input#hledat").val(''); $("input#hledat").css("color","#000000"); }else{ this.select(); } }); $("input#hledat").blur(function(){ var hledat = $("input#hledat").val(); if(hledat == ""){ $("input#hledat").val(searchString); $("input#hledat").css("color","#ababab"); } }); $("input#hledat").keydown(function(e) { if (e.keyCode == 13) { var hledat = $("input#hledat").val(); if(hledat != "" && hledat != searchString){ if($('#form-query-hp').text()){ $('#form-query-hp').submit(); } if($('#form-query').text()){ $('#form-query').submit(); } }else{ return false; // alert('Zadejte prosím výraz, který chcete vyhledat.'); } } }); $("a#b-submit-query").click(function(e){ var hledat = $("input#hledat").val(); if(hledat != "" && hledat != searchString){ if($('#form-query-hp').text()){ $('#form-query-hp').submit(); } if($('#form-query').text()){ $('#form-query').submit(); } }else{ return false; // alert('Zadejte prosím výraz, který chcete vyhledat.'); } }); $(document).on('click', 'a#btn-more-clients', function() { $('div#clients-content').load('/' + lang + '/index/ajaxgetclients'); return false; // Prevent browser from visiting `#` }); $(document).on('click', 'a#btn-more-partners', function() { $('div#partners-content').load('/' + lang + '/index/ajaxgetpartners'); return false; // Prevent browser from visiting `#` }); // disable autocomplete for all forms var allforms = document.getElementsByTagName("form"); for (var f = 0; f < allforms.length; f++) { allforms[f].setAttribute("autocomplete", "off"); } });