1$(function () { 2 $('.top_callme').on('click', function(){ 3 $('#callme_btn .TVBButton').click(); 4 }); 5 6 $('header').clone().appendTo('.header-fix'); 7 8 $(window).scroll (function () { 9 10 if ($(this).scrollTop () > 300) { 11 12 $('.header-fix').fadeIn(); 13 14 } else { 15 16 $('.header-fix').fadeOut(); 17 18 } 19 20 }); 21 $('[data-name="home-slider"]').slick({ 22 responsive: [ 23 { 24 breakpoint: 992, 25 settings: { 26 arrows: false, 27 dots: true 28 } 29 }, 30 ] 31 }); 32 33 $('[data-name="reviews"]').slick({ 34 slidesToShow: 3, 35 responsive: [ 36 { 37 breakpoint: 992, 38 settings: { 39 arrows: false, 40 dots: true, 41 slidesToShow: 2 42 } 43 }, 44 { 45 breakpoint: 576, 46 settings: { 47 arrows: false, 48 dots: true, 49 slidesToShow: 1 50 } 51 } 52 ] 53 }); 54 55 $('.instagram-slider__container').slick({ 56 slidesToShow: 3, 57 responsive: [ 58 { 59 breakpoint: 992, 60 settings: { 61 arrows: true, 62 dots: true, 63 slidesToShow: 2 64 } 65 }, 66 { 67 breakpoint: 576, 68 settings: { 69 arrows: true, 70 dots: true, 71 slidesToShow: 1 72 } 73 } 74 ] 75 }); 76 77 78 // Gallery 79 var $gallery = $('.gallery .list'); 80 81 if ($gallery.length) { 82 var currentSlide; 83 var slidesCount; 84 var sliderCounter = document.createElement('div'); 85 sliderCounter.classList.add('slick-counter'); 86 87 var updateSliderCounter = function(slick, currentIndex) { 88 currentSlide = slick.slickCurrentSlide() + 1; 89 slidesCount = slick.slideCount; 90 $(sliderCounter).text(currentSlide + ' / ' + slidesCount) 91 }; 92 93 $gallery.on('init', function(event, slick) { 94 $gallery.append(sliderCounter); 95 updateSliderCounter(slick); 96 }); 97 98 $gallery.on('afterChange', function(event, slick, currentSlide) { 99 updateSliderCounter(slick, currentSlide); 100 }); 101 102 $gallery.slick({ 103 infinite: false 104 }); 105 } 106 107 108 // Up 109 // var scrollTo = window.scrollY; 110 111 // animateUpButton(); 112 113 // $('.btn-up').on('click', function () { 114 // $('html, body').animate({scrollTop: 0}, 500); 115 // }); 116 117 118 // Mobile header 119 $('.header__menu').on('click', function () { 120 let self = $('.header__menu'); 121 122 if (self.hasClass('header__menu--active')) { 123 $('body').removeClass('swipe-open'); 124 self.removeClass('header__menu--active'); 125 } 126 else { 127 $('body').addClass('swipe-open'); 128 self.addClass('header__menu--active'); 129 } 130 }); 131 132 $('.nav__caret').on('click', function (e) { 133 e.preventDefault(); 134 e.stopPropagation(); 135 136 let self = $(this).parent(); 137 138 if (self.next().is(':hidden')) { 139 self.next().addClass('nav--opened'); 140 } 141 else { 142 self.next().removeClass('nav--opened'); 143 } 144 }); 145 146 147 // Swipe search 148 $('.tabs-mobile').on('click', function () { 149 $('body').addClass('swipe-search-open'); 150 $('.search-swipe').addClass('search-swipe--opened'); 151 }); 152 153 $('.search-swipe__close').on('click', function () { 154 $('body').removeClass('swipe-search-open'); 155 $('.search-swipe').removeClass('search-swipe--opened'); 156 }); 157 158 $('.search-swipe__content .nav__item').on('click', function (e) { 159 e.preventDefault(); 160 161 let self = $(this), 162 index = self.index(); 163 console.log(index) 164 165 $('.search-swipe__content .nav__item').removeClass('nav__item--selected'); 166 self.addClass('nav__item--selected'); 167 168 $('.tabs__content').removeClass('tabs__content--opened'); 169 $('.tabs__content').eq(index).addClass('tabs__content--opened'); 170 171 $('body').removeClass('swipe-search-open'); 172 $('.search-swipe').removeClass('search-swipe--opened'); 173 }); 174 175 function $_GET(key) { 176 var p = decodeURI(window.location.search); 177 p = p.match(new RegExp(key + '=([^&=]+)')); 178 return p ? p[1] : false; 179 } 180 181 if ($_GET('strIMessage') == 'ÐаÑвка+ÑÑпеÑно+оÑпÑавлена') { 182 $('.modal-backdrop, .modal').remove(); 183 $('body').append('<div class="modal-backdrop fade show"></div>'); 184 $('.modal-backdrop').after('<div class="modal show modal--feedback"></div>'); 185 $('body').addClass('modal-open'); 186 187 let html = '<div class="modal__dialog"><div class="modal__content"><svg class="modal__close" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.1225 11.9998L23.5602 2.56205C24.1466 1.97619 24.1466 1.02562 23.5602 0.439766C22.9739 -0.146589 22.0243 -0.146589 21.438 0.439766L12.0002 9.87747L2.56205 0.439766C1.97569 -0.146589 1.02612 -0.146589 0.439766 0.439766C-0.146589 1.02562 -0.146589 1.97619 0.439766 2.56205L9.87797 11.9998L0.439766 21.4375C-0.146589 22.0233 -0.146589 22.9739 0.439766 23.5597C0.732943 23.8524 1.11
187717 23.999 1.50091 23.999C1.88464 23.999 2.26887 23.8524 2.56205 23.5592L12.0002 14.1215L21.438 23.5592C21.7311 23.8524 22.1154 23.999 22.4991 23.999C22.8828 23.999 23.2671 23.8524 23.5602 23.5592C24.1466 22.9734 24.1466 22.0228 23.5602 21.437L14.1225 11.9998Z"></path></svg><div class="modal__body"><h3>ÐаÑа заÑвка ÑÑпеÑно оÑпÑавлена</h3></div></div></div>' 188 $('.modal').html(html); 189 } 190 191 192 193 // Popup 194 $('.js-form').on('click', function (e) { 195 e.preventDefault(); 196 197 openModal(); 198 }); 199 200 $('.js-form-tur').on('click', function (e) { 201 e.preventDefault(); 202 203 openModal(); 204 var price = $(this).parent().prev().find('h3').text(); 205 price = price.split(":")[1]; 206 price = price.replace('â½', ''); 207 price = price.replace(/\s+/g, ''); 208 $('.sberbank-modal #sum').val(price).prop('disabled', true); 209 $('.sberbank-modal .pay-or-date').html('<input id="date" type="text" placeholder="ÐÑбеÑиÑе даÑÑ Ð²ÑлеÑа *" class="form-control">'); 210 var datepicker = new Datepicker('#date', { 211 min: (function(){ 212 var date = new Date(); 213 date.setDate(date.getDate() - 1); 214 return date; 215 })(), 216 }); 217 218 $('.sberbank-modal .form-text').html('СоглаÑен Ñ <a target="_blank" href="/privacy/file.pdf" >положением об обÑабоÑке пеÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ </a> и Ð´Ð°Ñ ÑоглаÑие на обÑабоÑÐºÑ <a target="_blank" href="/policy/" >пеÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ </a>'); 219 if ($(this).hasClass('mir-pay')) { 220 $('.sberbank-modal .form-text').after('<p class="form-text form-text-mir">ÐÐ»Ñ ÑÑаÑÑÐ¸Ñ Ð² акÑии заÑегиÑÑÑиÑÑйÑеÑÑ Ð¸ пÑивÑжиÑе ваÑÑ ÐºÐ°ÑÑÑ "ÐиÑ" в пÑогÑамме лоÑлÑноÑÑи Ð´Ð»Ñ Ð´ÐµÑжаÑелей каÑÑ "ÐиÑ" </p>'); 221 $('.sberbank-modal .btn').after(' <a target="_blank" href="https://privetmir.ru/russiatravel/" class="btn-primary btn-mir">ÐаÑегиÑÑÑиÑоваÑÑÑÑ</a>').addClass('mir-paymant'); 222 $('.sberbank-modal .avangard-text').html('ÐÑи оплаÑе заказа банковÑкой каÑÑой ввод ÑеквизиÑов каÑÑÑ Ð¿ÑоиÑÑ Ð¾Ð´Ð¸Ñ Ð² ÑиÑÑеме ÑлекÑÑоннÑÑ Ð¿Ð»Ð°Ñежей ÐÐÐ ÐÐР«ÐвангаÑд», коÑоÑÐ°Ñ Ð¿ÑоÑла ÑеÑÑиÑикаÑÐ¸Ñ Ð² плаÑежнÑÑ ÑиÑÑÐµÐ¼Ð°Ñ Visa, MasterCard и ÐÐÐ . ÐÑедÑÑавленнÑе Ðами даннÑе полноÑÑÑÑ Ð·Ð°ÑиÑÐµÐ½Ñ Ð¸ никÑо, вклÑÑÐ°Ñ Ð½Ð°Ñ Ð¸Ð½ÑеÑнеÑ-магазин, не Ð¼Ð¾Ð¶ÐµÑ Ð¸Ñ Ð¿Ð¾Ð»ÑÑиÑÑ.'); 223 } 224 225 $('.sberbank-modal h2').html('ÐокÑпка ÑÑÑа онлайн'); 226 $('.sberbank-modal .modal__descr').html('ÐаполниÑе ÑоÑÐ¼Ñ Ð½Ð¸Ð¶Ðµ, внимаÑелÑно заполнÑÑ Ð²Ñе Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе полÑ. Ð ÑеÑение Ð´Ð½Ñ Ñ Ð²Ð°Ð¼Ð¸ ÑвÑжÑÑÑÑ Ð½Ð°Ñи менеджеÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð´ÑвеÑÐ¶Ð´ÐµÐ½Ð¸Ñ Ð±ÑониÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¸ оплаÑÑ .') 227 }); 228 229 $('body').delegate('.modal__close', 'click', function (e) { 230 e.preventDefault(); 231 232 closeModal(); 233 }); 234 235 $('body').delegate('.modal-sber-bg', 'click', function (e) { 236 $(this).parent().fadeOut(); 237 }); 238 239 $('body').delegate('.close-sber', 'click', function (e) { 240 $('#modal-sber').fadeOut(); 241 }); 242 243 // Form submit 244 $('body').delegate('.modal.sberbank-modal .btn', 'click', function (e) { 245 e.preventDefault(); 246 247 let self = $('.modal .form'), 248 name = $('#name', self), 249 phone = $('#phone', self), 250 email = $('#email', self), 251 pay = $('#pay', self), 252 sum = $('#sum', self), 253 comment = $('#comment', self); 254 date = $('#date', self); 255 256 257 var data = { 258 'name': name.val(), 259 'phone': phone.val(), 260 'email': email.val(), 261 'pay': pay.val(), 262 'sum': sum.val(), 263 'comment': comment.val(), 264 'date': date.val(), 265 }; 266 267 $('.modal__clarification').addClass('hidden-modal'); 268 269 if ($(this).hasClass('btn-pay')) { 270 if($(this).hasClass('mir-pay-end')) { 271 var url = '/AvangardPay.php'; 272 } 273 else { 274 var url = '/SberPay.php'; 275 } 276 277 $.ajax({ 278 url: url, 279 method: 'post', 280 dataType: 'html', 281 data: {name: data.name, phone: data.phone, email: data.email, pay: data.pay, date: data.date, sum: data.sum, comment: data.comment, thisPage: document.location.pathname}, 282 success: function(data){ 283 document.location.href = data; 284 //console.log(data); 285 } 286 }); 287 } 288 289 else if ($(this).hasClass('prev')) { 290 $(this).closest('.modal__dialog').fadeOut(); 291 $(this).closest('.modal__dialog').prev().fadeIn(); 292 } 293 294 else { 295 var dateOrPay = data.pay + data.date; 296 if (data.name != '' && data.phone != '' && data.email != '' && dateOrPay != undefined && data.sum != '' && Number.parseInt(data.sum) >= 10 && data.comment != '') { 297 // Success 298 console.log(123); 299 $('.form-control', self).removeClass('error'); 300 $('.form-error', self).remove(); 301 302 let htmlModalPay = `<div class="modal__dialog modal__dialog_end"> 303 <div class="modal__content"> 304 <svg class="modal__close" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 305 <path d="M14.1225 11.9998L23.5602 2.56205C24.1466 1.97619 24.1466 1.02562 23.5602 0.439766C22.9739 -0.146589 22.0243 -0.146589 21.438 0.439766L12.0002 9.87747L2.56205 0.439766C1.97569 -0.146589 1.02612 -0.146589 0.439766 0.439766C-0.146589 1.02562 -0.146589 1.97619 0.439766 2.56205L9.87797 11.9998L0.439766 21.4375C-0.146589 22.0233 -0.146589 22.9739 0.439766 23.5597C0.732943 23.8524 1.11
305717 23.999 1.50091 23.999C1.88464 23.999 2.26887 23.8524 2.56205 23.5592L12.0002 14.1215L21.438 23.5592C21.7311 23.8524 22.1154 23.999 22.4991 23.999C22.8828 23.999 23.2671 23.8524 23.5602 23.5592C24.1466 22.9734 24.1466 22.0228 23.5602 21.437L14.1225 11.9998Z" /> 306 </svg> 307 <div class="modal__body"> 308 <h2>СвободнÑй плаÑÑж</h2> 309 <p class="modal__descr">ÐожалÑйÑÑа, пÑовеÑÑÑе инÑоÑмаÑиÑ, и еÑли вÑÑ Ð²ÐµÑно - нажмиÑе ÐºÐ½Ð¾Ð¿ÐºÑ âÐплаÑиÑÑâ</p> 310 <div class="row modal-pay"> 311 <div class="col-md-6"> 312 <p><span>ФÐÐ: </span>`+ data.name +`</p> 313 <p><span>E-mail: </span>`+ data.email +`</p> 314 <p><span>СÑмма: </span>`+ data.sum +`</p> 315 </div> 316 <div class="col-md-6"> 317 <p><span>ТелеÑон: </span>`+ data.phone +`</p> 318 <p class="pay-or-date"><span>ÐазнаÑение плаÑежа: </span>`+ data.pay +`</p> 319 <p><span>ÐомменÑаÑий: </span>`+ data.comment +`</p> 320 </div> 321 </div> 322 <span class="btn btn-primary prev">Ðазад</span> 323 <button class="btn btn-primary btn-pay" type="submit">ÐплаÑиÑÑ</button> 324 </div> 325 </div> 326 </div>`; 327 $('.modal__dialog').fadeOut(); 328 $('.modal').append(htmlModalPay); 329 if ($(this).hasClass('mir-paymant')) { 330 $('.modal__dialog_end .btn').addClass('mir-pay-end'); 331 } 332 if (data.date != undefined) { 333 var htmlDate = '<span>ÐаÑа вÑлеÑа: </span>' + data.date; 334 $('.modal p.pay-or-date').html(htmlDate); 335 } 336 337 } 338 else { 339 checkError('name', name, 'ÐведиÑе ФÐÐ'); 340 checkError('date', date, 'ÐÑбеÑиÑе даÑÑ'); 341 checkError('phone', phone, 'ÐведиÑе Ð½Ð¾Ð¼ÐµÑ ÑелеÑона', 'ÐепÑавилÑнÑй ÑоÑмаÑ'); 342 checkError('email', email, 'ÐведиÑе E-mail', 'ÐепÑавилÑнÑй ÑоÑмаÑ'); 343 checkError('pay', pay, 'ÐведиÑе назнаÑение плаÑежа (пÑÑевка, кÑÑоÑÑ)'); 344 checkError('sum', sum, 'ÐведиÑе ÑÑммÑ', 'ТолÑко ÑиÑÑÑ'); 345 checkError('comment', comment, 'ÐведиÑе комменÑаÑий'); 346 } 347 } 348 }); 349 350 351 // Reviews 352 $('.reviews .list__item').on('click', function (e) { 353 e.preventDefault(); 354 355 let id = $(this).data('id'); 356 357 $.post('https://tsvet-tur.ru/reviews/' + id + '/', {id:id}, function(response) { 358 $('.modal-backdrop, .modal').remove(); 359 $('body').append('<div class="modal-backdrop fade show"></div>'); 360 $('.modal-backdrop').after('<div class="modal show modal--review"></div>'); 361 $('body').addClass('modal-open'); 362 363 let template = $('#review').html(); 364 let compiledTemplate = Template7.compile(template); 365 366 let context = { 367 name: response.name, 368 date: response.date, 369 descr: response.descr, 370 photo: response.photo, 371 social: response.social, 372 social_link: response.social_link, 373 descr: response.descr, 374 gallery: response.gallery 375 }; 376 console.log(context); 377 378 let html = compiledTemplate(context); 379 380 $('.modal').html(html); 381 382 let gallery = $('.gallery .list'); 383 384 if (gallery.length) { 385 var currentSlide; 386 var slidesCount; 387 var sliderCounter = document.createElement('div'); 388 sliderCounter.classList.add('slick-counter'); 389 390 var updateSliderCounter = function(slick, currentIndex) { 391 currentSlide = slick.slickCurrentSlide() + 1; 392 slidesCount = slick.slideCount; 393 $(sliderCounter).text(currentSlide + ' / ' + slidesCount) 394 }; 395 396 gallery.on('init', function(event, slick) { 397 gallery.append(sliderCounter); 398 updateSliderCounter(slick); 399 }); 400 401 gallery.on('afterChange', function(event, slick, currentSlide) { 402 updateSliderCounter(slick, currentSlide); 403 }); 404 405 gallery.slick({ 406 infinite: false 407 }); 408 } 409 }, 'json'); 410 }); 411 412 $('.js-form-review').on('click', function (e) { 413 e.preventDefault(); 414 415 $('.modal-backdrop, .modal').remove(); 416 $('body').append('<div class="modal-backdrop fade show"></div>');
417 $('.modal-backdrop').after('<div class="modal show modal--review"></div>'); 418 $('body').addClass('modal-open'); 419 420 // let compiledTemplate = Template7.compile(template); 421 422 // let context = { 423 424 // }; 425 426 // let html = compiledTemplate(context); 427 428 $('.modal').append($('#form-review')); 429 $('#form-review').fadeIn(); 430 431 }); 432 433 $('.btn-form-feedback').on('click', function (e) { 434 e.preventDefault(); 435 436 $('.modal-backdrop, .modal').remove(); 437 $('body').append('<div class="modal-backdrop fade show"></div>'); 438 $('.modal-backdrop').after('<div class="modal show modal--feedback"></div>'); 439 $('body').addClass('modal-open'); 440 var date = new Date(); 441 var secondCur = date.getSeconds(); 442 if (String(date.getSeconds()).length == 1) { 443 secondCur = '0' + String(date.getSeconds()); 444 } 445 var curDate = date.getDate() + '.' + (date.getMonth()+1) + '.' + date.getFullYear() + ' ' + (date.getHours()+1) + ':' + date.getMinutes() + ':' + secondCur; 446 if ($_GET('strIMessage') != 'ÐаÑвка+ÑÑпеÑно+оÑпÑавлена') { 447 var html = $('#feedback').html(); 448 } 449 else { 450 var html = '<div class="modal__dialog"><div class="modal__content"><svg class="modal__close" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.1225 11.9998L23.5602 2.56205C24.1466 1.97619 24.1466 1.02562 23.5602 0.439766C22.9739 -0.146589 22.0243 -0.146589 21.438 0.439766L12.0002 9.87747L2.56205 0.439766C1.97569 -0.146589 1.02612 -0.146589 0.439766 0.439766C-0.146589 1.02562 -0.146589 1.97619 0.439766 2.56205L9.87797 11.9998L0.439766 21.4375C-0.146589 22.0233 -0.146589 22.9739 0.439766 23.5597C0.732943 23.8524 1.11717 23.999 1.50091 23.999C1.88464 23.999 2.26887 23.8524 2.56205 23.5592L12.0002 14.1215L21.438 23.5592C21.7311 23.8524 22.1154 23.999 22.4991 23.999C22.8828 23.999 23.2671 23.8524 23.5602 23.5592C24.1466 22.9734 24.1466 22.0228 23.5602 21.437L14.1225 11.9998Z"></path></svg><div class="modal__body"><h3>ÐаÑа заÑвка ÑÑпеÑно оÑпÑавлена</h3></div></div></div>'; 451 } 452 453 $('.modal').html(html); 454 $('.feedback-custom input.name-feedback').val(curDate); 455 456 $('[data-name="phone"]').inputmask({ 457 placeholder: "x" 458 }); 459 }); 460 461}); 462 463$(window).on('scroll', function () { 464 scrollTo = $(this).scrollTop(); 465 466 animateUpButton(); 467}); 468 469function animateUpButton() { 470 if(scrollTo >= 150) { 471 $('.btn-up').removeClass('rotate-out').addClass('rotate-in'); 472 $('.btn-up').addClass('visible'); 473 } 474 else { 475 $('.btn-up').removeClass('rotate-in').addClass('rotate-out'); 476 $('.btn-up').removeClass('visible'); 477 } 478} 479 480function openModal() { 481 $('.modal-backdrop, .modal').remove(); 482 $('body').append('<div class="modal-backdrop fade show"></div>'); 483 $('.modal-backdrop').after('<div class="modal show sberbank-modal"></div>'); 484 $('body').addClass('modal-open'); 485 486 let htmlModal = `<div class="modal__dialog"> 487 <div class="modal__content"> 488 <svg class="modal__close" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> 489 <path d="M14.1225 11.9998L23.5602 2.56205C24.1466 1.97619 24.1466 1.02562 23.5602 0.439766C22.9739 -0.146589 22.0243 -0.146589 21.438 0.439766L12.0002 9.87747L2.56205 0.439766C1.97569 -0.146589 1.02612 -0.146589 0.439766 0.439766C-0.146589 1.02562 -0.146589 1.97619 0.439766 2.56205L9.87797 11.9998L0.439766 21.4375C-0.146589 22.0233 -0.146589 22.9739 0.439766 23.5597C0.732943 23.8524 1.11717 23.999 1.50091 23.999C1.88464 23.999 2.26887 23.8524 2.56205 23.5592L12.0002 14.1215L21.438 23.5592C21.7311 23.8524 22.1154 23.999 22.4991 23.999C22.8828 23.999 23.2671 23.8524 23.5602 23.5592C24.1466 22.9734 24.1466 22.0228 23.5602 21.437L14.1225 11.9998Z" /> 490 </svg> 491 <div class="modal__body"> 492 <h2>СвободнÑй плаÑÑж</h2> 493 <p class="modal__descr">ÐаполниÑе ÑоÑÐ¼Ñ Ð½Ð¸Ð¶Ðµ, внимаÑелÑно заполнÑÑ Ð²Ñе Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе полÑ. 494 Ð ÑеÑение Ð´Ð½Ñ Ñ Ð²Ð°Ð¼Ð¸ ÑвÑжÑÑÑÑ Ð½Ð°Ñи менеджеÑÑ Ð´Ð»Ñ ÐºÐ¾Ð½ÑÑлÑÑаÑии. </p> 495 <p class="modal__clarification">ÐведиÑе даннÑе заказÑика ÑÑÑа. Ðни Ð´Ð¾Ð»Ð¶Ð½Ñ ÑовпадаÑÑ Ñ Ð´Ð°Ð½Ð½Ñми деÑжаÑÐµÐ»Ñ ÐºÐ°ÑÑÑ</p> 496 <form class="form" method="post"> 497 <div> 498 <div> 499 <div class="form-group"> 500 <input id="name" type="text" placeholder="ФÐÐ *" class="form-control" /> 501 </div> 502 <div class="form-group"> 503 <input id="email" type="email" placeholder="E-mail *" class="form-control" /> 504 </div> 505 <div class="form-group"> 506 <div class="input-group"> 507 <input id="sum" type="text" placeholder="СÑмма *" class="form-control sum" /> 508 <div class="input-group-append">RUB</div> 509 </div> 510 </div> 511 </div> 512 <div> 513 <div class="form-group"> 514 <input id="phone" type="text" placeholder="ТелеÑон *" class="form-control" data-name="phone" data-inputmask="'mask': '+7 (999) 999-99-99'" placeholder="+7 (xxx) xxx-xx-xx" /> 515 </div> 516 <div class="form-group pay-or-date">
517 <input id="pay" type="text" placeholder="ÐазнаÑение плаÑежа *" class="form-control" /> 518 </div> 519 <div class="form-group"> 520 <input id="comment" type="text" placeholder="ÐомменÑаÑий *" class="form-control" /> 521 </div> 522 </div> 523 <div> 524 <label class="checkbox" for="checkbox-success"><input type="checkbox" id="checkbox-success"><span>СоглаÑен Ñ <a target="_blank" href="/privacy/file.pdf" >положением об обÑабоÑке пеÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ </a> и Ð´Ð°Ñ ÑоглаÑие на обÑабоÑÐºÑ <a target="_blank" href="/policy/" >пеÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ </a></span></label> 525 </div> 526 </div> 527 </form> 528 <p class="avangard-text"></p> 529 <span class="btn btn-first btn-primary">Ðалее</span> 530 </div> 531 </div> 532 </div>`; 533 534 $('.modal').html(htmlModal); 535 536 $('[data-name="phone"]').inputmask({ 537 placeholder: "x" 538 }); 539} 540 541function closeModal() { 542 $('#form-review').fadeOut(); 543 $('body').append($('#form-review')); 544 $('.modal-backdrop, .modal').remove(); 545 $('body').removeClass('modal-open'); 546} 547 548function checkError(name, id, error, errorFormat) { 549 let regexPhone = /^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{7,10}$/, 550 regexEmail = /.+@.+\..+/i, 551 regexSum = /\d/; 552 553 $('.form-error', id.parents('.form-group')).remove(); 554 555 if(id.val() == '') { 556 id.addClass('error'); 557 id.parents('.form-group').append(`<div class="form-error">${error}</div>`); 558 } 559 else { 560 $('.form-error', id.parents('.form-group')).remove(); 561 562 if(name == 'name' || name == 'pay' || name == 'comment' || name == 'date') { 563 id.removeClass('error'); 564 } 565 566 // Phone 567 if(name == 'phone') { 568 if(regexPhone.test(id.val())) { 569 $('.form-error', id.parents('.form-group')).remove(); 570 id.removeClass('error'); 571 } 572 else { 573 $('.form-error', id.parents('.form-group')).text(errorFormat); 574 } 575 } 576 577 // Email 578 if(name == 'email') { 579 if(regexEmail.test(id.val())) { 580 $('.form-error', id.parents('.form-group')).remove(); 581 id.removeClass('error'); 582 } 583 else { 584 $('.form-error', id.parents('.form-group')).text(errorFormat); 585 } 586 } 587 588 // Email 589 if(name == 'sum') { 590 if(regexSum.test(id.val()) && id.val() >= 10) { 591 $('.form-error', id.parents('.form-group')).remove(); 592 id.removeClass('error'); 593 } 594 else if (id.val() < 10) { 595 id.parents('.form-group').append('<div class="form-error">СÑмма не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¼ÐµÐ½ÑÑе 10 ÑÑблей</div>'); 596 } 597 else { 598 $('.form-error', id.parents('.form-group')).text(errorFormat); 599 } 600 } 601 } 602} 603 604document.addEventListener('DOMContentLoaded', function () { 605 const container = document.getElementById('fabContainer'); 606 const mainBtn = document.getElementById('fabMainBtn'); 607 608 // ÐÑкÑÑÑие/закÑÑÑие по ÐºÐ»Ð¸ÐºÑ Ð½Ð° главнÑÑ ÐºÐ½Ð¾Ð¿ÐºÑ 609 mainBtn.addEventListener('click', function (e) { 610 e.stopPropagation(); 611 container.classList.toggle('active'); 612 }); 613 614 // ÐакÑÑÑие пÑи клике в пÑÑÑÑÑ Ð¾Ð±Ð»Ð°ÑÑÑ ÑкÑана 615 document.addEventListener('click', function (e) { 616 if (!container.contains(e.target)) { 617 container.classList.remove('active'); 618 } 619 }); 620}); 621
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.