HTML: add event value to the detailed view.

Event value is important in case of gas change and heading events.
The value information show: mix and direction.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Gehad elrobey 2014-07-19 05:09:48 +02:00 committed by Dirk Hohndel
parent f46b6f6ee2
commit feb3d6e476
2 changed files with 3 additions and 2 deletions

View file

@ -36,6 +36,7 @@ void put_HTML_bookmarks(struct membuffer *b, struct dive *dive)
put_string(b, "\"events\":[");
while (ev) {
put_format(b, "{\"name\":\"%s\",", ev->name);
put_format(b, "\"value\":\"%d\",", ev->value);
put_format(b, "\"time\":\"%d\",},", ev->time.seconds);
ev = ev->next;
}

View file

@ -747,7 +747,7 @@ Return the HTML string for a bookmark entry in the table.
*/
function get_bookmark_HTML(event)
{
return '<tr><td class="Cyl">' + event.name + '</td><td class="Cyl">' + int_to_time(event.time) + '</td></tr>';
return '<tr><td class="Cyl">' + event.name + '</td><td class="Cyl">' + int_to_time(event.time) + '</td><td class="Cyl">' + event.value + '</td></tr>';
}
/**
@ -758,7 +758,7 @@ function get_bookmarks_HTML(dive)
if (dive.events <= 0)
return "";
var result = "";
result += '<h2 class="det_hed">Events</h2><table><tr><td class="words">Name</td><td class="words">Time</td></tr>';
result += '<h2 class="det_hed">Events</h2><table><tr><td class="words">Name</td><td class="words">Time</td><td class="words">Value</td></tr>';
for (var i in dive.events) {
result += get_bookmark_HTML(dive.events[i]);
}