1'use strict'; 2/** 3 * @param {(Object|string)} Node 4 * @param {!Object} obj 5 * @param {string} type 6 * @return {undefined} 7 */ 8function RSGoPro_PutJSon(Node, obj, type) { 9 console.log("node") 10 if ("OK" == Node.TYPE) { 11 if (type && type == Node.IDENTIFIER ? obj && Node.HTML.catalogajaxpages ? obj.parents(".js-ajaxpages").replaceWith(Node.HTML.catalogajaxpages) : obj && obj.parents(".js-ajaxpages").remove() : console.warn("PutJSon -> no ajaxpages"), Node.HTMLBYID) { 12 var name; 13 for (name in Node.HTMLBYID) { 14 if ($("#" + name)) { 15 16 if ("byClass" == Node.By) { 17 18 if ("append" == Node.METHOD) { 19 $("." + name).append(Node.HTMLBYID[name]); 20 } else { 21 $("." + name).html(Node.HTMLBYID[name]); 22 console.log($("." + name), Node.HTMLBYID[name]) 23 } 24 } 25 else { 26 if ("append" == Node.METHOD) { 27 $("#" + name).append(Node.HTMLBYID[name]); 28 } else { 29 $("#" + name).html(Node.HTMLBYID[name]); 30 } 31 } 32 33 } 34 } 35 } 36 if (Node.HTMLBYCLASS && type && type == Node.IDENTIFIER) { 37 for (name in Node.HTMLBYCLASS) { 38 var filterComponent = $("#" + type).find("." + name); 39 if (filterComponent) { 40 if ("append" == Node.METHOD) { 41 filterComponent.append(Node.HTMLBYCLASS[name]); 42 } else { 43 filterComponent.html(Node.HTMLBYCLASS[name]); 44 } 45 } 46 } 47 } 48 RSGoPro_SetSet(); 49 } else { 50 console.warn("PutJSon -> request return error"); 51 } 52} 53/** 54 * @param {!Object} d 55 * @param {string} cond 56 * @param {?} t 57 * @return {undefined} 58 */ 59function RSGoPro_Area2Darken(d, cond, t) { 60 var p1 = $.extend({ 61 progressLeft: false, 62 progressTop: false 63 }, t); 64 if (d.hasClass("areadarken")) { 65 d.removeClass("areadarken").removeAttr("style").find(".area2darken").remove(); 66 } else { 67 if ("absolute" != d.css("position") && "relative" != d.css("position")) { 68 d.css({ 69 position: "relative" 70 }); 71 } 72 d.addClass("areadarken").append('<div class="area2darken"></div>'); 73 if ("animashka" == cond) { 74 d.find(".area2darken").append('<i class="icon animashka"></i>'); 75 if (p1.progressTop) { 76 d.find(".animashka").css({ 77 top: p1.progressTop 78 }); 79 } 80 } 81 } 82} 83/** 84 * @return {undefined} 85 */ 86function RSGoPro_SetSet() { 87 RSGoPro_SetViewed(); 88 RSGoPro_SetCompared(); 89 RSGoPro_SetFavorite(); 90 RSGoPro_SetInBasket(); 91 RSGoPro_TIMER(); 92 rsGoProLazyInit(); 93} 94/** 95 * @return {undefined} 96 */ 97function RSGoPro_SetViewed() { 98 /** @type {string} */ 99 var ol_el = ".js-viewed-prod-count"; 100 /** @type {number} */ 101 var o = parseInt(Object.keys(RSGoPro_VIEWED).length); 102 $(ol_el).html(o); 103 if (0 < o) { 104 $(ol_el).addClass("js-more-than-zero"); 105 } else { 106 $(ol_el).removeClass("js-more-than-zero"); 107 } 108} 109/** 110 * @return {undefined} 111 */ 112function RSGoPro_SetCompared() { 113 /** @type {string} */ 114 var ol_el = ".js-compare-prod-count"; 115 /** @type {number} */ 116 var o = parseInt(Object.keys(RSGoPro_COMPARE).length); 117 for (var element_id in $(".js-add2compare").removeClass("in"), RSGoPro_COMPARE) { 118 if ("Y" == RSGoPro_COMPARE[element_id] && 0 < $(".js-elementid" + element_id).find(".js-add2compare").length) { 119 $(".js-elementid" + element_id).find(".js-add2compare").addClass("in"); 120 } 121 } 122 $(ol_el).html(o); 123 if (0 < o) { 124 $(ol_el).addClass("js-more-than-zero"); 125 } else { 126 $(ol_el).removeClass("js-more-than-zero"); 127 } 128} 129/** 130 * @return {undefined} 131 */ 132function RSGoPro_SetFavorite() { 133 /** @type {string} */ 134 var ol_el = ".js-favorite-prod-count"; 135 /** @type {number} */ 136 var o = parseInt(Object.keys(RSGoPro_FAVORITE).length); 137 for (var element_id in $(".js-add2favorite").removeClass("in"), RSGoPro_FAVORITE) { 138 if ("Y" == RSGoPro_FAVORITE[element_id] && 0 < $(".js-elementid" + element_id).find(".js-add2favorite").length) { 139 $(".js-elementid" + element_id).find(".js-add2favorite").addClass("in"); 140 } 141 } 142 $(ol_el).html(o); 143 if (0 < o) { 144 $(ol_el).addClass("js-more-than-zero"); 145 } else { 146 $(ol_el).removeClass("js-more-than-zero"); 147 } 148} 149/** 150 * @return {undefined} 151 */ 152function RSGoPro_SetInBasket() { 153 /** @type {string} */ 154 var ol_el = ".js-basket-prod-count"; 155 /** @type {number} */ 156 var o = parseInt(Object.keys(RSGoPro_INBASKET).length); 157 for (var element_id in $(".js-pay__form").removeClass("in"), RSGoPro_INBASKET) { 158 if ("Y" == RSGoPro_INBASKET[element_id] && 0 < $(".js-add2basketpid[value='" + element_id + "']").length) { 159 $('.js-add2basketpid[value="' + element_id + '"]').css("color", "red").parents(".js-pay__form").addClass("in"); 160 } 161 if (0 < parseInt(RSGoPro_INBASKET[element_id]) && 0 < $(".products").find(".js-add2basketform" + RSGoPro_INBASKET[element_id]).length) { 162 $(".js-add2basketform" + RSGoPro_INBASKET[element_id]).addClass("in"); 163 } 164 } 165 $(ol_el).html(o); 166 if (0 < o) { 167 $(ol_el).addClass("js-more-than-zero"); 168 } else { 169 $(ol_el).removeClass("js-more-than-zero"); 170 } 171 $(".js-basket-allsum-formated").html(RSGoPro_BASKET.allSum_FORMATED); 172} 173/** 174 * @return {undefined} 175 */ 176function RSGoPro_TIMER() { 177 $(".timer").timer({ 178 days: ".result-day", 179 hours: ".result-hour", 180 minute: ".result-minute", 181 second: ".result-second", 182 blockTime: ".val", 183 linePercent: ".progress", 184 textLinePercent: ".num_percent" 185 }); 186} 187/** 188 * @return {undefined} 189 */ 190function timerCanDelete() { 191} 192/** 193 * @return {undefined} 194 */
195function rsGoProLazyInit() { 196 $(".js-lazy-section").each(function () { 197 var $body = $(this); 198 var undoEl = $body.find(".lazy-animation"); 199 if ($body.hasClass("is-loading")) { 200 $body.find(".js-lazy").removeClass("js-lazy").addClass("js-lazy-sect"); 201 $body.find(".js-lazy-sect").lazy({ 202 onFinishedAll: function () { 203 $body.removeClass("is-loading"); 204 undoEl.removeClass("lazy-animation").fadeIn(500); 205 } 206 }); 207 } 208 }); 209 $(".js-lazy").Lazy({ 210 effect: "fadeIn", 211 effectTime: 500, 212 afterLoad: function (options) { 213 options.removeClass("lazy-animation"); 214 } 215 }); 216} 217/** 218 * @return {undefined} 219 */ 220function RSGoPro_InitMaskPhone() { 221 if (0 < $(".maskPhone").length) { 222 $(".maskPhone").mask(window.RSGoPro_PhoneMask); 223 } 224} 225/** 226 * @return {undefined} 227 */ 228function rsGoProToggleLockPageScroll() { 229 $("html").toggleClass("rsgopro-lockscroll"); 230} 231/** 232 * @return {undefined} 233 */ 234function rsGoProLockPageScroll() { 235 $("html").addClass("rsgopro-lockscroll"); 236} 237/** 238 * @return {undefined} 239 */ 240function rsGoProUnLockPageScroll() { 241 $("html").removeClass("rsgopro-lockscroll"); 242} 243!function ($) { 244 /** 245 * @param {?} animate 246 * @return {?} 247 */ 248 $.fn.setHtmlByUrl = function (animate) { 249 var obj = $.extend({ 250 url: "" 251 }, animate); 252 return this.each(function () { 253 if ("" != obj.url) { 254 var o = $(this); 255 $.ajax({ 256 type: "GET", 257 dataType: "html", 258 url: obj.url, 259 /* beforeSend : function() { 260 if ("localStorage" in window && null !== window.localStorage) { 261 return data = localStorage.getItem(obj.url), !data || (localStorage.setItem(obj.url, data), o.append(data), false); 262 } 263 }, */ 264 success: function (e) { 265 localStorage.setItem(obj.url, e); 266 o.append(e); 267 } 268 }); 269 } 270 }); 271 }; 272}(jQuery), $(document).on("rsGoPro.document.ready", function () { 273 $("html").addClass("rsgopro-document-ready"); 274 if (0 < $(".js-header-fly").length) { 275 setTimeout(function () { 276 $(".js-header-fly").addClass("document-ready"); 277 }, 50); 278 } 279 $(window).resize(BX.debounce(function () { 280 if ($(".catalogmenu2 li ul.first").height() < $(".aroundjssorslider1").height() && 100 < screen.width) { 281 $(".aroundjssorslider1").css("min-height", "auto"); 282 } 283 }, 100)); 284 BX.addCustomEvent("rs.location_change", function () { 285 BX.reload(); 286 }); 287 $(document).on("change", ".js-quantity", BX.debounce(function () { 288 289 if (0 < $(this).closest(".js-detail").length) { 290 var e = $(this).val(); 291 BX.onCustomEvent("rs_delivery_update", [0, e]); 292 } 293 294 $.ajax({ 295 type: 'POST', 296 data: {}, 297 url: '/ajax/getBasketInfo.php', 298 success: function (resultJSON) { 299 var result = JSON.parse(resultJSON); 300 301 302 var json = { 303 TYPE: "OK", 304 NUM_PRODUCTS: result["itemsInBasket"], 305 TOTAL_PRICE: result["totalPrice"] 306 }; 307 json.By = 'byClass'; 308 json.HTMLBYID = { "js-basketinfo": result["smallBasket"] }; 309 RSGoPro_PutJSon(json); 310 311 RSGoPro_BASKET.allSum_FORMATED = result["totalPrice"]; 312 RSGoPro_SetInBasket(); 313 314 } 315 }) 316 317 }, 250)); 318 rsGoProLazyInit(); 319 $(document).on("RSGoProOnOfferChange", function (canCreateDiscussions, cascadeRow) { 320 if (0 < $(cascadeRow).find(".timers").length && "N" == $(cascadeRow).find(".intimer").data("autoreuse")) { 321 /** @type {!Date} */ 322 var expiry = new Date; 323 /** @type {number} */ 324 expiry = Date.parse(expiry) / 1E3; 325 $(cascadeRow).find(".timer").data("datefrom"); 326 if ($(cascadeRow).find(".intimer").data("dateto") - expiry < 0) { 327 $(cascadeRow).find(".timers").css("display", "none"); 328 $(cascadeRow).removeClass("da2 qb"); 329 $(cascadeRow).find(".price").removeClass("new"); 330 } 331 } 332 BX.onCustomEvent("rs_delivery_update"); 333 }); 334 $(document).on("click", ".click_protection", function (event) { 335 return event.stopImmediatePropagation(), console.warn("Click protection"), false; 336 }); 337 $(document).on("click", "form .js-submit, form .submit", function () { 338 return $(this).parents("form").find('input[type="submit"]').trigger("click"), false; 339 }); 340 341 $(document).on("paste", ".ajax-quantity", function () { 342 return false;
343 }); 344 345 $(document).on('keypress', '.ajax-quantity', function (evt) { 346 var theEvent = evt || window.event; 347 var key = theEvent.keyCode || theEvent.which; 348 key = String.fromCharCode(key); 349 var regex = /[0-9]|\./; 350 if (!regex.test(key)) { 351 theEvent.returnValue = false; 352 if (theEvent.preventDefault) theEvent.preventDefault(); 353 } 354 return 0; 355 }); 356 357 $("body").on("click", ".openPopupNotice", function (e) { 358 open_dialog("popup-notice"); 359 return false; 360 } 361 ); 362 363let smartCaptchaLoading = null; 364 365function loadSmartCaptcha() { 366 if (window.smartCaptcha) { 367 return Promise.resolve(); 368 } 369 370 if (smartCaptchaLoading) { 371 return smartCaptchaLoading; 372 } 373 374 smartCaptchaLoading = new Promise(function (resolve, reject) { 375 376 window.rsGoProSmartCaptchaOnLoad = function () { 377 if (window.smartCaptcha) { 378 resolve(); 379 } else { 380 reject(new Error("SmartCaptcha не иниÑиализиÑована")); 381 } 382 }; 383 384 var script = document.createElement("script"); 385 386 script.src = 387 "https://smartcaptcha.cloud.yandex.ru/captcha.js" + 388 "?render=onload&onload=rsGoProSmartCaptchaOnLoad"; 389 390 script.async = true; 391 script.defer = true; 392 393 script.onerror = function () { 394 smartCaptchaLoading = null; 395 reject(new Error("Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ SmartCaptcha")); 396 }; 397 398 document.head.appendChild(script); 399 }); 400 401 return smartCaptchaLoading; 402} 403 404window.runSmartCaptchaGlobal = function(callback) { 405 406 loadSmartCaptcha().then(function() { 407 408 var container = document.querySelector(".js-smartcaptcha-container"); 409 410 if (!container) { 411 container = document.createElement("div"); 412 container.className = "js-smartcaptcha-container"; 413 document.body.appendChild(container); 414 } 415 416 var widgetId = container._smartCaptchaWidgetId; 417 418 if (widgetId === undefined) { 419 420 widgetId = window.smartCaptcha.render(container, { 421 sitekey: "ysc1_i0wO7BgsJGmhKlrTqeLYpUaxXn2XsORk1y0fB031b08cacd5", 422 invisible: true, 423 424 callback: function(token) { 425 426 if (!token) { 427 console.error("SmartCaptcha: Ñокен не полÑÑен"); 428 return; 429 } 430 431 callback(token); 432 } 433 }); 434 435 container._smartCaptchaWidgetId = widgetId; 436 437 } else { 438 window.smartCaptcha.reset(widgetId); 439 } 440 441 window.smartCaptcha.execute(widgetId); 442 443 }).catch(function(error) { 444 console.error("SmartCaptcha error:", error); 445 }); 446}; 447 448function runSmartCaptcha(form, submitter) { 449 450 return loadSmartCaptcha().then(function () { 451 452 var captchaContainer = form.querySelector(".js-smartcaptcha-container"); 453 454 if (!captchaContainer) { 455 captchaContainer = document.createElement("div"); 456 457 captchaContainer.className = "js-smartcaptcha-container"; 458 459 form.appendChild(captchaContainer); 460 } 461 462 var widgetId = window.smartCaptcha.render(captchaContainer, { 463 sitekey: "ysc1_i0wO7BgsJGmhKlrTqeLYpUaxXn2XsORk1y0fB031b08cacd5", 464 invisible: true, 465 466 callback: function (token) { 467 468 if (!token) { 469 console.error("SmartCaptcha: token не полÑÑен"); 470 return; 471 } 472 473 var responseInput = form.querySelector( 474 'input[name="recaptcha_response"]' 475 ); 476 477 if (responseInput) { 478 responseInput.value = token; 479 } 480 481 form.dataset.smartCaptchaPassed = "1"; 482 483 if (submitter) { 484 submitter.click(); 485 } else { 486 form.requestSubmit(); 487 } 488 } 489 }); 490 491 window.smartCaptcha.execute(widgetId); 492 }); 493} 494 495$(document).on("submit.smartCaptcha", "form", function (event) { 496 497 var form = this; 498 499 /* 500 * ÐÑли CAPTCHA Ñже пÑойдена, 501 * пÑопÑÑкаем повÑоÑнÑй submit. 502 */ 503 if (form.dataset.smartCaptchaPassed === "1") { 504 delete form.dataset.smartCaptchaPassed; 505 return true; 506 } 507 508 /* 509 * CAPTCHA нÑжна ÑолÑко ÑоÑмам, 510 * в коÑоÑÑÑ ÐµÑÑÑ Ð¿Ð¾Ð»Ðµ recaptcha_response. 511 * 512 * ÐÑли Ñ ÑоÑÐ¼Ñ Ñакого Ð¿Ð¾Ð»Ñ Ð½ÐµÑ â 513 * вообÑе ниÑего не делаем. 514 */ 515 var responseInput = form.querySelector( 516 'input[name="recaptcha_response"]' 517 ); 518 519 if (!responseInput) { 520 return true; 521 } 522 523 event.preventDefault(); 524 525 var submitter = event.originalEvent 526 ? event.originalEvent.submitter 527 : null; 528 529 runSmartCaptcha(form, submitter) 530 .catch(function (error) { 531 console.error("SmartCaptcha error:", error); 532 }); 533 534 return false;
535}); 536 537 $(document).ready(function () { 538 539 document.querySelectorAll(".ruble-png").forEach((el) => { 540 el.addEventListener("mouseover", (e) => { 541 e.target.parentElement.parentElement.parentElement.querySelector(".delivery-cost-modal").style.display = "flex"; 542 }); 543 }); 544 document.querySelectorAll(".ruble-png").forEach((el) => { 545 el.addEventListener("mouseout", (e) => { 546 e.target.parentElement.parentElement.parentElement.querySelector(".delivery-cost-modal").style.display = "none"; 547 }); 548 }); 549 var getParams = window.location.search.replace('?', '').split('&').reduce( 550 function (p, e) { 551 var a = e.split('='); 552 p[decodeURIComponent(a[0])] = decodeURIComponent(a[1]); 553 return p; 554 }, 555 {}); 556 let feedback = document.querySelector(".feedback"); 557 let recall = document.querySelector(".recall"); 558 if (getParams["open_popup_feedback"] === "Y") { 559 $(feedback).delay(1200).queue(function () { 560 feedback.click(); 561 }); 562 } 563 else if (getParams["open_popup_recall"] === "Y") { 564 $(recall).delay(1200).queue(function () { 565 recall.click(); 566 }); 567 } 568 else { 569 $.ajax({ 570 type: 'POST', 571 url: '/ajax/openPopupNotice.php', 572 success: function (data) { 573 //ÐÑли полÑзоваÑÐµÐ»Ñ Ð½Ðµ авÑоÑизован и не полÑÑал Ñведомление: 574 if (data == false) { 575 $(".openPopupNotice").delay(1200).queue(function () { 576 $(this).trigger("click"); 577 }); 578 } 579 //ÐнаÑе оÑпÑавлÑем его ID в ÑндекÑ.меÑÑÐ¸ÐºÑ 580 else { 581 if (ga !== undefined) { 582 if (data > 1) { 583 ga('create', 'UA-164785626-1', 'auto', { 584 userId: data 585 }); 586 ga('send', 'pageview'); 587 588 ga(function (tracker) { 589 var clientId = tracker.get('clientId'); 590 ym(49737763, 'params', { 591 "ID полÑзоваÑÐµÐ»Ñ Ð² 1С-ÐиÑÑикÑ": data, 592 "Google ClientID полÑзоваÑелÑ": clientId 593 }); 594 if (clientId) { 595 $.ajax({ 596 type: 'POST', 597 url: '/ajax/setGoogleClientID.php', 598 data: { clientID: clientId }, 599 success: function (data) { 600 if (!data) { 601 console.error("Error, cannot save user clientID in hl-block"); 602 } 603 } 604 }); 605 } 606 }); 607 } 608 } 609 } 610 } 611 }); 612 } 613 }); 614 615 function open_dialog(el) { 616 var wind = $('.' + el); 617 var bg = $('.popup-background'); 618 wind.show(); 619 bg.show().click(function () { 620 jQuery('.wind_bg, .wind_sputnik').hide(); 621 var errors = $(".errors"); 622 var errorInput = $("input"); 623 for (var i = 0; i < errors.length; i++) { 624 if ($(errors[i]).parents('.form_acc').length > 0) 625 continue; 626 else 627 $(errors[i]).empty(); 628 } 629 for (var i = 0; i < errorInput.length; i++) { 630 if ($(errorInput[i]).parents('.form_acc').length > 0 || !$(errorInput[i]).hasClass("error")) 631 continue; 632 else 633 $(errorInput[i]).removeClass('error'); 634 } 635 }); 636 } 637 638 $('.popup-close').click(function () { 639 jQuery('.popup-background, .popup-notice, .popup-notice-request').hide(); 640 return false;
641 }); 642 643 644 $(document).on('change', '.ajax-quantity', function (e) { 645 646 // in your click function, call clearTimeout 647 window.clearTimeout(window.updateQuantityTimeout); 648 649 // then call setTimeout again to reset the timer 650 //timeoutHandle = window.setTimeout(...); 651 652 653 var form = $(this); 654 console.log("la", form) 655 var oldValue = form.attr("old-value"); 656 var operation = "assign"; 657 var quantity = parseInt($(this).val()); 658 var elementId = parseInt($(this).parents(".js-element").data("productid")); 659 var e = $(this).closest(".c-quantity"); 660 var container = $(this).closest('.js-element'); 661 var thisBlock = $(this).closest(".b-pay__quantity"); 662 663 window.updateQuantityTimeout = setTimeout(function () { 664 RSGoPro_Area2Darken(e); 665 RSGoPro_Area2Darken($("#header").find(".basketinhead")); 666 $.ajax({ 667 type: 'POST', 668 data: { id: elementId, operation: operation, quantity: quantity }, 669 url: '/ajax/changeQuantity.php', 670 success: function (resultJSON) { 671 var result = JSON.parse(resultJSON); 672 switch (result["success"]) { 673 case 'N': 674 console.error(result["message"]); 675 break; 676 case 'Y': 677 let recordInSmallBasket = $("[name='QUANTITY_" + result["item"]["ID"] + "']"); 678 if (recordInSmallBasket.length == 1) { 679 recordInSmallBasket.val(result["item"]["QUANTITY"]); 680 $("#refreshSmallBasket").click(); 681 } 682 if (result["content"] != "") { 683 delete RSGoPro_INBASKET[elementId]; 684 thisBlock.replaceWith(result["content"]); 685 } 686 RSGoPro_BASKET.allSum_FORMATED = result["totalPrice"]; 687 RSGoPro_SetInBasket(); 688 if (result["quantityOverload"].toString() === "Y") { 689 quantity = result["availableQuantity"]; 690 $(form).val(quantity); 691 $('#amount-' + elementId).html('РналиÑии: ' + quantity + ' ÑÑ. '); 692 } 693 var json = { 694 TYPE: "OK", 695 NUM_PRODUCTS: result["itemsInBasket"], 696 TOTAL_PRICE: result["totalPrice"] 697 }; 698 json.By = 'byClass'; 699 json.HTMLBYID = { "js-basketinfo": result["smallBasket"] }; 700 701 RSGoPro_PutJSon(json); 702 BX.onCustomEvent("rs.gopro.after.changeQuantity", [{ 703 elementId: result["item"]["ID"] 704 }]); 705 if (oldValue && oldValue < quantity) { 706 $.ajax({ 707 type: 'POST', 708 url: '/ajax/getProductDataForYandexMetrica.php', 709 data: { productID: elementId }, 710 success: function (data) { 711 data = JSON.parse(data); 712 if (data["SUCCESS"] == "Y") { 713 var yaQuantity = quantity - oldValue; 714 window.dataLayer = window.dataLayer || []; 715 dataLayer.push({ 716 "ecommerce": { 717 "add": { 718 "products": [ 719 { 720 "id": data["ID"], 721 "name": data["NAME"], 722 "price": data["PRICE"], 723 "quantity": yaQuantity 724 } 725 ] 726 } 727 } 728 }); 729 } 730 else { 731 console.error(data["MESSAGE"]); 732 } 733 } 734 }); 735 } 736 else { 737 $.ajax({ 738 type: 'POST', 739 url: '/ajax/getProductDataForYandexMetrica.php', 740 data: { productID: elementId }, 741 success: function (data) { 742 data = JSON.parse(data); 743 if (data["SUCCESS"] == "Y") { 744 var yaQuantity = oldValue - quantity; 745 window.dataLayer = window.dataLayer || []; 746 dataLayer.push({ 747 "ecommerce": { 748 "remove": { 749 "products": [ 750 { 751 "id": data["ID"], 752 "name": data["NAME"], 753 "quantity": yaQuantity 754 } 755 ] 756 } 757 } 758 }); 759 } 760 else { 761 console.error(data["MESSAGE"]); 762 } 763 } 764 }); 765 } 766 form.attr("old-value", quantity); 767 break; 768 default: 769 console.warn("add2basket - can't change quantity"); 770 break; 771 } 772 RSGoPro_Area2Darken(e); 773 RSGoPro_Area2Darken($("#header").find(".basketinhead")); 774 } 775 }); 776 }, 1000); 777 return false;
778 }); 779 780 781 $(document).on("submit", ".js-pay__form", function () { 782 var e = $(this); 783 /** @type {number} */ 784 var j = parseInt(e.find(".js-add2basketpid").val()); 785 var config = e.parents(".js-element").data("detail"); 786 if (0 < j) { 787 BX.onCustomEvent("rs.gopro.before.add2basket", [{ 788 elementId: j 789 }]); 790 config = config + "?" + $(this).serialize() + "&AJAX_CALL=Y&" + rsGoProActionVariableName + "=add2basket"; 791 RSGoPro_Area2Darken(e); 792 RSGoPro_Area2Darken($("#header").find(".basketinhead")); 793 $.getJSON(config, {}, function (self) { 794 if ("OK" == self.TYPE) { 795 /** @type {string} */ 796 RSGoPro_INBASKET[j] = "Y"; 797 RSGoPro_BASKET.allSum_FORMATED = self.TOTAL_PRICE; 798 RSGoPro_SetInBasket(); 799 RSGoPro_PutJSon(self); 800 BX.onCustomEvent("rs.gopro.after.add2basket", [{ 801 elementId: j 802 }]); 803 $.ajax({ 804 type: 'POST', 805 url: '/ajax/getProductDataForYandexMetrica.php', 806 data: { productID: j }, 807 success: function (data) { 808 data = JSON.parse(data); 809 if (data["SUCCESS"] == "Y") { 810 window.dataLayer = window.dataLayer || []; 811 dataLayer.push({ 812 "ecommerce": { 813 "add": { 814 "products": [ 815 { 816 "id": data["ID"], 817 "name": data["NAME"], 818 "price": data["PRICE"], 819 "quantity": 1 820 } 821 ] 822 } 823 } 824 }); 825 } 826 else { 827 console.error(data["MESSAGE"]); 828 } 829 } 830 }); 831 $.ajax({ 832 type: 'POST', 833 url: '/ajax/getProductIdInBasket.php', 834 data: { productID: j }, 835 success: function (result) { 836 result = JSON.parse(result); 837 var container = e.closest('.js-element'); 838 e.closest(".b-pay").replaceWith("<span class=\"b-pay__quantity\">\n" + 839 "<input type=\"hidden\" name=\"id\" class=\"js-add2basketpid\" value=\"" + j + "\">" + 840 "<span class=\"c-quantity\">\n" + 841 "<span class=\"c-quantity__inner\">\n" + 842 "<a class=\"c-quantity__minus js-minus ajax_change\"></a>\n" + 843 "<input type=\"text\" class=\"c-quantity__value js-quantity ajax-quantity\" data-qProductid=\"" + result['id'] + "\" data-product-id=\"" + j + "\" data-available-quantity=\"" + result['quantity'] + "\" name=\"quantity\" value=\"1\" data-ratio=\"1\" old-value='1'>\n" + 844 "<span class=\"c-quantity__measure js-measurename\">ÑÑ.</span>\n" + 845 "<a class=\"c-quantity__plus js-plus ajax_change\"></a>\n" + 846 "</span>\n" + 847 "</span>\n" + 848 "</span>"); 849 RSGoPro_Area2Darken(e); 850 RSGoPro_Area2Darken($("#header").find(".basketinhead")); 851 } 852 }); 853 } else { 854 if ("ERROR" == self.TYPE && self.MESSAGE) { 855 alert(self.MESSAGE); 856 } else { 857 console.warn("add2basket - error responsed"); 858 } 859 } 860 }).fail(function (canCreateDiscussions) { 861 console.warn("add2basket - can't load json"); 862 }); 863 } else { 864 console.warn("add product to basket failed"); 865 } 866 return false;
867 }); 868 869 870 $(document).on("click", ".js-add2compare", function () { 871 var $subHeader = $(this); 872 /** @type {number} */ 873 var j = parseInt($subHeader.parents(".js-element").data("elementid")); 874 /** @type {string} */ 875 var th_field = ""; 876 var key = $subHeader.parents(".js-element").data("detail"); 877 if (0 < j) { 878 BX.onCustomEvent("rs.gopro.before.add2compare", [{ 879 elementId: j 880 }]); 881 RSGoPro_Area2Darken($(".js-add2compare")); 882 /** @type {string} */ 883 th_field = "Y" == RSGoPro_COMPARE[j] ? "DELETE_FROM_COMPARE_LIST" : "ADD_TO_COMPARE_LIST"; 884 /** @type {string} */ 885 key = key + "?AJAX_CALL=Y&" + rsGoProActionVariableName + "=" + th_field + "&" + rsGoProProductIdVariableName + "=" + j; 886 $.getJSON(key, {}, function (Node) { 887 if ("OK" == Node.TYPE) { 888 RSGoPro_PutJSon(Node); 889 if ("DELETE_FROM_COMPARE_LIST" == th_field) { 890 delete RSGoPro_COMPARE[j]; 891 } else { 892 /** @type {string} */ 893 RSGoPro_COMPARE[j] = "Y"; 894 } 895 BX.onCustomEvent("rs.gopro.after.add2compare", [{ 896 elementId: j 897 }]); 898 } else { 899 console.warn("compare - error responsed"); 900 } 901 }).fail(function (canCreateDiscussions) { 902 console.warn("compare - fail request"); 903 }).always(function () { 904 RSGoPro_Area2Darken($(".js-add2compare")); 905 RSGoPro_SetCompared(); 906 }); 907 } 908 return false; 909 }); 910 $(document).on("click", ".js-add2favorite", function () { 911 var $subHeader = $(this); 912 /** @type {number} */ 913 var id = parseInt($subHeader.parents(".js-element").data("elementid")); 914 var url = $subHeader.parents(".js-element").data("detail"); 915 if (0 < id) { 916 BX.onCustomEvent("rs.gopro.before.add2favorite", [{ 917 elementId: id 918 }]); 919 RSGoPro_Area2Darken($(".js-add2favorite")); 920 /** @type {string} */ 921 url = url + "?AJAX_CALL=Y&" + rsGoProActionVariableName + "=add2favorite&" + rsGoProProductIdVariableName + "=" + id; 922 $.getJSON(url, {}, function (Node) { 923 if ("OK" == Node.TYPE) { 924 RSGoPro_PutJSon(Node); 925 if ("Y" == RSGoPro_FAVORITE[id]) { 926 delete RSGoPro_FAVORITE[id]; 927 } else { 928 /** @type {string} */ 929 RSGoPro_FAVORITE[id] = "Y"; 930 } 931 BX.onCustomEvent("rs.gopro.after.add2favorite", [{ 932 elementId: id 933 }]); 934 } else { 935 console.warn("favorite - error responsed"); 936 } 937 }).fail(function (canCreateDiscussions) { 938 console.warn("favorite - fail request"); 939 }).always(function () { 940 RSGoPro_Area2Darken($(".js-add2favorite")); 941 RSGoPro_SetFavorite(); 942 }); 943 } 944 return false; 945 }); 946 947 //ÐÑи нажаÑии на кнопки ÑвелиÑÐµÐ½Ð¸Ñ ÐºÐ¾Ð»Ð¸ÑеÑÑва - ÑикÑиÑÑем ÑÑо в ÑÐ½Ð´ÐµÐºÑ ÐºÐ¾Ð¼Ð¼ÐµÑÑии: 948 $(document).on('click', '.rsec_plus', function () { 949 var prev_form = $(this); 950 var targetElement = prev_form.parent().find(".rsec_quantity__input"); 951 targetElement.trigger("change"); 952 }); 953 $(document).on('click', '.rsec_minus', function () { 954 var prev_form = $(this); 955 var targetElement = prev_form.parent().find(".rsec_quantity__input"); 956 targetElement.trigger("change"); 957 }); 958 959 //ÐобавиÑÑ Ð´Ð°Ð½Ð½Ñе в ÑндекÑ-коммеÑÑÐ¸Ñ 960 $(document).on('change', '.rsec_quantity__input', function () { 961 var old_value = parseInt($(this).attr("old-value")); 962 var new_value = parseInt($(this).val()); 963 var id = $(this).attr("element-id"); 964 var price = $(this).attr("element-price"); 965 var name = $(this).attr("element-name"); 966 $(this).attr("old-value", new_value); 967 968 if (old_value != new_value) { 969 $.ajax({ 970 type: 'POST', 971 url: '/ajax/getProductIDFromBasketForYandexMetrica.php',
972 data: { basketID: id }, 973 success: function (data) { 974 data = JSON.parse(data); 975 if (data["SUCCESS"] == "Y") { 976 if (old_value && old_value < new_value) { 977 var yaQuantity = new_value - old_value; 978 window.dataLayer = window.dataLayer || []; 979 dataLayer.push({ 980 "ecommerce": { 981 "add": { 982 "products": [ 983 { 984 "id": data["PRODUCT_ID"], 985 "name": name, 986 "price": price, 987 "quantity": yaQuantity 988 } 989 ] 990 } 991 } 992 }); 993 } 994 else { 995 var yaQuantity = old_value - new_value; 996 window.dataLayer = window.dataLayer || []; 997 dataLayer.push({ 998 "ecommerce": { 999 "remove": { 1000 "products": [ 1001 { 1002 "id": data["PRODUCT_ID"], 1003 "name": name, 1004 "quantity": yaQuantity 1005 } 1006 ] 1007 } 1008 } 1009 }); 1010 } 1011 } 1012 else { 1013 console.error(data["MESSAGE"]); 1014 } 1015 } 1016 }); 1017 } 1018 }); 1019 1020 //ÐÑи Ñдалении ÑоваÑа из коÑÐ·Ð¸Ð½Ñ Ð¾Ð¿Ð¾Ð²ÐµÑаем Ñакже ÑндекÑ-коммеÑÑиÑ: 1021 $(document).on('click', '.small_basket_delete_item', function () { 1022 var id = $(this).attr("element-id"); 1023 var name = $(this).attr("element-name"); 1024 1025 1026 1027 setTimeout(function () { 1028 $.ajax({ 1029 type: 'POST', 1030 data: {}, 1031 url: '/ajax/getBasketInfo.php', 1032 success: function (resultJSON) { 1033 var result = JSON.parse(resultJSON); 1034 console.log(result) 1035 var json = { 1036 TYPE: "OK", 1037 NUM_PRODUCTS: result["itemsInBasket"], 1038 TOTAL_PRICE: result["totalPrice"] 1039 }; 1040 json.By = 'byClass'; 1041 json.HTMLBYID = { "js-basketinfo": result["smallBasket"] }; 1042 RSGoPro_PutJSon(json); 1043 RSGoPro_BASKET.allSum_FORMATED = result["totalPrice"]; 1044 RSGoPro_SetInBasket(); 1045 } 1046 }) 1047 }, 500); 1048 1049 $.ajax({ 1050 type: 'POST', 1051 url: '/ajax/getProductIDFromBasketForYandexMetrica.php',
1052 data: { basketID: id }, 1053 success: function (data) { 1054 data = JSON.parse(data); 1055 1056 if (data["SUCCESS"] == "Y") { 1057 window.dataLayer = window.dataLayer || []; 1058 dataLayer.push({ 1059 "ecommerce": { 1060 "remove": { 1061 "products": [ 1062 { 1063 "id": data["PRODUCT_ID"], 1064 "name": name, 1065 "quantity": data["QUANTITY"] 1066 } 1067 ] 1068 } 1069 } 1070 }); 1071 1072 1073 } 1074 else { 1075 console.error(data["MESSAGE"]); 1076 } 1077 } 1078 }); 1079 }); 1080 1081 //ÐÑи нажаÑии кнопки, ÑдалÑÑÑÐ°Ñ Ð²Ñе оÑмеÑеннÑе ÑоваÑÑ Ð¸Ð· коÑзинÑ, нÑжно оÑпÑавиÑÑ Ð´Ð°Ð½Ð½Ñе в ÑндекÑ-коммеÑÑиÑ: 1082 $(document).on('click', '.rsec_delsome', function () { 1083 var products = $(".rsec_table").find(".rsec_jsline"); 1084 var ids = []; 1085 for (var i = 0; i < products.length; i++) { 1086 if ($(products[i]).find('input:checkbox').is(':checked')) { 1087 ids.push($(products[i]).attr("data-id")); 1088 } 1089 } 1090 if (ids.length) { 1091 $.ajax({ 1092 type: 'POST', 1093 url: '/ajax/getDeleteItemsDataForYandexMetrica.php', 1094 data: { basketIDs: ids }, 1095 success: function (data) { 1096 data = JSON.parse(data); 1097 if (data["SUCCESS"] == "Y") { 1098 var products = []; 1099 for (var key in data["products"]) { 1100 products.push(data["products"][key]); 1101 } 1102 window.dataLayer = window.dataLayer || []; 1103 dataLayer.push({ 1104 "ecommerce": { 1105 "remove": { 1106 "products": products 1107 } 1108 } 1109 }); 1110 } 1111 else { 1112 console.error(data["MESSAGE"]); 1113 } 1114 } 1115 }); 1116 } 1117 }); 1118 1119 //ÐÑи нажаÑии кнопки, ÑдалÑÑÑÐ°Ñ Ð²Ñе оÑмеÑеннÑе ÑоваÑÑ Ð¸Ð· коÑзинÑ, нÑжно оÑпÑавиÑÑ Ð´Ð°Ð½Ð½Ñе в ÑндекÑ-коммеÑÑиÑ: 1120 $(document).on('click', '.rsec_delall', function () { 1121 var products = $(".rsec_table").find(".rsec_jsline"); 1122 var ids = []; 1123 for (var i = 0; i < products.length; i++) { 1124 ids.push($(products[i]).attr("data-id")); 1125 } 1126 if (ids.length) { 1127 $.ajax({ 1128 type: 'POST', 1129 url: '/ajax/getDeleteItemsDataForYandexMetrica.php', 1130 data: { basketIDs: ids }, 1131 success: function (data) { 1132 data = JSON.parse(data); 1133 if (data["SUCCESS"] == "Y") { 1134 var products = []; 1135 for (key in data["products"]) { 1136 products.push(data["products"][key]); 1137 } 1138 window.dataLayer = window.dataLayer || []; 1139 dataLayer.push({ 1140 "ecommerce": { 1141 "remove": { 1142 "products": products 1143 } 1144 } 1145 }); 1146 } 1147 else { 1148 console.error(data["MESSAGE"]); 1149 } 1150 } 1151 }); 1152 } 1153 }); 1154 1155 $(document).on("click", ".js-minus", function () { 1156 var prev_form = $(this); 1157 var targetElement = prev_form.parent().find(".js-quantity"); 1158 /** @type {number} */ 1159 var r = parseFloat(prev_form.parent().find(".js-quantity").data("ratio")); 1160 /** @type {string} */ 1161 var htmlcodearr = r.toString().split(".", 2)[1]; 1162 /** @type {number} */ 1163 var n = 0; 1164 /** @type {number} */ 1165 var x = parseFloat(targetElement.val()); 1166 if (targetElement.hasClass("ajax-quantity")) { 1167 return void 0 !== htmlcodearr && (n = htmlcodearr.length), r <= x && targetElement.val((x - r).toFixed(n)), targetElement.trigger("change"), false; 1168 } 1169 else { 1170 return void 0 !== htmlcodearr && (n = htmlcodearr.length), r < x && targetElement.val((x - r).toFixed(n)), targetElement.trigger("change"), false; 1171 } 1172 }); 1173 1174 $(document).on("click", ".js-plus", function () { 1175 var e = $(this).parent().find(".js-quantity"); 1176 /** @type {number} */ 1177 var min = parseFloat(e.data("ratio")); 1178 /** @type {string} */ 1179 var pasteBinClones = min.toString().split(".", 2)[1]; 1180 /** @type {number} */ 1181 var i = 0; 1182 /** @type {number} */ 1183 var max = parseFloat(e.val()); 1184 var productId = parseInt(e.data("product-id")); 1185 var availableQuantity = parseFloat(e.data("available-quantity")); 1186 if (availableQuantity > max) { 1187 return void 0 !== pasteBinClones && (i = pasteBinClones.length), e.val((max + min).toFixed(i)), e.trigger("change"), false; 1188 } else { 1189 $('#amount-' + productId).html('РналиÑии: ' + availableQuantity + ' ÑÑ. '); 1190 return false;
1191 } 1192 }); 1193 $(document).on("blur", ".js-quantity", function () { 1194 var $this = $(this); 1195 /** @type {number} */ 1196 var scale = parseFloat($this.data("ratio")); 1197 /** @type {string} */ 1198 var itemData = scale.toString().split(".", 2)[1]; 1199 /** @type {number} */ 1200 var item = 0; 1201 if (void 0 !== itemData) { 1202 /** @type {number} */ 1203 item = itemData.length; 1204 } 1205 /** @type {number} */ 1206 var maxx = parseFloat($this.val()); 1207 if (0 < maxx) { 1208 $this.val((scale * Math.floor(maxx / scale)).toFixed(item)); 1209 } else { 1210 $this.val(scale); 1211 } 1212 }); 1213 rsGoPro.options.owl.base = { 1214 autoHeight: false, 1215 nav: true, 1216 items: 1, 1217 dots: false, 1218 dotsData: false, 1219 margin: 20, 1220 responsive: {}, 1221 loop: true, 1222 onInitialized: function () { 1223 this.$element.addClass("owl-carousel"); 1224 if (this.$element.closest(".rs-gopro-popup").length) { 1225 $.fancybox.update(); 1226 } 1227 } 1228 }; 1229 $(".js-owl-slider").each(function () { 1230 $slider = $(this); 1231 $slider.owlCarousel($.extend({}, rsGoPro.options.owl.base)); 1232 }); 1233 rsGoPro.options.fancybox.popup = {}; 1234 rsGoPro.options.fancybox.bigPopup = {}; 1235 rsGoPro.options.fancybox.base = { 1236 infobar: false,
1237 buttons: false, 1238 slideShow: false, 1239 fullScreen: false, 1240 thumbs: false, 1241 closeBtn: false, 1242 closeTpl: '<a title="Close" data-fancybox-close class="fancybox-close" href="javascript:;"><svg class="svg-icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-close-button"></use></svg></a>', 1243 ajax: { 1244 settings: { 1245 data: { 1246 "x-fancybox": "y" 1247 } 1248 } 1249 }, 1250 touch: false, 1251 keyboard: true, 1252 beforeLoad: function () { 1253 BX.onCustomEvent("rs.gopro.fancybox.beforeLoad", [this]); 1254 RSGoPro_HideAllPopup(); 1255 }, 1256 afterLoad: function () { 1257 document.querySelector(".fancybox-close-small").addEventListener("click", (e)=>{ 1258 1259 }) 1260 var lines; 1261 var i; 1262 BX.onCustomEvent("rs.gopro.fancybox.afterLoad", [this]); 1263 var t = this.opts.$orig.attr("title") || this.opts.$orig.text(); 1264 if (t && this.$slide.children("div").prepend('<div class="fancybox-custom-title"><span>' + t + "</span></div>"), this.opts.$orig && this.opts.$orig.data("insertdata")) { 1265 for (i in lines = this.opts.$orig.data("insertdata")) { 1266 this.$slide.find('[name="' + i + '"]').val(lines[i]); 1267 } 1268 } 1269 setTimeout(function () { 1270 RSGoPro_InitMaskPhone(); 1271 }, 75); 1272 } 1273 }; 1274 rsGoPro.options.fancybox.popup = $.extend({}, rsGoPro.options.fancybox.base); 1275 /** @type {string} */ 1276 rsGoPro.options.fancybox.popup.baseClass = "rs-gopro-popup"; 1277 $(".fancyajax:not(.big)").on("click touchstart", function (canCreateDiscussions) { 1278 }).data({ 1279 type: "ajax" 1280 }).fancybox(rsGoPro.options.fancybox.popup); 1281 rsGoPro.options.fancybox.bigPopup = $.extend({}, rsGoPro.options.fancybox.base); 1282 /** @type {string} */ 1283 rsGoPro.options.fancybox.bigPopup.baseClass = "rs-gopro-popup"; 1284 $(".fancyajax.big").on("click touchstart", function (canCreateDiscussions) { 1285 }).data({ 1286 type: "ajax" 1287 }).fancybox(rsGoPro.options.fancybox.bigPopup); 1288 RSGoPro_InitMaskPhone(); 1289 $(document).on("focus blur", ".dropdown-block .bx-ui-sls-fake", function () { 1290 $(this).parents(".dropdown-block").toggleClass("focus"); 1291 }); 1292 $(document).on("click", ".js-element .js-product__unsubscribe", function (event) { 1293 event.preventDefault(); 1294 var editingEl = $(this); 1295 var document = $(this).closest(".js-element"); 1296 var id = document.data("elementid"); 1297 if (0 < parseInt(id)) { 1298 BX.onCustomEvent("rs.gopro.before.unsubscribe", [{ 1299 elementId: id 1300 }]); 1301 var requestOptions = { 1302 type: "POST", 1303 data: { 1304 sessid: BX.bitrix_sessid(), 1305 deleteSubscribe: "Y", 1306 itemId: id, 1307 listSubscribeId: 0 < editingEl.data("subscribe-id").length ? BX.parseJSON(editingEl.data("subscribe-id")) : [] 1308 }, 1309 url: "/bitrix/components/bitrix/catalog.product.subscribe.list/ajax.php", 1310 success: function (data) { 1311 if ((data = BX.parseJSON(data)).success) { 1312 document.remove(); 1313 BX.onCustomEvent("rs.gopro.after.unsubscribe", [{ 1314 elementId: id 1315 }]); 1316 } 1317 }, 1318 error: function () { 1319 console.error("deleteSubscribe - error responsed?"); 1320 }, 1321 complete: function () { 1322 RSGoPro_Area2Darken(document, "animashka"); 1323 } 1324 }; 1325 RSGoPro_Area2Darken(document, "animashka"); 1326 $.ajax(requestOptions); 1327 } else { 1328 console.warn("Product ID undefined"); 1329 } 1330 return false; 1331 }); 1332 $(document).on("focus blur", ".js-pseudo-focus-blur-input", function () { 1333 $(this).parents(".js-pseudo-focus-blur").toggleClass("js-pseudo-focus"); 1334 }); 1335 1336 $(document).on("click", ".js-easy-scroll", function (canCreateDiscussions) { 1337 var imageelement = $(this); 1338 var t = imageelement.attr("href"); 1339 var offset = imageelement.data("es-offset") ? imageelement.data("es-offset") : 0; 1340 return 0 != $(t).length && (0 < $('a[href="' + t + '"]').length && $('a[href="' + t + '"]').tab("show"), setTimeout(function () { 1341 $("html:not(:animated), body:not(:animated)").animate({ 1342 scrollTop: $(t).offset().top + offset 1343 }, { 1344 duration: 500, 1345 easing: "swing" 1346 }); 1347 }, 50)), false; 1348 }); 1349}), void 0 !== window.frameCacheVars ? BX.addCustomEvent("onFrameDataReceived", function (canCreateDiscussions) { 1350 $(document).trigger("rsGoPro.document.ready"); 1351}) : BX.ready(function () { 1352 $(document).trigger("rsGoPro.document.ready"); 1353 if (document.querySelector("div.subscribe")) { 1354 document.querySelector("div.subscribe").querySelector("form").addEventListener("submit", (e) => { 1355 console.log('Form is sent'); 1356 let rubricMatrix = { 1357 5: 'Aquarium', 1358 3: 'promo', 1359 2: 'info', 1360 4: 'New products and digests', 1361 14: 'Products_for_rodents_and_birds', 1362 13: 'Products_for_cats_and_dogs' 1363 } 1364 let formData = $(e.target).serializeArray(); 1365 let email = formData[6].value; 1366 let rubricInputs = []; 1367 for (let a in formData) { 1368 if (formData[a].name.includes('RUB_ID') && formData[a].value != 0) rubricInputs.push(formData[a].value); 1369 } 1370 let subscriptions = []; 1371 for (let i in rubricMatrix) { 1372 for (let b of rubricInputs) { 1373 if (i == b) { 1374 subscriptions.push({ 'pointOfContact': 'Email', "brand": "Aquanimal", 'topic': rubricMatrix[i], 'isSubscribed': 'true' }); 1375 } 1376 } 1377 } 1378 subscriptions.push({ 1379 'pointOfContact': 'Email', 1380 "brand": "Aquanimal", 1381 "isSubscribed": true 1382 }); 1383 $.ajax({ 1384 type: "POST", 1385 dataType: "html", 1386 url: '/ajax/unauthorizedSubscriptionUserData.php', 1387 data: { 1388 "customer": { "email": email } 1389 }, 1390 success: function (e) {
1391 if (JSON.parse(e).customer) { 1392 console.log(false); 1393 } else { 1394 mindbox('sync', { 1395 operation: 'PodpiskaBezRegistraciiVFutere', 1396 data: { 1397 customer: { 1398 email: email, 1399 subscriptions: 1400 subscriptions 1401 } 1402 } 1403 , 1404 onSuccess: function (response) { 1405 console.log(response); 1406 }, 1407 onError: function (response) { 1408 console.log(response); 1409 } 1410 }); 1411 }; 1412 } 1413 }); 1414 console.log(subscriptions); 1415 1416 }) 1417 }; 1418});
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.