Your IP : 192.168.165.1


Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/
Upload File :
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/addblockmodal.min.js.map

{"version":3,"sources":["../src/addblockmodal.js"],"names":["define","$","ModalFactory","Templates","Str","Notification","init","context","addblocklink","titlerequests","blocks","map","blockName","key","component","bodyPromise","get_strings","then","titles","title","index","name","render","fail","exception","titlePromise","get_string","create","body","type"],"mappings":"AAwBAA,OAAM,sBAAC,CAAC,QAAD,CAAW,oBAAX,CAAiC,gBAAjC,CAAmD,UAAnD,CAA+D,mBAA/D,CAAD,CACC,SAASC,CAAT,CAAYC,CAAZ,CAA0BC,CAA1B,CAAqCC,CAArC,CAA0CC,CAA1C,CAAwD,CAG3D,MAA+C,CAO3CC,IAAI,CAAE,cAASC,CAAT,CAAkB,IAChBC,CAAAA,CAAY,CAAGP,CAAC,CAAC,qBAAD,CADA,CAIhBQ,CAAa,CAAGF,CAAO,CAACG,MAAR,CAAeC,GAAf,CAAmB,SAASC,CAAT,CAAoB,CACvD,MAAO,CACHC,GAAG,CAAE,YADF,CAEHC,SAAS,CAAE,SAAWF,CAFnB,CAIV,CALmB,CAJA,CAWhBG,CAAW,CAAGX,CAAG,CAACY,WAAJ,CAAgBP,CAAhB,EACjBQ,IADiB,CACZ,SAASC,CAAT,CAAiB,CACnB,MAAOA,CAAAA,CAAM,CAACP,GAAP,CAAW,SAASQ,CAAT,CAAgBC,CAAhB,CAAuB,CACrC,MAAO,CACHC,IAAI,CAAEd,CAAO,CAACG,MAAR,CAAeU,CAAf,CADH,CAEHD,KAAK,CAAEA,CAFJ,CAIV,CALM,CAMV,CARiB,EASjBF,IATiB,CASZ,SAASP,CAAT,CAAiB,CACnBH,CAAO,CAACG,MAAR,CAAiBA,CAAjB,CACA,MAAOP,CAAAA,CAAS,CAACmB,MAAV,CAAiB,qBAAjB,CAAwCf,CAAxC,CACV,CAZiB,EAajBgB,IAbiB,CAaZlB,CAAY,CAACmB,SAbD,CAXE,CA0BhBC,CAAY,CAAGrB,CAAG,CAACsB,UAAJ,CAAe,UAAf,EAClBH,IADkB,CACblB,CAAY,CAACmB,SADA,CA1BC,CA6BpBtB,CAAY,CAACyB,MAAb,CAAoB,CAChBR,KAAK,CAAEM,CADS,CAEhBG,IAAI,CAAEb,CAFU,CAGhBc,IAAI,CAAE,QAHU,CAApB,CAIGrB,CAJH,CAKH,CAzC0C,CA2ClD,CA/CK,CAAN","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 * Show an add block modal instead of doing it on a separate page.\n *\n * @module     core/addblockmodal\n * @class      addblockmodal\n * @package    core\n * @copyright  2016 Damyon Wiese <damyon@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_factory', 'core/templates', 'core/str', 'core/notification'],\n       function($, ModalFactory, Templates, Str, Notification) {\n\n\n    return /** @alias module:core/addblockmodal */ {\n        /**\n         * Global init function for this module.\n         *\n         * @method init\n         * @param {Object} context The template context for rendering this modal body.\n         */\n        init: function(context) {\n            var addblocklink = $('[data-key=addblock]');\n\n            // We need the fetch the names of the blocks. It was too much to send in the page.\n            var titlerequests = context.blocks.map(function(blockName) {\n                return {\n                    key: 'pluginname',\n                    component: 'block_' + blockName,\n                };\n            });\n\n            var bodyPromise = Str.get_strings(titlerequests)\n            .then(function(titles) {\n                return titles.map(function(title, index) {\n                    return {\n                        name: context.blocks[index],\n                        title: title,\n                    };\n                });\n            })\n            .then(function(blocks) {\n                context.blocks = blocks;\n                return Templates.render('core/add_block_body', context);\n            })\n            .fail(Notification.exception);\n\n            var titlePromise = Str.get_string('addblock')\n            .fail(Notification.exception);\n\n            ModalFactory.create({\n                title: titlePromise,\n                body: bodyPromise,\n                type: 'CANCEL',\n            }, addblocklink);\n        }\n    };\n});\n"],"file":"addblockmodal.min.js"}