[Bps-public-commit] rt-extension-spamfilter branch add-checkbox-selection updated. abf63551071ed6322c8af8c22aff1e8b59ee5c15
BPS Git Server
git at git.bestpractical.com
Fri Jul 7 19:51:35 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-spamfilter".
The branch, add-checkbox-selection has been updated
via abf63551071ed6322c8af8c22aff1e8b59ee5c15 (commit)
from 27717d5461b9ae3aabf5475516a3dcba385ea114 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit abf63551071ed6322c8af8c22aff1e8b59ee5c15
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date: Fri Jul 7 16:49:44 2023 -0300
Implement multiple selection of checkboxes holding shift key
Improve the selection of large number of Tickets/Messages by holding
shift key and clicking on the checkbox.
diff --git a/html/Tools/SpamFilter/List.html b/html/Tools/SpamFilter/List.html
index cbf32c3..2468ffe 100644
--- a/html/Tools/SpamFilter/List.html
+++ b/html/Tools/SpamFilter/List.html
@@ -47,7 +47,12 @@
%# END BPS TAGGED BLOCK }}}
<& /Elements/Header, Title => $title &>
<& /Elements/Tabs &>
-
+<style type="text/css">
+ /* allow multiple checkboxes to be checked holding shift key*/
+ .checkbox {
+ z-index: 1;
+ }
+</style>
<script type="text/javascript">
jQuery( function() {
jQuery('#not_spam_all').change( function () {
@@ -85,6 +90,39 @@
}
}
});
+ // Enable shift selection of checkboxes
+ lastReleaseSelected = null;
+ lastDeleteSelected = null;
+ ReleaseCheckboxes = jQuery('input.not_spam');
+ DeleteCheckboxes = jQuery('input.discard');
+ jQuery('input.not_spam,input.discard').click( function (e) {
+ console.log("logie");
+ // get id and split it
+ var id = this.id.split('-');
+ if (id[0] == 'Release') {
+ if (!lastReleaseSelected) {
+ lastReleaseSelected = this;
+ return;
+ }
+ if (e.shiftKey) {
+ var start = ReleaseCheckboxes.index(this);
+ var end = ReleaseCheckboxes.index(lastReleaseSelected);
+ ReleaseCheckboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).prop('checked', lastReleaseSelected.checked).change();
+ }
+ lastReleaseSelected = this;
+ } else {
+ if (!lastDeleteSelected) {
+ lastDeleteSelected = this;
+ return;
+ }
+ if (e.shiftKey) {
+ var start = DeleteCheckboxes.index(this);
+ var end = DeleteCheckboxes.index(lastDeleteSelected);
+ DeleteCheckboxes.slice(Math.min(start,end), Math.max(start,end)+ 1).prop('checked', lastDeleteSelected.checked).change();
+ }
+ lastDeleteSelected = this;
+ }
+ });
});
</script>
-----------------------------------------------------------------------
Summary of changes:
html/Tools/SpamFilter/List.html | 40 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
hooks/post-receive
--
rt-extension-spamfilter
More information about the Bps-public-commit
mailing list