diff --git a/www/pgm2/fhemweb.js b/www/pgm2/fhemweb.js index fc5c047bf..18dac8893 100644 --- a/www/pgm2/fhemweb.js +++ b/www/pgm2/fhemweb.js @@ -1112,6 +1112,10 @@ FW_doUpdate(evt) var retryTime = 5000; var now = new Date()/1000; + // d: array + // d[0]: informid + // d[1]: if the informid Widget has setValueFn, arg for this + // d[2]: else replace the html with this function setValue(d) // is Callable from eval below { @@ -1124,13 +1128,19 @@ FW_doUpdate(evt) d[2] = '
'+d[2]+''; var ma = /^([\s\S]*)<\/html>/.exec(d[2]); - if(!d[0].match("-")) // not a reading + if(!d[0].match("-")) { // not a reading $(this).html(d[2]); - else if(ma) + FW_replaceWidgets($(this)); + + } else if(ma) { $(this).html(ma[1]); - else + FW_replaceWidgets($(this)); + + } else { $(this).text(d[2]); + } + if(d[0].match(/-ts$/)) // timestamps $(this).addClass('changed'); $(this).find("a").each(function() { FW_replaceLink(this) }); @@ -1206,6 +1216,7 @@ FW_doUpdate(evt) } else { setValue(d); + } // updateLine is deprecated, use setValueFn