[Zope3-checkins] SVN: zope.formlib/trunk/ fix typo

Fred L. Drake, Jr. fdrake at gmail.com
Tue Aug 16 16:17:40 EDT 2005


Log message for revision 37968:
  fix typo

Changed:
  U   zope.formlib/trunk/README.txt
  U   zope.formlib/trunk/src/zope/formlib/pageform.pt
  U   zope.formlib/trunk/src/zope/formlib/subpageform.pt

-=-
Modified: zope.formlib/trunk/README.txt
===================================================================
--- zope.formlib/trunk/README.txt	2005-08-16 20:01:48 UTC (rev 37967)
+++ zope.formlib/trunk/README.txt	2005-08-16 20:17:40 UTC (rev 37968)
@@ -4,6 +4,6 @@
 This project provides a set of modules for defining pages and forms
 with Python code (as opposed to ZCML).  The project provides the
 zope.formlib package.  The formlib package depends on zope.app and
-this needs proetty much a full application server to be tested and
+this needs pretty much a full application server to be tested and
 used.   To use the package, check out, copy, or link (via svn
 externals) the formlib package into a zope package.

Modified: zope.formlib/trunk/src/zope/formlib/pageform.pt
===================================================================
--- zope.formlib/trunk/src/zope/formlib/pageform.pt	2005-08-16 20:01:48 UTC (rev 37967)
+++ zope.formlib/trunk/src/zope/formlib/pageform.pt	2005-08-16 20:17:40 UTC (rev 37968)
@@ -16,26 +16,15 @@
 <script type="text/javascript"><!--
 
 function toggleFormFieldHelp(ob,state) {
-  ob = ob.nextSibling;
-  while (ob && ob.className != 'field') {
-    ob = ob.nextSibling;
+  // ob is the label element
+  var field = ob.form[ob.htmlFor];
+  if (field) {
+    field.style.visibility = state && 'hidden' || 'visible';
+    var help = document.getElementById("field-help-for-" + field.name);
+    if (help) {
+      help.style.visibility = state && 'visible' || 'hidden';
+    }
   }
-  var td = ob;
-
-  ob = ob.firstChild;
-  while (ob && ob.className != 'form-fields-help')
-    ob = ob.nextSibling;
-  if (ob) {
-    ob.style.visibility = state && 'visible' || 'hidden';
-  }
-
-  ob = td.firstChild;
-  while (ob && ob.className != 'widget') {
-    ob = ob.nextSibling;
-  }
-  if (ob) {
-    ob.style.visibility = state && 'hidden' || 'visible';
-  }
 }
 
 //-->
@@ -105,6 +94,7 @@
                i18n:translate=""
                tal:content="hint"
                tal:condition="hint"
+               tal:attributes="id string:field-help-for-${widget/name}"
                onclick="this.style.visibility='hidden';"
                >Title of this content object.</div>
           <div class="widget" tal:content="structure widget">

Modified: zope.formlib/trunk/src/zope/formlib/subpageform.pt
===================================================================
--- zope.formlib/trunk/src/zope/formlib/subpageform.pt	2005-08-16 20:01:48 UTC (rev 37967)
+++ zope.formlib/trunk/src/zope/formlib/subpageform.pt	2005-08-16 20:17:40 UTC (rev 37968)
@@ -4,26 +4,15 @@
 <script type="text/javascript"><!--
 
 function toggleFormFieldHelp(ob,state) {
-  ob = ob.nextSibling;
-  while (ob && ob.className != 'field') {
-    ob = ob.nextSibling;
+  // ob is the label element
+  var field = ob.form[ob.htmlFor];
+  if (field) {
+    field.style.visibility = state && 'hidden' || 'visible';
+    var help = document.getElementById("field-help-for-" + field.name);
+    if (help) {
+      help.style.visibility = state && 'visible' || 'hidden';
+    }
   }
-  var td = ob;
-
-  ob = ob.firstChild;
-  while (ob && ob.className != 'form-fields-help')
-    ob = ob.nextSibling;
-  if (ob) {
-    ob.style.visibility = state && 'visible' || 'hidden';
-  }
-
-  ob = td.firstChild;
-  while (ob && ob.className != 'widget') {
-    ob = ob.nextSibling;
-  }
-  if (ob) {
-    ob.style.visibility = state && 'hidden' || 'visible';
-  }
 }
 
 //-->
@@ -94,6 +83,7 @@
           <div class="form-fields-help"
                tal:content="hint"
                tal:condition="hint"
+               tal:attributes="id string:field-help-for-${widget/name}"
                onclick="this.style.visibility='hidden';"
                i18n:translate="" 
                >Title of this content object.</div>



More information about the Zope3-Checkins mailing list