{"version":3,"file":"script.min.js","sources":["https:\/\/www.virtual.facen.una.py\/gradofacen\/local\/accessibility\/widgets\/linkhighlight\/amd\/src\/script.js"],"sourcesContent":["\/\/ This file is part of Moodle - https:\/\/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 * Link highlight widget JS\n *\n * @module accessibility\/linkhighlight\n * @copyright 2025 Ponlawat Weerapanpisit \n * @license https:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\nimport $ from 'jquery';\nimport { saveWidgetConfig } from 'local_accessibility\/common';\n\n\/**\n * Initialisation\n *\n * @param {string|number|undefined} data\n *\/\nexport const init = (data) => {\n $(() => {\n const $body = $('body');\n const $container = $('#accessibility_linkhighlight-container');\n if (!$container.length) {\n return;\n }\n const $btn = $container.find('.btn-toggler');\n if (!$btn.length) {\n return;\n }\n\n let userdata = data;\n\n const updatebtn = () => {\n $btn.html(userdata ? M.str.accessibility_linkhighlight.enabled : M.str.accessibility_linkhighlight.disabled);\n $btn.removeClass('btn-primary');\n $btn.removeClass('btn-light');\n $btn.addClass(userdata ? 'btn-primary' : 'btn-light');\n };\n updatebtn();\n\n $btn.on('click', async() => {\n userdata = userdata ? undefined : 1;\n if (userdata) {\n $body.addClass('accessibility-linkhighlight-enabled');\n } else {\n $body.removeClass('accessibility-linkhighlight-enabled');\n }\n updatebtn();\n await saveWidgetConfig('linkhighlight', userdata);\n });\n });\n};\n"],"names":["data","$body","$container","length","$btn","find","userdata","updatebtn","html","M","str","accessibility_linkhighlight","enabled","disabled","removeClass","addClass","on","async","undefined"],"mappings":";;;;;;;wJA+BqBA,4BACf,WACQC,OAAQ,mBAAE,QACVC,YAAa,mBAAE,8CAChBA,WAAWC,oBAGVC,KAAOF,WAAWG,KAAK,oBACxBD,KAAKD,kBAING,SAAWN,WAETO,UAAY,KACdH,KAAKI,KAAKF,SAAWG,EAAEC,IAAIC,4BAA4BC,QAAUH,EAAEC,IAAIC,4BAA4BE,UACnGT,KAAKU,YAAY,eACjBV,KAAKU,YAAY,aACjBV,KAAKW,SAAST,SAAW,cAAgB,cAE7CC,YAEAH,KAAKY,GAAG,SAASC,UACbX,SAAWA,cAAWY,EAAY,EAC9BZ,SACAL,MAAMc,SAAS,uCAEfd,MAAMa,YAAY,uCAEtBP,kBACM,4BAAiB,gBAAiBD"}