[kupu-checkins] r35885 - in kupu/trunk/kupu: common common/kupudrawers plone

duncan at codespeak.net duncan at codespeak.net
Tue Dec 19 14:38:41 CET 2006


Author: duncan
Date: Tue Dec 19 14:38:37 2006
New Revision: 35885

Modified:
   kupu/trunk/kupu/common/kupudrawers.js
   kupu/trunk/kupu/common/kupudrawers/drawer.xsl
   kupu/trunk/kupu/plone/html2captioned.py
Log:
Upload image in IE was defaulting description to some html.
Caption transform wasn't escaping html in description.


Modified: kupu/trunk/kupu/common/kupudrawers.js
==============================================================================
--- kupu/trunk/kupu/common/kupudrawers.js	(original)
+++ kupu/trunk/kupu/common/kupudrawers.js	Tue Dec 19 14:38:37 2006
@@ -1274,6 +1274,7 @@
             alert("Please enter a title for the image you are uploading");
             return;        
         };
+        form.node_prop_desc.value = form.node_prop_desc.value.replace(/^\xa0|\xa0$/g,'')
         form.submit();
     };
     

Modified: kupu/trunk/kupu/common/kupudrawers/drawer.xsl
==============================================================================
--- kupu/trunk/kupu/common/kupudrawers/drawer.xsl	(original)
+++ kupu/trunk/kupu/common/kupudrawers/drawer.xsl	Tue Dec 19 14:38:37 2006
@@ -439,11 +439,11 @@
                  </label>
                 <label i18n:translate="imagedrawer_upload_desc_label"
                     >Description<br />
-                <textarea rows="5" cols="40" name="node_prop_desc"> </textarea>   
+                <textarea rows="5" cols="40" name="node_prop_desc">&#160;</textarea>
                 </label>
             </form>
             <iframe id="kupu_upload_form_target" name="kupu_upload_form_target" src="javascript:''"
-                scrolling="off" frameborder="0" width="0px" height="0px" display="None"> </iframe>
+                scrolling="off" frameborder="0" width="0px" height="0px" display="None">&#160;</iframe>
         </div>
     </xsl:template>
     <xsl:template match="breadcrumbs">

Modified: kupu/trunk/kupu/plone/html2captioned.py
==============================================================================
--- kupu/trunk/kupu/plone/html2captioned.py	(original)
+++ kupu/trunk/kupu/plone/html2captioned.py	Tue Dec 19 14:38:37 2006
@@ -115,7 +115,7 @@
                     d = attrs.groupdict()
                     target = at_tool.reference_catalog.lookupObject(src)
                     if target:
-                        d['caption'] = newline_to_br(target.Description())
+                        d['caption'] = newline_to_br(html_quote(target.Description()))
                         tag = CLASS_PATTERN.sub('', d['tag'])
                         tag = ALT_PATTERN.sub('', tag)
                         tag = END_TAG_PATTERN.sub('\\1 alt="%s"\\2' % escape(target.Title(),1), tag)


More information about the kupu-checkins mailing list