[Zope-Checkins] CVS: Zope/lib/python/OFS - DTMLDocument.py:1.49 DTMLMethod.py:1.81

Andreas Jung andreas@andreas-jung.com
Sun, 6 Jul 2003 06:44:25 -0400


Update of /cvs-repository/Zope/lib/python/OFS
In directory cvs.zope.org:/tmp/cvs-serv8091/lib/python/OFS

Modified Files:
	DTMLDocument.py DTMLMethod.py 
Log Message:
     - Collector #628: Applied patch to fix several textarea resize
       problems.


=== Zope/lib/python/OFS/DTMLDocument.py 1.48 => 1.49 ===
--- Zope/lib/python/OFS/DTMLDocument.py:1.48	Wed Aug 14 17:42:56 2002
+++ Zope/lib/python/OFS/DTMLDocument.py	Sun Jul  6 06:43:49 2003
@@ -55,7 +55,7 @@
          ),
         )
 
-    def manage_edit(self,data,title,SUBMIT='Change',dtpref_cols='50',
+    def manage_edit(self,data,title,SUBMIT='Change',dtpref_cols='100%',
                     dtpref_rows='20',REQUEST=None):
         """
         Replaces a Documents contents with Data, Title with Title.


=== Zope/lib/python/OFS/DTMLMethod.py 1.80 => 1.81 ===
--- Zope/lib/python/OFS/DTMLMethod.py:1.80	Wed Sep 25 08:39:49 2002
+++ Zope/lib/python/OFS/DTMLMethod.py	Sun Jul  6 06:43:49 2003
@@ -220,21 +220,19 @@
 
     def _er(self,data,title,SUBMIT,dtpref_cols,dtpref_rows,REQUEST):
         dr,dc = self._size_changes[SUBMIT]
-
-        rows=str(max(1,int(dtpref_rows)+dr))
-
-        if dtpref_cols[-1]=='%':
-            cols= str(min(100, max(25,int(dtpref_cols[:-1])+dc)))+'%'
+        rows = str(max(1, int(dtpref_rows) + dr))
+        cols = str(dtpref_cols)
+        if cols.endswith('%'):
+           cols = str(min(100, max(25, int(cols[:-1]) + dc))) + '%'
         else:
-            cols=str(max(35,int(dtpref_cols)+dc))
-
-        e=(DateTime('GMT') + 365).rfc822()
-        resp=REQUEST['RESPONSE']
-        resp.setCookie('dtpref_rows',str(rows),path='/',expires=e)
-        resp.setCookie('dtpref_cols',str(cols),path='/',expires=e)
-        return self.manage_main(
-            self,REQUEST,title=title,__str__=self.quotedHTML(data),
-            dtpref_cols=cols,dtpref_rows=rows)
+           cols = str(max(35, int(cols) + dc))
+        e = (DateTime("GMT") + 365).rfc822()
+        setCookie = REQUEST["RESPONSE"].setCookie
+        setCookie("dtpref_rows", rows, path='/', expires=e)
+        setCookie("dtpref_cols", cols, path='/', expires=e)
+        REQUEST.other.update({"dtpref_cols":cols, "dtpref_rows":rows})
+        return self.manage_main(self, REQUEST, title=title,
+                                __str__=self.quotedHTML(data))
 
     def manage_edit(self,data,title,SUBMIT='Change',dtpref_cols='100%',
                     dtpref_rows='20',REQUEST=None):