Sindbad~EG File Manager

Current Path : /var/www/html/aprendizajegg.sumar.com.py/course/format/grid/amd/build/
Upload File :
Current File : /var/www/html/aprendizajegg.sumar.com.py/course/format/grid/amd/build/thegrid.min.js.map

{"version":3,"file":"thegrid.min.js","sources":["../src/thegrid.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 * JS module for the grid.\n *\n * @module      format_grid/thegrid\n * @copyright   &copy; 2023-onwards G J Barnard.\n * @author      G J Barnard - gjbarnard at gmail dot com and {@link http://moodle.org/user/profile.php?id=442195}\n * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport * as CourseEvents from 'core_course/events';\nimport jQuery from 'jquery';\nimport log from 'core/log';\n\n/**\n * Whether the event listener has already been registered for this module.\n *\n * @type {boolean}\n */\nlet registered = false;\n\n/**\n * If the manualCompletionToggled event has fired.\n *\n * @type {boolean}\n */\nlet mctFired = false;\n\n/**\n * Function to intialise and register event listeners for this module.\n *\n * @param {array} sectionnumbers Show completion is on.\n * @param {boolean} popup Popup is used.\n * @param {boolean} showcompletion Show completion is on.\n */\nexport const init = (sectionnumbers, popup, showcompletion) => {\n    log.debug('Grid thegrid JS init');\n    if (registered) {\n        log.debug('Grid thegrid JS init already registered');\n        return;\n    }\n    if (popup) {\n        log.debug('Grid thegrid sectionnumbers ' + sectionnumbers);\n\n        // Listen for toggled manual completion states of activities.\n        document.addEventListener(CourseEvents.manualCompletionToggled, () => {\n            mctFired = true;\n        });\n        registered = true;\n\n        // Modal.\n        var currentmodalsection = null;\n        var modalshown = false;\n\n        // Grid current section.\n        var currentsection = null;\n        var currentsectionshown = false;\n        var endsection = sectionnumbers.length - 1;\n\n        /**\n         * Change the current selected section, arrow keys only.\n         * If the modal is shown then will also move the carousel.\n         * @param {int} direction -1 = left and 1 = right.\n         */\n        var sectionchange = function (direction) {\n            if (currentsection === null) {\n                if (direction < 0) {\n                    currentsection = endsection;\n                } else {\n                    currentsection = 0;\n                }\n            }\n            if (currentsection !== null) {\n                jQuery('#section-' + sectionnumbers[currentsection]).removeClass('grid-current-section');\n                currentsection = currentsection + direction;\n                if (currentsection < 0) {\n                    currentsection = endsection;\n                } else if (currentsection > endsection) {\n                    currentsection = 0;\n                }\n                jQuery('#section-' + sectionnumbers[currentsection]).addClass('grid-current-section');\n            }\n        };\n\n        var updatecurrentsection = function () {\n            if (currentsectionshown) {\n                jQuery('#section-' + sectionnumbers[currentsection]).removeClass('grid-current-section');\n            }\n            currentsection = currentmodalsection - 1;\n            if (currentsectionshown) {\n                jQuery('#section-' + sectionnumbers[currentsection]).addClass('grid-current-section');\n            }\n        };\n\n        jQuery('#gridPopup').on('show.bs.modal', function (event) {\n            modalshown = true;\n            if (currentmodalsection === null) {\n                var trigger = jQuery(event.relatedTarget);\n                currentmodalsection = trigger.data('section');\n            }\n\n            updatecurrentsection();\n\n            var gml = jQuery('#gridPopupLabel');\n            var triggersectionname = jQuery('#gridpopupsection-' + currentmodalsection).data('sectiontitle');\n            gml.text(triggersectionname);\n\n            var modal = jQuery(this);\n            modal.find('#gridpopupsection-' + currentmodalsection).addClass('active');\n\n            jQuery('#gridPopupCarousel').on('slid.bs.carousel', function (event) {\n                var item = jQuery('.gridcarousel-item.active');\n                var st = item.data('sectiontitle');\n                gml.text(st);\n                log.debug(\"Carousel direction: \" + event.direction);\n                currentmodalsection = item.data('section');\n                updatecurrentsection();\n            });\n        });\n\n        jQuery('#gridPopup').on('hidden.bs.modal', function () {\n            updatecurrentsection();\n\n            if (currentmodalsection !== null) {\n                currentmodalsection = null;\n            }\n            jQuery('.gridcarousel-item').removeClass('active');\n            if (showcompletion && mctFired) {\n                mctFired = false;\n                window.location.reload();\n            }\n            modalshown = false;\n        });\n\n        jQuery(\".grid-section .grid-modal\").on('keydown', function (event) {\n            // Clicked within the modal\n            if ((event.which == 13) || (event.which == 27)) {\n                event.preventDefault();\n                var trigger = jQuery(event.currentTarget);\n                currentmodalsection = trigger.data('section');\n                jQuery('#gridPopup').modal('show');\n            }\n        });\n\n        jQuery(document).on('keydown', function (event) {\n            if (event.which == 37) {\n                // Left.\n                event.preventDefault();\n                currentsectionshown = true;\n                sectionchange(-1);\n                log.debug(\"Left: \" + sectionnumbers[currentsection]);\n                if (modalshown) {\n                    jQuery('#gridPopupCarouselLeft').trigger('click');\n                }\n            } else if (event.which == 39) {\n                // Right.\n                event.preventDefault();\n                currentsectionshown = true;\n                sectionchange(1);\n                log.debug(\"Right: \" + sectionnumbers[currentsection]);\n                if (modalshown) {\n                    jQuery('#gridPopupCarouselRight').trigger('click');\n                }\n            } else if ((event.which == 13) || (event.which == 27)) {\n                // Enter (13) and ESC keys (27).\n                if ((!modalshown) && (currentsectionshown)) {\n                    if (currentmodalsection === null) {\n                        currentmodalsection = sectionnumbers[currentsection];\n                    }\n                    jQuery('#gridPopup').modal('show');\n                }\n            }\n        });\n    }\n};\n"],"names":["registered","mctFired","sectionnumbers","popup","showcompletion","debug","document","addEventListener","CourseEvents","manualCompletionToggled","currentmodalsection","modalshown","currentsection","currentsectionshown","endsection","length","sectionchange","direction","removeClass","addClass","updatecurrentsection","on","event","trigger","relatedTarget","data","gml","triggersectionname","text","this","find","item","st","window","location","reload","which","preventDefault","currentTarget","modal"],"mappings":";;;;;;;;kGAiCIA,YAAa,EAObC,UAAW,gBASK,CAACC,eAAgBC,MAAOC,kCACpCC,MAAM,wBACNL,wBACIK,MAAM,mDAGVF,MAAO,cACHE,MAAM,+BAAiCH,gBAG3CI,SAASC,iBAAiBC,aAAaC,yBAAyB,K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