2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00
fhem-mirror/fhem/www/pgm2/fhemweb_readingsHistory.js
justme-1968 5b2e188f89 fhemweb.js: doku fixes
git-svn-id: https://svn.fhem.de/fhem/trunk@15189 2b470e98-0d58-463d-a4d8-8e2adae1ed80
2017-10-03 17:53:27 +00:00

53 lines
853 B
JavaScript

FW_version["fhemweb_readingsHistory.js"] = "$Id$";
function
FW_readingsHistoryUpdateLine(d){
var dd = d[0].split("-", 3);
if(dd.length != 2)
return;
var clear = 0;
if( dd[1] == "clear" )
clear = 1;
else if( dd[1] != "history" )
return;
var name = dd[0] + "-history";
el = document.getElementById(name);
if( el ) {
var rows = el.getAttribute("rows");
var lines = el.innerHTML.split( "<br>", rows );
el.innerHTML = d[1] + "<br>";
for( i = 0; i <= rows-2; ++i )
{
if( !clear )
el.innerHTML += lines[i];
el.innerHTML += "<br>";
}
}
}
function FW_readingsHistoryCreate(elName, devName, vArr, currVal, set, params, cmd)
{
}
FW_widgets['readingsHistory'] = {
createFn:FW_readingsHistoryCreate,
updateLine:FW_readingsHistoryUpdateLine
};
/*
=pod
=cut
*/