Fossil SCM

Add the "lappend" TH1 command. All built-in skins now respond to the "desktoponly" and "wideonly" classes on the main menu.

drh 2021-02-11 03:01 trunk
Commit d4c91b40a4eb05a94a6711ad3aa0641cb5542b291241bb116eae1e9b878a5a97
--- skins/ardoise/css.txt
+++ skins/ardoise/css.txt
@@ -699,17 +699,15 @@
699699
clear: both
700700
z-index: 21;
701701
}
702702
.mainmenu ul {
703703
list-style: none;
704
- display: block;
705704
border-top: 1px solid transparent;
706705
padding: 0
707706
}
708707
.mainmenu li {
709708
outline: 0;
710
- display: block;
711709
float: left;
712710
margin: 0
713711
}
714712
.mainmenu li.active {
715713
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNC40OTggMi4zODEiPjxwYXRoIGQ9Ik00LjIzMyAyLjM4MUguMjY1bC45OTgtMS4wNTguOTg2LTEuMDU4Ljk5OCAxLjA2MnoiIGZpbGw9IiNmZjgwMDAiLz48L3N2Zz4=);
@@ -716,11 +714,10 @@
716714
background-repeat: no-repeat;
717715
background-position: center bottom
718716
}
719717
.mainmenu li a {
720718
color: #66a8c7;
721
- display: block;
722719
padding: 10px 15px
723720
}
724721
.mainmenu li.active a {
725722
text-shadow: 0 0 1px #b1d2e2
726723
}
727724
--- skins/ardoise/css.txt
+++ skins/ardoise/css.txt
@@ -699,17 +699,15 @@
699 clear: both
700 z-index: 21;
701 }
702 .mainmenu ul {
703 list-style: none;
704 display: block;
705 border-top: 1px solid transparent;
706 padding: 0
707 }
708 .mainmenu li {
709 outline: 0;
710 display: block;
711 float: left;
712 margin: 0
713 }
714 .mainmenu li.active {
715 background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNC40OTggMi4zODEiPjxwYXRoIGQ9Ik00LjIzMyAyLjM4MUguMjY1bC45OTgtMS4wNTguOTg2LTEuMDU4Ljk5OCAxLjA2MnoiIGZpbGw9IiNmZjgwMDAiLz48L3N2Zz4=);
@@ -716,11 +714,10 @@
716 background-repeat: no-repeat;
717 background-position: center bottom
718 }
719 .mainmenu li a {
720 color: #66a8c7;
721 display: block;
722 padding: 10px 15px
723 }
724 .mainmenu li.active a {
725 text-shadow: 0 0 1px #b1d2e2
726 }
727
--- skins/ardoise/css.txt
+++ skins/ardoise/css.txt
@@ -699,17 +699,15 @@
699 clear: both
700 z-index: 21;
701 }
702 .mainmenu ul {
703 list-style: none;
 
704 border-top: 1px solid transparent;
705 padding: 0
706 }
707 .mainmenu li {
708 outline: 0;
 
709 float: left;
710 margin: 0
711 }
712 .mainmenu li.active {
713 background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNC40OTggMi4zODEiPjxwYXRoIGQ9Ik00LjIzMyAyLjM4MUguMjY1bC45OTgtMS4wNTguOTg2LTEuMDU4Ljk5OCAxLjA2MnoiIGZpbGw9IiNmZjgwMDAiLz48L3N2Zz4=);
@@ -716,11 +714,10 @@
714 background-repeat: no-repeat;
715 background-position: center bottom
716 }
717 .mainmenu li a {
718 color: #66a8c7;
 
719 padding: 10px 15px
720 }
721 .mainmenu li.active a {
722 text-shadow: 0 0 1px #b1d2e2
723 }
724
--- skins/ardoise/header.txt
+++ skins/ardoise/header.txt
@@ -27,15 +27,14 @@
2727
builtin_request_js hbmenu.js
2828
set once 1
2929
foreach {name url expr class} $mainmenu {
3030
if {![capexpr $expr]} continue
3131
if {$once && [string match /$current_page* $url]} {
32
- html "<li class='active'>"
32
+ lappend class active
3333
set once 0
34
- } else {
35
- html "<li>"
3634
}
35
+ html "<li class='$class'>"
3736
if {[string match /* $url]} {set url $home$url}
3837
html "<a href='$url'>$name</a></li>\n"
3938
}
4039
</th1></ul>
4140
</div> <!-- end div mainmenu -->
4241
--- skins/ardoise/header.txt
+++ skins/ardoise/header.txt
@@ -27,15 +27,14 @@
27 builtin_request_js hbmenu.js
28 set once 1
29 foreach {name url expr class} $mainmenu {
30 if {![capexpr $expr]} continue
31 if {$once && [string match /$current_page* $url]} {
32 html "<li class='active'>"
33 set once 0
34 } else {
35 html "<li>"
36 }
 
37 if {[string match /* $url]} {set url $home$url}
38 html "<a href='$url'>$name</a></li>\n"
39 }
40 </th1></ul>
41 </div> <!-- end div mainmenu -->
42
--- skins/ardoise/header.txt
+++ skins/ardoise/header.txt
@@ -27,15 +27,14 @@
27 builtin_request_js hbmenu.js
28 set once 1
29 foreach {name url expr class} $mainmenu {
30 if {![capexpr $expr]} continue
31 if {$once && [string match /$current_page* $url]} {
32 lappend class active
33 set once 0
 
 
34 }
35 html "<li class='$class'>"
36 if {[string match /* $url]} {set url $home$url}
37 html "<a href='$url'>$name</a></li>\n"
38 }
39 </th1></ul>
40 </div> <!-- end div mainmenu -->
41
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -15,8 +15,8 @@
1515
<div class="mainmenu">
1616
<th1>
1717
foreach {name url expr class} $mainmenu {
1818
if {![capexpr $expr]} continue
1919
if {[string match /* $url]} {set url $home$url}
20
- html "<a href='$url'>$name</a><br/>\n"
20
+ html "<a href='$url' class='$class'>$name</a><br/>\n"
2121
}
2222
</th1></div>
2323
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -15,8 +15,8 @@
15 <div class="mainmenu">
16 <th1>
17 foreach {name url expr class} $mainmenu {
18 if {![capexpr $expr]} continue
19 if {[string match /* $url]} {set url $home$url}
20 html "<a href='$url'>$name</a><br/>\n"
21 }
22 </th1></div>
23
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -15,8 +15,8 @@
15 <div class="mainmenu">
16 <th1>
17 foreach {name url expr class} $mainmenu {
18 if {![capexpr $expr]} continue
19 if {[string match /* $url]} {set url $home$url}
20 html "<a href='$url' class='$class'>$name</a><br/>\n"
21 }
22 </th1></div>
23
--- skins/blitz/css.txt
+++ skins/blitz/css.txt
@@ -848,19 +848,17 @@
848848
clear:both;
849849
}
850850
851851
.mainmenu ul {
852852
list-style: none outside;
853
- display: block;
854853
position: relative;
855854
border-top: 1px solid #ccc;
856855
padding: 0;
857856
}
858857
859858
.mainmenu li {
860859
outline: 0;
861
- display: block;
862860
float: left;
863861
margin: 0;
864862
}
865863
866864
.mainmenu li.active {
@@ -869,11 +867,10 @@
869867
background-position: center bottom;
870868
}
871869
872870
.mainmenu li a {
873871
color: #3b5c6b;
874
- display: block;
875872
padding: 10px 15px;
876873
}
877874
878875
.mainmenu li.active a {
879876
font-weight: bold;
880877
--- skins/blitz/css.txt
+++ skins/blitz/css.txt
@@ -848,19 +848,17 @@
848 clear:both;
849 }
850
851 .mainmenu ul {
852 list-style: none outside;
853 display: block;
854 position: relative;
855 border-top: 1px solid #ccc;
856 padding: 0;
857 }
858
859 .mainmenu li {
860 outline: 0;
861 display: block;
862 float: left;
863 margin: 0;
864 }
865
866 .mainmenu li.active {
@@ -869,11 +867,10 @@
869 background-position: center bottom;
870 }
871
872 .mainmenu li a {
873 color: #3b5c6b;
874 display: block;
875 padding: 10px 15px;
876 }
877
878 .mainmenu li.active a {
879 font-weight: bold;
880
--- skins/blitz/css.txt
+++ skins/blitz/css.txt
@@ -848,19 +848,17 @@
848 clear:both;
849 }
850
851 .mainmenu ul {
852 list-style: none outside;
 
853 position: relative;
854 border-top: 1px solid #ccc;
855 padding: 0;
856 }
857
858 .mainmenu li {
859 outline: 0;
 
860 float: left;
861 margin: 0;
862 }
863
864 .mainmenu li.active {
@@ -869,11 +867,10 @@
867 background-position: center bottom;
868 }
869
870 .mainmenu li a {
871 color: #3b5c6b;
 
872 padding: 10px 15px;
873 }
874
875 .mainmenu li.active a {
876 font-weight: bold;
877
--- skins/blitz/header.txt
+++ skins/blitz/header.txt
@@ -28,15 +28,14 @@
2828
<ul><th1>
2929
set once 1
3030
foreach {name url expr class} $mainmenu {
3131
if {![capexpr $expr]} continue
3232
if {$once && [string match /$current_page* $url]} {
33
- html "<li class='active'>"
33
+ lappend class active
3434
set once 0
35
- } else {
36
- html "<li>"
3735
}
36
+ html "<li class='$class'>"
3837
if {[string match /* $url]} {set url $home$url}
3938
html "<a href='$url'>$name</a></li>\n"
4039
}
4140
</th1></ul>
4241
</div> <!-- end div mainmenu -->
4342
--- skins/blitz/header.txt
+++ skins/blitz/header.txt
@@ -28,15 +28,14 @@
28 <ul><th1>
29 set once 1
30 foreach {name url expr class} $mainmenu {
31 if {![capexpr $expr]} continue
32 if {$once && [string match /$current_page* $url]} {
33 html "<li class='active'>"
34 set once 0
35 } else {
36 html "<li>"
37 }
 
38 if {[string match /* $url]} {set url $home$url}
39 html "<a href='$url'>$name</a></li>\n"
40 }
41 </th1></ul>
42 </div> <!-- end div mainmenu -->
43
--- skins/blitz/header.txt
+++ skins/blitz/header.txt
@@ -28,15 +28,14 @@
28 <ul><th1>
29 set once 1
30 foreach {name url expr class} $mainmenu {
31 if {![capexpr $expr]} continue
32 if {$once && [string match /$current_page* $url]} {
33 lappend class active
34 set once 0
 
 
35 }
36 html "<li class='$class'>"
37 if {[string match /* $url]} {set url $home$url}
38 html "<a href='$url'>$name</a></li>\n"
39 }
40 </th1></ul>
41 </div> <!-- end div mainmenu -->
42
--- skins/blitz_no_logo/css.txt
+++ skins/blitz_no_logo/css.txt
@@ -848,19 +848,17 @@
848848
clear:both;
849849
}
850850
851851
.mainmenu ul {
852852
list-style: none outside;
853
- display: block;
854853
position: relative;
855854
border-top: 1px solid #ccc;
856855
padding: 0;
857856
}
858857
859858
.mainmenu li {
860859
outline: 0;
861
- display: block;
862860
float: left;
863861
margin: 0;
864862
}
865863
866864
.mainmenu li.active {
@@ -869,11 +867,10 @@
869867
background-position: center bottom;
870868
}
871869
872870
.mainmenu li a {
873871
color: #3b5c6b;
874
- display: block;
875872
padding: 10px 15px;
876873
}
877874
878875
.mainmenu li.active a {
879876
font-weight: bold;
880877
--- skins/blitz_no_logo/css.txt
+++ skins/blitz_no_logo/css.txt
@@ -848,19 +848,17 @@
848 clear:both;
849 }
850
851 .mainmenu ul {
852 list-style: none outside;
853 display: block;
854 position: relative;
855 border-top: 1px solid #ccc;
856 padding: 0;
857 }
858
859 .mainmenu li {
860 outline: 0;
861 display: block;
862 float: left;
863 margin: 0;
864 }
865
866 .mainmenu li.active {
@@ -869,11 +867,10 @@
869 background-position: center bottom;
870 }
871
872 .mainmenu li a {
873 color: #3b5c6b;
874 display: block;
875 padding: 10px 15px;
876 }
877
878 .mainmenu li.active a {
879 font-weight: bold;
880
--- skins/blitz_no_logo/css.txt
+++ skins/blitz_no_logo/css.txt
@@ -848,19 +848,17 @@
848 clear:both;
849 }
850
851 .mainmenu ul {
852 list-style: none outside;
 
853 position: relative;
854 border-top: 1px solid #ccc;
855 padding: 0;
856 }
857
858 .mainmenu li {
859 outline: 0;
 
860 float: left;
861 margin: 0;
862 }
863
864 .mainmenu li.active {
@@ -869,11 +867,10 @@
867 background-position: center bottom;
868 }
869
870 .mainmenu li a {
871 color: #3b5c6b;
 
872 padding: 10px 15px;
873 }
874
875 .mainmenu li.active a {
876 font-weight: bold;
877
--- skins/blitz_no_logo/header.txt
+++ skins/blitz_no_logo/header.txt
@@ -25,15 +25,14 @@
2525
<ul><th1>
2626
set once 1
2727
foreach {name url expr class} $mainmenu {
2828
if {![capexpr $expr]} continue
2929
if {$once && [string match /$current_page* $url]} {
30
- html "<li class='active'>"
30
+ lappend class active
3131
set once 0
32
- } else {
33
- html "<li>"
3432
}
33
+ html "<li class='$class'>"
3534
if {[string match /* $url]} {set url $home$url}
3635
html "<a href='$url'>$name</a></li>\n"
3736
}
3837
</th1></ul>
3938
</div> <!-- end div mainmenu -->
4039
--- skins/blitz_no_logo/header.txt
+++ skins/blitz_no_logo/header.txt
@@ -25,15 +25,14 @@
25 <ul><th1>
26 set once 1
27 foreach {name url expr class} $mainmenu {
28 if {![capexpr $expr]} continue
29 if {$once && [string match /$current_page* $url]} {
30 html "<li class='active'>"
31 set once 0
32 } else {
33 html "<li>"
34 }
 
35 if {[string match /* $url]} {set url $home$url}
36 html "<a href='$url'>$name</a></li>\n"
37 }
38 </th1></ul>
39 </div> <!-- end div mainmenu -->
40
--- skins/blitz_no_logo/header.txt
+++ skins/blitz_no_logo/header.txt
@@ -25,15 +25,14 @@
25 <ul><th1>
26 set once 1
27 foreach {name url expr class} $mainmenu {
28 if {![capexpr $expr]} continue
29 if {$once && [string match /$current_page* $url]} {
30 lappend class active
31 set once 0
 
 
32 }
33 html "<li class='$class'>"
34 if {[string match /* $url]} {set url $home$url}
35 html "<a href='$url'>$name</a></li>\n"
36 }
37 </th1></ul>
38 </div> <!-- end div mainmenu -->
39
--- skins/darkmode/css.txt
+++ skins/darkmode/css.txt
@@ -550,18 +550,5 @@
550550
551551
body.forum .forumPostBody > div blockquote {
552552
border: 1px inset;
553553
padding: 0 0.5em;
554554
}
555
-
556
-@media screen and (max-width: 600px) {
557
- /* Spacing for mobile */
558
- .desktoponly {
559
- display: none;
560
- }
561
-}
562
-@media screen and (max-width: 1200px) {
563
- /* Special declarations for narrow desktop or wide mobile */
564
- .wideonly {
565
- display: none;
566
- }
567
-}
568555
--- skins/darkmode/css.txt
+++ skins/darkmode/css.txt
@@ -550,18 +550,5 @@
550
551 body.forum .forumPostBody > div blockquote {
552 border: 1px inset;
553 padding: 0 0.5em;
554 }
555
556 @media screen and (max-width: 600px) {
557 /* Spacing for mobile */
558 .desktoponly {
559 display: none;
560 }
561 }
562 @media screen and (max-width: 1200px) {
563 /* Special declarations for narrow desktop or wide mobile */
564 .wideonly {
565 display: none;
566 }
567 }
568
--- skins/darkmode/css.txt
+++ skins/darkmode/css.txt
@@ -550,18 +550,5 @@
550
551 body.forum .forumPostBody > div blockquote {
552 border: 1px inset;
553 padding: 0 0.5em;
554 }
 
 
 
 
 
 
 
 
 
 
 
 
 
555
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -272,13 +272,10 @@
272272
padding: 10px 10px;
273273
}
274274
.mainmenu {
275275
padding: 10px;
276276
}
277
- .desktoponly {
278
- display: none;
279
- }
280277
}
281278
@media screen and (min-width: 600px) {
282279
/* Spacing for desktop */
283280
body {
284281
padding-left: 20px;
@@ -294,11 +291,5 @@
294291
}
295292
.mainmenu {
296293
padding: 10px;
297294
}
298295
}
299
-@media screen and (max-width: 1200px) {
300
- /* Special declarations for narrow desktop or wide mobile */
301
- .wideonly {
302
- display: none;
303
- }
304
-}
305296
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -272,13 +272,10 @@
272 padding: 10px 10px;
273 }
274 .mainmenu {
275 padding: 10px;
276 }
277 .desktoponly {
278 display: none;
279 }
280 }
281 @media screen and (min-width: 600px) {
282 /* Spacing for desktop */
283 body {
284 padding-left: 20px;
@@ -294,11 +291,5 @@
294 }
295 .mainmenu {
296 padding: 10px;
297 }
298 }
299 @media screen and (max-width: 1200px) {
300 /* Special declarations for narrow desktop or wide mobile */
301 .wideonly {
302 display: none;
303 }
304 }
305
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -272,13 +272,10 @@
272 padding: 10px 10px;
273 }
274 .mainmenu {
275 padding: 10px;
276 }
 
 
 
277 }
278 @media screen and (min-width: 600px) {
279 /* Spacing for desktop */
280 body {
281 padding-left: 20px;
@@ -294,11 +291,5 @@
291 }
292 .mainmenu {
293 padding: 10px;
294 }
295 }
 
 
 
 
 
 
296
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -93,11 +93,11 @@
9393
</script>
9494
<div class="mainmenu"><th1>
9595
foreach {name url expr class} $mainmenu {
9696
if {![capexpr $expr]} continue
9797
if {[string match /* $url]} {set url $home$url}
98
- html "<a href='$url'>$name</a>\n"
98
+ html "<a href='$url' class='$class'>$name</a>\n"
9999
}
100100
if {[info exists login]} {
101101
html "<a href='$home/logout'>Logout</a>\n"
102102
} else {
103103
html "<a href='$home/login'>Login</a>\n"
104104
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -93,11 +93,11 @@
93 </script>
94 <div class="mainmenu"><th1>
95 foreach {name url expr class} $mainmenu {
96 if {![capexpr $expr]} continue
97 if {[string match /* $url]} {set url $home$url}
98 html "<a href='$url'>$name</a>\n"
99 }
100 if {[info exists login]} {
101 html "<a href='$home/logout'>Logout</a>\n"
102 } else {
103 html "<a href='$home/login'>Login</a>\n"
104
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -93,11 +93,11 @@
93 </script>
94 <div class="mainmenu"><th1>
95 foreach {name url expr class} $mainmenu {
96 if {![capexpr $expr]} continue
97 if {[string match /* $url]} {set url $home$url}
98 html "<a href='$url' class='$class'>$name</a>\n"
99 }
100 if {[info exists login]} {
101 html "<a href='$home/logout'>Logout</a>\n"
102 } else {
103 html "<a href='$home/login'>Login</a>\n"
104
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -93,8 +93,8 @@
9393
</script>
9494
<div class="mainmenu"><th1>
9595
foreach {name url expr class} $mainmenu {
9696
if {![capexpr $expr]} continue
9797
if {[string match /* $url]} {set url $home$url}
98
- html "<a href='$url'>$name</a>\n"
98
+ html "<a href='$url' class='$class'>$name</a>\n"
9999
}
100100
</th1></div>
101101
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -93,8 +93,8 @@
93 </script>
94 <div class="mainmenu"><th1>
95 foreach {name url expr class} $mainmenu {
96 if {![capexpr $expr]} continue
97 if {[string match /* $url]} {set url $home$url}
98 html "<a href='$url'>$name</a>\n"
99 }
100 </th1></div>
101
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -93,8 +93,8 @@
93 </script>
94 <div class="mainmenu"><th1>
95 foreach {name url expr class} $mainmenu {
96 if {![capexpr $expr]} continue
97 if {[string match /* $url]} {set url $home$url}
98 html "<a href='$url' class='$class'>$name</a>\n"
99 }
100 </th1></div>
101
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -14,9 +14,9 @@
1414
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
1515
builtin_request_js hbmenu.js
1616
foreach {name url expr class} $mainmenu {
1717
if {![capexpr $expr]} continue
1818
if {[string match /* $url]} {set url $home$url}
19
- html "<a href='$url'>$name</a>\n"
19
+ html "<a href='$url' class='$class'>$name</a>\n"
2020
}
2121
</th1></div>
2222
<div id='hbdrop'></div>
2323
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -14,9 +14,9 @@
14 html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
15 builtin_request_js hbmenu.js
16 foreach {name url expr class} $mainmenu {
17 if {![capexpr $expr]} continue
18 if {[string match /* $url]} {set url $home$url}
19 html "<a href='$url'>$name</a>\n"
20 }
21 </th1></div>
22 <div id='hbdrop'></div>
23
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -14,9 +14,9 @@
14 html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
15 builtin_request_js hbmenu.js
16 foreach {name url expr class} $mainmenu {
17 if {![capexpr $expr]} continue
18 if {[string match /* $url]} {set url $home$url}
19 html "<a href='$url' class='$class'>$name</a>\n"
20 }
21 </th1></div>
22 <div id='hbdrop'></div>
23
--- skins/original/header.txt
+++ skins/original/header.txt
@@ -13,8 +13,8 @@
1313
</div>
1414
<div class="mainmenu"><th1>
1515
foreach {name url expr class} $mainmenu {
1616
if {![capexpr $expr]} continue
1717
if {[string match /* $url]} {set url $home$url}
18
- html "<a href='$url'>$name</a>\n"
18
+ html "<a href='$url' class='$class'>$name</a>\n"
1919
}
2020
</th1></div>
2121
--- skins/original/header.txt
+++ skins/original/header.txt
@@ -13,8 +13,8 @@
13 </div>
14 <div class="mainmenu"><th1>
15 foreach {name url expr class} $mainmenu {
16 if {![capexpr $expr]} continue
17 if {[string match /* $url]} {set url $home$url}
18 html "<a href='$url'>$name</a>\n"
19 }
20 </th1></div>
21
--- skins/original/header.txt
+++ skins/original/header.txt
@@ -13,8 +13,8 @@
13 </div>
14 <div class="mainmenu"><th1>
15 foreach {name url expr class} $mainmenu {
16 if {![capexpr $expr]} continue
17 if {[string match /* $url]} {set url $home$url}
18 html "<a href='$url' class='$class'>$name</a>\n"
19 }
20 </th1></div>
21
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -6,9 +6,9 @@
66
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
77
builtin_request_js hbmenu.js
88
foreach {name url expr class} $mainmenu {
99
if {![capexpr $expr]} continue
1010
if {[string match /* $url]} {set url $home$url}
11
- html "<a href='$url'>$name</a>\n"
11
+ html "<a href='$url' class='$class'>$name</a>\n"
1212
}
1313
</th1></div>
1414
<div id='hbdrop' class='hbdrop'></div>
1515
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -6,9 +6,9 @@
6 html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
7 builtin_request_js hbmenu.js
8 foreach {name url expr class} $mainmenu {
9 if {![capexpr $expr]} continue
10 if {[string match /* $url]} {set url $home$url}
11 html "<a href='$url'>$name</a>\n"
12 }
13 </th1></div>
14 <div id='hbdrop' class='hbdrop'></div>
15
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -6,9 +6,9 @@
6 html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
7 builtin_request_js hbmenu.js
8 foreach {name url expr class} $mainmenu {
9 if {![capexpr $expr]} continue
10 if {[string match /* $url]} {set url $home$url}
11 html "<a href='$url' class='$class'>$name</a>\n"
12 }
13 </th1></div>
14 <div id='hbdrop' class='hbdrop'></div>
15
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -14,8 +14,8 @@
1414
</div>
1515
<div class="mainmenu"><th1>
1616
foreach {name url expr class} $mainmenu {
1717
if {![capexpr $expr]} continue
1818
if {[string match /* $url]} {set url $home$url}
19
- html "<a href='$url'>$name</a>\n"
19
+ html "<a href='$url' class='$class'>$name</a>\n"
2020
}
2121
</th1></div>
2222
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -14,8 +14,8 @@
14 </div>
15 <div class="mainmenu"><th1>
16 foreach {name url expr class} $mainmenu {
17 if {![capexpr $expr]} continue
18 if {[string match /* $url]} {set url $home$url}
19 html "<a href='$url'>$name</a>\n"
20 }
21 </th1></div>
22
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -14,8 +14,8 @@
14 </div>
15 <div class="mainmenu"><th1>
16 foreach {name url expr class} $mainmenu {
17 if {![capexpr $expr]} continue
18 if {[string match /* $url]} {set url $home$url}
19 html "<a href='$url' class='$class'>$name</a>\n"
20 }
21 </th1></div>
22
--- skins/xekri/header.txt
+++ skins/xekri/header.txt
@@ -94,11 +94,11 @@
9494
<div class="mainmenu"><th1>
9595
foreach {name url expr class} $mainmenu {
9696
if {![capexpr $expr]} continue
9797
if {[string match /* $url]} {
9898
if {[string match /$current_page* $url]} {
99
- set class "active $class"
99
+ lappend class active
100100
}
101101
set url $home$url
102102
}
103103
html "<a href='$url' class='$class'>$name</a>\n"
104104
}
105105
--- skins/xekri/header.txt
+++ skins/xekri/header.txt
@@ -94,11 +94,11 @@
94 <div class="mainmenu"><th1>
95 foreach {name url expr class} $mainmenu {
96 if {![capexpr $expr]} continue
97 if {[string match /* $url]} {
98 if {[string match /$current_page* $url]} {
99 set class "active $class"
100 }
101 set url $home$url
102 }
103 html "<a href='$url' class='$class'>$name</a>\n"
104 }
105
--- skins/xekri/header.txt
+++ skins/xekri/header.txt
@@ -94,11 +94,11 @@
94 <div class="mainmenu"><th1>
95 foreach {name url expr class} $mainmenu {
96 if {![capexpr $expr]} continue
97 if {[string match /* $url]} {
98 if {[string match /$current_page* $url]} {
99 lappend class active
100 }
101 set url $home$url
102 }
103 html "<a href='$url' class='$class'>$name</a>\n"
104 }
105
--- src/default.css
+++ src/default.css
@@ -1762,5 +1762,18 @@
17621762
17631763
body.chat #chat-drop-details img {
17641764
max-width: 45%;
17651765
max-height: 45%;
17661766
}
1767
+
1768
+/* Objects in the "desktoponly" class are invisible on mobile */
1769
+@media screen and (max-width: 600px) {
1770
+ .desktoponly {
1771
+ display: none;
1772
+ }
1773
+}
1774
+/* Objects in the "wideonly" class are invisible only on wide-screen desktops */
1775
+@media screen and (max-width: 1200px) {
1776
+ .wideonly {
1777
+ display: none;
1778
+ }
1779
+}
17671780
--- src/default.css
+++ src/default.css
@@ -1762,5 +1762,18 @@
1762
1763 body.chat #chat-drop-details img {
1764 max-width: 45%;
1765 max-height: 45%;
1766 }
 
 
 
 
 
 
 
 
 
 
 
 
 
1767
--- src/default.css
+++ src/default.css
@@ -1762,5 +1762,18 @@
1762
1763 body.chat #chat-drop-details img {
1764 max-width: 45%;
1765 max-height: 45%;
1766 }
1767
1768 /* Objects in the "desktoponly" class are invisible on mobile */
1769 @media screen and (max-width: 600px) {
1770 .desktoponly {
1771 display: none;
1772 }
1773 }
1774 /* Objects in the "wideonly" class are invisible only on wide-screen desktops */
1775 @media screen and (max-width: 1200px) {
1776 .wideonly {
1777 display: none;
1778 }
1779 }
1780
+34 -13
--- src/style.c
+++ src/style.c
@@ -1097,13 +1097,14 @@
10971097
style_init_th1_vars(0);
10981098
Th_Render(zScript?zScript:"");
10991099
}
11001100
11011101
/*
1102
-** If one of the "name" or "page" URL parameters (in that order)
1103
-** is set then this function looks for page/page group-specific
1104
-** CSS and (if found) appends it to pOut, else it is a no-op.
1102
+** Check for "name" or "page" query parameters on an /style.css
1103
+** page request. If present, then page-specific CSS is requested,
1104
+** so add that CSS to pOut. If the "name" and "page" query parameters
1105
+** are omitted, then pOut is unchnaged.
11051106
*/
11061107
static void page_style_css_append_page_style(Blob *pOut){
11071108
const char *zPage = PD("name",P("page"));
11081109
char * zFile;
11091110
int nFile = 0;
@@ -1115,19 +1116,14 @@
11151116
zFile = mprintf("style.%s.css", zPage);
11161117
zBuiltin = (const char *)builtin_file(zFile, &nFile);
11171118
if(nFile>0){
11181119
blob_appendf(pOut,
11191120
"\n/***********************************************************\n"
1120
- "** Start of page-specific CSS for page %s...\n"
1121
+ "** Page-specific CSS for \"%s\"\n"
11211122
"***********************************************************/\n",
11221123
zPage);
11231124
blob_append(pOut, zBuiltin, nFile);
1124
- blob_appendf(pOut,
1125
- "\n/***********************************************************\n"
1126
- "** End of page-specific CSS for page %s.\n"
1127
- "***********************************************************/\n",
1128
- zPage);
11291125
fossil_free(zFile);
11301126
return;
11311127
}
11321128
/* Potential TODO: check for aliases/page groups. e.g. group all
11331129
** /forumXYZ CSS into one file, all /setupXYZ into another, etc. As
@@ -1137,29 +1133,54 @@
11371133
}
11381134
11391135
/*
11401136
** WEBPAGE: style.css
11411137
**
1142
-** Return the style sheet.
1138
+** Return the style sheet. The style sheet is assemblied from
1139
+** multiple sources, in order:
1140
+**
1141
+** (1) The built-in "default.css" style sheet containing basic defaults.
1142
+**
1143
+** (2) The page-specific style sheet taken from the built-in
1144
+** called "PAGENAME.css" where PAGENAME is the value of the name=
1145
+** or page= query parameters. If neither name= nor page= exist,
1146
+** then this section is a no-op.
1147
+**
1148
+** (3) The skin-specific "css.txt" file, if there one.
1149
+**
1150
+** All of (1), (2), and (3) above (or as many as exist) are concatenated.
1151
+** The result is then run through TH1 with the following variables set:
1152
+**
1153
+** * $basename
1154
+** * $secureurl
1155
+** * $home
1156
+** * $logo
1157
+** * $background
1158
+**
1159
+** The output from TH1 becomes the style sheet. Fossil always reports
1160
+** that the style sheet is cacheable.
11431161
*/
11441162
void page_style_css(void){
11451163
Blob css = empty_blob;
11461164
int i;
11471165
const char * zDefaults;
1166
+ const char *zSkin;
11481167
11491168
cgi_set_content_type("text/css");
11501169
etag_check(0, 0);
11511170
/* Emit all default rules... */
11521171
zDefaults = (const char*)builtin_file("default.css", &i);
11531172
blob_append(&css, zDefaults, i);
11541173
/* Page-specific CSS, if any... */
11551174
page_style_css_append_page_style(&css);
1156
- blob_append(&css,
1175
+ zSkin = skin_in_use();
1176
+ if( zSkin==0 ) zSkin = "this repository";
1177
+ blob_appendf(&css,
11571178
"\n/***********************************************************\n"
1158
- "** All CSS which follows is supplied by the repository \"skin\".\n"
1179
+ "** Skin-specific CSS for %s\n"
11591180
"***********************************************************/\n",
1160
- -1);
1181
+ zSkin);
11611182
blob_append(&css,skin_get("css"),-1);
11621183
/* Process through TH1 in order to give an opportunity to substitute
11631184
** variables such as $baseurl.
11641185
*/
11651186
Th_Store("baseurl", g.zBaseURL);
11661187
--- src/style.c
+++ src/style.c
@@ -1097,13 +1097,14 @@
1097 style_init_th1_vars(0);
1098 Th_Render(zScript?zScript:"");
1099 }
1100
1101 /*
1102 ** If one of the "name" or "page" URL parameters (in that order)
1103 ** is set then this function looks for page/page group-specific
1104 ** CSS and (if found) appends it to pOut, else it is a no-op.
 
1105 */
1106 static void page_style_css_append_page_style(Blob *pOut){
1107 const char *zPage = PD("name",P("page"));
1108 char * zFile;
1109 int nFile = 0;
@@ -1115,19 +1116,14 @@
1115 zFile = mprintf("style.%s.css", zPage);
1116 zBuiltin = (const char *)builtin_file(zFile, &nFile);
1117 if(nFile>0){
1118 blob_appendf(pOut,
1119 "\n/***********************************************************\n"
1120 "** Start of page-specific CSS for page %s...\n"
1121 "***********************************************************/\n",
1122 zPage);
1123 blob_append(pOut, zBuiltin, nFile);
1124 blob_appendf(pOut,
1125 "\n/***********************************************************\n"
1126 "** End of page-specific CSS for page %s.\n"
1127 "***********************************************************/\n",
1128 zPage);
1129 fossil_free(zFile);
1130 return;
1131 }
1132 /* Potential TODO: check for aliases/page groups. e.g. group all
1133 ** /forumXYZ CSS into one file, all /setupXYZ into another, etc. As
@@ -1137,29 +1133,54 @@
1137 }
1138
1139 /*
1140 ** WEBPAGE: style.css
1141 **
1142 ** Return the style sheet.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1143 */
1144 void page_style_css(void){
1145 Blob css = empty_blob;
1146 int i;
1147 const char * zDefaults;
 
1148
1149 cgi_set_content_type("text/css");
1150 etag_check(0, 0);
1151 /* Emit all default rules... */
1152 zDefaults = (const char*)builtin_file("default.css", &i);
1153 blob_append(&css, zDefaults, i);
1154 /* Page-specific CSS, if any... */
1155 page_style_css_append_page_style(&css);
1156 blob_append(&css,
 
 
1157 "\n/***********************************************************\n"
1158 "** All CSS which follows is supplied by the repository \"skin\".\n"
1159 "***********************************************************/\n",
1160 -1);
1161 blob_append(&css,skin_get("css"),-1);
1162 /* Process through TH1 in order to give an opportunity to substitute
1163 ** variables such as $baseurl.
1164 */
1165 Th_Store("baseurl", g.zBaseURL);
1166
--- src/style.c
+++ src/style.c
@@ -1097,13 +1097,14 @@
1097 style_init_th1_vars(0);
1098 Th_Render(zScript?zScript:"");
1099 }
1100
1101 /*
1102 ** Check for "name" or "page" query parameters on an /style.css
1103 ** page request. If present, then page-specific CSS is requested,
1104 ** so add that CSS to pOut. If the "name" and "page" query parameters
1105 ** are omitted, then pOut is unchnaged.
1106 */
1107 static void page_style_css_append_page_style(Blob *pOut){
1108 const char *zPage = PD("name",P("page"));
1109 char * zFile;
1110 int nFile = 0;
@@ -1115,19 +1116,14 @@
1116 zFile = mprintf("style.%s.css", zPage);
1117 zBuiltin = (const char *)builtin_file(zFile, &nFile);
1118 if(nFile>0){
1119 blob_appendf(pOut,
1120 "\n/***********************************************************\n"
1121 "** Page-specific CSS for \"%s\"\n"
1122 "***********************************************************/\n",
1123 zPage);
1124 blob_append(pOut, zBuiltin, nFile);
 
 
 
 
 
1125 fossil_free(zFile);
1126 return;
1127 }
1128 /* Potential TODO: check for aliases/page groups. e.g. group all
1129 ** /forumXYZ CSS into one file, all /setupXYZ into another, etc. As
@@ -1137,29 +1133,54 @@
1133 }
1134
1135 /*
1136 ** WEBPAGE: style.css
1137 **
1138 ** Return the style sheet. The style sheet is assemblied from
1139 ** multiple sources, in order:
1140 **
1141 ** (1) The built-in "default.css" style sheet containing basic defaults.
1142 **
1143 ** (2) The page-specific style sheet taken from the built-in
1144 ** called "PAGENAME.css" where PAGENAME is the value of the name=
1145 ** or page= query parameters. If neither name= nor page= exist,
1146 ** then this section is a no-op.
1147 **
1148 ** (3) The skin-specific "css.txt" file, if there one.
1149 **
1150 ** All of (1), (2), and (3) above (or as many as exist) are concatenated.
1151 ** The result is then run through TH1 with the following variables set:
1152 **
1153 ** * $basename
1154 ** * $secureurl
1155 ** * $home
1156 ** * $logo
1157 ** * $background
1158 **
1159 ** The output from TH1 becomes the style sheet. Fossil always reports
1160 ** that the style sheet is cacheable.
1161 */
1162 void page_style_css(void){
1163 Blob css = empty_blob;
1164 int i;
1165 const char * zDefaults;
1166 const char *zSkin;
1167
1168 cgi_set_content_type("text/css");
1169 etag_check(0, 0);
1170 /* Emit all default rules... */
1171 zDefaults = (const char*)builtin_file("default.css", &i);
1172 blob_append(&css, zDefaults, i);
1173 /* Page-specific CSS, if any... */
1174 page_style_css_append_page_style(&css);
1175 zSkin = skin_in_use();
1176 if( zSkin==0 ) zSkin = "this repository";
1177 blob_appendf(&css,
1178 "\n/***********************************************************\n"
1179 "** Skin-specific CSS for %s\n"
1180 "***********************************************************/\n",
1181 zSkin);
1182 blob_append(&css,skin_get("css"),-1);
1183 /* Process through TH1 in order to give an opportunity to substitute
1184 ** variables such as $baseurl.
1185 */
1186 Th_Store("baseurl", g.zBaseURL);
1187
--- src/th_lang.c
+++ src/th_lang.c
@@ -228,10 +228,48 @@
228228
return TH_OK;
229229
}
230230
231231
/*
232232
** TH Syntax:
233
+**
234
+** lappend var ?arg1? ?arg2? ...?
235
+**
236
+** Interpret the content of variable var as a list. Create var if it
237
+** does not already exist. Append each argument as a new list element.
238
+*/
239
+static int lappend_command(
240
+ Th_Interp *interp,
241
+ void *ctx,
242
+ int argc,
243
+ const char **argv,
244
+ int *argl
245
+){
246
+ char *zList = 0;
247
+ int nList = 0;
248
+ int i, rc;
249
+
250
+ if( argc<2 ){
251
+ return Th_WrongNumArgs(interp, "lappend var ...");
252
+ }
253
+ rc = Th_GetVar(interp, argv[1], argl[1]);
254
+ if( rc==TH_OK ){
255
+ zList = Th_TakeResult(interp, &nList);
256
+ }
257
+
258
+ for(i=2; i<argc; i++){
259
+ Th_ListAppend(interp, &zList, &nList, argv[i], argl[i]);
260
+ }
261
+
262
+ Th_SetResult(interp, zList, nList);
263
+ Th_Free(interp, zList);
264
+
265
+ return TH_OK;
266
+}
267
+
268
+
269
+/*
270
+** TH Syntax:
233271
**
234272
** lindex list index
235273
*/
236274
static int lindex_command(
237275
Th_Interp *interp,
@@ -1354,10 +1392,11 @@
13541392
{"expr", expr_command, 0},
13551393
{"for", for_command, 0},
13561394
{"foreach", foreach_command, 0},
13571395
{"if", if_command, 0},
13581396
{"info", info_command, 0},
1397
+ {"lappend", lappend_command, 0},
13591398
{"lindex", lindex_command, 0},
13601399
{"list", list_command, 0},
13611400
{"llength", llength_command, 0},
13621401
{"lsearch", lsearch_command, 0},
13631402
{"proc", proc_command, 0},
13641403
--- src/th_lang.c
+++ src/th_lang.c
@@ -228,10 +228,48 @@
228 return TH_OK;
229 }
230
231 /*
232 ** TH Syntax:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233 **
234 ** lindex list index
235 */
236 static int lindex_command(
237 Th_Interp *interp,
@@ -1354,10 +1392,11 @@
1354 {"expr", expr_command, 0},
1355 {"for", for_command, 0},
1356 {"foreach", foreach_command, 0},
1357 {"if", if_command, 0},
1358 {"info", info_command, 0},
 
1359 {"lindex", lindex_command, 0},
1360 {"list", list_command, 0},
1361 {"llength", llength_command, 0},
1362 {"lsearch", lsearch_command, 0},
1363 {"proc", proc_command, 0},
1364
--- src/th_lang.c
+++ src/th_lang.c
@@ -228,10 +228,48 @@
228 return TH_OK;
229 }
230
231 /*
232 ** TH Syntax:
233 **
234 ** lappend var ?arg1? ?arg2? ...?
235 **
236 ** Interpret the content of variable var as a list. Create var if it
237 ** does not already exist. Append each argument as a new list element.
238 */
239 static int lappend_command(
240 Th_Interp *interp,
241 void *ctx,
242 int argc,
243 const char **argv,
244 int *argl
245 ){
246 char *zList = 0;
247 int nList = 0;
248 int i, rc;
249
250 if( argc<2 ){
251 return Th_WrongNumArgs(interp, "lappend var ...");
252 }
253 rc = Th_GetVar(interp, argv[1], argl[1]);
254 if( rc==TH_OK ){
255 zList = Th_TakeResult(interp, &nList);
256 }
257
258 for(i=2; i<argc; i++){
259 Th_ListAppend(interp, &zList, &nList, argv[i], argl[i]);
260 }
261
262 Th_SetResult(interp, zList, nList);
263 Th_Free(interp, zList);
264
265 return TH_OK;
266 }
267
268
269 /*
270 ** TH Syntax:
271 **
272 ** lindex list index
273 */
274 static int lindex_command(
275 Th_Interp *interp,
@@ -1354,10 +1392,11 @@
1392 {"expr", expr_command, 0},
1393 {"for", for_command, 0},
1394 {"foreach", foreach_command, 0},
1395 {"if", if_command, 0},
1396 {"info", info_command, 0},
1397 {"lappend", lappend_command, 0},
1398 {"lindex", lindex_command, 0},
1399 {"list", list_command, 0},
1400 {"llength", llength_command, 0},
1401 {"lsearch", lsearch_command, 0},
1402 {"proc", proc_command, 0},
1403

Keyboard Shortcuts

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