diff --git a/.upgradenotes/MDL-81962-1715959893322.yml b/.upgradenotes/MDL-81962-1715959893322.yml new file mode 100644 index 00000000000..5ab9d87e72a --- /dev/null +++ b/.upgradenotes/MDL-81962-1715959893322.yml @@ -0,0 +1,5 @@ +issueNumber: MDL-81962 +notes: + core: + - message: The `moodle-core-notification-confirm` YUI module has been removed after an extensive deprecation period. Please use the AMD `core/modal` module as a replacement. + type: removed diff --git a/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-debug.js b/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-debug.js deleted file mode 100644 index f8b982671aa..00000000000 --- a/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-debug.js +++ /dev/null @@ -1,223 +0,0 @@ -YUI.add('moodle-core-notification-confirm', function (Y, NAME) { - -/* eslint-disable no-unused-vars, no-unused-expressions */ -var DIALOGUE_PREFIX, - BASE, - CONFIRMYES, - CONFIRMNO, - TITLE, - QUESTION, - CSS_CLASSES; - -DIALOGUE_PREFIX = 'moodle-dialogue'; -BASE = 'notificationBase'; -CONFIRMYES = 'yesLabel'; -CONFIRMNO = 'noLabel'; -TITLE = 'title'; -QUESTION = 'question'; -CSS_CLASSES = { - BASE: 'moodle-dialogue-base', - WRAP: 'moodle-dialogue-wrap', - HEADER: 'moodle-dialogue-hd', - BODY: 'moodle-dialogue-bd', - CONTENT: 'moodle-dialogue-content', - FOOTER: 'moodle-dialogue-ft', - HIDDEN: 'hidden', - LIGHTBOX: 'moodle-dialogue-lightbox' -}; - -// Set up the namespace once. -M.core = M.core || {}; -/** - * A dialogue type designed to display a confirmation to the user. - * - * @module moodle-core-notification - * @submodule moodle-core-notification-confirm - */ - -var CONFIRM_NAME = 'Moodle confirmation dialogue', - CONFIRM; - -/** - * Extends core Dialogue to show the confirmation dialogue. - * - * @param {Object} config Object literal specifying the dialogue configuration properties. - * @constructor - * @class M.core.confirm - * @extends M.core.dialogue - */ -CONFIRM = function(config) { - CONFIRM.superclass.constructor.apply(this, [config]); -}; -Y.extend(CONFIRM, M.core.notification.info, { - /** - * The list of events to detach when destroying this dialogue. - * - * @property _closeEvents - * @type EventHandle[] - * @private - */ - _closeEvents: null, - - /** - * A reference to the yes button. - * - * @property _yesButton - * @type Node - * @private - */ - _yesButton: null, - - /** - * A reference to the No button. - * - * @property _noButton - * @type Node - * @private - */ - _noButton: null, - - /** - * A reference to the Question. - * - * @property _question - * @type Node - * @private - */ - _question: null, - - initializer: function() { - window.console.error( - 'The module "moodle-core-notification-confirm" module has been deprecated and will be removed in Moodle 4.4.' - ); - this._closeEvents = []; - this.publish('complete'); - this.publish('complete-yes'); - this.publish('complete-no'); - this._yesButton = Y.Node.create(''); - this._noButton = Y.Node.create(''); - this._question = Y.Node.create('
' + this.get(QUESTION) + '
'); - var content = Y.Node.create('
') - .append(this._question) - .append(Y.Node.create( - '
' - ) - .append(this._yesButton) - .append(this._noButton)); - this.get(BASE).addClass('moodle-dialogue-confirm'); - this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE); - this.setStdModContent(Y.WidgetStdMod.HEADER, - '
' + this.get(TITLE) + '
', - Y.WidgetStdMod.REPLACE); - - this._closeEvents.push( - Y.on('key', this.submit, window, 'down:27', this, false), - this._yesButton.on('click', this.submit, this, true), - this._noButton.on('click', this.submit, this, false) - ); - - var closeButton = this.get('boundingBox').one('.closebutton'); - if (closeButton) { - // The close button should act exactly like the 'No' button. - this._closeEvents.push( - closeButton.on('click', this.submit, this) - ); - } - }, - submit: function(e, outcome) { - new Y.EventHandle(this._closeEvents).detach(); - this.fire('complete', outcome); - if (outcome) { - this.fire('complete-yes'); - } else { - this.fire('complete-no'); - } - this.hide(); - this.destroy(); - } -}, { - NAME: CONFIRM_NAME, - CSS_PREFIX: DIALOGUE_PREFIX, - ATTRS: { - - /** - * The button text to use to accept the confirmation. - * - * @attribute yesLabel - * @type String - * @default 'Yes' - */ - yesLabel: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('yes', 'moodle'); - }, - setter: function(value) { - if (this._yesButton) { - this._yesButton.set('value', value); - } - return value; - } - }, - - /** - * The button text to use to reject the confirmation. - * - * @attribute noLabel - * @type String - * @default 'No' - */ - noLabel: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('no', 'moodle'); - }, - setter: function(value) { - if (this._noButton) { - this._noButton.set('value', value); - } - return value; - } - }, - - /** - * The title of the dialogue. - * - * @attribute title - * @type String - * @default 'Confirm' - */ - title: { - validator: Y.Lang.isString, - value: M.util.get_string('confirm', 'moodle') - }, - - /** - * The question posed by the dialogue. - * - * @attribute question - * @type String - * @default 'Are you sure?' - */ - question: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('areyousure', 'moodle'); - }, - setter: function(value) { - if (this._question) { - this._question.set('value', value); - } - return value; - } - } - } -}); -Y.augment(CONFIRM, Y.EventTarget); - -M.core.confirm = CONFIRM; - - -}, '@VERSION@', {"requires": ["moodle-core-notification-dialogue"]}); diff --git a/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-min.js b/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-min.js deleted file mode 100644 index a1047c593d4..00000000000 --- a/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-min.js +++ /dev/null @@ -1 +0,0 @@ -YUI.add("moodle-core-notification-confirm",function(i,t){var e;M.core=M.core||{},i.extend(e=function(t){e.superclass.constructor.apply(this,[t])},M.core.notification.info,{_closeEvents:null,_yesButton:null,_noButton:null,_question:null,initializer:function(){var t;window.console.error('The module "moodle-core-notification-confirm" module has been deprecated and will be removed in Moodle 4.4.'),this._closeEvents=[],this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no"),this._yesButton=i.Node.create(''),this._noButton=i.Node.create(''),this._question=i.Node.create('
'+this.get("question")+"
"),t=i.Node.create('
').append(this._question).append(i.Node.create('
').append(this._yesButton).append(this._noButton)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(i.WidgetStdMod.BODY,t,i.WidgetStdMod.REPLACE),this.setStdModContent(i.WidgetStdMod.HEADER,'
'+this.get("title")+"
",i.WidgetStdMod.REPLACE),this._closeEvents.push(i.on("key",this.submit,window,"down:27",this,!1),this._yesButton.on("click",this.submit,this,!0),this._noButton.on("click",this.submit,this,!1)),(t=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(t.on("click",this.submit,this))},submit:function(t,e){new i.EventHandle(this._closeEvents).detach(),this.fire("complete",e),e?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:"Moodle confirmation dialogue",CSS_PREFIX:"moodle-dialogue",ATTRS:{yesLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("yes","moodle")},setter:function(t){return this._yesButton&&this._yesButton.set("value",t),t}},noLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("no","moodle")},setter:function(t){return this._noButton&&this._noButton.set("value",t),t}},title:{validator:i.Lang.isString,value:M.util.get_string("confirm","moodle")},question:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("areyousure","moodle")},setter:function(t){return this._question&&this._question.set("value",t),t}}}}),i.augment(e,i.EventTarget),M.core.confirm=e},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file diff --git a/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm.js b/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm.js deleted file mode 100644 index f8b982671aa..00000000000 --- a/public/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm.js +++ /dev/null @@ -1,223 +0,0 @@ -YUI.add('moodle-core-notification-confirm', function (Y, NAME) { - -/* eslint-disable no-unused-vars, no-unused-expressions */ -var DIALOGUE_PREFIX, - BASE, - CONFIRMYES, - CONFIRMNO, - TITLE, - QUESTION, - CSS_CLASSES; - -DIALOGUE_PREFIX = 'moodle-dialogue'; -BASE = 'notificationBase'; -CONFIRMYES = 'yesLabel'; -CONFIRMNO = 'noLabel'; -TITLE = 'title'; -QUESTION = 'question'; -CSS_CLASSES = { - BASE: 'moodle-dialogue-base', - WRAP: 'moodle-dialogue-wrap', - HEADER: 'moodle-dialogue-hd', - BODY: 'moodle-dialogue-bd', - CONTENT: 'moodle-dialogue-content', - FOOTER: 'moodle-dialogue-ft', - HIDDEN: 'hidden', - LIGHTBOX: 'moodle-dialogue-lightbox' -}; - -// Set up the namespace once. -M.core = M.core || {}; -/** - * A dialogue type designed to display a confirmation to the user. - * - * @module moodle-core-notification - * @submodule moodle-core-notification-confirm - */ - -var CONFIRM_NAME = 'Moodle confirmation dialogue', - CONFIRM; - -/** - * Extends core Dialogue to show the confirmation dialogue. - * - * @param {Object} config Object literal specifying the dialogue configuration properties. - * @constructor - * @class M.core.confirm - * @extends M.core.dialogue - */ -CONFIRM = function(config) { - CONFIRM.superclass.constructor.apply(this, [config]); -}; -Y.extend(CONFIRM, M.core.notification.info, { - /** - * The list of events to detach when destroying this dialogue. - * - * @property _closeEvents - * @type EventHandle[] - * @private - */ - _closeEvents: null, - - /** - * A reference to the yes button. - * - * @property _yesButton - * @type Node - * @private - */ - _yesButton: null, - - /** - * A reference to the No button. - * - * @property _noButton - * @type Node - * @private - */ - _noButton: null, - - /** - * A reference to the Question. - * - * @property _question - * @type Node - * @private - */ - _question: null, - - initializer: function() { - window.console.error( - 'The module "moodle-core-notification-confirm" module has been deprecated and will be removed in Moodle 4.4.' - ); - this._closeEvents = []; - this.publish('complete'); - this.publish('complete-yes'); - this.publish('complete-no'); - this._yesButton = Y.Node.create(''); - this._noButton = Y.Node.create(''); - this._question = Y.Node.create('
' + this.get(QUESTION) + '
'); - var content = Y.Node.create('
') - .append(this._question) - .append(Y.Node.create( - '
' - ) - .append(this._yesButton) - .append(this._noButton)); - this.get(BASE).addClass('moodle-dialogue-confirm'); - this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE); - this.setStdModContent(Y.WidgetStdMod.HEADER, - '
' + this.get(TITLE) + '
', - Y.WidgetStdMod.REPLACE); - - this._closeEvents.push( - Y.on('key', this.submit, window, 'down:27', this, false), - this._yesButton.on('click', this.submit, this, true), - this._noButton.on('click', this.submit, this, false) - ); - - var closeButton = this.get('boundingBox').one('.closebutton'); - if (closeButton) { - // The close button should act exactly like the 'No' button. - this._closeEvents.push( - closeButton.on('click', this.submit, this) - ); - } - }, - submit: function(e, outcome) { - new Y.EventHandle(this._closeEvents).detach(); - this.fire('complete', outcome); - if (outcome) { - this.fire('complete-yes'); - } else { - this.fire('complete-no'); - } - this.hide(); - this.destroy(); - } -}, { - NAME: CONFIRM_NAME, - CSS_PREFIX: DIALOGUE_PREFIX, - ATTRS: { - - /** - * The button text to use to accept the confirmation. - * - * @attribute yesLabel - * @type String - * @default 'Yes' - */ - yesLabel: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('yes', 'moodle'); - }, - setter: function(value) { - if (this._yesButton) { - this._yesButton.set('value', value); - } - return value; - } - }, - - /** - * The button text to use to reject the confirmation. - * - * @attribute noLabel - * @type String - * @default 'No' - */ - noLabel: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('no', 'moodle'); - }, - setter: function(value) { - if (this._noButton) { - this._noButton.set('value', value); - } - return value; - } - }, - - /** - * The title of the dialogue. - * - * @attribute title - * @type String - * @default 'Confirm' - */ - title: { - validator: Y.Lang.isString, - value: M.util.get_string('confirm', 'moodle') - }, - - /** - * The question posed by the dialogue. - * - * @attribute question - * @type String - * @default 'Are you sure?' - */ - question: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('areyousure', 'moodle'); - }, - setter: function(value) { - if (this._question) { - this._question.set('value', value); - } - return value; - } - } - } -}); -Y.augment(CONFIRM, Y.EventTarget); - -M.core.confirm = CONFIRM; - - -}, '@VERSION@', {"requires": ["moodle-core-notification-dialogue"]}); diff --git a/public/lib/yui/build/moodle-core-notification/moodle-core-notification-debug.js b/public/lib/yui/build/moodle-core-notification/moodle-core-notification-debug.js index b6393231dca..e39bee3dab0 100644 --- a/public/lib/yui/build/moodle-core-notification/moodle-core-notification-debug.js +++ b/public/lib/yui/build/moodle-core-notification/moodle-core-notification-debug.js @@ -15,7 +15,6 @@ YUI.add('moodle-core-notification', function (Y, NAME) { *
*
moodle-core-notification-dialogue
*
moodle-core-notification-alert
- *
moodle-core-notification-confirm
*
moodle-core-notification-exception
*
moodle-core-notification-ajaxexception
*
diff --git a/public/lib/yui/build/moodle-core-notification/moodle-core-notification.js b/public/lib/yui/build/moodle-core-notification/moodle-core-notification.js index 0de335377ff..3dc1a21f01e 100644 --- a/public/lib/yui/build/moodle-core-notification/moodle-core-notification.js +++ b/public/lib/yui/build/moodle-core-notification/moodle-core-notification.js @@ -15,7 +15,6 @@ YUI.add('moodle-core-notification', function (Y, NAME) { *
*
moodle-core-notification-dialogue
*
moodle-core-notification-alert
- *
moodle-core-notification-confirm
*
moodle-core-notification-exception
*
moodle-core-notification-ajaxexception
*
diff --git a/public/lib/yui/src/notification/build.json b/public/lib/yui/src/notification/build.json index 4b6d8cf1d20..aa7c4b022a4 100644 --- a/public/lib/yui/src/notification/build.json +++ b/public/lib/yui/src/notification/build.json @@ -19,12 +19,6 @@ "alert.js" ] }, - "moodle-core-notification-confirm": { - "jsfiles": [ - "shared.js", - "confirm.js" - ] - }, "moodle-core-notification-exception": { "jsfiles": [ "shared.js", diff --git a/public/lib/yui/src/notification/js/confirm.js b/public/lib/yui/src/notification/js/confirm.js deleted file mode 100644 index 439d64d6697..00000000000 --- a/public/lib/yui/src/notification/js/confirm.js +++ /dev/null @@ -1,190 +0,0 @@ -/** - * A dialogue type designed to display a confirmation to the user. - * - * @module moodle-core-notification - * @submodule moodle-core-notification-confirm - */ - -var CONFIRM_NAME = 'Moodle confirmation dialogue', - CONFIRM; - -/** - * Extends core Dialogue to show the confirmation dialogue. - * - * @param {Object} config Object literal specifying the dialogue configuration properties. - * @constructor - * @class M.core.confirm - * @extends M.core.dialogue - */ -CONFIRM = function(config) { - CONFIRM.superclass.constructor.apply(this, [config]); -}; -Y.extend(CONFIRM, M.core.notification.info, { - /** - * The list of events to detach when destroying this dialogue. - * - * @property _closeEvents - * @type EventHandle[] - * @private - */ - _closeEvents: null, - - /** - * A reference to the yes button. - * - * @property _yesButton - * @type Node - * @private - */ - _yesButton: null, - - /** - * A reference to the No button. - * - * @property _noButton - * @type Node - * @private - */ - _noButton: null, - - /** - * A reference to the Question. - * - * @property _question - * @type Node - * @private - */ - _question: null, - - initializer: function() { - window.console.error( - 'The module "moodle-core-notification-confirm" module has been deprecated and will be removed in Moodle 4.4.' - ); - this._closeEvents = []; - this.publish('complete'); - this.publish('complete-yes'); - this.publish('complete-no'); - this._yesButton = Y.Node.create(''); - this._noButton = Y.Node.create(''); - this._question = Y.Node.create('
' + this.get(QUESTION) + '
'); - var content = Y.Node.create('
') - .append(this._question) - .append(Y.Node.create( - '
' - ) - .append(this._yesButton) - .append(this._noButton)); - this.get(BASE).addClass('moodle-dialogue-confirm'); - this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE); - this.setStdModContent(Y.WidgetStdMod.HEADER, - '
' + this.get(TITLE) + '
', - Y.WidgetStdMod.REPLACE); - - this._closeEvents.push( - Y.on('key', this.submit, window, 'down:27', this, false), - this._yesButton.on('click', this.submit, this, true), - this._noButton.on('click', this.submit, this, false) - ); - - var closeButton = this.get('boundingBox').one('.closebutton'); - if (closeButton) { - // The close button should act exactly like the 'No' button. - this._closeEvents.push( - closeButton.on('click', this.submit, this) - ); - } - }, - submit: function(e, outcome) { - new Y.EventHandle(this._closeEvents).detach(); - this.fire('complete', outcome); - if (outcome) { - this.fire('complete-yes'); - } else { - this.fire('complete-no'); - } - this.hide(); - this.destroy(); - } -}, { - NAME: CONFIRM_NAME, - CSS_PREFIX: DIALOGUE_PREFIX, - ATTRS: { - - /** - * The button text to use to accept the confirmation. - * - * @attribute yesLabel - * @type String - * @default 'Yes' - */ - yesLabel: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('yes', 'moodle'); - }, - setter: function(value) { - if (this._yesButton) { - this._yesButton.set('value', value); - } - return value; - } - }, - - /** - * The button text to use to reject the confirmation. - * - * @attribute noLabel - * @type String - * @default 'No' - */ - noLabel: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('no', 'moodle'); - }, - setter: function(value) { - if (this._noButton) { - this._noButton.set('value', value); - } - return value; - } - }, - - /** - * The title of the dialogue. - * - * @attribute title - * @type String - * @default 'Confirm' - */ - title: { - validator: Y.Lang.isString, - value: M.util.get_string('confirm', 'moodle') - }, - - /** - * The question posed by the dialogue. - * - * @attribute question - * @type String - * @default 'Are you sure?' - */ - question: { - validator: Y.Lang.isString, - valueFn: function() { - return M.util.get_string('areyousure', 'moodle'); - }, - setter: function(value) { - if (this._question) { - this._question.set('value', value); - } - return value; - } - } - } -}); -Y.augment(CONFIRM, Y.EventTarget); - -M.core.confirm = CONFIRM; diff --git a/public/lib/yui/src/notification/js/notification.js b/public/lib/yui/src/notification/js/notification.js index e728bbc8e51..659772bef7f 100644 --- a/public/lib/yui/src/notification/js/notification.js +++ b/public/lib/yui/src/notification/js/notification.js @@ -13,7 +13,6 @@ *
*
moodle-core-notification-dialogue
*
moodle-core-notification-alert
- *
moodle-core-notification-confirm
*
moodle-core-notification-exception
*
moodle-core-notification-ajaxexception
*