| ︙ | | | ︙ | |
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
static struct Submenu {
const char *zLabel; /* Button label */
const char *zLink; /* Jump to this link when button is pressed */
} aSubmenu[30];
static int nSubmenu = 0; /* Number of buttons */
static struct SubmenuCtrl {
const char *zName; /* Form query parameter */
const char *zLabel; /* Label. Might be NULL for FF_MULTI */
unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_CHECKBOX */
unsigned char eVisible; /* STYLE_NORMAL or STYLE_DISABLED */
short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
const char *const *azChoice; /* value/display pairs for FF_MULTI */
const char *zFalse; /* FF_BINARY label when false */
const char *zJS; /* Javascript to run on toggle */
} aSubmenuCtrl[20];
static int nSubmenuCtrl = 0;
#define FF_ENTRY 1 /* Text entry box */
#define FF_MULTI 2 /* Combobox. Multiple choices. */
#define FF_BINARY 3 /* Control for binary query parameter */
|
|
>
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
static struct Submenu {
const char *zLabel; /* Button label */
const char *zLink; /* Jump to this link when button is pressed */
} aSubmenu[30];
static int nSubmenu = 0; /* Number of buttons */
static struct SubmenuCtrl {
const char *zName; /* Form query parameter */
const char *zLabel; /* Label */
unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_CHECKBOX */
unsigned char eVisible; /* STYLE_NORMAL or STYLE_DISABLED */
short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
const char *const *azChoice; /* value/display pairs for FF_MULTI */
const char *zTrue; /* FF_BINARY label when true */
const char *zFalse; /* FF_BINARY label when false */
const char *zJS; /* Javascript to run on toggle */
} aSubmenuCtrl[20];
static int nSubmenuCtrl = 0;
#define FF_ENTRY 1 /* Text entry box */
#define FF_MULTI 2 /* Combobox. Multiple choices. */
#define FF_BINARY 3 /* Control for binary query parameter */
|
| ︙ | | | ︙ | |
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX;
nSubmenuCtrl++;
}
void style_submenu_binary(
const char *zName, /* Query parameter name */
const char *zTrue, /* Label to show when parameter is true */
const char *zFalse, /* Label to show when the parameter is false */
int eVisible /* Visible or disabled */
){
assert( nSubmenuCtrl < count(aSubmenuCtrl) );
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
aSubmenuCtrl[nSubmenuCtrl].zLabel = zTrue;
aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse;
aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY;
nSubmenuCtrl++;
}
void style_submenu_multichoice(
const char *zName, /* Query parameter name */
int nChoice, /* Number of options */
const char *const *azChoice, /* value/display pairs. 2*nChoice entries */
int eVisible /* Visible or disabled */
){
assert( nSubmenuCtrl < count(aSubmenuCtrl) );
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice;
aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice;
aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
nSubmenuCtrl++;
}
void style_submenu_sql(
|
>
|
>
>
>
|
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX;
nSubmenuCtrl++;
}
void style_submenu_binary(
const char *zName, /* Query parameter name */
const char *zLabel, /* Label of parameter */
const char *zTrue, /* Label to show when parameter is true */
const char *zFalse, /* Label to show when the parameter is false */
int eVisible /* Visible or disabled */
){
assert( nSubmenuCtrl < count(aSubmenuCtrl) );
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
aSubmenuCtrl[nSubmenuCtrl].zTrue = zTrue;
aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse;
aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY;
nSubmenuCtrl++;
}
void style_submenu_multichoice(
const char *zName, /* Query parameter name */
const char *zLabel, /* Label of parameter */
int nChoice, /* Number of options */
const char *const *azChoice, /* value/display pairs. 2*nChoice entries */
int eVisible /* Visible or disabled */
){
assert( nSubmenuCtrl < count(aSubmenuCtrl) );
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice;
aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice;
aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
nSubmenuCtrl++;
}
void style_submenu_sql(
|
| ︙ | | | ︙ | |
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
|
/*
** Default HTML page header text through <body>. If the repository-specific
** header template lacks a <body> tag, then all of the following is
** prepended.
*/
static const char zDfltHeader[] =
@ <html>
@ <head>
@ <meta charset="UTF-8">
@ <base href="$baseurl/$current_page" />
@ <meta http-equiv="Content-Security-Policy" content="$default_csp" />
@ <meta name="viewport" content="width=device-width, initial-scale=1.0">
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed" \
|
|
|
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
|
/*
** Default HTML page header text through <body>. If the repository-specific
** header template lacks a <body> tag, then all of the following is
** prepended.
*/
static const char zDfltHeader[] =
@ <html lang="en">
@ <head>
@ <meta charset="UTF-8">
@ <base href="$baseurl/$current_page" />
@ <meta http-equiv="Content-Security-Policy" content="$default_csp" />
@ <meta name="viewport" content="width=device-width, initial-scale=1.0">
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed" \
|
| ︙ | | | ︙ | |
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
|
int i;
char zClass[32]; /* reduced form of the main attribute */
if( nSubmenuCtrl ){
@ <form id='f01' method='GET' action='%R/%s(g.zPath)'>
@ <input type='hidden' name='udc' value='1'>
cgi_tag_query_parameter("udc");
}
@ <div class="submenu">
if( nSubmenu>0 ){
qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare);
for(i=0; i<nSubmenu; i++){
struct Submenu *p = &aSubmenu[i];
style_derive_classname(p->zLabel, zClass, sizeof zClass);
/* switching away from the %h formatting below might be dangerous
** because some places use %s to compose zLabel and zLink;
|
|
|
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
|
int i;
char zClass[32]; /* reduced form of the main attribute */
if( nSubmenuCtrl ){
@ <form id='f01' method='GET' action='%R/%s(g.zPath)'>
@ <input type='hidden' name='udc' value='1'>
cgi_tag_query_parameter("udc");
}
@ <nav id="submenu" class="submenu" title="Submenu">
if( nSubmenu>0 ){
qsort(aSubmenu, nSubmenu, sizeof(aSubmenu[0]), submenuCompare);
for(i=0; i<nSubmenu; i++){
struct Submenu *p = &aSubmenu[i];
style_derive_classname(p->zLabel, zClass, sizeof zClass);
/* switching away from the %h formatting below might be dangerous
** because some places use %s to compose zLabel and zLink;
|
| ︙ | | | ︙ | |
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
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
|
}else if( zQPN ){
cgi_tag_query_parameter(zQPN);
}
style_derive_classname(zQPN, zClass+4, sizeof(zClass)-4);
switch( aSubmenuCtrl[i].eType ){
case FF_ENTRY:
@ <span class='submenuctrl%s(zXtraClass) %s(zClass)'>\
@ %h(aSubmenuCtrl[i].zLabel)\
@ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
if( aSubmenuCtrl[i].iSize<0 ){
@ size='%d(-aSubmenuCtrl[i].iSize)' \
}else if( aSubmenuCtrl[i].iSize>0 ){
@ size='%d(aSubmenuCtrl[i].iSize)' \
@ maxlength='%d(aSubmenuCtrl[i].iSize)' \
}
@ id='submenuctrl-%d(i)'%s(zDisabled)></span>
break;
case FF_MULTI: {
int j;
const char *zVal = P(zQPN);
if( zXtraClass[0] ){
@ <span class='%s(zXtraClass+1) %s(zClass)'>
}
if( aSubmenuCtrl[i].zLabel ){
@ %h(aSubmenuCtrl[i].zLabel)\
}
@ <select class='submenuctrl %s(zClass)' size='1' name='%s(zQPN)' \
@ id='submenuctrl-%d(i)'%s(zDisabled)>
for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
const char *zQPV = aSubmenuCtrl[i].azChoice[j];
@ <option value='%h(zQPV)'\
if( fossil_strcmp(zVal, zQPV)==0 ){
@ selected\
}
@ >%h(aSubmenuCtrl[i].azChoice[j+1])</option>
}
@ </select>
if( zXtraClass[0] ){
@ </span>
}
break;
}
case FF_BINARY: {
int isTrue = PB(zQPN);
@ <select class='submenuctrl%s(zXtraClass)' size='1' \
@ name='%s(zQPN)' id='submenuctrl-%d(i)'%s(zDisabled)>
@ <option value='1'\
if( isTrue ){
@ selected\
}
@ >%h(aSubmenuCtrl[i].zLabel)</option>
@ <option value='0'\
if( !isTrue ){
@ selected\
}
@ >%h(aSubmenuCtrl[i].zFalse)</option>
@ </select>
break;
}
case FF_CHECKBOX: {
@ <label class='submenuctrl submenuckbox%s(zXtraClass) %s(zClass)'>\
@ <input type='checkbox' name='%s(zQPN)' id='submenuctrl-%d(i)' \
if( PB(zQPN) ){
@ checked \
}
if( aSubmenuCtrl[i].zJS ){
@ data-ctrl='%s(aSubmenuCtrl[i].zJS)'%s(zDisabled)>\
}else{
@ %s(zDisabled)>\
}
@ %h(aSubmenuCtrl[i].zLabel)</label>
break;
}
}
}
@ </div>
if( nSubmenuCtrl ){
cgi_query_parameters_to_hidden();
cgi_tag_query_parameter(0);
@ </form>
builtin_request_js("menu.js");
}
}
zAd = style_adunit_text(&mAdFlags);
if( (mAdFlags & ADUNIT_RIGHT_OK)!=0 ){
@ <div class="content adunit_right_container">
@ <div class="adunit_right">
cgi_append_content(zAd, -1);
@ </div>
}else if( zAd ){
@ <div class="adunit_banner">
cgi_append_content(zAd, -1);
@ </div>
}
@ <div class="content"><span id="debugMsg"></span>
cgi_destination(CGI_BODY);
if( sideboxUsed ){
@ <div class="endContent"></div>
}
@ </div>
/* Put the footer at the bottom of the page. */
zFooter = skin_get("footer");
if( sqlite3_strlike("%</body>%", zFooter, 0)==0 ){
style_load_all_js_files();
}
if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
|
|
|
<
|
<
>
>
|
>
|
|
|
|
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
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
|
}else if( zQPN ){
cgi_tag_query_parameter(zQPN);
}
style_derive_classname(zQPN, zClass+4, sizeof(zClass)-4);
switch( aSubmenuCtrl[i].eType ){
case FF_ENTRY:
@ <span class='submenuctrl%s(zXtraClass) %s(zClass)'>\
@ <label>%h(aSubmenuCtrl[i].zLabel): \
@ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
if( aSubmenuCtrl[i].iSize<0 ){
@ size='%d(-aSubmenuCtrl[i].iSize)' \
}else if( aSubmenuCtrl[i].iSize>0 ){
@ size='%d(aSubmenuCtrl[i].iSize)' \
@ maxlength='%d(aSubmenuCtrl[i].iSize)' \
}
@ id='submenuctrl-%d(i)'%s(zDisabled)></label></span>
break;
case FF_MULTI: {
int j;
const char *zVal = P(zQPN);
if( zXtraClass[0] ){
@ <span class='%s(zXtraClass+1) %s(zClass)'>
}
@ <label>%h(aSubmenuCtrl[i].zLabel): \
@ <select class='submenuctrl %s(zClass)' size='1' name='%s(zQPN)' \
@ id='submenuctrl-%d(i)'%s(zDisabled)>
for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
const char *zQPV = aSubmenuCtrl[i].azChoice[j];
@ <option value='%h(zQPV)'\
if( fossil_strcmp(zVal, zQPV)==0 ){
@ selected\
}
@ >%h(aSubmenuCtrl[i].azChoice[j+1])</option>
}
@ </select>
@ </label>
if( zXtraClass[0] ){
@ </span>
}
break;
}
case FF_BINARY: {
int isTrue = PB(zQPN);
@ <label for='submenuctrl-%d(i)'>%h(aSubmenuCtrl[i].zLabel):
@ <select class='submenuctrl%s(zXtraClass)' size='1' \
@ name='%s(zQPN)' id='submenuctrl-%d(i)'%s(zDisabled)>
@ <option value='1'\
if( isTrue ){
@ selected\
}
@ >%h(aSubmenuCtrl[i].zTrue)</option>
@ <option value='0'\
if( !isTrue ){
@ selected\
}
@ >%h(aSubmenuCtrl[i].zFalse)</option>
@ </select>
@ </label>
break;
}
case FF_CHECKBOX: {
@ <label class='submenuctrl submenuckbox%s(zXtraClass) %s(zClass)'>\
@ <input type='checkbox' name='%s(zQPN)' id='submenuctrl-%d(i)' \
if( PB(zQPN) ){
@ checked \
}
if( aSubmenuCtrl[i].zJS ){
@ data-ctrl='%s(aSubmenuCtrl[i].zJS)'%s(zDisabled)>\
}else{
@ %s(zDisabled)>\
}
@ %h(aSubmenuCtrl[i].zLabel)</label>
break;
}
}
}
@ </nav>
if( nSubmenuCtrl ){
cgi_query_parameters_to_hidden();
cgi_tag_query_parameter(0);
@ </form>
builtin_request_js("menu.js");
}
}
zAd = style_adunit_text(&mAdFlags);
if( (mAdFlags & ADUNIT_RIGHT_OK)!=0 ){
@ <div class="content adunit_right_container">
@ <div class="adunit_right">
cgi_append_content(zAd, -1);
@ </div>
}else if( zAd ){
@ <div class="adunit_banner">
cgi_append_content(zAd, -1);
@ </div>
}
@ <main class="content"><span id="debugMsg"></span>
cgi_destination(CGI_BODY);
if( sideboxUsed ){
@ <div class="endContent"></div>
}
@ </main>
/* Put the footer at the bottom of the page. */
zFooter = skin_get("footer");
if( sqlite3_strlike("%</body>%", zFooter, 0)==0 ){
style_load_all_js_files();
}
if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
|
| ︙ | | | ︙ | |
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
|
}
/*
** WEBPAGE: style.css loadavg-exempt
**
** Return the style sheet. The style sheet is assemblied from
** multiple sources, in order:
**
** (1) The built-in "default.css" style sheet containing basic defaults.
**
** (2) The page-specific style sheet taken from the built-in
** called "PAGENAME.css" where PAGENAME is the value of the name=
** or page= query parameters. If neither name= nor page= exist,
** then this section is a no-op.
**
** (3) The skin-specific "css.txt" file, if there one.
**
** All of (1), (2), and (3) above (or as many as exist) are concatenated.
** The result is then run through TH1 with the following variables set:
**
** * $basename
** * $secureurl
|
<
<
<
|
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
|
}
/*
** WEBPAGE: style.css loadavg-exempt
**
** Return the style sheet. The style sheet is assemblied from
** multiple sources, in order:
** (1) The built-in "default.css" style sheet containing basic defaults.
** (2) The page-specific style sheet taken from the built-in
** called "PAGENAME.css" where PAGENAME is the value of the name=
** or page= query parameters. If neither name= nor page= exist,
** then this section is a no-op.
** (3) The skin-specific "css.txt" file, if there one.
**
** All of (1), (2), and (3) above (or as many as exist) are concatenated.
** The result is then run through TH1 with the following variables set:
**
** * $basename
** * $secureurl
|
| ︙ | | | ︙ | |