Your IP : 216.73.216.95


Current Path : /var/www/ljmtc/cbt/badges/amd/build/
Upload File :
Current File : /var/www/ljmtc/cbt/badges/amd/build/backpackactions.min.js.map

{"version":3,"sources":["../src/backpackactions.js"],"names":["init","pendingPromise","Pending","root","selectors","elements","main","registerListenerEvents","resolve","on","actions","deletebackpack","e","preventDefault","link","currentTarget","buildModal","modal","displayModal","backpackurl","closest","attr","ModalFactory","types","SAVE_CANCEL","title","body","type","create","setSaveButtonText","getRoot","ModalEvents","save","window","location","href","Config","sesskey","hidden","destroy","show"],"mappings":"0QAwBA,OACA,OAEA,OACA,OACA,OACA,O,kXAOO,GAAMA,CAAAA,CAAI,CAAG,UAAM,IAChBC,CAAAA,CAAc,CAAG,GAAIC,UADL,CAGhBC,CAAI,CAAG,cAAEC,UAAUC,QAAV,CAAmBC,IAArB,CAHS,CAItBC,CAAsB,CAACJ,CAAD,CAAtB,CAEAF,CAAc,CAACO,OAAf,EACH,CAPM,C,YAeDD,CAAAA,CAAsB,CAAG,SAACJ,CAAD,CAAU,CAErCA,CAAI,CAACM,EAAL,CAAQ,OAAR,CAAiBL,UAAUM,OAAV,CAAkBC,cAAnC,4CAAmD,WAAMC,CAAN,2FAC/CA,CAAC,CAACC,cAAF,GAEMC,CAHyC,CAGlC,cAAEF,CAAC,CAACG,aAAJ,CAHkC,gBAI3BC,CAAAA,CAAU,CAACF,CAAD,CAJiB,QAIzCG,CAJyC,QAM/CC,CAAY,CAACD,CAAD,CAAQH,CAAR,CAAZ,CAN+C,wCAAnD,wDAQH,C,CAEKE,CAAU,4CAAG,WAAMF,CAAN,yFAETK,CAFS,CAEKL,CAAI,CAACM,OAAL,CAAahB,UAAUC,QAAV,CAAmBc,WAAhC,EAA6CE,IAA7C,CAAkD,kBAAlD,CAFL,MAIRC,SAJQ,gBAKE,iBAAU,qBAAV,CAAiC,aAAjC,CALF,mCAMC,iBAAU,4BAAV,CAAwC,aAAxC,CAAuDH,CAAvD,CAND,yBAOLG,UAAaC,KAAb,CAAmBC,WAPd,OAKXC,KALW,MAMXC,IANW,MAOXC,IAPW,qCAIKC,MAJL,2DAAH,uD,CAYVV,CAAY,4CAAG,WAAMD,CAAN,CAAaH,CAAb,wFACjBG,CADiB,gBACa,iBAAU,QAAV,CAAoB,MAApB,CADb,yBACXY,iBADW,iBAGjBZ,CAAK,CAACa,OAAN,GAAgBrB,EAAhB,CAAmBsB,UAAYC,IAA/B,CAAqC,UAAW,CAC5CC,MAAM,CAACC,QAAP,CAAgBC,IAAhB,CAAuBrB,CAAI,CAACO,IAAL,CAAU,MAAV,EAAoB,WAApB,CAAkCe,UAAOC,OAAzC,CAAmD,YAC7E,CAFD,EAIApB,CAAK,CAACa,OAAN,GAAgBrB,EAAhB,CAAmBsB,UAAYO,MAA/B,CAAuC,UAAW,CAC9CrB,CAAK,CAACsB,OAAN,EACH,CAFD,EAIAtB,CAAK,CAACuB,IAAN,GAXiB,wCAAH,uD","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 * Action methods related to backpacks.\n *\n * @module     core_badges/backpackactions\n * @package    core_badges\n * @copyright  2020 Sara Arjona <sara@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\nimport selectors from 'core_badges/selectors';\nimport {get_string as getString} from 'core/str';\nimport Pending from 'core/pending';\nimport ModalFactory from 'core/modal_factory';\nimport ModalEvents from 'core/modal_events';\nimport Config from 'core/config';\n\n/**\n * Set up the actions.\n *\n * @method init\n */\nexport const init = () => {\n    const pendingPromise = new Pending();\n\n    const root = $(selectors.elements.main);\n    registerListenerEvents(root);\n\n    pendingPromise.resolve();\n};\n\n/**\n * Register backpack related event listeners.\n *\n * @method registerListenerEvents\n * @param {Object} root The root element.\n */\nconst registerListenerEvents = (root) => {\n\n    root.on('click', selectors.actions.deletebackpack, async(e) => {\n        e.preventDefault();\n\n        const link = $(e.currentTarget);\n        const modal = await buildModal(link);\n\n        displayModal(modal, link);\n    });\n};\n\nconst buildModal = async(link) => {\n\n    const backpackurl = link.closest(selectors.elements.backpackurl).attr('data-backpackurl');\n\n    return ModalFactory.create({\n        title: await getString('delexternalbackpack', 'core_badges'),\n        body: await getString('delexternalbackpackconfirm', 'core_badges', backpackurl),\n        type: ModalFactory.types.SAVE_CANCEL,\n    });\n\n};\n\nconst displayModal = async(modal, link) => {\n    modal.setSaveButtonText(await getString('delete', 'core'));\n\n    modal.getRoot().on(ModalEvents.save, function() {\n        window.location.href = link.attr('href') + '&sesskey=' + Config.sesskey + '&confirm=1';\n    });\n\n    modal.getRoot().on(ModalEvents.hidden, function() {\n        modal.destroy();\n    });\n\n    modal.show();\n};\n"],"file":"backpackactions.min.js"}