Index: t3lib/js/extjs/ux/flashmessages.js =================================================================== --- t3lib/js/extjs/ux/flashmessages.js (revision 0) +++ t3lib/js/extjs/ux/flashmessages.js (revision 0) @@ -0,0 +1,82 @@ +/*************************************************************** + * Copyright notice + * + * (c) 2010 Steffen Kamper + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script 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. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +/** + * Flashmessage rendered by ExtJS + * + * + * @author Steffen Kamper + * @package TYPO3 + * @subpackage t3lib + * @version $Id: $ + */ +Ext.ns('TYPO3'); + +/** + * @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']; + + function createBox(severity, title, message){ + return ['
', + '
', + '
', title, '
', + '
', + '
', message, '
', + '
'].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(severities[severity], title, message) + }, true); + messageContainer.alignTo(document, 't-t'); + box.slideIn('t').pause(duration).ghost('t', {remove:true}); + } + } +}(); Index: typo3/backend.php =================================================================== --- typo3/backend.php (revision 7251) +++ typo3/backend.php (working copy) @@ -103,6 +103,7 @@ 'js/iecompatibility.js', 'js/flashupload.js', '../t3lib/jsfunc.evalfield.js', + '../t3lib/js/extjs/ux/flashmessages.js', 'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Backend' );