mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
d8fcd70284
git-svn-id: https://svn.fhem.de/fhem/trunk@4605 2b470e98-0d58-463d-a4d8-8e2adae1ed80
28 lines
862 B
JavaScript
28 lines
862 B
JavaScript
function
|
|
FW_svgUpdateDevs(devs)
|
|
{
|
|
// if matches, refresh the SVG by removing and readding the embed tag
|
|
var embArr = document.getElementsByTagName("embed");
|
|
for(var i = 0; i < embArr.length; i++) {
|
|
var svg = embArr[i].getSVGDocument();
|
|
if(!svg || !svg.firstChild || !svg.firstChild.nextSibling)
|
|
continue;
|
|
var flog = svg.firstChild.nextSibling.getAttribute("flog");
|
|
for(var j=0; j < devs.length; j++) {
|
|
if(flog !== null && flog.match(" "+devs[j]+" ")) {
|
|
var e = embArr[i];
|
|
var newE = document.createElement("embed");
|
|
for(var k=0; k<e.attributes.length; k++)
|
|
newE.setAttribute(e.attributes[k].name, e.attributes[k].value);
|
|
e.parentNode.insertBefore(newE, e);
|
|
e.parentNode.removeChild(e);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
FW_widgets['SVG'] = {
|
|
updateDevs:FW_svgUpdateDevs,
|
|
};
|