add optimisation in theme/img, in js, fix clearcache in privatesales
7
modules/ant_popover/js/ant_popover.min.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
$(document).ready(function(){AntPopover._init();});var AntPopover={conf:{'enable_delay':0,'disable_delay':10000,'cookie_lifetime':30*24*60*60,'cart':{'display':20000,'cookie_lifetime':30*24*60*60},'customer':{'display':0,'cookie_lifetime':30*24*60*60},'product':{'display':45000,'cookie_lifetime':30*24*60*60,'countdownLayout':'<span class="ap_timer_item ap_timer_d">'+'<span class="ap_timer_label">{dl}</span>'+'<span class="ap_timer_value ap_timer_value_dozen">{d10}<i class="inner_sep"></i></span>'+'<span class="ap_timer_value ap_timer_value_units">{d1}<i class="inner_sep"></i></span>'+'</span>'+'<span class="ap_timer_sep">:</span>'+'<span class="ap_timer_item ap_timer_h">'+'<span class="ap_timer_label">{hl}</span>'+'<span class="ap_timer_value ap_timer_value_dozen">{h10}<i class="inner_sep"></i></span>'+'<span class="ap_timer_value ap_timer_value_units">{h1}<i class="inner_sep"></i></span>'+'</span>'+'<span class="ap_timer_sep">:</span>'+'<span class="ap_timer_item ap_timer_i">'+'<span class="ap_timer_label">{ml}</span>'+'<span class="ap_timer_value ap_timer_value_dozen">{m10}<i class="inner_sep"></i></span>'+'<span class="ap_timer_value ap_timer_value_units">{m1}<i class="inner_sep"></i></span>'+'</span>'},'concours':{'display':0,'cookie_lifetime':12*60*60},'promo':{'display':3000,'cookie_lifetime':24*60*60}},overlay:$('.ap_overlay'),popups:[$('#ANT_POPOVER_CART_YIELD'),$('#ANT_POPOVER_CUSTOMER_YIELD'),$('#ANT_POPOVER_PRODUCT_YIELD'),$('#ANT_POPOVER_CONCOURS_YIELD'),$('#ANT_POPOVER_PROMO_YIELD')],triggered:false,_init:function(){var ap_intiTimer=new YTimer(function(){AntPopover._cartYieldInit();AntPopover._customerYieldInit();AntPopover._productYieldInit();AntPopover._concoursYieldInit();AntPopover._promoYieldInit();},AntPopover.conf.enable_delay);$('.ant_popover_container .close, .ant_popover_container .ap_btn').click(function(){var container=$(this).closest('.ant_popover_container');AntPopover.closePopup(container);});$('.ap_overlay').click(function(){AntPopover.closePopups();});$('.ap_add_to_cart').click(function(e){e.preventDefault();AntPopover.addToCart();});$('.ap_text_link').click(function(e){e.preventDefault();var container=$(this).closest('.ant_popover_container');var ap_event=container.data('event');var link=$(this).attr('href');AntPopover._ajaxCall(ap_event,1,0,function(resp){$('.ap_overlay').removeClass('shown');container.removeClass('shown').addClass('closed');window.location.href=link;});});},_cartYieldInit:function(){console.log($('#ANT_POPOVER_CART_YIELD'));console.log(AntPopover.conf.cart.cookie_lifetime);if($('#ANT_POPOVER_CART_YIELD').length){AntPopover.displayOnLeave('cart',$('#ANT_POPOVER_CART_YIELD'),AntPopover.conf.cart.cookie_lifetime);}},_customerYieldInit:function(){if($('#ANT_POPOVER_CUSTOMER_YIELD').length){AntPopover.displayOnStay('customer',$('#ANT_POPOVER_CUSTOMER_YIELD'),AntPopover.conf.customer.cookie_lifetime,AntPopover.conf.customer.display);}},_productYieldInit:function(){if($('#ANT_POPOVER_PRODUCT_YIELD').length){AntPopover.displayOnLeave('product',$('#ANT_POPOVER_PRODUCT_YIELD'),AntPopover.conf.product.cookie_lifetime);var now=new Date();if(endofsale-now<31536000000)$('#ANT_POPOVER_PRODUCT_YIELD .ap_timer').countdown({serverSync:function(){return new Date();},padZeroes:true,until:endofsale,layout:AntPopover.countdownLayout});else
|
||||
$('#ANT_POPOVER_PRODUCT_YIELD .ap_countdown_field').remove();}},_concoursYieldInit:function(){if($('#ANT_POPOVER_CONCOURS_YIELD').length){AntPopover.displayOnStay('concours',$('#ANT_POPOVER_CONCOURS_YIELD'),AntPopover.conf.concours.cookie_lifetime,AntPopover.conf.concours.display);}},_promoYieldInit:function(){if($('#ANT_POPOVER_PROMO_YIELD').length&&$(window).width()>767){AntPopover.displayOnStay('promo',$('#ANT_POPOVER_PROMO_YIELD'),AntPopover.conf.promo.cookie_lifetime,AntPopover.conf.promo.display);}},displayOnStay:function(event,element,cookie_lifetime,delay){var _ydost=new YTimer(function(){AntPopover.displayPopup(event,element,cookie_lifetime,delay);},delay);},displayOnLeave:function(event,element,cookie_lifetime){$('body').mouseleave(function(){AntPopover.displayPopup(event,element,cookie_lifetime,AntPopover.conf.disable_delay);});},displayPopup:function(ap_event,element,cookie_lifetime,delay){if(typeof(element)==='undefined')return;if(element.hasClass('closed')||element.hasClass('tmp_closed'))return;AntPopover._ajaxCall(ap_event,0,cookie_lifetime,function(resp){if(resp===true){if(!$('input:focus').length&&!$('.ant_popover_container.shown').length){element.addClass('shown');$('header').addClass('ap_overlay_header');$('.ap_overlay').addClass('shown');}else if(typeof(delay!=='undefined')&&delay){_pdtid=new YTimer(function(){AntPopover.displayPopup(ap_event,element,delay,cookie_lifetime);},delay);}}});},closePopups:function(){AntPopover.closePopup($('.ant_popover_container.shown'));},closePopup:function(element){$('.ap_overlay').removeClass('shown');$('header').removeClass('ap_overlay_header');var ap_event=element.data('event');AntPopover._ajaxCall(ap_event,1,0,function(resp){});element.removeClass('shown').addClass('closed');},addToCart:function(){var add_button=$('#buy_block #add_to_cart .btn');add_button.click();AntPopover.closePopups();},_ajaxCall:function(ap_event,update,lifetime,callback){if(typeof(update)==='undefined')update=0;if(typeof(lifetime)==='undefined')lifetime=AntPopover.conf.cookie_lifetime;$.ajax({type:"POST",url:ap_ajax_path,cache:false,dataType:"json",data:{ajax:true,ap_event:ap_event,update:update,lifetime:lifetime,},success:function(data){callback(data);}});},__shutdown:function(){$('.ap_overlay').removeClass('shown');if(typeof(_pctid)!=='undefined')clearTimeout(_pctid)
|
||||
if(typeof(_pytid)!=='undefined')clearTimeout(_pytid)
|
||||
if(typeof(_pdtid)!=='undefined')clearTimeout(_pdtid)
|
||||
$('.ant_popover_container').removeClass('shown').addClass('closed');},__restart:function(){$('.ant_popover_container').removeClass('shown closed tmp_closed');$('.ap_overlay').removeClass('shown');this._init();}}
|
||||
function YTimer(callback,time){this.setTimeout(callback,time);}YTimer.prototype.setTimeout=function(callback,time){var self=this;if(this.timer){clearTimeout(this.timer);}this.finished=false;this.callback=callback;this.time=time;this.timer=setTimeout(function(){self.finished=true;callback();},time);this.start=Date.now();}
|
||||
YTimer.prototype.add=function(time){if(!this.finished){time=this.time-(Date.now()-this.start)+time;this.setTimeout(this.callback,time);}}
|
@ -45,7 +45,10 @@ class SaleCache
|
||||
static function clearAll()
|
||||
{
|
||||
foreach(glob(__DIR__.'/../cache/*') as $path_file) {
|
||||
@unlink($path_file);
|
||||
if (preg_match('/index\.php$/', $path_file)===1) {
|
||||
continue;
|
||||
}
|
||||
@unlink($path_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,8 +61,8 @@
|
||||
<script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<script type='application/javascript' async src='{$js_dir}fastclick.js'></script>
|
||||
<script type='application/javascript' async src='{$modules_dir}ant_popover/js/ant_popover.js'></script>
|
||||
<script type='application/javascript' async src='{$js_dir}fastclick.min.js'></script>
|
||||
<script type='application/javascript' async src='{$modules_dir}ant_popover/js/ant_popover.min.js'></script>
|
||||
|
||||
{literal}
|
||||
<script>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 1003 B After Width: | Height: | Size: 80 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 145 B |
Before Width: | Height: | Size: 999 B After Width: | Height: | Size: 76 B |
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 71 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 149 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 132 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 593 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 765 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 78 B |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 685 B |