Ei muokkausyhteenvetoa |
Ei muokkausyhteenvetoa |
||
| (28 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
| Rivi 144: | Rivi 144: | ||
// add chart container | // add chart container | ||
memo.widgetEl.append( '<div class="card JwCard mb-2" style="position: relative; width: 100%; height: 100%;"><div class="card-header" style="min-height: 49px;"></div><div class="card-body p-2" style="position: relative; width: 100%; height: 100%;"><div class="chart-container" style="position: relative; z-index: 110; width: 100%; height: 100%;"></div></div><div class="card-footer"></div>' ); | memo.widgetEl.append( '<div class="card JwCard mb-2" style="position: relative; width: 100%; height: 100%;"><div class="card-header" style="min-height: 49px;"></div><div id="' + memo.id + '_collapsible" class="card-body p-2 collapse" style="position: relative; width: 100%; height: 100%;"><div class="chart-container" style="position: relative; z-index: 110; width: 100%; height: 100%;"></div></div><div class="card-footer"></div>' ); | ||
memo.chartEl = jQuery( this ).find( '.chart-container' ); | memo.chartEl = jQuery( this ).find( '.chart-container' ); | ||
memo.chartEl.css( 'height', memo.height + 'px' ); | memo.chartEl.css( 'height', memo.height + 'px' ); | ||
| Rivi 151: | Rivi 151: | ||
// add title | // add title | ||
memo.headerEl.append( '<div class="obscharttitle" style="float: left;"></div>' ); | memo.headerEl.append( '<a class="card-link" data-toggle="collapse" aria-expanded="false" href="#' + memo.id + '_collapsible' + '"><div class="obscharttitle" style="float: left;"></div></a>' ); | ||
memo.titleEl = jQuery( this ).find( '.obscharttitle' ); | memo.titleEl = jQuery( this ).find( '.obscharttitle' ); | ||
// add or hide footer | // add or hide footer | ||
| Rivi 162: | 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 203: | 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=""><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 210: | 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=""><i class="fas fa-download"></i></button></div>' ); | ||
memo.downloadEl = jQuery( this ).find( '.download-button' ); | memo.downloadEl = jQuery( this ).find( '.download-button' ); | ||
| Rivi 351: | 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 541: | Rivi 541: | ||
memo.obsMinCompDateMs = Math.min(ms, memo.obsMinCompDateMs); | memo.obsMinCompDateMs = Math.min(ms, memo.obsMinCompDateMs); | ||
memo.obsMaxCompDateMs = Math.max(ms, memo.obsMaxCompDateMs); | memo.obsMaxCompDateMs = Math.max(ms, memo.obsMaxCompDateMs); | ||
// add series id | // add series id | ||
| 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 225: | Rivi 1 230: | ||
memo.options.trendlines[0] = { labelInLegend: i18n['trendline'][memo.lang], tooltip: false, color: colors['allyear'], lineWidth: 3, originalLineWidth: 3, opacity: 1, type: memo.trendType, 'degree': 2, visibleInLegend: memo.trendType!='moving' }; | memo.options.trendlines[0] = { labelInLegend: i18n['trendline'][memo.lang], tooltip: false, color: colors['allyear'], lineWidth: 3, originalLineWidth: 3, opacity: 1, type: memo.trendType, 'degree': 2, visibleInLegend: memo.trendType!='moving' }; | ||
} | } | ||
for ( var t in memo.options.trendlines ) { | for ( var t in memo.options.trendlines ) { | ||
if ( memo.trendType == 'linear' ) { | if ( memo.trendType == 'linear' ) { | ||
memo.options.trendlines[ t ].type = 'linear'; | memo.options.trendlines[ t ].type = 'linear'; | ||
} else if ( memo. | } else if ( memo.trendType = 'poly2deg' ) { | ||
memo.options.trendlines[ t ].type = 'polynomial'; | memo.options.trendlines[ t ].type = 'polynomial'; | ||
memo.options.trendlines[ t ].degree = 2; | memo.options.trendlines[ t ].degree = 2; | ||
} else if ( memo. | } else if ( memo.trendType = 'poly3deg' ) { | ||
memo.options.trendlines[ t ].type = 'polynomial'; | memo.options.trendlines[ t ].type = 'polynomial'; | ||
memo.options.trendlines[ t ].degree = 3; | memo.options.trendlines[ t ].degree = 3; | ||
| Rivi 1 379: | Rivi 1 383: | ||
// do average | // do average | ||
console.log( memo ); | |||
if (memo.trendType == 'gaussian') { | if (memo.trendType == 'gaussian') { | ||
| Rivi 1 919: | Rivi 1 924: | ||
'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' }, | ||
| Rivi 2 053: | Rivi 2 059: | ||
'season': 'summer', | 'season': 'summer', | ||
'min': 0, | 'min': 0, | ||
'max': 110, | |||
'direction': 1, | 'direction': 1, | ||
'trend': { 'type': 'gaussian', 'layout': 'line' }, | 'trend': { 'type': 'gaussian', 'layout': 'line' }, | ||
| Rivi 2 176: | Rivi 2 183: | ||
'long': { 'fi': 'Elokuu', 'en': 'August', 'sv': 'Augusti', 'ru': '???' }, | 'long': { 'fi': 'Elokuu', 'en': 'August', 'sv': 'Augusti', 'ru': '???' }, | ||
'short': { 'fi': 'Elo', 'en': 'Aug', 'sv': 'Aug', 'ru': '???' }, | 'short': { 'fi': 'Elo', 'en': 'Aug', 'sv': 'Aug', 'ru': '???' }, | ||
'roman': ' | 'roman': 'VIII' | ||
}, | }, | ||
8: { | 8: { | ||


