changeset 5245:55de22afaff3

drawings: A unique ID for image maps is needed if drawings with the same name are included from different pages (bug fix for 1.9ImageMapsInDrawingsDontWork).
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Mon, 02 Nov 2009 21:47:05 +0100
parents 9730c2936db7
children ac1f33fb3829
files MoinMoin/action/anywikidraw.py MoinMoin/action/twikidraw.py
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/anywikidraw.py	Sun Nov 01 12:21:16 2009 +0100
+++ b/MoinMoin/action/anywikidraw.py	Mon Nov 02 21:47:05 2009 +0100
@@ -56,7 +56,9 @@
     if map:
         # ToDo mapid must become uniq
         # we have a image map. inline it and add a map ref to the img tag
-        mapid = u'ImageMapOf' + drawing
+        # we have also to set a unique ID
+        mapid = u'ImageMapOf%s%s' % (self.request.uid_generator(pagename), drawing)
+
         map = map.replace(u'id="%s.svg"' % drawing, '')
         map = map.replace(u'name="%s.svg"' % drawing, u'name="%s"' % mapid)
         # unxml, because 4.01 concrete will not validate />
--- a/MoinMoin/action/twikidraw.py	Sun Nov 01 12:21:16 2009 +0100
+++ b/MoinMoin/action/twikidraw.py	Mon Nov 02 21:47:05 2009 +0100
@@ -75,7 +75,8 @@
         map = u''
     if map:
         # we have a image map. inline it and add a map ref to the img tag
-        mapid = u'ImageMapOf' + drawing
+        # we have also to set a unique ID
+        mapid = u'ImageMapOf%s%s' % (self.request.uid_generator(pagename), drawing)
         map = map.replace(u'%MAPNAME%', mapid)
         # add alt and title tags to areas
         map = re.sub(ur'href\s*=\s*"((?!%TWIKIDRAW%).+?)"', ur'href="\1" alt="\1" title="\1"', map)