1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
|
timely.define(["jquery_timely","domReady","libs/utils","ai1ec_config","scripts/add_new_event/event_location/gmaps_helper","scripts/add_new_event/event_location/input_coordinates_event_handlers","scripts/add_new_event/event_location/input_coordinates_utility_functions","scripts/add_new_event/event_date_time/date_time_event_handlers","scripts/add_new_event/event_cost_helper","external_libs/jquery.calendrical_timespan","external_libs/jquery.inputdate","external_libs/jquery.tools","external_libs/bootstrap_datepicker","external_libs/bootstrap/transition","external_libs/bootstrap/collapse","external_libs/bootstrap/modal","external_libs/bootstrap/alert","external_libs/bootstrap/tab","external_libs/select2"],function(e,t,n,r,i,s,o,u,a,f){var l=function(){var t=new Date(r.now*1e3),n={allday:"#ai1ec_all_day_event",start_date_input:"#ai1ec_start-date-input",start_time_input:"#ai1ec_start-time-input",start_time:"#ai1ec_start-time",end_date_input:"#ai1ec_end-date-input",end_time_input:"#ai1ec_end-time-input",end_time:"#ai1ec_end-time",date_format:r.date_format,month_names:r.month_names,day_names:r.day_names,week_start_day:r.week_start_day,twentyfour_hour:r.twentyfour_hour,now:t};e.timespan(n)},c=function(){e(".ai1ec-panel-collapse").on("hide",function(){e(this).parent().removeClass("ai1ec-overflow-visible")}),e(".ai1ec-panel-collapse").on("shown",function(){var t=e(this);window.setTimeout(function(){t.parent().addClass("ai1ec-overflow-visible")},350)})},h=function(){l(),timely.require(["libs/gmaps"],function(e){e(i.init_gmaps)})},p=function(t,n){var r=null;"[object Array]"===Object.prototype.toString.call(n)?r=n.join("<br>"):r=n,e("#ai1ec_event_inline_alert").html(r),e("#ai1ec_event_inline_alert").removeClass("ai1ec-hidden"),t.preventDefault(),e("#publish, #ai1ec_bottom_publish").removeClass("button-primary-disabled"),e("#publish, #ai1ec_bottom_publish").removeClass("disabled"),e("#publish, #ai1ec_bottom_publish").siblings("#ajax-loading, .spinner").css("visibility","hidden")},d=function(t){o.ai1ec_check_lat_long_fields_filled_when_publishing_event(t)===!0&&(o.ai1ec_convert_commas_to_dots_for_coordinates(),o.ai1ec_check_lat_long_ok_for_search(t));var i=!1,s=[];e("#ai1ec_ticket_ext_url, #ai1ec_contact_url").each(function(){var t=this.value;e(this).removeClass("ai1ec-input-warn");var o=e(this).closest(".ai1ec-panel-collapse").parent().find(".ai1ec-panel-heading .ai1ec-fa-warning");i||o.addClass("ai1ec-hidden").parent().removeClass("ai1ec-tab-title-error");var u=e(this).attr("id"),a="ai1ec_ticket_ext_url"===u;if(""!==t&&!1===n.isValidUrl(t,a)){o.removeClass("ai1ec-hidden").parent().addClass("ai1ec-tab-title-error"),i||e(this).closest(".ai1ec-panel-collapse").collapse("show"),i=!0;var f=u+"_not_valid";s.push(r[f]),e(this).addClass("ai1ec-input-warn")}});var u=e("#ai1ec_contact_email"),a=u.closest(".ai1ec-panel-collapse").parent().find(".ai1ec-panel-heading .ai1ec-fa-warning");u.removeClass("ai1ec-input-warn"),i||a.addClass("ai1ec-hidden").parent().removeClass("ai1ec-tab-title-error");var f=e.trim(u.val());if(""!==f&&!1===n.isValidEmail(f)){a.removeClass("ai1ec-hidden").parent().addClass("ai1ec-tab-title-error"),i||u.closest(".ai1ec-panel-collapse").collapse("show"),i=!0;var l=u.attr("id")+"_not_valid";s.push(r[l]),u.addClass("ai1ec-input-warn")}var c=e("#title, #ai1ec_contact_name, #ai1ec_contact_email, #ai1ec_contact_phone, #content");if(e("#ai1ec_has_tickets").prop("checked")){c.addClass("ai1ec-required"),E(),e("#content").hasClass("ai1ec-error")?T(!0):T(!1);if(e(".ai1ec-error").not(".ai1ec-hidden .ai1ec-error").length||e(".ai1ec-tax-options-button").hasClass("ai1ec-required-error"))i=!0,e("#ai1ec-add-new-event-accordion > .ai1ec-panel-default > .ai1ec-panel-collapse").removeClass("ai1ec-collapse").css("height","auto"),s.push(r.ticketing_required_fields);e("#ai1ec_repeat").prop("checked")===!0&&(i=!0,s.push(r.ticketing_repeat_not_supported));if(!1===i){var h=0,d=0;e(".ai1ec-tickets-edit-form").not(".ai1ec-tickets-form-template").each(function(){var t=e(this),n=!1;t.find(".ai1ec-tickets-fields").remove(),t.find("select, input").each(fu
|