summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--save-html.c1
-rw-r--r--theme/list_lib.js15
2 files changed, 15 insertions, 1 deletions
diff --git a/save-html.c b/save-html.c
index 75f7542eb..f777de05d 100644
--- a/save-html.c
+++ b/save-html.c
@@ -37,6 +37,7 @@ void put_HTML_bookmarks(struct membuffer *b, struct dive *dive)
while (ev) {
put_format(b, "{\"name\":\"%s\",", ev->name);
put_format(b, "\"value\":\"%d\",", ev->value);
+ put_format(b, "\"type\":\"%d\",", ev->type);
put_format(b, "\"time\":\"%d\",},", ev->time.seconds);
ev = ev->next;
}
diff --git a/theme/list_lib.js b/theme/list_lib.js
index 904bde554..e4b983703 100644
--- a/theme/list_lib.js
+++ b/theme/list_lib.js
@@ -769,12 +769,25 @@ function get_cylinders_HTML(dive)
return result;
}
+function get_event_value(event)
+{
+ if (event.type == 11 || event.type == 25) { // gas change
+ var he = event.value >> 16;
+ var o2 = event.value & 0xffff;
+ return 'He: ' + he + ' - O2: ' + o2;
+ }
+ if (event.type == 23) { // heading
+ event.value;
+ }
+ return '-';
+}
+
/**
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><td class="Cyl">' + event.value + '</td></tr>';
+ return '<tr><td class="Cyl">' + event.name + '</td><td class="Cyl">' + int_to_time(event.time) + '</td><td class="Cyl">' + get_event_value(event) + '</td></tr>';
}
/**