moodle_local_treestudyplan/amd/build/cfg-grades.min.js.map
2024-06-03 23:24:16 +02:00

1 line
2.0 KiB
Plaintext

{"version":3,"file":"cfg-grades.min.js","sources":["../src/cfg-grades.js"],"sourcesContent":["/* eslint-env es6*/\n// Put this file in path/to/plugin/amd/src\n// You can call it anything you like\n\n/**\n * Initialize grade cfg page\n */\nexport function init() {\n { const\n intRx = /\\d/,\n integerChange = (event) => {\n if ((event.key.length > 1) || intRx.test(event.key)\n ) {\n return;\n }\n event.preventDefault();\n };\n\n for (let input of document.querySelectorAll('input[type=\"number\"][step=\"1\"][min=\"0\"]')) {\n input.addEventListener(\"keydown\", integerChange);\n }\n\n }\n\n { const\n decimal = /^[0-9]*?\\.[0-9]*?$/,\n intRx = /\\d/,\n floatChange = (event) => {\n if ((event.key.length > 1) || ((event.key === \".\") && (!event.currentTarget.value.match(decimal)))\n || intRx.test(event.key)\n ) {\n return;\n }\n event.preventDefault();\n };\n\n for (let input of document.querySelectorAll('input[type=\"number\"][min=\"0\"]:not([step])')) {\n input.addEventListener(\"keydown\", floatChange);\n }\n for (let input of document.querySelectorAll('input[type=\"text\"].float')) {\n input.addEventListener(\"keydown\", floatChange);\n }\n\n }\n\n\n}\n\n"],"names":["intRx","integerChange","event","key","length","test","preventDefault","input","document","querySelectorAll","addEventListener","decimal","floatChange","currentTarget","value","match"],"mappings":"gKASQA,MAAQ,KACRC,cAAiBC,QACVA,MAAMC,IAAIC,OAAS,GAAMJ,MAAMK,KAAKH,MAAMC,MAI/CD,MAAMI,sBAGL,IAAIC,SAASC,SAASC,iBAAiB,2CAC1CF,MAAMG,iBAAiB,UAAWT,sBAMlCU,QAAU,qBACVX,MAAQ,KACRY,YAAeV,QACRA,MAAMC,IAAIC,OAAS,GAAsB,MAAdF,MAAMC,MAAkBD,MAAMW,cAAcC,MAAMC,MAAMJ,UAC/EX,MAAMK,KAAKH,MAAMC,MAI1BD,MAAMI,sBAGL,IAAIC,SAASC,SAASC,iBAAiB,6CAC1CF,MAAMG,iBAAiB,UAAWE,iBAE/B,IAAIL,SAASC,SAASC,iBAAiB,4BAC1CF,MAAMG,iBAAiB,UAAWE"}