[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ Introduce a master
checkbox to the ZMI that toggles all other check boxes from a
folder listing.
Florian Lindner
Florian.Lindner at xgm.de
Thu Feb 1 05:51:11 EST 2007
Log message for revision 72287:
Introduce a master checkbox to the ZMI that toggles all other check boxes from a folder listing.
Changed:
U Zope3/trunk/src/zope/app/container/browser/contents.pt
U Zope3/trunk/src/zope/app/rotterdam/zope3.js
-=-
Modified: Zope3/trunk/src/zope/app/container/browser/contents.pt
===================================================================
--- Zope3/trunk/src/zope/app/container/browser/contents.pt 2007-02-01 10:45:13 UTC (rev 72286)
+++ Zope3/trunk/src/zope/app/container/browser/contents.pt 2007-02-01 10:51:10 UTC (rev 72287)
@@ -29,7 +29,7 @@
<thead>
<tr>
- <th> </th>
+ <th><input type="checkbox" onchange="updateCheckboxes(this, 'slaveBox');" /></th>
<th i18n:translate="">Name</th>
<th i18n:translate="">Title</th>
<th i18n:translate="">Size</th>
@@ -57,7 +57,7 @@
id_quoted item/id/url:quote"
tal:attributes="class python:oddrow and 'even' or 'odd'" >
<td>
- <input type="checkbox" class="noborder" name="ids:list" id="#"
+ <input type="checkbox" class="noborder slaveBox" name="ids:list" id="#"
value="#"
tal:attributes="value item/id;
id item/cb_id;
Modified: Zope3/trunk/src/zope/app/rotterdam/zope3.js
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/zope3.js 2007-02-01 10:45:13 UTC (rev 72286)
+++ Zope3/trunk/src/zope/app/rotterdam/zope3.js 2007-02-01 10:51:10 UTC (rev 72287)
@@ -64,3 +64,18 @@
}
}
}
+
+
+//----------------------------------------------------------------------------
+// toggle the status of all checkboxes that have class = "className"
+//----------------------------------------------------------------------------
+function updateCheckboxes(master, className) {
+ newState = master.checked;
+ objects = document.getElementsByTagName("input")
+ count = objects.length;
+ for(x = 0; x < count; x++) {
+ obj = objects[x];
+ if ((obj.type == "checkbox") && (obj.className.indexOf(className) != -1 ))
+ obj.checked = newState;
+ }
+}
More information about the Zope3-Checkins
mailing list