YUI.add('moodle-core-notification-alert', function (Y, NAME) { /* eslint-disable no-unused-vars, no-unused-expressions */ var DIALOGUE_PREFIX, BASE, CONFIRMYES, CONFIRMNO, TITLE, QUESTION, CSS; DIALOGUE_PREFIX = 'moodle-dialogue', BASE = 'notificationBase', CONFIRMYES = 'yesLabel', CONFIRMNO = 'noLabel', TITLE = 'title', QUESTION = 'question', CSS = { 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 || {}; /* global BASE, TITLE, CONFIRMYES, DIALOGUE_PREFIX */ /** * A dialogue type designed to display an alert to the user. * * @module moodle-core-notification * @submodule moodle-core-notification-alert */ var ALERT_NAME = 'Moodle alert', ALERT; /** * Extends core Dialogue to show the alert dialogue. * * @param {Object} config Object literal specifying the dialogue configuration properties. * @constructor * @class M.core.alert * @extends M.core.dialogue */ ALERT = function(config) { config.closeButton = false; ALERT.superclass.constructor.apply(this, [config]); }; Y.extend(ALERT, M.core.notification.info, { /** * The list of events to detach when destroying this dialogue. * * @property _closeEvents * @type EventHandle[] * @private */ _closeEvents: null, initializer: function() { this._closeEvents = []; this.publish('complete'); var yes = Y.Node.create(''), content = Y.Node.create('
') .append(Y.Node.create(' ')) .append(Y.Node.create('') .append(yes)); this.get(BASE).addClass('moodle-dialogue-confirm'); this.setStdModContent(Y.WidgetStdMod.BODY, content, Y.WidgetStdMod.REPLACE); this.setStdModContent(Y.WidgetStdMod.HEADER, '