Description

Here are some usability and accessibility issues for the TWikiDrawPlugin (which seem to be of minor importance, however they are of big importance for AccessibleMoin):

Steps to reproduce

  1. Go to WikiSandBox and create two new images: a normal one and on with an image map.

  2. Explore both pictures with the mouse and look at the title texts.
  3. Turn if image display in your browser and watch the result. Use Firefox and another browser to see the missing alt for clickble images in Firefox

Example

Component selection

Details

MoinMoin Version

1.6dev (moin-1-6-main-7c58e8af1a97)

OS and Version

WinXpHome Sp2

Python Version

Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Suaheli

Workaround

Discussion

Here's a changed version of text_html.py (moin-1-6-main-7c58e8af1a97)

   1 --- text_html_old.py	2007-02-18 22:01:18.000000000 +0100
   2 +++ text_html.py	2007-02-19 12:25:38.000000000 +0100
   3 @@ -682,7 +682,7 @@
   4  
   5          # check whether attachment exists, possibly point to upload form
   6          if not os.path.exists(fpath):
   7 -            linktext = _('Create new drawing "%(filename)s"')
   8 +            linktext = _('Create new drawing "%(filename)s (opens in new window)"')
   9              return wikiutil.link_tag(
  10                  self.request,
  11                  ('%s?action=AttachFile&rename=%s%s' %
  12 @@ -713,21 +713,23 @@
  13                  # add alt and title tags to areas
  14                  map = re.sub('href\s*=\s*"((?!%TWIKIDRAW%).+?)"', r'href="\1" alt="\1" title="\1"', map)
  15                  # add in edit links plus alt and title attributes
  16 -                map = map.replace('%TWIKIDRAW%"', edit_link + '" alt="' + _('Edit drawing %(filename)s') % {'filename': self.text(fname)} + '" title="' + _('Edit drawing %(filename)s') % {'filename': self.text(fname)} + '"')
  17 +                map = map.replace('%TWIKIDRAW%"', edit_link +
  18 +                                  '" alt="' + _('Edit drawing %(filename)s (opens in new window)') % {'filename': self.text(fname)} +
  19 +                                  '" title="' + _('Edit drawing %(filename)s (opens in new window)') % {'filename': self.text(fname)} + '"')
  20                  # unxml, because 4.01 concrete will not validate />
  21                  map = map.replace('/>', '>')
  22 -                return (map + self.image(
  23 -                    alt=drawing,
  24 -                    src=AttachFile.getAttachUrl(
  25 -                    pagename, filename, self.request,
  26 -                    addts=1),
  27 -                    usemap='#'+mapid, css="drawing"))
  28 +                return (map + self.image(alt="%s" % (_('Clickable drawing: %(filename)s') % {'filename': self.text(fname)}),
  29 +                                         title="",
  30 +                                         src=AttachFile.getAttachUrl(pagename, filename, self.request,addts=1),
  31 +                                         usemap='#'+mapid, css="drawing"))
  32 +  
  33          else:
  34              return wikiutil.link_tag(self.request,
  35                                       edit_link,
  36 -                                     self.image(alt=url,
  37 +                                     self.image(alt="%s" % (_('Edit drawing %(filename)s (opens in new window)') % {'filename': self.text(fname)}),
  38 +                                                title="%s" % (_('Edit drawing %(filename)s (opens in new window)') % {'filename': self.text(fname)}),                                             
  39                                                  src=AttachFile.getAttachUrl(pagename, filename, self.request, addts=1), css="drawing"),
  40 -                                     title="%s" % (_('Edit drawing %(filename)s') % {'filename': self.text(fname)}))
  41 +                                     title="%s" % (_('Edit drawing %(filename)s (opens in new window)') % {'filename': self.text(fname)}))
  42  
  43  
  44      # Text ##############################################################
text_html.diff

-- OliverSiemoneit 2007-02-19 11:37:37

Thank you very much for implementing this in Moin1.6! This moves an accessibility-aficinado to tears ;-) . All works fine on http://test.wikiwikiweb.de. Maybe two things to mention:

{{{.screenreader_info {

}}}

This is a common technique in accessible webdesign as you can see here: http://webaim.org/techniques/css/invisiblecontent/. This technique is also used to make the new inline-comments accessible and useable when css is disabled (MoinMoinBugs/1.6devCommentSectionsNotAccessibleByScreenreaderOrWithCssDisabled). This css class is also a must for so called "skip links" as implemented in ThemeMarket/SimpleMente. In AccessibleMoin there is no way round for that. This is a legitime and reliable solution and state-of-the-art. So in my eyes this css class will be sooner or later part of Moin anyway.

new_patch.diff

-- OliverSiemoneit 2007-04-18 13:47:51

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/AltAndTitleTextsDoNotDisplayCorrectlyInTwikiDrawPlugin (last edited 2007-10-29 19:09:53 by localhost)