I made a new feature for ajaxWDwx.js
This feature is called “Ajax Heat Color Word”
It makes the heatcolor word ajaxed with a color background that changes with the heatcolor, very similar to heatcolourword in WD
See it being used on my ajax dashboard here:
http://www.proweatherstore.com/weather/index.php
To see how it progressed from BETA to Final, see this post.
http://discourse.weather-watch.com/t/32531
This is version 1.00 Final
Here is how to add it:
edit ajax-dashboard.php:
change:
<?php echo $heatcolourword; ?>
to:
<span class="ajax" id="ajaxheatcolorword"><?php echo $heatcolourword; ?></span>
edit ajaxWDwx.js:
change:
// -- end of language settings ----------------------------------------------------------
to:
var langHeatWords = new Array (
'Unknown', 'Extreme Heat Danger', 'Heat Danger', 'Extreme Heat Caution', 'Extremely Hot', 'Uncomfortably Hot',
'Hot', 'Warm', 'Comfortable', 'Cool', 'Cold', 'Uncomfortably Cold', 'Very Cold', 'Extreme Cold' );
// -- end of language settings ----------------------------------------------------------
change:
// Mike Challis' counter function (adapted by Ken True)
to:
// function to add colored heatColorWord by Mike Challis
// final version 1.00
function heatColor(temp,WindChill,Humidex) {
var hcWord = langHeatWords[0];
if (temp > 32 && Humidex > 29) {
if (Humidex > 54) { return ('<span style="border: solid 1px; color: white; background-color: #BA1928;"> '+langHeatWords[1]+' </span>'); }
if (Humidex > 45) { return ('<span style="border: solid 1px; color: white; background-color: #E02538;"> '+langHeatWords[2]+' </span>'); }
if (Humidex > 39) { return ('<span style="border: solid 1px; color: black; background-color: #E178A1;"> '+langHeatWords[4]+' </span>'); }
if (Humidex > 29) { return ('<span style="border: solid 1px; color: white; background-color: #CC6633;"> '+langHeatWords[6]+' </span>'); }
} else if (WindChill < 16 ) {
if (WindChill < -18) { return ('<span style="border: solid 1px; color: black; background-color: #91ACFF;"> '+langHeatWords[13]+' </span>'); }
if (WindChill < -9) { return ('<span style="border: solid 1px; color: white; background-color: #806AF9;"> '+langHeatWords[12]+' </span>'); }
if (WindChill < -1) { return ('<span style="border: solid 1px; color: white; background-color: #3366FF;"> '+langHeatWords[11]+' </span>'); }
if (WindChill < 8) { return ('<span style="border: solid 1px; color: white; background-color: #6699FF;"> '+langHeatWords[10]+' </span>'); }
if (WindChill < 16) { return ('<span style="border: solid 1px; color: black; background-color: #89B2EA;"> '+langHeatWords[9]+' </span>'); }
} else if (WindChill >= 16 && temp <= 32) {
if (temp < 26) { return ('<span style="border: solid 1px; color: black; background-color: #C6EF8C;"> '+langHeatWords[8]+' </span>'); }
if (temp <= 32) { return ('<span style="border: solid 1px; color: black; background-color: #CC9933;"> '+langHeatWords[7]+' </span>'); }
}
return hcWord;
}
// Mike Challis' counter function (adapted by Ken True)
change:
set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
to:
set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
// # mike challis added heatColorWord feature
var heatColorWord = heatColor(clientraw[4],clientraw[44],clientraw[45]);
set_ajax_obs("ajaxheatcolorword",heatColorWord);