changeset 1367:9d46f2982fa3

Write animation information in javascript variable
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 04 Mar 2011 12:03:10 +0800
parents dc6591b4079d
children 9e7ec3b96968
files pyink/html5css3.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/html5css3.py	Fri Mar 04 11:41:51 2011 +0800
+++ b/pyink/html5css3.py	Fri Mar 04 12:03:10 2011 +0800
@@ -216,7 +216,7 @@
     
     _passing = lambda name, value: (name, str(value))
     _trans_transform = lambda name, value: \
-        (name, 'matrix(' + ','.join([str(e) for e in value]) + ')')
+        (name, 'matrix(' + ','.join([str(e) for e in value[0]]) + ')')
     
     _translators = {'x': _passing, 'y': _passing,
                    'width': _passing, 'height': _passing,
@@ -318,6 +318,14 @@
         
         print >> out, '''\
 </style>
+<script>'''
+
+        print >>out, 'var animation_info = '
+        import pprint
+        pprint.pprint(self._stylesheet, stream=out, indent=4, depth=2)
+
+        print >> out, '''\
+</script>
 </head>
 <body>'''