Fossil SCM

merge trunk

jan.nijtmans 2014-01-07 08:25 UTC sqlite-min-to-3.7.17 merge
Commit f52089d95e84324b491493c1fc85d4d0176b0bf0
+55 -8
--- src/browse.c
+++ src/browse.c
@@ -395,10 +395,11 @@
395395
** Query parameters:
396396
**
397397
** name=PATH Directory to display. Optional
398398
** ci=LABEL Show only files in this check-in. Optional.
399399
** re=REGEXP Show only files matching REGEXP. Optional.
400
+** expand Begin with the tree fully expanded.
400401
*/
401402
void page_tree(void){
402403
char *zD = fossil_strdup(P("name"));
403404
int nD = zD ? strlen(zD)+1 : 0;
404405
const char *zCI = P("ci");
@@ -413,10 +414,11 @@
413414
char *zREx = ""; /* Extra parameters for path hyperlinks */
414415
ReCompiled *pRE = 0; /* Compiled regular expression */
415416
FileTreeNode *p; /* One line of the tree */
416417
FileTree sTree; /* The complete tree of files */
417418
HQuery sURI; /* Hyperlink */
419
+ int startExpanded; /* True to start out with the tree expanded */
418420
char *zProjectName = db_get("project-name", 0);
419421
420422
if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; }
421423
memset(&sTree, 0, sizeof(sTree));
422424
login_check_credentials();
@@ -424,10 +426,11 @@
424426
while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
425427
style_header("File List");
426428
sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
427429
pathelementFunc, 0, 0);
428430
url_initialize(&sURI, "tree");
431
+ startExpanded = P("expand")!=0;
429432
430433
/* If a regular expression is specified, compile it */
431434
zRE = P("re");
432435
if( zRE ){
433436
re_compile(&pRE, zRE, 0);
@@ -541,12 +544,20 @@
541544
@ <h2>%d(nFile) files from all %d(n) check-ins
542545
@ %s(blob_str(&dirname))</h2>
543546
}
544547
545548
546
- /* Generate a multi-column table listing the contents of zD[]
547
- ** directory.
549
+ /* Generate tree of lists.
550
+ **
551
+ ** Each file and directory is a list element: <li>. Files have class=file
552
+ ** and if the filename as the suffix "xyz" the file also has class=file-xyz.
553
+ ** Directories have class=dir. The directory specfied by the name= query
554
+ ** parameter (or the top-level directory if there is no name= query parameter)
555
+ ** adds class=subdir.
556
+ **
557
+ ** The <li> element for directories also contains a sublist <ul>
558
+ ** for the contents of that directory.
548559
*/
549560
@ <div class="filetree"><ul>
550561
if( nD ){
551562
char *zLink = href("%s", url_render(&sURI, "name", 0, 0, 0));
552563
@ <li class="dir">
@@ -556,22 +567,23 @@
556567
@ <a>%h(zProjectName)</a>
557568
}
558569
@ <ul>
559570
for(p=sTree.pFirst; p; p=p->pNext){
560571
if( p->isDir ){
561
- if( nD && strlen(p->zFullName)==nD-1 ){
572
+ if( p->nFullName==nD-1 ){
562573
@ <li class="dir subdir">
563
- }else{
564
- @ <li class="dir">
565
- }
566
- if( fossil_strcmp(p->zFullName, zD)==0 ){
567574
@ <a>%h(p->zName)</a>
568575
}else{
569576
char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0));
577
+ @ <li class="dir">
570578
@ %z(zLink)%h(p->zName)</a>
571579
}
572
- @ <ul>
580
+ if( startExpanded || p->nFullName<=nD ){
581
+ @ <ul>
582
+ }else{
583
+ @ <ul style='display:none;'>
584
+ }
573585
}else{
574586
char *zLink;
575587
if( zCI ){
576588
zLink = href("%R/artifact/%s",p->zUuid);
577589
}else{
@@ -586,10 +598,45 @@
586598
}
587599
}
588600
}
589601
@ </ul>
590602
@ </ul></div>
603
+ @ <script>(function(){
604
+ @ function style(elem, prop){
605
+ @ return window.getComputedStyle(elem).getPropertyValue(prop);
606
+ @ }
607
+ @
608
+ @ function toggleAll(tree){
609
+ @ var lists = tree.querySelectorAll('.subdir > ul > li ul');
610
+ @ var display = 'block'; /* Default action: make all sublists visible */
611
+ @ for( var i=0; lists[i]; i++ ){
612
+ @ if( style(lists[i], 'display')!='none'){
613
+ @ display = 'none'; /* Any already visible - make them all hidden */
614
+ @ break;
615
+ @ }
616
+ @ }
617
+ @ for( var i=0; lists[i]; i++ ){
618
+ @ lists[i].style.display = display;
619
+ @ }
620
+ @ }
621
+ @
622
+ @ var outer_ul = document.querySelector('.filetree > ul');
623
+ @ outer_ul.querySelector('.subdir > a').style.cursor = 'pointer';
624
+ @ outer_ul.onclick = function( e ){
625
+ @ var a = e.target;
626
+ @ if( a.nodeName!='A' ) return;
627
+ @ if( a.parentNode.className.indexOf('subdir')>=0 ){
628
+ @ toggleAll(outer_ul);
629
+ @ return false;
630
+ @ }
631
+ @ if( style(a.parentNode, 'display')=='inline' ) return;
632
+ @ var ul = a.nextSibling;
633
+ @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
634
+ @ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
635
+ @ return false;
636
+ @ }
637
+ @ }())</script>
591638
style_footer();
592639
593640
/* We could free memory used by sTree here if we needed to. But
594641
** the process is about to exit, so doing so would not really accomplish
595642
** anything useful. */
596643
--- src/browse.c
+++ src/browse.c
@@ -395,10 +395,11 @@
395 ** Query parameters:
396 **
397 ** name=PATH Directory to display. Optional
398 ** ci=LABEL Show only files in this check-in. Optional.
399 ** re=REGEXP Show only files matching REGEXP. Optional.
 
400 */
401 void page_tree(void){
402 char *zD = fossil_strdup(P("name"));
403 int nD = zD ? strlen(zD)+1 : 0;
404 const char *zCI = P("ci");
@@ -413,10 +414,11 @@
413 char *zREx = ""; /* Extra parameters for path hyperlinks */
414 ReCompiled *pRE = 0; /* Compiled regular expression */
415 FileTreeNode *p; /* One line of the tree */
416 FileTree sTree; /* The complete tree of files */
417 HQuery sURI; /* Hyperlink */
 
418 char *zProjectName = db_get("project-name", 0);
419
420 if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; }
421 memset(&sTree, 0, sizeof(sTree));
422 login_check_credentials();
@@ -424,10 +426,11 @@
424 while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
425 style_header("File List");
426 sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
427 pathelementFunc, 0, 0);
428 url_initialize(&sURI, "tree");
 
429
430 /* If a regular expression is specified, compile it */
431 zRE = P("re");
432 if( zRE ){
433 re_compile(&pRE, zRE, 0);
@@ -541,12 +544,20 @@
541 @ <h2>%d(nFile) files from all %d(n) check-ins
542 @ %s(blob_str(&dirname))</h2>
543 }
544
545
546 /* Generate a multi-column table listing the contents of zD[]
547 ** directory.
 
 
 
 
 
 
 
 
548 */
549 @ <div class="filetree"><ul>
550 if( nD ){
551 char *zLink = href("%s", url_render(&sURI, "name", 0, 0, 0));
552 @ <li class="dir">
@@ -556,22 +567,23 @@
556 @ <a>%h(zProjectName)</a>
557 }
558 @ <ul>
559 for(p=sTree.pFirst; p; p=p->pNext){
560 if( p->isDir ){
561 if( nD && strlen(p->zFullName)==nD-1 ){
562 @ <li class="dir subdir">
563 }else{
564 @ <li class="dir">
565 }
566 if( fossil_strcmp(p->zFullName, zD)==0 ){
567 @ <a>%h(p->zName)</a>
568 }else{
569 char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0));
 
570 @ %z(zLink)%h(p->zName)</a>
571 }
572 @ <ul>
 
 
 
 
573 }else{
574 char *zLink;
575 if( zCI ){
576 zLink = href("%R/artifact/%s",p->zUuid);
577 }else{
@@ -586,10 +598,45 @@
586 }
587 }
588 }
589 @ </ul>
590 @ </ul></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
591 style_footer();
592
593 /* We could free memory used by sTree here if we needed to. But
594 ** the process is about to exit, so doing so would not really accomplish
595 ** anything useful. */
596
--- src/browse.c
+++ src/browse.c
@@ -395,10 +395,11 @@
395 ** Query parameters:
396 **
397 ** name=PATH Directory to display. Optional
398 ** ci=LABEL Show only files in this check-in. Optional.
399 ** re=REGEXP Show only files matching REGEXP. Optional.
400 ** expand Begin with the tree fully expanded.
401 */
402 void page_tree(void){
403 char *zD = fossil_strdup(P("name"));
404 int nD = zD ? strlen(zD)+1 : 0;
405 const char *zCI = P("ci");
@@ -413,10 +414,11 @@
414 char *zREx = ""; /* Extra parameters for path hyperlinks */
415 ReCompiled *pRE = 0; /* Compiled regular expression */
416 FileTreeNode *p; /* One line of the tree */
417 FileTree sTree; /* The complete tree of files */
418 HQuery sURI; /* Hyperlink */
419 int startExpanded; /* True to start out with the tree expanded */
420 char *zProjectName = db_get("project-name", 0);
421
422 if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; }
423 memset(&sTree, 0, sizeof(sTree));
424 login_check_credentials();
@@ -424,10 +426,11 @@
426 while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
427 style_header("File List");
428 sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
429 pathelementFunc, 0, 0);
430 url_initialize(&sURI, "tree");
431 startExpanded = P("expand")!=0;
432
433 /* If a regular expression is specified, compile it */
434 zRE = P("re");
435 if( zRE ){
436 re_compile(&pRE, zRE, 0);
@@ -541,12 +544,20 @@
544 @ <h2>%d(nFile) files from all %d(n) check-ins
545 @ %s(blob_str(&dirname))</h2>
546 }
547
548
549 /* Generate tree of lists.
550 **
551 ** Each file and directory is a list element: <li>. Files have class=file
552 ** and if the filename as the suffix "xyz" the file also has class=file-xyz.
553 ** Directories have class=dir. The directory specfied by the name= query
554 ** parameter (or the top-level directory if there is no name= query parameter)
555 ** adds class=subdir.
556 **
557 ** The <li> element for directories also contains a sublist <ul>
558 ** for the contents of that directory.
559 */
560 @ <div class="filetree"><ul>
561 if( nD ){
562 char *zLink = href("%s", url_render(&sURI, "name", 0, 0, 0));
563 @ <li class="dir">
@@ -556,22 +567,23 @@
567 @ <a>%h(zProjectName)</a>
568 }
569 @ <ul>
570 for(p=sTree.pFirst; p; p=p->pNext){
571 if( p->isDir ){
572 if( p->nFullName==nD-1 ){
573 @ <li class="dir subdir">
 
 
 
 
574 @ <a>%h(p->zName)</a>
575 }else{
576 char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0));
577 @ <li class="dir">
578 @ %z(zLink)%h(p->zName)</a>
579 }
580 if( startExpanded || p->nFullName<=nD ){
581 @ <ul>
582 }else{
583 @ <ul style='display:none;'>
584 }
585 }else{
586 char *zLink;
587 if( zCI ){
588 zLink = href("%R/artifact/%s",p->zUuid);
589 }else{
@@ -586,10 +598,45 @@
598 }
599 }
600 }
601 @ </ul>
602 @ </ul></div>
603 @ <script>(function(){
604 @ function style(elem, prop){
605 @ return window.getComputedStyle(elem).getPropertyValue(prop);
606 @ }
607 @
608 @ function toggleAll(tree){
609 @ var lists = tree.querySelectorAll('.subdir > ul > li ul');
610 @ var display = 'block'; /* Default action: make all sublists visible */
611 @ for( var i=0; lists[i]; i++ ){
612 @ if( style(lists[i], 'display')!='none'){
613 @ display = 'none'; /* Any already visible - make them all hidden */
614 @ break;
615 @ }
616 @ }
617 @ for( var i=0; lists[i]; i++ ){
618 @ lists[i].style.display = display;
619 @ }
620 @ }
621 @
622 @ var outer_ul = document.querySelector('.filetree > ul');
623 @ outer_ul.querySelector('.subdir > a').style.cursor = 'pointer';
624 @ outer_ul.onclick = function( e ){
625 @ var a = e.target;
626 @ if( a.nodeName!='A' ) return;
627 @ if( a.parentNode.className.indexOf('subdir')>=0 ){
628 @ toggleAll(outer_ul);
629 @ return false;
630 @ }
631 @ if( style(a.parentNode, 'display')=='inline' ) return;
632 @ var ul = a.nextSibling;
633 @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
634 @ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
635 @ return false;
636 @ }
637 @ }())</script>
638 style_footer();
639
640 /* We could free memory used by sTree here if we needed to. But
641 ** the process is about to exit, so doing so would not really accomplish
642 ** anything useful. */
643
+55 -8
--- src/browse.c
+++ src/browse.c
@@ -395,10 +395,11 @@
395395
** Query parameters:
396396
**
397397
** name=PATH Directory to display. Optional
398398
** ci=LABEL Show only files in this check-in. Optional.
399399
** re=REGEXP Show only files matching REGEXP. Optional.
400
+** expand Begin with the tree fully expanded.
400401
*/
401402
void page_tree(void){
402403
char *zD = fossil_strdup(P("name"));
403404
int nD = zD ? strlen(zD)+1 : 0;
404405
const char *zCI = P("ci");
@@ -413,10 +414,11 @@
413414
char *zREx = ""; /* Extra parameters for path hyperlinks */
414415
ReCompiled *pRE = 0; /* Compiled regular expression */
415416
FileTreeNode *p; /* One line of the tree */
416417
FileTree sTree; /* The complete tree of files */
417418
HQuery sURI; /* Hyperlink */
419
+ int startExpanded; /* True to start out with the tree expanded */
418420
char *zProjectName = db_get("project-name", 0);
419421
420422
if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; }
421423
memset(&sTree, 0, sizeof(sTree));
422424
login_check_credentials();
@@ -424,10 +426,11 @@
424426
while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
425427
style_header("File List");
426428
sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
427429
pathelementFunc, 0, 0);
428430
url_initialize(&sURI, "tree");
431
+ startExpanded = P("expand")!=0;
429432
430433
/* If a regular expression is specified, compile it */
431434
zRE = P("re");
432435
if( zRE ){
433436
re_compile(&pRE, zRE, 0);
@@ -541,12 +544,20 @@
541544
@ <h2>%d(nFile) files from all %d(n) check-ins
542545
@ %s(blob_str(&dirname))</h2>
543546
}
544547
545548
546
- /* Generate a multi-column table listing the contents of zD[]
547
- ** directory.
549
+ /* Generate tree of lists.
550
+ **
551
+ ** Each file and directory is a list element: <li>. Files have class=file
552
+ ** and if the filename as the suffix "xyz" the file also has class=file-xyz.
553
+ ** Directories have class=dir. The directory specfied by the name= query
554
+ ** parameter (or the top-level directory if there is no name= query parameter)
555
+ ** adds class=subdir.
556
+ **
557
+ ** The <li> element for directories also contains a sublist <ul>
558
+ ** for the contents of that directory.
548559
*/
549560
@ <div class="filetree"><ul>
550561
if( nD ){
551562
char *zLink = href("%s", url_render(&sURI, "name", 0, 0, 0));
552563
@ <li class="dir">
@@ -556,22 +567,23 @@
556567
@ <a>%h(zProjectName)</a>
557568
}
558569
@ <ul>
559570
for(p=sTree.pFirst; p; p=p->pNext){
560571
if( p->isDir ){
561
- if( nD && strlen(p->zFullName)==nD-1 ){
572
+ if( p->nFullName==nD-1 ){
562573
@ <li class="dir subdir">
563
- }else{
564
- @ <li class="dir">
565
- }
566
- if( fossil_strcmp(p->zFullName, zD)==0 ){
567574
@ <a>%h(p->zName)</a>
568575
}else{
569576
char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0));
577
+ @ <li class="dir">
570578
@ %z(zLink)%h(p->zName)</a>
571579
}
572
- @ <ul>
580
+ if( startExpanded || p->nFullName<=nD ){
581
+ @ <ul>
582
+ }else{
583
+ @ <ul style='display:none;'>
584
+ }
573585
}else{
574586
char *zLink;
575587
if( zCI ){
576588
zLink = href("%R/artifact/%s",p->zUuid);
577589
}else{
@@ -586,10 +598,45 @@
586598
}
587599
}
588600
}
589601
@ </ul>
590602
@ </ul></div>
603
+ @ <script>(function(){
604
+ @ function style(elem, prop){
605
+ @ return window.getComputedStyle(elem).getPropertyValue(prop);
606
+ @ }
607
+ @
608
+ @ function toggleAll(tree){
609
+ @ var lists = tree.querySelectorAll('.subdir > ul > li ul');
610
+ @ var display = 'block'; /* Default action: make all sublists visible */
611
+ @ for( var i=0; lists[i]; i++ ){
612
+ @ if( style(lists[i], 'display')!='none'){
613
+ @ display = 'none'; /* Any already visible - make them all hidden */
614
+ @ break;
615
+ @ }
616
+ @ }
617
+ @ for( var i=0; lists[i]; i++ ){
618
+ @ lists[i].style.display = display;
619
+ @ }
620
+ @ }
621
+ @
622
+ @ var outer_ul = document.querySelector('.filetree > ul');
623
+ @ outer_ul.querySelector('.subdir > a').style.cursor = 'pointer';
624
+ @ outer_ul.onclick = function( e ){
625
+ @ var a = e.target;
626
+ @ if( a.nodeName!='A' ) return;
627
+ @ if( a.parentNode.className.indexOf('subdir')>=0 ){
628
+ @ toggleAll(outer_ul);
629
+ @ return false;
630
+ @ }
631
+ @ if( style(a.parentNode, 'display')=='inline' ) return;
632
+ @ var ul = a.nextSibling;
633
+ @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
634
+ @ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
635
+ @ return false;
636
+ @ }
637
+ @ }())</script>
591638
style_footer();
592639
593640
/* We could free memory used by sTree here if we needed to. But
594641
** the process is about to exit, so doing so would not really accomplish
595642
** anything useful. */
596643
--- src/browse.c
+++ src/browse.c
@@ -395,10 +395,11 @@
395 ** Query parameters:
396 **
397 ** name=PATH Directory to display. Optional
398 ** ci=LABEL Show only files in this check-in. Optional.
399 ** re=REGEXP Show only files matching REGEXP. Optional.
 
400 */
401 void page_tree(void){
402 char *zD = fossil_strdup(P("name"));
403 int nD = zD ? strlen(zD)+1 : 0;
404 const char *zCI = P("ci");
@@ -413,10 +414,11 @@
413 char *zREx = ""; /* Extra parameters for path hyperlinks */
414 ReCompiled *pRE = 0; /* Compiled regular expression */
415 FileTreeNode *p; /* One line of the tree */
416 FileTree sTree; /* The complete tree of files */
417 HQuery sURI; /* Hyperlink */
 
418 char *zProjectName = db_get("project-name", 0);
419
420 if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; }
421 memset(&sTree, 0, sizeof(sTree));
422 login_check_credentials();
@@ -424,10 +426,11 @@
424 while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
425 style_header("File List");
426 sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
427 pathelementFunc, 0, 0);
428 url_initialize(&sURI, "tree");
 
429
430 /* If a regular expression is specified, compile it */
431 zRE = P("re");
432 if( zRE ){
433 re_compile(&pRE, zRE, 0);
@@ -541,12 +544,20 @@
541 @ <h2>%d(nFile) files from all %d(n) check-ins
542 @ %s(blob_str(&dirname))</h2>
543 }
544
545
546 /* Generate a multi-column table listing the contents of zD[]
547 ** directory.
 
 
 
 
 
 
 
 
548 */
549 @ <div class="filetree"><ul>
550 if( nD ){
551 char *zLink = href("%s", url_render(&sURI, "name", 0, 0, 0));
552 @ <li class="dir">
@@ -556,22 +567,23 @@
556 @ <a>%h(zProjectName)</a>
557 }
558 @ <ul>
559 for(p=sTree.pFirst; p; p=p->pNext){
560 if( p->isDir ){
561 if( nD && strlen(p->zFullName)==nD-1 ){
562 @ <li class="dir subdir">
563 }else{
564 @ <li class="dir">
565 }
566 if( fossil_strcmp(p->zFullName, zD)==0 ){
567 @ <a>%h(p->zName)</a>
568 }else{
569 char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0));
 
570 @ %z(zLink)%h(p->zName)</a>
571 }
572 @ <ul>
 
 
 
 
573 }else{
574 char *zLink;
575 if( zCI ){
576 zLink = href("%R/artifact/%s",p->zUuid);
577 }else{
@@ -586,10 +598,45 @@
586 }
587 }
588 }
589 @ </ul>
590 @ </ul></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
591 style_footer();
592
593 /* We could free memory used by sTree here if we needed to. But
594 ** the process is about to exit, so doing so would not really accomplish
595 ** anything useful. */
596
--- src/browse.c
+++ src/browse.c
@@ -395,10 +395,11 @@
395 ** Query parameters:
396 **
397 ** name=PATH Directory to display. Optional
398 ** ci=LABEL Show only files in this check-in. Optional.
399 ** re=REGEXP Show only files matching REGEXP. Optional.
400 ** expand Begin with the tree fully expanded.
401 */
402 void page_tree(void){
403 char *zD = fossil_strdup(P("name"));
404 int nD = zD ? strlen(zD)+1 : 0;
405 const char *zCI = P("ci");
@@ -413,10 +414,11 @@
414 char *zREx = ""; /* Extra parameters for path hyperlinks */
415 ReCompiled *pRE = 0; /* Compiled regular expression */
416 FileTreeNode *p; /* One line of the tree */
417 FileTree sTree; /* The complete tree of files */
418 HQuery sURI; /* Hyperlink */
419 int startExpanded; /* True to start out with the tree expanded */
420 char *zProjectName = db_get("project-name", 0);
421
422 if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; }
423 memset(&sTree, 0, sizeof(sTree));
424 login_check_credentials();
@@ -424,10 +426,11 @@
426 while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
427 style_header("File List");
428 sqlite3_create_function(g.db, "pathelement", 2, SQLITE_UTF8, 0,
429 pathelementFunc, 0, 0);
430 url_initialize(&sURI, "tree");
431 startExpanded = P("expand")!=0;
432
433 /* If a regular expression is specified, compile it */
434 zRE = P("re");
435 if( zRE ){
436 re_compile(&pRE, zRE, 0);
@@ -541,12 +544,20 @@
544 @ <h2>%d(nFile) files from all %d(n) check-ins
545 @ %s(blob_str(&dirname))</h2>
546 }
547
548
549 /* Generate tree of lists.
550 **
551 ** Each file and directory is a list element: <li>. Files have class=file
552 ** and if the filename as the suffix "xyz" the file also has class=file-xyz.
553 ** Directories have class=dir. The directory specfied by the name= query
554 ** parameter (or the top-level directory if there is no name= query parameter)
555 ** adds class=subdir.
556 **
557 ** The <li> element for directories also contains a sublist <ul>
558 ** for the contents of that directory.
559 */
560 @ <div class="filetree"><ul>
561 if( nD ){
562 char *zLink = href("%s", url_render(&sURI, "name", 0, 0, 0));
563 @ <li class="dir">
@@ -556,22 +567,23 @@
567 @ <a>%h(zProjectName)</a>
568 }
569 @ <ul>
570 for(p=sTree.pFirst; p; p=p->pNext){
571 if( p->isDir ){
572 if( p->nFullName==nD-1 ){
573 @ <li class="dir subdir">
 
 
 
 
574 @ <a>%h(p->zName)</a>
575 }else{
576 char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0));
577 @ <li class="dir">
578 @ %z(zLink)%h(p->zName)</a>
579 }
580 if( startExpanded || p->nFullName<=nD ){
581 @ <ul>
582 }else{
583 @ <ul style='display:none;'>
584 }
585 }else{
586 char *zLink;
587 if( zCI ){
588 zLink = href("%R/artifact/%s",p->zUuid);
589 }else{
@@ -586,10 +598,45 @@
598 }
599 }
600 }
601 @ </ul>
602 @ </ul></div>
603 @ <script>(function(){
604 @ function style(elem, prop){
605 @ return window.getComputedStyle(elem).getPropertyValue(prop);
606 @ }
607 @
608 @ function toggleAll(tree){
609 @ var lists = tree.querySelectorAll('.subdir > ul > li ul');
610 @ var display = 'block'; /* Default action: make all sublists visible */
611 @ for( var i=0; lists[i]; i++ ){
612 @ if( style(lists[i], 'display')!='none'){
613 @ display = 'none'; /* Any already visible - make them all hidden */
614 @ break;
615 @ }
616 @ }
617 @ for( var i=0; lists[i]; i++ ){
618 @ lists[i].style.display = display;
619 @ }
620 @ }
621 @
622 @ var outer_ul = document.querySelector('.filetree > ul');
623 @ outer_ul.querySelector('.subdir > a').style.cursor = 'pointer';
624 @ outer_ul.onclick = function( e ){
625 @ var a = e.target;
626 @ if( a.nodeName!='A' ) return;
627 @ if( a.parentNode.className.indexOf('subdir')>=0 ){
628 @ toggleAll(outer_ul);
629 @ return false;
630 @ }
631 @ if( style(a.parentNode, 'display')=='inline' ) return;
632 @ var ul = a.nextSibling;
633 @ while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
634 @ ul.style.display = style(ul, 'display')=='none' ? 'block' : 'none';
635 @ return false;
636 @ }
637 @ }())</script>
638 style_footer();
639
640 /* We could free memory used by sTree here if we needed to. But
641 ** the process is about to exit, so doing so would not really accomplish
642 ** anything useful. */
643
+5
--- src/main.c
+++ src/main.c
@@ -595,10 +595,15 @@
595595
#endif
596596
g.mainTimerId = fossil_timer_start();
597597
g.zVfsName = find_option("vfs",0,1);
598598
if( g.zVfsName==0 ){
599599
g.zVfsName = fossil_getenv("FOSSIL_VFS");
600
+#if defined(__CYGWIN__)
601
+ if( g.zVfsName==0 ){
602
+ g.zVfsName = "win32-longpath";
603
+ }
604
+#endif
600605
}
601606
if( g.zVfsName ){
602607
sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
603608
if( pVfs ){
604609
sqlite3_vfs_register(pVfs, 1);
605610
--- src/main.c
+++ src/main.c
@@ -595,10 +595,15 @@
595 #endif
596 g.mainTimerId = fossil_timer_start();
597 g.zVfsName = find_option("vfs",0,1);
598 if( g.zVfsName==0 ){
599 g.zVfsName = fossil_getenv("FOSSIL_VFS");
 
 
 
 
 
600 }
601 if( g.zVfsName ){
602 sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
603 if( pVfs ){
604 sqlite3_vfs_register(pVfs, 1);
605
--- src/main.c
+++ src/main.c
@@ -595,10 +595,15 @@
595 #endif
596 g.mainTimerId = fossil_timer_start();
597 g.zVfsName = find_option("vfs",0,1);
598 if( g.zVfsName==0 ){
599 g.zVfsName = fossil_getenv("FOSSIL_VFS");
600 #if defined(__CYGWIN__)
601 if( g.zVfsName==0 ){
602 g.zVfsName = "win32-longpath";
603 }
604 #endif
605 }
606 if( g.zVfsName ){
607 sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
608 if( pVfs ){
609 sqlite3_vfs_register(pVfs, 1);
610
+5
--- src/main.c
+++ src/main.c
@@ -595,10 +595,15 @@
595595
#endif
596596
g.mainTimerId = fossil_timer_start();
597597
g.zVfsName = find_option("vfs",0,1);
598598
if( g.zVfsName==0 ){
599599
g.zVfsName = fossil_getenv("FOSSIL_VFS");
600
+#if defined(__CYGWIN__)
601
+ if( g.zVfsName==0 ){
602
+ g.zVfsName = "win32-longpath";
603
+ }
604
+#endif
600605
}
601606
if( g.zVfsName ){
602607
sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
603608
if( pVfs ){
604609
sqlite3_vfs_register(pVfs, 1);
605610
--- src/main.c
+++ src/main.c
@@ -595,10 +595,15 @@
595 #endif
596 g.mainTimerId = fossil_timer_start();
597 g.zVfsName = find_option("vfs",0,1);
598 if( g.zVfsName==0 ){
599 g.zVfsName = fossil_getenv("FOSSIL_VFS");
 
 
 
 
 
600 }
601 if( g.zVfsName ){
602 sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
603 if( pVfs ){
604 sqlite3_vfs_register(pVfs, 1);
605
--- src/main.c
+++ src/main.c
@@ -595,10 +595,15 @@
595 #endif
596 g.mainTimerId = fossil_timer_start();
597 g.zVfsName = find_option("vfs",0,1);
598 if( g.zVfsName==0 ){
599 g.zVfsName = fossil_getenv("FOSSIL_VFS");
600 #if defined(__CYGWIN__)
601 if( g.zVfsName==0 ){
602 g.zVfsName = "win32-longpath";
603 }
604 #endif
605 }
606 if( g.zVfsName ){
607 sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfsName);
608 if( pVfs ){
609 sqlite3_vfs_register(pVfs, 1);
610
--- src/style.c
+++ src/style.c
@@ -786,10 +786,13 @@
786786
},
787787
{ ".filetree li",
788788
"tree-view list items",
789789
@ display: inline;
790790
},
791
+ /* There is exactly one element with class="subdir". That element is
792
+ ** the name of the directory specified by the "name=" query parameter,
793
+ ** and the directory described by the text at the top of the page. */
791794
{ ".filetree .subdir ul",
792795
"tree-view lists below subdir",
793796
@ position: relative;
794797
@ display: block;
795798
@ margin: 0 0 0 21px;
796799
--- src/style.c
+++ src/style.c
@@ -786,10 +786,13 @@
786 },
787 { ".filetree li",
788 "tree-view list items",
789 @ display: inline;
790 },
 
 
 
791 { ".filetree .subdir ul",
792 "tree-view lists below subdir",
793 @ position: relative;
794 @ display: block;
795 @ margin: 0 0 0 21px;
796
--- src/style.c
+++ src/style.c
@@ -786,10 +786,13 @@
786 },
787 { ".filetree li",
788 "tree-view list items",
789 @ display: inline;
790 },
791 /* There is exactly one element with class="subdir". That element is
792 ** the name of the directory specified by the "name=" query parameter,
793 ** and the directory described by the text at the top of the page. */
794 { ".filetree .subdir ul",
795 "tree-view lists below subdir",
796 @ position: relative;
797 @ display: block;
798 @ margin: 0 0 0 21px;
799
--- src/style.c
+++ src/style.c
@@ -786,10 +786,13 @@
786786
},
787787
{ ".filetree li",
788788
"tree-view list items",
789789
@ display: inline;
790790
},
791
+ /* There is exactly one element with class="subdir". That element is
792
+ ** the name of the directory specified by the "name=" query parameter,
793
+ ** and the directory described by the text at the top of the page. */
791794
{ ".filetree .subdir ul",
792795
"tree-view lists below subdir",
793796
@ position: relative;
794797
@ display: block;
795798
@ margin: 0 0 0 21px;
796799
--- src/style.c
+++ src/style.c
@@ -786,10 +786,13 @@
786 },
787 { ".filetree li",
788 "tree-view list items",
789 @ display: inline;
790 },
 
 
 
791 { ".filetree .subdir ul",
792 "tree-view lists below subdir",
793 @ position: relative;
794 @ display: block;
795 @ margin: 0 0 0 21px;
796
--- src/style.c
+++ src/style.c
@@ -786,10 +786,13 @@
786 },
787 { ".filetree li",
788 "tree-view list items",
789 @ display: inline;
790 },
791 /* There is exactly one element with class="subdir". That element is
792 ** the name of the directory specified by the "name=" query parameter,
793 ** and the directory described by the text at the top of the page. */
794 { ".filetree .subdir ul",
795 "tree-view lists below subdir",
796 @ position: relative;
797 @ display: block;
798 @ margin: 0 0 0 21px;
799

Keyboard Shortcuts

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