mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 20:50:21 +01:00
MDL-79583 core_badges: Remove unused AMD module
This module was removed by removed by MDL-78324, but added back due to a merge conflict in MDL-79064.
This commit is contained in:
parent
1724362afc
commit
c81cf6a7b7
10
badges/amd/build/backpackactions.min.js
vendored
10
badges/amd/build/backpackactions.min.js
vendored
@ -1,10 +0,0 @@
|
||||
define("core_badges/backpackactions",["exports","jquery","core_badges/selectors","core/str","core/pending","core/modal_factory","core/modal_events","core/config"],(function(_exports,_jquery,_selectors,_str,_pending,_modal_factory,_modal_events,_config){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
|
||||
/**
|
||||
* Action methods related to backpacks.
|
||||
*
|
||||
* @module core_badges/backpackactions
|
||||
* @copyright 2020 Sara Arjona <sara@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_jquery=_interopRequireDefault(_jquery),_selectors=_interopRequireDefault(_selectors),_pending=_interopRequireDefault(_pending),_modal_factory=_interopRequireDefault(_modal_factory),_modal_events=_interopRequireDefault(_modal_events),_config=_interopRequireDefault(_config);_exports.init=()=>{const pendingPromise=new _pending.default,root=(0,_jquery.default)(_selectors.default.elements.main);registerListenerEvents(root),pendingPromise.resolve()};const registerListenerEvents=root=>{root.on("click",_selectors.default.actions.deletebackpack,(async e=>{e.preventDefault();const link=(0,_jquery.default)(e.currentTarget),modal=await buildModal(link);displayModal(modal,link)}))},buildModal=async link=>{const backpackurl=link.closest(_selectors.default.elements.backpackurl).attr("data-backpackurl");return _modal_factory.default.create({title:await(0,_str.getString)("delexternalbackpack","core_badges"),body:await(0,_str.getString)("delexternalbackpackconfirm","core_badges",backpackurl),type:_modal_factory.default.types.SAVE_CANCEL})},displayModal=async(modal,link)=>{modal.setSaveButtonText(await(0,_str.getString)("delete","core")),modal.getRoot().on(_modal_events.default.save,(function(){window.location.href=link.attr("href")+"&sesskey="+_config.default.sesskey+"&confirm=1"})),modal.getRoot().on(_modal_events.default.hidden,(function(){modal.destroy()})),modal.show()}}));
|
||||
|
||||
//# sourceMappingURL=backpackactions.min.js.map
|
@ -1 +0,0 @@
|
||||
{"version":3,"file":"backpackactions.min.js","sources":["../src/backpackactions.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 * Action methods related to backpacks.\n *\n * @module core_badges/backpackactions\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 {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"],"names":["pendingPromise","Pending","root","selectors","elements","main","registerListenerEvents","resolve","on","actions","deletebackpack","async","e","preventDefault","link","currentTarget","modal","buildModal","displayModal","backpackurl","closest","attr","ModalFactory","create","title","body","type","types","SAVE_CANCEL","setSaveButtonText","getRoot","ModalEvents","save","window","location","href","Config","sesskey","hidden","destroy","show"],"mappings":";;;;;;;kXAoCoB,WACVA,eAAiB,IAAIC,iBAErBC,MAAO,mBAAEC,mBAAUC,SAASC,MAClCC,uBAAuBJ,MAEvBF,eAAeO,iBASbD,uBAA0BJ,OAE5BA,KAAKM,GAAG,QAASL,mBAAUM,QAAQC,gBAAgBC,MAAAA,IAC/CC,EAAEC,uBAEIC,MAAO,mBAAEF,EAAEG,eACXC,YAAcC,WAAWH,MAE/BI,aAAaF,MAAOF,UAItBG,WAAaN,MAAAA,aAETQ,YAAcL,KAAKM,QAAQjB,mBAAUC,SAASe,aAAaE,KAAK,2BAE/DC,uBAAaC,OAAO,CACvBC,YAAa,kBAAU,sBAAuB,eAC9CC,WAAY,kBAAU,6BAA8B,cAAeN,aACnEO,KAAMJ,uBAAaK,MAAMC,eAK3BV,aAAeP,MAAMK,MAAOF,QAC9BE,MAAMa,wBAAwB,kBAAU,SAAU,SAElDb,MAAMc,UAAUtB,GAAGuB,sBAAYC,MAAM,WACjCC,OAAOC,SAASC,KAAOrB,KAAKO,KAAK,QAAU,YAAce,gBAAOC,QAAU,gBAG9ErB,MAAMc,UAAUtB,GAAGuB,sBAAYO,QAAQ,WACnCtB,MAAMuB,aAGVvB,MAAMwB"}
|
@ -1,88 +0,0 @@
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Action methods related to backpacks.
|
||||
*
|
||||
* @module core_badges/backpackactions
|
||||
* @copyright 2020 Sara Arjona <sara@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
import $ from 'jquery';
|
||||
import selectors from 'core_badges/selectors';
|
||||
import {getString} from 'core/str';
|
||||
import Pending from 'core/pending';
|
||||
import ModalFactory from 'core/modal_factory';
|
||||
import ModalEvents from 'core/modal_events';
|
||||
import Config from 'core/config';
|
||||
|
||||
/**
|
||||
* Set up the actions.
|
||||
*
|
||||
* @method init
|
||||
*/
|
||||
export const init = () => {
|
||||
const pendingPromise = new Pending();
|
||||
|
||||
const root = $(selectors.elements.main);
|
||||
registerListenerEvents(root);
|
||||
|
||||
pendingPromise.resolve();
|
||||
};
|
||||
|
||||
/**
|
||||
* Register backpack related event listeners.
|
||||
*
|
||||
* @method registerListenerEvents
|
||||
* @param {Object} root The root element.
|
||||
*/
|
||||
const registerListenerEvents = (root) => {
|
||||
|
||||
root.on('click', selectors.actions.deletebackpack, async(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const link = $(e.currentTarget);
|
||||
const modal = await buildModal(link);
|
||||
|
||||
displayModal(modal, link);
|
||||
});
|
||||
};
|
||||
|
||||
const buildModal = async(link) => {
|
||||
|
||||
const backpackurl = link.closest(selectors.elements.backpackurl).attr('data-backpackurl');
|
||||
|
||||
return ModalFactory.create({
|
||||
title: await getString('delexternalbackpack', 'core_badges'),
|
||||
body: await getString('delexternalbackpackconfirm', 'core_badges', backpackurl),
|
||||
type: ModalFactory.types.SAVE_CANCEL,
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
const displayModal = async(modal, link) => {
|
||||
modal.setSaveButtonText(await getString('delete', 'core'));
|
||||
|
||||
modal.getRoot().on(ModalEvents.save, function() {
|
||||
window.location.href = link.attr('href') + '&sesskey=' + Config.sesskey + '&confirm=1';
|
||||
});
|
||||
|
||||
modal.getRoot().on(ModalEvents.hidden, function() {
|
||||
modal.destroy();
|
||||
});
|
||||
|
||||
modal.show();
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user