%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/ava/mod/quiz/amd/build/
Upload File :
Create Path :
Current File : /home/vacivi36/ava/mod/quiz/amd/build/add_question_modal_launcher.min.js.map

{"version":3,"file":"add_question_modal_launcher.min.js","sources":["../src/add_question_modal_launcher.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 * Initialise the an add question modal on the quiz page.\n *\n * @module    mod_quiz/add_question_modal_launcher\n * @copyright 2018 Ryan Wyllie <ryan@moodle.com>\n * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n    [\n        'jquery',\n        'core/notification',\n        'core/modal_factory',\n    ],\n    function(\n        $,\n        Notification,\n        ModalFactory\n    ) {\n\n    return {\n        /**\n         * Create a modal using the modal factory and add listeners to launch the\n         * modal when clicked.\n         *\n         * @param  {string} modalType Which modal to create\n         * @param  {string} selector The selectors for the elements that trigger the modal\n         * @param  {int} contextId The current context id\n         * @param  {function} preShowCallback A callback to execute before the modal is shown\n         * @param  {boolean} showNewCategory  Display the New category tab when selecting random questions.\n         * @return {promise} Resolved with the modal\n         */\n        init: function(modalType, selector, contextId, preShowCallback, showNewCategory = true) {\n            var body = $('body');\n            let templateContext = {\n                hidden: showNewCategory,\n            };\n\n            // Create a question bank modal using the factory.\n            // The same modal will be used by all of the add question\n            // links that match \"selector\" on the page. The content\n            // of the modal will be changed depending on which link is\n            // clicked.\n            return ModalFactory.create(\n                {\n                    type: modalType,\n                    large: true,\n                    templateContext: templateContext,\n                    // This callback executes before the modal is shown when the\n                    // trigger element is clicked.\n                    preShowCallback: function(triggerElement, modal) {\n                        triggerElement = $(triggerElement);\n                        modal.setContextId(contextId);\n                        modal.setAddOnPageId(triggerElement.attr('data-addonpage'));\n                        modal.setTitle(triggerElement.attr('data-header'));\n\n                        if (preShowCallback) {\n                            preShowCallback(triggerElement, modal);\n                        }\n                    }\n                },\n                // Created a deligated listener rather than a single\n                // trigger element.\n                [body, selector]\n            ).fail(Notification.exception);\n        }\n    };\n});\n"],"names":["define","$","Notification","ModalFactory","init","modalType","selector","contextId","preShowCallback","showNewCategory","body","templateContext","hidden","create","type","large","triggerElement","modal","setContextId","setAddOnPageId","attr","setTitle","fail","exception"],"mappings":";;;;;;;AAsBAA,8CACI,CACI,SACA,oBACA,uBAEJ,SACIC,EACAC,aACAC,oBAGG,CAYHC,KAAM,SAASC,UAAWC,SAAUC,UAAWC,qBAAiBC,+EACxDC,KAAOT,EAAE,YACTU,gBAAkB,CAClBC,OAAQH,wBAQLN,aAAaU,OAChB,CACIC,KAAMT,UACNU,OAAO,EACPJ,gBAAiBA,gBAGjBH,gBAAiB,SAASQ,eAAgBC,OACtCD,eAAiBf,EAAEe,gBACnBC,MAAMC,aAAaX,WACnBU,MAAME,eAAeH,eAAeI,KAAK,mBACzCH,MAAMI,SAASL,eAAeI,KAAK,gBAE/BZ,iBACAA,gBAAgBQ,eAAgBC,SAM5C,CAACP,KAAMJ,WACTgB,KAAKpB,aAAaqB"}

Zerion Mini Shell 1.0