Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
a322c99f
Commit
a322c99f
authored
Aug 14, 2002
by
matt@zope.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Image to include a "title" attribute on tag emission for Mozilla.
parent
bf3cd729
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+6
-2
No files found.
doc/CHANGES.txt
View file @
a322c99f
...
@@ -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
...
...
lib/python/OFS/Image.py
View file @
a322c99f
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
##############################################################################
##############################################################################
"""Image object"""
"""Image object"""
__version__
=
'$Revision: 1.13
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.13
9
$'
[
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment