%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/ava/admin/tool/dataprivacy/amd/build/
Upload File :
Create Path :
Current File : /home/vacivi36/ava/admin/tool/dataprivacy/amd/build/categoriesactions.min.js.map

{"version":3,"file":"categoriesactions.min.js","sources":["../src/categoriesactions.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 * AMD module for categories actions.\n *\n * @module     tool_dataprivacy/categoriesactions\n * @copyright  2018 David Monllao\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n    'jquery',\n    'core/ajax',\n    'core/notification',\n    'core/str',\n    'core/modal_factory',\n    'core/modal_events'],\nfunction($, Ajax, Notification, Str, ModalFactory, ModalEvents) {\n\n    /**\n     * List of action selectors.\n     *\n     * @type {{DELETE: string}}\n     */\n    var ACTIONS = {\n        DELETE: '[data-action=\"deletecategory\"]',\n    };\n\n    /**\n     * CategoriesActions class.\n     */\n    var CategoriesActions = function() {\n        this.registerEvents();\n    };\n\n    /**\n     * Register event listeners.\n     */\n    CategoriesActions.prototype.registerEvents = function() {\n        $(ACTIONS.DELETE).click(function(e) {\n            e.preventDefault();\n\n            var id = $(this).data('id');\n            var categoryname = $(this).data('name');\n            var stringkeys = [\n                {\n                    key: 'deletecategory',\n                    component: 'tool_dataprivacy'\n                },\n                {\n                    key: 'deletecategorytext',\n                    component: 'tool_dataprivacy',\n                    param: categoryname\n                },\n                {\n                    key: 'delete'\n                }\n            ];\n\n            Str.get_strings(stringkeys).then(function(langStrings) {\n                var title = langStrings[0];\n                var confirmMessage = langStrings[1];\n                var buttonText = langStrings[2];\n                return ModalFactory.create({\n                    title: title,\n                    body: confirmMessage,\n                    type: ModalFactory.types.SAVE_CANCEL\n                }).then(function(modal) {\n                    modal.setSaveButtonText(buttonText);\n\n                    // Handle save event.\n                    modal.getRoot().on(ModalEvents.save, function() {\n\n                        var request = {\n                            methodname: 'tool_dataprivacy_delete_category',\n                            args: {'id': id}\n                        };\n\n                        Ajax.call([request])[0].done(function(data) {\n                            if (data.result) {\n                                $('tr[data-categoryid=\"' + id + '\"]').remove();\n                            } else {\n                                Notification.addNotification({\n                                    message: data.warnings[0].message,\n                                    type: 'error'\n                                });\n                            }\n                        }).fail(Notification.exception);\n                    });\n\n                    // Handle hidden event.\n                    modal.getRoot().on(ModalEvents.hidden, function() {\n                        // Destroy when hidden.\n                        modal.destroy();\n                    });\n\n                    return modal;\n                });\n            }).done(function(modal) {\n                modal.show();\n\n            }).fail(Notification.exception);\n        });\n    };\n\n    return /** @alias module:tool_dataprivacy/categoriesactions */ {\n        // Public variables and functions.\n\n        /**\n         * Initialise the module.\n         *\n         * @method init\n         * @return {CategoriesActions}\n         */\n        'init': function() {\n            return new CategoriesActions();\n        }\n    };\n});\n"],"names":["define","$","Ajax","Notification","Str","ModalFactory","ModalEvents","ACTIONS","CategoriesActions","registerEvents","prototype","click","e","preventDefault","id","this","data","stringkeys","key","component","param","get_strings","then","langStrings","title","confirmMessage","buttonText","create","body","type","types","SAVE_CANCEL","modal","setSaveButtonText","getRoot","on","save","request","methodname","args","call","done","result","remove","addNotification","message","warnings","fail","exception","hidden","destroy","show"],"mappings":";;;;;;;AAsBAA,4CAAO,CACH,SACA,YACA,oBACA,WACA,qBACA,sBACJ,SAASC,EAAGC,KAAMC,aAAcC,IAAKC,aAAcC,iBAO3CC,eACQ,iCAMRC,kBAAoB,gBACfC,yBAMTD,kBAAkBE,UAAUD,eAAiB,WACzCR,EAAEM,gBAAgBI,OAAM,SAASC,GAC7BA,EAAEC,qBAEEC,GAAKb,EAAEc,MAAMC,KAAK,MAElBC,WAAa,CACb,CACIC,IAAK,iBACLC,UAAW,oBAEf,CACID,IAAK,qBACLC,UAAW,mBACXC,MATWnB,EAAEc,MAAMC,KAAK,SAW5B,CACIE,IAAK,WAIbd,IAAIiB,YAAYJ,YAAYK,MAAK,SAASC,iBAClCC,MAAQD,YAAY,GACpBE,eAAiBF,YAAY,GAC7BG,WAAaH,YAAY,UACtBlB,aAAasB,OAAO,CACvBH,MAAOA,MACPI,KAAMH,eACNI,KAAMxB,aAAayB,MAAMC,cAC1BT,MAAK,SAASU,cACbA,MAAMC,kBAAkBP,YAGxBM,MAAME,UAAUC,GAAG7B,YAAY8B,MAAM,eAE7BC,QAAU,CACVC,WAAY,mCACZC,KAAM,IAAOzB,KAGjBZ,KAAKsC,KAAK,CAACH,UAAU,GAAGI,MAAK,SAASzB,MAC9BA,KAAK0B,OACLzC,EAAE,uBAAyBa,GAAK,MAAM6B,SAEtCxC,aAAayC,gBAAgB,CACzBC,QAAS7B,KAAK8B,SAAS,GAAGD,QAC1BhB,KAAM,aAGfkB,KAAK5C,aAAa6C,cAIzBhB,MAAME,UAAUC,GAAG7B,YAAY2C,QAAQ,WAEnCjB,MAAMkB,aAGHlB,YAEZS,MAAK,SAAST,OACbA,MAAMmB,UAEPJ,KAAK5C,aAAa6C,eAIkC,MASnD,kBACG,IAAIxC"}

Zerion Mini Shell 1.0