Fossil SCM

first attempt at client-side file-list filtering

baruch 2014-12-17 23:17 trunk
Commit e44de4cc841b9cdc00828bedbfca30bcfacf56b1
2 files changed +12 -4 +2 -2
+12 -4
--- src/browse.c
+++ src/browse.c
@@ -704,15 +704,15 @@
704704
}else{
705705
int n = db_int(0, "SELECT count(*) FROM plink");
706706
@ <h2>%s(zObjType) from all %d(n) check-ins %s(blob_str(&dirname))
707707
}
708708
if( useMtime ){
709
- @ sorted by modification time</h2>
709
+ @ sorted by modification time
710710
}else{
711
- @ sorted by filename</h2>
711
+ @ sorted by filename
712712
}
713
-
713
+ @ <input id="filter_text" onInput="filter_list(this.value)" style="float:right" /></h2>
714714
715715
/* Generate tree of lists.
716716
**
717717
** Each file and directory is a list element: <li>. Files have class=file
718718
** and if the filename as the suffix "xyz" the file also has class=file-xyz.
@@ -721,11 +721,11 @@
721721
** adds class=subdir.
722722
**
723723
** The <li> element for directories also contains a sublist <ul>
724724
** for the contents of that directory.
725725
*/
726
- @ <div class="filetree"><ul>
726
+ @ <div class="filetree" id="filetreeroot"><ul>
727727
if( nD ){
728728
@ <li class="dir last">
729729
}else{
730730
@ <li class="dir subdir last">
731731
}
@@ -851,10 +851,18 @@
851851
@ if( !ul ) return true; /* This is a file link, not a directory */
852852
@ toggleDir(ul);
853853
@ return false;
854854
@ }
855855
@ }())</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>
856864
style_footer();
857865
858866
/* We could free memory used by sTree here if we needed to. But
859867
** the process is about to exit, so doing so would not really accomplish
860868
** anything useful. */
861869
--- 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 @@
449449
#if EXPORT_INTERFACE
450450
# define MAX_INT_TAG 16 /* The largest pre-assigned tag id */
451451
#endif
452452
453453
/*
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
456456
** the checkout.
457457
*/
458458
const char zLocalSchema[] =
459459
@ -- The VVAR table holds miscellanous information about the local database
460460
@ -- in the form of name-value pairs. This is similar to the VAR table
461461
--- 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

Keyboard Shortcuts

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