Current Path : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/ |
Current File : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/competencydialogue.min.js.map |
{"version":3,"sources":["../src/competencydialogue.js"],"names":["define","$","notification","ajax","templates","str","Dialogue","instance","Competencydialogue","prototype","triggerCompetencyViewedEvent","competencyId","call","methodname","args","id","showDialogue","competencyid","options","datapromise","getCompetencyDataPromise","localthis","done","data","render","html","competency","shortname","fail","exception","showDialogueFromData","dataSource","enhanceDialogue","clickEventHandler","e","compdialogue","currentTarget","includerelated","includecourses","preventDefault","requests","then","context","init","delegate","bind"],"mappings":"AAuBAA,OAAM,8BAAC,CAAC,QAAD,CACC,mBADD,CAEC,WAFD,CAGC,gBAHD,CAIC,UAJD,CAKC,kBALD,CAAD,CAMC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAgCC,CAAhC,CAA2CC,CAA3C,CAAgDC,CAAhD,CAA0D,IAOzDC,CAAAA,CAPyD,CAezDC,CAAkB,CAAG,UAAW,CAEnC,CAjB4D,CAyB7DA,CAAkB,CAACC,SAAnB,CAA6BC,4BAA7B,CAA4D,SAASC,CAAT,CAAuB,CAC/ER,CAAI,CAACS,IAAL,CAAU,CAAC,CACHC,UAAU,CAAE,mCADT,CAEHC,IAAI,CAAE,CAACC,EAAE,CAAEJ,CAAL,CAFH,CAAD,CAAV,CAIH,CALD,CAcAH,CAAkB,CAACC,SAAnB,CAA6BO,YAA7B,CAA4C,SAASC,CAAT,CAAuBC,CAAvB,CAAgC,IAEpEC,CAAAA,CAAW,CAAG,KAAKC,wBAAL,CAA8BH,CAA9B,CAA4CC,CAA5C,CAFsD,CAGpEG,CAAS,CAAG,IAHwD,CAIxEF,CAAW,CAACG,IAAZ,CAAiB,SAASC,CAAT,CAAe,CAE5BnB,CAAS,CAACoB,MAAV,CAAiB,4BAAjB,CAA+CD,CAA/C,EACKD,IADL,CACU,SAASG,CAAT,CAAe,CAEjBJ,CAAS,CAACX,4BAAV,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,CAAwD,SAASH,CAAT,CAAuBC,CAAvB,CAAgC,CAEpF,GAAIsB,CAAAA,CAAQ,CAAGrC,CAAI,CAACS,IAAL,CAAU,CACrB,CAACC,UAAU,CAAE,qCAAb,CACEC,IAAI,CAAE,CAACG,YAAY,CAAEA,CAAf,CACEoB,cAAc,CAAEnB,CAAO,CAACmB,cAAR,IADlB,CAEEC,cAAc,CAAEpB,CAAO,CAACoB,cAAR,IAFlB,CADR,CADqB,CAAV,CAAf,CASA,MAAOE,CAAAA,CAAQ,CAAC,CAAD,CAAR,CAAYC,IAAZ,CAAiB,SAASC,CAAT,CAAkB,CACvC,MAAOA,CAAAA,CACT,CAFM,EAEJd,IAFI,CAEC1B,CAAY,CAAC2B,SAFd,CAGV,CAdD,CAgBA,MAAuD,CAOnDc,IAAI,CAAE,eAAW,CACb,GAAwB,WAApB,QAAOpC,CAAAA,CAAX,CAAqC,CACjC,MACH,CAGDA,CAAQ,CAAG,GAAIC,CAAAA,CAAf,CACAP,CAAC,CAAC,MAAD,CAAD,CAAU2C,QAAV,CAAmB,uCAAnB,CAA0D,OAA1D,CAAmE,CAACT,YAAY,CAAE5B,CAAf,CAAnE,CACIA,CAAQ,CAAC0B,iBAAT,CAA2BY,IAA3B,CAAgCtC,CAAhC,CADJ,CAEH,CAhBkD,CAkB1D,CAzJK,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 * Display Competency in dialogue box.\n *\n * @module tool_lp/Competencydialogue\n * @package tool_lp\n * @copyright 2015 Issam Taboubi <issam.taboubi@umontreal.ca>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery',\n 'core/notification',\n 'core/ajax',\n 'core/templates',\n 'core/str',\n 'tool_lp/dialogue'],\n function($, notification, ajax, templates, str, Dialogue) {\n\n /**\n * The main instance we'll be working with.\n *\n * @type {Competencydialogue}\n */\n var instance;\n\n /**\n * Constructor for CompetencyDialogue.\n *\n * @param {Object} options\n *\n */\n var Competencydialogue = function() {\n // Intentionally left empty.\n };\n\n /**\n * Log the competency viewed event.\n *\n * @param {Number} competencyId The competency ID.\n * @method triggerCompetencyViewedEvent\n */\n Competencydialogue.prototype.triggerCompetencyViewedEvent = function(competencyId) {\n ajax.call([{\n methodname: 'core_competency_competency_viewed',\n args: {id: competencyId}\n }]);\n };\n\n /**\n * Display a dialogue box by competencyid.\n *\n * @param {Number} competencyid The competency ID.\n * @param {Object} options The options.\n * @method showDialogue\n */\n Competencydialogue.prototype.showDialogue = function(competencyid, options) {\n\n var datapromise = this.getCompetencyDataPromise(competencyid, options);\n var localthis = this;\n datapromise.done(function(data) {\n // Inner Html in the dialogue content.\n templates.render('tool_lp/competency_summary', data)\n .done(function(html) {\n // Log competency viewed event.\n localthis.triggerCompetencyViewedEvent(competencyid);\n\n // Show the dialogue.\n new Dialogue(\n data.competency.shortname,\n html\n );\n }).fail(notification.exception);\n }).fail(notification.exception);\n };\n\n /**\n * Display a dialogue box from data.\n *\n * @param {Object} dataSource data to be used to display dialogue box\n * @method showDialogueFromData\n */\n Competencydialogue.prototype.showDialogueFromData = function(dataSource) {\n\n var localthis = this;\n // Inner Html in the dialogue content.\n templates.render('tool_lp/competency_summary', dataSource)\n .done(function(html) {\n // Log competency viewed event.\n localthis.triggerCompetencyViewedEvent(dataSource.id);\n\n // Show the dialogue.\n new Dialogue(\n dataSource.shortname,\n html,\n localthis.enhanceDialogue\n );\n }).fail(notification.exception);\n };\n\n /**\n * The action on the click event.\n *\n * @param {Event} e event click\n * @method clickEventHandler\n */\n Competencydialogue.prototype.clickEventHandler = function(e) {\n\n var compdialogue = e.data.compdialogue;\n var currentTarget = $(e.currentTarget);\n var competencyid = currentTarget.data('id');\n var includerelated = !(currentTarget.data('excluderelated'));\n var includecourses = currentTarget.data('includecourses');\n\n // Show the dialogue box.\n compdialogue.showDialogue(competencyid, {\n includerelated: includerelated,\n includecourses: includecourses\n });\n e.preventDefault();\n };\n\n /**\n * Get a promise on data competency.\n *\n * @param {Number} competencyid\n * @param {Object} options\n * @return {Promise} return promise on data request\n * @method getCompetencyDataPromise\n */\n Competencydialogue.prototype.getCompetencyDataPromise = function(competencyid, options) {\n\n var requests = ajax.call([\n {methodname: 'tool_lp_data_for_competency_summary',\n args: {competencyid: competencyid,\n includerelated: options.includerelated || false,\n includecourses: options.includecourses || false\n }\n }\n ]);\n\n return requests[0].then(function(context) {\n return context;\n }).fail(notification.exception);\n };\n\n return /** @alias module:tool_lp/competencydialogue */ {\n\n /**\n * Initialise the competency dialogue module.\n *\n * Only the first call matters.\n */\n init: function() {\n if (typeof instance !== 'undefined') {\n return;\n }\n\n // Instantiate the one instance and delegate event on the body.\n instance = new Competencydialogue();\n $('body').delegate('[data-action=\"competency-dialogue\"]', 'click', {compdialogue: instance},\n instance.clickEventHandler.bind(instance));\n }\n };\n});\n"],"file":"competencydialogue.min.js"}