Proyectos de Subversion Moodle

Rev

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

{"version":3,"file":"user_course_navigation.min.js","sources":["../src/user_course_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 report_competency/user_course_navigation\n * @copyright  2015 Damyon Wiese\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery'], function($) {\n\n    /**\n     * UserCourseNavigation\n     *\n     * @class report_competency/user_course_navigation\n     * @param {String} userSelector The selector of the user element.\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} userId The course id\n     * @param {Number} courseId The user id\n     * @param {Number} moduleId The activity module (filter)\n     */\n    var UserCourseNavigation = function(userSelector, moduleSelector, baseUrl, userId, courseId, moduleId) {\n        this._baseUrl = baseUrl;\n        this._userId = userId + '';\n        this._courseId = courseId;\n        this._moduleId = moduleId;\n\n        $(userSelector).on('change', this._userChanged.bind(this));\n        $(moduleSelector).on('change', this._moduleChanged.bind(this));\n    };\n\n    /**\n     * The user was changed in the select list.\n     *\n     * @method _userChanged\n     * @param {Event} e the event\n     */\n    UserCourseNavigation.prototype._userChanged = function(e) {\n        // Note: This change causes a page reload and is intentionally not paired with a js_complete call.\n        M.util.js_pending('report_competency/user_course_navigation:_userChanged');\n        var newUserId = $(e.target).val();\n        var queryStr = '?user=' + newUserId + '&id=' + this._courseId + '&mod=' + this._moduleId;\n        document.location = this._baseUrl + queryStr;\n    };\n\n    /**\n     * The module was changed in the select list.\n     *\n     * @method _moduleChanged\n     * @param {Event} e the event\n     */\n    UserCourseNavigation.prototype._moduleChanged = function(e) {\n        // Note: This change causes a page reload and is intentionally not paired with a js_complete call.\n        M.util.js_pending('report_competency/user_course_navigation:_moduleChanged');\n        var newModuleId = $(e.target).val();\n        var queryStr = '?mod=' + newModuleId + '&id=' + this._courseId + '&user=' + this._userId;\n        document.location = this._baseUrl + queryStr;\n    };\n\n    /** @property {Number} The id of the user. */\n    UserCourseNavigation.prototype._userId = null;\n    /** @property {Number} The id of the module. */\n    UserCourseNavigation.prototype._moduleId = null;\n    /** @property {Number} The id of the course. */\n    UserCourseNavigation.prototype._courseId = null;\n    /** @property {String} Plugin base url. */\n    UserCourseNavigation.prototype._baseUrl = null;\n\n    return UserCourseNavigation;\n});\n"],"names":["define","$","UserCourseNavigation","userSelector","moduleSelector","baseUrl","userId","courseId","moduleId","_baseUrl","_userId","_courseId","_moduleId","on","this","_userChanged","bind","_moduleChanged","prototype","e","M","util","js_pending","queryStr","target","val","document","location"],"mappings":";;;;;;;AAuBAA,kDAAO,CAAC,WAAW,SAASC,OAapBC,qBAAuB,SAASC,aAAcC,eAAgBC,QAASC,OAAQC,SAAUC,eACpFC,SAAWJ,aACXK,QAAUJ,OAAS,QACnBK,UAAYJ,cACZK,UAAYJ,SAEjBP,EAAEE,cAAcU,GAAG,SAAUC,KAAKC,aAAaC,KAAKF,OACpDb,EAAEG,gBAAgBS,GAAG,SAAUC,KAAKG,eAAeD,KAAKF,eAS5DZ,qBAAqBgB,UAAUH,aAAe,SAASI,GAEnDC,EAAEC,KAAKC,WAAW,6DAEdC,SAAW,SADCtB,EAAEkB,EAAEK,QAAQC,MACU,OAASX,KAAKH,UAAY,QAAUG,KAAKF,UAC/Ec,SAASC,SAAWb,KAAKL,SAAWc,UASxCrB,qBAAqBgB,UAAUD,eAAiB,SAASE,GAErDC,EAAEC,KAAKC,WAAW,+DAEdC,SAAW,QADGtB,EAAEkB,EAAEK,QAAQC,MACS,OAASX,KAAKH,UAAY,SAAWG,KAAKJ,QACjFgB,SAASC,SAAWb,KAAKL,SAAWc,UAIxCrB,qBAAqBgB,UAAUR,QAAU,KAEzCR,qBAAqBgB,UAAUN,UAAY,KAE3CV,qBAAqBgB,UAAUP,UAAY,KAE3CT,qBAAqBgB,UAAUT,SAAW,KAEnCP"}