[Zope-Checkins] CVS: Zope/lib/python/OFS/dtml - cmassoc.dtml:1.3.148.1
Jens Vagelpohl
jens@zope.com
Wed, 3 Apr 2002 12:05:49 -0500
Update of /cvs-repository/Zope/lib/python/OFS/dtml
In directory cvs.zope.org:/tmp/cvs-serv23555
Modified Files:
Tag: Zope-2_5-branch
cmassoc.dtml
Log Message:
Adding a "select all" or "deselect all" button to the "Associate" tab,
just like in the folder contents view.
=== Zope/lib/python/OFS/dtml/cmassoc.dtml 1.3 => 1.3.148.1 ===
<dtml-var manage_tabs>
-<form action="&dtml-URL1;" method="POST">
+<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>
<dtml-if results>
@@ -39,10 +64,18 @@
<div class="form-element">
<input type="submit" name="ZCacheManager_setAssociations:method"
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">')
+ }
+//-->
+</script>
</div>
</td>
</tr>
</table>
+</form>
<dtml-else>
<p class="form-text">
@@ -52,6 +85,7 @@
<hr>
</dtml-if>
+<form target="&dtml-URL1;" method="post">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">