Ei muokkausyhteenvetoa Merkkaus: Muokkaamalla palautettu |
Ei muokkausyhteenvetoa |
||
| Rivi 99: | Rivi 99: | ||
memo.divide = '-'; | memo.divide = '-'; | ||
}; | }; | ||
if ( typeof jQuery( this ).attr( 'data-jw-divide-if-obses' ) != 'undefined' ) { | if ( typeof jQuery( this ).attr( 'data-jw-divide-if-obses' ) != 'undefined' ) { | ||
memo.divideCond = parseInt( jQuery( this ).attr( 'data-jw-divide-if-obses' ) ); | memo.divideCond = parseInt( jQuery( this ).attr( 'data-jw-divide-if-obses' ) ); | ||
} else { | } else { | ||
memo.divideCond = | memo.divideCond = 20; | ||
}; | }; | ||
| Rivi 122: | Rivi 122: | ||
memo.startDate = '1800-01-01'; | memo.startDate = '1800-01-01'; | ||
} | } | ||
memo.service = jQuery( this ).attr( 'data-coo311-service_code' ); | memo.service = jQuery( this ).attr( 'data-coo311-service_code' ); | ||
| Rivi 163: | Rivi 162: | ||
// add fullscreen button | // add fullscreen button | ||
memo.headerEl.append( '<div class="obschartbutton fullscreen-button" style="display: none; margin-left: 10px; float: right; | memo.headerEl.append( '<div class="obschartbutton fullscreen-button" style="display: none; margin-left: 10px; float: right; font-size: 18.72px;"><button title="' + i18n['fullscreen'][memo.lang] + '" style=""><i class="fas fa-expand"></i></button></div>' ); | ||
memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | memo.fullscreenEl = jQuery( this ).find( '.fullscreen-button' ); | ||
| Rivi 204: | Rivi 203: | ||
// add edit button | // add edit button | ||
if ( memo.editUrl != '-' ) { | if ( memo.editUrl != '-' ) { | ||
memo.headerEl.append( '<div class="obschartbutton edit-button" style=" | memo.headerEl.append( '<div class="obschartbutton edit-button" style="display: none; margin-left: 10px; float: right; font-size: 18.72px;"><button title="' + i18n['edit'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none;"><i class="fas fa-edit"></i></button></div>' ); | ||
memo.editEl = jQuery( this ).find( '.edit-button' ); | memo.editEl = jQuery( this ).find( '.edit-button' ); | ||
memo.editEl.on( 'click', function() { window.location.href = memo.editUrl; }); | memo.editEl.on( 'click', function() { window.location.href = memo.editUrl; }); | ||
| Rivi 211: | Rivi 210: | ||
// add download data button | // add download data button | ||
if ( memo.download ) { | if ( memo.download ) { | ||
memo.headerEl.append( '<div class="obschartbutton download-button" style="display: none; margin-left: 10px; float: right; | memo.headerEl.append( '<div class="obschartbutton download-button" style="display: none; margin-left: 10px; float: right; font-size: 18.72px;"><button title="' + i18n['download'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; color: #1B599B; background: none; border: none;"><i class="fas fa-download"></i></button></div>' ); | ||
memo.downloadEl = jQuery( this ).find( '.download-button' ); | memo.downloadEl = jQuery( this ).find( '.download-button' ); | ||
| Rivi 352: | Rivi 351: | ||
// add show site link button | // add show site link button | ||
if ( memo.showlink ) { | if ( memo.showlink ) { | ||
memo.headerEl.append( '<div class="obschartbutton sitelink-button" style="display: none; margin-left: 10px; float: right; | memo.headerEl.append( '<div class="obschartbutton sitelink-button" style="display: none; margin-left: 10px; float: right; font-size:18.72px;"><button title="' + i18n['sitelink'][memo.lang] + '" style="width: 24px; height: 24px; padding: 0; margin: 0; background: none; border: none; "><i class="fas fa-map-marked"></i></button></div>' ); | ||
memo.sitelinkEl = jQuery( this ).find( '.sitelink-button' ); | memo.sitelinkEl = jQuery( this ).find( '.sitelink-button' ); | ||
memo.sitelinkEl.on( 'click', function() { | memo.sitelinkEl.on( 'click', function() { | ||
| Rivi 668: | Rivi 667: | ||
for ( var dv in memo.depthsO[ di ].values ) { | for ( var dv in memo.depthsO[ di ].values ) { | ||
memo.depthsO[ di ]['valstrings'].push( memo.depthsO[ di ].values[ dv ].toString().replace( '.', ',' ) ); | memo.depthsO[ di ]['valstrings'].push( memo.depthsO[ di ].values[ dv ].toString().replace( '.', ',' ) ); | ||
} | } | ||
| Rivi 690: | Rivi 688: | ||
} else if ( depthcats[0] == 'bottom' ) { | } else if ( depthcats[0] == 'bottom' ) { | ||
memo.title = memo.title.replace( '–', '(' + i18n[ 'bottom' ][ memo.lang ] + ') –' ); | memo.title = memo.title.replace( '–', '(' + i18n[ 'bottom' ][ memo.lang ] + ') –' ); | ||
} | } | ||
} else if ( depthcats.length == 2 ) { | } else if ( depthcats.length == 2 ) { | ||
| Rivi 747: | Rivi 745: | ||
} | } | ||
if ( memo.info == '' | if ( memo.info == '' ) { | ||
if ( memo.siteid != '-' ) { | |||
memo.info += i18n[ 'siteinfostring' ][ memo.lang] + ': ' + memo.jw.site[ memo.siteid ].name; | |||
} | |||
if ( depthcats.length == 1 ) { | |||
if ( memo.depthsO[ depthcats[0] ].valstring != '' ) { | |||
if ( memo.info != '' ) { memo.info += "<br />"; } | |||
memo.info += i18n[ 'depthinfostring' ][ memo.lang] + ': ' + memo.depthsO[ depthcats[0] ].valstring; | |||
} | |||
} | } | ||
} | } | ||
if ( memo.info != '' ) { | if ( memo.info != '' ) { | ||
memo.titleEl.append( ' <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" title="' + memo.info + '"><span class="fontawesome"></span></button>' ); | memo.titleEl.append( ' <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-html="true" title="' + memo.info + '"><span class="fontawesome"></span></button>' ); | ||
jQuery( '[data-toggle="tooltip"]' ).tooltip(); | jQuery( '[data-toggle="tooltip"]' ).tooltip(); | ||
} | } | ||
| Rivi 1 226: | Rivi 1 231: | ||
} | } | ||
for ( var t in memo.options.trendlines ) { | |||
if ( memo.trendType == 'linear' ) { | |||
memo.options.trendlines[ t ].type = 'linear'; | |||
} else if ( memo.trendType = 'poly2deg' ) { | |||
memo.options.trendlines[ t ].type = 'polynomial'; | |||
memo.options.trendlines[ t ].degree = 2; | |||
} else if ( memo.trendType = 'poly3deg' ) { | |||
memo.options.trendlines[ t ].type = 'polynomial'; | |||
memo.options.trendlines[ t ].degree = 3; | |||
} else if ( memo.trendType == 'smart' ) { | |||
if ( ( memo.axisMaxDate.getFullYear() - memo.axisMinDate.getFullYear() > 10 ) && memo.obsesTotal > 20 ) { | if ( ( memo.axisMaxDate.getFullYear() - memo.axisMinDate.getFullYear() > 10 ) && memo.obsesTotal > 20 ) { | ||
memo.options.trendlines[ t ].type = 'polynomial'; | memo.options.trendlines[ t ].type = 'polynomial'; | ||
| Rivi 1 237: | Rivi 1 248: | ||
} | } | ||
} | } | ||
} | } | ||
} | } | ||
| Rivi 1 838: | Rivi 1 849: | ||
s2 = memo.data.Wf[ o ].c[ 6 ]; | s2 = memo.data.Wf[ o ].c[ 6 ]; | ||
} | } | ||
memo.chart.draw( memo.data, memo.options ); | memo.chart.draw( memo.data, memo.options ); | ||
| Rivi 1 913: | Rivi 1 923: | ||
'surface': { 'fi': 'pinta', 'en': 'surface', 'sv': 'ytan' }, | 'surface': { 'fi': 'pinta', 'en': 'surface', 'sv': 'ytan' }, | ||
'bottom': { 'fi': 'pohja', 'en': 'bottom', 'sv': 'bottnet' }, | 'bottom': { 'fi': 'pohja', 'en': 'bottom', 'sv': 'bottnet' }, | ||
'depthinfostring': { 'fi': 'Havainnot | 'siteinfostring': { 'fi': 'Havaintopaikka', 'en': 'Observation site', 'sv': 'Observationsplatsen' }, | ||
'depthinfostring': { 'fi': 'Havainnot syvyydeltä', 'en': 'Depth of observations', 'sv': 'Djup för observationer' }, | |||
'download': { 'fi': 'Lataa csv-muodossa', 'en': 'Download in csv format', 'sv': 'Ladda ner i csv-format' }, | 'download': { 'fi': 'Lataa csv-muodossa', 'en': 'Download in csv format', 'sv': 'Ladda ner i csv-format' }, | ||
'fullscreen': { 'fi': 'Ota käyttöön/poista kokoruututila', 'en': 'Toggle fullscreen mode', 'sv': 'Växla helskärmsläge' }, | 'fullscreen': { 'fi': 'Ota käyttöön/poista kokoruututila', 'en': 'Toggle fullscreen mode', 'sv': 'Växla helskärmsläge' }, | ||


