Current Path : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/ |
Current File : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/evidence_delete.min.js.map |
{"version":3,"sources":["../src/evidence_delete.js"],"names":["define","$","Notification","Ajax","Str","Log","selectors","register","triggerSelector","containerSelector","delegate","e","parent","currentTarget","parents","length","error","evidenceId","data","preventDefault","stopPropagation","get_strings","key","component","done","strings","confirm","promise","call","methodname","args","id","then","remove","fail","exception"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,UAHD,CAIC,UAJD,CAAD,CAKE,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAAqCC,CAArC,CAA0C,IAE1CC,CAAAA,CAAS,CAAG,EAF8B,CA4D9C,MAAoD,CAShDC,QAAQ,CA3DG,QAAXA,CAAAA,QAAW,CAASC,CAAT,CAA0BC,CAA1B,CAA6C,CACxD,GAA0C,WAAtC,QAAOH,CAAAA,CAAS,CAACE,CAAD,CAApB,CAAuD,CACnD,MACH,CAEDF,CAAS,CAACE,CAAD,CAAT,CAA6BP,CAAC,CAAC,MAAD,CAAD,CAAUS,QAAV,CAAmBF,CAAnB,CAAoC,OAApC,CAA6C,SAASG,CAAT,CAAY,CAClF,GAAIC,CAAAA,CAAM,CAAGX,CAAC,CAACU,CAAC,CAACE,aAAH,CAAD,CAAmBC,OAAnB,CAA2BL,CAA3B,CAAb,CACA,GAAI,CAACG,CAAM,CAACG,MAAR,EAAkC,CAAhB,CAAAH,CAAM,CAACG,MAA7B,CAAyC,CACrCV,CAAG,CAACW,KAAJ,CAAU,iDAAV,EACA,MACH,CACD,GAAIC,CAAAA,CAAU,CAAGL,CAAM,CAACM,IAAP,CAAY,IAAZ,CAAjB,CACA,GAAI,CAACD,CAAL,CAAiB,CACbZ,CAAG,CAACW,KAAJ,CAAU,4BAAV,EACA,MACH,CAEDL,CAAC,CAACQ,cAAF,GACAR,CAAC,CAACS,eAAF,GAEAhB,CAAG,CAACiB,WAAJ,CAAgB,CACZ,CAACC,GAAG,CAAE,SAAN,CAAiBC,SAAS,CAAE,QAA5B,CADY,CAEZ,CAACD,GAAG,CAAE,YAAN,CAAoBC,SAAS,CAAE,QAA/B,CAFY,CAGZ,CAACD,GAAG,CAAE,QAAN,CAAgBC,SAAS,CAAE,QAA3B,CAHY,CAIZ,CAACD,GAAG,CAAE,QAAN,CAAgBC,SAAS,CAAE,QAA3B,CAJY,CAAhB,EAKGC,IALH,CAKQ,SAASC,CAAT,CAAkB,CACtBvB,CAAY,CAACwB,OAAb,CACID,CAAO,CAAC,CAAD,CADX,CAEIA,CAAO,CAAC,CAAD,CAFX,CAGIA,CAAO,CAAC,CAAD,CAHX,CAIIA,CAAO,CAAC,CAAD,CAJX,CAKI,UAAW,CACP,GAAIE,CAAAA,CAAO,CAAGxB,CAAI,CAACyB,IAAL,CAAU,CAAC,CACrBC,UAAU,CAAE,iCADS,CAErBC,IAAI,CAAE,CACFC,EAAE,CAAEd,CADF,CAFe,CAAD,CAAV,CAAd,CAMAU,CAAO,CAAC,CAAD,CAAP,CAAWK,IAAX,CAAgB,UAAW,CACvBpB,CAAM,CAACqB,MAAP,EAEH,CAHD,EAGGC,IAHH,CAGQhC,CAAY,CAACiC,SAHrB,CAIH,CAhBL,CAkBH,CAxBD,EAwBGD,IAxBH,CAwBQhC,CAAY,CAACiC,SAxBrB,CA2BH,CA1C4B,CA2ChC,CAEmD,CAYvD,CA7EK,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 * Evidence delete.\n *\n * @package tool_lp\n * @copyright 2016 Frédéric Massart - FMCorz.net\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/str',\n 'core/log'],\n function($, Notification, Ajax, Str, Log) {\n\n var selectors = {};\n\n /**\n * Register an event listener.\n *\n * @param {String} triggerSelector The node on which the click will happen.\n * @param {String} containerSelector The parent node that will be removed and contains the evidence ID.\n */\n var register = function(triggerSelector, containerSelector) {\n if (typeof selectors[triggerSelector] !== 'undefined') {\n return;\n }\n\n selectors[triggerSelector] = $('body').delegate(triggerSelector, 'click', function(e) {\n var parent = $(e.currentTarget).parents(containerSelector);\n if (!parent.length || parent.length > 1) {\n Log.error('None or too many evidence container were found.');\n return;\n }\n var evidenceId = parent.data('id');\n if (!evidenceId) {\n Log.error('Evidence ID was not found.');\n return;\n }\n\n e.preventDefault();\n e.stopPropagation();\n\n Str.get_strings([\n {key: 'confirm', component: 'moodle'},\n {key: 'areyousure', component: 'moodle'},\n {key: 'delete', component: 'moodle'},\n {key: 'cancel', component: 'moodle'}\n ]).done(function(strings) {\n Notification.confirm(\n strings[0], // Confirm.\n strings[1], // Are you sure?\n strings[2], // Delete.\n strings[3], // Cancel.\n function() {\n var promise = Ajax.call([{\n methodname: 'core_competency_delete_evidence',\n args: {\n id: evidenceId\n }\n }]);\n promise[0].then(function() {\n parent.remove();\n return;\n }).fail(Notification.exception);\n }\n );\n }).fail(Notification.exception);\n\n\n });\n };\n\n return /** @alias module:tool_lp/evidence_delete */ {\n\n /**\n * Register an event listener.\n *\n * @param {String} triggerSelector The node on which the click will happen.\n * @param {String} containerSelector The parent node that will be removed and contains the evidence ID.\n * @return {Void}\n */\n register: register\n };\n\n});\n"],"file":"evidence_delete.min.js"}