From bfc919b1c3d9d39f6296179d8a6a1fbbd9b22782 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Sat, 26 Jul 2014 16:29:16 +0200 Subject: HTML: Fix event value fields. - The gas event values can contain o2 and he mix in gas change events. - Give a '-' value for events that don't have any sensible values. - Show event value if event type is heading or gaschange. Signed-off-by: Gehad elrobey Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- theme/list_lib.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'theme') 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 '' + event.name + '' + int_to_time(event.time) + '' + event.value + ''; + return '' + event.name + '' + int_to_time(event.time) + '' + get_event_value(event) + ''; } /** -- cgit v1.2.3-70-g09d2