Added Feature #13799: ExtJS driven fading in/out Flashmessages
authorSteffen Kamper <info@sk-typo3.de>
Tue, 13 Apr 2010 09:20:55 +0000 (09:20 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Tue, 13 Apr 2010 09:20:55 +0000 (09:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7337 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/js/extjs/ux/flashmessages.js [new file with mode: 0644]
typo3/backend.php

index 901690b..e82cb54 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
 
 2010-04-13  Steffen Kamper  <info@sk-typo3.de>
 
+       * Added Feature #13799: ExtJS driven fading in/out Flashmessages
        * Corrected spelling errors in felogin manual
        * Added Feature #12229: Add stdWrap date/strftime with GMT format property
        * Fixed bug #13402: Active suggest feature for TCA fields with foreign tables
diff --git a/t3lib/js/extjs/ux/flashmessages.js b/t3lib/js/extjs/ux/flashmessages.js
new file mode 100644 (file)
index 0000000..d9dc0be
--- /dev/null
@@ -0,0 +1,81 @@
+/***************************************************************\r
+ *  Copyright notice\r
+ *\r
+ *  (c) 2010 Steffen Kamper <info@sk-typo3.de>\r
+ *  All rights reserved\r
+ *\r
+ *  This script is part of the TYPO3 project. The TYPO3 project is\r
+ *  free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation; either version 2 of the License, or\r
+ *  (at your option) any later version.\r
+ *\r
+ *  The GNU General Public License can be found at\r
+ *  http://www.gnu.org/copyleft/gpl.html.\r
+ *\r
+ *  This script is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU General Public License for more details.\r
+ *\r
+ *  This copyright notice MUST APPEAR in all copies of the script!\r
+ ***************************************************************/\r
+\r
+/**\r
+ * Flashmessage rendered by ExtJS\r
+ *\r
+ *\r
+ * @author Steffen Kamper <info@sk-typo3.de>\r
+ * @package TYPO3\r
+ * @subpackage t3lib\r
+ * @version $Id: $\r
+ */\r
+Ext.ns('TYPO3');\r
+\r
+/**\r
+ * @class TYPO3.Flashmessage\r
+ * Passive popup box singleton\r
+ * @singleton\r
+ *\r
+ * Example (Information message):\r
+ * TYPO3.Flashmessage.display(1, 'TYPO3 Backend - Version 4.4', 'Ready for take off', 3);\r
+ */\r
+TYPO3.Flashmessage = function() {\r
+       var messageContainer;\r
+       var severities = ['notice', 'information', 'ok', 'warning', 'error'];\r
+\r
+       function createBox(severity, title, message){\r
+               return ['<div class="typo3-message message-', severity, '" style="width: 400px">',\r
+                               '<div class="header-container">',\r
+                               '<div class="message-header">', title, '</div>',\r
+                               '</div>',\r
+                               '<div class="message-body">', message, '</div>',\r
+                               '</div>'].join('');\r
+       }\r
+\r
+       return {\r
+               /**\r
+                * Shows popup\r
+                * @member TYPO3.Flashmessage\r
+                * @param int severity (0=notice, 1=information, 2=ok, 3=warning, 4=error)\r
+                * @param string title\r
+                * @param string message\r
+                * @param float duration in sec (default 5)\r
+                */\r
+               display : function(severity, title, message, duration){\r
+                       duration = duration || 5;\r
+                       if(!messageContainer){\r
+                               messageContainer = Ext.DomHelper.insertFirst(document.body, {\r
+                                       id   : 'msg-div',\r
+                                       style: 'position:absolute;z-index:10000'\r
+                               }, true);\r
+                       }\r
+\r
+                       var box = Ext.DomHelper.append(messageContainer, {\r
+                               html: createBox(severities[severity], title, message)\r
+                       }, true);\r
+                       messageContainer.alignTo(document, 't-t');\r
+                       box.slideIn('t').pause(duration).ghost('t', {remove:true});\r
+               }\r
+       }\r
+}();
\ No newline at end of file
index c54070f..ac00c10 100644 (file)
@@ -128,6 +128,7 @@ class TYPO3backend {
                        'js/flashupload.js',
                        '../t3lib/jsfunc.evalfield.js',
                        'ajax.php?ajaxID=ExtDirect::getAPI&namespace=TYPO3.Backend',
+                       '../t3lib/js/extjs/ux/flashmessages.js',
                        'js/backend.js',
                        'js/loginrefresh.js',
                        'js/extjs/viewport.js',