//$(document).ready(FW_readingsGroupReadyFn); $(FW_readingsGroupReadyFn); function FW_readingsGroupReadyFn() { // replace all informIds of the form devName-readingName with rgName-devName.readingName $(".readingsGroup").each(function() { if( this.className.search(/\bsortable\b/) ) { loadScript( 'pgm2/sorttable.js', function() { setTimeout( function() { $(".readingsGroup").each(function() { var sort = parseInt($(this).attr('sortColumn')); if( sort ) sorttable.doSort(this, Math.abs(sort)-1, sort<0?true:false ); } ); }, 100 ); } ); } var name = $(this).attr('id').split("-")[1]; $(this).find("[informId]").each(function() { var informId = $(this).attr('informId'); var parts = informId.split("-"); if( parts[0] != name ) { informId = name+'-'+informId.replace('-','.'); $(this).attr('informId', informId); } }); $(this).find("[rg-fhemWidget-label]").each(function() { var txt = $(this).attr('rg-fhemWidget-label'); var contents = $(this).find('div').first().contents(); if( contents.size() == 2 ) contents.first().replaceWith(txt); }); }); } function FW_readingsGroupToggle(d) { var rg = document.getElementById( 'readingsGroup-'+d ); if( rg ) { s=rg.style; s.display = s.display=='none' ? 'table' : 'none'; var group = rg.getAttribute('groupId'); if( group ) { var elArr = document.querySelectorAll( '[groupId='+group+']' ); for( var k=0; k