1(function($){$.fn.extend({wpbc_timeselector:function(){var times_options=[];this.each(function(){var el=$(this);if(el.parent().find('.wpbc_times_selector').length){el.parent().find('.wpbc_times_selector').remove();} 2el.find('option').each(function(ind){times_options.push({title:jQuery(this).text(),value:jQuery(this).val(),disabled:jQuery(this).is(':disabled'),selected:jQuery(this).is(':selected')});});var times_options_element=$.fn.wpbc_timeselector.format(times_options);el.after(times_options_element);el.next('.wpbc_times_selector').find('div').not('.wpbc_time_picker_disabled').on("click",function(){var selected_value=jQuery(this).attr('data-value');jQuery(this).parent('.wpbc_times_selector').find('.wpbc_time_selected').removeClass('wpbc_time_selected');jQuery(this).addClass('wpbc_time_selected');el.find('option').prop('selected',false);el.find('option').filter(function(){return selected_value===jQuery(this).val();}).prop('selected',true);el.trigger('change');});el.next('.wpbc_times_selector').find('div').not('.wpbc_time_picker_disabled').on("keypress",function(event){if(13===event.which){event.preventDefault();console.log(jQuery(this));jQuery(this).trigger('click');}});el.hide();times_options=[];});return this;}});$.fn.wpbc_timeselector.format=function(el_arr){var times_selector=jQuery(document.createElement('div')).addClass('wpbc_times_selector');var has_available_times=false;$.each(el_arr,function(index,el_item){if(!el_item.disabled){var time_option_value=('undefined'===typeof el_item.value||null===el_item.value)?'':el_item.value;var time_option_title=('undefined'===typeof el_item.title||null===el_item.title)?'':el_item.title;var time_option=jQuery(document.createElement('div')).attr('data-value',String(time_option_value)).attr('tabindex','0').text(String(time_option_title));if(el_item.selected){time_option.addClass('wpbc_time_selected');} 3times_selector.append(time_option);has_available_times=true;}else{}});if(!has_available_times){times_selector.append(jQuery(document.createElement('span')).addClass('wpbc_no_time_pickers').text('No available times'));} 4return times_selector;};})(jQuery);function wpbc_hook__init_timeselector(){if(('object'!==typeof window._wpbc)||('function'!==typeof window._wpbc.get_other_param)){return false;} 5if(true!==window._wpbc.get_other_param('is_enabled_booking_timeslot_picker')){return true;} 6jQuery('select[name^="rangetime"]').wpbc_timeselector();jQuery('select[name^="starttime"]').wpbc_timeselector();jQuery('select[name^="endtime"]').wpbc_timeselector();jQuery('select[name^="durationtime"]').wpbc_timeselector();jQuery(".booking_form_div").on('wpbc_hook_timeslots_disabled',function(event,bk_type,all_dates){jQuery('#booking_form_div'+bk_type+' select[name^="rangetime"]').wpbc_timeselector();jQuery('#booking_form_div'+bk_type+' select[name^="starttime"]').wpbc_timeselector();jQuery('#booking_form_div'+bk_type+' select[name^="endtime"]').wpbc_timeselector();jQuery('#booking_form_div'+bk_type+' select[name^="durationtime"]').wpbc_timeselector();});return true;} 7function wpbc_init_timeselector_when_wpbc_ready(){if(wpbc_hook__init_timeselector()){return;} 8var wpbc_timeselector_ready_handler=function(){if(wpbc_hook__init_timeselector()){document.removeEventListener('wpbc-ready',wpbc_timeselector_ready_handler);}};document.addEventListener('wpbc-ready',wpbc_timeselector_ready_handler);} 9jQuery(document).ready(function(){wpbc_init_timeselector_when_wpbc_ready();});
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.