![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-media-gallery-ui/view/adminhtml/web/js/grid/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ 'uiElement', 'escaper' ], function (Element, escaper) { 'use strict'; return Element.extend({ defaults: { template: 'Magento_MediaGalleryUi/grid/messages', messageDelay: 5, messages: [], allowedTags: ['div', 'span', 'b', 'strong', 'i', 'em', 'u', 'a'] }, /** * Init observable variables * @return {Object} */ initObservable: function () { this._super() .observe([ 'messages' ]); return this; }, /** * Get messages * * @returns {Array} */ get: function () { return this.messages(); }, /** * Add message * * @param {String} type * @param {String} message */ add: function (type, message) { this.messages.push({ code: type, message: message }); }, /** * Clear messages */ clear: function () { this.messages.removeAll(); }, /** * Schedule message cleanup * * @param {Number} delay */ scheduleCleanup: function (delay) { // eslint-disable-next-line no-unused-vars var timerId; delay = delay || this.messageDelay; // eslint-disable-next-line no-unused-vars timerId = setTimeout(function () { clearTimeout(timerId); this.clear(); }.bind(this), Number(delay) * 1000); }, /** * Prepare the given message to be rendered as HTML * * @param {String} message * @return {String} */ prepareMessageUnsanitizedHtml: function (message) { return escaper.escapeHtml(message, this.allowedTags); } }); });