Resolved FELIX-2232 /Event plugin has problems displaying events with properties/

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk/webconsole-plugins/event@926960 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/resources/res/events.html b/src/main/resources/res/events.html
index 784c823..9fe35ac 100644
--- a/src/main/resources/res/events.html
+++ b/src/main/resources/res/events.html
@@ -35,3 +35,9 @@
 </table>

 

 <div id="timeline" class="ui-helper-hidden">&nbsp;</div>

+<div id="timelineLegend" class="ui-helper-hidden">

+	<span class="event eventservice">Service Event</span>

+	<span class="event eventbundle">Bundle Event</span>

+	<span class="event eventconfig">Config Event</span>

+	<span class="event eventframework">Framework Event</span>

+</div>

diff --git a/src/main/resources/res/ui/events.css b/src/main/resources/res/ui/events.css
index 68833ac..2c25dfb 100644
--- a/src/main/resources/res/ui/events.css
+++ b/src/main/resources/res/ui/events.css
@@ -15,11 +15,13 @@
  * limitations under the License.
  */
 #timeline          { width: 100%; overflow-x: scroll }
+#timelineLegend .event { display: inline-block; width: 12em; margin: .2em 0; text-align: center }
 .event                 { overflow:visible; white-space:nowrap }
 .eventservice { background-color: #ADFF2F }
 .eventbundle   { background-color: #FFCACD }
 .eventconfig   { background-color: #FFD700 }
 .eventframework { background-color: #DCDCDC }
 
-.propName { padding: 0 4px 0 0 }
-.propVal   { padding: 0 0 0 4px }
\ No newline at end of file
+table.propTable, table.propTable tr, table.propTable td { border: none !important }
+td.propName { padding: 0 4px 0 0; text-align: right !important; text-decoration: underline }
+td.propVal   { padding: 0 0 0 4px }
\ No newline at end of file
diff --git a/src/main/resources/res/ui/events.js b/src/main/resources/res/ui/events.js
index 7a6d1a0..02cd849 100644
--- a/src/main/resources/res/ui/events.js
+++ b/src/main/resources/res/ui/events.js
@@ -51,30 +51,30 @@
     if ( dataEntry.info ) {
     	propE = text(dataEntry.info);
     } else {
-	    var propE = createElement('table', 'nicetable');
 	    var bodyE = createElement('tbody');
-	    propE.appendChild(bodyE);
-	
 	    for( var p in dataEntry.properties ) {
 	    	bodyE.appendChild(tr(null, null, [ 
-				td(null, 'propName', [text(p)]),
-				td(null, 'propVal', [text(dataEntry.properties[p])])
+				td('propName', null, [text(p)]),
+				td('propVal' , null, [text(dataEntry.properties[p])])
 			]));
 	    }
+	    propE = createElement('table', 'propTable', null, [ bodyE ]);
     }
 
 	$(tr( null, { id: 'entry' + dataEntry.id }, [
 		td( null, null, [ text( printDate(dataEntry.received) ) ] ),
 		td( null, null, [ text( dataEntry.topic ) ] ),
-		propE
+		td( null, null, [ propE ] )
 	])).appendTo(eventsBody);
 }
 
 var timeline = false;
+var timelineLegend = false;
 $(document).ready(function(){
 	eventsTable = $('#eventsTable');
 	eventsBody  = eventsTable.find('tbody');
 	timeline = $('#timeline');
+	timelineLegend = $('#timelineLegend');
 
 	$('#clear').click(function () {
 		$.post(pluginRoot, { 'action':'clear' }, renderData, 'json');
@@ -84,15 +84,16 @@
 		if (timelineHidden) {
 			$(this).text(i18n.displayList);
 			timeline.removeClass('ui-helper-hidden');
+			timelineLegend.removeClass('ui-helper-hidden');
 			eventsTable.addClass('ui-helper-hidden');
 		} else {
 			$(this).text(i18n.displayTimeline);
 			timeline.addClass('ui-helper-hidden');
+			timelineLegend.addClass('ui-helper-hidden');
 			eventsTable.removeClass('ui-helper-hidden');
 		}
 	});
 	$('#reload').click(function() {
 		$.get(pluginRoot + '/data.json', null, renderData, 'json');
-		//renderData(eventData);
 	}).click();
 });