Fossil

Check-in [3638635d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fix for last directory in list
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | file-filter
Files: files | file ages | folders
SHA1:3638635d0d1df9f40dd7cde4b27f54a1439d5530
User & Date: baruch 2014-12-22 21:57:56
Context
2014-12-23
09:05
Make search case insensitive check-in: 1621bd80 user: baruch tags: file-filter
2014-12-22
21:57
fix for last directory in list check-in: 3638635d user: baruch tags: file-filter
21:36
merge trunk check-in: f7448082 user: baruch tags: file-filter
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/browse.c.

738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
...
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
...
779
780
781
782
783
784
785

















786
787
788
789
790
791
792
793
...
848
849
850
851
852
853
854

855
856
857
858
859
860
861
862
863
...
878
879
880
881
882
883
884

885
886
887
888
889
890
891
  @ <ul>
  if( useMtime ){
    p = sortTreeByMtime(sTree.pFirst);
    memset(&sTree, 0, sizeof(sTree));
    relinkTree(&sTree, p);
  }
  for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
    const char *zLastClass = p->pSibling==0 ? " last" : "";
    if( p->pChild ){
      const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : "";
      @ <li class="dir%s(zSubdirClass)%s(zLastClass)"><div class="filetreeline">
      @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
      if( p->mtime>0.0 ){
        char *zAge = human_readable_age(rNow - p->mtime);
        @ <div class="filetreeage">%s(zAge)</div>
      }
      @ </div>
      if( startExpanded || p->nFullName<=nD ){
................................................................................
        @ <ul id="dir%d(nDir)" class="collapsed">
      }
      nDir++;
    }else if( !showDirOnly ){
      const char *zFileClass = fileext_class(p->zName);
      char *zLink;
      if( zCI ){
        zLink = href("%R/artifact/%.16s",p->zUuid);
      }else{
        zLink = href("%R/finfo?name=%T",p->zFullName);
      }
      @ <li class="%z(zFileClass)%s(zLastClass)"><div class="filetreeline">
      @ %z(zLink)%h(p->zName)</a>
      if( p->mtime>0 ){
        char *zAge = human_readable_age(rNow - p->mtime);
        @ <div class="filetreeage">%s(zAge)</div>
      }
      @ </div>
    }
................................................................................
      while( nClose-- > 0 ){
        @ </ul>
      }
    }
  }
  @ </ul>
  @ </ul></div>

















  @ <script>(function(){
  @ function isExpanded(ul){
  @   return ul.className=='';
  @ }
  @
  @ function toggleDir(ul, useInitValue){
  @   if( !useInitValue ){
  @     expandMap[ul.id] = !isExpanded(ul);
................................................................................
  @   if( !belowSubdir(a) ) return true;
  @   var ul = a.parentNode.nextSibling;
  @   while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
  @   if( !ul ) return true; /* This is a file link, not a directory */
  @   toggleDir(ul);
  @   return false;
  @ }

  @ }())</script>
  @ <script>function filter_list(t){
  @   var outer_ul = document.querySelector('.filetree > ul');
  @   var links = outer_ul.querySelectorAll('.file a');
  @   for( var i = 0; i < links.length; i++ ){
  @     var node = links[i];
  @     if( node.innerHTML.lastIndexOf(t) == -1 ){
  @       node = node.parentNode.parentNode;
  @       node.hidden = true;
................................................................................
  @       while( node!=outer_ul && node.parentNode.hidden ){
  @         node = node.parentNode;
  @         node.hidden = false;
  @         node = node.parentNode;
  @       }
  @     }
  @   }

  @ }</script>
  style_footer();

  /* We could free memory used by sTree here if we needed to.  But
  ** the process is about to exit, so doing so would not really accomplish
  ** anything useful. */
}







<


|







 







|



|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







 







>
|
|







 







>







738
739
740
741
742
743
744

745
746
747
748
749
750
751
752
753
754
...
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
...
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
...
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
...
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
  @ <ul>
  if( useMtime ){
    p = sortTreeByMtime(sTree.pFirst);
    memset(&sTree, 0, sizeof(sTree));
    relinkTree(&sTree, p);
  }
  for(p=sTree.pFirst, nDir=0; p; p=p->pNext){

    if( p->pChild ){
      const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : "";
      @ <li class="dir%s(zSubdirClass)"><div class="filetreeline">
      @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
      if( p->mtime>0.0 ){
        char *zAge = human_readable_age(rNow - p->mtime);
        @ <div class="filetreeage">%s(zAge)</div>
      }
      @ </div>
      if( startExpanded || p->nFullName<=nD ){
................................................................................
        @ <ul id="dir%d(nDir)" class="collapsed">
      }
      nDir++;
    }else if( !showDirOnly ){
      const char *zFileClass = fileext_class(p->zName);
      char *zLink;
      if( zCI ){
        zLink = href("%R/artifact/%s",p->zUuid);
      }else{
        zLink = href("%R/finfo?name=%T",p->zFullName);
      }
      @ <li class="%z(zFileClass)"><div class="filetreeline">
      @ %z(zLink)%h(p->zName)</a>
      if( p->mtime>0 ){
        char *zAge = human_readable_age(rNow - p->mtime);
        @ <div class="filetreeage">%s(zAge)</div>
      }
      @ </div>
    }
................................................................................
      while( nClose-- > 0 ){
        @ </ul>
      }
    }
  }
  @ </ul>
  @ </ul></div>
  @ <script>function fixLast(){
  @   var dirs = document.querySelectorAll('.filetree ul');
  @   for( var i = 0; i < dirs.length; i++ ){
  @     var node = dirs[i];
  @     var last = true;
  @     for( var j = node.children.length-1; j >= 0; j-- ){
  @       if( !node.children[j].hidden ){
  @         if( last ){
  @           node.children[j].classList.add('last');
  @           last = false;
  @         }else{
  @           node.children[j].classList.remove('last');
  @         }
  @       }
  @     }
  @   }
  @ }
  @ (function(){
  @ function isExpanded(ul){
  @   return ul.className=='';
  @ }
  @
  @ function toggleDir(ul, useInitValue){
  @   if( !useInitValue ){
  @     expandMap[ul.id] = !isExpanded(ul);
................................................................................
  @   if( !belowSubdir(a) ) return true;
  @   var ul = a.parentNode.nextSibling;
  @   while( ul && ul.nodeName!='UL' ) ul = ul.nextSibling;
  @   if( !ul ) return true; /* This is a file link, not a directory */
  @   toggleDir(ul);
  @   return false;
  @ }
  @ fixLast();
  @ }())
  @ function filter_list(t){
  @   var outer_ul = document.querySelector('.filetree > ul');
  @   var links = outer_ul.querySelectorAll('.file a');
  @   for( var i = 0; i < links.length; i++ ){
  @     var node = links[i];
  @     if( node.innerHTML.lastIndexOf(t) == -1 ){
  @       node = node.parentNode.parentNode;
  @       node.hidden = true;
................................................................................
  @       while( node!=outer_ul && node.parentNode.hidden ){
  @         node = node.parentNode;
  @         node.hidden = false;
  @         node = node.parentNode;
  @       }
  @     }
  @   }
  @   fixLast();
  @ }</script>
  style_footer();

  /* We could free memory used by sTree here if we needed to.  But
  ** the process is about to exit, so doing so would not really accomplish
  ** anything useful. */
}