Fossil

Check-in [d4c91b40a4]
Login

Check-in [d4c91b40a4]

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

Overview
Comment:Add the "lappend" TH1 command. All built-in skins now respond to the "desktoponly" and "wideonly" classes on the main menu.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d4c91b40a4eb05a94a6711ad3aa0641cb5542b291241bb116eae1e9b878a5a97
User & Date: drh 2021-02-11 03:01:20.691
Context
2021-02-11
14:33
Simplify the palette of built-in skins by combining "original", "enhanced1", and "rounded1" into just "original" and combining "blitz_no_logo" into "blitz". Update all built-in skins so that they sitemap is accessible from the menu by default. ... (check-in: 22fb2de45e user: drh tags: trunk)
03:01
Add the "lappend" TH1 command. All built-in skins now respond to the "desktoponly" and "wideonly" classes on the main menu. ... (check-in: d4c91b40a4 user: drh tags: trunk)
00:35
Improved hover colors for tree-view and file-ages in the darkmode skin. ... (check-in: eb5356185e user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to skins/ardoise/css.txt.
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
  border-top-right-radius: 15px;
  border-top-left-radius: 15px;
  clear: both
  z-index: 21;
}
.mainmenu ul {
  list-style: none;
  display: block;
  border-top: 1px solid transparent;
  padding: 0
}
.mainmenu li {
  outline: 0;
  display: block;
  float: left;
  margin: 0
}
.mainmenu li.active {
  background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNC40OTggMi4zODEiPjxwYXRoIGQ9Ik00LjIzMyAyLjM4MUguMjY1bC45OTgtMS4wNTguOTg2LTEuMDU4Ljk5OCAxLjA2MnoiIGZpbGw9IiNmZjgwMDAiLz48L3N2Zz4=);
  background-repeat: no-repeat;
  background-position: center bottom
}
.mainmenu li a {
  color: #66a8c7;
  display: block;
  padding: 10px 15px
}
.mainmenu li.active a {
  text-shadow: 0 0 1px #b1d2e2
}
.mainmenu li:hover {
  background-color: #ff8000;







<





<










<







697
698
699
700
701
702
703

704
705
706
707
708

709
710
711
712
713
714
715
716
717
718

719
720
721
722
723
724
725
  border-top-right-radius: 15px;
  border-top-left-radius: 15px;
  clear: both
  z-index: 21;
}
.mainmenu ul {
  list-style: none;

  border-top: 1px solid transparent;
  padding: 0
}
.mainmenu li {
  outline: 0;

  float: left;
  margin: 0
}
.mainmenu li.active {
  background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNC40OTggMi4zODEiPjxwYXRoIGQ9Ik00LjIzMyAyLjM4MUguMjY1bC45OTgtMS4wNTguOTg2LTEuMDU4Ljk5OCAxLjA2MnoiIGZpbGw9IiNmZjgwMDAiLz48L3N2Zz4=);
  background-repeat: no-repeat;
  background-position: center bottom
}
.mainmenu li a {
  color: #66a8c7;

  padding: 10px 15px
}
.mainmenu li.active a {
  text-shadow: 0 0 1px #b1d2e2
}
.mainmenu li:hover {
  background-color: #ff8000;
Changes to skins/ardoise/header.txt.
25
26
27
28
29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
        <th1>
html "<li><a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a></li>\n"
builtin_request_js hbmenu.js
set once 1
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {$once && [string match /$current_page* $url]} {
    html "<li class='active'>"
    set once 0
  } else {
    html "<li>"
  }

  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a></li>\n"
}
</th1></ul>
        </div> <!-- end div mainmenu -->
        <div id="hbdrop"></div>
      </div> <!-- end div container -->







|

<
<

>







25
26
27
28
29
30
31
32
33


34
35
36
37
38
39
40
41
42
        <th1>
html "<li><a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a></li>\n"
builtin_request_js hbmenu.js
set once 1
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {$once && [string match /$current_page* $url]} {
    lappend class active
    set once 0


  }
  html "<li class='$class'>"
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a></li>\n"
}
</th1></ul>
        </div> <!-- end div mainmenu -->
        <div id="hbdrop"></div>
      </div> <!-- end div container -->
Changes to skins/black_and_white/header.txt.
13
14
15
16
17
18
19
20
21
22
  </th1></div>
</div>
<div class="mainmenu">
<th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a><br/>\n"
}
</th1></div>







|


13
14
15
16
17
18
19
20
21
22
  </th1></div>
</div>
<div class="mainmenu">
<th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url' class='$class'>$name</a><br/>\n"
}
</th1></div>
Changes to skins/blitz/css.txt.
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */
.mainmenu {
    clear:both;
}

.mainmenu ul {
  list-style: none outside;
  display: block;
  position: relative;
  border-top: 1px solid #ccc;
  padding: 0;
}

.mainmenu li {
  outline: 0;
  display: block;
  float: left;
  margin: 0;
}

.mainmenu li.active {
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEQAACxEBf2RfkQAAAAd0SU1FB90FDxEXAZ2XRzAAAABJSURBVCjPY2CgBzhz5sx/QmoYiTXAxMSEkWRDsLkAl0GMpHoBm0EoAlu3bmUQFxcnGAboBjEhc4gxAJtLGUmJBVwuYiTXAGSDAIx5IBObnuVxAAAAAElFTkSuQmCC);
  background-repeat: no-repeat;
  background-position: center bottom;
}

.mainmenu li a {
  color: #3b5c6b;
  display: block;
  padding: 10px 15px;
}

.mainmenu li.active a {
  font-weight: bold;
}








<







<












<







846
847
848
849
850
851
852

853
854
855
856
857
858
859

860
861
862
863
864
865
866
867
868
869
870
871

872
873
874
875
876
877
878
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */
.mainmenu {
    clear:both;
}

.mainmenu ul {
  list-style: none outside;

  position: relative;
  border-top: 1px solid #ccc;
  padding: 0;
}

.mainmenu li {
  outline: 0;

  float: left;
  margin: 0;
}

.mainmenu li.active {
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEQAACxEBf2RfkQAAAAd0SU1FB90FDxEXAZ2XRzAAAABJSURBVCjPY2CgBzhz5sx/QmoYiTXAxMSEkWRDsLkAl0GMpHoBm0EoAlu3bmUQFxcnGAboBjEhc4gxAJtLGUmJBVwuYiTXAGSDAIx5IBObnuVxAAAAAElFTkSuQmCC);
  background-repeat: no-repeat;
  background-position: center bottom;
}

.mainmenu li a {
  color: #3b5c6b;

  padding: 10px 15px;
}

.mainmenu li.active a {
  font-weight: bold;
}

Changes to skins/blitz/header.txt.
26
27
28
29
30
31
32
33
34
35
36
37

38
39
40
41
42
43
44
    <!-- Main Menu -->
    <div class="mainmenu">
      <ul><th1>
set once 1
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {$once && [string match /$current_page* $url]} {
    html "<li class='active'>"
    set once 0
  } else {
    html "<li>"
  }

  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a></li>\n"
}
</th1></ul>
        </div> <!-- end div mainmenu -->
      </div> <!-- end div container -->
    </div> <!-- end div header -->







|

<
<

>







26
27
28
29
30
31
32
33
34


35
36
37
38
39
40
41
42
43
    <!-- Main Menu -->
    <div class="mainmenu">
      <ul><th1>
set once 1
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {$once && [string match /$current_page* $url]} {
    lappend class active
    set once 0


  }
  html "<li class='$class'>"
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a></li>\n"
}
</th1></ul>
        </div> <!-- end div mainmenu -->
      </div> <!-- end div container -->
    </div> <!-- end div header -->
Changes to skins/blitz_no_logo/css.txt.
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */
.mainmenu {
    clear:both;
}

.mainmenu ul {
  list-style: none outside;
  display: block;
  position: relative;
  border-top: 1px solid #ccc;
  padding: 0;
}

.mainmenu li {
  outline: 0;
  display: block;
  float: left;
  margin: 0;
}

.mainmenu li.active {
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEQAACxEBf2RfkQAAAAd0SU1FB90FDxEXAZ2XRzAAAABJSURBVCjPY2CgBzhz5sx/QmoYiTXAxMSEkWRDsLkAl0GMpHoBm0EoAlu3bmUQFxcnGAboBjEhc4gxAJtLGUmJBVwuYiTXAGSDAIx5IBObnuVxAAAAAElFTkSuQmCC);
  background-repeat: no-repeat;
  background-position: center bottom;
}

.mainmenu li a {
  color: #3b5c6b;
  display: block;
  padding: 10px 15px;
}

.mainmenu li.active a {
  font-weight: bold;
}








<







<












<







846
847
848
849
850
851
852

853
854
855
856
857
858
859

860
861
862
863
864
865
866
867
868
869
870
871

872
873
874
875
876
877
878
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– */
.mainmenu {
    clear:both;
}

.mainmenu ul {
  list-style: none outside;

  position: relative;
  border-top: 1px solid #ccc;
  padding: 0;
}

.mainmenu li {
  outline: 0;

  float: left;
  margin: 0;
}

.mainmenu li.active {
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEQAACxEBf2RfkQAAAAd0SU1FB90FDxEXAZ2XRzAAAABJSURBVCjPY2CgBzhz5sx/QmoYiTXAxMSEkWRDsLkAl0GMpHoBm0EoAlu3bmUQFxcnGAboBjEhc4gxAJtLGUmJBVwuYiTXAGSDAIx5IBObnuVxAAAAAElFTkSuQmCC);
  background-repeat: no-repeat;
  background-position: center bottom;
}

.mainmenu li a {
  color: #3b5c6b;

  padding: 10px 15px;
}

.mainmenu li.active a {
  font-weight: bold;
}

Changes to skins/blitz_no_logo/header.txt.
23
24
25
26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
    <!-- Main Menu -->
    <div class="mainmenu">
      <ul><th1>
set once 1
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {$once && [string match /$current_page* $url]} {
    html "<li class='active'>"
    set once 0
  } else {
    html "<li>"
  }

  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a></li>\n"
}
</th1></ul>
        </div> <!-- end div mainmenu -->
      </div> <!-- end div container -->
    </div> <!-- end div header -->







|

<
<

>







23
24
25
26
27
28
29
30
31


32
33
34
35
36
37
38
39
40
    <!-- Main Menu -->
    <div class="mainmenu">
      <ul><th1>
set once 1
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {$once && [string match /$current_page* $url]} {
    lappend class active
    set once 0


  }
  html "<li class='$class'>"
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a></li>\n"
}
</th1></ul>
        </div> <!-- end div mainmenu -->
      </div> <!-- end div container -->
    </div> <!-- end div header -->
Changes to skins/darkmode/css.txt.
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
    color: rgba(24,24,24,0.8);
}

body.forum .forumPostBody > div blockquote {
    border: 1px inset;
    padding: 0 0.5em;
}

@media screen and (max-width: 600px) {
  /* Spacing for mobile */
  .desktoponly {
    display: none;
  }
}
@media screen and (max-width: 1200px) {
  /* Special declarations for narrow desktop or wide mobile */
  .wideonly {
    display: none;
  }
}







<
<
<
<
<
<
<
<
<
<
<
<
<
548
549
550
551
552
553
554













    color: rgba(24,24,24,0.8);
}

body.forum .forumPostBody > div blockquote {
    border: 1px inset;
    padding: 0 0.5em;
}













Changes to skins/default/css.txt.
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
  .status {padding-top: 0px;}
  .mainmenu a {
    padding: 10px 10px;
  }
  .mainmenu {
    padding: 10px;
  }
  .desktoponly {
    display: none;
  }
}
@media screen and (min-width: 600px) {
  /* Spacing for desktop */
  body {
    padding-left: 20px;
    padding-right: 20px;
  }
  .title {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .status {padding-top: 30px;}
  .mainmenu a {
    padding: 10px 20px;
  }
  .mainmenu {
    padding: 10px;
  }
}
@media screen and (max-width: 1200px) {
  /* Special declarations for narrow desktop or wide mobile */
  .wideonly {
    display: none;
  }
}







<
<
<



















<
<
<
<
<
<
270
271
272
273
274
275
276



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295






  .status {padding-top: 0px;}
  .mainmenu a {
    padding: 10px 10px;
  }
  .mainmenu {
    padding: 10px;
  }



}
@media screen and (min-width: 600px) {
  /* Spacing for desktop */
  body {
    padding-left: 20px;
    padding-right: 20px;
  }
  .title {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .status {padding-top: 30px;}
  .mainmenu a {
    padding: 10px 20px;
  }
  .mainmenu {
    padding: 10px;
  }
}






Changes to skins/eagle/header.txt.
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
}
updateClock();
</script>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a>\n"
}
if {[info exists login]} {
  html "<a href='$home/logout'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></div>







|







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
}
updateClock();
</script>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url' class='$class'>$name</a>\n"
}
if {[info exists login]} {
  html "<a href='$home/logout'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></div>
Changes to skins/enhanced1/header.txt.
91
92
93
94
95
96
97
98
99
100
}
updateClock();
</script>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a>\n"
}
</th1></div>







|


91
92
93
94
95
96
97
98
99
100
}
updateClock();
</script>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url' class='$class'>$name</a>\n"
}
</th1></div>
Changes to skins/khaki/header.txt.
12
13
14
15
16
17
18
19
20
21
22
</div>
<div class="mainmenu"><th1>
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
builtin_request_js hbmenu.js
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a>\n"
}
</th1></div>
<div id='hbdrop'></div>







|



12
13
14
15
16
17
18
19
20
21
22
</div>
<div class="mainmenu"><th1>
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
builtin_request_js hbmenu.js
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url' class='$class'>$name</a>\n"
}
</th1></div>
<div id='hbdrop'></div>
Changes to skins/original/header.txt.
11
12
13
14
15
16
17
18
19
20
     }
  </th1></div>
</div>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a>\n"
}
</th1></div>







|


11
12
13
14
15
16
17
18
19
20
     }
  </th1></div>
</div>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url' class='$class'>$name</a>\n"
}
</th1></div>
Changes to skins/plain_gray/header.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<div class="header">
  <div class="title">$<project_name>: $<title></div>
</div>
<div class="mainmenu">
<th1>
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
builtin_request_js hbmenu.js
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a>\n"
}
</th1></div>
<div id='hbdrop' class='hbdrop'></div>










|



1
2
3
4
5
6
7
8
9
10
11
12
13
14
<div class="header">
  <div class="title">$<project_name>: $<title></div>
</div>
<div class="mainmenu">
<th1>
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
builtin_request_js hbmenu.js
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url' class='$class'>$name</a>\n"
}
</th1></div>
<div id='hbdrop' class='hbdrop'></div>
Changes to skins/rounded1/header.txt.
12
13
14
15
16
17
18
19
20
21
     }
  </th1></div>
</div>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url'>$name</a>\n"
}
</th1></div>







|


12
13
14
15
16
17
18
19
20
21
     }
  </th1></div>
</div>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {set url $home$url}
  html "<a href='$url' class='$class'>$name</a>\n"
}
</th1></div>
Changes to skins/xekri/header.txt.
92
93
94
95
96
97
98
99
100
101
102
103
104
105
updateClock();
</script>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {
    if {[string match /$current_page* $url]} {
      set class "active $class"
    }
    set url $home$url
  }
  html "<a href='$url' class='$class'>$name</a>\n"
}
</th1></div>







|






92
93
94
95
96
97
98
99
100
101
102
103
104
105
updateClock();
</script>
<div class="mainmenu"><th1>
foreach {name url expr class} $mainmenu {
  if {![capexpr $expr]} continue
  if {[string match /* $url]} {
    if {[string match /$current_page* $url]} {
      lappend class active
    }
    set url $home$url
  }
  html "<a href='$url' class='$class'>$name</a>\n"
}
</th1></div>
Changes to src/default.css.
1760
1761
1762
1763
1764
1765
1766













  font-family: monospace;
}

body.chat #chat-drop-details img {
  max-width: 45%;
  max-height: 45%;
}




















>
>
>
>
>
>
>
>
>
>
>
>
>
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
  font-family: monospace;
}

body.chat #chat-drop-details img {
  max-width: 45%;
  max-height: 45%;
}

/* Objects in the "desktoponly" class are invisible on mobile */
@media screen and (max-width: 600px) {
  .desktoponly {
    display: none;
  }
}
/* Objects in the "wideonly" class are invisible only on wide-screen desktops */
@media screen and (max-width: 1200px) {
  .wideonly {
    display: none;
  }
}
Changes to src/style.c.
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104

1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142






















1143
1144
1145
1146
1147

1148
1149
1150
1151
1152
1153
1154
1155


1156
1157
1158

1159
1160
1161
1162
1163
1164
1165
1166
1167
    cgi_set_content_type("application/javascript");
  }
  style_init_th1_vars(0);
  Th_Render(zScript?zScript:"");
}

/*
** If one of the "name" or "page" URL parameters (in that order)
** is set then this function looks for page/page group-specific
** CSS and (if found) appends it to pOut, else it is a no-op.

*/
static void page_style_css_append_page_style(Blob *pOut){
  const char *zPage = PD("name",P("page"));
  char * zFile;
  int nFile = 0;
  const char *zBuiltin;

  if(zPage==0 || zPage[0]==0){
    return;
  }
  zFile = mprintf("style.%s.css", zPage);
  zBuiltin = (const char *)builtin_file(zFile, &nFile);
  if(nFile>0){
    blob_appendf(pOut,
      "\n/***********************************************************\n"
      "** Start of page-specific CSS for page %s...\n"
      "***********************************************************/\n",
      zPage);
    blob_append(pOut, zBuiltin, nFile);
    blob_appendf(pOut,
      "\n/***********************************************************\n"
      "** End of page-specific CSS for page %s.\n"
      "***********************************************************/\n",
      zPage);
    fossil_free(zFile);
    return;
  }
  /* Potential TODO: check for aliases/page groups. e.g. group all
  ** /forumXYZ CSS into one file, all /setupXYZ into another, etc. As
  ** of this writing, doing so would only shave a few kb from
  ** default.css. */
  fossil_free(zFile);
}

/*
** WEBPAGE: style.css
**
** Return the style sheet.






















*/
void page_style_css(void){
  Blob css = empty_blob;
  int i;
  const char * zDefaults;


  cgi_set_content_type("text/css");
  etag_check(0, 0);
  /* Emit all default rules... */
  zDefaults = (const char*)builtin_file("default.css", &i);
  blob_append(&css, zDefaults, i);
  /* Page-specific CSS, if any... */
  page_style_css_append_page_style(&css);


  blob_append(&css,
     "\n/***********************************************************\n"
     "** All CSS which follows is supplied by the repository \"skin\".\n"

     "***********************************************************/\n",
     -1);
  blob_append(&css,skin_get("css"),-1);
  /* Process through TH1 in order to give an opportunity to substitute
  ** variables such as $baseurl.
  */
  Th_Store("baseurl", g.zBaseURL);
  Th_Store("secureurl", fossil_wants_https(1)? g.zHttpsURL: g.zBaseURL);
  Th_Store("home", g.zTop);







|
|
|
>















|



<
<
<
<
<













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





>








>
>
|

<
>

|







1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124





1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178

1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
    cgi_set_content_type("application/javascript");
  }
  style_init_th1_vars(0);
  Th_Render(zScript?zScript:"");
}

/*
** Check for "name" or "page" query parameters on an /style.css
** page request.  If present, then page-specific CSS is requested,
** so add that CSS to pOut.  If the "name" and "page" query parameters
** are omitted, then pOut is unchnaged.
*/
static void page_style_css_append_page_style(Blob *pOut){
  const char *zPage = PD("name",P("page"));
  char * zFile;
  int nFile = 0;
  const char *zBuiltin;

  if(zPage==0 || zPage[0]==0){
    return;
  }
  zFile = mprintf("style.%s.css", zPage);
  zBuiltin = (const char *)builtin_file(zFile, &nFile);
  if(nFile>0){
    blob_appendf(pOut,
      "\n/***********************************************************\n"
      "** Page-specific CSS for \"%s\"\n"
      "***********************************************************/\n",
      zPage);
    blob_append(pOut, zBuiltin, nFile);





    fossil_free(zFile);
    return;
  }
  /* Potential TODO: check for aliases/page groups. e.g. group all
  ** /forumXYZ CSS into one file, all /setupXYZ into another, etc. As
  ** of this writing, doing so would only shave a few kb from
  ** default.css. */
  fossil_free(zFile);
}

/*
** WEBPAGE: style.css
**
** Return the style sheet.   The style sheet is assemblied from
** multiple sources, in order:
**
**    (1)   The built-in "default.css" style sheet containing basic defaults.
**
**    (2)   The page-specific style sheet taken from the built-in
**          called "PAGENAME.css" where PAGENAME is the value of the name=
**          or page= query parameters.  If neither name= nor page= exist,
**          then this section is a no-op.
**
**    (3)   The skin-specific "css.txt" file, if there one.
**
** All of (1), (2), and (3) above (or as many as exist) are concatenated.
** The result is then run through TH1 with the following variables set:
**
**    *   $basename
**    *   $secureurl
**    *   $home
**    *   $logo
**    *   $background
**
** The output from TH1 becomes the style sheet.  Fossil always reports
** that the style sheet is cacheable.  
*/
void page_style_css(void){
  Blob css = empty_blob;
  int i;
  const char * zDefaults;
  const char *zSkin;

  cgi_set_content_type("text/css");
  etag_check(0, 0);
  /* Emit all default rules... */
  zDefaults = (const char*)builtin_file("default.css", &i);
  blob_append(&css, zDefaults, i);
  /* Page-specific CSS, if any... */
  page_style_css_append_page_style(&css);
  zSkin = skin_in_use();
  if( zSkin==0 ) zSkin = "this repository";
  blob_appendf(&css,
     "\n/***********************************************************\n"

     "** Skin-specific CSS for %s\n"
     "***********************************************************/\n",
     zSkin);
  blob_append(&css,skin_get("css"),-1);
  /* Process through TH1 in order to give an opportunity to substitute
  ** variables such as $baseurl.
  */
  Th_Store("baseurl", g.zBaseURL);
  Th_Store("secureurl", fossil_wants_https(1)? g.zHttpsURL: g.zBaseURL);
  Th_Store("home", g.zTop);
Changes to src/th_lang.c.
226
227
228
229
230
231
232






































233
234
235
236
237
238
239
  Th_Free(interp, zList);

  return TH_OK;
}

/*
** TH Syntax:






































**
**   lindex list index
*/
static int lindex_command(
  Th_Interp *interp,
  void *ctx,
  int argc,







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
  Th_Free(interp, zList);

  return TH_OK;
}

/*
** TH Syntax:
**
**    lappend var ?arg1? ?arg2? ...?
**
** Interpret the content of variable var as a list.  Create var if it
** does not already exist.  Append each argument as a new list element.
*/
static int lappend_command(
  Th_Interp *interp,
  void *ctx,
  int argc,
  const char **argv,
  int *argl
){
  char *zList = 0;
  int nList = 0;
  int i, rc;

  if( argc<2 ){
    return Th_WrongNumArgs(interp, "lappend var ...");
  }
  rc = Th_GetVar(interp, argv[1], argl[1]);
  if( rc==TH_OK ){
    zList = Th_TakeResult(interp, &nList);
  }

  for(i=2; i<argc; i++){
    Th_ListAppend(interp, &zList, &nList, argv[i], argl[i]);
  }

  Th_SetResult(interp, zList, nList);
  Th_Free(interp, zList);

  return TH_OK;
}


/*
** TH Syntax:
**
**   lindex list index
*/
static int lindex_command(
  Th_Interp *interp,
  void *ctx,
  int argc,
1352
1353
1354
1355
1356
1357
1358

1359
1360
1361
1362
1363
1364
1365
    {"array",    array_command,   0},
    {"catch",    catch_command,   0},
    {"expr",     expr_command,    0},
    {"for",      for_command,     0},
    {"foreach",  foreach_command, 0},
    {"if",       if_command,      0},
    {"info",     info_command,    0},

    {"lindex",   lindex_command,  0},
    {"list",     list_command,    0},
    {"llength",  llength_command, 0},
    {"lsearch",  lsearch_command, 0},
    {"proc",     proc_command,    0},
    {"rename",   rename_command,  0},
    {"set",      set_command,     0},







>







1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
    {"array",    array_command,   0},
    {"catch",    catch_command,   0},
    {"expr",     expr_command,    0},
    {"for",      for_command,     0},
    {"foreach",  foreach_command, 0},
    {"if",       if_command,      0},
    {"info",     info_command,    0},
    {"lappend",  lappend_command, 0},
    {"lindex",   lindex_command,  0},
    {"list",     list_command,    0},
    {"llength",  llength_command, 0},
    {"lsearch",  lsearch_command, 0},
    {"proc",     proc_command,    0},
    {"rename",   rename_command,  0},
    {"set",      set_command,     0},