mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
HTML: Fix listlib whitespace errors.
Fix some code style and whitespace errors. [Dirk Hohndel: one hunk didn't apply as there was no such code...?] 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>
This commit is contained in:
parent
023187a73e
commit
a110b2858d
1 changed files with 88 additions and 73 deletions
|
@ -666,15 +666,7 @@ function rgb(r, g, b)
|
|||
r = Math.floor(r * 255);
|
||||
g = Math.floor(g * 255);
|
||||
b = Math.floor(b * 255);
|
||||
return[
|
||||
"rgb(",
|
||||
r,
|
||||
",",
|
||||
g,
|
||||
",",
|
||||
b,
|
||||
")"
|
||||
].join("");
|
||||
return["rgb(", r, ",", g, ",", b, ")"].join("");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -876,11 +868,13 @@ function mkelvin_to_C(mkelvin)
|
|||
return (mkelvin - ZERO_C_IN_MKELVIN) / 1000.0;
|
||||
}
|
||||
|
||||
function mbar_to_bar(mbar){
|
||||
function mbar_to_bar(mbar)
|
||||
{
|
||||
return mbar / 1000;
|
||||
}
|
||||
|
||||
function mm_to_meter(mm){
|
||||
function mm_to_meter(mm)
|
||||
{
|
||||
return mm / (1000);
|
||||
}
|
||||
|
||||
|
@ -890,43 +884,59 @@ var plot1;
|
|||
*Main canvas draw function
|
||||
*this calls the axis and grid initialization functions.
|
||||
*/
|
||||
function canvas_draw(){
|
||||
function canvas_draw()
|
||||
{
|
||||
document.getElementById("chart1").innerHTML = "";
|
||||
var d1 = new Array();
|
||||
var d2 = new Array();
|
||||
for (var i = 0; i < items[dive_id].samples.length; i++) {
|
||||
d1.push([items[dive_id].samples[i][0]/60,-1*mm_to_meter(items[dive_id].samples[i][1])]);
|
||||
d1.push([
|
||||
items[dive_id].samples[i][0] / 60,
|
||||
-1 * mm_to_meter(items[dive_id].samples[i][1])
|
||||
]);
|
||||
if (items[dive_id].samples[i][2] != 0) {
|
||||
d2.push([items[dive_id].samples[i][0]/60,mbar_to_bar(items[dive_id].samples[i][2])]);
|
||||
d2.push([
|
||||
items[dive_id].samples[i][0] / 60,
|
||||
mbar_to_bar(items[dive_id].samples[i][2])
|
||||
]);
|
||||
}
|
||||
}
|
||||
plot1 = $.jqplot('chart1', [d1,d2], {
|
||||
plot1 = $.jqplot('chart1', [
|
||||
d1,
|
||||
d2
|
||||
],
|
||||
{
|
||||
grid : {
|
||||
drawBorder : true,
|
||||
shadow : false,
|
||||
background : 'rgba(0,0,0,0)'
|
||||
},
|
||||
highlighter: { show: true },
|
||||
highlighter : {
|
||||
show : true
|
||||
},
|
||||
seriesDefaults : {
|
||||
shadowAlpha : 0.1,
|
||||
shadowDepth : 2,
|
||||
fillToZero : true
|
||||
},
|
||||
series: [{
|
||||
series :[
|
||||
{
|
||||
color : 'rgba(35,58,58,.6)',
|
||||
negativeColor : 'rgba(35,58,58,.6)',
|
||||
showMarker : true,
|
||||
showLine : true,
|
||||
fill : true,
|
||||
yaxis : 'yaxis',
|
||||
},{
|
||||
},
|
||||
{
|
||||
color : 'rgba(44, 190, 160, 0.7)',
|
||||
showMarker : false,
|
||||
rendererOptions : {
|
||||
smooth : true,
|
||||
},
|
||||
yaxis : 'y2axis',
|
||||
},],
|
||||
},
|
||||
],
|
||||
axes : {
|
||||
xaxis : {
|
||||
pad : 1.0,
|
||||
|
@ -940,12 +950,16 @@ function canvas_draw(){
|
|||
yaxis : {
|
||||
max : 0,
|
||||
tickRenderer : $.jqplot.CanvasAxisTickRenderer,
|
||||
tickOptions:{ formatString:'%.2f'},
|
||||
tickOptions : {
|
||||
formatString : '%.2f'
|
||||
},
|
||||
pad : 2.05
|
||||
},
|
||||
y2axis : {
|
||||
tickRenderer : $.jqplot.CanvasAxisTickRenderer,
|
||||
tickOptions:{ formatString:'%ibar'},
|
||||
tickOptions : {
|
||||
formatString : '%ibar'
|
||||
},
|
||||
pad : 3.05
|
||||
},
|
||||
}
|
||||
|
@ -979,7 +993,8 @@ function showDiveDetails(dive)
|
|||
canvas_draw();
|
||||
}
|
||||
|
||||
function setDiveTitle(dive){
|
||||
function setDiveTitle(dive)
|
||||
{
|
||||
document.getElementById("dive_no").innerHTML="Dive No. " + (settings.subsurfaceNumbers === '0'?
|
||||
dive.number : dive.subsurface_number);
|
||||
document.getElementById("dive_location").innerHTML = dive.location;
|
||||
|
|
Loading…
Add table
Reference in a new issue