[Zope-Checkins] CVS: Zope/lib/python/OFS/dtml -
cmassoc.dtml:1.4.136.1
Tres Seaver
tseaver at zope.com
Wed May 19 18:54:19 EDT 2004
Update of /cvs-repository/Zope/lib/python/OFS/dtml
In directory cvs.zope.org:/tmp/cvs-serv21096/lib/python/OFS/dtml
Modified Files:
Tag: tseaver-collector_911-branch
cmassoc.dtml
Log Message:
- Initial pass at merging leper's changes from Collector #911.
=== Zope/lib/python/OFS/dtml/cmassoc.dtml 1.4 => 1.4.136.1 ===
--- Zope/lib/python/OFS/dtml/cmassoc.dtml:1.4 Wed Apr 3 12:41:04 2002
+++ Zope/lib/python/OFS/dtml/cmassoc.dtml Wed May 19 18:53:48 2004
@@ -1,31 +1,6 @@
<dtml-var manage_page_header>
<dtml-var manage_tabs>
-<script type="text/javascript">
-<!--
-
-isSelected = false;
-
-function toggleSelect() {
- if (isSelected == false) {
- for (i = 0; i < document.objectItems.length; i++)
- document.objectItems.elements[i].checked = true ;
- isSelected = true;
- document.objectItems.selectButton.value = "Deselect All";
- return isSelected;
- }
- else {
- for (i = 0; i < document.objectItems.length; i++)
- document.objectItems.elements[i].checked = false ;
- isSelected = false;
- document.objectItems.selectButton.value = "Select All";
- return isSelected;
- }
-}
-
-//-->
-</script>
-
<form action="&dtml-URL1;" name="objectItems" method="POST">
<dtml-if show_results>
@@ -66,16 +41,24 @@
value="Save Changes">
<script type="text/javascript">
<!--
-if (document.forms[0]) {
- document.write('<input class="form-element" type="submit" name="selectButton" value="Select All" onClick="toggleSelect(); return false">')
- }
+var ALL = false;
+var associate = /^associate_/;
+function toggleSelect() {
+ ALL = !ALL;
+ for (var i = 0; i < document.objectItems.length; i++)
+ if (document.objectItems.elements[i].type == "checkbox" &&
+ associate.test(document.objectItems.elements[i].name))
+ document.objectItems.elements[i].checked = ALL;
+ document.objectItems.selectButton.value = ALL ? "Deselect All" : "Select All";
+}
+document.write('<input type="submit" name="selectButton" value="Select All"');
+document.write(' onClick="toggleSelect();return false" />\n')
//-->
</script>
</div>
</td>
</tr>
</table>
-</form>
<dtml-else>
<p class="form-text">
@@ -85,7 +68,6 @@
<hr>
</dtml-if>
-<form target="&dtml-URL1;" method="post">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
@@ -144,4 +126,3 @@
</form>
<dtml-var manage_page_footer>
-
More information about the Zope-Checkins
mailing list