Replace code with:gielie wrote: ↑Thursday 10 August 2017 15:34 HI Rob,
The following code doesn't work anymore in the latest beta.Its the presence switch with is no a on/off again instead of a aan/afwezig.Code: Select all
function getBlock_6(device,idx){ $('.block_'+idx); var html=''; html+='<div class="col-xs-4 col-icon">'; if(device['Status']=='Off') html+='<img src="img/cust_away.png" class="off icon" />'; else html+='<img src="img/cust_home.png" class="on icon" />'; html+='</div>'; html+='<div class="col-xs-8 col-data">'; html+='<strong class="title">'+device['Name']+'</strong><br />'; if(device['Status']=='Off') html+='<span class="state">AFWEZIG</span>'; else html+='<span class="state">AANWEZIG</span>'; if((_SHOW_LASTUPDATE && (typeof(blocks[idx])=='undefined' || typeof(blocks[idx]['hide_lastupdate'])=='undefined' || blocks[idx]['hide_lastupdate']===false)) || (!_SHOW_LASTUPDATE && (typeof(blocks[idx])!=='undefined' && typeof(blocks[idx]['show_lastupdate'])!=='undefined' && blocks[idx]['show_lastupdate']==true)) ){ html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(_LASTUPDATE_FORMAT)+'</span>'; } html+='</div>'; return html; }
Can you fix this?
Code: Select all
function getBlock_117(device,idx,result){
var html='';
html+='<div class="col-xs-4 col-icon">';
if(device['Status']=='Off') html+='<img src="img/cust_away.png" class="off icon" />';
else html+='<img src="img/cust_home.png" class="on icon" />';
html+='</div>';
html+='<div class="col-xs-8 col-data">';
html+='<strong class="title">'+device['Name']+'</strong><br />';
if(device['Status']=='Off') html+='<span class="state">AFWEZIG</span>';
else html+='<span class="state">AANWEZIG</span>';
if((settings['last_update']==1 && (typeof(blocks[idx])=='undefined' || typeof(blocks[idx]['hide_lastupdate'])=='undefined' || blocks[idx]['hide_lastupdate']===false)) ||
(settings['last_update']==0 && (typeof(blocks[idx])!=='undefined' && typeof(blocks[idx]['show_lastupdate'])!=='undefined' && blocks[idx]['show_lastupdate']==true))
){
html+='<br /><span class="lastupdate">'+moment(device['LastUpdate']).format(settings['timeformat'])+'</span>';
}
html+='</div>';
return html;
}