Current Path : C:/xampp/htdocs/moodle/calendar/amd/build/ |
Current File : C:/xampp/htdocs/moodle/calendar/amd/build/calendar_threemonth.min.js.map |
{"version":3,"sources":["../src/calendar_threemonth.js"],"names":["define","$","Notification","CalendarSelectors","CalendarEvents","Templates","CalendarViewManager","registerCalendarEventListeners","root","body","on","monthChanged","dayChanged","join","e","year","month","courseId","categoryId","queue","next","processRequest","then","fail","exception","newCurrentMonth","find","newParent","closest","calendarPeriods","allMonths","previousMonth","nextMonth","placeHolder","attr","placeHolderContainer","hide","append","requestYear","requestMonth","oldMonth","is","insertBefore","data","insertAfter","Deferred","resolve","refreshMonthContent","slideUpPromise","slideDownPromise","slideUp","remove","slideDown","when","links","miniDayLink","target","day","text","calendarRoot","calendarMain","refreshDayContent","preventDefault","window","history","pushState","init"],"mappings":"AAwBAA,OAAM,qCAAC,CACH,QADG,CAEH,mBAFG,CAGH,yBAHG,CAIH,sBAJG,CAKH,gBALG,CAMH,4BANG,CAAD,CAQN,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAMIC,CANJ,CAOE,CAQE,GAAIC,CAAAA,CAA8B,CAAG,SAASC,CAAT,CAAe,CAChD,GAAIC,CAAAA,CAAI,CAAGR,CAAC,CAAC,MAAD,CAAZ,CACAQ,CAAI,CAACC,EAAL,CAAQ,CAACN,CAAc,CAACO,YAAhB,CAA8BP,CAAc,CAACQ,UAA7C,EAAyDC,IAAzD,CAA8D,GAA9D,CAAR,CAA4E,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAyBC,CAAzB,CAAmCC,CAAnC,CAA+C,CAGvHV,CAAI,CAACW,KAAL,CAAW,SAASC,CAAT,CAAe,CACtB,MAAOC,CAAAA,CAAc,CAACP,CAAD,CAAIC,CAAJ,CAAUC,CAAV,CAAiBC,CAAjB,CAA2BC,CAA3B,CAAd,CACNI,IADM,CACD,UAAW,CACb,MAAOF,CAAAA,CAAI,EACd,CAHM,E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C,CAKtDc,CAAG,CAAGF,CAAW,CAACG,IAAZ,EALgD,CAMtDzC,CAAQ,CAAGsC,CAAW,CAACZ,IAAZ,CAAiB,UAAjB,CAN2C,CAOtDzB,CAAU,CAAGqC,CAAW,CAACZ,IAAZ,CAAiB,YAAjB,CAPyC,CAQtDgB,CAAY,CAAG1D,CAAC,CAAC,MAAD,CAAD,CAAUyB,IAAV,CAAevB,CAAiB,CAACyD,YAAjC,CARuC,CAS1DtD,CAAmB,CAACuD,iBAApB,CAAsCF,CAAtC,CAAoD5C,CAApD,CAA0DC,CAA1D,CAAiEyC,CAAjE,CAAsExC,CAAtE,CAAgFC,CAAhF,CACIyC,CADJ,CACkB,4BADlB,EAEA7C,CAAC,CAACgD,cAAF,GACAC,MAAM,CAACC,OAAP,CAAeC,SAAf,CAAyB,EAAzB,CAA6B,EAA7B,CAAiC,WAAjC,CACP,CAbD,CAcH,CA1FD,CA4FA,MAAO,CACHC,IAAI,CAAE,cAAS1D,CAAT,CAAe,CACjBA,CAAI,CAAGP,CAAC,CAACO,CAAD,CAAR,CAEAD,CAA8B,CAACC,CAAD,CACjC,CALE,CAOV,CA1HK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * This module handles display of multiple mini calendars in a view, and\n * movement through them.\n *\n * @module core_calendar/calendar_threemonth\n * @package core_calendar\n * @copyright 2017 Andrew Nicols <andrew@nicols.co.uk>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/notification',\n 'core_calendar/selectors',\n 'core_calendar/events',\n 'core/templates',\n 'core_calendar/view_manager',\n],\nfunction(\n $,\n Notification,\n CalendarSelectors,\n CalendarEvents,\n Templates,\n CalendarViewManager\n) {\n\n /**\n * Listen to and handle any calendar events fired by the calendar UI.\n *\n * @method registerCalendarEventListeners\n * @param {object} root The calendar root element\n */\n var registerCalendarEventListeners = function(root) {\n var body = $('body');\n body.on([CalendarEvents.monthChanged, CalendarEvents.dayChanged].join(' '), function(e, year, month, courseId, categoryId) {\n // We have to use a queue here because the calling code is decoupled from these listeners.\n // It's possible for the event to be called multiple times before one call is fully resolved.\n root.queue(function(next) {\n return processRequest(e, year, month, courseId, categoryId)\n .then(function() {\n return next();\n })\n .fail(Notification.exception)\n ;\n });\n });\n\n var processRequest = function(e, year, month, courseId, categoryId) {\n var newCurrentMonth = root.find('[data-year=\"' + year + '\"][data-month=\"' + month + '\"]');\n var newParent = newCurrentMonth.closest(CalendarSelectors.calendarPeriods.month);\n var allMonths = root.find(CalendarSelectors.calendarPeriods.month);\n\n var previousMonth = $(allMonths[0]);\n var nextMonth = $(allMonths[2]);\n\n var placeHolder = $('<span>');\n placeHolder.attr('data-template', 'core_calendar/threemonth_month');\n placeHolder.attr('data-includenavigation', false);\n placeHolder.attr('data-mini', true);\n var placeHolderContainer = $('<div>');\n placeHolderContainer.hide();\n placeHolderContainer.append(placeHolder);\n\n var requestYear;\n var requestMonth;\n var oldMonth;\n\n if (newParent.is(previousMonth)) {\n // Fetch the new previous month.\n placeHolderContainer.insertBefore(previousMonth);\n\n requestYear = previousMonth.data('previousYear');\n requestMonth = previousMonth.data('previousMonth');\n oldMonth = nextMonth;\n } else if (newParent.is(nextMonth)) {\n // Fetch the new next month.\n placeHolderContainer.insertAfter(nextMonth);\n requestYear = nextMonth.data('nextYear');\n requestMonth = nextMonth.data('nextMonth');\n oldMonth = previousMonth;\n } else {\n return $.Deferred().resolve();\n }\n\n return CalendarViewManager.refreshMonthContent(\n placeHolder,\n requestYear,\n requestMonth,\n courseId,\n categoryId,\n placeHolder\n )\n .then(function() {\n var slideUpPromise = $.Deferred();\n var slideDownPromise = $.Deferred();\n oldMonth.slideUp('fast', function() {\n $(this).remove();\n slideUpPromise.resolve();\n });\n placeHolderContainer.slideDown('fast', function() {\n slideDownPromise.resolve();\n });\n\n return $.when(slideUpPromise, slideDownPromise);\n });\n };\n\n // Listen for a click on the day link in the three month block to load the day view.\n root.on('click', CalendarSelectors.links.miniDayLink, function(e) {\n\n var miniDayLink = $(e.target);\n var year = miniDayLink.data('year'),\n month = miniDayLink.data('month'),\n day = miniDayLink.text(),\n courseId = miniDayLink.data('courseid'),\n categoryId = miniDayLink.data('categoryid'),\n calendarRoot = $('body').find(CalendarSelectors.calendarMain);\n CalendarViewManager.refreshDayContent(calendarRoot, year, month, day, courseId, categoryId,\n calendarRoot, 'core_calendar/calendar_day');\n e.preventDefault();\n window.history.pushState({}, '', '?view=day');\n });\n };\n\n return {\n init: function(root) {\n root = $(root);\n\n registerCalendarEventListeners(root);\n }\n };\n});\n"],"file":"calendar_threemonth.min.js"}