{"version":3,"file":"notifications.min.js","sources":["https:\/\/kundenportal.comm-unity.at\/local\/wb_faq\/amd\/src\/notifications.js"],"sourcesContent":["\n\/\/ 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 * @package local_wunderbyte_table\n * @copyright Wunderbyte GmbH \n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\nimport Notification from 'core\/notification';\nimport {get_string as getString} from 'core\/str';\n\n\n\/**\n * Show success Notification.\n *\/\n export function showSuccessNotification() {\n\n getString('savesuccess', 'local_wb_faq').then(message => {\n\n Notification.addNotification({\n message,\n type: \"success\"\n });\n\n setTimeout(() => {\n let notificationslist = document.querySelectorAll('#user-notifications div.alert');\n const notificatonelement = notificationslist[notificationslist.length - 1];\n notificatonelement.remove();\n }, 5000);\n\n return;\n }).catch(e => {\n \/\/ eslint-disable-next-line no-console\n console.log(e);\n });\n}\n\n\/**\n * Show error notification.\n *\/\nexport function showErrorNotification() {\n getString('saveerror', 'local_wb_faq').then(message => {\n\n Notification.addNotification({\n message,\n type: \"danger\"\n });\n\n setTimeout(() => {\n let notificationslist = document.querySelectorAll('#user-notifications div.alert');\n const notificatonelement = notificationslist[notificationslist.length - 1];\n notificatonelement.remove();\n }, 5000);\n\n return;\n }).catch(e => {\n \/\/ eslint-disable-next-line no-console\n console.log(e);\n });\n}\n"],"names":["then","message","addNotification","type","setTimeout","notificationslist","document","querySelectorAll","length","remove","catch","e","console","log"],"mappings":";;;;;2HAuDc,YAAa,gBAAgBA,MAAKC,gCAE3BC,gBAAgB,CACzBD,QAAAA,QACAE,KAAM,WAGVC,YAAW,SACHC,kBAAoBC,SAASC,iBAAiB,iCACvBF,kBAAkBA,kBAAkBG,OAAS,GACrDC,WACpB,QAGJC,OAAMC,IAELC,QAAQC,IAAIF,uEAxCN,cAAe,gBAAgBX,MAAKC,gCAE7BC,gBAAgB,CACzBD,QAAAA,QACAE,KAAM,YAGVC,YAAW,SACHC,kBAAoBC,SAASC,iBAAiB,iCACvBF,kBAAkBA,kBAAkBG,OAAS,GACrDC,WACpB,QAGJC,OAAMC,IAELC,QAAQC,IAAIF"}