1/** 2 * Advancedcms 3 * 4 * @category Module 5 * @author silbersaiten <[email protected]> 6 * @support silbersaiten <[email protected]> 7 * @copyright 2020 silbersaiten 8 * @version 1.3.56 9 * @link http://www.silbersaiten.de 10 * @license See joined file licence.txt 11 */ 12 13var AdvancedCmsBlockProductSlider = { 14 init: function () { 15 this.listeners(); 16 }, 17 listeners: function () { 18 if ($('.adcms-product-slider .bxslider li').length) { 19 this.activateBXSlider(); 20 } 21 22 $(document).on('click', '.ad_cms_product_slider_add_to_cart', function (e) { 23 e.preventDefault(); 24 AdvancedCmsBlockProductSlider.putIntoCart($(this)); 25 }); 26 }, 27 activateBXSlider: function () { 28 $('.adcms-product-slider .bxslider').each(function () { 29 $(this).bxSlider({ 30 minSlides: $(this).data('slidesToShow'), 31 maxSlides: 6, 32 responsive: true, 33 slideWidth: 10000, 34 pager: false, 35 nextText: '', 36 prevText: '', 37 moveSlides: 1, 38 infiniteLoop: false, 39 hideControlOnEnd: true 40 }); 41 }); 42 43 if ($('.advanced-cms-wrapper').hasClass('t17')) { 44 $('a.bx-prev').append('<span class="icon-prev" aria-hidden="true"><i class="material-icons"></i></span>'); 45 $('a.bx-next').append('<span class="icon-next" aria-hidden="true"><i class="material-icons"></i></span>'); 46 } 47 }, 48 putIntoCart: function (el) { 49 var container = el.closest('form'); 50 var actionURL = prestashop.urls.pages.cart; 51 var data = { 52 id_product: container.find('[name=id_product]').val(), 53 id_product_attribute: container.find('[name=id_product_attribute]').val(), 54 id_customization: 0, 55 ajax: 1, 56 token: container.find('[name=token]').val(), 57 action: 'update', 58 qty: container.find('[name=qty]').val(), 59 add: 1 60 }; 61 62 $.post(actionURL, data, null, 'json') 63 .then(function (resp) { 64 if (resp.hasError) { 65 prestashop.emit('handleError', {eventType: 'updateShoppingCart', resp: resp}); 66 var error_list = resp.errors.map(function (item) { 67 return item + '<br>'; 68 }); 69 $.growl.error({message: error_list}); 70 } else { 71 prestashop.emit('updateCart', { 72 reason: { 73 idProduct: data.id_product, 74 idProductAttribute: data.id_product_attribute, 75 idCustomization: 0, 76 linkAction: 'refresh', 77 cart: resp.cart 78 }, 79 resp: resp 80 }); 81 $.growl.notice({title: '', message: GrowlAddToCart}); 82 } 83 }) 84 .fail((resp) => { 85 prestashop.emit('handleError', {eventType: 'updateShoppingCart', resp: resp}); 86 }); 87 }, 88}; 89 90$(function () { 91 AdvancedCmsBlockProductSlider.init(); 92});
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.