Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| Rivi 30: | Rivi 30: | ||
jw.obstype = {}; | jw.obstype = {}; | ||
jw.obstypeorder = []; | |||
for ( var oi in jw.obsList ) { | for ( var oi in jw.obsList ) { | ||
var o = jw.obsList[oi]; | var o = jw.obsList[oi]; | ||
if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { newest: jw.obs[o].obsdatetime, sum: 0, count: 0, mean: -1, catsum: 0, catcount: 0, catmean: -1, obses: [] }; } | if ( typeof jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] == 'undefined' ) { | ||
jw.obstype[ jw.obs[o].printouts.ObsCode[0] ] = { newest: jw.obs[o].obsdatetime, sum: 0, count: 0, mean: -1, catsum: 0, catcount: 0, catmean: -1, obses: [] }; | |||
jwobstypeorder.push( jw.obs[o].printouts.ObsCode[0] ); | |||
} | |||
jw.obstype[ jw.obs[o].printouts.ObsCode[0] ].obses.push( o ); | jw.obstype[ jw.obs[o].printouts.ObsCode[0] ].obses.push( o ); | ||
} | } | ||
| Rivi 82: | Rivi 86: | ||
out = ''; | out = ''; | ||
//out += '<h2 class="h4">Havaintotilanne</h2>'; | //out += '<h2 class="h4">Havaintotilanne</h2>'; | ||
if ( jw.obstypesorder.length > 0 ) { | |||
out += '<div class="row">'; | out += '<div class="row">'; | ||
| Rivi 89: | Rivi 96: | ||
out += '<div style="height: 40px; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | out += '<div style="height: 40px; display: flex; justify-content: center; align-items: center; flex-direction: column;">'; | ||
out += '<button style="padding: 0 0.25em; font-size: 13px; margin-bottom: 3px;" type="button" class="btn btn-secondary btn-info" data-toggle="tooltip" data-placement="top" data-trigger="click" title="' + 'Pintaveden lämpötila on havainnon tuoreudella painotettu keskiarvo viimeisen 7 vuorokauden aikana järvelle tallennetuista havainnoista. Näitä havaintoja on yhteensä ' + jw.obstype[ 'temp' ].obses.length + ' kpl, joista uusin on tehty ' + jw.obstype[ 'temp' ].newest.toLocaleString( 'fi' ) + '">'; | out += '<button style="padding: 0 0.25em; font-size: 13px; margin-bottom: 3px;" type="button" class="btn btn-secondary btn-info" data-toggle="tooltip" data-placement="top" data-trigger="click" title="' + 'Pintaveden lämpötila on havainnon tuoreudella painotettu keskiarvo viimeisen 7 vuorokauden aikana järvelle tallennetuista havainnoista. Näitä havaintoja on yhteensä ' + jw.obstype[ 'temp' ].obses.length + ' kpl, joista uusin on tehty ' + jw.obstype[ 'temp' ].newest.toLocaleString( 'fi' ) + '">'; | ||
out += jw.obstype[ 'temp' ].newest.inRelationToToday(); | out += jw.obstype[ 'temp' ].newest.inRelationToToday(); | ||
out += '</button>'; | out += '</button>'; | ||
out += '</div>'; | out += '</div>'; | ||
| Rivi 163: | Rivi 172: | ||
out += '</div>'; | out += '</div>'; | ||
} | |||
jQuery( '#sub-content-header-container' ).append( out ); | jQuery( '#sub-content-header-container' ).append( out ); | ||


