File: /var/www/html/demo.sumarbc.com.py/theme/moove/amd/build/accessibilitysettings_modal.min.js.map
{"version":3,"file":"accessibilitysettings_modal.min.js","sources":["../src/accessibilitysettings_modal.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 * Theme settings modal js.\n *\n * @package\n * @copyright 2022 Willian Mano - https://conecti.me\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/notification', 'core/custom_interaction_events', 'core/modal', 'core/modal_registry', 'core/ajax'],\n function(jQuery, Notification, CustomEvents, Modal, ModalRegistry, Ajax) {\n /**\n * Is modal registered?\n */\n var registered = false;\n /**\n * Elements selectors.\n */\n var SELECTORS = {\n SAVE_BUTTON: '[data-action=\"save\"]',\n CANCEL_BUTTON: '[data-action=\"cancel\"]'\n };\n\n /**\n * Constructor for the Modal.\n *\n * @param {object} root The root jQuery element for the modal\n */\n var AccessibilityModal = function(root) {\n Modal.call(this, root);\n\n var request = Ajax.call([{\n methodname: 'theme_moove_getthemesettings',\n args: {}\n }]);\n\n request[0].done(function(result) {\n document.getElementById('fonttype').value = result.fonttype;\n\n if (result.enableaccessibilitytoolbar) {\n document.getElementById('enableaccessibilitytoolbar').checked = true;\n }\n });\n };\n\n AccessibilityModal.TYPE = 'theme_moove-themesettings_modal';\n AccessibilityModal.prototype = Object.create(Modal.prototype);\n AccessibilityModal.prototype.constructor = AccessibilityModal;\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n AccessibilityModal.prototype.registerEventListeners = function() {\n // Apply parent event listeners.\n Modal.prototype.registerEventListeners.call(this);\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.SAVE_BUTTON, function() {\n var request = Ajax.call([{\n methodname: 'theme_moove_savethemesettings',\n args: {\n formdata: this.getFormData()\n }\n }]);\n\n request[0].done(function() {\n document.location.reload(true);\n }).fail(function(error) {\n var message = error.message;\n\n if (!message) {\n message = error.error;\n }\n\n Notification.addNotification({\n message: message,\n type: 'error'\n });\n\n this.hide();\n\n this.destroy();\n }.bind(this));\n }.bind(this));\n\n this.getModal().on(CustomEvents.events.activate, SELECTORS.CANCEL_BUTTON, function() {\n this.hide();\n this.destroy();\n }.bind(this));\n };\n\n /**\n * Get the serialised form data.\n *\n * @method getFormData\n * @return {string} serialised form data\n */\n AccessibilityModal.prototype.getFormData = function() {\n return this.getForm().serialize();\n };\n\n /**\n * Get the form element from the modal.\n *\n * @method getForm\n * @return {object}\n */\n AccessibilityModal.prototype.getForm = function() {\n return this.getBody().find('form');\n };\n\n // Automatically register with the modal registry the first time this module is imported so that you can create modals\n // of this type using the modal factory.\n if (!registered) {\n ModalRegistry.register(AccessibilityModal.TYPE, AccessibilityModal, 'theme_moove/accessibilitysettings_modal');\n registered = true;\n }\n\n return AccessibilityModal;\n });"],"names":["define","jQuery","Notification","CustomEvents","Modal","ModalRegistry","Ajax","registered","SELECTORS","AccessibilityModal","root","call","this","methodname","args","done","result","document","getElementById","value","fonttype","enableaccessibilitytoolbar","checked","TYPE","prototype","Object","create","constructor","registerEventListeners","getModal","on","events","activate","formdata","getFormData","location","reload","fail","error","message","addNotification","type","hide","destroy","bind","getForm","serialize","getBody","find","register"],"mappings":";;;;;;;AAsBAA,OAAM,0CAAC,CAAC,SAAU,oBAAqB,iCAAkC,aAAc,sBAAuB,cAC1G,SAASC,OAAQC,aAAcC,aAAcC,MAAOC,cAAeC,MAI/D,IAAIC,YAAa,EAIbC,sBACa,uBADbA,wBAEe,yBAQfC,mBAAqB,SAAS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