Fossil SCM

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.

drh 2021-01-26 23:58 trunk merge
Commit 5f2271292a9a4b46f031b90326a0ca2396b2458695855206e4217c5de5ea79d1
--- skins/ardoise/header.txt
+++ skins/ardoise/header.txt
@@ -21,50 +21,25 @@
2121
2222
<!-- Main Menu -->
2323
<div class="mainmenu">
2424
<ul>
2525
<th1>
26
-proc menulink {url name} {
27
- upvar current_page current
28
- upvar home home
29
- if {[string range $url 0 [string length $current]] eq "/$current"} {
26
+html "<li><a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a></li>\n"
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]} {
3032
html "<li class='active'>"
33
+ set once 0
3134
} else {
3235
html "<li>"
3336
}
34
- html "<a href='$home$url'>$name</a></li>\n"
35
-}
36
-html "<li><a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a></li>"
37
-builtin_request_js hbmenu.js
38
-menulink $index_page Home
39
-if {[anycap jor]} {
40
- menulink /timeline Timeline
41
-}
42
-if {[hascap oh]} {
43
- menulink /dir?ci=tip Files
44
-}
45
-# if {[hascap o]} {
46
-# menulink /brlist Branches
47
-# menulink /taglist Tags
48
-# }
49
-# if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
50
-# menulink /forum Forum
51
-# }
52
-# if {[hascap r]} {
53
-# menulink /ticket Tickets
54
-# }
55
-# if {[hascap j]} {
56
-# menulink /wiki Wiki
57
-# }
58
-# if {[hascap o]} {
59
-# menulink /help Help
60
-# }
61
-if {[hascap s]} {
62
- menulink /setup Admin
63
-}
64
- </th1>
65
- </ul>
37
+ if {[string match /* $url]} {set url $home$url}
38
+ html "<a href='$url'>$name</a></li>\n"
39
+}
40
+</th1></ul>
6641
</div> <!-- end div mainmenu -->
6742
<div id="hbdrop"></div>
6843
</div> <!-- end div container -->
6944
</div> <!-- end div header -->
7045
<div class="middle max-full-width">
7146
--- skins/ardoise/header.txt
+++ skins/ardoise/header.txt
@@ -21,50 +21,25 @@
21
22 <!-- Main Menu -->
23 <div class="mainmenu">
24 <ul>
25 <th1>
26 proc menulink {url name} {
27 upvar current_page current
28 upvar home home
29 if {[string range $url 0 [string length $current]] eq "/$current"} {
 
 
30 html "<li class='active'>"
 
31 } else {
32 html "<li>"
33 }
34 html "<a href='$home$url'>$name</a></li>\n"
35 }
36 html "<li><a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a></li>"
37 builtin_request_js hbmenu.js
38 menulink $index_page Home
39 if {[anycap jor]} {
40 menulink /timeline Timeline
41 }
42 if {[hascap oh]} {
43 menulink /dir?ci=tip Files
44 }
45 # if {[hascap o]} {
46 # menulink /brlist Branches
47 # menulink /taglist Tags
48 # }
49 # if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
50 # menulink /forum Forum
51 # }
52 # if {[hascap r]} {
53 # menulink /ticket Tickets
54 # }
55 # if {[hascap j]} {
56 # menulink /wiki Wiki
57 # }
58 # if {[hascap o]} {
59 # menulink /help Help
60 # }
61 if {[hascap s]} {
62 menulink /setup Admin
63 }
64 </th1>
65 </ul>
66 </div> <!-- end div mainmenu -->
67 <div id="hbdrop"></div>
68 </div> <!-- end div container -->
69 </div> <!-- end div header -->
70 <div class="middle max-full-width">
71
--- skins/ardoise/header.txt
+++ skins/ardoise/header.txt
@@ -21,50 +21,25 @@
21
22 <!-- Main Menu -->
23 <div class="mainmenu">
24 <ul>
25 <th1>
26 html "<li><a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a></li>\n"
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 <div id="hbdrop"></div>
43 </div> <!-- end div container -->
44 </div> <!-- end div header -->
45 <div class="middle max-full-width">
46
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -12,36 +12,16 @@
1212
}
1313
</th1></div>
1414
</div>
1515
<div class="mainmenu">
1616
<th1>
17
-html "<a href='$home$index_page'>Home</a>\n"
18
-if {[anycap jor]} {
19
- html "<a href='$home/timeline'>Timeline</a>\n"
20
-}
21
-if {[anoncap oh]} {
22
- html "<a href='$home/tree?ci=tip'>Files</a>\n"
23
-}
24
-if {[anoncap o]} {
25
- html "<a href='$home/brlist'>Branches</a>\n"
26
- html "<a href='$home/taglist'>Tags</a>\n"
27
-}
28
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
29
- html "<a href='$home/forum'>Forum</a>\n"
30
-}
31
-if {[anoncap r]} {
32
- html "<a href='$home/ticket'>Tickets</a>\n"
33
-}
34
-if {[anoncap j]} {
35
- html "<a href='$home/wiki'>Wiki</a>\n"
36
-}
37
-if {[hascap s]} {
38
- html "<a href='$home/setup'>Admin</a>\n"
39
-} elseif {[hascap a]} {
40
- html "<a href='$home/setup_ulist'>Users</a>\n"
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"
4121
}
4222
if {[info exists login]} {
4323
html "<a href='$home/login'>Logout</a>\n"
4424
} else {
4525
html "<a href='$home/login'>Login</a>\n"
4626
}
47
-</th1></ul></div>
27
+</th1></div>
4828
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -12,36 +12,16 @@
12 }
13 </th1></div>
14 </div>
15 <div class="mainmenu">
16 <th1>
17 html "<a href='$home$index_page'>Home</a>\n"
18 if {[anycap jor]} {
19 html "<a href='$home/timeline'>Timeline</a>\n"
20 }
21 if {[anoncap oh]} {
22 html "<a href='$home/tree?ci=tip'>Files</a>\n"
23 }
24 if {[anoncap o]} {
25 html "<a href='$home/brlist'>Branches</a>\n"
26 html "<a href='$home/taglist'>Tags</a>\n"
27 }
28 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
29 html "<a href='$home/forum'>Forum</a>\n"
30 }
31 if {[anoncap r]} {
32 html "<a href='$home/ticket'>Tickets</a>\n"
33 }
34 if {[anoncap j]} {
35 html "<a href='$home/wiki'>Wiki</a>\n"
36 }
37 if {[hascap s]} {
38 html "<a href='$home/setup'>Admin</a>\n"
39 } elseif {[hascap a]} {
40 html "<a href='$home/setup_ulist'>Users</a>\n"
41 }
42 if {[info exists login]} {
43 html "<a href='$home/login'>Logout</a>\n"
44 } else {
45 html "<a href='$home/login'>Login</a>\n"
46 }
47 </th1></ul></div>
48
--- skins/black_and_white/header.txt
+++ skins/black_and_white/header.txt
@@ -12,36 +12,16 @@
12 }
13 </th1></div>
14 </div>
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 if {[info exists login]} {
23 html "<a href='$home/login'>Logout</a>\n"
24 } else {
25 html "<a href='$home/login'>Login</a>\n"
26 }
27 </th1></div>
28
--- skins/blitz/header.txt
+++ skins/blitz/header.txt
@@ -23,52 +23,24 @@
2323
</th1>
2424
</div>
2525
2626
<!-- Main Menu -->
2727
<div class="mainmenu">
28
- <ul>
29
- <th1>
30
-proc menulink {url name} {
31
- upvar current_page current
32
- upvar home home
33
- if {[string range $url 0 [string length $current]] eq "/$current"} {
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]} {
3433
html "<li class='active'>"
34
+ set once 0
3535
} else {
3636
html "<li>"
3737
}
38
- html "<a href='$home$url'>$name</a></li>\n"
39
-}
40
-menulink $index_page Home
41
-if {[anycap jor]} {
42
- menulink /timeline Timeline
43
-}
44
-if {[hascap oh]} {
45
- menulink /dir?ci=tip Files
46
-}
47
-if {[hascap o]} {
48
- menulink /brlist Branches
49
- menulink /taglist Tags
50
-}
51
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
52
- menulink /forum Forum
53
-}
54
-if {[hascap r]} {
55
- menulink /ticket Tickets
56
-}
57
-if {[hascap j]} {
58
- menulink /wiki Wiki
59
-}
60
-if {[hascap o]} {
61
- menulink /help Help
62
-}
63
-if {[hascap s]} {
64
- menulink /setup Admin
65
-} elseif {[hascap a]} {
66
- menulink /setup_ulist Users
67
-}
68
- </th1>
69
- </ul>
38
+ if {[string match /* $url]} {set url $home$url}
39
+ html "<a href='$url'>$name</a></li>\n"
40
+}
41
+</th1></ul>
7042
</div> <!-- end div mainmenu -->
7143
</div> <!-- end div container -->
7244
</div> <!-- end div header -->
7345
<div class="middle max-full-width">
7446
<div class="container">
7547
--- skins/blitz/header.txt
+++ skins/blitz/header.txt
@@ -23,52 +23,24 @@
23 </th1>
24 </div>
25
26 <!-- Main Menu -->
27 <div class="mainmenu">
28 <ul>
29 <th1>
30 proc menulink {url name} {
31 upvar current_page current
32 upvar home home
33 if {[string range $url 0 [string length $current]] eq "/$current"} {
34 html "<li class='active'>"
 
35 } else {
36 html "<li>"
37 }
38 html "<a href='$home$url'>$name</a></li>\n"
39 }
40 menulink $index_page Home
41 if {[anycap jor]} {
42 menulink /timeline Timeline
43 }
44 if {[hascap oh]} {
45 menulink /dir?ci=tip Files
46 }
47 if {[hascap o]} {
48 menulink /brlist Branches
49 menulink /taglist Tags
50 }
51 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
52 menulink /forum Forum
53 }
54 if {[hascap r]} {
55 menulink /ticket Tickets
56 }
57 if {[hascap j]} {
58 menulink /wiki Wiki
59 }
60 if {[hascap o]} {
61 menulink /help Help
62 }
63 if {[hascap s]} {
64 menulink /setup Admin
65 } elseif {[hascap a]} {
66 menulink /setup_ulist Users
67 }
68 </th1>
69 </ul>
70 </div> <!-- end div mainmenu -->
71 </div> <!-- end div container -->
72 </div> <!-- end div header -->
73 <div class="middle max-full-width">
74 <div class="container">
75
--- skins/blitz/header.txt
+++ skins/blitz/header.txt
@@ -23,52 +23,24 @@
23 </th1>
24 </div>
25
26 <!-- Main Menu -->
27 <div class="mainmenu">
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 </div> <!-- end div container -->
44 </div> <!-- end div header -->
45 <div class="middle max-full-width">
46 <div class="container">
47
--- skins/blitz_no_logo/header.txt
+++ skins/blitz_no_logo/header.txt
@@ -20,52 +20,24 @@
2020
<small> &nbsp;$<title></small></h1>
2121
</div>
2222
2323
<!-- Main Menu -->
2424
<div class="mainmenu">
25
- <ul>
26
- <th1>
27
-proc menulink {url name} {
28
- upvar current_page current
29
- upvar home home
30
- if {[string range $url 0 [string length $current]] eq "/$current"} {
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]} {
3130
html "<li class='active'>"
31
+ set once 0
3232
} else {
3333
html "<li>"
3434
}
35
- html "<a href='$home$url'>$name</a></li>\n"
36
-}
37
-menulink $index_page Home
38
-if {[anycap jor]} {
39
- menulink /timeline Timeline
40
-}
41
-if {[hascap oh]} {
42
- menulink /dir?ci=tip Files
43
-}
44
-if {[hascap o]} {
45
- menulink /brlist Branches
46
- menulink /taglist Tags
47
-}
48
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
49
- menulink /forum Forum
50
-}
51
-if {[hascap r]} {
52
- menulink /ticket Tickets
53
-}
54
-if {[hascap j]} {
55
- menulink /wiki Wiki
56
-}
57
-if {[hascap o]} {
58
- menulink /help Help
59
- }
60
-if {[hascap s]} {
61
- menulink /setup Admin
62
-} elseif {[hascap a]} {
63
- menulink /setup_ulist Users
64
-}
65
- </th1>
66
- </ul>
35
+ if {[string match /* $url]} {set url $home$url}
36
+ html "<a href='$url'>$name</a></li>\n"
37
+}
38
+</th1></ul>
6739
</div> <!-- end div mainmenu -->
6840
</div> <!-- end div container -->
6941
</div> <!-- end div header -->
7042
<div class="middle max-full-width">
7143
<div class="container">
7244
--- skins/blitz_no_logo/header.txt
+++ skins/blitz_no_logo/header.txt
@@ -20,52 +20,24 @@
20 <small> &nbsp;$<title></small></h1>
21 </div>
22
23 <!-- Main Menu -->
24 <div class="mainmenu">
25 <ul>
26 <th1>
27 proc menulink {url name} {
28 upvar current_page current
29 upvar home home
30 if {[string range $url 0 [string length $current]] eq "/$current"} {
31 html "<li class='active'>"
 
32 } else {
33 html "<li>"
34 }
35 html "<a href='$home$url'>$name</a></li>\n"
36 }
37 menulink $index_page Home
38 if {[anycap jor]} {
39 menulink /timeline Timeline
40 }
41 if {[hascap oh]} {
42 menulink /dir?ci=tip Files
43 }
44 if {[hascap o]} {
45 menulink /brlist Branches
46 menulink /taglist Tags
47 }
48 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
49 menulink /forum Forum
50 }
51 if {[hascap r]} {
52 menulink /ticket Tickets
53 }
54 if {[hascap j]} {
55 menulink /wiki Wiki
56 }
57 if {[hascap o]} {
58 menulink /help Help
59 }
60 if {[hascap s]} {
61 menulink /setup Admin
62 } elseif {[hascap a]} {
63 menulink /setup_ulist Users
64 }
65 </th1>
66 </ul>
67 </div> <!-- end div mainmenu -->
68 </div> <!-- end div container -->
69 </div> <!-- end div header -->
70 <div class="middle max-full-width">
71 <div class="container">
72
--- skins/blitz_no_logo/header.txt
+++ skins/blitz_no_logo/header.txt
@@ -20,52 +20,24 @@
20 <small> &nbsp;$<title></small></h1>
21 </div>
22
23 <!-- Main Menu -->
24 <div class="mainmenu">
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 </div> <!-- end div container -->
41 </div> <!-- end div header -->
42 <div class="middle max-full-width">
43 <div class="container">
44
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -39,79 +39,25 @@
3939
html " &middot; <a href='$home/login'>Login</a>"
4040
}
4141
</th1></p>
4242
<ul class="nav navbar-nav">
4343
<th1>
44
- set is_index [expr [string compare [string range $current_page 0 4] "index"]==0]
45
- set is_home [expr [string compare [string range $current_page 0 [expr [string length $index_page]-1] ] $index_page]==0]
46
- if {$is_index || $is_home} {
47
- html "<li class='active'><a href='$home$index_page'>Home</a></li>\n"
48
- } else {
49
- html "<li><a href='$home$index_page'>Home</a></li>\n"
50
- }
51
- if {[hascap j]} {
52
- if {[string compare [string range $current_page 0 3] "wiki"] == 0} {
53
- html "<li class='active'><a href='$home/wiki'>Wiki</a></li>\n"
54
- } else {
55
- html "<li><a href='$home/wiki'>Wiki</a></li>\n"
56
- }
57
- }
58
- if {[anycap jor]} {
59
- if {[string compare $current_page "timeline"] == 0} {
60
- html "<li class='active'><a href='$home/timeline'>Timeline</a></li>\n"
61
- } else {
62
- html "<li><a href='$home/timeline'>Timeline</a></li>\n"
63
- }
64
- }
65
- if {[hascap oh]} {
66
- if {[string compare [string range $current_page 0 2] "dir"] == 0} {
67
- html "<li class='active'><a href='$home/dir?ci=tip'>Files</a></li>\n"
68
- } else {
69
- html "<li><a href='$home/dir?ci=tip'>Files</a></li>\n"
70
- }
71
- }
72
- if {[hascap o]} {
73
- if {[string compare $current_page "brlist"] == 0} {
74
- html "<li class='active'><a href='$home/brlist'>Branches</a></li>\n"
75
- } else {
76
- html "<li><a href='$home/brlist'>Branches</a></li>\n"
77
- }
78
- if {[string compare $current_page "taglist"] == 0} {
79
- html "<li class='active'><a href='$home/taglist'>Tags</a></li>\n"
80
- } else {
81
- html "<li><a href='$home/taglist'>Tags</a></li>\n"
82
- }
83
- }
84
- if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
85
- if {[string compare $current_page "forum"] == 0} {
86
- html "<li class='active'><a href='$home/forum'>Forum</a></li>\n"
87
- } else {
88
- html "<li><a href='$home/forum'>Forum</a></li>\n"
89
- }
90
- }
91
- if {[hascap r]} {
92
- if {[string compare $current_page "reportlist"] == 0} {
93
- html "<li class='active'><a href='$home/reportlist'>Tickets</a></li>\n"
94
- } else {
95
- html "<li><a href='$home/reportlist'>Tickets</a></li>\n"
96
- }
97
- }
98
- if {[hascap s]} {
99
- if {[string compare [string range $current_page 0 4] "setup"] == 0} {
100
- html "<li class='active'><a href='$home/setup'>Admin</a></li>\n"
101
- } else {
102
- html "<li><a href='$home/setup'>Admin</a></li>\n"
103
- }
104
- } elseif {[hascap a]} {
105
- if {[string compare [string range $current_page 0 4] "setup"] == 0} {
106
- html "<li class='active'><a href='$home/setup_ulist'>Users</a></li>\n"
107
- } else {
108
- html "<li><a href='$home/setup_ulist'>Users</a></li>\n"
109
- }
110
- }
111
- </th1>
112
- </ul>
44
+set once 1
45
+set is_index [expr [string compare [string range $current_page 0 4] "index"]==0]
46
+set is_home [expr [string compare [string range $current_page 0 [expr [string length $index_page]-1] ] $index_page]==0]
47
+foreach {name url expr class} $mainmenu {
48
+ if {![capexpr $expr]} continue
49
+ if {$once && [string match /$current_page* $url]} {
50
+ html "<li class='active'>"
51
+ set once 0
52
+ } else {
53
+ html "<li>"
54
+ }
55
+ if {[string match /* $url]} {set url $home$url}
56
+ html "<a href='$url'>$name</a></li>\n"
57
+}
58
+</th1></ul>
11359
</div><!--/.nav-collapse -->
11460
</div>
11561
</div>
11662
<div class="content">
11763
<th1>
11864
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -39,79 +39,25 @@
39 html " &middot; <a href='$home/login'>Login</a>"
40 }
41 </th1></p>
42 <ul class="nav navbar-nav">
43 <th1>
44 set is_index [expr [string compare [string range $current_page 0 4] "index"]==0]
45 set is_home [expr [string compare [string range $current_page 0 [expr [string length $index_page]-1] ] $index_page]==0]
46 if {$is_index || $is_home} {
47 html "<li class='active'><a href='$home$index_page'>Home</a></li>\n"
48 } else {
49 html "<li><a href='$home$index_page'>Home</a></li>\n"
50 }
51 if {[hascap j]} {
52 if {[string compare [string range $current_page 0 3] "wiki"] == 0} {
53 html "<li class='active'><a href='$home/wiki'>Wiki</a></li>\n"
54 } else {
55 html "<li><a href='$home/wiki'>Wiki</a></li>\n"
56 }
57 }
58 if {[anycap jor]} {
59 if {[string compare $current_page "timeline"] == 0} {
60 html "<li class='active'><a href='$home/timeline'>Timeline</a></li>\n"
61 } else {
62 html "<li><a href='$home/timeline'>Timeline</a></li>\n"
63 }
64 }
65 if {[hascap oh]} {
66 if {[string compare [string range $current_page 0 2] "dir"] == 0} {
67 html "<li class='active'><a href='$home/dir?ci=tip'>Files</a></li>\n"
68 } else {
69 html "<li><a href='$home/dir?ci=tip'>Files</a></li>\n"
70 }
71 }
72 if {[hascap o]} {
73 if {[string compare $current_page "brlist"] == 0} {
74 html "<li class='active'><a href='$home/brlist'>Branches</a></li>\n"
75 } else {
76 html "<li><a href='$home/brlist'>Branches</a></li>\n"
77 }
78 if {[string compare $current_page "taglist"] == 0} {
79 html "<li class='active'><a href='$home/taglist'>Tags</a></li>\n"
80 } else {
81 html "<li><a href='$home/taglist'>Tags</a></li>\n"
82 }
83 }
84 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
85 if {[string compare $current_page "forum"] == 0} {
86 html "<li class='active'><a href='$home/forum'>Forum</a></li>\n"
87 } else {
88 html "<li><a href='$home/forum'>Forum</a></li>\n"
89 }
90 }
91 if {[hascap r]} {
92 if {[string compare $current_page "reportlist"] == 0} {
93 html "<li class='active'><a href='$home/reportlist'>Tickets</a></li>\n"
94 } else {
95 html "<li><a href='$home/reportlist'>Tickets</a></li>\n"
96 }
97 }
98 if {[hascap s]} {
99 if {[string compare [string range $current_page 0 4] "setup"] == 0} {
100 html "<li class='active'><a href='$home/setup'>Admin</a></li>\n"
101 } else {
102 html "<li><a href='$home/setup'>Admin</a></li>\n"
103 }
104 } elseif {[hascap a]} {
105 if {[string compare [string range $current_page 0 4] "setup"] == 0} {
106 html "<li class='active'><a href='$home/setup_ulist'>Users</a></li>\n"
107 } else {
108 html "<li><a href='$home/setup_ulist'>Users</a></li>\n"
109 }
110 }
111 </th1>
112 </ul>
113 </div><!--/.nav-collapse -->
114 </div>
115 </div>
116 <div class="content">
117 <th1>
118
--- skins/bootstrap/header.txt
+++ skins/bootstrap/header.txt
@@ -39,79 +39,25 @@
39 html " &middot; <a href='$home/login'>Login</a>"
40 }
41 </th1></p>
42 <ul class="nav navbar-nav">
43 <th1>
44 set once 1
45 set is_index [expr [string compare [string range $current_page 0 4] "index"]==0]
46 set is_home [expr [string compare [string range $current_page 0 [expr [string length $index_page]-1] ] $index_page]==0]
47 foreach {name url expr class} $mainmenu {
48 if {![capexpr $expr]} continue
49 if {$once && [string match /$current_page* $url]} {
50 html "<li class='active'>"
51 set once 0
52 } else {
53 html "<li>"
54 }
55 if {[string match /* $url]} {set url $home$url}
56 html "<a href='$url'>$name</a></li>\n"
57 }
58 </th1></ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59 </div><!--/.nav-collapse -->
60 </div>
61 </div>
62 <div class="content">
63 <th1>
64
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -272,11 +272,11 @@
272272
padding: 10px 10px;
273273
}
274274
.mainmenu {
275275
padding: 10px;
276276
}
277
- .not-mobile {
277
+ .desktoponly {
278278
display: none;
279279
}
280280
}
281281
@media screen and (min-width: 600px) {
282282
/* Spacing for desktop */
@@ -296,9 +296,9 @@
296296
padding: 10px;
297297
}
298298
}
299299
@media screen and (max-width: 1200px) {
300300
/* Special declarations for narrow desktop or wide mobile */
301
- .wide-screen {
301
+ .wideonly {
302302
display: none;
303303
}
304304
}
305305
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -272,11 +272,11 @@
272 padding: 10px 10px;
273 }
274 .mainmenu {
275 padding: 10px;
276 }
277 .not-mobile {
278 display: none;
279 }
280 }
281 @media screen and (min-width: 600px) {
282 /* Spacing for desktop */
@@ -296,9 +296,9 @@
296 padding: 10px;
297 }
298 }
299 @media screen and (max-width: 1200px) {
300 /* Special declarations for narrow desktop or wide mobile */
301 .wide-screen {
302 display: none;
303 }
304 }
305
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -272,11 +272,11 @@
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 */
@@ -296,9 +296,9 @@
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/header.txt
+++ skins/default/header.txt
@@ -8,47 +8,19 @@
88
}
99
</th1></div>
1010
</div>
1111
<div class="mainmenu">
1212
<th1>
13
-proc menulink {url name cls} {
14
- upvar current_page current
15
- upvar home home
16
- if {[string range $url 0 [string length $current]] eq "/$current"} {
17
- html "<a href='$home$url' class='active $cls'>$name</a>\n"
18
- } else {
19
- html "<a href='$home$url' class='$cls'>$name</a>\n"
20
- }
21
-}
2213
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
2314
builtin_request_js hbmenu.js
24
-menulink $index_page Home {}
25
-if {[anycap jor]} {
26
- menulink /timeline Timeline {}
27
-}
28
-if {[hascap oh]} {
29
- if {![info exists current_checkin]} {set current_checkin tip}
30
- menulink /dir?ci=$current_checkin Files desktoponly
31
-}
32
-if {[hascap o]} {
33
- menulink /brlist Branches wideonly
34
- menulink /taglist Tags wideonly
35
-}
36
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
37
- menulink /forum Forum desktoponly
38
-}
39
-if {[hascap C]} {
40
- menulink /chat Chat wideonly
41
-}
42
-if {[hascap r]} {
43
- menulink /ticket Tickets wideonly
44
-}
45
-if {[hascap j]} {
46
- menulink /wiki Wiki wideonly
47
-}
48
-if {[hascap s]} {
49
- menulink /setup Admin {}
50
-} elseif {[hascap a]} {
51
- menulink /setup_ulist Users {}
15
+foreach {name url expr class} $mainmenu {
16
+ if {![capexpr $expr]} continue
17
+ if {[string match /* $url]} {
18
+ if {[string match /$current_page* $url]} {
19
+ set class "active $class"
20
+ }
21
+ set url $home$url
22
+ }
23
+ html "<a href='$url' class='$class'>$name</a>\n"
5224
}
5325
</th1></div>
5426
<div id='hbdrop'></div>
5527
--- skins/default/header.txt
+++ skins/default/header.txt
@@ -8,47 +8,19 @@
8 }
9 </th1></div>
10 </div>
11 <div class="mainmenu">
12 <th1>
13 proc menulink {url name cls} {
14 upvar current_page current
15 upvar home home
16 if {[string range $url 0 [string length $current]] eq "/$current"} {
17 html "<a href='$home$url' class='active $cls'>$name</a>\n"
18 } else {
19 html "<a href='$home$url' class='$cls'>$name</a>\n"
20 }
21 }
22 html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
23 builtin_request_js hbmenu.js
24 menulink $index_page Home {}
25 if {[anycap jor]} {
26 menulink /timeline Timeline {}
27 }
28 if {[hascap oh]} {
29 if {![info exists current_checkin]} {set current_checkin tip}
30 menulink /dir?ci=$current_checkin Files desktoponly
31 }
32 if {[hascap o]} {
33 menulink /brlist Branches wideonly
34 menulink /taglist Tags wideonly
35 }
36 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
37 menulink /forum Forum desktoponly
38 }
39 if {[hascap C]} {
40 menulink /chat Chat wideonly
41 }
42 if {[hascap r]} {
43 menulink /ticket Tickets wideonly
44 }
45 if {[hascap j]} {
46 menulink /wiki Wiki wideonly
47 }
48 if {[hascap s]} {
49 menulink /setup Admin {}
50 } elseif {[hascap a]} {
51 menulink /setup_ulist Users {}
52 }
53 </th1></div>
54 <div id='hbdrop'></div>
55
--- skins/default/header.txt
+++ skins/default/header.txt
@@ -8,47 +8,19 @@
8 }
9 </th1></div>
10 </div>
11 <div class="mainmenu">
12 <th1>
 
 
 
 
 
 
 
 
 
13 html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
14 builtin_request_js hbmenu.js
15 foreach {name url expr class} $mainmenu {
16 if {![capexpr $expr]} continue
17 if {[string match /* $url]} {
18 if {[string match /$current_page* $url]} {
19 set class "active $class"
20 }
21 set url $home$url
22 }
23 html "<a href='$url' class='$class'>$name</a>\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24 }
25 </th1></div>
26 <div id='hbdrop'></div>
27
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -89,44 +89,17 @@
8989
setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
9090
}
9191
}
9292
updateClock();
9393
</script>
94
-<div class="mainmenu">
95
-<th1>
96
-proc menulink {url name} {
97
- upvar home home
98
- html "<a href='$home$url'>$name</a>\n"
99
-}
100
-menulink $index_page Home
101
-menulink /help Help
102
-if {[anycap jor]} {
103
- menulink /timeline Timeline
104
-}
105
-if {[anoncap oh]} {
106
- menulink /dir?ci=tip Files
107
-}
108
-if {[anoncap o]} {
109
- menulink /brlist Branches
110
- menulink /taglist Tags
111
-}
112
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
113
- menulink /forum Forum
114
-}
115
-if {[anoncap r]} {
116
- menulink /ticket Tickets
117
-}
118
-if {[anoncap j]} {
119
- menulink /wiki Wiki
120
-}
121
-menulink /sitemap More...
122
-if {[hascap s]} {
123
- menulink /setup Admin
124
-} elseif {[hascap a]} {
125
- menulink /setup_ulist Users
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"
12699
}
127100
if {[info exists login]} {
128
- menulink /login Logout
101
+ html "<a href='$home/logout'>Logout</a>\n"
129102
} else {
130
- menulink /login Login
103
+ html "<a href='$home/login'>Login</a>\n"
131104
}
132105
</th1></div>
133106
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -89,44 +89,17 @@
89 setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
90 }
91 }
92 updateClock();
93 </script>
94 <div class="mainmenu">
95 <th1>
96 proc menulink {url name} {
97 upvar home home
98 html "<a href='$home$url'>$name</a>\n"
99 }
100 menulink $index_page Home
101 menulink /help Help
102 if {[anycap jor]} {
103 menulink /timeline Timeline
104 }
105 if {[anoncap oh]} {
106 menulink /dir?ci=tip Files
107 }
108 if {[anoncap o]} {
109 menulink /brlist Branches
110 menulink /taglist Tags
111 }
112 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
113 menulink /forum Forum
114 }
115 if {[anoncap r]} {
116 menulink /ticket Tickets
117 }
118 if {[anoncap j]} {
119 menulink /wiki Wiki
120 }
121 menulink /sitemap More...
122 if {[hascap s]} {
123 menulink /setup Admin
124 } elseif {[hascap a]} {
125 menulink /setup_ulist Users
126 }
127 if {[info exists login]} {
128 menulink /login Logout
129 } else {
130 menulink /login Login
131 }
132 </th1></div>
133
--- skins/eagle/header.txt
+++ skins/eagle/header.txt
@@ -89,44 +89,17 @@
89 setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
90 }
91 }
92 updateClock();
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 }
105 </th1></div>
106
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -89,43 +89,17 @@
8989
setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
9090
}
9191
}
9292
updateClock();
9393
</script>
94
-<div class="mainmenu">
95
-<th1>
96
-proc menulink {url name} {
97
- upvar home home
98
- html "<a href='$home$url'>$name</a>\n"
99
-}
100
-menulink $index_page Home
101
-menulink /help Help
102
-if {[anycap jor]} {
103
- menulink /timeline Timeline
104
-}
105
-if {[anoncap oh]} {
106
- menulink /dir?ci=tip Files
107
-}
108
-if {[anoncap o]} {
109
- menulink /brlist Branches
110
- menulink /taglist Tags
111
-}
112
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
113
- menulink /forum Forum
114
-}
115
-if {[anoncap r]} {
116
- menulink /ticket Tickets
117
-}
118
-if {[anoncap j]} {
119
- menulink /wiki Wiki
120
-}
121
-if {[hascap s]} {
122
- menulink /setup Admin
123
-} elseif {[hascap a]} {
124
- menulink /setup_ulist Users
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"
12599
}
126100
if {[info exists login]} {
127
- menulink /login Logout
101
+ html "<a href='$home/logout'>Logout</a>\n"
128102
} else {
129
- menulink /login Login
103
+ html "<a href='$home/login'>Login</a>\n"
130104
}
131105
</th1></div>
132106
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -89,43 +89,17 @@
89 setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
90 }
91 }
92 updateClock();
93 </script>
94 <div class="mainmenu">
95 <th1>
96 proc menulink {url name} {
97 upvar home home
98 html "<a href='$home$url'>$name</a>\n"
99 }
100 menulink $index_page Home
101 menulink /help Help
102 if {[anycap jor]} {
103 menulink /timeline Timeline
104 }
105 if {[anoncap oh]} {
106 menulink /dir?ci=tip Files
107 }
108 if {[anoncap o]} {
109 menulink /brlist Branches
110 menulink /taglist Tags
111 }
112 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
113 menulink /forum Forum
114 }
115 if {[anoncap r]} {
116 menulink /ticket Tickets
117 }
118 if {[anoncap j]} {
119 menulink /wiki Wiki
120 }
121 if {[hascap s]} {
122 menulink /setup Admin
123 } elseif {[hascap a]} {
124 menulink /setup_ulist Users
125 }
126 if {[info exists login]} {
127 menulink /login Logout
128 } else {
129 menulink /login Login
130 }
131 </th1></div>
132
--- skins/enhanced1/header.txt
+++ skins/enhanced1/header.txt
@@ -89,43 +89,17 @@
89 setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
90 }
91 }
92 updateClock();
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 }
105 </th1></div>
106
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -8,38 +8,17 @@
88
} else {
99
puts "Not logged in"
1010
}
1111
</th1></div>
1212
</div>
13
-<div class="mainmenu">
14
-<th1>
15
-html "<a href='$home$index_page'>Home</a>\n"
16
-if {[anycap jor]} {
17
- html "<a href='$home/timeline'>Timeline</a>\n"
18
-}
19
-if {[anoncap oh]} {
20
- html "<a href='$home/tree?ci=tip'>Files</a>\n"
21
-}
22
-if {[anoncap o]} {
23
- html "<a href='$home/brlist'>Branches</a>\n"
24
- html "<a href='$home/taglist'>Tags</a>\n"
25
-}
26
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
27
- html "<a href='$home/forum'>Forum</a>\n"
28
-}
29
-if {[anoncap r]} {
30
- html "<a href='$home/ticket'>Tickets</a>\n"
31
-}
32
-if {[anoncap j]} {
33
- html "<a href='$home/wiki'>Wiki</a>\n"
34
-}
35
-if {[hascap s]} {
36
- html "<a href='$home/setup'>Admin</a>\n"
37
-} elseif {[hascap a]} {
38
- html "<a href='$home/setup_ulist'>Users</a>\n"
13
+<div class="mainmenu"><th1>
14
+foreach {name url expr class} $mainmenu {
15
+ if {![capexpr $expr]} continue
16
+ if {[string match /* $url]} {set url $home$url}
17
+ html "<a href='$url'>$name</a>\n"
3918
}
4019
if {[info exists login]} {
41
- html "<a href='$home/login'>Logout</a>\n"
20
+ html "<a href='/logout'>Logout</a>\n"
4221
} else {
43
- html "<a href='$home/login'>Login</a>\n"
22
+ html "<a href='/login'>Login</a>\n"
4423
}
4524
</th1></div>
4625
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -8,38 +8,17 @@
8 } else {
9 puts "Not logged in"
10 }
11 </th1></div>
12 </div>
13 <div class="mainmenu">
14 <th1>
15 html "<a href='$home$index_page'>Home</a>\n"
16 if {[anycap jor]} {
17 html "<a href='$home/timeline'>Timeline</a>\n"
18 }
19 if {[anoncap oh]} {
20 html "<a href='$home/tree?ci=tip'>Files</a>\n"
21 }
22 if {[anoncap o]} {
23 html "<a href='$home/brlist'>Branches</a>\n"
24 html "<a href='$home/taglist'>Tags</a>\n"
25 }
26 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
27 html "<a href='$home/forum'>Forum</a>\n"
28 }
29 if {[anoncap r]} {
30 html "<a href='$home/ticket'>Tickets</a>\n"
31 }
32 if {[anoncap j]} {
33 html "<a href='$home/wiki'>Wiki</a>\n"
34 }
35 if {[hascap s]} {
36 html "<a href='$home/setup'>Admin</a>\n"
37 } elseif {[hascap a]} {
38 html "<a href='$home/setup_ulist'>Users</a>\n"
39 }
40 if {[info exists login]} {
41 html "<a href='$home/login'>Logout</a>\n"
42 } else {
43 html "<a href='$home/login'>Login</a>\n"
44 }
45 </th1></div>
46
--- skins/khaki/header.txt
+++ skins/khaki/header.txt
@@ -8,38 +8,17 @@
8 } else {
9 puts "Not logged in"
10 }
11 </th1></div>
12 </div>
13 <div class="mainmenu"><th1>
14 foreach {name url expr class} $mainmenu {
15 if {![capexpr $expr]} continue
16 if {[string match /* $url]} {set url $home$url}
17 html "<a href='$url'>$name</a>\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18 }
19 if {[info exists login]} {
20 html "<a href='/logout'>Logout</a>\n"
21 } else {
22 html "<a href='/login'>Login</a>\n"
23 }
24 </th1></div>
25
--- skins/original/header.txt
+++ skins/original/header.txt
@@ -9,38 +9,17 @@
99
} else {
1010
puts "Not logged in"
1111
}
1212
</th1></div>
1313
</div>
14
-<div class="mainmenu">
15
-<th1>
16
-html "<a href='$home$index_page'>Home</a>\n"
17
-if {[anycap jor]} {
18
- html "<a href='$home/timeline'>Timeline</a>\n"
19
-}
20
-if {[anoncap oh]} {
21
- html "<a href='$home/tree?ci=tip'>Files</a>\n"
22
-}
23
-if {[anoncap o]} {
24
- html "<a href='$home/brlist'>Branches</a>\n"
25
- html "<a href='$home/taglist'>Tags</a>\n"
26
-}
27
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
28
- html "<a href='$home/forum'>Forum</a>\n"
29
-}
30
-if {[anoncap r]} {
31
- html "<a href='$home/ticket'>Tickets</a>\n"
32
-}
33
-if {[anoncap j]} {
34
- html "<a href='$home/wiki'>Wiki</a>\n"
35
-}
36
-if {[hascap s]} {
37
- html "<a href='$home/setup'>Admin</a>\n"
38
-} elseif {[hascap a]} {
39
- html "<a href='$home/setup_ulist'>Users</a>\n"
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='$home$url'>$name</a>\n"
4019
}
4120
if {[info exists login]} {
42
- html "<a href='$home/login'>Logout</a>\n"
21
+ html "<a href='$home/logout'>Logout</a>\n"
4322
} else {
4423
html "<a href='$home/login'>Login</a>\n"
4524
}
4625
</th1></div>
4726
--- skins/original/header.txt
+++ skins/original/header.txt
@@ -9,38 +9,17 @@
9 } else {
10 puts "Not logged in"
11 }
12 </th1></div>
13 </div>
14 <div class="mainmenu">
15 <th1>
16 html "<a href='$home$index_page'>Home</a>\n"
17 if {[anycap jor]} {
18 html "<a href='$home/timeline'>Timeline</a>\n"
19 }
20 if {[anoncap oh]} {
21 html "<a href='$home/tree?ci=tip'>Files</a>\n"
22 }
23 if {[anoncap o]} {
24 html "<a href='$home/brlist'>Branches</a>\n"
25 html "<a href='$home/taglist'>Tags</a>\n"
26 }
27 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
28 html "<a href='$home/forum'>Forum</a>\n"
29 }
30 if {[anoncap r]} {
31 html "<a href='$home/ticket'>Tickets</a>\n"
32 }
33 if {[anoncap j]} {
34 html "<a href='$home/wiki'>Wiki</a>\n"
35 }
36 if {[hascap s]} {
37 html "<a href='$home/setup'>Admin</a>\n"
38 } elseif {[hascap a]} {
39 html "<a href='$home/setup_ulist'>Users</a>\n"
40 }
41 if {[info exists login]} {
42 html "<a href='$home/login'>Logout</a>\n"
43 } else {
44 html "<a href='$home/login'>Login</a>\n"
45 }
46 </th1></div>
47
--- skins/original/header.txt
+++ skins/original/header.txt
@@ -9,38 +9,17 @@
9 } else {
10 puts "Not logged in"
11 }
12 </th1></div>
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='$home$url'>$name</a>\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19 }
20 if {[info exists login]} {
21 html "<a href='$home/logout'>Logout</a>\n"
22 } else {
23 html "<a href='$home/login'>Login</a>\n"
24 }
25 </th1></div>
26
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -3,35 +3,17 @@
33
</div>
44
<div class="mainmenu">
55
<th1>
66
html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
77
builtin_request_js hbmenu.js
8
-html "<a href='$home$index_page'>Home</a>\n"
9
-if {[anycap jor]} {
10
- html "<a href='$home/timeline'>Timeline</a>\n"
11
-}
12
-if {[anoncap oh]} {
13
- html "<a href='$home/tree?ci=tip'>Files</a>\n"
14
-}
15
-#if {[anoncap o]} {
16
-# html "<a href='$home/brlist'>Branches</a>\n"
17
-# html "<a href='$home/taglist'>Tags</a>\n"
18
-#}
19
-#if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
20
-# html "<a href='$home/forum'>Forum</a>\n"
21
-#}
22
-#if {[anoncap r]} {
23
-# html "<a href='$home/ticket'>Tickets</a>\n"
24
-#}
25
-#if {[anoncap j]} {
26
-# html "<a href='$home/wiki'>Wiki</a>\n"
27
-#}
28
-if {[hascap s]} {
29
- html "<a href='$home/setup'>Admin</a>\n"
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"
3012
}
3113
if {[info exists login]} {
32
- html "<a href='$home/login'>Logout</a>\n"
14
+ html "<a href='$home/logout'>Logout</a>\n"
3315
} else {
3416
html "<a href='$home/login'>Login</a>\n"
3517
}
3618
</th1></div>
3719
<div id='hbdrop' class='hbdrop'></div>
3820
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -3,35 +3,17 @@
3 </div>
4 <div class="mainmenu">
5 <th1>
6 html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
7 builtin_request_js hbmenu.js
8 html "<a href='$home$index_page'>Home</a>\n"
9 if {[anycap jor]} {
10 html "<a href='$home/timeline'>Timeline</a>\n"
11 }
12 if {[anoncap oh]} {
13 html "<a href='$home/tree?ci=tip'>Files</a>\n"
14 }
15 #if {[anoncap o]} {
16 # html "<a href='$home/brlist'>Branches</a>\n"
17 # html "<a href='$home/taglist'>Tags</a>\n"
18 #}
19 #if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
20 # html "<a href='$home/forum'>Forum</a>\n"
21 #}
22 #if {[anoncap r]} {
23 # html "<a href='$home/ticket'>Tickets</a>\n"
24 #}
25 #if {[anoncap j]} {
26 # html "<a href='$home/wiki'>Wiki</a>\n"
27 #}
28 if {[hascap s]} {
29 html "<a href='$home/setup'>Admin</a>\n"
30 }
31 if {[info exists login]} {
32 html "<a href='$home/login'>Logout</a>\n"
33 } else {
34 html "<a href='$home/login'>Login</a>\n"
35 }
36 </th1></div>
37 <div id='hbdrop' class='hbdrop'></div>
38
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -3,35 +3,17 @@
3 </div>
4 <div class="mainmenu">
5 <th1>
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 if {[info exists login]} {
14 html "<a href='$home/logout'>Logout</a>\n"
15 } else {
16 html "<a href='$home/login'>Login</a>\n"
17 }
18 </th1></div>
19 <div id='hbdrop' class='hbdrop'></div>
20
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -10,38 +10,17 @@
1010
} else {
1111
puts "Not logged in"
1212
}
1313
</th1></div>
1414
</div>
15
-<div class="mainmenu">
16
-<th1>
17
-html "<a href='$home$index_page'>Home</a>\n"
18
-if {[anycap jor]} {
19
- html "<a href='$home/timeline'>Timeline</a>\n"
20
-}
21
-if {[anoncap oh]} {
22
- html "<a href='$home/tree?ci=tip'>Files</a>\n"
23
-}
24
-if {[anoncap o]} {
25
- html "<a href='$home/brlist'>Branches</a>\n"
26
- html "<a href='$home/taglist'>Tags</a>\n"
27
-}
28
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
29
- html "<a href='$home/forum'>Forum</a>\n"
30
-}
31
-if {[anoncap r]} {
32
- html "<a href='$home/ticket'>Tickets</a>\n"
33
-}
34
-if {[anoncap j]} {
35
- html "<a href='$home/wiki'>Wiki</a>\n"
36
-}
37
-if {[hascap s]} {
38
- html "<a href='$home/setup'>Admin</a>\n"
39
-} elseif {[hascap a]} {
40
- html "<a href='$home/setup_ulist'>Users</a>\n"
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"
4120
}
4221
if {[info exists login]} {
43
- html "<a href='$home/login'>Logout</a>\n"
22
+ html "<a href='$home/logout'>Logout</a>\n"
4423
} else {
4524
html "<a href='$home/login'>Login</a>\n"
4625
}
4726
</th1></div>
4827
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -10,38 +10,17 @@
10 } else {
11 puts "Not logged in"
12 }
13 </th1></div>
14 </div>
15 <div class="mainmenu">
16 <th1>
17 html "<a href='$home$index_page'>Home</a>\n"
18 if {[anycap jor]} {
19 html "<a href='$home/timeline'>Timeline</a>\n"
20 }
21 if {[anoncap oh]} {
22 html "<a href='$home/tree?ci=tip'>Files</a>\n"
23 }
24 if {[anoncap o]} {
25 html "<a href='$home/brlist'>Branches</a>\n"
26 html "<a href='$home/taglist'>Tags</a>\n"
27 }
28 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
29 html "<a href='$home/forum'>Forum</a>\n"
30 }
31 if {[anoncap r]} {
32 html "<a href='$home/ticket'>Tickets</a>\n"
33 }
34 if {[anoncap j]} {
35 html "<a href='$home/wiki'>Wiki</a>\n"
36 }
37 if {[hascap s]} {
38 html "<a href='$home/setup'>Admin</a>\n"
39 } elseif {[hascap a]} {
40 html "<a href='$home/setup_ulist'>Users</a>\n"
41 }
42 if {[info exists login]} {
43 html "<a href='$home/login'>Logout</a>\n"
44 } else {
45 html "<a href='$home/login'>Login</a>\n"
46 }
47 </th1></div>
48
--- skins/rounded1/header.txt
+++ skins/rounded1/header.txt
@@ -10,38 +10,17 @@
10 } else {
11 puts "Not logged in"
12 }
13 </th1></div>
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 if {[info exists login]} {
22 html "<a href='$home/logout'>Logout</a>\n"
23 } else {
24 html "<a href='$home/login'>Login</a>\n"
25 }
26 </th1></div>
27
--- skins/xekri/header.txt
+++ skins/xekri/header.txt
@@ -89,48 +89,16 @@
8989
setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
9090
}
9191
}
9292
updateClock();
9393
</script>
94
-<div class="mainmenu">
95
-<th1>
96
-proc menulink {url name} {
97
- upvar current_page current
98
- upvar home home
99
- if {[string range $url 0 [string length $current]] eq "/$current"} {
100
- html "<a href='$home$url' class='active'>$name</a>\n"
101
- } else {
102
- html "<a href='$home$url'>$name</a>\n"
103
- }
104
-}
105
-menulink $index_page Home
106
-if {[anycap jor]} {
107
- menulink /timeline Timeline
108
-}
109
-if {[anoncap oh]} {
110
- menulink /dir?ci=tip Files
111
-}
112
-if {[anoncap o]} {
113
- menulink /brlist Branches
114
- menulink /taglist Tags
115
-}
116
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
117
- menulink /forum Forum
118
-}
119
-if {[anoncap r]} {
120
- menulink /ticket Tickets
121
-}
122
-if {[anoncap j]} {
123
- menulink /wiki Wiki
124
-}
125
- menulink /sitemap More...
126
-if {[hascap s]} {
127
- menulink /setup Admin
128
-} elseif {[hascap a]} {
129
- menulink /setup_ulist Users
94
+<div class="mainmenu"><th1>
95
+foreach {name url expr class} $mainmenu {
96
+ if {![capexpr $expr]} continue
97
+ html "<a href='$home$url'>$name</a>\n"
13098
}
13199
if {[info exists login]} {
132
- menulink /login Logout
100
+ html "<a href='$home/logout'>Logout</a>\n"
133101
} else {
134
- menulink /login Login
102
+ html "<a href='$home/login'>Login</a>\n"
135103
}
136104
</th1></div>
137105
--- skins/xekri/header.txt
+++ skins/xekri/header.txt
@@ -89,48 +89,16 @@
89 setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
90 }
91 }
92 updateClock();
93 </script>
94 <div class="mainmenu">
95 <th1>
96 proc menulink {url name} {
97 upvar current_page current
98 upvar home home
99 if {[string range $url 0 [string length $current]] eq "/$current"} {
100 html "<a href='$home$url' class='active'>$name</a>\n"
101 } else {
102 html "<a href='$home$url'>$name</a>\n"
103 }
104 }
105 menulink $index_page Home
106 if {[anycap jor]} {
107 menulink /timeline Timeline
108 }
109 if {[anoncap oh]} {
110 menulink /dir?ci=tip Files
111 }
112 if {[anoncap o]} {
113 menulink /brlist Branches
114 menulink /taglist Tags
115 }
116 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
117 menulink /forum Forum
118 }
119 if {[anoncap r]} {
120 menulink /ticket Tickets
121 }
122 if {[anoncap j]} {
123 menulink /wiki Wiki
124 }
125 menulink /sitemap More...
126 if {[hascap s]} {
127 menulink /setup Admin
128 } elseif {[hascap a]} {
129 menulink /setup_ulist Users
130 }
131 if {[info exists login]} {
132 menulink /login Logout
133 } else {
134 menulink /login Login
135 }
136 </th1></div>
137
--- skins/xekri/header.txt
+++ skins/xekri/header.txt
@@ -89,48 +89,16 @@
89 setTimeout(updateClock,(60-d.getUTCSeconds())*1000);
90 }
91 }
92 updateClock();
93 </script>
94 <div class="mainmenu"><th1>
95 foreach {name url expr class} $mainmenu {
96 if {![capexpr $expr]} continue
97 html "<a href='$home$url'>$name</a>\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98 }
99 if {[info exists login]} {
100 html "<a href='$home/logout'>Logout</a>\n"
101 } else {
102 html "<a href='$home/login'>Login</a>\n"
103 }
104 </th1></div>
105
--- src/configure.c
+++ src/configure.c
@@ -89,10 +89,11 @@
8989
const char *zName; /* Name of the configuration parameter */
9090
int groupMask; /* Which config groups is it part of */
9191
} aConfig[] = {
9292
{ "css", CONFIGSET_CSS },
9393
{ "header", CONFIGSET_SKIN },
94
+ { "mainmenu", CONFIGSET_SKIN },
9495
{ "footer", CONFIGSET_SKIN },
9596
{ "details", CONFIGSET_SKIN },
9697
{ "js", CONFIGSET_SKIN },
9798
{ "logo-mimetype", CONFIGSET_SKIN },
9899
{ "logo-image", CONFIGSET_SKIN },
99100
--- src/configure.c
+++ src/configure.c
@@ -89,10 +89,11 @@
89 const char *zName; /* Name of the configuration parameter */
90 int groupMask; /* Which config groups is it part of */
91 } aConfig[] = {
92 { "css", CONFIGSET_CSS },
93 { "header", CONFIGSET_SKIN },
 
94 { "footer", CONFIGSET_SKIN },
95 { "details", CONFIGSET_SKIN },
96 { "js", CONFIGSET_SKIN },
97 { "logo-mimetype", CONFIGSET_SKIN },
98 { "logo-image", CONFIGSET_SKIN },
99
--- src/configure.c
+++ src/configure.c
@@ -89,10 +89,11 @@
89 const char *zName; /* Name of the configuration parameter */
90 int groupMask; /* Which config groups is it part of */
91 } aConfig[] = {
92 { "css", CONFIGSET_CSS },
93 { "header", CONFIGSET_SKIN },
94 { "mainmenu", CONFIGSET_SKIN },
95 { "footer", CONFIGSET_SKIN },
96 { "details", CONFIGSET_SKIN },
97 { "js", CONFIGSET_SKIN },
98 { "logo-mimetype", CONFIGSET_SKIN },
99 { "logo-image", CONFIGSET_SKIN },
100
+28
--- src/setup.c
+++ src/setup.c
@@ -1016,10 +1016,38 @@
10161016
@ <p>Note: To avoid a redirect loop or other problems, this entry must
10171017
@ begin with "/" and it must specify a valid page. For example,
10181018
@ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the
10191019
@ leading "/".</p>
10201020
@ <p>(Property: "index-page")
1021
+ @ <hr>
1022
+ @ <p>The main menu for the web interface
1023
+ @ <p>
1024
+ @
1025
+ @ <p>This setting should be a TCL list. Each set of four consecutive
1026
+ @ values defines a single main menu item:
1027
+ @ <ol>
1028
+ @ <li> The first term is text that appears on the menu.
1029
+ @ <li> The second term is a hyperlink to take when a user clicks on the
1030
+ @ entry. Hyperlinks that start with "/" are relative to the
1031
+ @ repository root.
1032
+ @ <li> The third term is an argument to the TH1 "capexpr" command.
1033
+ @ If capexpr evalutes to true, then the entry is shown. If not,
1034
+ @ the entry is omitted. "*" is always true. "{}" is never true.
1035
+ @ <li> The fouth term is a list of extra class names to apply to the new
1036
+ @ menu entry. Some skins will classes "desktoponly" and "wideonly"
1037
+ @ to only show the entries when the web browser screen is wide or
1038
+ @ very wide, respectively.
1039
+ @ </ol>
1040
+ @
1041
+ @ <p>Some custom skins might not use this property. Whether the property
1042
+ @ is used or a choice made by the skin designer. Some skins add an extra
1043
+ @ choices (such as the hamburger button) to the menu that are not shown
1044
+ @ on this list. (Property: mainmenu)
1045
+ @ <p>
1046
+ textarea_attribute("Main Menu", 12, 80,
1047
+ "mainmenu", "mmenu", style_default_mainmenu(), 0);
1048
+ @
10211049
@ <hr>
10221050
@ <p>Extra links to appear on the <a href="%R/sitemap">/sitemap</a> page,
10231051
@ as sub-items of the "Home Page" entry, appearing before the
10241052
@ "Documentation Search" entry (if any). In skins that use the /sitemap
10251053
@ page to construct a hamburger menu dropdown, new entries added here
10261054
--- src/setup.c
+++ src/setup.c
@@ -1016,10 +1016,38 @@
1016 @ <p>Note: To avoid a redirect loop or other problems, this entry must
1017 @ begin with "/" and it must specify a valid page. For example,
1018 @ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the
1019 @ leading "/".</p>
1020 @ <p>(Property: "index-page")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1021 @ <hr>
1022 @ <p>Extra links to appear on the <a href="%R/sitemap">/sitemap</a> page,
1023 @ as sub-items of the "Home Page" entry, appearing before the
1024 @ "Documentation Search" entry (if any). In skins that use the /sitemap
1025 @ page to construct a hamburger menu dropdown, new entries added here
1026
--- src/setup.c
+++ src/setup.c
@@ -1016,10 +1016,38 @@
1016 @ <p>Note: To avoid a redirect loop or other problems, this entry must
1017 @ begin with "/" and it must specify a valid page. For example,
1018 @ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the
1019 @ leading "/".</p>
1020 @ <p>(Property: "index-page")
1021 @ <hr>
1022 @ <p>The main menu for the web interface
1023 @ <p>
1024 @
1025 @ <p>This setting should be a TCL list. Each set of four consecutive
1026 @ values defines a single main menu item:
1027 @ <ol>
1028 @ <li> The first term is text that appears on the menu.
1029 @ <li> The second term is a hyperlink to take when a user clicks on the
1030 @ entry. Hyperlinks that start with "/" are relative to the
1031 @ repository root.
1032 @ <li> The third term is an argument to the TH1 "capexpr" command.
1033 @ If capexpr evalutes to true, then the entry is shown. If not,
1034 @ the entry is omitted. "*" is always true. "{}" is never true.
1035 @ <li> The fouth term is a list of extra class names to apply to the new
1036 @ menu entry. Some skins will classes "desktoponly" and "wideonly"
1037 @ to only show the entries when the web browser screen is wide or
1038 @ very wide, respectively.
1039 @ </ol>
1040 @
1041 @ <p>Some custom skins might not use this property. Whether the property
1042 @ is used or a choice made by the skin designer. Some skins add an extra
1043 @ choices (such as the hamburger button) to the menu that are not shown
1044 @ on this list. (Property: mainmenu)
1045 @ <p>
1046 textarea_attribute("Main Menu", 12, 80,
1047 "mainmenu", "mmenu", style_default_mainmenu(), 0);
1048 @
1049 @ <hr>
1050 @ <p>Extra links to appear on the <a href="%R/sitemap">/sitemap</a> page,
1051 @ as sub-items of the "Home Page" entry, appearing before the
1052 @ "Documentation Search" entry (if any). In skins that use the /sitemap
1053 @ page to construct a hamburger menu dropdown, new entries added here
1054
+24
--- src/style.c
+++ src/style.c
@@ -595,10 +595,33 @@
595595
** Returns the default page header.
596596
*/
597597
const char *get_default_header(){
598598
return zDfltHeader;
599599
}
600
+
601
+/*
602
+** The default TCL list that defines the main menu.
603
+*/
604
+static const char zDfltMainMenu[] =
605
+@ Home /home * {}
606
+@ Timeline /timeline {o r j} {}
607
+@ Files /dir?ci=tip oh desktoponly
608
+@ Branches /brlist o wideonly
609
+@ Tags /taglist o wideonly
610
+@ Forum /forum {@2 3 4 5 6} wideonly
611
+@ Chat /chat C wideonly
612
+@ Tickets /ticket r wideonly
613
+@ Wiki /wiki j wideonly
614
+@ Setup /setup s {}
615
+;
616
+
617
+/*
618
+** Return the default menu
619
+*/
620
+const char *style_default_mainmenu(void){
621
+ return zDfltMainMenu;
622
+}
600623
601624
/*
602625
** Given a URL path, extract the first element as a "feature" name,
603626
** used as the <body class="FEATURE"> value by default, though
604627
** later-running code may override this, typically to group multiple
@@ -659,10 +682,11 @@
659682
Th_Store("csrf_token", g.zCsrfToken);
660683
Th_Store("release_version", RELEASE_VERSION);
661684
Th_Store("manifest_version", MANIFEST_VERSION);
662685
Th_Store("manifest_date", MANIFEST_DATE);
663686
Th_Store("compiler_name", COMPILER_NAME);
687
+ Th_Store("mainmenu", db_get("mainmenu", style_default_mainmenu()));
664688
url_var("stylesheet", "css", "style.css");
665689
image_url_var("logo");
666690
image_url_var("background");
667691
if( !login_is_nobody() ){
668692
Th_Store("login", g.zLogin);
669693
--- src/style.c
+++ src/style.c
@@ -595,10 +595,33 @@
595 ** Returns the default page header.
596 */
597 const char *get_default_header(){
598 return zDfltHeader;
599 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
600
601 /*
602 ** Given a URL path, extract the first element as a "feature" name,
603 ** used as the <body class="FEATURE"> value by default, though
604 ** later-running code may override this, typically to group multiple
@@ -659,10 +682,11 @@
659 Th_Store("csrf_token", g.zCsrfToken);
660 Th_Store("release_version", RELEASE_VERSION);
661 Th_Store("manifest_version", MANIFEST_VERSION);
662 Th_Store("manifest_date", MANIFEST_DATE);
663 Th_Store("compiler_name", COMPILER_NAME);
 
664 url_var("stylesheet", "css", "style.css");
665 image_url_var("logo");
666 image_url_var("background");
667 if( !login_is_nobody() ){
668 Th_Store("login", g.zLogin);
669
--- src/style.c
+++ src/style.c
@@ -595,10 +595,33 @@
595 ** Returns the default page header.
596 */
597 const char *get_default_header(){
598 return zDfltHeader;
599 }
600
601 /*
602 ** The default TCL list that defines the main menu.
603 */
604 static const char zDfltMainMenu[] =
605 @ Home /home * {}
606 @ Timeline /timeline {o r j} {}
607 @ Files /dir?ci=tip oh desktoponly
608 @ Branches /brlist o wideonly
609 @ Tags /taglist o wideonly
610 @ Forum /forum {@2 3 4 5 6} wideonly
611 @ Chat /chat C wideonly
612 @ Tickets /ticket r wideonly
613 @ Wiki /wiki j wideonly
614 @ Setup /setup s {}
615 ;
616
617 /*
618 ** Return the default menu
619 */
620 const char *style_default_mainmenu(void){
621 return zDfltMainMenu;
622 }
623
624 /*
625 ** Given a URL path, extract the first element as a "feature" name,
626 ** used as the <body class="FEATURE"> value by default, though
627 ** later-running code may override this, typically to group multiple
@@ -659,10 +682,11 @@
682 Th_Store("csrf_token", g.zCsrfToken);
683 Th_Store("release_version", RELEASE_VERSION);
684 Th_Store("manifest_version", MANIFEST_VERSION);
685 Th_Store("manifest_date", MANIFEST_DATE);
686 Th_Store("compiler_name", COMPILER_NAME);
687 Th_Store("mainmenu", db_get("mainmenu", style_default_mainmenu()));
688 url_var("stylesheet", "css", "style.css");
689 image_url_var("logo");
690 image_url_var("background");
691 if( !login_is_nobody() ){
692 Th_Store("login", g.zLogin);
693
--- src/th_lang.c
+++ src/th_lang.c
@@ -885,10 +885,34 @@
885885
return Th_SetResultInt(interp, argl[2]);
886886
}
887887
888888
/*
889889
** TH Syntax:
890
+**
891
+** string match PATTERN STRING
892
+**
893
+*/
894
+static int string_match_command(
895
+ Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
896
+){
897
+ extern char *fossil_strndup(const char*,int);
898
+ extern void fossil_free(void*);
899
+ char *zPat, *zStr;
900
+ int rc;
901
+ if( argc!=4 ){
902
+ return Th_WrongNumArgs(interp, "string match pattern string");
903
+ }
904
+ zPat = fossil_strndup(argv[2],argl[2]);
905
+ zStr = fossil_strndup(argv[3],argl[3]);
906
+ rc = sqlite3_strglob(zPat,zStr);
907
+ fossil_free(zPat);
908
+ fossil_free(zStr);
909
+ return Th_SetResultInt(interp, !rc);
910
+}
911
+
912
+/*
913
+** TH Syntax:
890914
**
891915
** string range STRING FIRST LAST
892916
*/
893917
static int string_range_command(
894918
Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
@@ -1155,10 +1179,11 @@
11551179
{ "first", string_first_command },
11561180
{ "index", string_index_command },
11571181
{ "is", string_is_command },
11581182
{ "last", string_last_command },
11591183
{ "length", string_length_command },
1184
+ { "match", string_match_command },
11601185
{ "range", string_range_command },
11611186
{ "repeat", string_repeat_command },
11621187
{ "trim", string_trim_command },
11631188
{ "trimleft", string_trim_command },
11641189
{ "trimright", string_trim_command },
11651190
--- src/th_lang.c
+++ src/th_lang.c
@@ -885,10 +885,34 @@
885 return Th_SetResultInt(interp, argl[2]);
886 }
887
888 /*
889 ** TH Syntax:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
890 **
891 ** string range STRING FIRST LAST
892 */
893 static int string_range_command(
894 Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
@@ -1155,10 +1179,11 @@
1155 { "first", string_first_command },
1156 { "index", string_index_command },
1157 { "is", string_is_command },
1158 { "last", string_last_command },
1159 { "length", string_length_command },
 
1160 { "range", string_range_command },
1161 { "repeat", string_repeat_command },
1162 { "trim", string_trim_command },
1163 { "trimleft", string_trim_command },
1164 { "trimright", string_trim_command },
1165
--- src/th_lang.c
+++ src/th_lang.c
@@ -885,10 +885,34 @@
885 return Th_SetResultInt(interp, argl[2]);
886 }
887
888 /*
889 ** TH Syntax:
890 **
891 ** string match PATTERN STRING
892 **
893 */
894 static int string_match_command(
895 Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
896 ){
897 extern char *fossil_strndup(const char*,int);
898 extern void fossil_free(void*);
899 char *zPat, *zStr;
900 int rc;
901 if( argc!=4 ){
902 return Th_WrongNumArgs(interp, "string match pattern string");
903 }
904 zPat = fossil_strndup(argv[2],argl[2]);
905 zStr = fossil_strndup(argv[3],argl[3]);
906 rc = sqlite3_strglob(zPat,zStr);
907 fossil_free(zPat);
908 fossil_free(zStr);
909 return Th_SetResultInt(interp, !rc);
910 }
911
912 /*
913 ** TH Syntax:
914 **
915 ** string range STRING FIRST LAST
916 */
917 static int string_range_command(
918 Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl
@@ -1155,10 +1179,11 @@
1179 { "first", string_first_command },
1180 { "index", string_index_command },
1181 { "is", string_is_command },
1182 { "last", string_last_command },
1183 { "length", string_length_command },
1184 { "match", string_match_command },
1185 { "range", string_range_command },
1186 { "repeat", string_repeat_command },
1187 { "trim", string_trim_command },
1188 { "trimleft", string_trim_command },
1189 { "trimright", string_trim_command },
1190

Keyboard Shortcuts

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