Fossil SCM

Improve tree-view styling on IE8.

joel 2014-01-16 21:43 trunk
Commit bfe7eeb71a01c29d25e5cc68daa7155ea2a360b0
2 files changed +7 -8 +2 -2
+7 -8
--- src/browse.c
+++ src/browse.c
@@ -597,38 +597,37 @@
597597
** The <li> element for directories also contains a sublist <ul>
598598
** for the contents of that directory.
599599
*/
600600
@ <div class="filetree"><ul>
601601
if( nD ){
602
- @ <li class="dir">
602
+ @ <li class="dir last">
603603
}else{
604
- @ <li class="dir subdir">
604
+ @ <li class="dir subdir last">
605605
}
606606
@ %z(href("%s",url_render(&sURI,"name",0,0,0)))%h(zProjectName)</a>
607607
@ <ul>
608608
for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
609
+ const char *zLastClass = p->isLast ? " last" : "";
609610
if( p->isDir ){
610
- if( p->nFullName==nD-1 ){
611
- @ <li class="dir subdir">
612
- }else{
613
- @ <li class="dir">
614
- }
611
+ const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : "";
612
+ @ <li class="dir%s(zSubdirClass)%s(zLastClass)">
615613
@ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
616614
if( startExpanded || p->nFullName<=nD ){
617615
@ <ul id="dir%d(nDir)">
618616
}else{
619617
@ <ul id="dir%d(nDir)" style='display:none;'>
620618
}
621619
nDir++;
622620
}else if( !showDirOnly ){
621
+ char *zFileClass = fileext_class(p->zName);
623622
char *zLink;
624623
if( zCI ){
625624
zLink = href("%R/artifact/%S",p->zUuid);
626625
}else{
627626
zLink = href("%R/finfo?name=%T",p->zFullName);
628627
}
629
- @ <li class="%z(fileext_class(p->zName))">%z(zLink)%h(p->zName)</a>
628
+ @ <li class="%z(zFileClass)%s(zLastClass)">%z(zLink)%h(p->zName)</a>
630629
}
631630
if( p->isLast ){
632631
int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0);
633632
while( nClose-- > 0 ){
634633
@ </ul>
635634
--- src/browse.c
+++ src/browse.c
@@ -597,38 +597,37 @@
597 ** The <li> element for directories also contains a sublist <ul>
598 ** for the contents of that directory.
599 */
600 @ <div class="filetree"><ul>
601 if( nD ){
602 @ <li class="dir">
603 }else{
604 @ <li class="dir subdir">
605 }
606 @ %z(href("%s",url_render(&sURI,"name",0,0,0)))%h(zProjectName)</a>
607 @ <ul>
608 for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
 
609 if( p->isDir ){
610 if( p->nFullName==nD-1 ){
611 @ <li class="dir subdir">
612 }else{
613 @ <li class="dir">
614 }
615 @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
616 if( startExpanded || p->nFullName<=nD ){
617 @ <ul id="dir%d(nDir)">
618 }else{
619 @ <ul id="dir%d(nDir)" style='display:none;'>
620 }
621 nDir++;
622 }else if( !showDirOnly ){
 
623 char *zLink;
624 if( zCI ){
625 zLink = href("%R/artifact/%S",p->zUuid);
626 }else{
627 zLink = href("%R/finfo?name=%T",p->zFullName);
628 }
629 @ <li class="%z(fileext_class(p->zName))">%z(zLink)%h(p->zName)</a>
630 }
631 if( p->isLast ){
632 int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0);
633 while( nClose-- > 0 ){
634 @ </ul>
635
--- src/browse.c
+++ src/browse.c
@@ -597,38 +597,37 @@
597 ** The <li> element for directories also contains a sublist <ul>
598 ** for the contents of that directory.
599 */
600 @ <div class="filetree"><ul>
601 if( nD ){
602 @ <li class="dir last">
603 }else{
604 @ <li class="dir subdir last">
605 }
606 @ %z(href("%s",url_render(&sURI,"name",0,0,0)))%h(zProjectName)</a>
607 @ <ul>
608 for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
609 const char *zLastClass = p->isLast ? " last" : "";
610 if( p->isDir ){
611 const char *zSubdirClass = p->nFullName==nD-1 ? " subdir" : "";
612 @ <li class="dir%s(zSubdirClass)%s(zLastClass)">
 
 
 
613 @ %z(href("%s",url_render(&sURI,"name",p->zFullName,0,0)))%h(p->zName)</a>
614 if( startExpanded || p->nFullName<=nD ){
615 @ <ul id="dir%d(nDir)">
616 }else{
617 @ <ul id="dir%d(nDir)" style='display:none;'>
618 }
619 nDir++;
620 }else if( !showDirOnly ){
621 char *zFileClass = fileext_class(p->zName);
622 char *zLink;
623 if( zCI ){
624 zLink = href("%R/artifact/%S",p->zUuid);
625 }else{
626 zLink = href("%R/finfo?name=%T",p->zFullName);
627 }
628 @ <li class="%z(zFileClass)%s(zLastClass)">%z(zLink)%h(p->zName)</a>
629 }
630 if( p->isLast ){
631 int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0);
632 while( nClose-- > 0 ){
633 @ </ul>
634
+2 -2
--- src/style.c
+++ src/style.c
@@ -802,20 +802,20 @@
802802
@ width: 14px;
803803
@ height: 1.5em;
804804
@ border-left: 2px solid #aaa;
805805
@ border-bottom: 2px solid #aaa;
806806
},
807
- { ".filetree ul ul:before",
807
+ { ".filetree li > ul:before",
808808
"tree-view directory lines",
809809
@ content: '';
810810
@ position: absolute;
811811
@ top: -1.5em;
812812
@ bottom: 0;
813813
@ left: -35px;
814814
@ border-left: 2px solid #aaa;
815815
},
816
- { ".filetree li:last-child > ul:before",
816
+ { ".filetree li.last > ul:before",
817817
"hide lines for last-child directories",
818818
@ display: none;
819819
},
820820
{ ".filetree a",
821821
"tree-view links",
822822
--- src/style.c
+++ src/style.c
@@ -802,20 +802,20 @@
802 @ width: 14px;
803 @ height: 1.5em;
804 @ border-left: 2px solid #aaa;
805 @ border-bottom: 2px solid #aaa;
806 },
807 { ".filetree ul ul:before",
808 "tree-view directory lines",
809 @ content: '';
810 @ position: absolute;
811 @ top: -1.5em;
812 @ bottom: 0;
813 @ left: -35px;
814 @ border-left: 2px solid #aaa;
815 },
816 { ".filetree li:last-child > ul:before",
817 "hide lines for last-child directories",
818 @ display: none;
819 },
820 { ".filetree a",
821 "tree-view links",
822
--- src/style.c
+++ src/style.c
@@ -802,20 +802,20 @@
802 @ width: 14px;
803 @ height: 1.5em;
804 @ border-left: 2px solid #aaa;
805 @ border-bottom: 2px solid #aaa;
806 },
807 { ".filetree li > ul:before",
808 "tree-view directory lines",
809 @ content: '';
810 @ position: absolute;
811 @ top: -1.5em;
812 @ bottom: 0;
813 @ left: -35px;
814 @ border-left: 2px solid #aaa;
815 },
816 { ".filetree li.last > ul:before",
817 "hide lines for last-child directories",
818 @ display: none;
819 },
820 { ".filetree a",
821 "tree-view links",
822

Keyboard Shortcuts

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