Index: openacs-4/packages/xowiki/www/resources/selection-area.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/Attic/selection-area.js,v diff -u -N -r1.1.2.5 -r1.1.2.6 --- openacs-4/packages/xowiki/www/resources/selection-area.js 18 Oct 2022 12:58:57 -0000 1.1.2.5 +++ openacs-4/packages/xowiki/www/resources/selection-area.js 25 Oct 2022 11:10:00 -0000 1.1.2.6 @@ -63,6 +63,8 @@ } textarea.value = internalRep; + + selection_area_update_count_information(id); } function selection_area_bulk_operation_handler(ev, operation) { @@ -87,6 +89,20 @@ selection_area_update_internal_representation(id); } +function selection_area_update_count_information(id) { + // Update the count information for the listings + for (var element of ['candidates', 'selected']) { + // get the list elements + var list_elements = document.getElementById(id + '.' + element).getElementsByTagName('LI'); + + // get the list header element + var list_header = document.getElementById(id).getElementsByClassName('workarea ' + element)[0].getElementsByTagName('H3')[0]; + + // replace the count information e.g. "Selection (0)" -> "Selection (1)" + list_header.innerHTML = list_header.innerHTML.replace(/\(.*\)/,'(' + list_elements.length + ')'); + } +} + /* * Local variables: * mode: JavaScript