Commit a322c99f authored by matt@zope.com's avatar matt@zope.com

Update Image to include a "title" attribute on tag emission for Mozilla.

parent bf3cd729
...@@ -142,6 +142,8 @@ Zope Changes ...@@ -142,6 +142,8 @@ Zope Changes
points to the Zope root, where the ZServer package and default points to the Zope root, where the ZServer package and default
imports may be found. imports may be found.
- Collector #516 -- "title" property on image tags
Zope 2.6.0 alpha 1 Zope 2.6.0 alpha 1
Features Added Features Added
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
"""Image object""" """Image object"""
__version__='$Revision: 1.138 $'[11:-2] __version__='$Revision: 1.139 $'[11:-2]
import Globals, struct import Globals, struct
from OFS.content_types import guess_content_type from OFS.content_types import guess_content_type
...@@ -709,7 +709,7 @@ class Image(File): ...@@ -709,7 +709,7 @@ class Image(File):
return self.tag() return self.tag()
def tag(self, height=None, width=None, alt=None, def tag(self, height=None, width=None, alt=None,
scale=0, xscale=0, yscale=0, css_class=None, **args): scale=0, xscale=0, yscale=0, css_class=None, title=None, **args):
""" """
Generate an HTML IMG tag for this image, with customization. Generate an HTML IMG tag for this image, with customization.
Arguments to self.tag() can be any valid attributes of an IMG tag. Arguments to self.tag() can be any valid attributes of an IMG tag.
...@@ -743,6 +743,10 @@ class Image(File): ...@@ -743,6 +743,10 @@ class Image(File):
alt=getattr(self, 'title', '') alt=getattr(self, 'title', '')
result = '%s alt="%s"' % (result, escape(alt, 1)) result = '%s alt="%s"' % (result, escape(alt, 1))
if title is None:
title=getattr(self, 'title', '')
result = '%s title="%s"' % (result, escape(title, 1))
if height: if height:
result = '%s height="%s"' % (result, height) result = '%s height="%s"' % (result, height)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment