{"version":3,"file":"infobanner.min.js","sources":["https:\/\/moodle.polymtl.ca\/theme\/boost_union\/amd\/src\/infobanner.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 * Theme Boost Union - JS code infobanner\n *\n * @module theme_boost_union\/infobanner\n * @copyright 2022 Alexander Bias, lern.link GmbH \n * @copyright on behalf of Zurich University of Applied Sciences (ZHAW)\n * @copyright based on code from theme_boost_campus by Kathrin Osswald.\n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\ndefine(['jquery'], function($) {\n \"use strict\";\n\n \/**\n * Initialising.\n *\/\n function initInfoBanner() {\n \/\/ Register click handler for all close buttons.\n $('.themeboostunioninfobanner .close').on('click', function() {\n \/\/ As soon as the button was clicked, get the number of the info banner.\n var infobannerno = $(this).attr('data-infobanner-no');\n\n \/\/ And store the dismissing of the info banner as a user preference to persist this decision.\n require(['core_user\/repository'], function(UserRepository) {\n UserRepository.setUserPreference('theme_boost_union_infobanner' + infobannerno + '_dismissed', true);\n });\n });\n }\n\n return {\n init: function() {\n initInfoBanner();\n }\n };\n});\n"],"names":["define","$","init","on","infobannerno","this","attr","require","UserRepository","setUserPreference"],"mappings":";;;;;;;;;AAyBAA,sCAAO,CAAC,WAAW,SAASC,SAmBjB,CACHC,KAAM,WAZND,EAAE,qCAAqCE,GAAG,SAAS,eAE3CC,aAAeH,EAAEI,MAAMC,KAAK,sBAGhCC,QAAQ,CAAC,yBAAyB,SAASC,gBACvCA,eAAeC,kBAAkB,+BAAiCL,aAAe,cAAc"}