Check-in [5f2271292a]
Not logged in

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

Overview
Comment:In the default skins, the main menu on web pages is now mostly determined by the "mainmenu" setting rather than by the "header.txt" file of the skin. This allows a project to more easily change skins without disrupting the customized menu. It also means that the built-in skins are morely likely to be usable without any modification. This change also adds the "string match" command to TH1.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5f2271292a9a4b46f031b90326a0ca2396b2458695855206e4217c5de5ea79d1
User & Date: drh 2021-01-26 23:58:07.794
Context
2021-01-27
02:45
Fixed typo introduced in [f42b5773ed] check-in: b2ad0172e9 user: wyoung tags: trunk
2021-01-26
23:58
In the default skins, the main menu on web pages is now mostly determined by the "mainmenu" setting rather than by the "header.txt" file of the skin. This allows a project to more easily change skins without disrupting the customized menu. It also means that the built-in skins are morely likely to be usable without any modification. This change ... check-in: 5f2271292a user: drh tags: trunk
23:38
Minor formatting issue on the /Setup/Configure page. Closed-Leaf check-in: 4dae4a1ba7 user: drh tags: new-main-menu
19:37
Rework the /sitemap customization settings. There is now just a single setting "sitemap-extra" that is a TCL list of triples, where each triple defines a new entry in the /sitemap. Legacy entries are ignored. Administrators that have a custom /sitemap configuration will need to update the "Custom Sitemap Entries" setting on the /Admin/Configurati... check-in: aa5beb8c29 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to skins/ardoise/header.txt.
19
20
21
22
23
24
25

26
27
28

29
30

31
32
33

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
      <small> &nbsp;$<title></small></h1>
    </div>

    <!-- Main Menu -->
    <div class="mainmenu">
      <ul>
        <th1>

proc menulink {url name} {
  upvar current_page current
  upvar home home

  if {[string range $url 0 [string length $current]] eq "/$current"} {
    html "<li class='active'>"

  } else {
    html "<li>"
  }

  html "<a href='$home$url'>$name</a></li>\n"
}
html "<li><a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a></li>"
builtin_request_js hbmenu.js
menulink $index_page Home
if {[anycap jor]} {
  menulink /timeline Timeline
}
if {[hascap oh]} {
  menulink /dir?ci=tip Files
}
# if {[hascap o]} {
#   menulink  /brlist Branches
#   menulink  /taglist Tags
# }
# if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
#   menulink /forum Forum
# }
# if {[hascap r]} {
#   menulink /ticket Tickets
# }
# if {[hascap j]} {
#   menulink /wiki Wiki
# }
# if {[hascap o]} {
#   menulink /help Help
# }
if {[hascap s]} {
  menulink /setup Admin
}
            </th1>
          </ul>
        </div> <!-- end div mainmenu -->
        <div id="hbdrop"></div>
      </div> <!-- end div container -->
    </div> <!-- end div header -->
    <div class="middle max-full-width">
      <div class="container">
        <th1>







>
|
|
|
>
|

>



>
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39




























40

41
42
43
44
45
46
47
      <small> &nbsp;$<title></small></h1>
    </div>

    <!-- Main Menu -->
    <div class="mainmenu">
      <ul>
        <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 -->
    </div> <!-- end div header -->
    <div class="middle max-full-width">
      <div class="container">
        <th1>
Changes to skins/black_and_white/header.txt.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
     } else {
       puts "Not logged in"
     }
  </th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
  html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
  html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
  html "<a href='$home/brlist'>Branches</a>\n"
  html "<a href='$home/taglist'>Tags</a>\n"
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  html "<a href='$home/forum'>Forum</a>\n"
}
if {[anoncap r]} {
  html "<a href='$home/ticket'>Tickets</a>\n"
}
if {[anoncap j]} {
  html "<a href='$home/wiki'>Wiki</a>\n"
}
if {[hascap s]} {
  html "<a href='$home/setup'>Admin</a>\n"
} elseif {[hascap a]} {
  html "<a href='$home/setup_ulist'>Users</a>\n"
}
if {[info exists login]} {
  html "<a href='$home/login'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></ul></div>







|
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<






|
10
11
12
13
14
15
16
17
18


19













20





21
22
23
24
25
26
27
     } else {
       puts "Not logged in"
     }
  </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"





}
if {[info exists login]} {
  html "<a href='$home/login'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></div>
Changes to skins/blitz/header.txt.
21
22
23
24
25
26
27
28
29
30

31
32
33
34

35
36
37

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
        html "<a class='rss' href='$home/timeline.rss'></a>"
      }
      </th1>
    </div>

    <!-- Main Menu -->
    <div class="mainmenu">
      <ul>
        <th1>
proc menulink {url name} {

  upvar current_page current
  upvar home home
  if {[string range $url 0 [string length $current]] eq "/$current"} {
    html "<li class='active'>"

  } else {
    html "<li>"
  }

  html "<a href='$home$url'>$name</a></li>\n"
}
menulink $index_page Home
if {[anycap jor]} {
  menulink /timeline Timeline
}
if {[hascap oh]} {
  menulink /dir?ci=tip Files
}
if {[hascap o]} {
  menulink  /brlist Branches
  menulink  /taglist Tags
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  menulink /forum Forum
}
if {[hascap r]} {
  menulink /ticket Tickets
}
if {[hascap j]} {
  menulink /wiki Wiki
}
if {[hascap o]} {
  menulink /help Help
}
if {[hascap s]} {
  menulink /setup Admin
} elseif {[hascap a]} {
  menulink /setup_ulist Users
}
            </th1>
          </ul>
        </div> <!-- end div mainmenu -->
      </div> <!-- end div container -->
    </div> <!-- end div header -->
    <div class="middle max-full-width">
      <div class="container">







|
|
|
>
|
<
<

>



>
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<





21
22
23
24
25
26
27
28
29
30
31
32


33
34
35
36
37
38
39
40




























41

42
43
44
45
46
        html "<a class='rss' href='$home/timeline.rss'></a>"
      }
      </th1>
    </div>

    <!-- 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 -->
    <div class="middle max-full-width">
      <div class="container">
Changes to skins/blitz_no_logo/header.txt.
18
19
20
21
22
23
24
25
26
27

28
29
30
31

32
33
34

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
      }
      </th1>
      <small> &nbsp;$<title></small></h1>
    </div>

    <!-- Main Menu -->
    <div class="mainmenu">
      <ul>
        <th1>
proc menulink {url name} {

  upvar current_page current
  upvar home home
  if {[string range $url 0 [string length $current]] eq "/$current"} {
    html "<li class='active'>"

  } else {
    html "<li>"
  }

  html "<a href='$home$url'>$name</a></li>\n"
}
menulink $index_page Home
if {[anycap jor]} {
  menulink /timeline Timeline
}
if {[hascap oh]} {
  menulink /dir?ci=tip Files
}
if {[hascap o]} {
  menulink  /brlist Branches
  menulink  /taglist Tags
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  menulink /forum Forum
}
if {[hascap r]} {
  menulink /ticket Tickets
}
if {[hascap j]} {
  menulink /wiki Wiki
}
if {[hascap o]} {
  menulink /help Help
  }
if {[hascap s]} {
  menulink /setup Admin
} elseif {[hascap a]} {
  menulink /setup_ulist Users
}
            </th1>
          </ul>
        </div> <!-- end div mainmenu -->
      </div> <!-- end div container -->
    </div> <!-- end div header -->
    <div class="middle max-full-width">
      <div class="container">







|
|
|
>
|
<
<

>



>
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<





18
19
20
21
22
23
24
25
26
27
28
29


30
31
32
33
34
35
36
37




























38

39
40
41
42
43
      }
      </th1>
      <small> &nbsp;$<title></small></h1>
    </div>

    <!-- 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 -->
    <div class="middle max-full-width">
      <div class="container">
Changes to skins/bootstrap/header.txt.
37
38
39
40
41
42
43

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
              } else {
                puts "Not logged in"
                html " &middot; <a href='$home/login'>Login</a>"
              }
            </th1></p>
            <ul class="nav navbar-nav">
              <th1>

                set is_index [expr [string compare [string range $current_page 0 4] "index"]==0]
                set is_home [expr [string compare [string range $current_page 0 [expr [string length $index_page]-1] ] $index_page]==0]
                if {$is_index || $is_home} {
                  html "<li class='active'><a href='$home$index_page'>Home</a></li>\n"
                } else {
                  html "<li><a href='$home$index_page'>Home</a></li>\n"
                }
                if {[hascap j]} {
                  if {[string compare [string range $current_page 0 3] "wiki"] == 0} {
                    html "<li class='active'><a href='$home/wiki'>Wiki</a></li>\n"
                  } else {
                    html "<li><a href='$home/wiki'>Wiki</a></li>\n"
                  }
                }
                if {[anycap jor]} {
                  if {[string compare $current_page "timeline"] == 0} {
                    html "<li class='active'><a href='$home/timeline'>Timeline</a></li>\n"
                  } else {
                    html "<li><a href='$home/timeline'>Timeline</a></li>\n"
                  }
                }
                if {[hascap oh]} {
                  if {[string compare [string range $current_page 0 2] "dir"] == 0} {
                    html "<li class='active'><a href='$home/dir?ci=tip'>Files</a></li>\n"
                  } else {
                    html "<li><a href='$home/dir?ci=tip'>Files</a></li>\n"
                  }
                }
                if {[hascap o]} {
                  if {[string compare $current_page "brlist"] == 0} {
                    html "<li class='active'><a href='$home/brlist'>Branches</a></li>\n"
                  } else {
                    html "<li><a href='$home/brlist'>Branches</a></li>\n"
                  }
                  if {[string compare $current_page "taglist"] == 0} {
                    html "<li class='active'><a href='$home/taglist'>Tags</a></li>\n"
                  } else {
                    html "<li><a href='$home/taglist'>Tags</a></li>\n"
                  }
                }
                if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
                  if {[string compare $current_page "forum"] == 0} {
                    html "<li class='active'><a href='$home/forum'>Forum</a></li>\n"
                  } else {
                    html "<li><a href='$home/forum'>Forum</a></li>\n"
                  }
                }
                if {[hascap r]} {
                  if {[string compare $current_page "reportlist"] == 0} {
                    html "<li class='active'><a href='$home/reportlist'>Tickets</a></li>\n"
                  } else {
                    html "<li><a href='$home/reportlist'>Tickets</a></li>\n"
                  }
                }
                if {[hascap s]} {
                  if {[string compare [string range $current_page 0 4] "setup"] == 0} {
                    html "<li class='active'><a href='$home/setup'>Admin</a></li>\n"
                  } else {
                    html "<li><a href='$home/setup'>Admin</a></li>\n"
                  }
                } elseif {[hascap a]} {
                  if {[string compare [string range $current_page 0 4] "setup"] == 0} {
                    html "<li class='active'><a href='$home/setup_ulist'>Users</a></li>\n"
                  } else {
                    html "<li><a href='$home/setup_ulist'>Users</a></li>\n"
                  }
                }
              </th1>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
      <div class="content">
        <th1>
          html "<div class='container'>"
            html "<ul class='breadcrumb'>"







>
|
|
<
|
<
<
<
|
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
|
|
|
<
<
|
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
|
<







37
38
39
40
41
42
43
44
45
46

47



48







49



















50
51






52
53
54


55









56
57







58

59
60
61
62
63
64
65
              } else {
                puts "Not logged in"
                html " &middot; <a href='$home/login'>Login</a>"
              }
            </th1></p>
            <ul class="nav navbar-nav">
              <th1>
set once 1
set is_index [expr [string compare [string range $current_page 0 4] "index"]==0]
set is_home [expr [string compare [string range $current_page 0 [expr [string length $index_page]-1] ] $index_page]==0]

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><!--/.nav-collapse -->
        </div>
      </div>
      <div class="content">
        <th1>
          html "<div class='container'>"
            html "<ul class='breadcrumb'>"
Changes to skins/default/css.txt.
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
  .status {padding-top: 0px;}
  .mainmenu a {
    padding: 10px 10px;
  }
  .mainmenu {
    padding: 10px;
  }
  .not-mobile {
    display: none;
  }
}
@media screen and (min-width: 600px) {
  /* Spacing for desktop */
  body {
    padding-left: 20px;







|







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
  .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;
294
295
296
297
298
299
300
301
302
303
304
  }
  .mainmenu {
    padding: 10px;
  }
}
@media screen and (max-width: 1200px) {
  /* Special declarations for narrow desktop or wide mobile */
  .wide-screen {
    display: none;
  }
}







|



294
295
296
297
298
299
300
301
302
303
304
  }
  .mainmenu {
    padding: 10px;
  }
}
@media screen and (max-width: 1200px) {
  /* Special declarations for narrow desktop or wide mobile */
  .wideonly {
    display: none;
  }
}
Changes to skins/default/header.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

52
53
54
<div class="header">
  <div class="title"><h1>$<project_name></h1>$<title></div>
    <div class="status"><th1>
 if {[info exists login]} {
   html "<a href='$home/login'>$login</a>\n"
 } else {
   html "<a href='$home/login'>Login</a>\n"
 }
    </th1></div>
</div>
<div class="mainmenu">
<th1>
proc menulink {url name cls} {
  upvar current_page current
  upvar home home
  if {[string range $url 0 [string length $current]] eq "/$current"} {
    html "<a href='$home$url' class='active $cls'>$name</a>\n"
  } else {
    html "<a href='$home$url' class='$cls'>$name</a>\n"
  }
}
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
builtin_request_js hbmenu.js
menulink $index_page Home {}

if {[anycap jor]} {
  menulink /timeline Timeline {}
}
if {[hascap oh]} {
  if {![info exists current_checkin]} {set current_checkin tip}
  menulink /dir?ci=$current_checkin Files desktoponly
}
if {[hascap o]} {
  menulink  /brlist Branches wideonly
  menulink  /taglist Tags wideonly
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  menulink /forum Forum desktoponly
}
if {[hascap C]} {
  menulink /chat Chat wideonly
}
if {[hascap r]} {
  menulink /ticket Tickets wideonly
}
if {[hascap j]} {
  menulink /wiki Wiki wideonly
}
if {[hascap s]} {
  menulink /setup Admin {}
} elseif {[hascap a]} {
  menulink /setup_ulist Users {}

}
</th1></div>
<div id='hbdrop'></div>












<
<
<
<
<
<
<
<
<


<
>
|
<
<
|
<
|
<
|
<
<
|
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
>



1
2
3
4
5
6
7
8
9
10
11
12









13
14

15
16


17

18

19


20







21
22







23
24
25
26
<div class="header">
  <div class="title"><h1>$<project_name></h1>$<title></div>
    <div class="status"><th1>
 if {[info exists login]} {
   html "<a href='$home/login'>$login</a>\n"
 } else {
   html "<a href='$home/login'>Login</a>\n"
 }
    </th1></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]} {

    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>
<div id='hbdrop'></div>
Changes to skins/eagle/header.txt.
87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
      f(d.getUTCHours())     + ':' +
      f(d.getUTCMinutes());
    setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
  }
}
updateClock();
</script>
<div class="mainmenu">
<th1>
proc menulink {url name} {

  upvar home home
  html "<a href='$home$url'>$name</a>\n"
}
menulink $index_page Home
menulink /help Help
if {[anycap jor]} {
  menulink /timeline Timeline
}
if {[anoncap oh]} {
  menulink /dir?ci=tip Files
}
if {[anoncap o]} {
  menulink /brlist Branches
  menulink /taglist Tags
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  menulink /forum Forum
}
if {[anoncap r]} {
  menulink /ticket Tickets
}
if {[anoncap j]} {
  menulink /wiki Wiki
}
menulink /sitemap More...
if {[hascap s]} {
  menulink /setup Admin
} elseif {[hascap a]} {
  menulink /setup_ulist Users
}
if {[info exists login]} {
  menulink /login Logout
} else {
  menulink /login Login
}
</th1></div>







|
<
|
>
|
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|

|


87
88
89
90
91
92
93
94

95
96
97
98
99



























100
101
102
103
104
105
      f(d.getUTCHours())     + ':' +
      f(d.getUTCMinutes());
    setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
  }
}
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>
Changes to skins/enhanced1/header.txt.
87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
      f(d.getUTCHours())     + ':' +
      f(d.getUTCMinutes());
    setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
  }
}
updateClock();
</script>
<div class="mainmenu">
<th1>
proc menulink {url name} {

  upvar home home
  html "<a href='$home$url'>$name</a>\n"
}
menulink $index_page Home
menulink /help Help
if {[anycap jor]} {
  menulink /timeline Timeline
}
if {[anoncap oh]} {
  menulink /dir?ci=tip Files
}
if {[anoncap o]} {
  menulink /brlist Branches
  menulink /taglist Tags
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  menulink /forum Forum
}
if {[anoncap r]} {
  menulink /ticket Tickets
}
if {[anoncap j]} {
  menulink /wiki Wiki
}
if {[hascap s]} {
  menulink /setup Admin
} elseif {[hascap a]} {
  menulink /setup_ulist Users
}
if {[info exists login]} {
  menulink /login Logout
} else {
  menulink /login Login
}
</th1></div>







|
<
|
>
|
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|

|


87
88
89
90
91
92
93
94

95
96
97
98
99


























100
101
102
103
104
105
      f(d.getUTCHours())     + ':' +
      f(d.getUTCMinutes());
    setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
  }
}
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>
Changes to skins/khaki/header.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<div class="header">
  <div class="title">$<title></div>
  <div class="status">
    <div class="logo">$<project_name></div><br/>
    <th1>
     if {[info exists login]} {
       puts "Logged in as $login"
     } else {
       puts "Not logged in"
     }
  </th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
  html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
  html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
  html "<a href='$home/brlist'>Branches</a>\n"
  html "<a href='$home/taglist'>Tags</a>\n"
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  html "<a href='$home/forum'>Forum</a>\n"
}
if {[anoncap r]} {
  html "<a href='$home/ticket'>Tickets</a>\n"
}
if {[anoncap j]} {
  html "<a href='$home/wiki'>Wiki</a>\n"
}
if {[hascap s]} {
  html "<a href='$home/setup'>Admin</a>\n"
} elseif {[hascap a]} {
  html "<a href='$home/setup_ulist'>Users</a>\n"
}
if {[info exists login]} {
  html "<a href='$home/login'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></div>












|
|
<
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|

<
<
<
<
<

|

|


1
2
3
4
5
6
7
8
9
10
11
12
13
14

15


16













17
18





19
20
21
22
23
24
<div class="header">
  <div class="title">$<title></div>
  <div class="status">
    <div class="logo">$<project_name></div><br/>
    <th1>
     if {[info exists login]} {
       puts "Logged in as $login"
     } else {
       puts "Not logged in"
     }
  </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"
}





if {[info exists login]} {
  html "<a href='/logout'>Logout</a>\n"
} else {
  html "<a href='/login'>Login</a>\n"
}
</th1></div>
Changes to skins/original/header.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<div class="header">
  <div class="logo">
    <img src="$logo_image_url" alt="logo" />
  </div>
  <div class="title"><small>$<project_name></small><br />$<title></div>
  <div class="status"><th1>
     if {[info exists login]} {
       puts "Logged in as $login"
     } else {
       puts "Not logged in"
     }
  </th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
  html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
  html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
  html "<a href='$home/brlist'>Branches</a>\n"
  html "<a href='$home/taglist'>Tags</a>\n"
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  html "<a href='$home/forum'>Forum</a>\n"
}
if {[anoncap r]} {
  html "<a href='$home/ticket'>Tickets</a>\n"
}
if {[anoncap j]} {
  html "<a href='$home/wiki'>Wiki</a>\n"
}
if {[hascap s]} {
  html "<a href='$home/setup'>Admin</a>\n"
} elseif {[hascap a]} {
  html "<a href='$home/setup_ulist'>Users</a>\n"
}
if {[info exists login]} {
  html "<a href='$home/login'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></div>













|
|
<
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|

<
<
<
<
<

|




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

16


17













18
19





20
21
22
23
24
25
<div class="header">
  <div class="logo">
    <img src="$logo_image_url" alt="logo" />
  </div>
  <div class="title"><small>$<project_name></small><br />$<title></div>
  <div class="status"><th1>
     if {[info exists login]} {
       puts "Logged in as $login"
     } else {
       puts "Not logged in"
     }
  </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='$home$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>
Changes to skins/plain_gray/header.txt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<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
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
  html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
  html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
#if {[anoncap o]} {
#  html "<a href='$home/brlist'>Branches</a>\n"
#  html "<a href='$home/taglist'>Tags</a>\n"
#}
#if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
#  html "<a href='$home/forum'>Forum</a>\n"
#}
#if {[anoncap r]} {
#  html "<a href='$home/ticket'>Tickets</a>\n"
#}
#if {[anoncap j]} {
#  html "<a href='$home/wiki'>Wiki</a>\n"
#}
if {[hascap s]} {
  html "<a href='$home/setup'>Admin</a>\n"
}
if {[info exists login]} {
  html "<a href='$home/login'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></div>
<div id='hbdrop' class='hbdrop'></div>







|
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|


|





1
2
3
4
5
6
7
8
9


10
















11
12
13
14
15
16
17
18
19
<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"
}
if {[info exists login]} {
  html "<a href='$home/logout'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></div>
<div id='hbdrop' class='hbdrop'></div>
Changes to skins/rounded1/header.txt.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
     if {[info exists login]} {
       puts "Logged in as $login"
     } else {
       puts "Not logged in"
     }
  </th1></div>
</div>
<div class="mainmenu">
<th1>
html "<a href='$home$index_page'>Home</a>\n"
if {[anycap jor]} {
  html "<a href='$home/timeline'>Timeline</a>\n"
}
if {[anoncap oh]} {
  html "<a href='$home/tree?ci=tip'>Files</a>\n"
}
if {[anoncap o]} {
  html "<a href='$home/brlist'>Branches</a>\n"
  html "<a href='$home/taglist'>Tags</a>\n"
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  html "<a href='$home/forum'>Forum</a>\n"
}
if {[anoncap r]} {
  html "<a href='$home/ticket'>Tickets</a>\n"
}
if {[anoncap j]} {
  html "<a href='$home/wiki'>Wiki</a>\n"
}
if {[hascap s]} {
  html "<a href='$home/setup'>Admin</a>\n"
} elseif {[hascap a]} {
  html "<a href='$home/setup_ulist'>Users</a>\n"
}
if {[info exists login]} {
  html "<a href='$home/login'>Logout</a>\n"
} else {
  html "<a href='$home/login'>Login</a>\n"
}
</th1></div>







|
|
<
|
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|

<
<
<
<
<

|




8
9
10
11
12
13
14
15
16

17


18













19
20





21
22
23
24
25
26
     if {[info exists login]} {
       puts "Logged in as $login"
     } else {
       puts "Not logged in"
     }
  </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"
}





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/xekri/header.txt.
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
      f(d.getUTCHours())     + ':' +
      f(d.getUTCMinutes());
    setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
  }
}
updateClock();
</script>
<div class="mainmenu">
<th1>
proc menulink {url name} {
  upvar current_page current
  upvar home home
  if {[string range $url 0 [string length $current]] eq "/$current"} {
    html "<a href='$home$url' class='active'>$name</a>\n"
  } else {
    html "<a href='$home$url'>$name</a>\n"
  }
}
menulink $index_page Home
if {[anycap jor]} {
  menulink /timeline Timeline
}
if {[anoncap oh]} {
  menulink /dir?ci=tip Files
}
if {[anoncap o]} {
  menulink  /brlist Branches
  menulink  /taglist Tags
}
if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
  menulink /forum Forum
}
if {[anoncap r]} {
  menulink /ticket Tickets
}
if {[anoncap j]} {
  menulink /wiki Wiki
}
  menulink /sitemap More...
if {[hascap s]} {
  menulink /setup Admin
} elseif {[hascap a]} {
  menulink /setup_ulist Users
}
if {[info exists login]} {
  menulink /login Logout
} else {
  menulink /login Login
}
</th1></div>







|
<
|
<
<
<
<
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|

|


87
88
89
90
91
92
93
94

95




96
97
98



























99
100
101
102
103
104
      f(d.getUTCHours())     + ':' +
      f(d.getUTCMinutes());
    setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
  }
}
updateClock();
</script>
<div class="mainmenu"><th1>

foreach {name url expr class} $mainmenu {




  if {![capexpr $expr]} continue
  html "<a href='$home$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>
Changes to src/configure.c.
87
88
89
90
91
92
93

94
95
96
97
98
99
100
*/
static struct {
  const char *zName;   /* Name of the configuration parameter */
  int groupMask;       /* Which config groups is it part of */
} aConfig[] = {
  { "css",                    CONFIGSET_CSS  },
  { "header",                 CONFIGSET_SKIN },

  { "footer",                 CONFIGSET_SKIN },
  { "details",                CONFIGSET_SKIN },
  { "js",                     CONFIGSET_SKIN },
  { "logo-mimetype",          CONFIGSET_SKIN },
  { "logo-image",             CONFIGSET_SKIN },
  { "background-mimetype",    CONFIGSET_SKIN },
  { "background-image",       CONFIGSET_SKIN },







>







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
*/
static struct {
  const char *zName;   /* Name of the configuration parameter */
  int groupMask;       /* Which config groups is it part of */
} aConfig[] = {
  { "css",                    CONFIGSET_CSS  },
  { "header",                 CONFIGSET_SKIN },
  { "mainmenu",               CONFIGSET_SKIN },
  { "footer",                 CONFIGSET_SKIN },
  { "details",                CONFIGSET_SKIN },
  { "js",                     CONFIGSET_SKIN },
  { "logo-mimetype",          CONFIGSET_SKIN },
  { "logo-image",             CONFIGSET_SKIN },
  { "background-mimetype",    CONFIGSET_SKIN },
  { "background-image",       CONFIGSET_SKIN },
Changes to src/setup.c.
1014
1015
1016
1017
1018
1019
1020




























1021
1022
1023
1024
1025
1026
1027
  @ to a documentation page (ex: "/doc/trunk/index.wiki") or to "/timeline".</p>
  @
  @ <p>Note:  To avoid a redirect loop or other problems, this entry must
  @ begin with "/" and it must specify a valid page.  For example,
  @ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the
  @ leading "/".</p>
  @ <p>(Property: "index-page")




























  @ <hr>
  @ <p>Extra links to appear on the <a href="%R/sitemap">/sitemap</a> page,
  @ as sub-items of the "Home Page" entry, appearing before the
  @ "Documentation Search" entry (if any).  In skins that use the /sitemap
  @ page to construct a hamburger menu dropdown, new entries added here
  @ will appear on the hamburger menu.
  @







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







1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
  @ to a documentation page (ex: "/doc/trunk/index.wiki") or to "/timeline".</p>
  @
  @ <p>Note:  To avoid a redirect loop or other problems, this entry must
  @ begin with "/" and it must specify a valid page.  For example,
  @ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the
  @ leading "/".</p>
  @ <p>(Property: "index-page")
  @ <hr>
  @ <p>The main menu for the web interface
  @ <p>
   @
  @ <p>This setting should be a TCL list.  Each set of four consecutive
  @ values defines a single main menu item:
  @ <ol>
  @ <li> The first term is text that appears on the menu.
  @ <li> The second term is a hyperlink to take when a user clicks on the
  @      entry.  Hyperlinks that start with "/" are relative to the
  @      repository root.
  @ <li> The third term is an argument to the TH1 "capexpr" command.
  @      If capexpr evalutes to true, then the entry is shown.  If not,
  @      the entry is omitted.  "*" is always true.  "{}" is never true.
  @ <li> The fouth term is a list of extra class names to apply to the new
  @      menu entry.  Some skins will classes "desktoponly" and "wideonly"
  @      to only show the entries when the web browser screen is wide or
  @      very wide, respectively.
  @ </ol>
  @
  @ <p>Some custom skins might not use this property.  Whether the property
  @ is used or a choice made by the skin designer.  Some skins add an extra
  @ choices (such as the hamburger button) to the menu that are not shown
  @ on this list. (Property: mainmenu)
  @ <p>
  textarea_attribute("Main Menu", 12, 80, 
      "mainmenu", "mmenu", style_default_mainmenu(), 0);
  @
  @ <hr>
  @ <p>Extra links to appear on the <a href="%R/sitemap">/sitemap</a> page,
  @ as sub-items of the "Home Page" entry, appearing before the
  @ "Documentation Search" entry (if any).  In skins that use the /sitemap
  @ page to construct a hamburger menu dropdown, new entries added here
  @ will appear on the hamburger menu.
  @
Changes to src/style.c.
593
594
595
596
597
598
599























600
601
602
603
604
605
606

/*
** Returns the default page header.
*/
const char *get_default_header(){
  return zDfltHeader;
}
























/*
** Given a URL path, extract the first element as a "feature" name,
** used as the <body class="FEATURE"> value by default, though
** later-running code may override this, typically to group multiple
** Fossil UI URLs into a single "feature" so you can have per-feature
** CSS rules.







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







593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629

/*
** Returns the default page header.
*/
const char *get_default_header(){
  return zDfltHeader;
}

/*
** The default TCL list that defines the main menu.
*/
static const char zDfltMainMenu[] = 
@ Home      /home        *              {}
@ Timeline  /timeline    {o r j}        {}
@ Files     /dir?ci=tip  oh             desktoponly
@ Branches  /brlist      o              wideonly
@ Tags      /taglist     o              wideonly
@ Forum     /forum       {@2 3 4 5 6}   wideonly
@ Chat      /chat        C              wideonly
@ Tickets   /ticket      r              wideonly
@ Wiki      /wiki        j              wideonly
@ Setup     /setup       s              {}
;

/*
** Return the default menu
*/
const char *style_default_mainmenu(void){
  return zDfltMainMenu;
}

/*
** Given a URL path, extract the first element as a "feature" name,
** used as the <body class="FEATURE"> value by default, though
** later-running code may override this, typically to group multiple
** Fossil UI URLs into a single "feature" so you can have per-feature
** CSS rules.
657
658
659
660
661
662
663

664
665
666
667
668
669
670
  if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath);
  Th_Store("current_page", local_zCurrentPage);
  Th_Store("csrf_token", g.zCsrfToken);
  Th_Store("release_version", RELEASE_VERSION);
  Th_Store("manifest_version", MANIFEST_VERSION);
  Th_Store("manifest_date", MANIFEST_DATE);
  Th_Store("compiler_name", COMPILER_NAME);

  url_var("stylesheet", "css", "style.css");
  image_url_var("logo");
  image_url_var("background");
  if( !login_is_nobody() ){
    Th_Store("login", g.zLogin);
  }
  Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) );







>







680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
  if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath);
  Th_Store("current_page", local_zCurrentPage);
  Th_Store("csrf_token", g.zCsrfToken);
  Th_Store("release_version", RELEASE_VERSION);
  Th_Store("manifest_version", MANIFEST_VERSION);
  Th_Store("manifest_date", MANIFEST_DATE);
  Th_Store("compiler_name", COMPILER_NAME);
  Th_Store("mainmenu", db_get("mainmenu", style_default_mainmenu()));
  url_var("stylesheet", "css", "style.css");
  image_url_var("logo");
  image_url_var("background");
  if( !login_is_nobody() ){
    Th_Store("login", g.zLogin);
  }
  Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) );
Changes to src/th_lang.c.
883
884
885
886
887
888
889
























890
891
892
893
894
895
896
    return Th_WrongNumArgs(interp, "string length string");
  }
  return Th_SetResultInt(interp, argl[2]);
}

/*
** TH Syntax:
























**
**   string range STRING FIRST LAST
*/
static int string_range_command(
  Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
){
  int iStart;







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







883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
    return Th_WrongNumArgs(interp, "string length string");
  }
  return Th_SetResultInt(interp, argl[2]);
}

/*
** TH Syntax:
**
**   string match PATTERN STRING
**
*/
static int string_match_command(
  Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
){
  extern char *fossil_strndup(const char*,int);
  extern void fossil_free(void*);
  char *zPat, *zStr;
  int rc;
  if( argc!=4 ){
    return Th_WrongNumArgs(interp, "string match pattern string");
  }
  zPat = fossil_strndup(argv[2],argl[2]);
  zStr = fossil_strndup(argv[3],argl[3]);
  rc = sqlite3_strglob(zPat,zStr);
  fossil_free(zPat);
  fossil_free(zStr);
  return Th_SetResultInt(interp, !rc);
}

/*
** TH Syntax:
**
**   string range STRING FIRST LAST
*/
static int string_range_command(
  Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
){
  int iStart;
1153
1154
1155
1156
1157
1158
1159

1160
1161
1162
1163
1164
1165
1166
  static const Th_SubCommand aSub[] = {
    { "compare",   string_compare_command },
    { "first",     string_first_command },
    { "index",     string_index_command },
    { "is",        string_is_command },
    { "last",      string_last_command },
    { "length",    string_length_command },

    { "range",     string_range_command },
    { "repeat",    string_repeat_command },
    { "trim",      string_trim_command },
    { "trimleft",  string_trim_command },
    { "trimright", string_trim_command },
    { 0, 0 }
  };







>







1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
  static const Th_SubCommand aSub[] = {
    { "compare",   string_compare_command },
    { "first",     string_first_command },
    { "index",     string_index_command },
    { "is",        string_is_command },
    { "last",      string_last_command },
    { "length",    string_length_command },
    { "match",     string_match_command },
    { "range",     string_range_command },
    { "repeat",    string_repeat_command },
    { "trim",      string_trim_command },
    { "trimleft",  string_trim_command },
    { "trimright", string_trim_command },
    { 0, 0 }
  };