Your IP : 192.168.165.1


Current Path : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/
Upload File :
Current File : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/competency_rule.min.js.map

{"version":3,"sources":["../src/competency_rule.js"],"names":["define","$","Rule","tree","_eventNode","_ready","Deferred","_tree","prototype","_competency","canConfig","hasChildren","id","getConfig","getType","Error","init","_load","injectTemplate","reject","promise","isValid","when","on","type","handler","setTargetCompetency","competency","_trigger","data","trigger","_triggerChange"],"mappings":"AAuBAA,OAAM,2BAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,CAa3B,GAAIC,CAAAA,CAAI,CAAG,SAASC,CAAT,CAAe,CACtB,KAAKC,UAAL,CAAkBH,CAAC,CAAC,OAAD,CAAnB,CACA,KAAKI,MAAL,CAAcJ,CAAC,CAACK,QAAF,EAAd,CACA,KAAKC,KAAL,CAAaJ,CAChB,CAJD,CAOAD,CAAI,CAACM,SAAL,CAAeC,WAAf,CAA6B,IAA7B,CAEAP,CAAI,CAACM,SAAL,CAAeJ,UAAf,CAA4B,IAA5B,CAEAF,CAAI,CAACM,SAAL,CAAeH,MAAf,CAAwB,IAAxB,CAEAH,CAAI,CAACM,SAAL,CAAeD,KAAf,CAAuB,IAAvB,CAQAL,CAAI,CAACM,SAAL,CAAeE,SAAf,CAA2B,UAAW,CAClC,MAAO,MAAKH,KAAL,CAAWI,WAAX,CAAuB,KAAKF,WAAL,CAAiBG,EAAxC,CACV,CAFD,CAYAV,CAAI,CAACM,SAAL,CAAeK,SAAf,CAA2B,UAAW,CAClC,MAAO,KACV,CAFD,CAWAX,CAAI,CAACM,SAAL,CAAeM,OAAf,CAAyB,UAAW,CAChC,KAAM,IAAIC,CAAAA,KAAJ,CAAU,iBAAV,CACT,CAFD,CAYAb,CAAI,CAACM,SAAL,CAAeQ,IAAf,CAAsB,UAAW,CAC7B,MAAO,MAAKC,KAAL,EACV,CAFD,CAWAf,CAAI,CAACM,SAAL,CAAeU,cAAf,CAAgC,UAAW,CACvC,MAAOjB,CAAAA,CAAC,CAACK,QAAF,GAAaa,MAAb,GAAsBC,OAAtB,EACV,CAFD,CAYAlB,CAAI,CAACM,SAAL,CAAea,OAAf,CAAyB,UAAW,CAChC,QACH,CAFD,CAWAnB,CAAI,CAACM,SAAL,CAAeS,KAAf,CAAuB,UAAW,CAC9B,MAAOhB,CAAAA,CAAC,CAACqB,IAAF,EACV,CAFD,CAWApB,CAAI,CAACM,SAAL,CAAee,EAAf,CAAoB,SAASC,CAAT,CAAeC,CAAf,CAAwB,CACxC,KAAKrB,UAAL,CAAgBmB,EAAhB,CAAmBC,CAAnB,CAAyBC,CAAzB,CACH,CAFD,CAUAvB,CAAI,CAACM,SAAL,CAAekB,mBAAf,CAAqC,SAASC,CAAT,CAAqB,CACtD,KAAKlB,WAAL,CAAmBkB,CACtB,CAFD,CAYAzB,CAAI,CAACM,SAAL,CAAeoB,QAAf,CAA0B,SAASJ,CAAT,CAAeK,CAAf,CAAqB,CAC3C,KAAKzB,UAAL,CAAgB0B,OAAhB,CAAwBN,CAAxB,CAA8B,CAACK,CAAD,CAA9B,CACH,CAFD,CAUA3B,CAAI,CAACM,SAAL,CAAeuB,cAAf,CAAgC,UAAW,CACvC,KAAKH,QAAL,CAAc,QAAd,CAAwB,IAAxB,CACH,CAFD,CAIA,MAAoD1B,CAAAA,CAEvD,CAxJK,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 * Competency rule base module.\n *\n * @package    tool_lp\n * @copyright  2015 Frédéric Massart - FMCorz.net\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n    /**\n     * Competency rule abstract class.\n     *\n     * Any competency rule should extend this object. The event 'change' should be\n     * triggered on the instance when the configuration has changed. This will allow\n     * the components using the rule to gather the config, or check its validity.\n     *\n     * this._triggerChange();\n     *\n     * @param {Tree} tree The competency tree.\n     */\n    var Rule = function(tree) {\n        this._eventNode = $('<div>');\n        this._ready = $.Deferred();\n        this._tree = tree;\n    };\n\n    /** @type {Object} The current competency. */\n    Rule.prototype._competency = null;\n    /** @type {Node} The node we attach the events to. */\n    Rule.prototype._eventNode = null;\n    /** @type {Promise} Resolved when the object is ready. */\n    Rule.prototype._ready = null;\n    /** @type {Tree} The competency tree. */\n    Rule.prototype._tree = null;\n\n    /**\n     * Whether or not the current competency can be configured using this rule.\n     *\n     * @return {Boolean}\n     * @method canConfig\n     */\n    Rule.prototype.canConfig = function() {\n        return this._tree.hasChildren(this._competency.id);\n    };\n\n    /**\n     * The config established by this rule.\n     *\n     * To override in subclasses when relevant.\n     *\n     * @return {String|null}\n     * @method getConfig\n     */\n    Rule.prototype.getConfig = function() {\n        return null;\n    };\n\n    // eslint-disable-next-line valid-jsdoc\n    /**\n     * Return the type of the module.\n     *\n     * @return {String}\n     * @method getType\n     */\n    Rule.prototype.getType = function() {\n        throw new Error('Not implemented');\n    };\n\n    /**\n     * The init process.\n     *\n     * Do not override this, instead override _load.\n     *\n     * @return {Promise} Revoled when the plugin is initialised.\n     * @method init\n     */\n    Rule.prototype.init = function() {\n        return this._load();\n    };\n\n    /**\n     * Callback to inject the template.\n     *\n     * @param  {Node} container Node to inject in.\n     * @return {Promise} Resolved when done.\n     * @method injectTemplate\n     */\n    Rule.prototype.injectTemplate = function() {\n        return $.Deferred().reject().promise();\n    };\n\n    /**\n     * Whether or not the current config is valid.\n     *\n     * Plugins should override this.\n     *\n     * @return {Boolean}\n     * @method _isValid\n     */\n    Rule.prototype.isValid = function() {\n        return false;\n    };\n\n    /**\n     * Load the class.\n     *\n     * @return {Promise}\n     * @method _load\n     * @protected\n     */\n    Rule.prototype._load = function() {\n        return $.when();\n    };\n\n    /**\n     * Register an event listener.\n     *\n     * @param {String} type The event type.\n     * @param {Function} handler The event listener.\n     * @method on\n     */\n    Rule.prototype.on = function(type, handler) {\n        this._eventNode.on(type, handler);\n    };\n\n    /**\n     * Sets the current competency.\n     *\n     * @param {Competency} competency\n     * @method setTargetCompetency\n     */\n    Rule.prototype.setTargetCompetency = function(competency) {\n        this._competency = competency;\n    };\n\n    /**\n     * Trigger an event.\n     *\n     * @param {String} type The type of event.\n     * @param {Object} data The data to pass to the listeners.\n     * @method _trigger\n     * @protected\n     */\n    Rule.prototype._trigger = function(type, data) {\n        this._eventNode.trigger(type, [data]);\n    };\n\n    /**\n     * Trigger the change event.\n     *\n     * @method _triggerChange\n     * @protected\n     */\n    Rule.prototype._triggerChange = function() {\n        this._trigger('change', this);\n    };\n\n    return /** @alias module:tool_lp/competency_rule */ Rule;\n\n});\n"],"file":"competency_rule.min.js"}