[Zope-Checkins] SVN: Zope/trunk/ - Collector #1454/OFS.File: Accept content types ending with

Jens Vagelpohl jens at dataflake.org
Wed Nov 10 15:52:18 EST 2004


Log message for revision 28422:
  - Collector #1454/OFS.File: Accept content types ending with
    "javascript" as editable through the File edit form, just like
    text/<foo> types
  

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/OFS/dtml/fileEdit.dtml

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt	2004-11-10 20:42:52 UTC (rev 28421)
+++ Zope/trunk/doc/CHANGES.txt	2004-11-10 20:52:18 UTC (rev 28422)
@@ -35,6 +35,10 @@
       - RAMCacheManager: Allow invalidation of a cache entry from the
         Statistics view in the ZMI
 
+      - Collector #1454/OFS.File: Accept content types ending with
+        "javascript" as editable through the File edit form, just like
+        text/<foo> types
+
     Bugs fixed
     
       - Collector #1127: strftime did not take timezone into account.

Modified: Zope/trunk/lib/python/OFS/dtml/fileEdit.dtml
===================================================================
--- Zope/trunk/lib/python/OFS/dtml/fileEdit.dtml	2004-11-10 20:42:52 UTC (rev 28421)
+++ Zope/trunk/lib/python/OFS/dtml/fileEdit.dtml	2004-11-10 20:52:18 UTC (rev 28422)
@@ -48,48 +48,51 @@
   </td>
 </tr>
 
-<dtml-if "this().getContentType()[:4] == 'text' and this().get_size() < 65536">
-<tr>
-  <td align="left" valign="top" colspan="2">
-  <div style="width: 100%;">
-  <dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
-            rows="REQUEST.get('dtpref_rows', '20')">
-  <dtml-if "cols[-1]=='%'">
-  <textarea name="filedata:text" wrap="off" style="width: &dtml-cols;;"
+<dtml-let ct=getContentType>
+  <dtml-if "(ct.startswith('text') or ct.endswith('javascript')) 
+            and this().get_size() < 65536">
+  <tr>
+    <td align="left" valign="top" colspan="2">
+    <div style="width: 100%;">
+    <dtml-let cols="REQUEST.get('dtpref_cols', '100%')"
+              rows="REQUEST.get('dtpref_rows', '20')">
+    <dtml-if "cols[-1]=='%'">
+    <textarea name="filedata:text" wrap="off" style="width: &dtml-cols;;"
+    <dtml-else>
+    <textarea name="filedata:text" wrap="off" cols="&dtml-cols;"
+    </dtml-if>
+              rows="&dtml-rows;"><dtml-var __str__ html_quote></textarea>
+    </dtml-let>
+    </div>
+    </td>
+  </tr>
   <dtml-else>
-  <textarea name="filedata:text" wrap="off" cols="&dtml-cols;"
+  <tr>
+    <td align="left" valign="top">
+    <div class="form-label">
+    Last Modified
+    </div>
+    </td>
+    <td align="left" valign="top">
+    <div class="form-text">
+    <dtml-var bobobase_modification_time fmt="%Y-%m-%d %H:%M">
+    </div>
+    </td>
+  </tr>
+  <tr>
+    <td align="left" valign="top">
+    <div class="form-label">
+    File Size
+    </div>
+    </td>
+    <td align="left" valign="top">
+    <div class="form-text">
+    <dtml-var size thousands_commas> bytes
+    </div>
+    </td>
+  </tr>
   </dtml-if>
-            rows="&dtml-rows;"><dtml-var __str__ html_quote></textarea>
-  </dtml-let>
-  </div>
-  </td>
-</tr>
-<dtml-else>
-<tr>
-  <td align="left" valign="top">
-  <div class="form-label">
-  Last Modified
-  </div>
-  </td>
-  <td align="left" valign="top">
-  <div class="form-text">
-  <dtml-var bobobase_modification_time fmt="%Y-%m-%d %H:%M">
-  </div>
-  </td>
-</tr>
-<tr>
-  <td align="left" valign="top">
-  <div class="form-label">
-  File Size
-  </div>
-  </td>
-  <td align="left" valign="top">
-  <div class="form-text">
-  <dtml-var size thousands_commas> bytes
-  </div>
-  </td>
-</tr>
-</dtml-if>
+</dtml-let>
 
 <tr>
   <td></td>



More information about the Zope-Checkins mailing list