{"version":3,"file":"logging.min.js","sources":["https:\/\/elearning.unipd.it\/cla\/blocks\/bfmanager\/amd\/src\/logging.js"],"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 .\n\n\/**\n * Adds logging data for block_bfmanager.\n *\n * @author Jay Churchward \n * @copyright 2022 Brickfield Education Labs \n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\nimport Ajax from \"core\/ajax\";\n\n\/**\n * Initialising the module.\n *\n * @param {integer} courseid\n *\/\nexport function init(courseid) {\n document.addEventListener('click', e => {\n const trigger = e.target.closest('.block_bfmanager_guidelink');\n if (trigger) {\n addModalLog(courseid);\n }\n });\n document.addEventListener('click', e => {\n const trigger = e.target.closest('#block_bfmanager_toggle-accessmap');\n if (trigger) {\n addHeatmapLog(courseid);\n }\n });\n}\n\n\/**\n * Triggers an event to be logged when a guide modal is opened.\n *\n * @param {integer} courseid\n *\/\nconst addModalLog = (courseid) => {\n Ajax.call([{\n methodname: 'tool_bfplus_add_log_data',\n args: {\n 'courseid': courseid,\n 'categoryid': 0,\n 'component': 'block_bfmanager',\n 'eventname': 'bfmanager_modal_opened'\n },\n }]);\n};\n\n\/**\n * Triggers an event to be logged when the heatmap is toggled.\n *\n * @param {integer} courseid\n *\/\nconst addHeatmapLog = (courseid) => {\n Ajax.call([{\n methodname: 'tool_bfplus_add_log_data',\n args: {\n 'courseid': courseid,\n 'categoryid': 0,\n 'component': 'block_bfmanager',\n 'eventname': 'bfmanager_heatmap_toggled'\n },\n }]);\n};"],"names":["courseid","document","addEventListener","e","target","closest","addModalLog","addHeatmapLog","call","methodname","args"],"mappings":";;;;;;;oFA8BqBA,UACjBC,SAASC,iBAAiB,SAASC,IACfA,EAAEC,OAAOC,QAAQ,+BAE7BC,YAAYN,aAGpBC,SAASC,iBAAiB,SAASC,IACfA,EAAEC,OAAOC,QAAQ,sCAE7BE,cAAcP,wEAUpBM,YAAeN,yBACZQ,KAAK,CAAC,CACPC,WAAY,2BACZC,KAAM,UACUV,oBACE,YACD,4BACA,8BAUnBO,cAAiBP,yBACdQ,KAAK,CAAC,CACPC,WAAY,2BACZC,KAAM,UACUV,oBACE,YACD,4BACA"}