Fossil SCM
first attempt at client-side file-list filtering
Commit
e44de4cc841b9cdc00828bedbfca30bcfacf56b1
Parent
6e29ebbb77ebbdd…
2 files changed
+12
-4
+2
-2
+12
-4
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -704,15 +704,15 @@ | ||
| 704 | 704 | }else{ |
| 705 | 705 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 706 | 706 | @ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname)) |
| 707 | 707 | } |
| 708 | 708 | if( useMtime ){ |
| 709 | - @ sorted by modification time</h2> | |
| 709 | + @ sorted by modification time | |
| 710 | 710 | }else{ |
| 711 | - @ sorted by filename</h2> | |
| 711 | + @ sorted by filename | |
| 712 | 712 | } |
| 713 | - | |
| 713 | + @ <input id="filter_text" onInput="filter_list(this.value)" style="float:right" /></h2> | |
| 714 | 714 | |
| 715 | 715 | /* Generate tree of lists. |
| 716 | 716 | ** |
| 717 | 717 | ** Each file and directory is a list element: <li>. Files have class=file |
| 718 | 718 | ** and if the filename as the suffix "xyz" the file also has class=file-xyz. |
| @@ -721,11 +721,11 @@ | ||
| 721 | 721 | ** adds class=subdir. |
| 722 | 722 | ** |
| 723 | 723 | ** The <li> element for directories also contains a sublist <ul> |
| 724 | 724 | ** for the contents of that directory. |
| 725 | 725 | */ |
| 726 | - @ <div class="filetree"><ul> | |
| 726 | + @ <div class="filetree" id="filetreeroot"><ul> | |
| 727 | 727 | if( nD ){ |
| 728 | 728 | @ <li class="dir last"> |
| 729 | 729 | }else{ |
| 730 | 730 | @ <li class="dir subdir last"> |
| 731 | 731 | } |
| @@ -851,10 +851,18 @@ | ||
| 851 | 851 | @ if( !ul ) return true; /* This is a file link, not a directory */ |
| 852 | 852 | @ toggleDir(ul); |
| 853 | 853 | @ return false; |
| 854 | 854 | @ } |
| 855 | 855 | @ }())</script> |
| 856 | + @ <script>function filter_list(t){ | |
| 857 | + @ var root = gebi('filetreeroot'); | |
| 858 | + @ var links = root.querySelectorAll(".file a") | |
| 859 | + @ for(var i = 0; i < links.length; i++){ | |
| 860 | + @ var a = links[i]; | |
| 861 | + @ a.parentNode.parentNode.hidden = (a.innerHTML.lastIndexOf(t) == -1) | |
| 862 | + @ } | |
| 863 | + @ }</script> | |
| 856 | 864 | style_footer(); |
| 857 | 865 | |
| 858 | 866 | /* We could free memory used by sTree here if we needed to. But |
| 859 | 867 | ** the process is about to exit, so doing so would not really accomplish |
| 860 | 868 | ** anything useful. */ |
| 861 | 869 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -704,15 +704,15 @@ | |
| 704 | }else{ |
| 705 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 706 | @ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname)) |
| 707 | } |
| 708 | if( useMtime ){ |
| 709 | @ sorted by modification time</h2> |
| 710 | }else{ |
| 711 | @ sorted by filename</h2> |
| 712 | } |
| 713 | |
| 714 | |
| 715 | /* Generate tree of lists. |
| 716 | ** |
| 717 | ** Each file and directory is a list element: <li>. Files have class=file |
| 718 | ** and if the filename as the suffix "xyz" the file also has class=file-xyz. |
| @@ -721,11 +721,11 @@ | |
| 721 | ** adds class=subdir. |
| 722 | ** |
| 723 | ** The <li> element for directories also contains a sublist <ul> |
| 724 | ** for the contents of that directory. |
| 725 | */ |
| 726 | @ <div class="filetree"><ul> |
| 727 | if( nD ){ |
| 728 | @ <li class="dir last"> |
| 729 | }else{ |
| 730 | @ <li class="dir subdir last"> |
| 731 | } |
| @@ -851,10 +851,18 @@ | |
| 851 | @ if( !ul ) return true; /* This is a file link, not a directory */ |
| 852 | @ toggleDir(ul); |
| 853 | @ return false; |
| 854 | @ } |
| 855 | @ }())</script> |
| 856 | style_footer(); |
| 857 | |
| 858 | /* We could free memory used by sTree here if we needed to. But |
| 859 | ** the process is about to exit, so doing so would not really accomplish |
| 860 | ** anything useful. */ |
| 861 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -704,15 +704,15 @@ | |
| 704 | }else{ |
| 705 | int n = db_int(0, "SELECT count(*) FROM plink"); |
| 706 | @ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname)) |
| 707 | } |
| 708 | if( useMtime ){ |
| 709 | @ sorted by modification time |
| 710 | }else{ |
| 711 | @ sorted by filename |
| 712 | } |
| 713 | @ <input id="filter_text" onInput="filter_list(this.value)" style="float:right" /></h2> |
| 714 | |
| 715 | /* Generate tree of lists. |
| 716 | ** |
| 717 | ** Each file and directory is a list element: <li>. Files have class=file |
| 718 | ** and if the filename as the suffix "xyz" the file also has class=file-xyz. |
| @@ -721,11 +721,11 @@ | |
| 721 | ** adds class=subdir. |
| 722 | ** |
| 723 | ** The <li> element for directories also contains a sublist <ul> |
| 724 | ** for the contents of that directory. |
| 725 | */ |
| 726 | @ <div class="filetree" id="filetreeroot"><ul> |
| 727 | if( nD ){ |
| 728 | @ <li class="dir last"> |
| 729 | }else{ |
| 730 | @ <li class="dir subdir last"> |
| 731 | } |
| @@ -851,10 +851,18 @@ | |
| 851 | @ if( !ul ) return true; /* This is a file link, not a directory */ |
| 852 | @ toggleDir(ul); |
| 853 | @ return false; |
| 854 | @ } |
| 855 | @ }())</script> |
| 856 | @ <script>function filter_list(t){ |
| 857 | @ var root = gebi('filetreeroot'); |
| 858 | @ var links = root.querySelectorAll(".file a") |
| 859 | @ for(var i = 0; i < links.length; i++){ |
| 860 | @ var a = links[i]; |
| 861 | @ a.parentNode.parentNode.hidden = (a.innerHTML.lastIndexOf(t) == -1) |
| 862 | @ } |
| 863 | @ }</script> |
| 864 | style_footer(); |
| 865 | |
| 866 | /* We could free memory used by sTree here if we needed to. But |
| 867 | ** the process is about to exit, so doing so would not really accomplish |
| 868 | ** anything useful. */ |
| 869 |
+2
-2
| --- src/schema.c | ||
| +++ src/schema.c | ||
| @@ -449,12 +449,12 @@ | ||
| 449 | 449 | #if EXPORT_INTERFACE |
| 450 | 450 | # define MAX_INT_TAG 16 /* The largest pre-assigned tag id */ |
| 451 | 451 | #endif |
| 452 | 452 | |
| 453 | 453 | /* |
| 454 | -** The schema for the locate FOSSIL database file found at the root | |
| 455 | -** of very check-out. This database contains the complete state of | |
| 454 | +** The schema for the local FOSSIL database file found at the root | |
| 455 | +** of every check-out. This database contains the complete state of | |
| 456 | 456 | ** the checkout. |
| 457 | 457 | */ |
| 458 | 458 | const char zLocalSchema[] = |
| 459 | 459 | @ -- The VVAR table holds miscellanous information about the local database |
| 460 | 460 | @ -- in the form of name-value pairs. This is similar to the VAR table |
| 461 | 461 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -449,12 +449,12 @@ | |
| 449 | #if EXPORT_INTERFACE |
| 450 | # define MAX_INT_TAG 16 /* The largest pre-assigned tag id */ |
| 451 | #endif |
| 452 | |
| 453 | /* |
| 454 | ** The schema for the locate FOSSIL database file found at the root |
| 455 | ** of very check-out. This database contains the complete state of |
| 456 | ** the checkout. |
| 457 | */ |
| 458 | const char zLocalSchema[] = |
| 459 | @ -- The VVAR table holds miscellanous information about the local database |
| 460 | @ -- in the form of name-value pairs. This is similar to the VAR table |
| 461 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -449,12 +449,12 @@ | |
| 449 | #if EXPORT_INTERFACE |
| 450 | # define MAX_INT_TAG 16 /* The largest pre-assigned tag id */ |
| 451 | #endif |
| 452 | |
| 453 | /* |
| 454 | ** The schema for the local FOSSIL database file found at the root |
| 455 | ** of every check-out. This database contains the complete state of |
| 456 | ** the checkout. |
| 457 | */ |
| 458 | const char zLocalSchema[] = |
| 459 | @ -- The VVAR table holds miscellanous information about the local database |
| 460 | @ -- in the form of name-value pairs. This is similar to the VAR table |
| 461 |