felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r671917 - in /felix/trunk/webconsole/src/main/resources/res: imgs/left.gif ui/datatable.js
Date Thu, 26 Jun 2008 15:00:50 GMT
Author: fmeschbe
Date: Thu Jun 26 08:00:50 2008
New Revision: 671917

URL: http://svn.apache.org/viewvc?rev=671917&view=rev
Log:
FELIX-614 display left array with "go back to full list" functionality
on single bundle/component display

Added:
    felix/trunk/webconsole/src/main/resources/res/imgs/left.gif   (with props)
Modified:
    felix/trunk/webconsole/src/main/resources/res/ui/datatable.js

Added: felix/trunk/webconsole/src/main/resources/res/imgs/left.gif
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/imgs/left.gif?rev=671917&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/trunk/webconsole/src/main/resources/res/imgs/left.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: felix/trunk/webconsole/src/main/resources/res/ui/datatable.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/datatable.js?rev=671917&r1=671916&r2=671917&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/datatable.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/datatable.js Thu Jun 26 08:00:50 2008
@@ -65,9 +65,15 @@
 function data( /* Array of Object */ dataArray )
 {
     // render components
-    for ( var idx in dataArray )
+    if (dataArray.length == 1)
     {
-        entry( dataArray[idx] );
+        entry( dataArray[0], true );
+    }
+    else {
+        for ( var idx in dataArray )
+        {
+            entry( dataArray[idx] );
+        }
     }
 }
 
@@ -82,10 +88,10 @@
 }
 
 
-function entry( /* Object */ dataEntry )
+function entry( /* Object */ dataEntry, /* boolean */ singleEntry )
 {
     var trElement = tr( null, { id: "entry" + dataEntry.id } );
-    entryInternal( trElement,  dataEntry );
+    entryInternal( trElement,  dataEntry, singleEntry );
     document.write( serialize( trElement ) );
 
     // dataEntry detailed properties
@@ -98,28 +104,32 @@
 }
 
 
-function entryInternal( /* Element */ parent, /* Object */ dataEntry )
+function entryInternal( /* Element */ parent, /* Object */ dataEntry, /* boolean */ singleEntry
)
 {
 
     var id = dataEntry.id;
     var name = dataEntry.name;
     var state = dataEntry.state;
-    var icon = (dataEntry.props) ? "down" : "right";
+    var icon = singleEntry ? "left" : (dataEntry.props ? "down" : "right");
+    var event = singleEntry ? "history.back()" : "showDataEntryDetails(" + id + ")"; 
 
-    parent.appendChild( addText( td( "content right" ), id ) );
+    parent.appendChild( td( "content right", null, [ text( id ) ] ) );
     
-    var tdEl = td( "content" );
-    tdEl.appendChild( createElement( "img", null, {
-            src: appRoot + "/res/imgs/" + icon + ".gif",
-            onClick: "showDataEntryDetails(" + id + ")",
-            id: "entry" + id + "_inline"
-        } ) );
-    tdEl.appendChild( addText( createElement( "a", null, {
-            href: pluginRoot + "/" + id
-        } ), name ) );
-    parent.appendChild( tdEl );
+    parent.appendChild( td( "content", null, [
+            createElement( "img", null, {
+                src: appRoot + "/res/imgs/" + icon + ".gif",
+                onClick: event,
+                id: "entry" + id + "_inline"
+            } ),
+            text( "\u00a0" ),
+            createElement( "a", null, {
+                href: pluginRoot + "/" + id
+            }, [ text( name ) ]
+            )]
+        )
+    );
 
-    parent.appendChild( addText( td( "content center" ), state ) );
+    parent.appendChild( td( "content center", null, [ text( state ) ] ) );
 
     for ( var aidx in dataEntry.actions )
     {
@@ -196,7 +206,8 @@
  }
 
  
-function showDetails(bundleId) {
+function showDetails(bundleId)
+{
     var span = document.getElementById('bundle' + bundleId + '_details');
 }
 



Mime
View raw message