1$(document).ready(function () { 2 3}); 4 5$(function () { 6 $(document).on("click", ".popup_link", function (event) { 7 event.preventDefault(); 8 var t = $(this).attr('rel'); 9 10 $.ajax({ 11 url: "/include/areas/popup/" + t + ".php", 12 type: "POST", 13 cache: false, 14 success: function (data) { 15 $('body').prepend('<div class="coverPopup"></div>'); 16 $('.modal-body').html(data).closest('.modal').show('fade', 300); 17 }, 18 dataType: "html" 19 }); 20 }); 21 22 $(document).on("click", ".modal .close", function (event) { 23 event.preventDefault(); 24 $(this).closest('.modal').hide('fade', 300); 25 $('.coverPopup').remove(); 26 }); 27 28 $(document).on("click", ".buy", function (event) { 29 event.preventDefault(); 30 console.log($(window).width()); 31 if ($(window).width() <= 1024) { 32 window.location.replace('/buy.php'); 33 return false; 34 } else { 35 return window.kassirWidget.summon({url:'https://msk.kassir.ru/frame/entry/index?type=E&id=94485&key=e4b78a82-9726-97fa-d835-b802227fb1a3'}); 36 } 37 }); 38 39 $("a[href^='#']").click(function(){ 40 var _href = $(this).attr("href"); 41 42 if (_href != '#' && _href.length) { 43 // var y = $(_href).offset().top - 140; 44 var y = $(_href).offset().top + 140; 45 $("html, body").animate({scrollTop: + y + "px"}, 600); 46 return false; 47 } 48 }); 49 50 $(document).on('submit','.form-ajax',function(event){ 51 var form = $(this), 52 type = typeof form.attr('method') !== 'undefined' && form.attr('method')!='' ? form.attr('method') : 'post', 53 bAjax = true; 54 event.preventDefault(); 55 56 var required = form.find('[required]'); 57 if(required.length>0) { 58 59 for(var i=0; i<required.length;i++) { 60 var input = required[i]; 61 var bNoValid = false; 62 if(input.value=='') 63 { 64 bNoValid = true; 65 } 66 else if(input.getAttribute('type')==='email') { 67 var pattern = /^(([^<>()\[\]\\.,;:\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,}))$/; 68 if(!pattern.test(input.value)) { 69 bNoValid = true; 70 } 71 } 72 if(bNoValid) { 73 input.classList.add('is-invalid'); 74 } 75 else 76 { 77 input.classList.remove('is-invalid'); 78 } 79 } 80 } 81 var isSuccess = true; 82// if(form.find('.reCaptcha').length>0) { 83// var captcha = form.find('.reCaptcha')[0]; 84// if (window.grecaptcha && captcha.captchaWidget) { 85// isSuccess = window.grecaptcha.getResponse(captcha.captchaWidget).length > 0; 86// if(!isSuccess) { 87// form.find('.reCaptcha').addClass('no-valid'); 88// } 89// } 90// } 91 if(bAjax) { 92 event.preventDefault(); 93 form.append('<input type="hidden" name="ajax" value="Y">'); 94 $.ajax({ 95 url: form.attr('action'), 96 type: type, 97 data: form.serialize(), 98 cache: false, 99 dataType: 'json', 100 success: function(res){ 101 if(typeof res ==='string' && res!='') 102 { 103 try{ 104 res = JSON.parse(res); 105 } 106 catch (e){ 107 return; 108 } 109 } 110 form.trigger('onFormAjaxAfterSubmit',[res]); 111 if(typeof res ==='object') 112 { 113 if('MESS' in res) 114 { 115 if(form.find('.message-container').length==0) { 116 form.prepend('<div class="message-container"></div>'); 117 } 118 form.find('.message-container').html('<div class="alert alert-info">'+res.MESS+'</div>'); 119 } 120 if('ERROR' in res) 121 { 122 if(form.find('.message-container').length==0) { 123 form.prepend('<div class="message-container"></div>'); 124 } 125 form.find('.message-container').html('<div class="alert alert-danger">'+res.ERROR+'</div>'); 126 } 127 else if('MODAL' in res) { 128 alert('СпаÑибо, ÑоÑма оÑпÑавлена'); 129 // var obModal = res.MODAL; 130 // $.ajax({ 131 // url: "/include/areas/popup/" + obModal.target + ".php", 132 // type: "POST", 133 // cache: false, 134 // success: function (data) { 135 // $('body').prepend('<div class="coverPopup"></div>'); 136 // $('.modal-body').html(data).closest('.modal').show('fade', 300); 137 // }, 138 // dataType: "html" 139 // }); 140 } 141 } 142 } 143 }); 144 } 145 }); 146 147 if ( $('.ch-styled').length ) { 148 $('.ch-styled').styler() 149 } 150});
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.