summaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
Diffstat (limited to 'theme')
-rw-r--r--theme/dive_export.html36
-rw-r--r--theme/light.css9
-rw-r--r--theme/list_lib.js218
-rw-r--r--theme/sand.css15
4 files changed, 192 insertions, 86 deletions
diff --git a/theme/dive_export.html b/theme/dive_export.html
index 91b0ef749..697c16ca3 100644
--- a/theme/dive_export.html
+++ b/theme/dive_export.html
@@ -39,6 +39,10 @@ function load_scripts()
document.getElementsByTagName("head")[0].appendChild(fileref);
fileref=document.createElement('script');
+ fileref.setAttribute("src", location.pathname + "_files/translation.json");
+ document.getElementsByTagName("head")[0].appendChild(fileref);
+
+ fileref=document.createElement('script');
fileref.setAttribute("src", location.pathname + "_files/settings.json");
document.getElementsByTagName("head")[0].appendChild(fileref);
@@ -121,9 +125,16 @@ window.onload=function(){
showAllDives();
document.getElementById("divePanel").style.display='none';
document.getElementById("diveStat").style.display='none';
+ if (divestat.length <= 0)
+ document.getElementById("stats_button").style.display='none';
+
document.body.style.visibility='visible';
document.onkeydown = switchDives;
+
+ //translate Page
+ translate_page();
+ getDefaultColor();
}
function changeAdvSearch(e){
@@ -142,7 +153,8 @@ function changeAdvSearch(e){
</center>
<div id="diveListPanel">
<div id="controlbox">
- <input id="search_input" oninput="SearchModules(this.value, null)" placeholder="search"/><a id="adv_srch_sp" onClick="showdiv()" >Advanced Search</a>
+ <input id="search_input" oninput="SearchModules(this.value, null)" placeholder="search"/>
+ <a id="adv_srch_sp" onClick="showdiv()" >Advanced Search</a>
<div id="advanced_search">
<input type="checkbox" onchange="changeAdvSearch(this)" value="location" checked>Location<br>
<input type="checkbox" onchange="changeAdvSearch(this)" value="divemaster" checked>Divemaster<br>
@@ -157,19 +169,19 @@ function changeAdvSearch(e){
<option>50</option>
<option>100</option>
</select>
- <button onClick="expandAll()"> Expand All </button>
- <button onClick="collapseAll()"> Collapse All </button>
+ <button id="expnd_all_btn" onClick="expandAll()"> Expand All </button>
+ <button id="claps_all_btn" onClick="collapseAll()"> Collapse All </button>
<button id="trip_button" onclick="toggleTrips();">trips</button>
<button id="stats_button" onclick="toggleStats();">Stats</button>
</div>
</div>
<div id="header">
- <div onClick="change_sort_col('1')" class="item">Number</div>
- <div onClick="change_sort_col('2')" class="item">Date</div>
- <div onClick="change_sort_col('3')" class="item">Time</div>
- <div onClick="change_sort_col('6')" class="item_large">Location</div>
- <div onClick="change_sort_col('4')" class="item">Air Temp</div>
- <div onClick="change_sort_col('5')" class="item">Water Temp</div>
+ <div id="number_header" onClick="change_sort_col('1')" class="item">Number</div>
+ <div id="date_header" onClick="change_sort_col('2')" class="item">Date</div>
+ <div id="time_header" onClick="change_sort_col('3')" class="item">Time</div>
+ <div id="location_header" onClick="change_sort_col('6')" class="item_large">Location</div>
+ <div id="air_temp_header" onClick="change_sort_col('4')" class="item">Air Temp</div>
+ <div id="water_temp_header" onClick="change_sort_col('5')" class="item">Water Temp</div>
</div>
<div id="diveslist">
</div>
@@ -185,7 +197,7 @@ function changeAdvSearch(e){
<center>
<div id="but">
<button onClick="prevDetailedDive()">&lt;-</button>
- <button onClick="unshowDiveDetails()">Back to List</button>
+ <button id="bk_to_ls_lbl" onClick="unshowDiveDetails()">Back to List</button>
<button onClick="nextDetailedDive()">-&gt;</button>
</div>
</center>
@@ -194,7 +206,7 @@ function changeAdvSearch(e){
<h2 id="dive_no"></h2>
<h3 id="dive_location"></h3>
</center>
- <h2 class="det_hed">Dive profile</h2>
+ <h2 id="div_profil_lbl" class="det_hed">Dive profile</h2>
<div style="width:100%" id="chart1"></div>
</div>
<div id="diveinfo">
@@ -221,7 +233,7 @@ function changeAdvSearch(e){
</div>
<div id="diveStat">
<center>
- <button onClick="toggleStats()">Back to List</button>
+ <button id="bk_to_ls_lbl2" onClick="toggleStats()">Back to List</button>
</center>
<div id="diveStatsData">
</div>
diff --git a/theme/light.css b/theme/light.css
index a1acbfa65..baa04b62b 100644
--- a/theme/light.css
+++ b/theme/light.css
@@ -129,7 +129,6 @@ input[type=checkbox]{
font-weight:bold;
}
-
#controller{
min-width:200px;
padding:10px;
@@ -159,8 +158,14 @@ input[type=checkbox]{
}
.statscell{
- min-width:100px;
+ min-width:120px;
+ height: 25px;
margin:0px;
+ text-align:center;
+}
+
+.stats_row{
+ background-color:rgba(125,125,125,0.3);
}
#stats_header{
diff --git a/theme/list_lib.js b/theme/list_lib.js
index 684d92e13..c66be6414 100644
--- a/theme/list_lib.js
+++ b/theme/list_lib.js
@@ -126,7 +126,7 @@ function next_page()
function view_pagging(start, end)
{
var page = document.getElementById("pagging");
- page.innerHTML = (start + 1) + ' to ' + (end + 1) + ' of ' + (itemsToShow.length) + ' dives';
+ page.innerHTML = (start + 1) + ' to ' + (end + 1) + ' of ' + (itemsToShow.length) + '' + translate.dives;
}
/**
@@ -134,12 +134,14 @@ function view_pagging(start, end)
*/
function expandAll()
{
+ console.time('expnadAll');
for (var i = start; i < start + sizeofpage; i++) {
if (i >= itemsToShow.length)
break;
unexpand(document.getElementById(itemsToShow[i]));
items[itemsToShow[i]].expanded = false;
}
+ console.timeEnd('expnadAll');
}
/**
@@ -204,21 +206,22 @@ function getlimited(dive)
function getExpanded(dive)
{
- var res = '<table><tr><td class="words">Date: </td><td>' + dive.date +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time: </td><td>' + dive.time +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Location: </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, divemaster:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a>' +
- '</td></tr></table><table><tr><td class="words">Rating:</td><td>' + putRating(dive.rating) +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;Visibilty:</td><td>' + putRating(dive.visibility) +
+ 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">Air temp: </td><td>' + dive.temperature.air +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;Water temp: </td><td>' + dive.temperature.water +
- '</td></tr></table><table><tr><td class="words">DiveMaster: </td><td>' + dive.divemaster +
- '</td></tr><tr><td class="words"><p>Buddy: </p></td><td>' + dive.buddy +
- '</td></tr><tr><td class="words">Suit: </td><td>' + dive.suit +
- '</td></tr><tr><td class="words">Tags: </td><td>' + putTags(dive.tags) +
- '</td></tr></table><div style="margin:10px;"><p class="words">Notes: </p>' + dive.notes + '</div>';
+ '<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.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 +
+ '</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><div style="margin:10px;"><p class="words">' + translate.Notes + ': </p>' + dive.notes + '</div>';
if (settings.listOnly === '0') {
- res += '<center><a onclick="showDiveDetails(' + dive.number + ')">show more details</a></center>';
+ res += '<center><a onclick="showDiveDetails(' + dive.number + ')">' + translate.Show_more_details + '</a></center>';
}
return res;
};
@@ -271,7 +274,7 @@ var locat = true;
This variable keep the state of the col.
which is sorted upon it.
*/
-var sort_based_on = 1; // sorting is based on number by default.
+var sort_based_on = '1'; // sorting is based on number by default.
function change_sort_col(sortOn)
{
@@ -371,9 +374,14 @@ function cmpNumAsc(j, iSmaller)
return items[j].subsurface_number < items[iSmaller].subsurface_number;
}
+function cmpNumAsc(j, iSmaller)
+{
+ return settings.subsurfaceNumbers === '0' ? items[j].number < items[iSmaller].number : items[j].subsurface_number < items[iSmaller].subsurface_number;
+}
+
function cmpNumDes(j, iSmaller)
{
- return items[j].subsurface_number > items[iSmaller].subsurface_number;
+ return settings.subsurfaceNumbers === '0' ? items[j].number > items[iSmaller].number : items[j].subsurface_number > items[iSmaller].subsurface_number;
}
function cmpTimeAsc(j, iSmaller)
@@ -398,22 +406,22 @@ function cmpDateDes(j, iSmaller)
function cmpAtempAsc(j, iSmaller)
{
- return parseInt(items[j].temperature.air, 10) < parseInt(items[iSmaller].temperature.air, 10);
+ return parseFloat(items[j].temperature.air, 10) < parseFloat(items[iSmaller].temperature.air, 10);
}
function cmpAtempDes(j, iSmaller)
{
- return parseInt(items[j].temperature.air, 10) > parseInt(items[iSmaller].temperature.air, 10);
+ return parseFloat(items[j].temperature.air, 10) > parseFloat(items[iSmaller].temperature.air, 10);
}
function cmpWtempAsc(j, iSmaller)
{
- return parseInt(items[j].temperature.water, 10) < parseInt(items[iSmaller].temperature.water, 10);
+ return parseFloat(items[j].temperature.water, 10) < parseFloat(items[iSmaller].temperature.water, 10);
}
function cmpWtempDes(j, iSmaller)
{
- return parseInt(items[j].temperature.water, 10) > parseInt(items[iSmaller].temperature.water, 10);
+ return parseFloat(items[j].temperature.water, 10) > parseFloat(items[iSmaller].temperature.water, 10);
}
function sort_it(sortOn, function_)
@@ -491,7 +499,7 @@ Set.prototype.intersect = function(another_set)
}
var result = new Array();
for (var i = 0; i < another_set.keys.length; i++) {
- if(this.contains(another_set.keys[i])) {
+ if (this.contains(another_set.keys[i])) {
result.push(another_set.keys[i]);
}
};
@@ -658,13 +666,11 @@ function toggleStats()
var stats_button = document.getElementById('stats_button');
if (statsShows) {
statsShows = false;
- stats_button.style.backgroundColor = "#dfdfdf";
- document.getElementById('diveListPanel').style.display='block';
- document.getElementById('diveStat').style.display='none';
+ document.getElementById('diveListPanel').style.display = 'block';
+ document.getElementById('diveStat').style.display = 'none';
} else {
- document.getElementById('diveListPanel').style.display='none';
- document.getElementById('diveStat').style.display='block';
- stats_button.style.backgroundColor = "#5f7f8f";
+ document.getElementById('diveListPanel').style.display = 'none';
+ document.getElementById('diveStat').style.display = 'block';
statsShows = true;
showStats();
}
@@ -676,28 +682,48 @@ function showStats()
document.getElementById('diveStatsData').innerHTML += getDiveStats();
}
-function getDiveStats(){
+function getDiveStats()
+{
var res = "";
res += '<table><tr id="stats_header">';
- res += '<td class="statscell">Year</td><td class="statscell">#</td><td class="statscell">Total Time</td><td class="statscell">Avarage Time</td><td class="statscell">Shortest Time</td><td class="statscell">Longest Time</td><td class="statscell">Avarage Depth</td><td class="statscell">Min Depth</td><td class="statscell">Max Depth</td><td class="statscell">Average SAC</td><td class="statscell">Min SAC</td><td class="statscell">Max SAC</td><td class="statscell">Average Temp</td><td class="statscell">Min Temp</td><td class="statscell">Max Temp</td>';
+ res += '<td class="statscell">' + translate.Year + '</td><td class="statscell">#</td><td class="statscell">' + translate.Total_Time + '</td><td class="statscell">' + translate.Average_Time + '</td><td class="statscell">' + translate.Shortest_Time + '</td><td class="statscell">' + translate.Longest_Time + '</td><td class="statscell">' + translate.Average_Depth + '</td><td class="statscell">' + translate.Min_Depth + '</td><td class="statscell">' + translate.Max_Depth + '</td><td class="statscell">' + translate.Average_SAC + '</td><td class="statscell">' + translate.Min_SAC + '</td><td class="statscell">' + translate.Max_SAC + '</td><td class="statscell">' + translate.Average_Temp + '</td><td class="statscell">' + translate.Min_Temp + '</td><td class="statscell">' + translate.Max_Temp + '</td>';
res += '</tr>';
res += getStatsRows();
res += '</table>';
return res;
}
-function getStatsRows(){
+function getStatsRows()
+{
var res = "";
- for(var i = 0; i < divestat.length ; i++) {
- res += '<tr><td class="statscell">'+divestat[i].YEAR+'</td><td class="statscell">'+divestat[i].DIVES+'</td><td class="statscell">'+divestat[i].TOTAL_TIME+'</td><td class="statscell">'+divestat[i].AVERAGE_TIME+'</td><td class="statscell">'+divestat[i].SHORTEST_TIME+'</td><td class="statscell">'+divestat[i].LONGEST_TIME+'</td><td class="statscell">'+divestat[i].AVG_DEPTH+'</td><td class="statscell">'+divestat[i].MIN_DEPTH+'</td><td class="statscell">'+divestat[i].MAX_DEPTH+'</td><td class="statscell">'+divestat[i].AVG_SAC+'</td><td class="statscell">'+divestat[i].MIN_SAC+'</td><td class="statscell">'+divestat[i].MAX_SAC+'</td><td class="statscell">'+divestat[i].AVG_TEMP+'</td><td class="statscell">'+divestat[i].MIN_TEMP+'</td><td class="statscell">'+divestat[i].MAX_TEMP+'</td></tr>';
+ for (var i = 0; i < divestat.length; i++) {
+ res += '<tr onmouseout="stats_row_unhighlight(this)" onmouseover="stats_row_highlight(this)" class="stats_row"><td class="statscell">' + divestat[i].YEAR + '</td><td class="statscell">' + divestat[i].DIVES + '</td><td class="statscell">' + divestat[i].TOTAL_TIME + '</td><td class="statscell">' + divestat[i].AVERAGE_TIME + '</td><td class="statscell">' + divestat[i].SHORTEST_TIME + '</td><td class="statscell">' + divestat[i].LONGEST_TIME + '</td><td class="statscell">' + divestat[i].AVG_DEPTH + '</td><td class="statscell">' + divestat[i].MIN_DEPTH + '</td><td class="statscell">' + divestat[i].MAX_DEPTH + '</td><td class="statscell">' + divestat[i].AVG_SAC + '</td><td class="statscell">' + divestat[i].MIN_SAC + '</td><td class="statscell">' + divestat[i].MAX_SAC + '</td><td class="statscell">' + divestat[i].AVG_TEMP + '</td><td class="statscell">' + divestat[i].MIN_TEMP + '</td><td class="statscell">' + divestat[i].MAX_TEMP + '</td></tr>';
}
return res;
}
+function stats_row_highlight(row)
+{
+ row.style.backgroundColor = "rgba(125,125,125,0.7)";
+}
+
+function stats_row_unhighlight(row)
+{
+ row.style.backgroundColor = "rgba(125,125,125,0.3)";
+}
+
//trips
var tripsShown;
+var HEADER_COLOR;
+var BACKGROUND_COLOR;
+function getDefaultColor(){
+ var header = document.getElementById('header');
+ var button = document.getElementById('no_dives_selector');
+ HEADER_COLOR = document.defaultView.getComputedStyle(header).getPropertyValue('background-color');
+ BACKGROUND_COLOR = document.defaultView.getComputedStyle(button).getPropertyValue('background-color');
+}
/**
*This is the main function called to show/hide trips
@@ -707,11 +733,11 @@ function toggleTrips()
var trip_button = document.getElementById('trip_button');
if (tripsShown) {
tripsShown = false;
- trip_button.style.backgroundColor = "#dfdfdf";
+ trip_button.style.backgroundColor = BACKGROUND_COLOR;
viewInPage();
} else {
showtrips();
- trip_button.style.backgroundColor = "#5f7f8f";
+ trip_button.style.backgroundColor = HEADER_COLOR;
tripsShown = true;
}
}
@@ -796,8 +822,11 @@ function get_weight_HTML(weight)
*/
function get_weights_HTML(dive)
{
+ if (!dive.Weights.length)
+ return "";
+
var result = "";
- result += '<table><tr><td class="words">Weight</td><td class="words">Type</td></tr>';
+ result += '<table><tr><td class="words">' + translate.Weight + '</td><td class="words">' + translate.Type + '</td></tr>';
for (var i in dive.Weights) {
result += get_weight_HTML(dive.Weights[i]);
}
@@ -814,12 +843,12 @@ function get_cylinder_HTML(cylinder)
var cEPressure = cylinder.EPressure;
if (cSPressure === "--") {
- cSPressure = mbar_to_bar(items[dive_id].samples[0][2]) + " bar";
+ cSPressure = Math.round(mbar_to_bar(items[dive_id].samples[0][2])).toFixed(1) + " bar";
}
if (cEPressure === "--") {
var nonZeroCEPressure = lastNonZero();
- cEPressure = mbar_to_bar(nonZeroCEPressure) + " bar";
+ cEPressure = Math.round(mbar_to_bar(nonZeroCEPressure)).toFixed(1) + " bar";
}
return '<tr><td class="Cyl">' + cylinder.Type + '</td><td class="Cyl">' + cylinder.Size + '</td><td class="Cyl">' + cylinder.WPressure + '</td>' + '<td class="Cyl">' + cSPressure + '</td><td class="Cyl">' + cEPressure + '</td><td class="Cyl">' + cylinder.O2 + '</td></tr>';
@@ -830,8 +859,11 @@ function get_cylinder_HTML(cylinder)
*/
function get_cylinders_HTML(dive)
{
+ if (!dive.Cylinders.length)
+ return "";
+
var result = "";
- result += '<h2 class="det_hed">Dive equipments</h2><table><tr><td class="words">Type</td><td class="words">Size</td><td class="words">Work Pressure</td><td class="words">Start Pressure</td><td class="words">End Pressure</td><td class="words">O2</td></tr>';
+ result += '<h2 class="det_hed">' + translate.Dive_equipments + '</h2><table><tr><td class="words">' + translate.Type + '</td><td class="words">' + translate.Size + '</td><td class="words">' + translate.Work_Pressure + '</td><td class="words">' + translate.Start_Pressure + '</td><td class="words">' + translate.End_Pressure + '</td><td class="words">'+translate.Gas+'</td></tr>';
for (var i in dive.Cylinders) {
result += get_cylinder_HTML(dive.Cylinders[i]);
}
@@ -868,7 +900,7 @@ function get_bookmarks_HTML(dive)
if (dive.events <= 0)
return "";
var result = "";
- result += '<h2 class="det_hed">Events</h2><table><tr><td class="words">Name</td><td class="words">Time</td><td class="words">Value</td></tr>';
+ result += '<h2 class="det_hed">' + translate.Events + '</h2><table><tr><td class="words">' + translate.Name + '</td><td class="words">' + translate.Time + '</td><td class="words">' + translate.Value + '</td></tr>';
for (var i in dive.events) {
result += get_bookmark_HTML(dive.events[i]);
}
@@ -876,25 +908,41 @@ function get_bookmarks_HTML(dive)
return result;
}
+function getDiveCoorString(coordinates){
+ res = "";
+ lat = coordinates.lat;
+ lon = coordinates.lon;
+ res += float_to_deg(lat) + ' , ' + float_to_deg(lon);
+ return res;
+}
+
+function getDiveCoor(dive)
+{
+ if (!dive.coordinates)
+ return "";
+ return '<td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + translate.Coordinates + ': </td><td>' + '<a href="http://www.google.com/maps/@' + dive.coordinates.lat + ',' + dive.coordinates.lon + ',13z" target="_blank">' + getDiveCoorString(dive.coordinates) + '</a></td>';
+}
+
/**
*Return HTML main data of a dive
*/
function get_dive_HTML(dive)
{
- return '<h2 class="det_hed">Dive Information</h2><table><tr><td class="words">Date: </td><td>' + dive.date +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time: </td><td>' + dive.time +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Location: </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, divemaster:false, buddy:false, notes:false, tags:false,})\">' +
- dive.location + '</a>' +
- '</td></tr></table><table><tr><td class="words">Rating:</td><td>' + putRating(dive.rating) +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;Visibilty:</td><td>' + putRating(dive.visibility) +
- '</td></tr></table>' +
- '<table><tr><td class="words">Air temp: </td><td>' + dive.temperature.air +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;Water temp: </td><td>' + dive.temperature.water +
- '</td></tr></table><table><tr><td class="words">DiveMaster: </td><td>' + dive.divemaster +
- '</td></tr><tr><td class="words"><p>Buddy: </p></td><td>' + dive.buddy +
- '</td></tr><tr><td class="words">Suit: </td><td>' + dive.suit +
- '</td></tr><tr><td class="words">Tags: </td><td>' + putTags(dive.tags) +
- '</td></tr></table><div style="margin:10px;"><p class="words">Notes: </p>' + dive.notes + '</div>';
+ var res = '<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 +
+ '</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.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 +
+ '</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><div style="margin:10px;"><p class="words">' + translate.Notes + ': </p>' + dive.notes + '</div>';
+ return res;
};
/**
@@ -902,10 +950,9 @@ function get_dive_HTML(dive)
*/
function get_status_HTML(dive)
{
- return '<h2 class="det_hed">Dive Status</h2><table><tr><td class="words">Sac: </td><td>' + ml_to_litre(dive.sac) +
- ' l/min' + '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Otu: </td><td>' + dive.otu +
- '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cns: </td><td>' + dive.cns +
- '</td></tr></table>';
+ return '<h2 class="det_hed">' + translate.Dive_Status + '</h2><table><tr><td class="words">SAC: </td><td>' + ml_to_litre(dive.sac) +
+ ' l/min' + '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OTU: </td><td>' + dive.otu +
+ '</td><td class="words">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CNS: </td><td>' + dive.cns + '</td></tr></table>';
};
function get_dive_photos(dive)
@@ -917,8 +964,8 @@ function get_dive_photos(dive)
var slider = "";
document.getElementById("divephotos").style.display = 'block';
for (var i = 0; i < dive.photos.length; i++) {
- slider += '<img src="'+location.pathname +
- '_files/photos/'+dive.photos[i].filename+'" alt="" height="240" width="240">';
+ slider += '<img src="' + location.pathname +
+ '_files/photos/' + dive.photos[i].filename + '" alt="" height="240" width="240">';
}
return slider;
}
@@ -962,7 +1009,7 @@ function mm_to_meter(mm)
function gram_to_km(gram)
{
- return gram / 1000;
+ return (gram / 1000).toFixed(1);
}
function ml_to_litre(ml)
@@ -980,6 +1027,14 @@ function int_to_time(n)
return Math.floor((n) / 60) + ":" + format_two_digit((n) % (60)) + " min";
}
+function float_to_deg(flt){
+ var deg = 0 | flt;
+ flt = (flt < 0 ? flt =- flt : flt);
+ var min = 0 | flt % 1 * 60;
+ var sec = (0 | flt * 60 % 1 * 6000) / 100;
+ return deg + "&deg; " + min + "' " + sec + "\"";
+}
+
/**
*Main canvas draw function
*this calls the axis and grid initialization functions.
@@ -1024,8 +1079,7 @@ function canvas_draw()
0
]);
}
- if (plot1)
- {
+ if (plot1) {
$('chart1').unbind();
plot1.destroy();
}
@@ -1047,7 +1101,7 @@ function canvas_draw()
if(seriesIndex===2)
return items[dive_id].events[pointIndex].name;
else
- return str;
+ return str.replace(",", " : ");
}
},
seriesDefaults : {
@@ -1090,7 +1144,7 @@ function canvas_draw()
tickRenderer : $.jqplot.CanvasAxisTickRenderer,
tickOptions : {
showGridline : false,
- formatString : '%i'
+ formatString : '%imin'
},
label:'Time (min)'
},
@@ -1152,11 +1206,12 @@ function showDiveDetails(dive)
document.getElementById("diveListPanel").style.display = 'none';
document.getElementById("divePanel").style.display = 'block';
canvas_draw();
+ scrollToTheTop();
}
function setDiveTitle(dive)
{
- document.getElementById("dive_no").innerHTML = "Dive No. " + (settings.subsurfaceNumbers === '0' ?
+ document.getElementById("dive_no").innerHTML = translate.Dive_No + (settings.subsurfaceNumbers === '0' ?
dive.number + 1 : dive.subsurface_number);
document.getElementById("dive_location").innerHTML = dive.location;
}
@@ -1167,7 +1222,6 @@ function setDiveTitle(dive)
*/
function unshowDiveDetails(dive)
{
- start = dive_id;
viewInPage();
plot1 = null;
document.getElementById("diveListPanel").style.display = 'block';
@@ -1204,7 +1258,33 @@ function switchDives(e)
}
}
-window.onresize = function(event) {
- if (plot1)
- plot1.replot( { resetAxes: true } );
+function scrollToTheTop()
+{
+ window.scrollTo(0, 0);
+}
+
+window.onresize = function(event)
+{
+ if (plot1)
+ plot1.replot({
+ resetAxes : false
+ });
};
+
+function translate_page()
+{
+ document.getElementById("number_header").innerHTML = translate.Number;
+ document.getElementById("date_header").innerHTML = translate.Date;
+ document.getElementById("time_header").innerHTML = translate.Time;
+ document.getElementById("location_header").innerHTML = translate.Location;
+ document.getElementById("air_temp_header").innerHTML = translate.Air_Temp;
+ document.getElementById("water_temp_header").innerHTML = translate.Water_Temp;
+ document.getElementById("adv_srch_sp").innerHTML = translate.Advanced_Search;
+ document.getElementById("expnd_all_btn").innerHTML = translate.Expand_All;
+ document.getElementById("claps_all_btn").innerHTML = translate.Collapse_All;
+ document.getElementById("trip_button").innerHTML = translate.trips;
+ document.getElementById("stats_button").innerHTML = translate.Statistics;
+ document.getElementById("div_profil_lbl").innerHTML = translate.Dive_profile;
+ document.getElementById("bk_to_ls_lbl").innerHTML = translate.Back_to_List;
+ document.getElementById("bk_to_ls_lbl2").innerHTML = translate.Back_to_List;
+}
diff --git a/theme/sand.css b/theme/sand.css
index befa861b7..b2f35bbb1 100644
--- a/theme/sand.css
+++ b/theme/sand.css
@@ -147,7 +147,7 @@ input[type=checkbox]{
width:90%;
margin:0% 5% 0% 5%;
margin-bottom:50px;
- background-color: rgba(88,121,139,0.3);
+ background-color: rgba(253, 195, 141,0.3);
box-shadow: 10px 10px 5px #888888;
}
@@ -156,9 +156,18 @@ input[type=checkbox]{
overflow-y:hidden;
}
.statscell{
- border-style:solid;
- padding-right:100px;
+ min-width:120px;
+ height: 25px;
margin:0px;
+ text-align:center;
+}
+
+.stats_row{
+ background-color:rgba(125,125,125,0.3);
+}
+
+#stats_header{
+ background-color:#EFC15F;
}
button,#no_dives_selector{