changeset 5120:aa10c2a001f5

pdf embedding: do not give object tag attributes the adobe acrobat reader pdf browser plugin does not understand (they make it fail)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 03 Sep 2009 18:41:03 +0200
parents 9044bc563305
children 939ff5ed921a
files MoinMoin/macro/EmbedObject.py
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/EmbedObject.py	Wed Sep 02 13:44:41 2009 +0200
+++ b/MoinMoin/macro/EmbedObject.py	Thu Sep 03 18:41:03 2009 +0200
@@ -201,8 +201,19 @@
         if mt.minor == 'pdf':
             width = width or '100%'
             height = height or '800px'
-
-        embed_src = '''
+            embed_src = '''
+<object %(ob_data)s %(ob_type)s %(ob_width)s %(ob_height)s %(ob_align)s>
+<p>%(alt)s</p>
+</object>''' % {
+    "ob_data": _check_object_value("data", url),
+    "ob_width": _check_object_value("width", width),
+    "ob_height": _check_object_value("height", height),
+    "ob_type": _check_object_value("type", mime_type),
+    "ob_align": _check_object_value("align", align),
+    "alt": wikiutil.escape(alt),
+}
+        else:
+            embed_src = '''
 <object %(ob_data)s %(ob_type)s %(ob_width)s %(ob_height)s %(ob_align)s>
 %(movie)s%(quality)s%(wmode)s%(autostart)s%(play)s%(loop)s%(menu)s<p>%(alt)s</p>
 </object>''' % {