Proyectos de Subversion Moodle

Rev

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

{"version":3,"file":"module_navigation.min.js","sources":["../src/module_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 * Module to navigation between users in a course.\n *\n * @module     tool_lp/module_navigation\n * @copyright  2019 Damyon Wiese\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n    /**\n     * ModuleNavigation\n     *\n     * @class tool_lp/module_navigation\n     * @param {String} moduleSelector The selector of the module element.\n     * @param {String} baseUrl The base url for the page (no params).\n     * @param {Number} courseId The course id\n     * @param {Number} moduleId The activity module (filter)\n     */\n    var ModuleNavigation = function(moduleSelector, baseUrl, courseId, moduleId) {\n        this._baseUrl = baseUrl;\n        this._moduleId = moduleId;\n        this._courseId = courseId;\n\n        $(moduleSelector).on('change', this._moduleChanged.bind(this));\n    };\n\n    /**\n     * The module was changed in the select list.\n     *\n     * @method _moduleChanged\n     * @param {Event} e the event\n     */\n    ModuleNavigation.prototype._moduleChanged = function(e) {\n        var newModuleId = $(e.target).val();\n        var queryStr = '?mod=' + newModuleId + '&courseid=' + this._courseId;\n        document.location = this._baseUrl + queryStr;\n    };\n\n    /** @property {Number} The id of the course. */\n    ModuleNavigation.prototype._courseId = null;\n    /** @property {Number} The id of the module. */\n    ModuleNavigation.prototype._moduleId = null;\n    /** @property {String} Plugin base url. */\n    ModuleNavigation.prototype._baseUrl = null;\n\n    return ModuleNavigation;\n});\n"],"names":["define","$","ModuleNavigation","moduleSelector","baseUrl","courseId","moduleId","_baseUrl","_moduleId","_courseId","on","this","_moduleChanged","bind","prototype","e","queryStr","target","val","document","location"],"mappings":";;;;;;;AAuBAA,mCAAO,CAAC,WAAW,SAASC,OAWpBC,iBAAmB,SAASC,eAAgBC,QAASC,SAAUC,eAC1DC,SAAWH,aACXI,UAAYF,cACZG,UAAYJ,SAEjBJ,EAAEE,gBAAgBO,GAAG,SAAUC,KAAKC,eAAeC,KAAKF,eAS5DT,iBAAiBY,UAAUF,eAAiB,SAASG,OAE7CC,SAAW,QADGf,EAAEc,EAAEE,QAAQC,MACS,aAAeP,KAAKF,UAC3DU,SAASC,SAAWT,KAAKJ,SAAWS,UAIxCd,iBAAiBY,UAAUL,UAAY,KAEvCP,iBAAiBY,UAAUN,UAAY,KAEvCN,iBAAiBY,UAAUP,SAAW,KAE/BL"}