1/** 2 * Created by lynxoft on 20.04.2017. 3 */ 4$(document).ready(function() { 5 lx.cart.init(); 6}); 7function showBasketItemsList(val) 8{ 9 $("#basket_toolbar_button").removeClass("current"); 10 $("#basket_toolbar_button_delayed").removeClass("current"); 11 12 13 $("#normal_count").css('display', 'inline-block'); 14 $("#delay_count").css('display', 'inline-block'); 15 16 if (val == 2) 17 { 18 if ($("#basket_items_list")) 19 $("#basket_items_list").css('display', 'none'); 20 if ($(".setting-left-cell")) 21 $(".setting-left-cell").css('display', 'none'); 22 if ($("#order_form_container")) 23 $("#order_form_container").css('display', 'none'); 24 if ($("#basket_items_delayed")) 25 { 26 $("#basket_items_not_available").css('display', 'block'); 27 $("#basket_toolbar_button_delayed").addClass("current"); 28 $("#delay_count").css('display', 'none'); 29 } 30 } 31 else 32 { 33 if ($("#basket_items_list")) 34 { 35 $("#basket_items_list").css('display', 'block'); 36 $("#basket_toolbar_button").addClass("current"); 37 $("#normal_count").css('display', 'none'); 38 } 39 if ($(".setting-left-cell")) 40 $(".setting-left-cell").css('display', 'block'); 41 if ($("#order_form_container")) 42 $("#order_form_container").css('display', 'block'); 43 if ($("#basket_items_not_available")) 44 $("#basket_items_not_available").css('display', 'none'); 45 } 46} 47 48function recalcBasketAjax(params) 49{ 50 BX.showWait(); 51 52 var property_values = {}, 53 action_var = BX('action_var').value, 54 items = BX('basket_items'), 55 delayedItems = BX('delayed_items'), 56 postData, 57 i, 58 postDataDel; 59 60 postData = { 61 'sessid': BX.bitrix_sessid(), 62 'site_id': BX.message('SITE_ID'), 63 'props': property_values, 64 'action_var': action_var, 65 'select_props': BX('column_headers').value, 66 'offers_props': BX('offers_props').value, 67 'quantity_float': BX('quantity_float').value, 68 'count_discount_4_all_quantity': BX('count_discount_4_all_quantity').value, 69 'price_vat_show_value': BX('price_vat_show_value').value, 70 'hide_coupon': BX('hide_coupon').value, 71 'use_prepayment': BX('use_prepayment').value 72 }; 73 postDataDel = { 74 'action': 'delete' 75 }; 76 postData[action_var] = 'recalculate'; 77 if (!!params && typeof params === 'object') 78 { 79 for (i in params) 80 { 81 if (params.hasOwnProperty(i)) 82 postData[i] = params[i]; 83 } 84 } 85 //.setProcessing(true); 86 if (postDataDel.ID) 87 window.location.href = '/personal/cart/?action=delete&id='+postDataDel.ID; 88 BX.ajax({ 89 url: '/bitrix/components/bitrix/sale.basket.basket/ajax.php', 90 method: 'POST', 91 data: postData, 92 dataType: 'json', 93 onsuccess: function(result) 94 { 95 BX.closeWait(); 96 BX.reload(); 97 } 98 }); 99} 100 101function enterCoupon() 102{ 103 var newCoupon = BX('coupon'); 104 if (!!newCoupon && !!newCoupon.value) 105 recalcBasketAjax({'coupon' : newCoupon.value}); 106} 107 108function deleteCoupon(e) 109{ 110 var target = BX.proxy_context, 111 value; 112 113 if (!!target && target.hasAttribute('data-coupon')) 114 { 115 value = target.getAttribute('data-coupon'); 116 if (!!value && value.length > 0) 117 { 118 recalcBasketAjax({'delete_coupon' : value}); 119 } 120 } 121} 122 123BX.ready(function() { 124 var couponBlock; 125 couponBlock = BX('coupons_block'); 126 if (!!couponBlock) 127 BX.bindDelegate(couponBlock, 'click', { 'attribute': 'data-coupon' }, BX.delegate(function(e){deleteCoupon(e); }, this)); 128});
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.