Sindbad~EG File Manager

Current Path : /var/www/html/maxicambios.sumar.com.py/grade/report/singleview/amd/build/
Upload File :
Current File : /var/www/html/maxicambios.sumar.com.py/grade/report/singleview/amd/build/grade.min.js.map

{"version":3,"file":"grade.min.js","sources":["../src/grade.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 * A small modal to search grade items within the gradebook.\n *\n * @module    gradereport_singleview/grade\n * @copyright 2022 Mathew May <mathew.solutions>\n * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport * as FocusLockManager from 'core/local/aria/focuslock';\nimport Pending from 'core/pending';\nimport * as Templates from 'core/templates';\nimport Url from 'core/url';\nimport * as Repository from 'core_grades/searchwidget/repository';\nimport * as WidgetBase from 'core_grades/searchwidget/basewidget';\nimport $ from 'jquery';\nimport * as Selectors from 'core_grades/searchwidget/selectors';\n\n/**\n * Our entry point into starting to build the search widget.\n * It'll eventually, based upon the listeners, open the search widget and allow filtering.\n *\n * @method init\n */\nexport const init = () => {\n    if (document.querySelector(Selectors.elements.getSearchWidgetSelector('grade'))) {\n        const pendingPromise = new Pending();\n        registerListenerEvents();\n        pendingPromise.resolve();\n    }\n};\n\n/**\n * Register grade item search widget related event listeners.\n *\n * @method registerListenerEvents\n */\nconst registerListenerEvents = () => {\n    let {bodyPromiseResolver, bodyPromise} = WidgetBase.promisesAndResolvers();\n    const dropdownMenuContainer = document.querySelector(Selectors.elements.getSearchWidgetDropdownSelector('grade'));\n    const menuContainer = document.querySelector(Selectors.elements.getSearchWidgetSelector('grade'));\n    const inputElement = menuContainer.querySelector('input[name=\"itemid\"]');\n\n    // Handle the 'shown.bs.dropdown' event (Fired when the dropdown menu is fully displayed).\n    $(menuContainer).on('show.bs.dropdown', async(e) => {\n        const courseID = e.relatedTarget.dataset.courseid;\n        // Display a loading icon in the dropdown menu container until the body promise is resolved.\n        await WidgetBase.showLoader(dropdownMenuContainer);\n\n        // If an error occurs while fetching the data, display the error within the modal.\n        const data = await Repository.gradeitemFetch(courseID).catch(async(e) => {\n            const errorTemplateData = {\n                'errormessage': e.message\n            };\n            bodyPromiseResolver(\n                await Templates.render('core_grades/searchwidget/error', errorTemplateData)\n            );\n        });\n\n        // Early return if there is no module data.\n        if (data === []) {\n            return;\n        }\n\n        await WidgetBase.init(\n            dropdownMenuContainer,\n            bodyPromise,\n            data.gradeitems,\n            searchGradeitems(),\n            null,\n            afterSelect\n        );\n\n        // Resolvers for passed functions in the modal creation.\n        bodyPromiseResolver(Templates.render('gradereport_singleview/gradesearch_body', []));\n\n        // Lock tab control. It has to be locked because the dropdown's role is dialog.\n        FocusLockManager.trapFocus(dropdownMenuContainer);\n    });\n\n    // Handle the 'hide.bs.dropdown' event (Fired when the dropdown menu is being closed).\n    $(menuContainer).on('hide.bs.dropdown', () => {\n        FocusLockManager.untrapFocus();\n    });\n\n    inputElement.addEventListener('change', e => {\n        const toggle = menuContainer.querySelector('.dropdown-toggle');\n        const courseId = toggle.dataset.courseid;\n        const actionUrl = Url.relativeUrl(\n            '/grade/report/singleview/index.php',\n            {\n                id: courseId,\n                item: 'grade',\n                itemid: e.target.value\n            },\n            false\n        );\n        location.href = actionUrl;\n\n        e.stopPropagation();\n    });\n};\n\n/**\n * Define how we want to search and filter grade items when the user decides to input a search value.\n *\n * @method searchGradeitems\n * @returns {function(): function(*, *): (*)}\n */\nconst searchGradeitems = () => {\n    return () => {\n        return (modules, searchTerm) => {\n            if (searchTerm === '') {\n                return modules;\n            }\n            searchTerm = searchTerm.toLowerCase();\n            const searchResults = [];\n            modules.forEach((module) => {\n                const moduleName = module.name.toLowerCase();\n                if (moduleName.includes(searchTerm)) {\n                    searchResults.push(module);\n                }\n            });\n            return searchResults;\n        };\n    };\n};\n\n/**\n * Define the action to be performed when an item is selected by the search widget.\n *\n * @param {String} selected The selected item's value.\n */\nconst afterSelect = (selected) => {\n    const menuContainer = document.querySelector(Selectors.elements.getSearchWidgetSelector('grade'));\n    const inputElement = menuContainer.querySelector('input[name=\"itemid\"]');\n\n    $(menuContainer).dropdown('hide'); // Otherwise the dropdown stays open when user choose an option using keyboard.\n\n    if (inputElement.value != selected) {\n        inputElement.value = selected;\n        inputElement.dispatchEvent(new Event('change', {bubbles: true}));\n    }\n};\n"],"names":["document","querySelector","Selectors","elements","getSearchWidgetSelector","pendingPromise","Pending","registerListenerEvents","resolve","bodyPromiseResolver","bodyPromise","WidgetBase","promisesAndResolvers","dropdownMenuContainer","getSearchWidgetDropdownSelector","menuContainer","inputElement","on","async","courseID","e","relatedTarget","dataset","courseid","showLoader","data","Repository","gradeitemFetch","catch","errorTemplateData","message","Templates","render","init","gradeitems","searchGradeitems","afterSelect","FocusLockManager","trapFocus","untrapFocus","addEventListener","courseId","actionUrl","Url","relativeUrl","id","item","itemid","target","value","location","href","stopPropagation","modules","searchTerm","toLowerCase","searchResults","forEach","module","name","includes","push","selected","dropdown","dispatchEvent","Event","bubbles"],"mappings":";;;;;;;ucAsCoB,QACZA,SAASC,cAAcC,UAAUC,SAASC,wBAAwB,UAAW,OACvEC,eAAiB,IAAIC,iBAC3BC,yBACAF,eAAeG,kBASjBD,uBAAyB,SACvBE,oBAACA,oBAADC,YAAsBA,aAAeC,WAAWC,6BAC9CC,sBAAwBb,SAASC,cAAcC,UAAUC,SAASW,gCAAgC,UAClGC,cAAgBf,SAASC,cAAcC,UAAUC,SAASC,wBAAwB,UAClFY,aAAeD,cAAcd,cAAc,4CAG/Cc,eAAeE,GAAG,oBAAoBC,MAAAA,UAC9BC,SAAWC,EAAEC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