Fossil SCM

Get the hamburger menu working for the "plain_gray" skin.

drh 2021-01-25 16:52 trunk
Commit fa8be1ace63433de66d7bb01087b0f9692921b671a3ca8b247c832074a8a6e6b
--- skins/plain_gray/css.txt
+++ skins/plain_gray/css.txt
@@ -7,23 +7,10 @@
77
-moz-text-size-adjust: none;
88
-webkit-text-size-adjust: none;
99
-mx-text-size-adjust: none;
1010
}
1111
12
-/* The project logo in the upper left-hand corner of each page */
13
-div.logo {
14
- display: table-row;
15
- text-align: center;
16
- /* vertical-align: bottom;*/
17
- font-size: 2em;
18
- font-weight: bold;
19
- background-color: #707070;
20
- color: #ffffff;
21
- min-width: 200px;
22
- white-space: nowrap;
23
-}
24
-
2512
/* The page title centered at the top of each page */
2613
div.title {
2714
display: table-cell;
2815
font-size: 1.5em;
2916
font-weight: bold;
@@ -38,13 +25,11 @@
3825
div.status {
3926
display: table-cell;
4027
text-align: right;
4128
vertical-align: bottom;
4229
color: #404040;
43
- font-size: 0.8em;
4430
font-weight: bold;
45
- min-width: 200px;
4631
white-space: nowrap;
4732
}
4833
4934
/* The header across the top of the page */
5035
div.header {
@@ -60,28 +45,48 @@
6045
font-weight: bold;
6146
text-align: center;
6247
letter-spacing: 1px;
6348
background-color: #404040;
6449
color: white;
50
+ z-index: 21; /* just above hbdrop */
51
+}
52
+.hbdrop {
53
+ background-color: white;
54
+ border: 1px solid black;
55
+ border-radius: 0.5em;
56
+ display: none;
57
+ width: 95%;
58
+ position: absolute;
59
+ z-index: 20; /* just below mainmenu, but above timeline bubbles */
6560
}
61
+div.hbdrop a { color: #604000; }
62
+div.hbdrop a:link { color: #604000;}
63
+div.hbdrop a:visited { color: #600000; }
64
+
6665
6766
/* The submenu bar that *sometimes* appears below the main menu */
6867
div.submenu, div.sectionmenu {
6968
padding: 3px 10px 3px 0px;
7069
font-size: 0.9em;
7170
text-align: center;
7271
background-color: #606060;
7372
color: white;
7473
}
75
-div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited,
76
-div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited,
74
+div.mainmenu a,
75
+div.mainmenu a:visited,
76
+div.submenu a,
77
+div.submenu a:visited,
78
+div.sectionmenu>a.button:link,
79
+div.sectionmenu>a.button:visited,
7780
div.submenu label {
7881
padding: 3px 10px 3px 10px;
7982
color: white;
8083
text-decoration: none;
8184
}
82
-div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover,
85
+div.mainmenu a:hover,
86
+div.submenu a:hover,
87
+div.sectionmenu>a.button:hover,
8388
div.submenu label:hover {
8489
color: #404040;
8590
background-color: white;
8691
}
8792
8893
--- skins/plain_gray/css.txt
+++ skins/plain_gray/css.txt
@@ -7,23 +7,10 @@
7 -moz-text-size-adjust: none;
8 -webkit-text-size-adjust: none;
9 -mx-text-size-adjust: none;
10 }
11
12 /* The project logo in the upper left-hand corner of each page */
13 div.logo {
14 display: table-row;
15 text-align: center;
16 /* vertical-align: bottom;*/
17 font-size: 2em;
18 font-weight: bold;
19 background-color: #707070;
20 color: #ffffff;
21 min-width: 200px;
22 white-space: nowrap;
23 }
24
25 /* The page title centered at the top of each page */
26 div.title {
27 display: table-cell;
28 font-size: 1.5em;
29 font-weight: bold;
@@ -38,13 +25,11 @@
38 div.status {
39 display: table-cell;
40 text-align: right;
41 vertical-align: bottom;
42 color: #404040;
43 font-size: 0.8em;
44 font-weight: bold;
45 min-width: 200px;
46 white-space: nowrap;
47 }
48
49 /* The header across the top of the page */
50 div.header {
@@ -60,28 +45,48 @@
60 font-weight: bold;
61 text-align: center;
62 letter-spacing: 1px;
63 background-color: #404040;
64 color: white;
 
 
 
 
 
 
 
 
 
 
65 }
 
 
 
 
66
67 /* The submenu bar that *sometimes* appears below the main menu */
68 div.submenu, div.sectionmenu {
69 padding: 3px 10px 3px 0px;
70 font-size: 0.9em;
71 text-align: center;
72 background-color: #606060;
73 color: white;
74 }
75 div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited,
76 div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited,
 
 
 
 
77 div.submenu label {
78 padding: 3px 10px 3px 10px;
79 color: white;
80 text-decoration: none;
81 }
82 div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover,
 
 
83 div.submenu label:hover {
84 color: #404040;
85 background-color: white;
86 }
87
88
--- skins/plain_gray/css.txt
+++ skins/plain_gray/css.txt
@@ -7,23 +7,10 @@
7 -moz-text-size-adjust: none;
8 -webkit-text-size-adjust: none;
9 -mx-text-size-adjust: none;
10 }
11
 
 
 
 
 
 
 
 
 
 
 
 
 
12 /* The page title centered at the top of each page */
13 div.title {
14 display: table-cell;
15 font-size: 1.5em;
16 font-weight: bold;
@@ -38,13 +25,11 @@
25 div.status {
26 display: table-cell;
27 text-align: right;
28 vertical-align: bottom;
29 color: #404040;
 
30 font-weight: bold;
 
31 white-space: nowrap;
32 }
33
34 /* The header across the top of the page */
35 div.header {
@@ -60,28 +45,48 @@
45 font-weight: bold;
46 text-align: center;
47 letter-spacing: 1px;
48 background-color: #404040;
49 color: white;
50 z-index: 21; /* just above hbdrop */
51 }
52 .hbdrop {
53 background-color: white;
54 border: 1px solid black;
55 border-radius: 0.5em;
56 display: none;
57 width: 95%;
58 position: absolute;
59 z-index: 20; /* just below mainmenu, but above timeline bubbles */
60 }
61 div.hbdrop a { color: #604000; }
62 div.hbdrop a:link { color: #604000;}
63 div.hbdrop a:visited { color: #600000; }
64
65
66 /* The submenu bar that *sometimes* appears below the main menu */
67 div.submenu, div.sectionmenu {
68 padding: 3px 10px 3px 0px;
69 font-size: 0.9em;
70 text-align: center;
71 background-color: #606060;
72 color: white;
73 }
74 div.mainmenu a,
75 div.mainmenu a:visited,
76 div.submenu a,
77 div.submenu a:visited,
78 div.sectionmenu>a.button:link,
79 div.sectionmenu>a.button:visited,
80 div.submenu label {
81 padding: 3px 10px 3px 10px;
82 color: white;
83 text-decoration: none;
84 }
85 div.mainmenu a:hover,
86 div.submenu a:hover,
87 div.sectionmenu>a.button:hover,
88 div.submenu label:hover {
89 color: #404040;
90 background-color: white;
91 }
92
93
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -1,43 +1,39 @@
11
<div class="header">
2
- <div class="title"><small>$<project_name></small><br />$<title></div>
3
- <div class="status"><th1>
4
- if {[info exists login]} {
5
- puts "Logged in as $login"
6
- } else {
7
- puts "Not logged in"
8
- }
9
- </th1></div>
2
+ <div class="title">$<project_name>: $<title></div>
103
</div>
114
<div class="mainmenu">
125
<th1>
6
+html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
137
html "<a href='$home$index_page'>Home</a>\n"
148
if {[anycap jor]} {
159
html "<a href='$home/timeline'>Timeline</a>\n"
1610
}
1711
if {[anoncap oh]} {
1812
html "<a href='$home/tree?ci=tip'>Files</a>\n"
1913
}
20
-if {[anoncap o]} {
21
- html "<a href='$home/brlist'>Branches</a>\n"
22
- html "<a href='$home/taglist'>Tags</a>\n"
23
-}
24
-if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
25
- html "<a href='$home/forum'>Forum</a>\n"
26
-}
27
-if {[anoncap r]} {
28
- html "<a href='$home/ticket'>Tickets</a>\n"
29
-}
30
-if {[anoncap j]} {
31
- html "<a href='$home/wiki'>Wiki</a>\n"
32
-}
14
+#if {[anoncap o]} {
15
+# html "<a href='$home/brlist'>Branches</a>\n"
16
+# html "<a href='$home/taglist'>Tags</a>\n"
17
+#}
18
+#if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
19
+# html "<a href='$home/forum'>Forum</a>\n"
20
+#}
21
+#if {[anoncap r]} {
22
+# html "<a href='$home/ticket'>Tickets</a>\n"
23
+#}
24
+#if {[anoncap j]} {
25
+# html "<a href='$home/wiki'>Wiki</a>\n"
26
+#}
3327
if {[hascap s]} {
3428
html "<a href='$home/setup'>Admin</a>\n"
35
-} elseif {[hascap a]} {
36
- html "<a href='$home/setup_ulist'>Users</a>\n"
3729
}
3830
if {[info exists login]} {
3931
html "<a href='$home/login'>Logout</a>\n"
4032
} else {
4133
html "<a href='$home/login'>Login</a>\n"
4234
}
4335
</th1></div>
36
+<div id='hbdrop' class='hbdrop'></div>
37
+<script nonce="$nonce">
38
+<th1>styleScript skins/default/js.txt</th1>
39
+</script>
4440
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -1,43 +1,39 @@
1 <div class="header">
2 <div class="title"><small>$<project_name></small><br />$<title></div>
3 <div class="status"><th1>
4 if {[info exists login]} {
5 puts "Logged in as $login"
6 } else {
7 puts "Not logged in"
8 }
9 </th1></div>
10 </div>
11 <div class="mainmenu">
12 <th1>
 
13 html "<a href='$home$index_page'>Home</a>\n"
14 if {[anycap jor]} {
15 html "<a href='$home/timeline'>Timeline</a>\n"
16 }
17 if {[anoncap oh]} {
18 html "<a href='$home/tree?ci=tip'>Files</a>\n"
19 }
20 if {[anoncap o]} {
21 html "<a href='$home/brlist'>Branches</a>\n"
22 html "<a href='$home/taglist'>Tags</a>\n"
23 }
24 if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
25 html "<a href='$home/forum'>Forum</a>\n"
26 }
27 if {[anoncap r]} {
28 html "<a href='$home/ticket'>Tickets</a>\n"
29 }
30 if {[anoncap j]} {
31 html "<a href='$home/wiki'>Wiki</a>\n"
32 }
33 if {[hascap s]} {
34 html "<a href='$home/setup'>Admin</a>\n"
35 } elseif {[hascap a]} {
36 html "<a href='$home/setup_ulist'>Users</a>\n"
37 }
38 if {[info exists login]} {
39 html "<a href='$home/login'>Logout</a>\n"
40 } else {
41 html "<a href='$home/login'>Login</a>\n"
42 }
43 </th1></div>
 
 
 
 
44
--- skins/plain_gray/header.txt
+++ skins/plain_gray/header.txt
@@ -1,43 +1,39 @@
1 <div class="header">
2 <div class="title">$<project_name>: $<title></div>
 
 
 
 
 
 
 
3 </div>
4 <div class="mainmenu">
5 <th1>
6 html "<a id='hbbtn' href='$home/sitemap' aria-label='Site Map'>&#9776;</a>"
7 html "<a href='$home$index_page'>Home</a>\n"
8 if {[anycap jor]} {
9 html "<a href='$home/timeline'>Timeline</a>\n"
10 }
11 if {[anoncap oh]} {
12 html "<a href='$home/tree?ci=tip'>Files</a>\n"
13 }
14 #if {[anoncap o]} {
15 # html "<a href='$home/brlist'>Branches</a>\n"
16 # html "<a href='$home/taglist'>Tags</a>\n"
17 #}
18 #if {[anycap 23456] || [anoncap 2] || [anoncap 3]} {
19 # html "<a href='$home/forum'>Forum</a>\n"
20 #}
21 #if {[anoncap r]} {
22 # html "<a href='$home/ticket'>Tickets</a>\n"
23 #}
24 #if {[anoncap j]} {
25 # html "<a href='$home/wiki'>Wiki</a>\n"
26 #}
27 if {[hascap s]} {
28 html "<a href='$home/setup'>Admin</a>\n"
 
 
29 }
30 if {[info exists login]} {
31 html "<a href='$home/login'>Logout</a>\n"
32 } else {
33 html "<a href='$home/login'>Login</a>\n"
34 }
35 </th1></div>
36 <div id='hbdrop' class='hbdrop'></div>
37 <script nonce="$nonce">
38 <th1>styleScript skins/default/js.txt</th1>
39 </script>
40
+11 -5
--- src/th_main.c
+++ src/th_main.c
@@ -1488,26 +1488,32 @@
14881488
return TH_ERROR;
14891489
}
14901490
}
14911491
14921492
/*
1493
-** TH1 command: styleScript
1493
+** TH1 command: styleScript ?BUILTIN-FILENAME?
14941494
**
1495
-** Render the configured JavaScript for the selected skin.
1495
+** Render the js.txt file from the current skin. Or, if an argument
1496
+** is supplied, render the built-in filename given.
14961497
*/
14971498
static int styleScriptCmd(
14981499
Th_Interp *interp,
14991500
void *p,
15001501
int argc,
15011502
const char **argv,
15021503
int *argl
15031504
){
1504
- if( argc!=1 ){
1505
- return Th_WrongNumArgs(interp, "styleScript");
1505
+ if( argc!=1 && argc!=2 ){
1506
+ return Th_WrongNumArgs(interp, "styleScript ?BUILTIN_NAME?");
15061507
}
15071508
if( Th_IsRepositoryOpen() ){
1508
- const char *zScript = skin_get("js");
1509
+ const char *zScript;
1510
+ if( argc==2 ){
1511
+ zScript = (const char*)builtin_file(argv[1], 0);
1512
+ }else{
1513
+ zScript = skin_get("js");
1514
+ }
15091515
if( zScript==0 ) zScript = "";
15101516
Th_Render(zScript);
15111517
Th_SetResult(interp, 0, 0);
15121518
return TH_OK;
15131519
}else{
15141520
--- src/th_main.c
+++ src/th_main.c
@@ -1488,26 +1488,32 @@
1488 return TH_ERROR;
1489 }
1490 }
1491
1492 /*
1493 ** TH1 command: styleScript
1494 **
1495 ** Render the configured JavaScript for the selected skin.
 
1496 */
1497 static int styleScriptCmd(
1498 Th_Interp *interp,
1499 void *p,
1500 int argc,
1501 const char **argv,
1502 int *argl
1503 ){
1504 if( argc!=1 ){
1505 return Th_WrongNumArgs(interp, "styleScript");
1506 }
1507 if( Th_IsRepositoryOpen() ){
1508 const char *zScript = skin_get("js");
 
 
 
 
 
1509 if( zScript==0 ) zScript = "";
1510 Th_Render(zScript);
1511 Th_SetResult(interp, 0, 0);
1512 return TH_OK;
1513 }else{
1514
--- src/th_main.c
+++ src/th_main.c
@@ -1488,26 +1488,32 @@
1488 return TH_ERROR;
1489 }
1490 }
1491
1492 /*
1493 ** TH1 command: styleScript ?BUILTIN-FILENAME?
1494 **
1495 ** Render the js.txt file from the current skin. Or, if an argument
1496 ** is supplied, render the built-in filename given.
1497 */
1498 static int styleScriptCmd(
1499 Th_Interp *interp,
1500 void *p,
1501 int argc,
1502 const char **argv,
1503 int *argl
1504 ){
1505 if( argc!=1 && argc!=2 ){
1506 return Th_WrongNumArgs(interp, "styleScript ?BUILTIN_NAME?");
1507 }
1508 if( Th_IsRepositoryOpen() ){
1509 const char *zScript;
1510 if( argc==2 ){
1511 zScript = (const char*)builtin_file(argv[1], 0);
1512 }else{
1513 zScript = skin_get("js");
1514 }
1515 if( zScript==0 ) zScript = "";
1516 Th_Render(zScript);
1517 Th_SetResult(interp, 0, 0);
1518 return TH_OK;
1519 }else{
1520

Keyboard Shortcuts

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