Current Path : /var/www/ljmtc/cbt/blocks/timeline/amd/build/ |
Current File : /var/www/ljmtc/cbt/blocks/timeline/amd/build/calendar_events_repository.min.js.map |
{"version":3,"sources":["../src/calendar_events_repository.js"],"names":["define","$","Ajax","Notification","queryByTime","args","hasOwnProperty","limit","limitnum","timesortfrom","starttime","timesortto","endtime","limittononsuspendedevents","promise","call","methodname","fail","exception","queryByCourse","queryByCourses"],"mappings":"AAsBAA,OAAM,6CAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAAD,CAA+C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgC,CA4IjF,MAAO,CACHC,WAAW,CAjCG,QAAdA,CAAAA,WAAc,CAASC,CAAT,CAAe,CAC7B,GAAI,CAACA,CAAI,CAACC,cAAL,CAAoB,OAApB,CAAL,CAAmC,CAC/BD,CAAI,CAACE,KAAL,GACH,CAEDF,CAAI,CAACG,QAAL,CAAgBH,CAAI,CAACE,KAArB,CACA,MAAOF,CAAAA,CAAI,CAACE,KAAZ,CAEA,GAAIF,CAAI,CAACC,cAAL,CAAoB,WAApB,CAAJ,CAAsC,CAClCD,CAAI,CAACI,YAAL,CAAoBJ,CAAI,CAACK,SAAzB,CACA,MAAOL,CAAAA,CAAI,CAACK,SACf,CAED,GAAIL,CAAI,CAACC,cAAL,CAAoB,SAApB,CAAJ,CAAoC,CAChCD,CAAI,CAACM,UAAL,CAAkBN,CAAI,CAACO,OAAvB,CACA,MAAOP,CAAAA,CAAI,CAACO,OACf,CAEDP,CAAI,CAACQ,yBAAL,IAlB6B,GAyBzBC,CAAAA,CAAO,CAAGZ,CAAI,CAACa,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,6CADF,CAEVX,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAzBe,CA2B7BS,CAAO,CAACG,IAAR,CAAad,CAAY,CAACe,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAEM,CAEHK,aAAa,CA3HG,QAAhB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M,UAAL,CAAkBN,CAAI,CAACO,OAAvB,CACA,MAAOP,CAAAA,CAAI,CAACO,OACf,CAjB+B,GAwB5BE,CAAAA,CAAO,CAAGZ,CAAI,CAACa,IAAL,CAAU,CALV,CACVC,UAAU,CAAE,4CADF,CAEVX,IAAI,CAAEA,CAFI,CAKU,CAAV,EAAqB,CAArB,CAxBkB,CA0BhCS,CAAO,CAACG,IAAR,CAAad,CAAY,CAACe,SAA1B,EAEA,MAAOJ,CAAAA,CACV,CAgDM,CAKV,CAjJK,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 * A javascript module to retrieve calendar events from the server.\n *\n * @module block_timeline/calendar_events_repository\n * @copyright 2018 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notification) {\n\n var DEFAULT_LIMIT = 20;\n\n /**\n * Retrieve a list of calendar events for the logged in user for the\n * given course.\n *\n * Valid args are:\n * int courseid Only get events for this course\n * int starttime Only get events after this time\n * int endtime Only get events before this time\n * int limit Limit the number of results returned\n * int aftereventid Offset the result set from the given id\n *\n * @method queryByCourse\n * @param {object} args The request arguments\n * @return {promise} Resolved with an array of the calendar events\n */\n var queryByCourse = function(args) {\n if (!args.hasOwnProperty('limit')) {\n args.limit = DEFAULT_LIMIT;\n }\n\n args.limitnum = args.limit;\n delete args.limit;\n\n if (args.hasOwnProperty('starttime')) {\n args.timesortfrom = args.starttime;\n delete args.starttime;\n }\n\n if (args.hasOwnProperty('endtime')) {\n args.timesortto = args.endtime;\n delete args.endtime;\n }\n\n var request = {\n methodname: 'core_calendar_get_action_events_by_course',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Retrieve a list of calendar events for the given courses for the\n * logged in user.\n *\n * Valid args are:\n * array courseids Get events for these courses\n * int starttime Only get events after this time\n * int endtime Only get events before this time\n * int limit Limit the number of results returned\n *\n * @method queryByCourses\n * @param {object} args The request arguments\n * @return {promise} Resolved with an array of the calendar events\n */\n var queryByCourses = function(args) {\n if (!args.hasOwnProperty('limit')) {\n // This is intentionally smaller than the default limit.\n args.limit = 10;\n }\n\n args.limitnum = args.limit;\n delete args.limit;\n\n if (args.hasOwnProperty('starttime')) {\n args.timesortfrom = args.starttime;\n delete args.starttime;\n }\n\n if (args.hasOwnProperty('endtime')) {\n args.timesortto = args.endtime;\n delete args.endtime;\n }\n\n var request = {\n methodname: 'core_calendar_get_action_events_by_courses',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n /**\n * Retrieve a list of calendar events for the logged in user after the given\n * time.\n *\n * Valid args are:\n * int starttime Only get events after this time\n * int endtime Only get events before this time\n * int limit Limit the number of results returned\n * int aftereventid Offset the result set from the given id\n *\n * @method queryByTime\n * @param {object} args The request arguments\n * @return {promise} Resolved with an array of the calendar events\n */\n var queryByTime = function(args) {\n if (!args.hasOwnProperty('limit')) {\n args.limit = DEFAULT_LIMIT;\n }\n\n args.limitnum = args.limit;\n delete args.limit;\n\n if (args.hasOwnProperty('starttime')) {\n args.timesortfrom = args.starttime;\n delete args.starttime;\n }\n\n if (args.hasOwnProperty('endtime')) {\n args.timesortto = args.endtime;\n delete args.endtime;\n }\n // Don't show events related to courses that the user is suspended in.\n args.limittononsuspendedevents = true;\n\n var request = {\n methodname: 'core_calendar_get_action_events_by_timesort',\n args: args\n };\n\n var promise = Ajax.call([request])[0];\n\n promise.fail(Notification.exception);\n\n return promise;\n };\n\n return {\n queryByTime: queryByTime,\n queryByCourse: queryByCourse,\n queryByCourses: queryByCourses,\n };\n});\n"],"file":"calendar_events_repository.min.js"}