From ee6c0772e07d756b9a921715f624c73950215705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20N=C3=A4gler?= <typo3@naegler.net> Date: Wed, 12 Nov 2014 20:15:56 +0100 Subject: [PATCH] [TASK] Refactor flashmessages.js Refactor flashmessages.js: * rename to FlashMessages.js * match severities from PHP flashMessages * remove ExtJS * introduce require.js module * introduce bootstrap alert message code * init global one time for complete backend * load component in top context, referenced now with top.TYPO3.Flashmessage.* on any page possible Resolves: #62893 Releases: master Change-Id: I10a5222a0fbdf371abcc24d2ebb233a8a9fec150 Reviewed-on: http://review.typo3.org/34029 Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de> Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de> Reviewed-by: Markus Klein <klein.t3@reelworx.at> Tested-by: Markus Klein <klein.t3@reelworx.at> --- .../components/pagetree/javascript/actions.js | 2 +- .../Classes/Controller/BackendController.php | 3 +- .../Public/JavaScript/FlashMessages.js | 94 +++++++++++++++++++ .../JavaScript/flashmessage_compatibility.js | 34 +++++++ .../Public/JavaScript/flashmessages.js | 91 ------------------ typo3/sysext/cms/layout/js/typo3pageModule.js | 2 +- .../sysext/core/Classes/Page/PageRenderer.php | 17 ++-- ...2893-FlashmessageJavaScriptObjectMoved.rst | 44 +++++++++ .../Resources/Public/JavaScript/main.js | 12 +-- .../Resources/Public/JavaScript/ter.js | 4 +- .../Resources/Public/JavaScript/update.js | 6 +- .../Resources/Public/JavaScript/LangModule.js | 14 +-- .../Classes/Report/LinkValidatorReport.php | 1 - typo3/sysext/t3editor/res/jslib/t3editor.js | 4 +- .../Classes/Controller/PreviewController.php | 1 - .../Classes/Controller/ReviewController.php | 1 - 16 files changed, 206 insertions(+), 124 deletions(-) create mode 100644 typo3/sysext/backend/Resources/Public/JavaScript/FlashMessages.js create mode 100644 typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js delete mode 100644 typo3/sysext/backend/Resources/Public/JavaScript/flashmessages.js create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-62893-FlashmessageJavaScriptObjectMoved.rst diff --git a/typo3/js/extjs/components/pagetree/javascript/actions.js b/typo3/js/extjs/components/pagetree/javascript/actions.js index bc8f5235c949..2dc19999801e 100644 --- a/typo3/js/extjs/components/pagetree/javascript/actions.js +++ b/typo3/js/extjs/components/pagetree/javascript/actions.js @@ -31,7 +31,7 @@ TYPO3.Components.PageTree.Actions = { */ evaluateResponse: function(response) { if (response.success === false) { - TYPO3.Flashmessage.display(4, 'Exception', response.message); + top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, 'Exception', response.message); return false; } diff --git a/typo3/sysext/backend/Classes/Controller/BackendController.php b/typo3/sysext/backend/Classes/Controller/BackendController.php index 313baa44563d..662115639187 100644 --- a/typo3/sysext/backend/Classes/Controller/BackendController.php +++ b/typo3/sysext/backend/Classes/Controller/BackendController.php @@ -118,7 +118,6 @@ class BackendController { 'md5' => 'sysext/backend/Resources/Public/JavaScript/md5.js', 'modulemenu' => 'sysext/backend/Resources/Public/JavaScript/modulemenu.js', 'evalfield' => 'sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js', - 'flashmessages' => 'sysext/backend/Resources/Public/JavaScript/flashmessages.js', 'tabclosemenu' => 'js/extjs/ux/ext.ux.tabclosemenu.js', 'notifications' => 'sysext/backend/Resources/Public/JavaScript/notifications.js', 'backend' => 'sysext/backend/Resources/Public/JavaScript/backend.js', @@ -136,6 +135,8 @@ class BackendController { // Add default BE css $this->pageRenderer->addCssLibrary('contrib/normalize/normalize.css', 'stylesheet', 'all', '', TRUE, TRUE); + // load FlashMessages functionality + $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/FlashMessages'); $this->css = ''; $this->initializeToolbarItems(); $this->menuWidth = isset($GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW']) ? (int)$GLOBALS['TBE_STYLES']['dims']['leftMenuFrameW'] : $this->menuWidthDefault; diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FlashMessages.js b/typo3/sysext/backend/Resources/Public/JavaScript/FlashMessages.js new file mode 100644 index 000000000000..9aae5ce26e41 --- /dev/null +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FlashMessages.js @@ -0,0 +1,94 @@ +/** + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ + +/** + * FlashMessage rendered by jQuery + * + * @author Steffen Kamper <info@sk-typo3.de> (ExtJS) + * @author Frank Nägler <typo3@naegler.net> (jQuery) + */ + +define('TYPO3/CMS/Backend/FlashMessages', ['jquery'], function ($) { + var Severity = { + notice: -2, + // @deprecated since 7.0 and will be removed with CMS 9, use info instead of information + information: -1, + info: -1, + ok: 0, + warning: 1, + error: 2 + }; + + var Flashmessage = { + messageContainer: null + }; + + /** + * Shows popup + * @member TYPO3.Flashmessage + * @param int severity (TYPO3.Severity.*) + * @param string title + * @param string message + * @param float duration in sec (default 5) + */ + Flashmessage.display = function (severity, title, message, duration) { + var className = ''; + switch (severity) { + case TYPO3.Severity.notice: + className = 'notice'; + break; + case TYPO3.Severity.info: + className = 'info'; + break; + case TYPO3.Severity.ok: + className = 'success'; + break; + case TYPO3.Severity.warning: + className = 'warning'; + break; + case TYPO3.Severity.error: + className = 'danger'; + break; + default: + className = 'info'; + } + duration = duration || 5; + if (!this.messageContainer) { + this.messageContainer = $('<div id="msg-div" style="position:absolute;z-index:10000;width: 100%;"></div>').appendTo('body'); + } + $box = $('<div class="alert alert-' + className + ' alert-dismissible fade in" role="alert">' + + '<button type="button" class="close" data-dismiss="alert">' + + '<span aria-hidden="true">×</span>' + + '<span class="sr-only">Close</span>' + + '</button>' + + '<h4>' + title + '</h4>' + + '<p>' + message + '</p>' + + '</div>'); + $box.appendTo(this.messageContainer); + $box.css({ + width: '400px', + position: 'relative', + margin: '0 auto 10px auto' + }); + $box.fadeIn().delay(duration * 1000).slideUp(); + }; + + /** + * return the Flashmessage object + */ + return function () { + TYPO3.Severity = Severity; + TYPO3.Flashmessage = Flashmessage; + return Flashmessage; + }(); +}); diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js b/typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js new file mode 100644 index 000000000000..62ddd2bbc42a --- /dev/null +++ b/typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js @@ -0,0 +1,34 @@ +/** + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ + +/** + * Javascript compatibility file for a breaking change to the + * flashmessage javascript object + * @deprecate this file will be removed with CMS 9 + */ + +// map old Flashmessage API to the new one +if (!TYPO3.Flashmessage) { + TYPO3.Flashmessage = {}; + TYPO3.Flashmessage.display = function(severity, title, message, duration) { + if (console !== undefined) { + console.log('TYPO3.Flashmessage.display is deprecated and will be removed with CMS 9, please use top.TYPO3.Flashmessage.display'); + } + top.TYPO3.Flashmessage.display(severity, title, message, duration); + } +} + +// map old Severity object to the new one +if (!TYPO3.Severity) { + TYPO3.Severity = top.TYPO3.Severity; +} diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/flashmessages.js b/typo3/sysext/backend/Resources/Public/JavaScript/flashmessages.js deleted file mode 100644 index 7caf3f67fbbe..000000000000 --- a/typo3/sysext/backend/Resources/Public/JavaScript/flashmessages.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -/** - * Flashmessage rendered by ExtJS - * - * @author Steffen Kamper <info@sk-typo3.de> - */ -Ext.ns('TYPO3'); - -/** - * Object for named severities - */ -TYPO3.Severity = { - notice: 0, - information: 1, - ok: 2, - warning: 3, - error: 4 -}; - -/** - * @class TYPO3.Flashmessage - * Passive popup box singleton - * @singleton - * - * Example (Information message): - * TYPO3.Flashmessage.display(1, 'TYPO3 Backend - Version 4.4', 'Ready for take off', 3); - */ -TYPO3.Flashmessage = function() { - var messageContainer; - var severities = ['notice', 'information', 'ok', 'warning', 'error']; - var classMap = { - 'notice': 'notice', - 'information': 'info', - 'ok': 'success', - 'warning': 'warning', - 'error': 'danger' - } - - function createBox(severity, title, message) { - var className = (severity !== undefined && severities[severity] ? classMap[severities[severity]] : classMap['information']); - return ['<div class="typo3-messages"><div class="alert alert-', className, '" style="width: 400px">', - '<div class="pull-right t3-icon fa fa-close t3js-icon-actions-message-close" style="cursor: pointer;"></div>', - '<h4>', title, '</h4>', - '<div class="alert-body">', message, '</div>', - '</div></div>'].join(''); - } - - return { - /** - * Shows popup - * @member TYPO3.Flashmessage - * @param int severity (0=notice, 1=information, 2=ok, 3=warning, 4=error) - * @param string title - * @param string message - * @param float duration in sec (default 5) - */ - display : function(severity, title, message, duration) { - duration = duration || 5; - if (!messageContainer) { - messageContainer = Ext.DomHelper.insertFirst(document.body, { - id : 'msg-div', - style: 'position:absolute;z-index:10000' - }, true); - } - - var box = Ext.DomHelper.append(messageContainer, { - html: createBox(severity, title, message) - }, true); - messageContainer.alignTo(document, 't-t'); - box.child('.t3js-icon-actions-message-close').on('click', function (e, t, o) { - var node; - node = new Ext.Element(Ext.get(t).findParent('div.typo3-messages')); - node.hide(); - Ext.removeNode(node.dom); - }, box); - box.slideIn('t').pause(duration).ghost('t', {remove: true}); - } - }; -}(); diff --git a/typo3/sysext/cms/layout/js/typo3pageModule.js b/typo3/sysext/cms/layout/js/typo3pageModule.js index c9229eaf90ca..8fd2607f5875 100644 --- a/typo3/sysext/cms/layout/js/typo3pageModule.js +++ b/typo3/sysext/cms/layout/js/typo3pageModule.js @@ -197,7 +197,7 @@ TYPO3.Components.PageModule = { */ evaluateResponse: function (response) { if (response.success === false) { - TYPO3.Flashmessage.display(4, 'Exception', response.message); + top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, 'Exception', response.message); return false; } diff --git a/typo3/sysext/core/Classes/Page/PageRenderer.php b/typo3/sysext/core/Classes/Page/PageRenderer.php index ec1651eaf507..0bbb1af23a03 100644 --- a/typo3/sysext/core/Classes/Page/PageRenderer.php +++ b/typo3/sysext/core/Classes/Page/PageRenderer.php @@ -1379,8 +1379,11 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface { if (count($filterNamespaces) === 0) { $filterNamespaces = array('TYPO3'); } - // For ExtDirect we need flash message support - $this->addJsFile(GeneralUtility::resolveBackPath($this->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js')); + // @deprecated since 7.0 and will be removed with CMS 8 + // add compatibility mapping for the old flashmessage API + $this->addJsFile(GeneralUtility::resolveBackPath($this->backPath . + 'sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js')); + // Add language labels for ExtDirect if (TYPO3_MODE === 'FE') { $this->addInlineLanguageLabelArray(array( @@ -1447,8 +1450,8 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface { Ext.Direct.on("exception", function(event) { if (event.code === Ext.Direct.exceptions.TRANSPORT && !event.where) { - TYPO3.Flashmessage.display( - TYPO3.Severity.error, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.error, TYPO3.l10n.localize("extDirect_timeoutHeader"), TYPO3.l10n.localize("extDirect_timeoutMessage"), 30 @@ -1462,8 +1465,8 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface { "ExtDirect - Exception" ); } else if (event.code === "router") { - TYPO3.Flashmessage.display( - TYPO3.Severity.error, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.error, event.code, event.message, 30 @@ -1617,7 +1620,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface { $this->requireJsConfig['paths'] = array( 'jquery-ui' => 'contrib/jquery-ui', 'jquery' => 'contrib/jquery', - 'twbs' => 'contrib/twbs/bootstrap.min', + 'twbs' => 'contrib/twbs/bootstrap.min' ); // get all extensions that are loaded $loadedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray(); diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-62893-FlashmessageJavaScriptObjectMoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-62893-FlashmessageJavaScriptObjectMoved.rst new file mode 100644 index 000000000000..b32957433b9c --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-62893-FlashmessageJavaScriptObjectMoved.rst @@ -0,0 +1,44 @@ +================================================================================== +Deprecation: #62893 - Flashmessage JavaScript object TYPO3.Flashmessages was moved +================================================================================== + +Description +=========== + +Flashmessages JavaScript object was moved from ``TYPO3.Flashmessages`` to ``top.TYPO3.Flashmessages``. +The severity constant values was changed to correspond to the same values (-2,-1,0,1,2) of the constants as in PHP. +The constants ``TYPO3.Severity.information`` was marked as deprecated. +3rd party extensions referring to ``TYPO3.Severity.information`` will work until CMS 9. +A compatibility file was introduced to map ``TYPO3.Flashmessages`` to ``top.TYPO3.Flashmessages``, will also work until CMS 9. + + +Impact +====== + +If a 3rd party extension calls the mentioned methods directly, a deprecation log will be written to the browser console. + + +Affected installations +====================== + +A TYPO3 instance is affected if a 3rd party extension refers to the method ``TYPO3.Flashmessages.display()`` or use ``TYPO3.Severity.information`` constants. + + +Migration +========= + +The affected 3rd party extensions must be modified to use ``top.TYPO3.Flashmessages`` instead of ``TYPO3.Flashmessages``. + +Example: + + .. code-block:: javascript + + // Old and deprecated: + TYPO3.Flashmessages.display(TYPO3.Severity.notice) + + // New and the only correct way: + top.TYPO3.Flashmessages.display(top.TYPO3.Severity.notice) + + .. + +The ``TYPO3.Severity`` object moved to ``top.TYPO3.Severity``. Use ``top.TYPO3.Severity.*`` instead. diff --git a/typo3/sysext/extensionmanager/Resources/Public/JavaScript/main.js b/typo3/sysext/extensionmanager/Resources/Public/JavaScript/main.js index 8e69a6deb24b..9958541d7500 100644 --- a/typo3/sysext/extensionmanager/Resources/Public/JavaScript/main.js +++ b/typo3/sysext/extensionmanager/Resources/Public/JavaScript/main.js @@ -184,15 +184,15 @@ dataType: 'json', success: function(data) { if (data.hasErrors) { - TYPO3.Flashmessage.display( - TYPO3.Severity.error, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.error, TYPO3.l10n.localize('downloadExtension.updateExtension.error'), data.errorMessage, 15 ); } else { - TYPO3.Flashmessage.display( - TYPO3.Severity.information, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.info, TYPO3.l10n.localize('extensionList.updateFlashMessage.title'), TYPO3.l10n.localize('extensionList.updateFlashMessage.message').replace(/\{0\}/g, data.extension), 15 @@ -204,8 +204,8 @@ // Create an error message with diagnosis info. var errorMessage = textStatus + '(' + errorThrown + '): ' + jqXHR.responseText; - TYPO3.Flashmessage.display( - TYPO3.Severity.error, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.error, TYPO3.l10n.localize('downloadExtension.updateExtension.error'), errorMessage, 15 diff --git a/typo3/sysext/extensionmanager/Resources/Public/JavaScript/ter.js b/typo3/sysext/extensionmanager/Resources/Public/JavaScript/ter.js index dbcecfd42b05..2a369c3ed8e6 100644 --- a/typo3/sysext/extensionmanager/Resources/Public/JavaScript/ter.js +++ b/typo3/sysext/extensionmanager/Resources/Public/JavaScript/ter.js @@ -93,7 +93,7 @@ } else { if(data.hasErrors) { $('.typo3-extension-manager').unmask(); - TYPO3.Flashmessage.display(TYPO3.Severity.error, data.title, data.message, 15); + top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, data.title, data.message, 15); } else { var button = 'yes'; var dialog = []; @@ -135,7 +135,7 @@ }); successMessage += '</ul>'; }); - TYPO3.Flashmessage.display(TYPO3.Severity.information, TYPO3.l10n.localize('extensionList.dependenciesResolveFlashMessage.title').replace(/\{0\}/g, data.extension), successMessage, 15); + top.TYPO3.Flashmessage.display(top.TYPO3.Severity.info, TYPO3.l10n.localize('extensionList.dependenciesResolveFlashMessage.title').replace(/\{0\}/g, data.extension), successMessage, 15); } } }); diff --git a/typo3/sysext/extensionmanager/Resources/Public/JavaScript/update.js b/typo3/sysext/extensionmanager/Resources/Public/JavaScript/update.js index dd959b3e0e02..9ba156344713 100644 --- a/typo3/sysext/extensionmanager/Resources/Public/JavaScript/update.js +++ b/typo3/sysext/extensionmanager/Resources/Public/JavaScript/update.js @@ -46,7 +46,7 @@ // Something went wrong, show message if (data.errorMessage.length) { - TYPO3.Flashmessage.display(TYPO3.Severity.warning, TYPO3.l10n.localize('extensionList.updateFromTerFlashMessage.title'), data.errorMessage, 10); + top.TYPO3.Flashmessage.display(top.TYPO3.Severity.warning, TYPO3.l10n.localize('extensionList.updateFromTerFlashMessage.title'), data.errorMessage, 10); } // Message with latest updates @@ -75,8 +75,8 @@ var errorMessage = textStatus + '(' + errorThrown + '): ' + jqXHR.responseText; - TYPO3.Flashmessage.display( - TYPO3.Severity.warning, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.warning, TYPO3.l10n.localize('extensionList.updateFromTerFlashMessage.title'), errorMessage, 10 diff --git a/typo3/sysext/lang/Resources/Public/JavaScript/LangModule.js b/typo3/sysext/lang/Resources/Public/JavaScript/LangModule.js index cbe4c73ab3a7..6791aba261ca 100644 --- a/typo3/sysext/lang/Resources/Public/JavaScript/LangModule.js +++ b/typo3/sysext/lang/Resources/Public/JavaScript/LangModule.js @@ -260,8 +260,8 @@ var languageModule = { if (typeof label !== 'string' || label === '') { return; } - TYPO3.Flashmessage.display( - TYPO3.Severity.error, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.error, TYPO3.l10n.localize('flashmessage.error'), TYPO3.l10n.localize(label), 5 @@ -278,8 +278,8 @@ var languageModule = { if (typeof label !== 'string' || label === '') { return; } - TYPO3.Flashmessage.display( - TYPO3.Severity.information, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.info, TYPO3.l10n.localize('flashmessage.information'), TYPO3.l10n.localize(label), 3 @@ -296,8 +296,8 @@ var languageModule = { if (typeof label !== 'string' || label === '') { return; } - TYPO3.Flashmessage.display( - TYPO3.Severity.ok, + top.TYPO3.Flashmessage.display( + top.TYPO3.Severity.ok, TYPO3.l10n.localize('flashmessage.success'), TYPO3.l10n.localize(label), 3 @@ -407,4 +407,4 @@ var languageModule = { */ jQuery(document).ready(function($) { languageModule.initialize(); -}); \ No newline at end of file +}); diff --git a/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php b/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php index b5e82d1f722f..7545fd5a25dd 100644 --- a/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php +++ b/typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php @@ -203,7 +203,6 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu }'); // Add JS $this->pageRenderer->addJsFile($this->doc->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js'); - $this->pageRenderer->addJsFile($this->doc->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js'); $this->pageRenderer->addJsFile($this->doc->backPath . 'sysext/backend/Resources/Public/JavaScript/iframepanel.js'); if ($this->modTS['showCheckLinkTab'] == 1) { $this->updateListHtml = '<input type="submit" name="updateLinkList" id="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>'; diff --git a/typo3/sysext/t3editor/res/jslib/t3editor.js b/typo3/sysext/t3editor/res/jslib/t3editor.js index 04b9c1855ce8..1a3ec00d524c 100644 --- a/typo3/sysext/t3editor/res/jslib/t3editor.js +++ b/typo3/sysext/t3editor/res/jslib/t3editor.js @@ -173,9 +173,9 @@ T3editor.prototype = { this.textModified = false; } else { if (typeof returnedData.exceptionMessage != 'undefined') { - TYPO3.Flashmessage.display(4, T3editor.lang.errorWhileSaving[0]['target'], returnedData.exceptionMessage); + top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, T3editor.lang.errorWhileSaving[0]['target'], returnedData.exceptionMessage); } else { - TYPO3.Flashmessage.display(4, T3editor.lang.errorWhileSaving[0]['target']); + top.TYPO3.Flashmessage.display(top.TYPO3.Severity.error, T3editor.lang.errorWhileSaving[0]['target']); } } this.modalOverlay.hide(); diff --git a/typo3/sysext/workspaces/Classes/Controller/PreviewController.php b/typo3/sysext/workspaces/Classes/Controller/PreviewController.php index 1266b3facd9c..f5c32318f484 100644 --- a/typo3/sysext/workspaces/Classes/Controller/PreviewController.php +++ b/typo3/sysext/workspaces/Classes/Controller/PreviewController.php @@ -57,7 +57,6 @@ class PreviewController extends AbstractController { $states = $GLOBALS['BE_USER']->uc['moduleData']['Workspaces']['States']; $this->pageRenderer->addInlineSetting('Workspaces', 'States', $states); $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/notifications.js'); - $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js'); $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/iframepanel.js'); $resourcePathJavaScript = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/JavaScript/'; $jsFiles = array( diff --git a/typo3/sysext/workspaces/Classes/Controller/ReviewController.php b/typo3/sysext/workspaces/Classes/Controller/ReviewController.php index 90a2513e9dbe..b0d91a91aa40 100644 --- a/typo3/sysext/workspaces/Classes/Controller/ReviewController.php +++ b/typo3/sysext/workspaces/Classes/Controller/ReviewController.php @@ -146,7 +146,6 @@ class ReviewController extends AbstractController { $this->pageRenderer->addExtDirectCode(array( 'TYPO3.Workspaces' )); - $this->pageRenderer->addJsFile($this->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js'); $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.grid.RowExpander.js'); $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.app.SearchField.js'); $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js'); -- GitLab