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:
Gehad elrobey 2014-06-27 22:31:03 +02:00 committed by Dirk Hohndel
parent 023187a73e
commit a110b2858d

View file

@ -666,15 +666,7 @@ function rgb(r, g, b)
r = Math.floor(r * 255); r = Math.floor(r * 255);
g = Math.floor(g * 255); g = Math.floor(g * 255);
b = Math.floor(b * 255); b = Math.floor(b * 255);
return[ return["rgb(", r, ",", g, ",", b, ")"].join("");
"rgb(",
r,
",",
g,
",",
b,
")"
].join("");
} }
/** /**
@ -876,12 +868,14 @@ function mkelvin_to_C(mkelvin)
return (mkelvin - ZERO_C_IN_MKELVIN) / 1000.0; return (mkelvin - ZERO_C_IN_MKELVIN) / 1000.0;
} }
function mbar_to_bar(mbar){ function mbar_to_bar(mbar)
return mbar/1000; {
return mbar / 1000;
} }
function mm_to_meter(mm){ function mm_to_meter(mm)
return mm/(1000); {
return mm / (1000);
} }
var plot1; var plot1;
@ -890,63 +884,83 @@ var plot1;
*Main canvas draw function *Main canvas draw function
*this calls the axis and grid initialization functions. *this calls the axis and grid initialization functions.
*/ */
function canvas_draw(){ function canvas_draw()
document.getElementById("chart1").innerHTML=""; {
document.getElementById("chart1").innerHTML = "";
var d1 = new Array(); var d1 = new Array();
var d2 = new Array(); var d2 = new Array();
for (var i =0; i< items[dive_id].samples.length;i++){ 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([
if (items[dive_id].samples[i][2]!=0) { items[dive_id].samples[i][0] / 60,
d2.push([items[dive_id].samples[i][0]/60,mbar_to_bar(items[dive_id].samples[i][2])]); -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])
]);
} }
} }
plot1 = $.jqplot('chart1', [d1,d2], { plot1 = $.jqplot('chart1', [
grid: { d1,
drawBorder: true, d2
shadow: false, ],
background: 'rgba(0,0,0,0)' {
grid : {
drawBorder : true,
shadow : false,
background : 'rgba(0,0,0,0)'
}, },
highlighter: { show: true }, highlighter : {
seriesDefaults: { show : true
shadowAlpha: 0.1,
shadowDepth: 2,
fillToZero: true
}, },
series: [{ seriesDefaults : {
color: 'rgba(35,58,58,.6)', shadowAlpha : 0.1,
negativeColor: 'rgba(35,58,58,.6)', shadowDepth : 2,
showMarker: true, fillToZero : true
showLine: true,
fill: true,
yaxis:'yaxis',
},{
color: 'rgba(44, 190, 160, 0.7)',
showMarker: false,
rendererOptions: {
smooth: true,
}, },
yaxis:'y2axis', series :[
},], {
axes: { color : 'rgba(35,58,58,.6)',
xaxis: { negativeColor : 'rgba(35,58,58,.6)',
pad: 1.0, showMarker : true,
tickRenderer: $.jqplot.CanvasAxisTickRenderer , showLine : true,
tickOptions: { fill : true,
showGridline: false, yaxis : 'yaxis',
formatString:'%i min', },
angle: -30 {
color : 'rgba(44, 190, 160, 0.7)',
showMarker : false,
rendererOptions : {
smooth : true,
},
yaxis : 'y2axis',
},
],
axes : {
xaxis : {
pad : 1.0,
tickRenderer : $.jqplot.CanvasAxisTickRenderer,
tickOptions : {
showGridline : false,
formatString : '%i min',
angle : -30
} }
}, },
yaxis: { yaxis : {
max: 0, max : 0,
tickRenderer: $.jqplot.CanvasAxisTickRenderer , tickRenderer : $.jqplot.CanvasAxisTickRenderer,
tickOptions:{ formatString:'%.2f'}, tickOptions : {
pad: 2.05 formatString : '%.2f'
}, },
y2axis: { pad : 2.05
tickRenderer: $.jqplot.CanvasAxisTickRenderer , },
tickOptions:{ formatString:'%ibar'}, y2axis : {
pad: 3.05 tickRenderer : $.jqplot.CanvasAxisTickRenderer,
tickOptions : {
formatString : '%ibar'
},
pad : 3.05
}, },
} }
}); });
@ -970,7 +984,7 @@ function showDiveDetails(dive)
//draw the canvas and initialize the view //draw the canvas and initialize the view
document.getElementById("diveinfo").innerHTML = get_dive_HTML(items[dive_id]); document.getElementById("diveinfo").innerHTML = get_dive_HTML(items[dive_id]);
document.getElementById("dive_equipments").innerHTML = get_cylinders_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]); document.getElementById("bookmarks").innerHTML = get_bookmarks_HTML(items[dive_id]);
setDiveTitle(items[dive_id]); setDiveTitle(items[dive_id]);
//hide the list of dives and show the canvas. //hide the list of dives and show the canvas.
@ -979,10 +993,11 @@ function showDiveDetails(dive)
canvas_draw(); canvas_draw();
} }
function setDiveTitle(dive){ function setDiveTitle(dive)
document.getElementById("dive_no").innerHTML="Dive No. "+(settings.subsurfaceNumbers === '0'? {
document.getElementById("dive_no").innerHTML="Dive No. " + (settings.subsurfaceNumbers === '0'?
dive.number : dive.subsurface_number); dive.number : dive.subsurface_number);
document.getElementById("dive_location").innerHTML=dive.location; document.getElementById("dive_location").innerHTML = dive.location;
} }
/** /**