Attachment 'imagemap.patch'

Download

   1 diff -r 8f2446858dd3 MoinMoin/action/anywikidraw.py
   2 --- a/MoinMoin/action/anywikidraw.py	Mon Mar 01 00:23:21 2010 +0100
   3 +++ b/MoinMoin/action/anywikidraw.py	Thu Apr 15 11:54:50 2010 +0200
   4 @@ -63,6 +63,21 @@
   5          map = map.replace(u'name="%s.svg"' % drawing, u'name="%s"' % mapid)
   6          # unxml, because 4.01 concrete will not validate />
   7          map = map.replace(u'/>', u'>')
   8 +
   9 +        # Add script_root to image map links which direct to wiki pages.
  10 +        script = self.request.script_root
  11 +        regexes = re.compile('(?:href=")+(?P<url>[^"]+)"+')
  12 +        def correct_map_match( match):
  13 +            url = match.group("url")
  14 +
  15 +            if not url.startswith("http://"):
  16 +                return r'href="' + script + "/" + url + '"'
  17 +            else:
  18 +                return r'href="' + url + '"'
  19 +        map = regexes.sub(correct_map_match, map)
  20 +      
  21 +      
  22 +        
  23          title = _('Clickable drawing: %(filename)s') % {'filename': self.text(containername)}
  24          if 'title' not in kw:
  25              kw['title'] = title

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-04-15 09:17:20, 10.0 KB) [[attachment:bugs.adraw]]
  • [get | view] (2010-04-15 09:56:13, 1.0 KB) [[attachment:imagemap.patch]]
  • [get | view] (2010-04-15 09:22:12, 40.0 KB) [[attachment:link.adraw]]
  • [get | view] (2010-04-15 09:10:48, 10.0 KB) [[attachment:test.adraw]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.