Proyectos de Subversion Moodle

Rev

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

{"version":3,"file":"group.min.js","sources":["../../src/actionbar/group.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\nimport GroupSearch from 'core_group/comboboxsearch/group';\n\n/**\n * Allow the user to search for groups in the action bar.\n *\n * @module    core_course/actionbar/group\n * @copyright 2024 Shamim Rezaie <shamim@moodle.com>\n * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nexport default class Group extends GroupSearch {\n\n    baseUrl;\n\n    /**\n     * Construct the class.\n     *\n     * @param {string} baseUrl The base URL for the page.\n     * @param {int|null} cmid ID of the course module initiating the group search (optional).\n     */\n    constructor(baseUrl, cmid = null) {\n        super(cmid);\n        this.baseUrl = baseUrl;\n    }\n\n    /**\n     * Allow the class to be invoked via PHP.\n     *\n     * @param {string} baseUrl The base URL for the page.\n     * @param {int|null} cmid ID of the course module initiating the group search (optional).\n     * @returns {Group}\n     */\n    static init(baseUrl, cmid = null) {\n        return new Group(baseUrl, cmid);\n    }\n\n    /**\n     * Build up the link that is dedicated to a particular result.\n     *\n     * @param {Number} groupID The ID of the group selected.\n     * @returns {string}\n     */\n    selectOneLink(groupID) {\n        const url = new URL(this.baseUrl);\n        url.searchParams.set('groupsearchvalue', this.getSearchTerm());\n        url.searchParams.set('group', groupID);\n\n        return url.toString();\n    }\n}\n"],"names":["Group","GroupSearch","constructor","baseUrl","selectOneLink","groupID","url","URL","this","searchParams","set","getSearchTerm","toString"],"mappings":";;;;;;;;MAwBqBA,cAAcC,eAU/BC,YAAYC,sEAAgB,4KAEnBA,QAAUA,oBAUPA,gBACD,IAAIH,MAAMG,+DADO,MAU5BC,cAAcC,eACJC,IAAM,IAAIC,IAAIC,KAAKL,gBACzBG,IAAIG,aAAaC,IAAI,mBAAoBF,KAAKG,iBAC9CL,IAAIG,aAAaC,IAAI,QAASL,SAEvBC,IAAIM"}