Sindbad~EG File Manager

Current Path : /var/www/html/elearningbasa.sumar.com.py/question/amd/build/
Upload File :
Current File : /var/www/html/elearningbasa.sumar.com.py/question/amd/build/edit_tags.min.js.map

{"version":3,"file":"edit_tags.min.js","sources":["../src/edit_tags.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 * A javascript module to handle question tags editing.\n *\n * @deprecated since Moodle 4.0\n * @todo Final deprecation on Moodle 4.4 MDL-72438\n * @module     core_question/edit_tags\n * @copyright  2018 Simey Lameze <simey@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n            'jquery',\n            'core/fragment',\n            'core/str',\n            'core/modal_events',\n            'core/modal_factory',\n            'core/notification',\n            'core/custom_interaction_events',\n            'core_question/repository',\n            'core_question/selectors',\n        ],\n        function(\n            $,\n            Fragment,\n            Str,\n            ModalEvents,\n            ModalFactory,\n            Notification,\n            CustomEvents,\n            Repository,\n            QuestionSelectors\n        ) {\n\n    /**\n     * Enable the save button in the footer.\n     *\n     * @param {object} root The container element.\n     * @method enableSaveButton\n     */\n    var enableSaveButton = function(root) {\n        root.find(QuestionSelectors.actions.save).prop('disabled', false);\n    };\n\n    /**\n     * Disable the save button in the footer.\n     *\n     * @param {object} root The container element.\n     * @method disableSaveButton\n     */\n    var disableSaveButton = function(root) {\n        root.find(QuestionSelectors.actions.save).prop('disabled', true);\n    };\n\n    /**\n     * Get the serialised form data.\n     *\n     * @method getFormData\n     * @param {object} modal The modal object.\n     * @return {string} serialised form data\n     */\n    var getFormData = function(modal) {\n        return modal.getBody().find('form').serialize();\n    };\n\n    /**\n     * Set the element state to loading.\n     *\n     * @param {object} root The container element\n     * @method startLoading\n     */\n    var startLoading = function(root) {\n        var loadingIconContainer = root.find(QuestionSelectors.containers.loadingIcon);\n\n        loadingIconContainer.removeClass('hidden');\n    };\n\n    /**\n     * Remove the loading state from the element.\n     *\n     * @param {object} root The container element\n     * @method stopLoading\n     */\n    var stopLoading = function(root) {\n        var loadingIconContainer = root.find(QuestionSelectors.containers.loadingIcon);\n\n        loadingIconContainer.addClass('hidden');\n    };\n\n    /**\n     * Set the context Id data attribute on the modal.\n     *\n     * @param {Promise} modal The modal promise.\n     * @param {int} contextId The context id.\n     */\n    var setContextId = function(modal, contextId) {\n        modal.getBody().attr('data-contextid', contextId);\n    };\n\n    /**\n     * Get the context Id data attribute value from the modal body.\n     *\n     * @param {Promise} modal The modal promise.\n     * @return {int} The context id.\n     */\n    var getContextId = function(modal) {\n        return modal.getBody().data('contextid');\n    };\n\n    /**\n     * Set the question Id data attribute on the modal.\n     *\n     * @param {Promise} modal The modal promise.\n     * @param {int} questionId The question Id.\n     */\n    var setQuestionId = function(modal, questionId) {\n        modal.getBody().attr('data-questionid', questionId);\n    };\n\n    /**\n     * Get the question Id data attribute value from the modal body.\n     *\n     * @param {Promise} modal The modal promise.\n     * @return {int} The question Id.\n     */\n    var getQuestionId = function(modal) {\n        return modal.getBody().data('questionid');\n    };\n\n    /**\n     * Register event listeners for the module.\n     *\n     * @param {object} root The calendar root element\n     */\n    var registerEventListeners = function(root) {\n        var modalPromise = ModalFactory.create(\n            {\n                type: ModalFactory.types.SAVE_CANCEL,\n                large: false\n            },\n            [root, QuestionSelectors.actions.edittags]\n        ).then(function(modal) {\n            // All of this code only executes once, when the modal is\n            // first created. This allows us to add any code that should\n            // only be run once, such as adding event handlers to the modal.\n            Str.get_string('questiontags', 'question')\n                .then(function(string) {\n                    modal.setTitle(string);\n                    return string;\n                })\n                .fail(Notification.exception);\n\n            modal.getRoot().on(ModalEvents.save, function(e) {\n                var form = modal.getBody().find('form');\n                form.submit();\n                e.preventDefault();\n            });\n\n            modal.getRoot().on('submit', 'form', function(e) {\n                save(modal, root).then(function() {\n                    modal.hide();\n                    location.reload();\n                    return;\n                }).fail(Notification.exception);\n\n                // Stop the form from actually submitting and prevent it's\n                // propagation because we have already handled the event.\n                e.preventDefault();\n                e.stopPropagation();\n            });\n\n            return modal;\n        });\n\n        // We need to add an event handler to the tags link because there are\n        // multiple links on the page and without adding a listener we don't know\n        // which one the user clicked on the show the modal.\n        root.on(CustomEvents.events.activate, QuestionSelectors.actions.edittags, function(e) {\n            var currentTarget = $(e.currentTarget);\n\n            var questionId = currentTarget.data('questionid'),\n                canTag = !!currentTarget.data('cantag'),\n                contextId = currentTarget.data('contextid');\n\n            // This code gets called each time the user clicks the tag link\n            // so we can use it to reload the contents of the tag modal.\n            modalPromise.then(function(modal) {\n                // Display spinner and disable save button.\n                disableSaveButton(root);\n                startLoading(root);\n\n                var args = {\n                    id: questionId\n                };\n\n                var tagsFragment = Fragment.loadFragment('question', 'tags_form', contextId, args);\n                modal.setBody(tagsFragment);\n\n                tagsFragment.then(function() {\n                        enableSaveButton(root);\n                        return;\n                    })\n                    .always(function() {\n                        // Always hide the loading spinner when the request\n                        // has completed.\n                        stopLoading(root);\n                        return;\n                    })\n                .fail(Notification.exception);\n\n                // Show or hide the save button depending on whether the user\n                // has the capability to edit the tags.\n                if (canTag) {\n                    modal.getRoot().find(QuestionSelectors.actions.save).show();\n                } else {\n                    modal.getRoot().find(QuestionSelectors.actions.save).hide();\n                }\n\n                setQuestionId(modal, questionId);\n                setContextId(modal, contextId);\n\n                return modal;\n            }).fail(Notification.exception);\n\n            e.preventDefault();\n        });\n    };\n\n    /**\n     * Send the form data to the server to save question tags.\n     *\n     * @method save\n     * @param {object} modal The modal object.\n     * @param {object} root The container element.\n     * @return {object} A promise\n     */\n    var save = function(modal, root) {\n        // Display spinner and disable save button.\n        disableSaveButton(root);\n        startLoading(root);\n\n        var formData = getFormData(modal);\n        var questionId = getQuestionId(modal);\n        var contextId = getContextId(modal);\n\n        // Send the form data to the server for processing.\n        return Repository.submitTagCreateUpdateForm(questionId, contextId, formData)\n            .always(function() {\n                // Regardless of success or error we should always stop\n                // the loading icon and re-enable the buttons.\n                stopLoading(root);\n                enableSaveButton(root);\n                return;\n            })\n            .fail(Notification.exception);\n    };\n\n    return {\n        init: function(root) {\n            window.console.warn('warn: The core_question/repository has been deprecated.' +\n                'Please use qbank_tagquestion/repository instead.');\n            root = $(root);\n            registerEventListeners(root);\n        }\n    };\n});\n"],"names":["define","$","Fragment","Str","ModalEvents","ModalFactory","Notification","CustomEvents","Repository","QuestionSelectors","enableSaveButton","root","find","actions","save","prop","disableSaveButton","startLoading","containers","loadingIcon","removeClass","stopLoading","addClass","modal","formData","getBody","serialize","getFormData","questionId","data","getQuestionId","contextId","getContextId","submitTagCreateUpdateForm","always","fail","exception","init","window","console","warn","modalPromise","create","type","types","SAVE_CANCEL","large","edittags","then","get_string","string","setTitle","getRoot","on","e","submit","preventDefault","hide","location","reload","stopPropagation","events","activate","currentTarget","canTag","args","id","tagsFragment","loadFragment","setBody","show","attr","setQuestionId","setContextId","registerEventListeners"],"mappings":";;;;;;;;;AAwBAA,iCAAO,CACK,SACA,gBACA,WACA,oBACA,qBACA,oBACA,iCACA,2BACA,4BAEJ,SACIC,EACAC,SACAC,IACAC,YACAC,aACAC,aACAC,aACAC,WACAC,uBASJC,iBAAmB,SAASC,MAC5BA,KAAKC,KAAKH,kBAAkBI,QAAQC,MAAMC,KAAK,YAAY,IAS3DC,kBAAoB,SAASL,MAC7BA,KAAKC,KAAKH,kBAAkBI,QAAQC,MAAMC,KAAK,YAAY,IAoB3DE,aAAe,SAASN,MACGA,KAAKC,KAAKH,kBAAkBS,WAAWC,aAE7CC,YAAY,WASjCC,YAAc,SAASV,MACIA,KAAKC,KAAKH,kBAAkBS,WAAWC,aAE7CG,SAA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