Ero sivun ”Widget:JwObsCharts” versioiden välillä
Järvi-meriwikistä
Rivi 67: | Rivi 67: | ||
memo.height = memo.widgetEl.attr( 'data-height' ); if (typeof memo.height == 'undefined') { memo.height = 450; } | memo.height = memo.widgetEl.attr( 'data-height' ); if (typeof memo.height == 'undefined') { memo.height = 450; } | ||
− | memo.siteid = jQuery( this ).attr( 'data-jw-siteid' ); | + | memo.siteid = jQuery( this ).attr( 'data-jw-siteid' ); |
− | + | memo.obscode = jQuery( this ).attr( 'data-jw-obscode' ); | |
− | memo.obscode = jQuery( this ).attr( 'data-jw-obscode' ); | ||
memo.refcode = jQuery( this ).attr( 'data-jw-refcode' ); if ( typeof memo.refcode == 'undefined' ) { memo.refcode = '-'; } | memo.refcode = jQuery( this ).attr( 'data-jw-refcode' ); if ( typeof memo.refcode == 'undefined' ) { memo.refcode = '-'; } | ||
memo.reffilter = jQuery( this ).attr( 'data-jw-reffilter' ); if ( typeof memo.reffilter == 'undefined' ) { memo.reffilter = ''; } | memo.reffilter = jQuery( this ).attr( 'data-jw-reffilter' ); if ( typeof memo.reffilter == 'undefined' ) { memo.reffilter = ''; } | ||
Rivi 328: | Rivi 327: | ||
} | } | ||
− | + | memo.jw.loadObses( { 'obscode': memo.obscodeParts[0], 'siteid': memo.siteid, 'startdate': memo.startDate, 'custom': custom }, function( o ) { | |
− | + | //console.log( JSON.stringify( memo.jw.obs ) ); | |
− | + | memo.obses = memo.jw.obs; | |
− | + | if ( memo.refcode != '-' ) { | |
− | + | memo.jwR.loadObses( { "obscode": memo.refcode, "siteid": memo.siteid, "sort": "SiteID", "custom": memo.reffilter }, function( r ) { | |
− | + | memo.refs = memo.jwR.obs; | |
− | + | //console.log( JSON.stringify( memo.refs ) ); | |
− | |||
drawVisualization(memo); | drawVisualization(memo); | ||
− | + | }); | |
− | + | } else { | |
− | |||
− | |||
drawVisualization(memo); | drawVisualization(memo); | ||
− | } | + | } |
− | } | + | }); |
− | |||
− | |||
− | |||
} else { | } else { | ||
if ( typeof window.jwobschart[id] == 'undefined' ) { | if ( typeof window.jwobschart[id] == 'undefined' ) { | ||
Rivi 669: | Rivi 662: | ||
− | } else if ( memo.obscode == 'ski' ) { | + | } else if ( memo.obscode == 'ski' ) { |
− | |||
memo.widgetEl.html(''); | memo.widgetEl.html(''); | ||
memo.widgetEl.append( '<p style="text-align: center; line-height: 20px;" class="huomio">29.3.2023</p>' ); | memo.widgetEl.append( '<p style="text-align: center; line-height: 20px;" class="huomio">29.3.2023</p>' ); | ||
Rivi 677: | Rivi 669: | ||
} else if ( memo.obscode == 'temp' ) { | } else if ( memo.obscode == 'temp' ) { | ||
− | |||
− | |||
− | |||
memo.widgetEl.html(''); | memo.widgetEl.html(''); | ||
memo.widgetEl.append( '<p style="text-align: center; line-height: 20px;" class="huomio">Ei tuoreita havaintoja</p>' ); | memo.widgetEl.append( '<p style="text-align: center; line-height: 20px;" class="huomio">Ei tuoreita havaintoja</p>' ); |