Ero sivun ”Widget:CitobsDBcounter” versioiden välillä
Järvi-meriwikistä
Rivi 21: | Rivi 21: | ||
function <!--{$id|default:vesificounter|escape:'html'}-->_allOk() { | function <!--{$id|default:vesificounter|escape:'html'}-->_allOk() { | ||
+ | var lang = "<!--{$lang|default:fi|escape:'html'}-->"; | ||
var service_code = "<!--{$service_code|default:x|escape:'html'}-->"; | var service_code = "<!--{$service_code|default:x|escape:'html'}-->"; | ||
var keyword = "<!--{$keyword|default:x|escape:'html'}-->"; | var keyword = "<!--{$keyword|default:x|escape:'html'}-->"; | ||
Rivi 32: | Rivi 33: | ||
citobs.loadRequests( { 'service_code': service_code, 'keyword': keyword, 'start_date': start_date }, function() { | citobs.loadRequests( { 'service_code': service_code, 'keyword': keyword, 'start_date': start_date }, function() { | ||
− | var | + | var c1 = 0; |
+ | var c2 = 0; | ||
for ( var o in citobs.request ) { | for ( var o in citobs.request ) { | ||
+ | c1++; | ||
if ( citobs.request[ o ].attributes[ 'algaebloom_singlevaluelist_201808151546174' ] != '1' ) { | if ( citobs.request[ o ].attributes[ 'algaebloom_singlevaluelist_201808151546174' ] != '1' ) { | ||
− | + | c2++; | |
} | } | ||
} | } | ||
− | var out | + | var out; |
+ | if ( lang == 'fi' ) { | ||
+ | out = 'Lisäksi Vesi.fi-palvelun kautta on tällä viikolla lähetetty ' + c1 + ' havaintoa sinilevätilanteesta. Näistä ' + c2 + ' kappaleessa havaittiin sinilevää.'; | ||
+ | } else { | ||
+ | out = 'In addition, ' + c1 + ' observations about the blue-green algae situation have been sent through the Vesi.fi service this week. In ' + c2 + ' of these observations, algae had been detected.'; | ||
+ | } | ||
jQuery( "#<!--{$id|default:vesificounter|escape:'html'}-->_container" ).html ( out ); | jQuery( "#<!--{$id|default:vesificounter|escape:'html'}-->_container" ).html ( out ); | ||