mirror of
https://github.com/moodle/moodle.git
synced 2025-02-22 19:06:51 +01:00
Moodle announced that support for IE would be dropped back in August 2020 with Moodle 3.9 but not active steps were taken at that time. That decision was made in MDLSITE-6109 and this particular step was meant to be taken in Moodle 3.10. This is the first step taken to actively drop support for IE. This commit also bumps the browser support pattern from 0.25% to 0.3%. The percentage here includes any browser where at least this percentage of users worldwide may be using a browser. In this case it causes support for Android 4.3-4.4 to be dropped, which relate to Android KitKat (released 2013). This combination of changes means that all of the supported browsers in our compatibility list support modern features including async, for...of, classes, native Promises, and more which has a huge impact on the ease of debugging code, and drastically reduces the minified file size because a number of native Polyfills included by Babel are no longer included.
1 line
4.6 KiB
Plaintext
1 line
4.6 KiB
Plaintext
{"version":3,"file":"default_notification_preferences.min.js","sources":["../src/default_notification_preferences.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 <http://www.gnu.org/licenses/>.\n\n/**\n * Controls the default settings for the list of notification types on the\n * notifications admin page\n *\n * @module core_message/default_notification_preferences\n * @class default_notification_preferences\n * @copyright 2021 Moodle\n * @author Pau Ferrer Ocaña <pau@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nconst selectors = {\n provider: '.defaultmessageoutputs .provider_enabled',\n lockSetting: '.locked_message_setting',\n enabledSetting: '.enabled_message_setting',\n allSettings: '.locked_message_setting, .enabled_message_setting'\n};\n\n/**\n * Register event listeners for the default_notification_preferences page.\n */\nconst registerEventListeners = () => {\n\n /**\n * Update the dimmed status of the \"enabled\" toggle on the notification setting.\n *\n * @param {HTMLElement} lockedElement Element that receives the event.\n */\n const toggleLockSetting = (lockedElement) => {\n const isEnabled = lockedElement.checked || false;\n const enabledId = lockedElement.id.replace('_locked[', '_enabled[');\n\n const enabledElement = document.getElementById(enabledId).closest('div.custom-control');\n enabledElement.classList.toggle('dimmed_text', isEnabled);\n };\n\n /**\n * Enable/Disable all settings of the provider.\n *\n * @param {HTMLElement} providerEnabledElement Element that receives the event.\n */\n const toggleEnableProviderSettings = (providerEnabledElement) => {\n const isEnabled = providerEnabledElement.checked || false;\n const parentRow = providerEnabledElement.closest('tr');\n\n const elements = parentRow.querySelectorAll(selectors.allSettings);\n elements.forEach((element) => {\n element.toggleAttribute('disabled', !isEnabled);\n });\n };\n\n const container = document.querySelector('.preferences-container');\n\n container.querySelectorAll(selectors.provider).forEach((providerEnabledElement) => {\n // Set the initial statuses.\n if (!providerEnabledElement.checked) {\n toggleEnableProviderSettings(providerEnabledElement);\n }\n\n providerEnabledElement.addEventListener('change', (e) => {\n toggleEnableProviderSettings(e.target);\n });\n });\n\n container.querySelectorAll(selectors.lockSetting).forEach((lockedElement) => {\n // Set the initial statuses.\n if (lockedElement.checked) {\n toggleLockSetting(lockedElement);\n }\n\n lockedElement.addEventListener('change', (e) => {\n toggleLockSetting(e.target);\n });\n });\n};\n\n/**\n * Initialize the page.\n */\nconst init = () => {\n registerEventListeners();\n};\n\nexport default {\n init: init,\n};\n"],"names":["selectors","init","toggleLockSetting","lockedElement","isEnabled","checked","enabledId","id","replace","document","getElementById","closest","classList","toggle","toggleEnableProviderSettings","providerEnabledElement","querySelectorAll","forEach","element","toggleAttribute","container","querySelector","addEventListener","e","target","registerEventListeners"],"mappings":";;;;;;;;;;;MA0BMA,mBACQ,2CADRA,sBAEW,0BAFXA,sBAIW,iEAoEF,CACXC,KALS,KA1DkB,YAOrBC,kBAAqBC,sBACjBC,UAAYD,cAAcE,UAAW,EACrCC,UAAYH,cAAcI,GAAGC,QAAQ,WAAY,aAEhCC,SAASC,eAAeJ,WAAWK,QAAQ,sBACnDC,UAAUC,OAAO,cAAeT,YAQ7CU,6BAAgCC,+BAC5BX,UAAYW,uBAAuBV,UAAW,EAClCU,uBAAuBJ,QAAQ,MAEtBK,iBAAiBhB,uBACnCiB,SAASC,UACdA,QAAQC,gBAAgB,YAAaf,eAIvCgB,UAAYX,SAASY,cAAc,0BAEzCD,UAAUJ,iBAAiBhB,oBAAoBiB,SAASF,yBAE/CA,uBAAuBV,SACxBS,6BAA6BC,wBAGjCA,uBAAuBO,iBAAiB,UAAWC,IAC/CT,6BAA6BS,EAAEC,cAIvCJ,UAAUJ,iBAAiBhB,uBAAuBiB,SAASd,gBAEnDA,cAAcE,SACdH,kBAAkBC,eAGtBA,cAAcmB,iBAAiB,UAAWC,IACtCrB,kBAAkBqB,EAAEC,eAS5BC"} |