PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
dokan-pro
/
modules
/
booking
/
assets
/
js
jQuery(document).ready(function(e){function o(){e(".wc_booking_availability_type select, .wc_booking_pricing_type select, #_wc_booking_duration_type, #_wc_booking_user_can_cancel, #_wc_booking_duration_unit, #_wc_booking_has_persons, #_wc_booking_has_resources, #_wc_booking_has_person_types, #_wc_booking_has_restricted_days").change()}function r(){e(".woocommerce_bookable_persons .woocommerce_booking_person").each(function(o,r){e(".person_menu_order",r).val(parseInt(e(r).index(".woocommerce_bookable_persons .woocommerce_booking_person"),10))})}function n(){e(".woocommerce_bookable_resources .woocommerce_booking_resource").each(function(o,r){e(".resource_menu_order",r).val(parseInt(e(r).index(".woocommerce_bookable_resources .woocommerce_booking_resource"),10))})}e("#bookings_availability, #bookings_pricing, .bookings_extension").on("change",".wc_booking_availability_type select, .wc_booking_pricing_type select",function(){var o=e(this).val(),r=e(this).closest("tr"),n=e(r);n.find(".from_date, .from_day_of_week, .from_month, .from_week, .from_time, .from").hide(),n.find(".to_date, .to_day_of_week, .to_month, .to_week, .to_time, .to").hide(),n.find(".repeating-label").hide(),n.find(".bookings-datetime-select-to").removeClass("bookings-datetime-select-both"),n.find(".bookings-datetime-select-from").removeClass("bookings-datetime-select-both"),n.find(".bookings-to-label-row .bookings-datetimerange-second-label").hide(),"custom"==o&&n.find(".from_date, .to_date").show(),"months"==o&&n.find(".from_month, .to_month").show(),"weeks"==o&&n.find(".from_week, .to_week").show(),"days"==o&&n.find(".from_day_of_week, .to_day_of_week").show(),o.match("^time")&&(n.find(".from_time, .to_time").show(),"time:range"===o&&(n.find(".from_date, .to_date").show(),n.find(".repeating-label").show(),n.find(".bookings-datetime-select-to").addClass("bookings-datetime-select-both"),n.find(".bookings-datetime-select-from").addClass("bookings-datetime-select-both"),n.find(".bookings-to-label-row .bookings-datetimerange-second-label").show())),"persons"!=o&&"duration"!=o&&"blocks"!=o||n.find(".from, .to").show()}),e("body").on("row_added",function(){e(".wc_booking_availability_type select, .wc_booking_pricing_type select").change(),e(".date-picker").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,showOn:"button",buttonImage:wc_bookings_writepanel_js_params.calendar_image,buttonImageOnly:!0})}),e("body").on("woocommerce-product-type-change",function(r){"booking"!==r&&(e("#_wc_booking_has_persons").removeAttr("checked"),e("#_wc_booking_has_resources").removeAttr("checked")),o()}),e("input#_virtual").change(function(){o()}),e("#_wc_booking_duration_type").change(function(){"customer"==e(this).val()?e("#min_max_duration").show():e("#min_max_duration").hide()}),e("#_wc_booking_duration_unit").change(function(){switch(e(".availability_time, ._wc_booking_first_block_time_field").hide(),e("#enable-range-picker").hide(),e("._wc_booking_apply_adjacent_buffer_field").show(),e("._wc_booking_buffer_period").show(),e(this).val()){case"hour":case"minute":var o="hour"===e(this).val()?wc_bookings_writepanel_js_params.i18n_hours:wc_bookings_writepanel_js_params.i18n_minutes;e("._wc_booking_buffer_period_unit").text(o),e(".availability_time, ._wc_booking_first_block_time_field").show();break;case"month":e("._wc_booking_buffer_period").hide(),e("._wc_booking_apply_adjacent_buffer_field").hide();break;default:e("#enable-range-picker").show(),e("._wc_booking_buffer_period_unit").text(wc_bookings_writepanel_js_params.i18n_days)}}),e("#_wc_booking_user_can_cancel").change(function(){e(this).is(":checked")?e(".form-field.booking-cancel-limit").show():e(".form-field.booking-cancel-limit").hide()}),e("#_wc_booking_has_persons").change(function(){e(this).is(":checked")?e("#persons-options, .bookings_persons_tab").show():e("#persons-options, .bookings_persons_tab").hide(),e("ul.wc-tabs li:visible").eq(0).find("a").click()}),e("#_wc_booking_has_person_types").change(function(){e(this).is(":checked")?e("#persons-types").show():e("#persons-types").hide()}),e("#_wc_booking_has_resources").change(function(){e(this).is(":checked")?e(".bookings_resources_tab").show():e(".bookings_resources_tab").hide(),e("ul.wc-tabs li:visible").eq(0).find("a").click()}),e("#_wc_booking_has_restricted_days").change(function(){e(this).is(":checked")?e(".booking-day-restriction").show():e(".booking-day-restriction").hide()}),o(),e("#availability_rows, #pricing_rows").sortable({items:"tr",cursor:"move",axis:"y",handle:".sort",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(e,o){o.item.css("background-color","#f6f6f6")},stop:function(e,o){o.item.removeAttr("style"),jQuery(e.target).find("tr").each(function(e,o){for(var r=jQuery(o).find('[name*="wc_booking"]'),n=0;n<r.length;n++){var i=r[n],t=jQuery(i).attr("name"),s=t.replace(/[\d+]/g,e);s!==t&&jQuery(i).attr("name",s)}})}}),e(".date-picker").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,showOn:"button",buttonImage:wc_bookings_writepanel_js_params.calendar_image,buttonImageOnly:!0}),e(".add_row").click(function(o){var r=e(o.target).closest("table").find("#pricing_rows tr").length,n=e(this).data("row");return n=n.replace(/bookings_cost_js_index_replace/gi,r.toString()),e(this).closest("table").find("tbody").append(n),e("body").trigger("row_added"),!1}),e("body").on("click","td.remove",function(){return e(this).closest("tr").remove(),!1}),e("#bookings_persons").on("change","input.person_name",function(){e(this).closest(".woocommerce_booking_person").find("span.person_name").text(e(this).val())}),jQuery("#bookings_persons").on("click","button.add_person",function(){jQuery(".woocommerce_bookable_persons").block({message:null});var o=jQuery(".woocommerce_booking_person").length,r={action:"woocommerce_add_bookable_person",post_id:wc_bookings_writepanel_js_params.post,loop:o,security:wc_bookings_writepanel_js_params.nonce_add_person};return jQuery.post(wc_bookings_writepanel_js_params.ajax_url,r,function(o){jQuery(".woocommerce_bookable_persons").append(o).unblock(),jQuery(".woocommerce_bookable_persons #message").hide(),e(".woocommerce_bookable_persons").sortable(i)}),!1}),jQuery("#bookings_persons").on("click","button.unlink_booking_person",function(e){if(e.preventDefault(),confirm(wc_bookings_writepanel_js_params.i18n_remove_person)){var o=jQuery(this).parent().parent(),r=jQuery(this).attr("rel");if(r>0){jQuery(o).block({message:null});var n={action:"woocommerce_unlink_bookable_person",person_id:r,security:wc_bookings_writepanel_js_params.nonce_unlink_person};jQuery.post(wc_bookings_writepanel_js_params.ajax_url,n,function(e){jQuery(o).fadeOut("300",function(){jQuery(o).remove()})})}else jQuery(o).fadeOut("300",function(){jQuery(o).remove()})}return!1});var i={items:".woocommerce_booking_person",cursor:"move",axis:"y",handle:"h3",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(e,o){o.item.css("background-color","#f6f6f6")},stop:function(e,o){o.item.removeAttr("style"),r()}};e(".woocommerce_bookable_persons").sortable(i),e("#bookings_resources").on("change","input.resource_name",function(){e(this).closest(".woocommerce_booking_resource").find("span.resource_name").text(e(this).val())}),jQuery("#bookings_resources").on("click","button.add_resource",function(){var e=jQuery(".woocommerce_booking_resource").length,o=jQuery("select.add_resource_id").val(),r="";if(!o&&!(r=prompt(wc_bookings_writepanel_js_params.i18n_new_resource_name)))return!1;jQuery(".woocommerce_bookable_resources").block({message:null});var n={action:"woocommerce_add_bookable_resource",post_id:wc_bookings_writepanel_js_params.post,loop:e,add_resource_id:o,add_resource_name:r,security:wc_bookings_writepanel_js_params.nonce_add_resource};return jQuery.post(wc_bookings_writepanel_js_params.ajax_url,n,function(e){e.error?alert(e.error):(jQuery(".woocommerce_bookable_resources").append(e.html).unblock(),jQuery(".woocommerce_bookable_resources").sortable(t),o&&jQuery(".add_resource_id").find("option[value="+o+"]").remove())}),!1}),jQuery("#bookings_resources").on("click","button.remove_booking_resource",function(e){if(e.preventDefault(),confirm(wc_bookings_writepanel_js_params.i18n_remove_resource)){var o=jQuery(this).parent().parent(),r=jQuery(this).attr("rel");jQuery(o).block({message:null,overlayCSS:{background:"#fff url("+wc_bookings_writepanel_js_params.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",opacity:.6}});var n={action:"woocommerce_remove_bookable_resource",post_id:wc_bookings_writepanel_js_params.post,resource_id:r,security:wc_bookings_writepanel_js_params.nonce_delete_resource};jQuery.post(wc_bookings_writepanel_js_params.ajax_url,n,function(e){jQuery(o).fadeOut("300",function(){jQuery(o).remove();var e=jQuery(o).find("input[name*=resource_id]").val(),r=jQuery(o).find("input[name*=resource_title]").val();jQuery("select[name=add_resource_id]").append(jQuery("<option>",{value:e,text:r}))})})}return!1});var t={items:".woocommerce_booking_resource",cursor:"move",axis:"y",handle:"h3",scrollSensitivity:40,forcePlaceholderSize:!0,helper:"clone",opacity:.65,placeholder:"wc-metabox-sortable-placeholder",start:function(e,o){o.item.css("background-color","#f6f6f6")},stop:function(e,o){o.item.removeAttr("style"),n()}};e(".woocommerce_bookable_resources").sortable(t)});
[+]
..
[-] script.js
[edit]
[-] writepanel.min.js
[edit]