diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2014-07-26 16:29:16 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-08-04 10:02:58 -0700 |
commit | bfc919b1c3d9d39f6296179d8a6a1fbbd9b22782 (patch) | |
tree | 47c291a3db159553558f34b480181f79ffa8a2c8 /theme | |
parent | 0416a09a1e3d2a2fe3f97dbe098520bb24cc2a8d (diff) | |
download | subsurface-bfc919b1c3d9d39f6296179d8a6a1fbbd9b22782.tar.gz |
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 <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'theme')
-rw-r--r-- | theme/list_lib.js | 15 |
1 files changed, 14 insertions, 1 deletions
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>'; } /** |