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,49 @@ +/** + * @class TYPO3.Flashmessage + * Passive popup box (a toast) singleton + * @singleton + * + * Example: + * TYPO3.Flashmessage.msg(1, 'TYPO3 Backend - Version 4.4', 'Ready for take off', 3); + */ + +Ext.ns('TYPO3'); + +TYPO3.Flashmessage = function() { + var msgContainer; + var sev = ['notice', 'ok', 'warning', 'error']; + + function createBox(severity, title, message){ + return ['
', + '
', + '
', title, '
', + '
', + '
', message, '
', + '
'].join(''); + } + + return { + /** + * Shows popup + * @member TYPO3.Flashmessage + * @param {int} severity 0=notice, 1=ok, 2=warning, 3=error + * @param {String} title + * @param {String} message + * @param {float} duration in sec (default 5) + * @param {String} parentContainer (default document.body) + */ + msg : function(severity, title, message, duration, parentContainer){ + duration = duration || 5; + parentContainer = parentContainer || document.body; + if(!msgContainer){ + msgContainer = Ext.DomHelper.insertFirst(parentContainer, {id:'msg-div',style:'position:absolute;z-index:10000'}, true); + } + + var m = Ext.DomHelper.append(msgContainer, {html:createBox(sev[severity], title, message)}, true); + msgContainer.alignTo(document, 't-t'); + m.slideIn('t').pause(duration).ghost("t", {remove:true}); + } + } + +}(); + Index: typo3/backend.php =================================================================== --- typo3/backend.php (revision 7093) +++ 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' );