Merge branch 'MDL-71818-master-test4' of git://github.com/rezaies/moodle

This commit is contained in:
Sara Arjona 2021-12-29 09:13:12 +01:00
commit 995ed32cf5
3 changed files with 3 additions and 3 deletions

View File

@ -1,2 +1,2 @@
define ("core_calendar/calendar",["jquery","core/ajax","core/str","core/templates","core/notification","core/custom_interaction_events","core/modal_events","core/modal_factory","core_calendar/modal_event_form","core_calendar/summary_modal","core_calendar/repository","core_calendar/events","core_calendar/view_manager","core_calendar/crud","core_calendar/selectors","core/config"],function(a,b,c,d,f,g,h,i,j,k,l,m,n,o,p,q){var r={ROOT:"[data-region='calendar']",DAY:"[data-region='day']",NEW_EVENT_BUTTON:"[data-action='new-event-button']",DAY_CONTENT:"[data-region='day-content']",LOADING_ICON:".loading-icon",VIEW_DAY_LINK:"[data-action='view-day-link']",CALENDAR_MONTH_WRAPPER:".calendarwrapper",TODAY:".today",DAY_NUMBER_CIRCLE:".day-number-circle",DAY_NUMBER:".day-number"},s=function(b,c,e,g){var h=null,i=g.attr("data-day-timestamp");if(e){h=e.attr("data-day-timestamp")}if(!e||h!=i){d.render("core/loading",{}).then(function(a,b){g.find(r.DAY_CONTENT).addClass("hidden");d.appendNodeContents(g,a,b);if(e){e.find(r.DAY_CONTENT).addClass("hidden");d.appendNodeContents(e,a,b)}}).then(function(){return l.updateEventStartDay(c,i)}).then(function(){a("body").trigger(m.eventMoved,[c,e,g])}).always(function(){var a=g.find(r.LOADING_ICON);g.find(r.DAY_CONTENT).removeClass("hidden");d.replaceNode(a,"","");if(e){var b=e.find(r.LOADING_ICON);e.find(r.DAY_CONTENT).removeClass("hidden");d.replaceNode(b,"","")}}).fail(f.exception)}},t=function(b,c){var d=a("body");d.on(m.created,function(){n.reloadCurrentMonth(b)});d.on(m.deleted,function(){n.reloadCurrentMonth(b)});d.on(m.updated,function(){n.reloadCurrentMonth(b)});d.on(m.editActionEvent,function(a,b){window.location.assign(b)});d.on(m.moveEvent,s);d.on(m.eventMoved,function(){n.reloadCurrentMonth(b)});o.registerEditListeners(b,c)},u=function(b){var c=document.getElementById(p.fullCalendarView);b.on("click",r.VIEW_DAY_LINK,function(d){var e=a(d.target).closest(r.VIEW_DAY_LINK),g=e.data("year"),h=e.data("month"),i=e.data("day"),j=e.data("courseid"),k=e.data("categoryid"),l="?view=day&time="+e.data("timestamp");if(c){n.refreshDayContent(b,g,h,i,j,k,b,"core_calendar/calendar_day").then(function(){d.preventDefault();return n.updateUrl(l)}).fail(f.exception)}else{window.location.assign(q.wwwroot+"/calendar/view.php"+l)}});b.on("change",p.elements.courseSelector,function(){var c=a(this),d=c.val();n.reloadCurrentMonth(b,d,null).then(function(){return b.find(p.elements.courseSelector).val(d)}).fail(f.exception)});var d=o.registerEventFormModal(b),e=a(r.CALENDAR_MONTH_WRAPPER).data("context-id");t(b,d);if(e){b.on("click",r.DAY,function(g){var e=a(g.target),h="side-pre"===b.parents("aside").data("blockregion");if(!c&&h){var i=e.closest(r.DAY),j="?view=day&time="+i.data("day-timestamp");window.location.assign(q.wwwroot+"/calendar/view.php"+j)}else{var k=e.closest(r.VIEW_DAY_LINK);if(!k){var l=a(this).attr("data-new-event-timestamp");d.then(function(a){var b=e.closest(p.wrapper);a.setCourseId(b.data("courseid"));var c=b.data("categoryid");if("undefined"!=typeof c){a.setCategoryId(c)}a.setContextId(b.data("contextId"));a.setStartTime(l);a.show()}).fail(f.exception)}}g.preventDefault()})}};return{init:function init(b){b=a(b);n.init(b);u(b)}}});
define ("core_calendar/calendar",["jquery","core/ajax","core/str","core/templates","core/notification","core/custom_interaction_events","core/modal_events","core/modal_factory","core_calendar/modal_event_form","core_calendar/summary_modal","core_calendar/repository","core_calendar/events","core_calendar/view_manager","core_calendar/crud","core_calendar/selectors","core/config"],function(a,b,c,d,f,g,h,i,j,k,l,m,n,o,p,q){var r={ROOT:"[data-region='calendar']",DAY:"[data-region='day']",NEW_EVENT_BUTTON:"[data-action='new-event-button']",DAY_CONTENT:"[data-region='day-content']",LOADING_ICON:".loading-icon",VIEW_DAY_LINK:"[data-action='view-day-link']",CALENDAR_MONTH_WRAPPER:".calendarwrapper",TODAY:".today",DAY_NUMBER_CIRCLE:".day-number-circle",DAY_NUMBER:".day-number"},s=function(b,c,e,g){var h=null,i=g.attr("data-day-timestamp");if(e){h=e.attr("data-day-timestamp")}if(!e||h!=i){d.render("core/loading",{}).then(function(a,b){g.find(r.DAY_CONTENT).addClass("hidden");d.appendNodeContents(g,a,b);if(e){e.find(r.DAY_CONTENT).addClass("hidden");d.appendNodeContents(e,a,b)}}).then(function(){return l.updateEventStartDay(c,i)}).then(function(){a("body").trigger(m.eventMoved,[c,e,g])}).always(function(){var a=g.find(r.LOADING_ICON);g.find(r.DAY_CONTENT).removeClass("hidden");d.replaceNode(a,"","");if(e){var b=e.find(r.LOADING_ICON);e.find(r.DAY_CONTENT).removeClass("hidden");d.replaceNode(b,"","")}}).fail(f.exception)}},t=function(b,c){var d=a("body");d.on(m.created,function(){n.reloadCurrentMonth(b)});d.on(m.deleted,function(){n.reloadCurrentMonth(b)});d.on(m.updated,function(){n.reloadCurrentMonth(b)});d.on(m.editActionEvent,function(a,b){window.location.assign(b)});d.on(m.moveEvent,s);d.on(m.eventMoved,function(){n.reloadCurrentMonth(b)});o.registerEditListeners(b,c)},u=function(b){var c=document.getElementById(p.fullCalendarView);b.on("click",r.VIEW_DAY_LINK,function(d){var e=a(d.target).closest(r.VIEW_DAY_LINK),g=e.data("year"),h=e.data("month"),i=e.data("day"),j=e.data("courseid"),k=e.data("categoryid"),l="?view=day&time="+e.data("timestamp");if(c){n.refreshDayContent(b,g,h,i,j,k,b,"core_calendar/calendar_day").then(function(){d.preventDefault();return n.updateUrl(l)}).fail(f.exception)}else{window.location.assign(q.wwwroot+"/calendar/view.php"+l)}});b.on("change",p.elements.courseSelector,function(){var c=a(this),d=c.val();n.reloadCurrentMonth(b,d,null).then(function(){return b.find(p.elements.courseSelector).val(d)}).fail(f.exception)});var d=o.registerEventFormModal(b),e=a(r.CALENDAR_MONTH_WRAPPER).data("context-id");t(b,d);if(e){b.on("click",r.DAY,function(g){var e=a(g.target),h="side-pre"===b.parents("aside").data("blockregion");if(!c&&h){var i=e.closest(r.DAY),j="?view=day&time="+i.data("day-timestamp");window.location.assign(q.wwwroot+"/calendar/view.php"+j)}else{var k=e.closest(r.VIEW_DAY_LINK).length;if(!k){var l=a(this).attr("data-new-event-timestamp");d.then(function(a){var b=e.closest(p.wrapper);a.setCourseId(b.data("courseid"));var c=b.data("categoryid");if("undefined"!=typeof c){a.setCategoryId(c)}a.setContextId(b.data("contextId"));a.setStartTime(l);a.show()}).fail(f.exception)}}g.preventDefault()})}};return{init:function init(b){b=a(b);n.init(b);u(b)}}});
//# sourceMappingURL=calendar.min.js.map

File diff suppressed because one or more lines are too long

View File

@ -222,7 +222,7 @@ define([
const url = '?view=day&time=' + dateContainer.data('day-timestamp');
window.location.assign(Config.wwwroot + '/calendar/view.php' + url);
} else {
const hasViewDayLink = target.closest(SELECTORS.VIEW_DAY_LINK);
const hasViewDayLink = target.closest(SELECTORS.VIEW_DAY_LINK).length;
const shouldShowNewEventModal = !hasViewDayLink;
if (shouldShowNewEventModal) {
var startTime = $(this).attr('data-new-event-timestamp');