Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{"version":3,"file":"competency_plan_navigation.min.js","sources":["../src/competency_plan_navigation.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 * Event click on selecting competency in the competency autocomplete.\n *\n * @module     tool_lp/competency_plan_navigation\n * @copyright  2016 Issam Taboubi <issam.taboubi@umontreal.ca>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n    /**\n     * CompetencyPlanNavigation\n     *\n     * @class\n     * @param {String} competencySelector The selector of the competency element.\n     * @param {String} baseUrl The base url for the page (no params).\n     * @param {Number} userId The user id\n     * @param {Number} competencyId The competency id\n     * @param {Number} planId The plan id\n     */\n    var CompetencyPlanNavigation = function(competencySelector, baseUrl, userId, competencyId, planId) {\n        this._baseUrl = baseUrl;\n        this._userId = userId + '';\n        this._competencyId = competencyId + '';\n        this._planId = planId;\n        this._ignoreFirstCompetency = true;\n\n        $(competencySelector).on('change', this._competencyChanged.bind(this));\n    };\n\n    /**\n     * The competency was changed in the select list.\n     *\n     * @method _competencyChanged\n     * @param {Event} e\n     */\n    CompetencyPlanNavigation.prototype._competencyChanged = function(e) {\n        if (this._ignoreFirstCompetency) {\n            this._ignoreFirstCompetency = false;\n            return;\n        }\n        var newCompetencyId = $(e.target).val();\n        var queryStr = '?userid=' + this._userId + '&planid=' + this._planId + '&competencyid=' + newCompetencyId;\n        document.location = this._baseUrl + queryStr;\n    };\n\n    /** @property {Number} The id of the competency. */\n    CompetencyPlanNavigation.prototype._competencyId = null;\n    /** @property {Number} The id of the user. */\n    CompetencyPlanNavigation.prototype._userId = null;\n    /** @property {Number} The id of the plan. */\n    CompetencyPlanNavigation.prototype._planId = null;\n    /** @property {String} Plugin base url. */\n    CompetencyPlanNavigation.prototype._baseUrl = null;\n    /** @property {Boolean} Ignore the first change event for competencies. */\n    CompetencyPlanNavigation.prototype._ignoreFirstCompetency = null;\n\n    return CompetencyPlanNavigation;\n});\n"],"names":["define","$","CompetencyPlanNavigation","competencySelector","baseUrl","userId","competencyId","planId","_baseUrl","_userId","_competencyId","_planId","_ignoreFirstCompetency","on","this","_competencyChanged","bind","prototype","e","newCompetencyId","target","val","queryStr","document","location"],"mappings":";;;;;;;AAuBAA,4CAAO,CAAC,WAAW,SAASC,OAYpBC,yBAA2B,SAASC,mBAAoBC,QAASC,OAAQC,aAAcC,aAClFC,SAAWJ,aACXK,QAAUJ,OAAS,QACnBK,cAAgBJ,aAAe,QAC/BK,QAAUJ,YACVK,wBAAyB,EAE9BX,EAAEE,oBAAoBU,GAAG,SAAUC,KAAKC,mBAAmBC,KAAKF,eASpEZ,yBAAyBe,UAAUF,mBAAqB,SAASG,MACzDJ,KAAKF,4BACAA,wBAAyB,WAG9BO,gBAAkBlB,EAAEiB,EAAEE,QAAQC,MAC9BC,SAAW,WAAaR,KAAKL,QAAU,WAAaK,KAAKH,QAAU,iBAAmBQ,gBAC1FI,SAASC,SAAWV,KAAKN,SAAWc,WAIxCpB,yBAAyBe,UAAUP,cAAgB,KAEnDR,yBAAyBe,UAAUR,QAAU,KAE7CP,yBAAyBe,UAAUN,QAAU,KAE7CT,yBAAyBe,UAAUT,SAAW,KAE9CN,yBAAyBe,UAAUL,uBAAyB,KAErDV"}