芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/wp-event-manager/assets/js/event-submission.min.js
EventSubmission=function(){return{init:function(){Common.logInfo("EventSubmission.init..."),jQuery("body").on("click",".event-manager-remove-uploaded-file",(function(){return jQuery(this).closest(".event-manager-uploaded-file").remove(),!1})),jQuery("#event_start_time").length>0&&jQuery("#event_start_time").timepicker({timeFormat:wp_event_manager_event_submission.i18n_timepicker_format,step:wp_event_manager_event_submission.i18n_timepicker_step}),jQuery("#event_end_time").length>0&&jQuery("#event_end_time").timepicker({timeFormat:wp_event_manager_event_submission.i18n_timepicker_format,step:wp_event_manager_event_submission.i18n_timepicker_step}),jQuery('input[data-picker="timepicker"]').length>0&&jQuery('input[data-picker="timepicker"]').timepicker({timeFormat:wp_event_manager_event_submission.i18n_timepicker_format,step:wp_event_manager_event_submission.i18n_timepicker_step}),jQuery('input[data-picker="datepicker"]#event_start_date').length>0&&(wp_event_manager_event_submission.start_of_week=parseInt(wp_event_manager_event_submission.start_of_week),wp_event_manager_event_submission.show_past_date?jQuery('input[data-picker="datepicker"]#event_start_date').datepicker({dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames}).on("change",(function(){jQuery("#event_end_date").datepicker("destroy"),jQuery('input[data-picker="datepicker"]#event_end_date').datepicker({minDate:jQuery("#event_start_date").val(),dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames})})):jQuery('input[data-picker="datepicker"]#event_start_date').datepicker({minDate:0,dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames}).on("change",(function(){jQuery("#event_end_date").datepicker("destroy"),jQuery('input[data-picker="datepicker"]#event_end_date').datepicker({minDate:jQuery("#event_start_date").val(),dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames})}))),jQuery('input[data-picker="datepicker"]#event_end_date').length>0&&jQuery('input[data-picker="datepicker"]#event_end_date').datepicker({dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames,beforeShow:function(e,t){var n=jQuery('input[data-picker="datepicker"]#event_start_date').datepicker("getDate");jQuery(this).datepicker("option","minDate",n)}}).on("change",(function(){jQuery("#event_registration_deadline").datepicker("destroy"),wp_event_manager_event_submission.show_past_date?jQuery('input[data-picker="datepicker"]#event_registration_deadline').datepicker({maxDate:jQuery("#event_end_date").val(),dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames}):jQuery('input[data-picker="datepicker"]#event_registration_deadline').datepicker({minDate:0,maxDate:jQuery("#event_end_date").val(),dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames})})),jQuery('input[data-picker="datepicker"]#event_registration_deadline').length>0&&(wp_event_manager_event_submission.show_past_date?jQuery('input[data-picker="datepicker"]#event_registration_deadline').datepicker({maxDate:jQuery("#event_end_date").val(),dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames}):jQuery('input[data-picker="datepicker"]#event_registration_deadline').datepicker({minDate:0,maxDate:jQuery("#event_end_date").val(),dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames})),jQuery('input[data-picker="datepicker"]').length>0&&(wp_event_manager_event_submission.show_past_date?jQuery('input[data-picker="datepicker"]').datepicker({dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames}):jQuery('input[data-picker="datepicker"]').datepicker({minDate:0,dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week,monthNames:wp_event_manager_event_submission.monthNames})),jQuery("#event_online").length>0&&"yes"==jQuery("input[name=event_online]:checked").val()&&(jQuery(".fieldset-event_venue_name").length>0&&jQuery("input[name=event_venue_name]").length>0&&(jQuery("input[name=event_venue_name]").attr("required")&&jQuery("input[name=event_venue_name]").attr("required",!1),jQuery(".fieldset-event_venue_name").hide()),jQuery(".fieldset-event_address").length>0&&jQuery("input[name=event_address]").length>0&&(jQuery("input[name=event_address]").attr("required")&&jQuery("input[name=event_address]").attr("required",!1),jQuery(".fieldset-event_address").hide()),jQuery(".fieldset-event_pincode").length>0&&jQuery("input[name=event_pincode]").length>0&&(jQuery("input[name=event_pincode]").attr("required")&&jQuery("input[name=event_pincode]").attr("required",!1),jQuery(".fieldset-event_pincode").hide()),jQuery(".fieldset-event_location").length>0&&jQuery("input[name=event_location]").length>0&&(jQuery("input[name=event_location]").attr("required")&&jQuery("input[name=event_location]").attr("required",!1),jQuery(".fieldset-event_location").hide()),jQuery(".fieldset-event_venue_ids").length>0&&jQuery(".fieldset-event_venue_ids").hide()),jQuery("#event_ticket_options").length>0&&"free"==jQuery("#event_ticket_options:checked").val()&&(jQuery("input[name=event_ticket_price]").attr("required")&&jQuery("input[name=event_ticket_price]").attr("required",!1),jQuery(".fieldset-event_ticket_price").hide()),jQuery("input[name=event_online]").on("change",EventSubmission.actions.onlineEvent),jQuery("input[name=event_ticket_options]").on("change",EventSubmission.actions.eventTicketOptions),jQuery("body").on("click",".wpem_add_organizer",EventSubmission.actions.addOrganizer),jQuery("body").on("click",".wpem_add_venue",EventSubmission.actions.addVenue),jQuery(".add-group-row").on("click",EventSubmission.actions.addGroupField),jQuery(document).delegate(".remove-group-row","click",EventSubmission.actions.removeGroupField)},actions:{addGroupField:function(e){var t=jQuery(this).closest(".field"),n=0;t.find("input.group-row").each((function(){parseInt(jQuery(this).val())>n&&(n=parseInt(jQuery(this).val()))}));var i=jQuery(this).data("row").replace(/%%group-row-index%%/g,n+1);i=i.replace(/%group-row-index%/g,n+1),jQuery(this).before(i),t.find('input[data-picker="datepicker"]').length>0&&t.find('input[data-picker="datepicker"]').datepicker({dateFormat:wp_event_manager_event_submission.i18n_datepicker_format,firstDay:wp_event_manager_event_submission.start_of_week}),t.find('input[data-picker="timepicker"]').length>0&&t.find('input[data-picker="timepicker"]').timepicker({timeFormat:wp_event_manager_event_submission.i18n_timepicker_format,step:wp_event_manager_event_submission.i18n_timepicker_step}),t.find('select[multiple="multiple"]').length>0&&t.find('select[multiple="multiple"]').chosen(),e.preventDefault()},removeGroupField:function(e){jQuery("."+this.id).remove(),e.preventDefault()},onlineEvent:function(e){e.preventDefault(),Common.logInfo("EventDashboard.actions.onlineEvent..."),jQuery("#event_online").length>0&&("yes"==jQuery(this).val()?(jQuery(".fieldset-event_venue_name").length>0&&jQuery("input[name=event_venue_name]").length>0&&(jQuery("input[name=event_venue_name]").attr("required")&&jQuery("input[name=event_venue_name]").attr("required",!1),jQuery(".fieldset-event_venue_name").hide()),jQuery(".fieldset-event_address").length>0&&jQuery("input[name=event_address]").length>0&&(jQuery("input[name=event_address]").attr("required")&&jQuery("input[name=event_address]").attr("required",!1),jQuery(".fieldset-event_address").hide()),jQuery(".fieldset-event_pincode").length>0&&jQuery("input[name=event_pincode]").length>0&&(jQuery("input[name=event_pincode]").attr("required")&&jQuery("input[name=event_pincode]").attr("required",!1),jQuery(".fieldset-event_pincode").hide()),jQuery(".fieldset-event_location").length>0&&jQuery("input[name=event_location]").length>0&&(jQuery("input[name=event_location]").attr("required")&&jQuery("input[name=event_location]").attr("required",!1),jQuery(".fieldset-event_location").hide()),jQuery(".fieldset-event_venue_ids").length>0&&jQuery(".fieldset-event_venue_ids").hide()):(jQuery(".fieldset-event_venue_name").length>0&&jQuery("input[name=event_venue_name]").length>0&&(jQuery("input[name=event_venue_name]").attr("required")&&jQuery("input[name=event_venue_name]").attr("required",!0),jQuery(".fieldset-event_venue_name").show()),jQuery(".fieldset-event_address").length>0&&jQuery("input[name=event_address]").length>0&&(jQuery("input[name=event_address]").attr("required")&&jQuery("input[name=event_address]").attr("required",!0),jQuery(".fieldset-event_address").show()),jQuery(".fieldset-event_pincode").length>0&&jQuery("input[name=event_pincode]").length>0&&(jQuery("input[name=event_pincode]").attr("required")&&jQuery("input[name=event_pincode]").attr("required",!0),jQuery(".fieldset-event_pincode").show()),jQuery(".fieldset-event_location").length>0&&jQuery("input[name=event_location]").length>0&&(jQuery("input[name=event_location]").attr("required")&&jQuery("input[name=event_location]").attr("required",!0),jQuery(".fieldset-event_location").show()),jQuery(".fieldset-event_venue_ids").length>0&&jQuery(".fieldset-event_venue_ids").show()))},eventTicketOptions:function(e){e.preventDefault(),Common.logInfo("EventDashboard.actions.eventTicketOptions..."),jQuery("#event_ticket_options").length>0&&("free"==jQuery(this).val()?jQuery(".fieldset-event_ticket_price").length>0&&jQuery("input[name=event_ticket_price]").length>0&&(jQuery("input[name=event_ticket_price]").attr("required")&&jQuery("input[name=event_ticket_price]").attr("required",!1),jQuery(".fieldset-event_ticket_price").hide()):(jQuery(".fieldset-event_ticket_price").length>0&&jQuery("input[name=event_ticket_price]").length>0&&jQuery("input[name=event_ticket_price]").attr("required")&&jQuery("input[name=event_ticket_price]").attr("required",!0),jQuery(".fieldset-event_ticket_price").show()))},addOrganizer:function(e){jQuery(".wpem_add_organizer").css("pointer-events","none"),jQuery("#wpem_add_organizer_popup .wpem-modal-header-close .wpem-modal-close").trigger("click"),jQuery("body #submit-organizer-form .wpem-form-footer .wpem-alert-danger").remove();var t=jQuery("body #submit-organizer-form").serialize(),n=tinyMCE.get("organizer_description").getContent(),i=new FormData;jQuery("#organizer_logo").length>0&&i.append("organizer_logo",jQuery("#organizer_logo")[0].files[0]),i.append("action","add_organizer"),i.append("form_data",t),i.append("organizer_description",n),jQuery.ajax({url:wp_event_manager_event_submission.ajax_url,type:"POST",dataType:"JSON",processData:!1,contentType:!1,data:i,success:function(e){200==e.code?(jQuery("select#event_organizer_ids").prepend('
'+e.organizer.organizer_name+"
"),jQuery("#event_organizer_ids").trigger("chosen:updated"),jQuery("body #submit-organizer-form .event-manager-uploaded-files").remove(),jQuery("body #submit-organizer-form")[0].reset(),jQuery(".wpem_add_organizer").css("pointer-events","auto")):(jQuery(".wpem_add_organizer").css("pointer-events","auto"),jQuery("body #submit-organizer-form .wpem-form-footer .wpem_add_organizer").after(e.message))}})},addVenue:function(e){jQuery(".wpem_add_venue").css("pointer-events","none"),jQuery("#wpem_add_venue_popup .wpem-modal-header-close .wpem-modal-close").trigger("click"),jQuery("body #submit-venue-form .wpem-form-footer .wpem-alert-danger").remove();var t=jQuery("body #submit-venue-form").serialize(),n=tinyMCE.get("venue_description").getContent(),i=new FormData;console.log(jQuery("#venue_logo")[0]),void 0!==jQuery("#venue_logo")[0]&&i.append("venue_logo",jQuery("#venue_logo")[0].files[0]),i.append("action","add_venue"),i.append("form_data",t),i.append("venue_description",n),jQuery.ajax({url:wp_event_manager_event_submission.ajax_url,type:"POST",dataType:"JSON",processData:!1,contentType:!1,data:i,success:function(e){200==e.code?(jQuery("select#event_venue_ids").append('
'+e.venue.venue_name+"
"),jQuery("#event_venue_ids").trigger("chosen:updated"),jQuery("body #submit-venue-form .event-manager-uploaded-files").remove(),jQuery("body #submit-venue-form")[0].reset(),jQuery(".wpem_add_venue").css("pointer-events","auto")):(jQuery(".wpem_add_venue").css("pointer-events","auto"),jQuery("body #submit-venue-form .wpem-form-footer .wpem_add_venue").after(e.message))}})}}}},EventSubmission=EventSubmission(),jQuery(document).ready((function(e){EventSubmission.init()}));