1(function() { 2 var $is_loaded = false; 3 $(window).on("load", function() { 4 $("header").css("opacity", 0); 5 $('.preloader').addClass('animated fadeOut').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oAnimationEnd animationend', function() { 6 $is_loaded = true; 7 $('.preloader').hide(); 8 $('header').addClass("animated fadeIn"); 9 }); 10 11 $('header').height($(window).height() + 80); 12 }); 13 14 var throttle; 15 $(window).on("resize", function() { 16 clearTimeout(throttle); 17 throttle = setTimeout(function() { 18 $('header').height($(window).height()); 19 }, 125); 20 }); 21 22 $(function () { 23 setTimeout(function() { 24 if(!$is_loaded) 25 { 26 $('.preloader').hide(); 27 $('header').addClass("animated fadeIn"); 28 } 29 }, 1000); 30 }); 31})(); 32 33$(function() { 34 Typed.new("#typed", { 35 stringsElement: document.getElementById('typed-strings'), 36 typeSpeed: 30, 37 backDelay:4500, 38 loop: true, 39 contentType: 'html', 40 loopCount: null 41 }); 42 43 //fancy formuláÅová polÃÄka 44 (function() { 45 if (!String.prototype.trim) { 46 (function() { 47 var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 48 String.prototype.trim = function() { 49 return this.replace(rtrim, ''); 50 }; 51 })(); 52 } 53 54 [].slice.call( document.querySelectorAll( 'input.input__field' ) ).forEach( function( inputEl ) { 55 if( inputEl.value.trim() !== '' ) { 56 inputEl.parentNode.classList.add('input--filled'); 57 } 58 59 inputEl.addEventListener( 'focus', onInputFocus ); 60 inputEl.addEventListener( 'blur', onInputBlur ); 61 //OÅ¡etÅenà automatického vyplnÄnà formuláÅe prohlÞeÄem 62 //VÄtÅ¡inou po vyplnÄnà pole prohlÞeÄ posluÅ¡nÄ vyvolá change událost, budeme tedy naslouchat 63 inputEl.addEventListener('change', onInputChange); 64 if(inputEl.classList.contains('autofill-fix')) 65 { 66 //Chrome ale u polÃÄka s heslem dÄlá výjimku. Do pole vykreslà puntÃÄky, ale hodnotu do nÄj vložà až po interakci uživatele se stránkou (tÅeba kliknutÃ) 67 //Nemůžeme tedy kontrolovat délku obsahu ani se spolehnout na change event. 68 //Zneužijeme extra property ':-webkit-autofill' k definovánà dummy css animace, která sice nic nedÄlá, ale můžeme reagovat na událost jejÃho spuÅ¡tÄnà 69 inputEl.addEventListener('animationstart', onAnimationStart); 70 } 71 } ); 72 73 74 function onInputFocus( ev ) { 75 ev.target.parentNode.classList.add('input--filled'); 76 } 77 78 function onInputBlur( ev ) { 79 if( ev.target.value.trim() === '' ) { 80 ev.target.parentNode.classList.remove('input--filled'); 81 } 82 } 83 84 function onInputChange(ev) 85 { 86 if(ev.target.value.trim() !== '') 87 { 88 ev.target.parentNode.classList.add('input--filled'); 89 } 90 else 91 { 92 ev.target.parentNode.classList.remove('input--filled'); 93 } 94 } 95 96 function onAnimationStart(ev) 97 { 98 if(ev.animationName === 'autofillStart') 99 { 100 ev.target.parentNode.classList.add('input--filled'); 101 } 102 else if(ev.animationName === 'autofillCancel') 103 { 104 if(ev.target.value.trim() === '') 105 { 106 ev.target.parentNode.classList.remove('input--filled'); 107 } 108 } 109 } 110 })(); 111 112 //validace polÃÄek ve formuláÅi 113 $.validator.addMethod("login_mail", function(value, element) { 114 var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 115 return this.optional(element) || regex.test(value); 116 }); 117 118 var validation_options = { 119 errorClass: "error", 120 validClass: "valid", 121 errorPlacement: function() { 122 //necheme zobrazit zprávu 123 }, 124 highlight: function(element, errorClass, validClass) { 125 $(element).parent("span").addClass(errorClass).removeClass(validClass); 126 }, 127 unhighlight: function(element, errorClass, validClass) { 128 $(element).parent("span").addClass(validClass).removeClass(errorClass); 129 } 130 }; 131 var rules = $.extend({}, validation_options, { 132 rules: { 133 login: { 134 required: true, 135 login_mail: true 136 }, 137 passw: { 138 required: true 139 } 140 } 141 }); 142 $("#loginForm.validate").validate($.extend({}
142, validation_options, rules)); 143});
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.