1/** 2 * 2021-2022 3 * 4 * NOTICE OF LICENSE 5 * 6 * This source file is subject to the Academic Free License (AFL 3.0) 7 * It is available through the world-wide-web at this URL: 8 * http://opensource.org/licenses/afl-3.0.php 9 * If you did not receive a copy of the license and are unable to 10 * obtain it through the world-wide-web, please send an email 11 * to [email protected] so we can send you a copy immediately. 12 * 13 * DISCLAIMER 14 * 15 * Do not edit or add to this file if you wish to upgrade this module to newer 16 * versions in the future. If you wish to customize the module for your 17 * needs please refer to 18 * http://doc.prestashop.com/display/PS15/Overriding+default+behaviors 19 * for more information. 20 * 21 * @author Digincube <[email protected]> 22 * @copyright 2021-2022 Digincube 23 * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 */ 25 26$(document).ready(function () { 27 //renderSlider(); 28 $( "body" ).on( "renderSlider", function( event, xhr ) { 29 setTimeout(function(){ 30 renderSlider(); 31 }, 1200); 32 }); 33 if (typeof md_arrow_color !== 'undefined') { 34 document.documentElement.style.setProperty('--arrowColor', md_arrow_color); 35 document.documentElement.style.setProperty('--dotColor', md_dots_color); 36 } 37 38 39 $(document).on("ajaxComplete", function(event, xhr, options){ 40 try { 41 var data = $.parseJSON(xhr.responseText); 42 if(data.products != undefined && data.products.length){ 43 $( "body" ).trigger( "renderSlider", [ xhr ] ); 44 } 45 } catch(e) {} 46 47 } 48 ); 49 50 $(document).on("click", ".thumbnails-list-items.effect-click .thumb-item", function () { 51 renderImage($(this)); 52 }); 53 54 $(document).on("mouseover", ".thumbnails-list-items.effect-mouseenter .thumb-item", function () { 55 renderImage($(this)); 56 }); 57 58 $(document).on("mouseover", ".colors-items.effect-mouseenter .color-item", function () { 59 renderImage($(this)); 60 }); 61 62 $(document).on("click", ".colors-items.effect-click .color-item", function () { 63 renderImage($(this)); 64 }); 65 66 $(document).find(".mySwiper").each(function(index,elem) { 67 var newElement = $('<div class="md-rendred">').append($(this).clone()); 68 var product_miniature = $(this).closest('.product-miniature').find('.product-thumbnail'); 69 $(this).closest('.product-miniature').addClass('mdSwiperRendred'); 70 product_miniature.append( newElement ); 71 $(this).remove(); 72 var container_id = '#'+$(this).attr('id'); 73 console.log(container_id); 74 $(container_id).lightSlider({ 75 //gallery:true, 76 item:1, 77 loop:true, 78 thumbItem:9, 79 mode:md_carousel_effect, 80 slideMargin:0, 81 enableDrag: false, 82 currentPagerPosition:'left' 83 }); 84 }); 85 86 if($('.md-second-image').length){ 87 $(".md-second-image.not-rendred" ).each(function(index,elem) { 88 $(this).removeClass('not-rendred'); 89 $(this).closest('.product-miniature').addClass('mdSecondRendred'); 90 var container_id = '#'+$(this).attr('id'); 91 var thumbnail_top = $(this).closest('.product-miniature').find('.product-thumbnail'); 92 thumbnail_top.append( $(this).prop('outerHTML')); 93 $(this).remove(); 94 $(container_id).show(); 95 }); 96 } 97 98 99 100}); 101 102function renderImage(obj) { 103 obj.closest('.item').addClass('selected').siblings().removeClass('selected'); 104 var img_item = obj.closest('.product-miniature').find('.product-thumbnail img'); 105 var thumbnail_url = obj.attr('data-fullimg'); 106 if (img_item.length) { 107 img_item.attr('src', thumbnail_url); 108 } 109} 110
111function renderSlider(){ 112 if (!it_items_slider) 113 it_items_slider = 4; 114 115 if($('.thumbnails-list-items.vertical').closest('.thumbnail-container').length){ 116 $( ".thumbnails-list-items" ).each(function(index,elem) { 117 var container = $(this).closest('.thumbnail-container'); 118 $(this).closest('.product-miniature').addClass('mdVerticalRendred'); 119 var el = $(this).detach(); 120 el.css('height',container.outerHeight()) 121 container.append(el); 122 123 var width = container.outerWidth() / it_items_slider + 15; 124 var right = width + 10; 125 if(it_items_slider > 2) 126 $('.thumbnails-list-items.vertical').css({'width':width+'px','right':-right+'px'}) 127 128 }) 129 } 130 131 $(".thumbnails-list-items.not-rendred" ).each(function(index,elem) { 132 $(this).removeClass('not-rendred') 133 var container_id = '#'+$(this).find('.thumbs-slider').attr('id'); 134 //var newElement = $('<div class="thumbs-rendred">').append(); 135 var thumbnail_top = $(this).closest('.product-miniature').find('.thumbnail-top'); 136 thumbnail_top.append( $(this).prop('outerHTML')); 137 $(this).remove(); 138 $(container_id).show(); 139 if(!$(container_id).find('.tns-item').length){ 140 141 tns({ 142 "container": container_id, 143 "items": it_items_slider, 144 "mouseDrag": true, 145 "swipeAngle": false, 146 "speed": 400, 147 "gutter": 6, 148 "loop": false, 149 "controlsText": ['', ''], 150 "nav": false, 151 "axis": slider_type == 'vertical' ? 'vertical' : 'horizontal', 152 }); 153 } 154 // 155 }); 156} 157$(window).load(function() { 158 renderSlider(); 159});
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.