mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch 'MDL-60013-master' of git://github.com/junpataleta/moodle
This commit is contained in:
commit
ce4e052209
1
lib/amd/build/modal_confirm.min.js
vendored
1
lib/amd/build/modal_confirm.min.js
vendored
@ -1 +0,0 @@
|
|||||||
define(["jquery","core/custom_interaction_events","core/modal_events","core/modal_save_cancel","core/log"],function(a,b,c,d,e){var f=function(a){e.warn("The CONFIRM modal type has been deprecated and should not be used anymore. Please use the SAVE_CANCEL modal type instead."),d.call(this,a)};return f.prototype=Object.create(d.prototype),f.prototype.constructor=f,f});
|
|
2
lib/amd/build/modal_events.min.js
vendored
2
lib/amd/build/modal_events.min.js
vendored
@ -1 +1 @@
|
|||||||
define([],function(){return{shown:"modal:shown",hidden:"modal:hidden",destroyed:"modal:destroyed",bodyRendered:"modal:bodyRendered",save:"modal-save-cancel:save",cancel:"modal-save-cancel:cancel",yes:"modal-save-cancel:save",no:"modal-save-cancel:cancel"}});
|
define([],function(){return{shown:"modal:shown",hidden:"modal:hidden",destroyed:"modal:destroyed",bodyRendered:"modal:bodyRendered",save:"modal-save-cancel:save",cancel:"modal-save-cancel:cancel"}});
|
2
lib/amd/build/modal_factory.min.js
vendored
2
lib/amd/build/modal_factory.min.js
vendored
@ -1 +1 @@
|
|||||||
define(["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_confirm","core/modal_cancel","core/templates","core/notification","core/custom_interaction_events"],function(a,b,c,d,e,f,g,h,i,j){var k={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CONFIRM:"core/modal_save_cancel",CANCEL:"core/modal_cancel"},l={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CONFIRM:"CONFIRM",CANCEL:"CANCEL"};c.register(l.DEFAULT,d,k.DEFAULT),c.register(l.SAVE_CANCEL,e,k.SAVE_CANCEL),c.register(l.CONFIRM,f,k.CONFIRM),c.register(l.CANCEL,g,k.CANCEL);var m=function(c,d,e){var f=null,g="function"==typeof e.preShowCallback,h=function(b,d){f=a(b.currentTarget),c.then(function(a){return g&&e.preShowCallback(f,a),a.show(),a}),d.originalEvent.preventDefault()};if(Array.isArray(d)){var i=d[1];d=d[0],j.define(d,[j.events.activate]),d.on(j.events.activate,i,h)}else j.define(d,[j.events.activate]),d.on(j.events.activate,h);c.then(function(a){return a.getRoot().on(b.hidden,function(){null!==f&&f.focus()}),a})},n=function(b,c){c=a(c);var d=b.module,e=new d(c);return e},o=function(b,c){var d=b.template,e=h.render(d,c).then(function(c){var d=a(c);return n(b,d)}).fail(i.exception);return e},p=function(a,b){var d=a.type||l.DEFAULT,e=!!a.large,f=null,g={};f=c.get(d),f||i.exception({message:"Unable to find modal of type: "+d}),"undefined"!=typeof a.templateContext&&(g=a.templateContext);var h=o(f,g).then(function(b){return"undefined"!=typeof a.title&&b.setTitle(a.title),"undefined"!=typeof a.body&&b.setBody(a.body),"undefined"!=typeof a.footer&&b.setFooter(a.footer),e&&b.setLarge(),b});return"undefined"!=typeof b&&m(h,b,a),h};return{create:p,types:l}});
|
define(["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_cancel","core/templates","core/notification","core/custom_interaction_events"],function(a,b,c,d,e,f,g,h,i){var j={DEFAULT:"core/modal",SAVE_CANCEL:"core/modal_save_cancel",CANCEL:"core/modal_cancel"},k={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CANCEL:"CANCEL"};c.register(k.DEFAULT,d,j.DEFAULT),c.register(k.SAVE_CANCEL,e,j.SAVE_CANCEL),c.register(k.CANCEL,f,j.CANCEL);var l=function(c,d,e){var f=null,g="function"==typeof e.preShowCallback,h=function(b,d){f=a(b.currentTarget),c.then(function(a){return g&&e.preShowCallback(f,a),a.show(),a}),d.originalEvent.preventDefault()};if(Array.isArray(d)){var j=d[1];d=d[0],i.define(d,[i.events.activate]),d.on(i.events.activate,j,h)}else i.define(d,[i.events.activate]),d.on(i.events.activate,h);c.then(function(a){return a.getRoot().on(b.hidden,function(){null!==f&&f.focus()}),a})},m=function(b,c){c=a(c);var d=b.module,e=new d(c);return e},n=function(b,c){var d=b.template,e=g.render(d,c).then(function(c){var d=a(c);return m(b,d)}).fail(h.exception);return e},o=function(a,b){var d=a.type||k.DEFAULT,e=!!a.large,f=null,g={};f=c.get(d),f||h.exception({message:"Unable to find modal of type: "+d}),"undefined"!=typeof a.templateContext&&(g=a.templateContext);var i=n(f,g).then(function(b){return"undefined"!=typeof a.title&&b.setTitle(a.title),"undefined"!=typeof a.body&&b.setBody(a.body),"undefined"!=typeof a.footer&&b.setFooter(a.footer),e&&b.setLarge(),b});return"undefined"!=typeof b&&l(i,b,a),i};return{create:o,types:k}});
|
@ -1,46 +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/>.
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Contain the logic for the yes/no confirmation modal.
|
|
||||||
* This has been deprecated and should not be used anymore. Please use core/modal_save_cancel instead.
|
|
||||||
* See MDL-59759.
|
|
||||||
*
|
|
||||||
* @deprecated Since Moodle 3.4
|
|
||||||
* @module core/modal_confirm
|
|
||||||
* @class modal_confirm
|
|
||||||
* @package core
|
|
||||||
* @copyright 2016 Ryan Wyllie <ryan@moodle.com>
|
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
||||||
*/
|
|
||||||
define(['jquery', 'core/custom_interaction_events', 'core/modal_events', 'core/modal_save_cancel', 'core/log'],
|
|
||||||
function($, CustomEvents, ModalEvents, ModalSaveCancel, Log) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor for the Modal.
|
|
||||||
*
|
|
||||||
* @param {object} root The root jQuery element for the modal
|
|
||||||
*/
|
|
||||||
var ModalConfirm = function(root) {
|
|
||||||
Log.warn("The CONFIRM modal type has been deprecated and should not be used anymore." +
|
|
||||||
" Please use the SAVE_CANCEL modal type instead.");
|
|
||||||
ModalSaveCancel.call(this, root);
|
|
||||||
};
|
|
||||||
|
|
||||||
ModalConfirm.prototype = Object.create(ModalSaveCancel.prototype);
|
|
||||||
ModalConfirm.prototype.constructor = ModalConfirm;
|
|
||||||
|
|
||||||
return ModalConfirm;
|
|
||||||
});
|
|
@ -32,9 +32,5 @@ define([], function() {
|
|||||||
// ModalSaveCancel events.
|
// ModalSaveCancel events.
|
||||||
save: 'modal-save-cancel:save',
|
save: 'modal-save-cancel:save',
|
||||||
cancel: 'modal-save-cancel:cancel',
|
cancel: 'modal-save-cancel:cancel',
|
||||||
// ModalConfirm events. Deprecated since Moodle 3.4. See MDL-59759.
|
|
||||||
// Point core/modal_confirm events to save/cancel events of core/modal_save_cancel.
|
|
||||||
yes: 'modal-save-cancel:save',
|
|
||||||
no: 'modal-save-cancel:cancel',
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -23,17 +23,15 @@
|
|||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
define(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',
|
define(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',
|
||||||
'core/modal_save_cancel', 'core/modal_confirm', 'core/modal_cancel',
|
'core/modal_save_cancel', 'core/modal_cancel',
|
||||||
'core/templates', 'core/notification', 'core/custom_interaction_events'],
|
'core/templates', 'core/notification', 'core/custom_interaction_events'],
|
||||||
function($, ModalEvents, ModalRegistry, Modal, ModalSaveCancel, ModalConfirm,
|
function($, ModalEvents, ModalRegistry, Modal, ModalSaveCancel,
|
||||||
ModalCancel, Templates, Notification, CustomEvents) {
|
ModalCancel, Templates, Notification, CustomEvents) {
|
||||||
|
|
||||||
// The templates for each type of modal.
|
// The templates for each type of modal.
|
||||||
var TEMPLATES = {
|
var TEMPLATES = {
|
||||||
DEFAULT: 'core/modal',
|
DEFAULT: 'core/modal',
|
||||||
SAVE_CANCEL: 'core/modal_save_cancel',
|
SAVE_CANCEL: 'core/modal_save_cancel',
|
||||||
// Deprecated since Moodle 3.4. Point template to core/modal_save_cancel instead. See MDL-59759.
|
|
||||||
CONFIRM: 'core/modal_save_cancel',
|
|
||||||
CANCEL: 'core/modal_cancel',
|
CANCEL: 'core/modal_cancel',
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -41,16 +39,12 @@ define(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',
|
|||||||
var TYPES = {
|
var TYPES = {
|
||||||
DEFAULT: 'DEFAULT',
|
DEFAULT: 'DEFAULT',
|
||||||
SAVE_CANCEL: 'SAVE_CANCEL',
|
SAVE_CANCEL: 'SAVE_CANCEL',
|
||||||
// Deprecated since Moodle 3.4. See MDL-59759.
|
|
||||||
CONFIRM: 'CONFIRM',
|
|
||||||
CANCEL: 'CANCEL',
|
CANCEL: 'CANCEL',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Register the common set of modals.
|
// Register the common set of modals.
|
||||||
ModalRegistry.register(TYPES.DEFAULT, Modal, TEMPLATES.DEFAULT);
|
ModalRegistry.register(TYPES.DEFAULT, Modal, TEMPLATES.DEFAULT);
|
||||||
ModalRegistry.register(TYPES.SAVE_CANCEL, ModalSaveCancel, TEMPLATES.SAVE_CANCEL);
|
ModalRegistry.register(TYPES.SAVE_CANCEL, ModalSaveCancel, TEMPLATES.SAVE_CANCEL);
|
||||||
// Deprecated since Moodle 3.4. See MDL-59759.
|
|
||||||
ModalRegistry.register(TYPES.CONFIRM, ModalConfirm, TEMPLATES.CONFIRM);
|
|
||||||
ModalRegistry.register(TYPES.CANCEL, ModalCancel, TEMPLATES.CANCEL);
|
ModalRegistry.register(TYPES.CANCEL, ModalCancel, TEMPLATES.CANCEL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,7 @@ information provided here is intended especially for developers.
|
|||||||
- This allows developers to easily output groups of checkboxes that can be toggled by master controls in the form of a checkbox or
|
- This allows developers to easily output groups of checkboxes that can be toggled by master controls in the form of a checkbox or
|
||||||
a button. Action elements which perform actions on the selected checkboxes can also be enabled/disabled depending on whether
|
a button. Action elements which perform actions on the selected checkboxes can also be enabled/disabled depending on whether
|
||||||
at least a single checkbox item is selected or not.
|
at least a single checkbox item is selected or not.
|
||||||
|
* Final deprecation (removal) of the core/modal_confirm dialogue.
|
||||||
|
|
||||||
=== 3.7 ===
|
=== 3.7 ===
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user