Fossil SCM

renamed the marking class to filterable as suggested by [forum:/forumpost/9c804128d3|forum post]

jkosche 2025-05-10 18:17 quickfilter
Commit 2f0cb4659374a98fb3f8fa88b34278dddef15c95f72dd3060b007966a73825bb
--- src/quickfilter.js
+++ src/quickfilter.js
@@ -1,21 +1,21 @@
11
/* Javascript code that will enable quick filtering of items in tables.
22
**
33
** Add an input field with the id 'quickfilter' as follows:
44
** <input type="text" id="quickfilter" placeholder="filter list...">
5
-** Mark the table with the filter items with the class 'filterlist'.
5
+** Mark the table with the filter items with the class 'filterable'.
66
** The table is expected to have a tbody around the rows that are
77
** filtered (to avoid filtering the header).
88
**
99
** The user can type to filter the table for elements matching the typed text.
1010
*/
1111
1212
quickfilter.addEventListener('input', function(){
1313
const quickfilter = document.getElementById('quickfilter');
14
- const filterlist = document.querySelectorAll('.filterlist tbody tr');
14
+ const filterrows = document.querySelectorAll('.filterable tbody tr');
1515
const filter = quickfilter.value.toLowerCase().trim();
16
- for(row of filterlist){
16
+ for(row of filterrows){
1717
const orig = row.innerHTML;
1818
const cleaned = orig.replaceAll("<mark>", "").replaceAll("</mark>", "");
1919
if(filter===''){
2020
row.innerHTML = cleaned;
2121
row.style.display = 'table-row';
2222
--- src/quickfilter.js
+++ src/quickfilter.js
@@ -1,21 +1,21 @@
1 /* Javascript code that will enable quick filtering of items in tables.
2 **
3 ** Add an input field with the id 'quickfilter' as follows:
4 ** <input type="text" id="quickfilter" placeholder="filter list...">
5 ** Mark the table with the filter items with the class 'filterlist'.
6 ** The table is expected to have a tbody around the rows that are
7 ** filtered (to avoid filtering the header).
8 **
9 ** The user can type to filter the table for elements matching the typed text.
10 */
11
12 quickfilter.addEventListener('input', function(){
13 const quickfilter = document.getElementById('quickfilter');
14 const filterlist = document.querySelectorAll('.filterlist tbody tr');
15 const filter = quickfilter.value.toLowerCase().trim();
16 for(row of filterlist){
17 const orig = row.innerHTML;
18 const cleaned = orig.replaceAll("<mark>", "").replaceAll("</mark>", "");
19 if(filter===''){
20 row.innerHTML = cleaned;
21 row.style.display = 'table-row';
22
--- src/quickfilter.js
+++ src/quickfilter.js
@@ -1,21 +1,21 @@
1 /* Javascript code that will enable quick filtering of items in tables.
2 **
3 ** Add an input field with the id 'quickfilter' as follows:
4 ** <input type="text" id="quickfilter" placeholder="filter list...">
5 ** Mark the table with the filter items with the class 'filterable'.
6 ** The table is expected to have a tbody around the rows that are
7 ** filtered (to avoid filtering the header).
8 **
9 ** The user can type to filter the table for elements matching the typed text.
10 */
11
12 quickfilter.addEventListener('input', function(){
13 const quickfilter = document.getElementById('quickfilter');
14 const filterrows = document.querySelectorAll('.filterable tbody tr');
15 const filter = quickfilter.value.toLowerCase().trim();
16 for(row of filterrows){
17 const orig = row.innerHTML;
18 const cleaned = orig.replaceAll("<mark>", "").replaceAll("</mark>", "");
19 if(filter===''){
20 row.innerHTML = cleaned;
21 row.style.display = 'table-row';
22
+1 -1
--- src/repolist.c
+++ src/repolist.c
@@ -221,11 +221,11 @@
221221
zType[nType++] = 'x'; /* space before login-group */
222222
zType[nType++] = 't'; /* Login Group */
223223
}
224224
zType[nType] = 0;
225225
blob_appendf(&html,
226
- "<table border='0' class='sortable filterlist' data-init-sort='1'"
226
+ "<table border='0' class='sortable filterable' data-init-sort='1'"
227227
" data-column-types='%s' cellspacing='0' cellpadding='0'><thead>\n"
228228
"<tr><th>Filename</th><th>&emsp;</th>\n"
229229
"<th%s><nobr>Project Name</nobr></th>\n",
230230
zType, (bShowDesc ? " width='25%'" : ""));
231231
if( bShowDesc ){
232232
--- src/repolist.c
+++ src/repolist.c
@@ -221,11 +221,11 @@
221 zType[nType++] = 'x'; /* space before login-group */
222 zType[nType++] = 't'; /* Login Group */
223 }
224 zType[nType] = 0;
225 blob_appendf(&html,
226 "<table border='0' class='sortable filterlist' data-init-sort='1'"
227 " data-column-types='%s' cellspacing='0' cellpadding='0'><thead>\n"
228 "<tr><th>Filename</th><th>&emsp;</th>\n"
229 "<th%s><nobr>Project Name</nobr></th>\n",
230 zType, (bShowDesc ? " width='25%'" : ""));
231 if( bShowDesc ){
232
--- src/repolist.c
+++ src/repolist.c
@@ -221,11 +221,11 @@
221 zType[nType++] = 'x'; /* space before login-group */
222 zType[nType++] = 't'; /* Login Group */
223 }
224 zType[nType] = 0;
225 blob_appendf(&html,
226 "<table border='0' class='sortable filterable' data-init-sort='1'"
227 " data-column-types='%s' cellspacing='0' cellpadding='0'><thead>\n"
228 "<tr><th>Filename</th><th>&emsp;</th>\n"
229 "<th%s><nobr>Project Name</nobr></th>\n",
230 zType, (bShowDesc ? " width='25%'" : ""));
231 if( bShowDesc ){
232
+1 -1
--- src/report.c
+++ src/report.c
@@ -1235,11 +1235,11 @@
12351235
output_color_key(zClrKey, 1,
12361236
"border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
12371237
if( quickfilter ){
12381238
@ <input type="search" id="quickfilter" placeholder="filter ticket list...">
12391239
}
1240
- @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable filterlist"
1240
+ @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable filterable"
12411241
@ data-column-types='' data-init-sort='0'>
12421242
sState.rn = rn;
12431243
sState.nCount = 0;
12441244
report_restrict_sql(&zErr1);
12451245
db_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2);
12461246
--- src/report.c
+++ src/report.c
@@ -1235,11 +1235,11 @@
1235 output_color_key(zClrKey, 1,
1236 "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
1237 if( quickfilter ){
1238 @ <input type="search" id="quickfilter" placeholder="filter ticket list...">
1239 }
1240 @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable filterlist"
1241 @ data-column-types='' data-init-sort='0'>
1242 sState.rn = rn;
1243 sState.nCount = 0;
1244 report_restrict_sql(&zErr1);
1245 db_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2);
1246
--- src/report.c
+++ src/report.c
@@ -1235,11 +1235,11 @@
1235 output_color_key(zClrKey, 1,
1236 "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
1237 if( quickfilter ){
1238 @ <input type="search" id="quickfilter" placeholder="filter ticket list...">
1239 }
1240 @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable filterable"
1241 @ data-column-types='' data-init-sort='0'>
1242 sState.rn = rn;
1243 sState.nCount = 0;
1244 report_restrict_sql(&zErr1);
1245 db_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2);
1246

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button