1/** 2 * 2007-2024 PrestaShop 3 * 4 * NOTICE OF LICENSE 5 * 6 * This source file is subject to the Academic Free License (AFL 3.0) 7 * that is bundled with this package in the file LICENSE.txt. 8 * It is also available through the world-wide-web at this URL: 9 * http://opensource.org/licenses/afl-3.0.php 10 * If you did not receive a copy of the license and are unable to 11 * obtain it through the world-wide-web, please send an email 12 * to [email protected] so we can send you a copy immediately. 13 * 14 * DISCLAIMER 15 * 16 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 17 * versions in the future. If you wish to customize PrestaShop for your 18 * needs please refer to http://www.prestashop.com for more information. 19 * 20 * @author PrestaShop SA <[email protected]> 21 * @copyright 2007-2024 PrestaShop SA 22 * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 23 * International Registered Trademark & Property of PrestaShop SA 24 * 25 * Don't forget to prefix your containers with your own identifier 26 * to avoid any conflicts with others containers. 27 */ 28var storage; 29var langId = document.getElementsByTagName("html")[0].getAttribute("lang"); 30var currentFeatureModule = tvthemename + "_feature_" + langId; 31jQuery(document).ready(function($) { 32 storage = $.localStorage; 33 34 function storageGet(key) { 35 return "" + storage.get(currentFeatureModule + key); 36 } 37 38 function storageSet(key, value) { 39 storage.set(currentFeatureModule + key, value); 40 } 41 42 function storageClear(key) { 43 storage.remove(currentFeatureModule + key); 44 } 45 var gettvcmsfeatureproductsajax = function() { 46 if ($('.tvcmsfeatured-product').length) { 47 /*****Load Cache*****/ 48 var data = storageGet(""); 49 if (data != "null") { 50 $('.tvcmsfeatured-product').html(data); 51 makeFeatureProductSlider(); 52 productTime(); //custom.js 53 } 54 /*****Load Cache*****/ 55 $.ajax({
56 type: 'POST', 57 url: gettvcmsfeaturedproductslink, 58 success: function(data) { 59 var dataCache = storageGet(""); 60 storageSet("", data); 61 if (dataCache === 'null') { 62 $('.tvcmsfeatured-product').html(data); 63 makeFeatureProductSlider(); 64 customImgLazyLoad('.tvcmsfeatured-product'); 65 } 66 }, 67 error: function(jqXHR, textStatus, errorThrown) { 68 //setTimeout(function(){gettvcmsfeatureproductsajax()},500); 69 console.log(textStatus, errorThrown); 70 } 71 }); 72 } 73 } 74 //setTimeout(function(){gettvcmsfeatureproductsajax()},500); 75 76 themevoltyCallEventsPush(gettvcmsfeatureproductsajax, null); 77 78 function makeFeatureProductSlider() { 79 var swiperClass = [ 80 //['slider className','navigation nextClass','navigation prevClass','paging className'] 81 ['.tvcmsfeatured-product .tvfeatured-product-wrapper', '.tvcmsfeatured-next', '.tvcmsfeatured-prev', '.tvcmsfeatured-product'], 82 ]; 83 for (var i = 0; i < swiperClass.length; i++) { 84 if ($(swiperClass[i][0]).attr('data-has-image') == 'true') { 85 $(swiperClass[i][0]).owlCarousel({ 86 loop: false, 87 dots: false, 88 nav: false, 89 smartSpeed: tvMainSmartSpeed, 90 responsive: { 91 0: { items: 1 }, 92 320: { items: 1, slideBy: 1 }, 93 330: { items: 2, slideBy: 1 }, 94 400: { items: 2, slideBy: 1 }, 95 480: { items: 2, slideBy: 1 }, 96 650: { items: 2, slideBy: 1 }, 97 767: { items: 2, slideBy: 1 }, 98 768: { items: 2, slideBy: 1 }, 99 992: { items: 2, slideBy: 1 }, 100 1025: { items: 3, slideBy: 1 }, 101 1200: { items: 3, slideBy: 1 }, 102 1350: { items: 3, slideBy: 1 }, 103 1660: { items: 3, slideBy: 1 }, 104 1800: { items: 3, slideBy: 1 } 105 } 106 }); 107 } else { 108 $(swiperClass[i][0]).owlCarousel({ 109 loop: false, 110 dots: false, 111 nav: false, 112 smartSpeed: tvMainSmartSpeed, 113 responsive: { 114 0: { items: 1 }, 115 320: { items: 1, slideBy: 1 }, 116 330: { items: 2, slideBy: 1 }, 117 400: { items: 2, slideBy: 1 }, 118 480: { items: 2, slideBy: 1 }, 119 650: { items: 3, slideBy: 1 }, 120 767: { items: 3, slideBy: 1 }, 121 768: { items: 3, slideBy: 1 }, 122 992: { items: 3, slideBy: 1 }, 123 1025: { items: 4, slideBy: 1 }, 124 1200: { items: 4, slideBy: 1 }, 125 1350: { items: 4, slideBy: 1 }, 126 1660: { items: 4, slideBy: 1 }, 127 1800: { items: 4, slideBy: 1 } 128 } 129 }); 130 } 131 $(swiperClass[i][1]).on('click', function(e) { 132 e.preventDefault(); 133 $('.' + $(this).attr('data-parent') + ' .owl-nav .owl-next').trigger('click'); 134 }); 135 $(swiperClass[i][2]).on('click', function(e) { 136 e.preventDefault(); 137 $('.' + $(this).attr('data-parent') + ' .owl-nav .owl-prev').trigger('click'); 138 }); 139 $(swiperClass[i][3] + ' .tv-pagination-wrapper').insertAfter(swiperClass[i][3] + ' .tvfeatured-product-content .tvall-block-box-shadows'); 140 } 141 } 142});
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.