Fossil SCM
renamed the marking class to filterable as suggested by [forum:/forumpost/9c804128d3|forum post]
Commit
2f0cb4659374a98fb3f8fa88b34278dddef15c95f72dd3060b007966a73825bb
Parent
f98be00db07d3b0…
3 files changed
+3
-3
+1
-1
+1
-1
+3
-3
| --- src/quickfilter.js | ||
| +++ src/quickfilter.js | ||
| @@ -1,21 +1,21 @@ | ||
| 1 | 1 | /* Javascript code that will enable quick filtering of items in tables. |
| 2 | 2 | ** |
| 3 | 3 | ** Add an input field with the id 'quickfilter' as follows: |
| 4 | 4 | ** <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'. | |
| 6 | 6 | ** The table is expected to have a tbody around the rows that are |
| 7 | 7 | ** filtered (to avoid filtering the header). |
| 8 | 8 | ** |
| 9 | 9 | ** The user can type to filter the table for elements matching the typed text. |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | quickfilter.addEventListener('input', function(){ |
| 13 | 13 | const quickfilter = document.getElementById('quickfilter'); |
| 14 | - const filterlist = document.querySelectorAll('.filterlist tbody tr'); | |
| 14 | + const filterrows = document.querySelectorAll('.filterable tbody tr'); | |
| 15 | 15 | const filter = quickfilter.value.toLowerCase().trim(); |
| 16 | - for(row of filterlist){ | |
| 16 | + for(row of filterrows){ | |
| 17 | 17 | const orig = row.innerHTML; |
| 18 | 18 | const cleaned = orig.replaceAll("<mark>", "").replaceAll("</mark>", ""); |
| 19 | 19 | if(filter===''){ |
| 20 | 20 | row.innerHTML = cleaned; |
| 21 | 21 | row.style.display = 'table-row'; |
| 22 | 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 '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 @@ | ||
| 221 | 221 | zType[nType++] = 'x'; /* space before login-group */ |
| 222 | 222 | zType[nType++] = 't'; /* Login Group */ |
| 223 | 223 | } |
| 224 | 224 | zType[nType] = 0; |
| 225 | 225 | 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'" | |
| 227 | 227 | " data-column-types='%s' cellspacing='0' cellpadding='0'><thead>\n" |
| 228 | 228 | "<tr><th>Filename</th><th> </th>\n" |
| 229 | 229 | "<th%s><nobr>Project Name</nobr></th>\n", |
| 230 | 230 | zType, (bShowDesc ? " width='25%'" : "")); |
| 231 | 231 | if( bShowDesc ){ |
| 232 | 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 filterlist' data-init-sort='1'" |
| 227 | " data-column-types='%s' cellspacing='0' cellpadding='0'><thead>\n" |
| 228 | "<tr><th>Filename</th><th> </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> </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 @@ | ||
| 1235 | 1235 | output_color_key(zClrKey, 1, |
| 1236 | 1236 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 1237 | 1237 | if( quickfilter ){ |
| 1238 | 1238 | @ <input type="search" id="quickfilter" placeholder="filter ticket list..."> |
| 1239 | 1239 | } |
| 1240 | - @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable filterlist" | |
| 1240 | + @ <table border="1" cellpadding="2" cellspacing="0" class="report sortable filterable" | |
| 1241 | 1241 | @ data-column-types='' data-init-sort='0'> |
| 1242 | 1242 | sState.rn = rn; |
| 1243 | 1243 | sState.nCount = 0; |
| 1244 | 1244 | report_restrict_sql(&zErr1); |
| 1245 | 1245 | db_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2); |
| 1246 | 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 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 |