1/** 2 * Copyright ETS Software Technology Co., Ltd 3 * 4 * NOTICE OF LICENSE 5 * 6 * This file is not open source! Each license that you purchased is only available for 1 website only. 7 * If you want to use this file on more websites (or projects), you need to purchase additional licenses. 8 * You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party. 9 * 10 * DISCLAIMER 11 * 12 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 13 * versions in the future. 14 * 15 * @author ETS Software Technology Co., Ltd 16 * @copyright ETS Software Technology Co., Ltd 17 * @license Valid for 1 website (or project) for each purchase of license 18 */ 19 var height_index_heading = 100; 20 21 22$(document).on('hooksLoaded',function(){ 23 runowl(); 24}); 25$(document).ready(function(){ 26 if($('.bybc-blog-slider .lazyload').length) 27 { 28 $(document).scrollTop(100); 29 } 30 31 $(document).on('change','#form_blog input[type="file"],.blog-managament-information input[type="file"]',function(){ 32 var fileExtension = ['jpeg', 'jpg', 'png', 'gif', 'bmp']; 33 if ($.inArray($(this).val().split('.').pop().toLowerCase(), fileExtension) == -1) { 34 alert(ybc_blog_invalid_file); 35 } 36 else 37 { 38 var file_name = $(this).val().replace('C:\\fakepath\\',''); 39 if($(this).closest('.upload_form_custom').find('.file_name').length) 40 { 41 $(this).closest('.upload_form_custom').find('.file_name').html(file_name); 42 } 43 else 44 $(this).closest('.upload_form_custom').append('<span class="file_name">'+file_name+'</span>'); 45 readURL(this); 46 } 47 if($(this).next('.file_name').length>0) 48 { 49 $(this).next('.file_name').html($(this).val().replace('C:\\fakepath\\','')) 50 } 51 }); 52 if ( $('.ybc-blog-rtl').length > 0 ){ 53 var rtl_blog = true; 54 55 } else { 56 var rtl_blog = false; 57 } 58 59 function loadLazi(){ 60 if($('img.lazyload').length>0) 61 { 62 $('img.lazyload').lazyload({ 63 load : function () { 64 $(this).parent().removeClass('ybc_item_img_ladyload'); 65 $(this).parent().parent().removeClass('ybc_item_img_ladyload'); 66 $(this).addClass('isload'); 67 }, 68 threshold: 100, 69 }); 70 } 71 } 72 $( window ).on('load',function() { 73 loadLazi(); 74 }); 75 loadLazi(); 76 77 $(document).on('click','.owl-next',function(){ 78 if($('img.lazyload').length>0) 79 { 80 $('img.lazyload').lazyload(); 81 } 82 }); 83 $(window).on('scroll',function(){ 84 autoLoadBlog(); 85 }); 86 runowl(); 87 autoLoadBlog(); 88}); 89function autoLoadBlog() 90{ 91 var container = '.ybc-blog-wrapper-blog-list.loadmore'; 92 if ($(container).length > 0 && $(container+" .blog-paggination a.next").length > 0 && !$(container+" .blog-paggination a.next").hasClass('active') && $(window).scrollTop() + $(window).height() >= $(container).offset().top + $(container).height() ) { 93 $(container+" .blog-paggination a.next").addClass('active'); 94 $('.ets_blog_loading.autoload').addClass('active'); 95 $.ajax({ 96 url: $(container+" .blog-paggination a.next").attr('href'), 97 data: 'loadajax=1'+($('select[name="ybc_sort_by_posts"]').length ? '&ybc_sort_by_posts='+$('select[name="ybc_sort_by_posts"]').val():''), 98 type: 'post', 99 dataType: 'json', 100 success: function(json){ 101 if(json.list_blog) 102 $('.ybc-blog-list').append(json.list_blog); 103 if(json.list_galleries) 104 { 105 $('.ybc-galley-list').append(json.list_galleries); 106 ybcBlogPrettyPhoto(); 107 } 108 $('.blog-paggination').html(json.blog_paggination); 109 if($('img.lazyload').length>0) 110 { 111 $('img.lazyload').lazyload({ 112 load : function () { 113 $(this).parent().removeClass('ybc_item_img_ladyload'); 114 $(this).parent().parent().removeClass('ybc_item_img_ladyload'); 115 }, 116 threshold: 100, 117 }); 118 } 119 $('.ets_blog_loading.autoload').removeClass('active'); 120 }, 121 error: function(error) 122 { 123 124 } 125 }); 126 } 127} 128function runowl() 129{ 130 if ( $('.ybc_blog_rtl_mode').length > 0 ){ 131 var rtl_blog = true; 132 133 } else { 134 var rtl_blog = false;
135 } 136 137 if ($('.ybc-blog-related-posts.ybc_blog_carousel .ybc-blog-related-posts-list:not(.slick-initialized)').length > 0) 138 { 139 var number_post_related_per_row = $('.ybc-blog-related-posts').attr('data-items'); 140 $('.ybc-blog-related-posts.ybc_blog_carousel .ybc-blog-related-posts-list:not(.slick-initialized)').slick({ 141 slidesToShow: number_post_related_per_row, 142 arrows: true, 143 rtl: rtl_blog, 144 dots: false, 145 autoplay: false, 146 responsive: [ 147 { 148 breakpoint: 1200, 149 settings: { 150 slidesToShow: number_post_related_per_row, 151 } 152 }, 153 { 154 breakpoint: 992, 155 settings: { 156 slidesToShow: 3, 157 } 158 }, 159 { 160 breakpoint: 768, 161 settings: { 162 slidesToShow: 2, 163 } 164 }, 165 { 166 breakpoint: 400, 167 settings: { 168 slidesToShow: 1, 169 } 170 } 171 ] 172 }); 173 $('.ybc-blog-related-posts.ybc_blog_carousel .ybc-blog-related-posts-list').on('changed.etsowl.carousel', function(event) { 174 if($('img.lazyload').length>0) 175 { 176 $('img.lazyload').lazyload(); 177 } 178 }); 179 } 180 if ($('.ybc_related_products_type_carousel.ybc_blog_carousel:not(.slick-initialized)').length > 0) 181 { 182 $('.ybc_related_products_type_carousel.ybc_blog_carousel:not(.slick-initialized)').slick({ 183 slidesToShow: 4, 184 arrows: true, 185 rtl: rtl_blog, 186 dots: false, 187 autoplay: false, 188 responsive: [ 189 { 190 breakpoint: 1200, 191 settings: { 192 slidesToShow: 4, 193 } 194 }, 195 { 196 breakpoint: 992, 197 settings: { 198 slidesToShow: 3, 199 } 200 }, 201 { 202 breakpoint: 768, 203 settings: { 204 slidesToShow: 2, 205 } 206 }, 207 { 208 breakpoint: 400, 209 settings: { 210 slidesToShow: 1, 211 } 212 } 213 ] 214 }); 215 $('.ybc-blog-related-posts.ybc_blog_carousel .ybc-blog-related-posts-list').on('changed.etsowl.carousel', function(event) { 216 if($('img.lazyload').length>0) 217 { 218 $('img.lazyload').lazyload(); 219 } 220 }); 221 } 222 if ($('.ybc_blog_related_posts_type_carousel .blog_type_slider:not(.slick-initialized)').length > 0) 223 { 224 $('.ybc_blog_related_posts_type_carousel .blog_type_slider:not(.slick-initialized)').slick({ 225 dots: false, 226 infinite: false, 227 speed: 300, 228 arrows: true, 229 slidesToShow: number_post_related_per_row, 230 slidesToScroll: 4, 231 responsive: [ 232 { 233 breakpoint: 1200, 234 settings: { 235 slidesToShow: number_post_related_per_row, 236 infinite: true, 237 } 238 }, 239 { 240 breakpoint: 1024, 241 settings: { 242 slidesToShow: 3, 243 infinite: true, 244 } 245 }, 246 { 247 breakpoint: 600, 248 settings: { 249 slidesToShow: 2, 250 } 251 }, 252 { 253 breakpoint: 480, 254 settings: { 255 slidesToShow: 1, 256 } 257 } 258 ] 259 }); 260 $('.ybc_blog_related_posts_type_carousel .blog_type_slider').on('changed.etsowl.carousel', function(event) { 261 if($('img.lazyload').length>0) 262 { 263 $('img.lazyload').lazyload(); 264 } 265 }); 266 } 267} 268 269function readURL(input) { 270 if (input.files && input.files[0]) { 271 var reader = new FileReader(); 272 reader.onload = function (e) { 273 if($(input).closest('.col-md-9').find('.thumb_post').length <= 0) 274 { 275 $(input).closest('.col-md-9').append('<div class="thumb_post"><img src="'+e.target.result+'"/> </div>'); 276 } 277 else 278 { 279 $(input).closest('.col-md-9').find('.thumb_post img').eq(0).attr('src',e.target.result); 280 } 281 }
282 reader.readAsDataURL(input.files[0]); 283 } 284} 285 286 287function addLazyLoadAfterSlider(){ 288 if( $('.slick-cloned .ybc_item_img_ladyload .isload').length ){ 289 $('.slick-cloned .ybc_item_img_ladyload .isload').parent().removeClass('ybc_item_img_ladyload'); 290 } 291 $('img.lazyload').each(function(){ 292 $(this).lazyload({ 293 threshold: 100, 294 afterLoad : function (element) { 295 $(this).parent().removeClass('ybc_item_img_ladyload'); 296 $(this).parent().parent().removeClass('ybc_item_img_ladyload'); 297 $(this).addClass('isload'); 298 } 299 }); 300 }); 301} 302 303
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.