summaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
authorGravatar willemferguson <willemferguson@zoology.up.ac.za>2019-12-03 08:58:09 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-03 20:37:57 -0800
commit7c024f12d2123e08c272cefb2991623bc1da107a (patch)
treedd9891f167a8dd0a055584db67d79d0b98bc68da /theme
parent9006e3d1027279621af5f10f25c5c2c4bf2f5b9c (diff)
downloadsubsurface-7c024f12d2123e08c272cefb2991623bc1da107a.tar.gz
Desktop: add export to html
Add the export of environmental parameters in star widgets to .html format. The dive rating is always shown both in the condensed as well as in the expanded view. The other five environmental variables are only shown in the expanded view. Only those star widgets with a rating are shown: if a star widget has not been rated in the UI, then it is assumed unrated and is not indicated in the expanded view. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'theme')
-rw-r--r--theme/list_lib.js25
1 files changed, 17 insertions, 8 deletions
diff --git a/theme/list_lib.js b/theme/list_lib.js
index 143bfd492..05ac98d2a 100644
--- a/theme/list_lib.js
+++ b/theme/list_lib.js
@@ -224,11 +224,10 @@ function getExpanded(dive)
var res = '<table><tr><td class="words">' + translate.Date + ': </td><td>' + dive.date +
'</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + translate.Time + ': </td><td>' + dive.time +
'</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + translate.Location + ': </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, divemaster:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a>' + getDiveCoor(dive) +
- '</td></tr></table><table><tr><td class="words">' + translate.Rating + ':</td><td>' + putRating(dive.rating) +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;' + translate.Visibility + ':</td><td>' + putRating(dive.visibility) +
'</td></tr></table>' +
'<table><tr><td class="words">' + translate.Air_Temp + ': </td><td>' + dive.temperature.air +
'</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;' + translate.Water_Temp + ': </td><td>' + dive.temperature.water +
+ '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;' + translate.Rating + ':</td><td>' + putRating(dive.rating) +
'</td></tr></table><table><tr><td class="words">' + translate.Max_Depth + ': </td><td>' + put_depth_unit(dive.maxdepth) + " " + depth_unit + '</td></tr><tr><td class="words">' + translate.Duration + ': </td><td>' + dive.dive_duration +
'</td></tr><tr><td class="words">' + translate.DiveMaster + ': </td><td>' + dive.divemaster +
'</td></tr><tr><td class="words"><p>' + translate.Buddy + ': </p></td><td>' + dive.buddy +
@@ -964,13 +963,23 @@ function getDiveCoor(dive)
*/
function get_dive_HTML(dive)
{
- var res = '<h2 class="det_hed">' + translate.Dive_information + '</h2><table><tr><td class="words">' + translate.Date + ': </td><td>' + dive.date +
+ var table1 = '<h2 class="det_hed">' + translate.Dive_information + '</h2><table><tr><td class="words">' + translate.Date + ': </td><td>' + dive.date +
'</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + translate.Time + ': </td><td>' + dive.time +
'</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + translate.Location + ': </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, divemaster:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a></td>' + getDiveCoor(dive) +
- '</tr></table><table><tr><td class="words">' + translate.Rating + ':</td><td>' + putRating(dive.rating) +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;' + translate.Visibility + ':</td><td>' + putRating(dive.visibility) +
- '</td></tr></table>' +
- '<table><tr><td class="words">' + translate.Air_Temp + ': </td><td>' + dive.temperature.air +
+ '</tr></table>';
+ var table2 = '<table><tr><td class="words">' + translate.Rating + ':</td><td>' + putRating(dive.rating) + '</td>';
+ if (dive.wavesize > 0)
+ table2 += '<td class="words">&nbsp;&nbsp;&nbsp;' + translate.WaveSize + ':</td><td>' + putRating(dive.wavesize) + '</td>';
+ if (dive.visibility > 0)
+ table2 += '</td><td class="words">&nbsp;&nbsp;&nbsp;' + translate.Visibility + ':</td><td>' + putRating(dive.visibility) + '</td>';
+ if (dive.current > 0)
+ table2 += '<td class="words">&nbsp;&nbsp;&nbsp;' + translate.Current + ':</td><td>' + putRating(dive.current) + '</td>';
+ if (dive.surge > 0)
+ table2 += '<td class="words">&nbsp;&nbsp;&nbsp;' + translate.Surge + ':</td><td>' + putRating(dive.surge) + '</td>';
+ if (dive.chill > 0)
+ table2 += '<td class="words">&nbsp;&nbsp;&nbsp;' + translate.Chill + ':</td><td>' + putRating(dive.chill) + '</td>';
+ table2 += '</tr></table>';
+ var table3 = '<table><tr><td class="words">' + translate.Air_Temp + ': </td><td>' + dive.temperature.air +
'</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;' + translate.Water_Temp + ': </td><td>' + dive.temperature.water +
'</td></tr></table><table><tr><td class="words">' + translate.Max_Depth + ': </td><td>' + put_depth_unit(dive.maxdepth) + " " + depth_unit + '</td></tr><tr><td class="words">' + translate.Duration + ': </td><td>' + dive.dive_duration +
'</td></tr><tr><td class="words">' + translate.DiveMaster + ': </td><td>' + dive.divemaster +
@@ -978,7 +987,7 @@ function get_dive_HTML(dive)
'</td></tr><tr><td class="words">' + translate.Suit + ': </td><td>' + dive.suit +
'</td></tr><tr><td class="words">' + translate.Tags + ': </td><td>' + putTags(dive.tags) +
'</td></tr></table>'+ put_divecomputer_details(dive.divecomputers) +'<div style="margin:10px;"><p class="words">' + translate.Notes + ': </p>' + dive.notes + '</div>';
- return res;
+ return table1 + table2 + table3;
};
function put_divecomputer_details(dc)