Sindbad~EG File Manager

Current Path : /var/www/html/aprender.faexito.org/course/format/amd/build/local/courseeditor/
Upload File :
Current File : /var/www/html/aprender.faexito.org/course/format/amd/build/local/courseeditor/dndsection.min.js.map

{"version":3,"file":"dndsection.min.js","sources":["../../../src/local/courseeditor/dndsection.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 * Course index section component.\n *\n * This component is used to control specific course section interactions like drag and drop\n * in both course index and course content.\n *\n * @module     core_courseformat/local/courseeditor/dndsection\n * @class      core_courseformat/local/courseeditor/dndsection\n * @copyright  2021 Ferran Recio <ferran@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {BaseComponent, DragDrop} from 'core/reactive';\nimport {getString} from 'core/str';\nimport {prefetchStrings} from 'core/prefetch';\nimport Templates from 'core/templates';\n\n// Load global strings.\nprefetchStrings('core', ['addfilehere']);\n\nexport default class extends BaseComponent {\n\n    /**\n     * Save some values form the state.\n     *\n     * @param {Object} state the current state\n     */\n    configState(state) {\n        this.id = this.element.dataset.id;\n        this.section = state.section.get(this.id);\n        this.course = state.course;\n    }\n\n    /**\n     * Register state values and the drag and drop subcomponent.\n     *\n     * @param {BaseComponent} sectionitem section item component\n     */\n    configDragDrop(sectionitem) {\n        // Drag and drop is only available for components compatible course formats.\n        if (this.reactive.isEditing && this.reactive.supportComponents) {\n            // Init the inner dragable element.\n            this.sectionitem = sectionitem;\n            // Init the dropzone.\n            this.dragdrop = new DragDrop(this);\n            // Save dropzone classes.\n            this.classes = this.dragdrop.getClasses();\n        }\n    }\n\n    /**\n     * Remove all subcomponents dependencies.\n     */\n    destroy() {\n        if (this.sectionitem !== undefined) {\n            this.sectionitem.unregister();\n        }\n        if (this.dragdrop !== undefined) {\n            this.dragdrop.unregister();\n        }\n    }\n\n    /**\n     * Get the last CM element of that section.\n     *\n     * @returns {element|null} the las course module element of the section.\n     */\n    getLastCm() {\n        return null;\n    }\n\n    // Drag and drop methods.\n\n    /**\n     * The element drop start hook.\n     *\n     * @param {Object} dropdata the dropdata\n     */\n    dragStart(dropdata) {\n        this.reactive.dispatch('sectionDrag', [dropdata.id], true);\n    }\n\n    /**\n     * The element drop end hook.\n     *\n     * @param {Object} dropdata the dropdata\n     */\n    dragEnd(dropdata) {\n        this.reactive.dispatch('sectionDrag', [dropdata.id], false);\n    }\n\n    /**\n     * Validate if the drop data can be dropped over the component.\n     *\n     * @param {Object} dropdata the exported drop data.\n     * @returns {boolean}\n     */\n    validateDropData(dropdata) {\n        // We accept files.\n        if (dropdata?.type === 'files') {\n            return true;\n        }\n        // We accept any course module.\n        if (dropdata?.type === 'cm') {\n            return true;\n        }\n        // We accept any section but the section 0 or ourself\n        if (dropdata?.type === 'section') {\n            const sectionzeroid = this.course.sectionlist[0];\n            return dropdata?.id != this.id && dropdata?.id != sectionzeroid && this.id != sectionzeroid;\n        }\n        return false;\n    }\n\n    /**\n     * Display the component dropzone.\n     *\n     * @param {Object} dropdata the accepted drop data\n     */\n    showDropZone(dropdata) {\n        if (dropdata.type == 'files') {\n            this.addOverlay({\n                content: getString('addfilehere', 'core'),\n                icon: Templates.renderPix('t/download', 'core'),\n            }).then(() => {\n                // Check if we still need the file dropzone.\n                if (!this.dragdrop?.isDropzoneVisible()) {\n                    this.removeOverlay();\n                }\n                return;\n            }).catch((error) => {\n                throw error;\n            });\n        }\n        if (dropdata.type == 'cm') {\n            this.getLastCm()?.classList.add(this.classes.DROPDOWN);\n        }\n        if (dropdata.type == 'section') {\n            // The relative move of section depends on the section number.\n            if (this.section.number > dropdata.number) {\n                this.element.classList.remove(this.classes.DROPUP);\n                this.element.classList.add(this.classes.DROPDOWN);\n            } else {\n                this.element.classList.add(this.classes.DROPUP);\n                this.element.classList.remove(this.classes.DROPDOWN);\n            }\n        }\n    }\n\n    /**\n     * Hide the component dropzone.\n     */\n    hideDropZone() {\n        this.getLastCm()?.classList.remove(this.classes.DROPDOWN);\n        this.element.classList.remove(this.classes.DROPUP);\n        this.element.classList.remove(this.classes.DROPDOWN);\n        this.removeOverlay();\n    }\n\n    /**\n     * Drop event handler.\n     *\n     * @param {Object} dropdata the accepted drop data\n     * @param {Event} event the drop event\n     */\n    drop(dropdata, event) {\n        // File handling.\n        if (dropdata.type == 'files') {\n            this.reactive.uploadFiles(\n                this.section.id,\n                this.section.number,\n                dropdata.files\n            );\n            return;\n        }\n        // Call the move mutation.\n        if (dropdata.type == 'cm') {\n            const mutation = (event.altKey) ? 'cmDuplicate' : 'cmMove';\n            this.reactive.dispatch(mutation, [dropdata.id], this.id);\n        }\n        if (dropdata.type == 'section') {\n            this.reactive.dispatch('sectionMove', [dropdata.id], this.id);\n        }\n    }\n}\n"],"names":["BaseComponent","configState","state","id","this","element","dataset","section","get","course","configDragDrop","sectionitem","reactive","isEditing","supportComponents","dragdrop","DragDrop","classes","getClasses","destroy","undefined","unregister","getLastCm","dragStart","dropdata","dispatch","dragEnd","validateDropData","type","sectionzeroid","sectionlist","showDropZone","addOverlay","content","icon","Templates","renderPix","then","_this$dragdrop","isDropzoneVisible","removeOverlay","catch","error","classList","add","DROPDOWN","number","remove","DROPUP","hideDropZone","drop","event","mutation","altKey","uploadFiles","files"],"mappings":";;;;;;;;;;;iLAiCgB,OAAQ,CAAC,uCAEIA,wBAOzBC,YAAYC,YACHC,GAAKC,KAAKC,QAAQC,QAAQH,QAC1BI,QAAUL,MAAMK,QAAQC,IAAIJ,KAAKD,SACjCM,OAASP,MAAMO,OAQxBC,eAAeC,aAEPP,KAAKQ,SAASC,WA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