[Zope-Checkins] SVN: Zope/trunk/ - Collector #1557/OFS.Image: Introducing new 'alt' property. The 'alt' attribute

Andreas Jung andreas at andreas-jung.com
Sat Oct 30 03:31:09 EDT 2004


Log message for revision 28292:
        - Collector #1557/OFS.Image: Introducing new 'alt' property. The 'alt' attribute
          is no longer taken from the 'title' property but from the new 'alt' property. 
          The border="0" attribute is no longer part of the HTML output except specified
          otherwise.
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/OFS/Image.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt	2004-10-30 06:13:51 UTC (rev 28291)
+++ Zope/trunk/doc/CHANGES.txt	2004-10-30 07:31:08 UTC (rev 28292)
@@ -33,6 +33,12 @@
 
       - docutils: moved from lib/python/docutils to lib/python/third_party/docutils 
 
+      - Collector #1557/OFS.Image: Introducing new 'alt' property. The 'alt' attribute
+        is no longer taken from the 'title' property but from the new 'alt' property. 
+        The border="0" attribute is no longer part of the HTML output except specified
+        otherwise.
+           
+
   Zope 2.8a1
 
 

Modified: Zope/trunk/lib/python/OFS/Image.py
===================================================================
--- Zope/trunk/lib/python/OFS/Image.py	2004-10-30 06:13:51 UTC (rev 28291)
+++ Zope/trunk/lib/python/OFS/Image.py	2004-10-30 07:31:08 UTC (rev 28292)
@@ -113,6 +113,7 @@
 
 
     _properties=({'id':'title', 'type': 'string'},
+                 {'id':'alt', 'type':'string'},
                  {'id':'content_type', 'type':'string'},
                  )
 
@@ -788,7 +789,7 @@
         result='<img src="%s"' % (self.absolute_url())
 
         if alt is None:
-            alt=getattr(self, 'title', '')
+            alt=getattr(self, 'alt', '')
         result = '%s alt="%s"' % (result, escape(alt, 1))
 
         if title is None:
@@ -801,8 +802,9 @@
         if width:
             result = '%s width="%s"' % (result, width)
 
-        if not 'border' in [ x.lower() for x in  args.keys()]:
-            result = '%s border="0"' % result
+        # Omitting 'border' attribute (Collector #1557)
+#        if not 'border' in [ x.lower() for x in  args.keys()]:
+#            result = '%s border="0"' % result
 
         if css_class is not None:
             result = '%s class="%s"' % (result, css_class)



More information about the Zope-Checkins mailing list