1(function($){$.chronoprecise=function(el,options){var defaults={navHtml:'<header class="rdvCarouselheader" id="rdvCarouselheader"><nav><a href="#" class="carousel-control prev" rel="prev">%prev_week_txt%</a><a href="#" class="carousel-control next" rel="next">%next_week_txt%</a></nav></header>'} 2var plugin=this;plugin.settings={} 3var init=function(){plugin.firstLoaded=!1;plugin.selectRdv=!1;plugin.settings=$.extend({},defaults,options);plugin.el=el;plugin.currentScreen=1;plugin.totalScreen=$(plugin.el).find('#rdvCarouselContent .slide').length;plugin.initNavigation();plugin.initEvents();plugin.initMobileEvents();plugin.firstLoaded=!0} 4plugin.reload=function(){plugin.el=el;plugin.firstLoaded=!0;plugin.currentScreen=1;plugin.totalScreen=$(plugin.el).find('#rdvCarouselContent .slide').length;plugin.initNavigation();plugin.resetEvents();plugin.initEvents();plugin.initMobileEvents()} 5plugin.initEvents=function(){$(document.body).on('updated_checkout',function(){plugin.current_shipping_method=$('input[name="shipping_method[0]"]:checked').val();plugin.isActive=$('.appointment-link').length?!0:!1;if(plugin.getShipAddress()!=plugin.currentAddress&&!plugin.loadingRdv&&plugin.isActive&&!plugin.selectRdv){plugin.loadingRdv=!0,shipping_method=$('.appointment-link').closest('li').find('input[name="shipping_method[0]"]').val();$.ajax({type:'POST',dataType:'json',url:Chronoprecise.ajaxurl,cache:!1,data:{'action':'load_chronoprecise_appointment','method_id':shipping_method,'chrono_nonce':Chronoprecise.chrono_nonce}}).done(function(output){$('#outer-container-method-chronoprecise').html($(output.data).filter('#outer-container-method-chronoprecise').html());plugin.loadingRdv=!1;$('#outer-container-method-chronoprecise').data('chronoprecise').reload();$(document).trigger('chronoprecise:slot_loaded');plugin.getScreen(plugin.currentScreen)})} 6setTimeout(function(){plugin.selectRdv=!1},200)});if(plugin.firstLoaded==!1){$(document.body).on('click','.appointment-link a',function(){if(typeof plugin.loadingRdv!='undefined'&&plugin.loadingRdv){$(document).on('chronoprecise:slot_loaded',function(){plugin.showFancybox();$(document).off('chronoprecise:slot_loaded')})}else{plugin.showFancybox()}})} 7$(document.body).on('click','.shipping_method_chronopostprecise',function(){plugin.selectRdv=!0;plugin.selectChronopostSrdvSlot(this)});$(document.body).on('click','#container-method-chronoprecise .carousel-control',function(event){event.preventDefault();if(!$(this).is('.inactive')){plugin.currentScreen=$(this).is('.next')?plugin.currentScreen+1:plugin.currentScreen-1;plugin.getScreen(plugin.currentScreen)}})} 8plugin.showFancybox=function(){$.fancybox.open({src:'#container-method-chronoprecise',type:'inline',clickSlide:!1,touch:!1})} 9plugin.resetEvents=function(){$(plugin.el).off('click','.shipping_method_chronopostprecise');$(plugin.el).off('click','#rdvCarouselheader .carousel-control');$('#global-mobile').off('click','th')} 10plugin.initMobileEvents=function(){$('#global-mobile').on('click','th',function(event){event.preventDefault();var $this=$(this);$('#global-mobile th').removeClass('active');$this.addClass('active');$('#time-list ul').hide();var idUlHoraireDay=$this.attr('id').replace("th","ul");$('#'+idUlHoraireDay).show()});$('#global-mobile th').eq(0).click()} 11var dateLeadingZero=function(date){return('0'+date).slice(-2)} 12plugin.initNavigation=function(){plugin.settings.navHtml=plugin.settings.navHtml.replace('%prev_week_txt%',Chronoprecise.prev_week_txt).replace('%next_week_txt%',Chronoprecise.next_week_txt);if(plugin.totalScreen>1){$(plugin.el).find('#rdvCarousel').before(plugin.settings.navHtml)} 13plugin.getScreen(plugin.currentScreen)} 14plugin.getScreen=function(nb){$('#rdvCarouselContent .slide').removeClass('slide-active').eq(nb-1).addClass('slide-active');$('#rdvCarouselheader .carousel-control').removeClass('inactive') 15if(nb==1){$('#rdvCarouselheader .carousel-control.prev').addClass('inactive')}else if(nb==plugin.totalScreen){$('#rdvCarouselheader .carousel-control.next').addClass('inactive')}} 16plugin.selectChronopostSrdvSlot=function(element){$('#container-method-chronoprecise').addClass('slot-selected');var slotValue=$(element).data('slotvaluejson');var d=new Date(slotValue.deliveryDate);var thID='#th_'+dateLeadingZero(d.getDate());thID+='-'+dateLeadingZero((d.getMonth()+1));thID+='-'+d.getFullYear();$("#rdvCarousel .active").removeClass("active");var td=$(element).closest("td");var tr=td.closest("tr");var th=tr.find('th');th.addClass("active");$(thID).addClass("active");$("#global-mobile ul li.active").removeClass("active");var li=$(element).closest("li");li.addClass("active");$('#chronopostprecise_creneaux_info').val(JSON.stringify(slotValue)).trigger('chronoprecise:appointment_changed');setTimeout(function(){jQuery(document.body).trigger('update_checkout',{update_shipping_method:!0})},5)} 17plugin.getShipAddress=function(){var address_1=$('input#billing_address_1').val(),address_2=$('input#billing_address_2').val(),postcode=$('input#billing_postcode').val(),city=$('input#billing_city').val(),country=$('#billing_country').val();if($('#ship-to-different-address').find('input').is(':checked')){address_1=$('input#shipping_address_1').val();address_2=$('input#shipping_address_2').val();postcode=$('input#shipping_postcode').val();city=$('input#shipping_city').val();country=$('#shipping_country').val()} 18var ship_address=address_1;if(address_2!=''){ship_address+=' '+address_2} 19return ship_address+' '+postcode+' '+city+' '+country} 20init()} 21$.fn.chronoprecise=function(options){return this.each(function(){if(undefined==$(this).data('chronoprecise')){var plugin=new $.chronoprecise(this,options);$(this).data('chronoprecise',plugin);if(options&&options.openRdv){plugin.showFancybox()}}})}})(jQuery)
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.