1; (function (document) { 2 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', BindEvents); } else { BindEvents(); } 3 4 function BindEvents() { 5 window.PubSub.subscribe("add_to_cart", function (url) { 6 trackEvent("addToCart"); 7 }); 8 9 window.PubSub.subscribe("buy_one_click_pre", function () { 10 trackEvent("buyOneClickForm"); 11 }); 12 13 window.PubSub.subscribe("buy_one_click_confirm", function () { 14 trackEvent("buyOneClickConfirm"); 15 }); 16 17 window.PubSub.subscribe("compare.add", function () { 18 trackEvent("addToCompare"); 19 }); 20 21 window.PubSub.subscribe("add_to_wishlist", function () { 22 trackEvent("addToWishlist"); 23 }); 24 25 window.PubSub.subscribe("send_feedback", function () { 26 trackEvent("sendFeedback"); 27 }); 28 29 window.PubSub.subscribe("send_preorder", function () { 30 trackEvent("sendPreOrder"); 31 }); 32 33 window.PubSub.subscribe("add_response", function () { 34 trackEvent("addResponse"); 35 }); 36 37 window.PubSub.subscribe("callback", function () { 38 trackEvent("callBack"); 39 }); 40 41 window.PubSub.subscribe("callback_request", function () { 42 trackEvent("callBackRequest"); 43 }); 44 45 window.PubSub.subscribe("module_callback", function () { 46 trackEvent("getCallBack"); 47 }); 48 49 window.PubSub.subscribe("subscribe.email", function () { 50 trackEvent("subscribeNews"); 51 }); 52 53 window.PubSub.subscribe("user.registration", function () { 54 trackEvent("userRegistration"); 55 }); 56 57 window.PubSub.subscribe("order_from_mobile", function () { 58 trackEvent("orderFromMobile"); 59 }); 60 61 // Send event 62 function trackEvent(target) { 63 try { 64 var counterId = $(".yacounterid").attr("data-counterId"); 65 var yaCounter = window["yaCounter" + counterId]; 66 yaCounter.reachGoal(target); 67 } catch (err) { 68 } 69 }; 70 71 72 window.PubSub.subscribe("cart.add", function (offerId, productId, amount, attributesXml, cartId) { 73 74 var dataCnt = $("[data-yametrika-datacnt]").attr("data-yametrika-datacnt"); 75 if (dataCnt == null || window[dataCnt] == null) { 76 return false; 77 } 78 79 $.ajax({
80 type: 'GET', 81 async: false, 82 dataType: 'json', 83 url: 'yametrika/getproductbyid?offerId=' + offerId + "&productId=" + productId + "&cartId=" + cartId, 84 success: function (data) { 85 if (data != null && data.artno != null) { 86 window[dataCnt].push({ 87 "ecommerce": { 88 "add": { 89 "products": [{ "id": data.artno, "name": data.name, "price": data.price, "brand": data.brand, "category": data.category, "quantity": amount || data.amount }] 90 } 91 } 92 }); 93 } 94 } 95 }); 96 }); 97 98 window.PubSub.subscribe("cart.remove", function (offerId) { 99 var dataCnt = $("[data-yametrika-datacnt]").attr("data-yametrika-datacnt"); 100 if (dataCnt == null || window[dataCnt] == null) { 101 return false; 102 } 103 104 $.ajax({
105 type: 'GET', 106 async: false, 107 dataType: 'json', 108 url: 'yametrika/getproductbyofferid?offerid=' + offerId, 109 success: function (data) { 110 if (data != null && data.artno != null) { 111 window[dataCnt].push({ 112 "ecommerce": { 113 "remove": { 114 "products": [{ "id": data.artno, "name": data.name }] 115 } 116 } 117 }); 118 } 119 } 120 }); 121 }); 122 }; 123})(document);
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.