1const getDeviceType = () => { 2 const ua = navigator.userAgent; 3 console.log(ua); 4 if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(ua)) { 5 $('html').removeClass('mobile desktop'); 6 $('html').addClass('tablet'); 7 return "tablet"; 8 } 9 if (/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(ua)) { 10 $('html').removeClass('tablet desktop'); 11 $('html').addClass('mobile'); 12 return "mobile"; 13 } 14 $('html').removeClass('tablet mobile'); 15 $('html').addClass('desktop'); 16 return "desktop"; 17}; 18 19 20(function($){ 21$(document).ready(function(){ 22$(".nav-modal-wrap").mCustomScrollbar(); 23 24 25 26$('.side_menu .menu-item>* .icon-chevron-down').on('click', function(e){ 27 e.preventDefault(); 28 $(this).parents('.has_children').toggleClass('active'); 29}); 30 31// new Snow ({ 32// iconColor : '#c4c4c4', 33// iconSize : 11, 34// countSnowflake : 30 35// }); 36 37 38// $('select[name="children"]').on('change',function(event){ 39// let cnt = event.target.options[event.target.selectedIndex].dataset.id; 40 41// $('#hidden_children_info').modal('show'); 42// $('#hidden_children_info .res').empty(); 43// if(cnt>=1){ 44// for(let i=1; i<=cnt; i++){ 45// $('#hidden_children_info .res').append('<div class="children_info"><label>Ребенок '+i+'</label><input type="text" name="children_info['+i+'][year]" class="form-control year_child" placeholder="ÐаÑа ÑождениÑ"></div>'); 46 47// } 48// } 49// }); 50 51let btn_mobile = $('.mobile_btn'); 52let sideNavOverlay = $('.side-nav-overlay'); 53let nav_modal_wrap = $('.nav-modal-wrap'); 54let close_btn_side_modal = $('.close_btn_side_modal'); 55 56 close_btn_side_modal.on('click', function () { 57 $('html').removeClass('nav-open filter-open'); 58 // $(right_sidebar).removeClass('open'); 59 $(nav_modal_wrap).removeClass('open'); 60 }); 61 btn_mobile.on('click', function (e) { 62 e.preventDefault(); 63 $(this).toggleClass('active'); 64 $(nav_modal_wrap).toggleClass('open'); 65 $('html').toggleClass('nav-open'); 66 67 }); 68 sideNavOverlay.on('click', function () { 69 $('html').removeClass('nav-open filter-open'); 70 // $(right_sidebar).removeClass('open'); 71 $(nav_modal_wrap).removeClass('open'); 72 }); 73 74 75$('.get_calc').on('click',function(){ 76 $('html').removeClass('nav-open filter-open'); 77 $(nav_modal_wrap).removeClass('open'); 78}); 79 80 $('img.svg_parse').each(function(){ 81 var $img = $(this); 82 var imgID = $img.attr('id'); 83 var imgClass = $img.attr('class'); 84 var imgURL = $img.attr('src'); 85 86 $.get(imgURL, function(data) { 87 var $svg = $(data).find('svg'); 88 if(typeof imgID !== 'undefined') { 89 $svg = $svg.attr('id', imgID); 90 } 91 if(typeof imgClass !== 'undefined') { 92 $svg = $svg.attr('class', imgClass+' replaced-svg'); 93 } 94 $svg = $svg.removeAttr('xmlns:a'); 95 $img.replaceWith($svg); 96 }, 'xml'); 97 }); 98 99$('.callback_inner').on('click',function(e){ 100 $('#fixed_callback').toggleClass('active'); 101}); 102 103 104const recaptchaResponse = document.querySelectorAll('input[name="recaptcha_response"]') 105 106grecaptcha.ready(function (){ 107 grecaptcha.execute("6LdpgmMpAAAAACcEWWaNQx9g8XgYZ4AAss52Rp_1", { action: "contact" }).then(function (token){ 108 recaptchaResponse.forEach((el)=>{ 109 el.value = token 110 }); 111 112 }); 113}); 114 115 116 // grecaptcha.ready(function () { 117 // grecaptcha.execute("6LdpgmMpAAAAACcEWWaNQx9g8XgYZ4AAss52Rp_1", { action: "contact" }).then(function (token) { 118 // var recaptchaResponse = document.getElementById("recaptchaResponse"); 119 // recaptchaResponse.value = token; 120 // }); 121 // }); 122 123 124$(".userForm").submit(function (e) { 125 e.preventDefault(); 126 const form = $(this); 127 $.ajax({ 128 type: "POST", 129 // url: '/mail_feedback.php', 130 url: $(form).attr('action'), 131 dataType: 'json', 132 data: $(form).serialize(), 133 success: function (json) { 134 if(json.status==true && json.data){ 135 $(form).html(json.data); 136 // setTimeout(function(){ 137 // $(form).remove(); 138 // }, 3000); 139 }else{ 140 $(form).html(json.data); 141 } 142 }, 143 error: function (jqXHR, text, error) { 144 $(form).html(jqXHR, text); 145 } 146 }); 147 return false;
148 }); 149 150 151// $(".userForm").submit(function (e) { 152// e.preventDefault(); 153 154 155// var form = $(this); 156// $.ajax({ 157// type: "POST", 158// // url: '/mail_feedback.php', 159// url: $(form).attr('action'), 160// dataType: 'json', 161// data: $(form).serialize(), 162// success: function (json) { 163// if(json.status==true && json.data){ 164// $(form).html(json.data); 165 166// setTimeout(function(){ 167// $(form).remove(); 168// }, 3000); 169// }else{ 170// $(form).html(json.data); 171// } 172 173// }, 174// error: function (jqXHR, text, error) { 175// $(form).html(jqXHR, text); 176// } 177// }); 178// return false; 179// }); 180 181 182 183 // $('[data-toggle="tooltip"]').tooltip(); 184 185$('[data-toggle="custom-tooltip"]').tooltip({ 186 template: '<div class="tooltip custom-tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>', 187 // trigger : 'click' 188}); 189 // $('.header_contact_phone').hover(function(){ 190 // $(this).toggleClass('active'); 191 // }); 192 193$("#sticky").sticky({topSpacing:0}); 194 /*ripple effect for buttons*/ 195 $.ripple(".btn", { 196 debug: false, // Turn Ripple.js logging on/off 197 on: 'mouseenter', // The event to trigger a ripple effect 198 opacity: 0.4, // The opacity of the ripple 199 color: "auto", // Set the background color. If set to "auto", it will use the text color 200 multi: true, // Allow multiple ripples per element 201 duration: 0.6, // The duration of the ripple 202 easing: 'linear' // The CSS3 easing function of the ripple 203 }); 204 205 maskPhone('.phone'); 206 // maskPhone('.order_id', '_____'); 207 $('.booking_form .container_submit .btn-next').on('click',function(e){ 208 e.preventDefault(); 209 $(this).toggleClass('active'); 210 $('.hidden_imputs').toggleClass('active'); 211 }); 212 213 214 $(document).on('click', '.select_name', function () { 215 if($('.select_name_active').length){ 216 $('.select_name_active').next().removeClass('custom_select_active'); 217 $('.select_name_active').removeClass('select_name_active'); 218 } 219 $(this).toggleClass('select_name_active').next().toggleClass('custom_select_active'); 220 }); 221 222 223 $(document).on('click', '.custom_select li', function () { 224 let custom_select = $(this).parents('.custom_select'); 225 let select = $(custom_select).find('select'); 226 $('option[value="'+$(this).data('value')+'"]',select).prop('selected',true); 227 $('.select_name span',custom_select).text($(this).data('value')); 228 $(document).click(); 229 return false; 230 }); 231 232 $(document).click(function(e) { 233 if ($(e.target).closest('.custom_select').length) 234 return 235 $('.custom_select').find('.select_name').removeClass('select_name_active').next().removeClass('custom_select_active'); 236 e.stopPropagation(); 237 }); 238 239 240(function( factory ) { 241 if ( typeof define === "function" && define.amd ) { 242 define( [ "../widgets/datepicker" ], factory ); 243 } else { 244 factory( jQuery.datepicker ); 245 } 246}(function(datepicker) { 247 datepicker.regional.ru = { 248 closeText: "ÐакÑÑÑÑ", 249 prevText: "<ÐÑед", 250 nextText: "След>", 251 currentText: "СегоднÑ", 252 monthNames: [ "ЯнваÑÑ","ФевÑалÑ","ÐаÑÑ","ÐпÑелÑ","Ðай","ÐÑнÑ", 253 "ÐÑлÑ","ÐвгÑÑÑ","СенÑÑбÑÑ","ÐкÑÑбÑÑ","ÐоÑбÑÑ","ÐекабÑÑ" ], 254 monthNamesShort: [ "Янв","Фев","ÐаÑ","ÐпÑ","Ðай","ÐÑн", 255 "ÐÑл","Ðвг","Сен","ÐкÑ","ÐоÑ","Ðек" ], 256 dayNames: [ "воÑкÑеÑенÑе","понеделÑник","вÑоÑник","ÑÑеда","ÑеÑвеÑг","пÑÑниÑа","ÑÑббоÑа" ], 257 dayNamesShort: [ "вÑк","пнд","вÑÑ","ÑÑд","ÑÑв","пÑн","ÑбÑ" ], 258 dayNamesMin: [ "ÐÑ","Ðн","ÐÑ","СÑ","ЧÑ","ÐÑ","Сб" ], 259 weekHeader: "Ðед", 260 dateFormat: "dd.mm.yy", 261 firstDay: 1, 262 isRTL: false, 263 showMonthAfterYear: false, 264 yearSuffix: "" }; 265 datepicker.setDefaults(datepicker.regional.ru); 266 return datepicker.regional.ru; 267})); 268 269$.datepicker.setDefaults($.datepicker.regional['ru']); 270 parseDate = function (str) { 271 var mdy = str.split("."); 272 return new Date(mdy[2], mdy[1] - 1, mdy[0]); 273 }; 274 275let $form= $('.booking_form form'); 276 277 $("input[name=date_in], input[name=date_out], .booking_form .icon-calendar", $form).datepicker({ 278 showOtherMonths: true, 279 selectOtherMonths: true, 280 changeMonth: true, 281 changeYear: false, 282 dateFormat: "dd.mm.yy", 283 hideIfNoPrevNext: true, 284 minDate: "0", 285 beforeShowDay: function (date) { 286 var date1 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("input[name=date_in]", $form).val()); 287 var date2 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("input[name=date_out]", $form).val()); 288 return [true, date1 && (date.getTime() == date1.getTime() || (date2 && date >= date1 && date <= date2)) ? "ui-state-range" : ""]; 289 console.log(date); 290 }, 291 }); 292 293 294let ldate_in = '21.05.2022'; 295let ldate_count = 1; 296 $("input[name=date_in]", $form).datepicker("setDate", typeof ldate_in !== "undefined" ? $.datepicker.parseDate("dd.mm.yy", ldate_in) : new Date()); 297 298 // $("input[name=date_in]", $form).datepicker("setDate"); 299 // var date_in = new Date('1995-12-17T03:24:00'); 300 301 var date_out = new Date($("input[name=date_in]", $form).datepicker("getDate")); 302 date_out.setDate(date_out.getDate() + (typeof ldate_count !== "undefined" ? ldate_count : 1)); 303 $("input[name=date_out]", $form).datepicker("setDate", date_out); 304 $("input[name=date_out]", $form).datepicker("option", "minDate", "+1d"); 305 306 // $("input[name=date_in]", $form).datepicker("setDate", date_in); 307 308 $("input[name=date_in]", $form).datepicker("option", "onSelect", function (date, input) { 309 var dateFrom = parseDate(date); 310 var dateTo = new Date(dateFrom); 311 dateTo.setDate(dateTo.getDate() + 1); 312 313 if (parseDate($("input[name=date_out]", $form).val()) <= dateFrom) { 314 $("input[name=date_out]", $form).val($.datepicker.formatDate("dd.mm.yy", dateTo)); 315 } 316 $("input[name=date_out]", $form).datepicker("option", { minDate: dateTo }); 317 setTimeout(function () { 318 $("input[name=date_out]", $form).focus(); 319 }, 100); 320 }); 321 322 323}); 324})(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.