Ero sivun ”Widget:JwCurrentCharts” versioiden välillä
Järvi-meriwikistä
Rivi 613: | Rivi 613: | ||
iavg = ( icatsum/icatcount ); | iavg = ( icatsum/icatcount ); | ||
− | console.log( iavg ); | + | //console.log( iavg ); |
if ( iavg > 0.7 && ivc > 0 ) { | if ( iavg > 0.7 && ivc > 0 ) { | ||
ivalavg = Math.round( ivalsum/ivalcount ); | ivalavg = Math.round( ivalsum/ivalcount ); | ||
− | console.log( ivalavg ); | + | //console.log( ivalavg ); |
− | console.log( ivalmin + '-' + ivalmax + ' cm' ); | + | //console.log( ivalmin + '-' + ivalmax + ' cm' ); |
+ | |||
+ | if ( ivalmax > ivalmin ) { | ||
+ | istr = ivalmin + '-' + ivalmax + ' cm'; | ||
+ | } else { | ||
+ | istr = ivalmin + ' cm'; | ||
+ | } | ||
+ | |||
+ | if ( ivc == 1 ) { | ||
+ | istr += '<br /><span>(' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | ||
+ | } else { | ||
+ | istr += '<br /><span class="smaller">('; | ||
+ | istr += '<button style="margin-left: -1px; padding: 0; font-size: 13px; margin-bottom: 3px; color: #59B500;" type="button" class="btn Xbtn-secondary Xbtn-info" data-toggle="tooltip" data-placement="top" title="" data-original-title="Perustuu yhteensä ' + icount + ' havaintoon ajanjaksolla: ' + memo.obsesA[ memo.obsesA.length-1 ].obsdatetime.toLocaleDateString() + '-' + memo.obsesA[0].obsdatetime.toLocaleDateString() + '."><span class="fontawesome"></span></button>'; | ||
+ | istr += ' ↦' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | ||
+ | } | ||
+ | |||
− | } | + | } else { |
− | + | if ( iavg < 0.25 || memo.obsesA[0].data.cat == '5' ) { istr = 'Ei jäätä'; } | |
− | + | else if ( iavg < 0.75 ) { istr = 'Osittain jäässä'; } | |
− | + | else { istr = 'Yhtenäinen jääpeite'; } | |
− | + | if ( icount == 1 ) { | |
− | + | istr += '<br /><span>(' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | |
− | + | } else { | |
− | + | //tstr += '<br /><span>(' + tc.toString() + ' havaintoa)</span>'; | |
− | + | //tstr += ' <span class="smaller">(n=' + tc.toString() + ')</span><br /><span>(viimeisin ' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | |
− | + | istr += '<br /><span class="smaller">('; | |
− | + | istr += '<button style="margin-left: -1px; padding: 0; font-size: 13px; margin-bottom: 3px; color: #59B500;" type="button" class="btn Xbtn-secondary Xbtn-info" data-toggle="tooltip" data-placement="top" title="" data-original-title="Perustuu yhteensä ' + icount + ' havaintoon ajanjaksolla: ' + memo.obsesA[ memo.obsesA.length-1 ].obsdatetime.toLocaleDateString() + '-' + memo.obsesA[0].obsdatetime.toLocaleDateString() + '."><span class="fontawesome"></span></button>'; | |
− | + | istr += ' ↦' + memo.obsesA[0].obsdatetime.inRelationToToday(memo.lang).toLowerCase() + ')</span>'; | |
+ | } | ||
} | } | ||
} else { | } else { |