1ACC.assistedservicepromotion = { 2 bindAll: function () 3 { 4 $(document).on("click",".asm-customer360-promotions-addToCart",function(e){ 5 ACC.assistedservicepromotion.handleCouponToCartAction("apply",this,"Failed to Apply to cart"); 6 }); 7 $(document).on("click",".asm-customer360-promotions-removefromCart-remove",function(e){ 8 ACC.assistedservicepromotion.handleCouponToCartAction("remove",this,"Failed to remove from cart"); 9 }); 10 }, 11 12 handleCouponToCartAction: function (couponToCartAction, element, errorMsg ) 13 { 14 var index = $(element).attr('data-index'); 15 var params ={ 16 CSRFToken:ACC.config.CSRFToken, 17 voucherCode:"csa_coupon_"+$(element).attr('data-coupon') 18 }; 19 var couponUrl = ACC.config.encodedContextPath + "/cart/voucher/" + couponToCartAction; 20 21 return $.ajax({ 22 url : couponUrl, 23 type : "POST", 24 data : params, 25 success : function(data) { 26 var cssClassToToggle = 'hidden'; 27 $('.asm-customer360-promotions-addToCart[data-index='+index+']').toggleClass(cssClassToToggle); 28 $('.asm-customer360-promotions-removefromCart[data-index='+index+']').toggleClass(cssClassToToggle); 29 }, 30 error : function(xht, textStatus, ex) { 31 $(element).html(errorMsg); 32 } 33 }); 34 } 35}; 36 37$(document).ready(function () 38{ 39 ACC.assistedservicepromotion.bindAll(); 40});
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.