From e3c90a69d2f9a6b2124e010fd9c2c67fe0c352bf Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 23 Jan 2012 21:07:25 +0000 Subject: [PATCH] Some animation added git-svn-id: https://svn.fhem.de/fhem/trunk@1214 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/webfrontend/pgm2/svg.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/fhem/webfrontend/pgm2/svg.js b/fhem/webfrontend/pgm2/svg.js index f97baae56..99a8087a3 100644 --- a/fhem/webfrontend/pgm2/svg.js +++ b/fhem/webfrontend/pgm2/svg.js @@ -3,6 +3,7 @@ var old_title; var old_sel; var svgdoc; var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var to; // Base64 encode the xy points (12 bit x, 12 bit y). function @@ -92,15 +93,22 @@ svg_paste(evt) d.documentElement.appendChild(o); } - function -showOtherLines(d, lid, on) +showOtherLines(d, lid, currval, maxval) { for(var i=0; i < 9; i++) { var id="line_"+i; var el = d.getElementById(id); - if(el) - el.setAttribute("display", (on||id==lid) ? "block" : "none"); + if(el && id != lid) { + var h = parseFloat(el.getAttribute("y_h")); + el.setAttribute("transform", "translate(0,"+h*(1-currval)+") "+ + "scale(1,"+currval+")"); + } + } + if(currval != maxval) { + currval += (currval