summaryrefslogtreecommitdiffstats
path: root/ksvg/test/ecma/dom01.svg
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit47d455dd55be855e4cc691c32f687f723d9247ee (patch)
tree52e236aaa2576bdb3840ebede26619692fed6d7d /ksvg/test/ecma/dom01.svg
downloadtdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz
tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksvg/test/ecma/dom01.svg')
-rw-r--r--ksvg/test/ecma/dom01.svg40
1 files changed, 40 insertions, 0 deletions
diff --git a/ksvg/test/ecma/dom01.svg b/ksvg/test/ecma/dom01.svg
new file mode 100644
index 00000000..d5b98937
--- /dev/null
+++ b/ksvg/test/ecma/dom01.svg
@@ -0,0 +1,40 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg width="4cm" height="2cm" viewBox="0 0 400 200"
+ onload="StartAnimation(evt)"
+ xmlns="http://www.w3.org/2000/svg">
+
+ <script type="text/ecmascript"><![CDATA[
+ var timevalue = 0;
+ var timer_increment = 50;
+ var max_time = 5000;
+ var text_element;
+ function StartAnimation(evt) {
+ text_element = evt.target.ownerDocument.getElementById("TextElement");
+ ShowAndGrowElement();
+ }
+ function ShowAndGrowElement() {
+ timevalue = timevalue + timer_increment;
+ if (timevalue > max_time)
+ return;
+
+ // Scale the text string gradually until it is 20 times larger
+ scalefactor = (timevalue * 20.) / max_time * 40;
+ text_element.setAttribute("transform", "scale(" + scalefactor + ")");
+ // Make the string more opaque
+ opacityfactor = timevalue / max_time;
+// text_element.setAttribute("opacity", opacityfactor);
+
+ // Call ShowAndGrowElement again <timer_increment> milliseconds later.
+// setTimeout("ShowAndGrowElement()", timer_increment)
+ }
+ window.ShowAndGrowElement = ShowAndGrowElement
+ ]]></script>
+ <rect x="1" y="1" width="398" height="198"
+ fill="none" stroke="blue" stroke-width="2"/>
+
+ <g transform="translate(50,150)" fill="red" font-size="7">
+ <text id="TextElement">SVG</text>
+ </g>
+</svg>