Current Path : C:/xampp/htdocs/moodle/mod/quiz/amd/build/ |
Current File : C:/xampp/htdocs/moodle/mod/quiz/amd/build/add_question_modal_launcher.min.js.map |
{"version":3,"sources":["../src/add_question_modal_launcher.js"],"names":["define","$","Notification","ModalFactory","init","modalType","selector","contextId","preShowCallback","body","create","type","large","triggerElement","modal","setContextId","setAddOnPageId","attr","setTitle","fail","exception"],"mappings":"AAuBAA,OAAM,wCACF,CACI,QADJ,CAEI,mBAFJ,CAGI,oBAHJ,CADE,CAMF,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIE,CAEF,MAAO,CAWHC,IAAI,CAAE,cAASC,CAAT,CAAoBC,CAApB,CAA8BC,CAA9B,CAAyCC,CAAzC,CAA0D,CAC5D,GAAIC,CAAAA,CAAI,CAAGR,CAAC,CAAC,MAAD,CAAZ,CAOA,MAAOE,CAAAA,CAAY,CAACO,MAAb,CACH,CACIC,IAAI,CAAEN,CADV,CAEIO,KAAK,GAFT,CAKIJ,eAAe,CAAE,yBAASK,CAAT,CAAyBC,CAAzB,CAAgC,CAC7CD,CAAc,CAAGZ,CAAC,CAACY,CAAD,CAAlB,CACAC,CAAK,CAACC,YAAN,CAAmBR,CAAnB,EACAO,CAAK,CAACE,cAAN,CAAqBH,CAAc,CAACI,IAAf,CAAoB,gBAApB,CAArB,EACAH,CAAK,CAACI,QAAN,CAAeL,CAAc,CAACI,IAAf,CAAoB,aAApB,CAAf,EAEA,GAAIT,CAAJ,CAAqB,CACjBA,CAAe,CAACK,CAAD,CAAiBC,CAAjB,CAClB,CACJ,CAdL,CADG,CAmBH,CAACL,CAAD,CAAOH,CAAP,CAnBG,EAoBLa,IApBK,CAoBAjB,CAAY,CAACkB,SApBb,CAqBV,CAxCE,CA0CV,CAtDK,CAAN","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 * @package mod_quiz\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 * @return {promise} Resolved with the modal\n */\n init: function(modalType, selector, contextId, preShowCallback) {\n var body = $('body');\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 // 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"],"file":"add_question_modal_launcher.min.js"}