tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tveron...@apache.org
Subject svn commit: r1291237 - /openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js
Date Mon, 20 Feb 2012 13:06:22 GMT
Author: tveronezi
Date: Mon Feb 20 13:06:21 2012
New Revision: 1291237

URL: http://svn.apache.org/viewvc?rev=1291237&view=rev
Log:
https://issues.apache.org/jira/browse/TOMEE-130

Creating a carousel to show jndi details. (Back button)

Modified:
    openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js

Modified: openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js?rev=1291237&r1=1291236&r2=1291237&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js
(original)
+++ openejb/trunk/openejb/tomee/tomee-webapp/src/main/webapp/staging/js/tomee/view/ApplicationJndiPanel.js
Mon Feb 20 13:06:21 2012
@@ -62,9 +62,8 @@ TOMEE.ApplicationJndiPanel = function (c
     var addCarouselItem = function (carouselParams) {
         var captionTpl = [
             '          <br/><br/><br/><br/><br/><br/>',
-            '          <div class="carousel-caption">',
-            '              <h4>{0}</h4>',
-            '              <p>{1}</p>',
+            '          <div class="carousel-caption" style="padding: 5px;">',
+            '{0}',
             '          </div>'
         ].join('');
 
@@ -78,19 +77,18 @@ TOMEE.ApplicationJndiPanel = function (c
         ].join('');
 
         var result = '';
-        if (carouselParams.caption) {
-            var caption = TOMEE.utils.stringFormat(captionTpl,
-                carouselParams.caption.title,
-                carouselParams.caption.message
-            );
+        if (carouselParams.captionTpl) {
+            var caption = TOMEE.utils.stringFormat(captionTpl, carouselParams.captionTpl);
             result = TOMEE.utils.stringFormat(tpl, carouselParams.bodyTpl, caption);
 
         } else {
             result = TOMEE.utils.stringFormat(tpl, carouselParams.bodyTpl, '');
         }
 
-        elements.carousel.append($(result));
+        var el = $(result);
+        elements.carousel.append(el);
         elements.carousel.carousel('next');
+        return el;
     };
 
     var showBeanPanel = function (bean) {
@@ -102,13 +100,31 @@ TOMEE.ApplicationJndiPanel = function (c
             '<p>beanType: ' + bean['beanType'] + '</p>'
         ].join('');
 
-        addCarouselItem({
-            caption: {
-                title: TOMEE.ApplicationI18N.get('app.home.menu.tools.jndi.browser.bean'),
-                message: TOMEE.ApplicationI18N.get('app.home.menu.tools.jndi.browser.bean.details')
-            },
+        var backUid = TOMEE.Sequence.next('CAROUSEL-BACK');
+        var captionTpl = [
+            '<div class="btn-group">',
+            '<a class="btn" id="' + backUid + '" href="#">Back</a>',
+            '<a class="btn" href="#">Invoke</a>',
+            '<a class="btn" href="#">View class</a>',
+            '</div>'
+        ].join('');
+
+        var item = addCarouselItem({
+            captionTpl: captionTpl,
             bodyTpl: bodyTpl
         });
+
+        var backBtn = item.find("#" + backUid);
+        backBtn.on('click', function() {
+            elements.carousel.carousel('prev');
+
+            var task = TOMEE.DelayedTask({
+                callback:function() {
+                    item.remove();
+                }
+            });
+            task.delay(1000);
+        });
     };
 
     var addRow = function (bean) {



Mime
View raw message