diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2014-06-24 21:40:06 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-30 07:56:12 -0700 |
commit | 10345d62fcb3bbe16d1c048e281f37e8570c4a19 (patch) | |
tree | 05589c4db4dd352f8c59a107f4ab1ef30ba7caf8 /theme/list_lib.js | |
parent | b438158693b54ed0e9359184a075947dcd602790 (diff) | |
download | subsurface-10345d62fcb3bbe16d1c048e281f37e8570c4a19.tar.gz |
HTML: export dive events to detailed view
Add table of dive events to the dive detailed view. This should view
each event, its type and the time this event took place.
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/list_lib.js')
-rw-r--r-- | theme/list_lib.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/theme/list_lib.js b/theme/list_lib.js index 20dc5a79e..e1ea5644f 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -826,6 +826,29 @@ function get_cylinders_HTML(dive) } /** +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">' + event.time + '</td></tr>'; +} + +/** +*Return HTML table of bookmarks of a dive. +*/ +function get_bookmarks_HTML(dive) +{ + var result = ""; + result += '<h2 class="det_hed">Events</h2><table><tr><td class="words">Name</td><td class="words">Time</td></tr>'; + for (var i in dive.events) { + result += get_bookmark_HTML(dive.events[i]); + } + result += '</table>'; + return result; +} + + +/** *Return HTML main data of a dive */ function get_dive_HTML(dive) @@ -886,6 +909,7 @@ function showDiveDetails(dive) canvas_draw(); document.getElementById("diveinfo").innerHTML = get_dive_HTML(items[dive_id]); document.getElementById("dive_equipments").innerHTML = get_cylinders_HTML(items[dive_id]); + document.getElementById("bookmarks").innerHTML=get_bookmarks_HTML(items[dive_id]); //hide the list of dives and show the canvas. document.getElementById("diveListPanel").style.display = 'none'; |