You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2012/06/09 00:17:37 UTC

svn commit: r1348261 - in /openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp: css/tomee.css js/tomee/view/ApplicationView.js js/tomee/view/components/Panel.js

Author: tveronezi
Date: Fri Jun  8 22:17:36 2012
New Revision: 1348261

URL: http://svn.apache.org/viewvc?rev=1348261&view=rev
Log:
https://issues.apache.org/jira/browse/TOMEE-205
fancy panels need fancy toolbars ;O)

Modified:
    openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/css/tomee.css
    openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/ApplicationView.js
    openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/components/Panel.js

Modified: openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/css/tomee.css
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/css/tomee.css?rev=1348261&r1=1348260&r2=1348261&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/css/tomee.css (original)
+++ openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/css/tomee.css Fri Jun  8 22:17:36 2012
@@ -27,6 +27,12 @@ body {
 
 }
 
+.t-navbar {
+    background-color: #eeeeee; /* Old browsers */
+    background-image: none;
+    box-shadow: 0 1px -1px rgba(0, 0, 0, .25), inset 0 -1px 0 rgba(0, 0, 0, .1);
+}
+
 ul.tree, ul.tree ul {
     list-style-type: none;
     margin: 0;

Modified: openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/ApplicationView.js
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/ApplicationView.js?rev=1348261&r1=1348260&r2=1348261&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/ApplicationView.js (original)
+++ openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/ApplicationView.js Fri Jun  8 22:17:36 2012
@@ -94,6 +94,9 @@ TOMEE.ApplicationView = function (cfg) {
         elMapContent.main.append(newTab);
 
         currentTab = tab;
+
+        //adjust the size
+        calculateContentSize();
     };
 
     //show current tab

Modified: openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/components/Panel.js
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/components/Panel.js?rev=1348261&r1=1348260&r2=1348261&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/components/Panel.js (original)
+++ openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/js/tomee/view/components/Panel.js Fri Jun  8 22:17:36 2012
@@ -22,55 +22,152 @@ TOMEE.components.Panel = function (cfg) 
     var channel = cfg.channel;
     var avoidOverflow = TOMEE.utils.getSafe(cfg.avoidOverflow, false);
 
+    var elMapToolbar = TOMEE.el.getElMap({
+        elName:'main',
+        tag:'div',
+        cls:'navbar',
+        attributes:{
+            style:'margin-bottom: 0px;'
+        },
+        children:[
+            {
+                tag:'div',
+                cls:'navbar-inner t-navbar',
+                attributes:{
+                    style:'padding-left: 0px; padding-right: 0px;'
+                },
+                children:[
+                    {
+                        tag:'div',
+                        children:[
+                            {
+                                elName:'appName',
+                                tag:'a',
+                                cls:'brand',
+                                attributes:{
+                                    href:'#',
+                                    style:'padding-left: 10px; margin-left: 0px;'
+                                },
+                                html:TOMEE.utils.getSafe(cfg.title, '-')
+                            },
+                            {
+                                tag:'div',
+                                cls:'btn-group pull-right',
+                                children:[
+                                    {
+                                        tag:'a',
+                                        cls:'btn dropdown-toggle',
+                                        attributes:{
+                                            'data-toggle':'dropdown',
+                                            href:'#'
+                                        },
+                                        children:[
+                                            {
+                                                tag:'i',
+                                                cls:'icon-cog'
+                                            },
+                                            {
+                                                tag:'span',
+                                                elName:'userNameSpan',
+                                                attributes:{
+                                                    style:'padding-left: 5px; padding-right: 5px;'
+                                                }
+                                            },
+                                            {
+                                                tag:'span',
+                                                cls:'caret'
+                                            }
+                                        ]
+                                    },
+                                    {
+                                        tag:'ul',
+                                        cls:'dropdown-menu',
+                                        attributes:{
+                                            style:'right: 5px;'
+                                        },
+                                        children:[
+                                            {
+                                                tag:'li',
+                                                children:[
+                                                    {
+                                                        elName:'actionLink',
+                                                        tag:'a',
+                                                        attributes:{
+                                                            href:'#'
+                                                        },
+                                                        html:'-'
+                                                    }
+                                                ]
+                                            }
+                                        ]
+
+                                    }
+                                ]
+                            }
+                        ]
+                    }
+                ]
+            }
+        ]
+    });
+
     var map = TOMEE.el.getElMap({
-        elName: 'main',
-        tag: 'div',
-        children: [{
-            tag: 'div',
-            children:[{
-                tag: 'div',
-                cls: 'well t-panel',
-                children:[{
-                    tag: 'h3',
-                    attributes:{
-                        style: 'position: relative; background-color: #d3d3d3; padding-left: 5px'
-                    },
-                    html: TOMEE.utils.getSafe(cfg.title, '-')
-                }, {
-                    elName: 'content',
-                    tag: 'div',
-                    attributes:{
-                        style: 'height: 250px; position: relative; overflow: auto;'
-                    },
-                    createCallback: function(el) {
-                        if(avoidOverflow) {
-                            el.css('overflow', '');
-                        }
+        elName:'main',
+        tag:'div',
+        children:[
+            {
+                tag:'div',
+                children:[
+                    {
+                        tag:'div',
+                        cls:'well t-panel',
+                        children:[
+                            {
+                                elName: 'toolbar',
+                                tag:'div',
+                                attributes:{
+                                    style:'position: relative;'
+                                }
+                            },
+                            {
+                                elName:'content',
+                                tag:'div',
+                                attributes:{
+                                    style:'height: 250px; position: relative; overflow: auto;'
+                                },
+                                createCallback:function (el) {
+                                    if (avoidOverflow) {
+                                        el.css('overflow', '');
+                                    }
+                                }
+                            }
+                        ]
                     }
-                }]
-            }]
-        }]
+                ]
+            }
+        ]
     });
 
+    map.toolbar.append(elMapToolbar.main);
+
 
     var extraStyles = cfg.extraStyles;
-    if(extraStyles) {
-        (function() {
+    if (extraStyles) {
+        (function () {
             var content = map['content'];
 
-            for(var key in extraStyles) {
+            for (var key in extraStyles) {
                 content.css(key, extraStyles[key]);
             }
         })();
     }
 
 
-
     return {
         getEl:function () {
             return map.main;
         },
-        getContentEl: function() {
+        getContentEl:function () {
             return map.content;
         }
     };