1 line
9.2 KiB
JavaScript
1 line
9.2 KiB
JavaScript
|
timely.define(["jquery_timely","scripts/calendar/print","scripts/calendar/agenda_view","scripts/calendar/month_view","libs/frontend_utils","libs/utils","ai1ec_calendar","ai1ec_config","scripts/common_scripts/frontend/common_frontend","libs/select2_multiselect_helper","external_libs/twig","agenda","oneday","month","external_libs/jquery_history","external_libs/jquery.tablescroller","external_libs/jquery.scrollTo","external_libs/bootstrap_datepicker","external_libs/bootstrap/alert","external_libs/jquery_cookie"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p){e.cookie.json=!0;var d="ai1ec_saved_filter",v=!e("#save_filtered_views").hasClass("ai1ec-hide");timely.renderer_map||(timely.renderer_map={}),e.extend(timely.renderer_map,{agenda:c,oneday:h,week:h,month:p});var m=function(t){var n=t.find("#ai1ec-view-dropdown .ai1ec-dropdown-menu .ai1ec-active a"),i=u.week_view_ends_at-u.week_view_starts_at,s=i*60;t.find("table.ai1ec-week-view-original").tableScroll({height:s,containerClass:"ai1ec-week-view ai1ec-popover-boundary",scroll:!1}),t.find("table.ai1ec-oneday-view-original").tableScroll({height:s,containerClass:"ai1ec-oneday-view ai1ec-popover-boundary",scroll:!1});if(t.find(".ai1ec-week-view").length||t.find(".ai1ec-oneday-view").length)t.find(".ai1ec-oneday-view .tablescroll_wrapper, .ai1ec-week-view .tablescroll_wrapper").scrollTo(t.find(".ai1ec-hour-marker:eq("+u.week_view_starts_at+")")),t.find(".ai1ec-hour-marker:eq("+u.week_view_starts_at+")").addClass("ai1ec-first-visible");t.find(".ai1ec-month-view .ai1ec-multiday").length&&r.extend_multiday_events(t),t.find(".ai1ec-calendar-view-container").data("ai1ec-inited",!0).trigger("initialize_view.ai1ec"),t.find(".ai1ec-calendar-toolbar").trigger("ai1ec-affix.reinit"),e(".ai1ec-event[data-ticket-url], .ai1ec-has-tickets-button").each(function(){var t=e(this),n=t.data("ticket-url"),r=e.merge(e(".ai1ec-sas-action-tickets",t),e(".ai1ec-sas-action-tickets",t.parent("a").next(".ai1ec-popover"))).attr("href",n)})},g=function(t){t.find(".ai1ec-calendar-view-container").trigger("destroy_view.ai1ec");var n=t.find(".ai1ec-minical-trigger").data("datepicker");typeof n!="undefined"&&(n.picker.remove(),e(document).off("changeDate",".ai1ec-minical-trigger")),t.find(".ai1ec-tooltip.ai1ec-in, .ai1ec-popup").remove(),t.find(".ai1ec-calendar-toolbar .ai1ec-btn-toolbar").remove()},y=function(){var t=[],n=[],r=[],i;e(".ai1ec-category-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){t.push(e(this).data("term"))}),e(".ai1ec-tag-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){n.push(e(this).data("term"))}),e(".ai1ec-author-filter .ai1ec-dropdown-menu .ai1ec-active").each(function(){r.push(e(this).data("term"))});var s={};return s.cat_ids=t,s.tag_ids=n,s.auth_ids=r,i=e(".ai1ec-views-dropdown .ai1ec-dropdown-menu .ai1ec-active").data("action"),s.action=i,s},b=function(){var t=History.getState(),n=e.cookie(d);if(null===n||undefined===n)n={};var r=y();u.is_calendar_page?n.calendar_page=r:n[t.url]=r,e.cookie(d,n,{path:"/",expires:365}),e("#save_filtered_views").addClass("ai1ec-active").attr("data-original-title",u.clear_saved_filter_text);var i=s.make_alert(u.save_filter_text_ok,"success");e("#ai1ec-calendar").prepend(i)},w=function(t){t.stopImmediatePropagation();var n=e.cookie(d);if(u.is_calendar_page)delete n.calendar_page;else{var r=History.getState();delete n[r.url]}e.cookie(d,n,{path:"/",expires:365}),e("#save_filtered_views").removeClass("ai1ec-active").attr("data-original-title",u.reset_saved_filter_text),v||e("#save_filtered_views").addClass("ai1ec-hide");var i=s.make_alert(u.remove_filter_text_ok,"success");e("#ai1ec-calendar").prepend(i)},E=!1,S={},x=function(t,n,r){D(t,n),t.find(".ai1ec-calendar-view-loading").fadeIn("fast").end().find(".ai1ec-calendar-view").fadeTo("fast",.3,function(){var i={request_type:r,ai1ec_doing_ajax:!0};e("#ai1ec-container > .ai1ec-alert").remove(),E&&1===E.readyState&&E.abort("ai1ec_abort");var o="-"+i.request_type;S[n+o]?E=S[n+o]:(E=e.ajax({url:n,dataType:r,data:i,method:"GET"}),S[n+o]=E.promise()),E.done(function(i){e(document).trigger("calendar_vi
|