1 2$(document).ready(function () { 3 $('.pgs__top-text__more__btn').click(function () {//also in static.../kotvy.js 4 $(this).parent().addClass('full-text'); 5 $(this).parent().parent().css({'max-height': '200vh', 'overflow': 'hidden'}); 6 setTimeout(function () { 7 $('.pgs__top-text').css({'max-height': 'none', 'overflow': 'visible'}); 8 }, 800); 9 }); 10 $('.pgs__top-text__more__btn--less').click(function () { 11 $(this).parent().removeClass('full-text'); 12 $(this).parent().parent().removeAttr('style'); 13 $('html, body').animate({ 14 scrollTop: $('.pgs__top-text').offset().top - 150 15 }, 1000); 16 17 }); 18}); 19 20 21/** 22 * naformatuje cislo tak, ze mu prida oddelovac mezi tisice a pouzije desetinny znak 23 * defaultovano pro ceske locale 24 * @param float number 25 * @param int decimals 26 * @param String decPoint 27 * @param String thousandsSep 28 * @returns String 29 */ 30function formatNumber(number, decimals, decPoint, thousandsSep) { 31 decimals = typeof decimals !== 'undefined' ? decimals : 0; 32 decPoint = typeof decPoint !== 'undefined' ? decPoint : ","; 33 thousandsSep = typeof thousandsSep !== 'undefined' ? thousandsSep : " "; 34 // float $number, int $decimals = 0, string $dec_point = ".", string $thousands_sep = "," 35 36 var priceSring = '' + number; 37 var splitted = priceSring.split('.'); 38 // celociselna cast 39 var wholePart = splitted[0]; 40 var rgx = /(\d+)(\d{3})/; 41 while (rgx.test(wholePart)) { 42 wholePart = wholePart.replace(rgx, '$1' + thousandsSep + '$2'); 43 } 44 // desetinna cast 45 var decimalPart = ''; 46 if (decimals > 0) { 47 decimalPart = splitted.length > 1 ? decPoint + splitted[1].substring(0, decimals) : ''; 48 } 49 return wholePart + decimalPart; 50} 51 52/** 53 * naformatuje cislo do tvaru pro lepsi citelnost 54 * @param number price 55 * @param string locale 56 * @returns string 57 */ 58function formatPrice(price, locale) { 59 // FIXME: resit cenu podle locale 60 return formatNumber(price, 0, ",", " ") + " KÄ"; 61} 62 63function validateEmail(email) { 64 var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 65 return re.test(email); 66} 67 68/* Lukáš - asi pÅehodit na vhodnÄjšà mÃsto */ 69function ajaxPostFooterNewsletter(ev, that, url) { 70 ev.preventDefault(); 71 var $form = $(that); 72 var wrapper = $(that).parents('.js-newsletter-wrapper'); 73 var message = wrapper.find('.js-widget--newsletter--message'); 74 var successMessage = wrapper.find('.js-widget--newsletter--message .success'); 75 var errorMessage = wrapper.find('.js-widget--newsletter--message .error'); 76 var errorMessageText = wrapper.find('.js-newsletter-js-error'); 77 var validMail = validateEmail($form.find('input[name=email]').val()); 78 if (validMail) { 79 $.post(url, $form.serialize(), 80 function (response) { 81 if (response.result == 'ok') { 82 $form.find('input[name=email]').val('@'); 83 successMessage.show(); 84 errorMessage.hide(); 85 message.slideDown(); 86 87 setTimeout(function () { 88 successMessage.hide(); 89 message.slideUp(); 90 }, 10000); 91 } else { 92 successMessage.hide(); 93 errorMessage.show(); 94 errorMessageText.html(response.error); 95 message.slideDown(); 96 97 setTimeout(function () { 98 errorMessage.hide(); 99 message.slideUp(); 100 }, 10000); 101 } 102 }, 'json'); 103 } else { 104 //TODO 105 //alert('not valid mail'); 106 107 successMessage.hide(); 108 errorMessage.show(); 109 errorMessageText.html('Email, který jste zadali, nenà ve správném tvaru.'); 110 message.slideDown(); 111 112 setTimeout(function () { 113 errorMessage.hide(); 114 message.slideUp(); 115 }, 10000); 116 } 117} 118 119var IZON = IZON || {}; 120IZON.Forms = IZON.Forms || {}; 121 122IZON.Forms.serializeObject = function (selector) {
123 var formArray = $(selector).serializeArray(); 124 var object = {}; 125 for (var i = 0; i < formArray.length; i++) { 126 var name = formArray[i]['name']; 127 var value = formArray[i]['value']; 128 var names = name.split("["); 129 var swap = object; 130 for (var j = 0; j < names.length; j++) { 131 name = names[j]; 132 if (j > 0) { 133 name = name.substring(0, name.length - 1); 134 } 135 if (j == names.length - 1) { 136 swap[name] = value; 137 } else { 138 if (!swap.hasOwnProperty(name)) { 139 swap[name] = {}; 140 } 141 swap = swap[name]; 142 143 } 144 } 145 } 146 return object; 147}; 148 149function debounce(func, wait, immediate) { 150 var timeout; 151 return function() { 152 var context = this, args = arguments; 153 var later = function() { 154 timeout = null; 155 if (!immediate) func.apply(context, args); 156 }; 157 var callNow = immediate && !timeout; 158 clearTimeout(timeout); 159 timeout = setTimeout(later, wait); 160 if (callNow) func.apply(context, args); 161 }; 162};
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.