Ero sivun ”Widget:JwCurrentCharts” versioiden välillä
Järvi-meriwikistä
Rivi 27: | Rivi 27: | ||
jQuery.getScript( "//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js", function() { | jQuery.getScript( "//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js", function() { | ||
jQuery.getScript( "//www.jarviwiki.fi/citobsjs/jwapi.js", function() { | jQuery.getScript( "//www.jarviwiki.fi/citobsjs/jwapi.js", function() { | ||
− | jQuery.getScript( '//www.gstatic.com/charts/loader.js', function() { | + | allReady(); |
− | + | //jQuery.getScript( '//www.gstatic.com/charts/loader.js', function() { | |
− | + | // google.charts.load( 'current', { 'packages':[ 'corechart' ], 'language': 'fi' } ); | |
− | }); | + | // google.charts.setOnLoadCallback( allReady ); |
+ | //}); | ||
}); | }); | ||
}); | }); | ||
Rivi 332: | Rivi 333: | ||
memo.jwR = new jwApi(); | memo.jwR = new jwApi(); | ||
− | var | + | var custom = ''; |
− | |||
− | |||
if ( typeof memo.obscodeParts[1] != 'undefined' ) { | if ( typeof memo.obscodeParts[1] != 'undefined' ) { | ||
if ( typeof memo.obscodeParts[2] != 'undefined' ) { | if ( typeof memo.obscodeParts[2] != 'undefined' ) { | ||
− | + | custom += '[[' + i18n[memo.obscodeParts[0]].catName + '::' + memo.obscodeParts[2].split(',').join('||') +']]'; | |
} else { | } else { | ||
− | + | custom += '[[' + i18n[memo.obscode].catName + '::>0]]'; | |
} | } | ||
} | } | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
if ( memo.siteid != '-' ) { | if ( memo.siteid != '-' ) { | ||
− | so.siteid | + | so = { 'obscode': memo.obscodeParts[0], 'siteid': memo.siteid, 'startdate': memo.startDate, 'custom': custom }; |
} else { | } else { | ||
− | so.waterbody | + | so = { 'obscode': memo.obscodeParts[0], 'waterbody': memo.waterbody, 'startdate': memo.startDate, 'custom': custom }; |
} | } | ||
− | + | ||
memo.jw.loadObses( so, function( o ) { | memo.jw.loadObses( so, function( o ) { | ||
− | memo.obses = memo.jw.obs; | + | memo.obses = memo.jw.obs; |
− | drawVisualization(memo); | + | if ( memo.refcode != '-' ) { |
+ | memo.jwR.loadObses( { "obscode": memo.refcode, "siteid": memo.siteid, "sort": "SiteID", "custom": memo.reffilter }, function( r ) { | ||
+ | memo.refs = memo.jwR.obs; | ||
+ | drawVisualization(memo); | ||
+ | }); | ||
+ | } else { | ||
+ | drawVisualization(memo); | ||
+ | } | ||
}); | }); | ||
} else { | } else { |