| ︙ | | | ︙ | |
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/* @-comment: // */
/*
** A black-and-white theme with the project title in a bar across the top
** and no logo image.
*/
static const char zBuiltinSkin1[] =
@ REPLACE INTO config VALUES('css','/* General settings for the entire page */
@ body {
@ margin: 0ex 1ex;
@ padding: 0px;
@ background-color: white;
@ font-family: sans-serif;
@ }
@
|
>
|
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/* @-comment: // */
/*
** A black-and-white theme with the project title in a bar across the top
** and no logo image.
*/
static const char zBuiltinSkin1[] =
@ REPLACE INTO config(name,mtime,value)
@ VALUES('css',now(),'/* General settings for the entire page */
@ body {
@ margin: 0ex 1ex;
@ padding: 0px;
@ background-color: white;
@ font-family: sans-serif;
@ }
@
|
| ︙ | | | ︙ | |
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
@
@ /* The label/value pairs on (for example) the vinfo page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }');
@ REPLACE INTO config VALUES('header','<html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss">
@ <link rel="stylesheet" href="$home/style.css?blackwhite" type="text/css"
@ media="screen">
@ </head>
|
|
|
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
@
@ /* The label/value pairs on (for example) the vinfo page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }');
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss">
@ <link rel="stylesheet" href="$home/style.css?blackwhite" type="text/css"
@ media="screen">
@ </head>
|
| ︙ | | | ︙ | |
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
@ if {[info exists login]} {
@ html "<a href=''$home/login''>Logout</a> "
@ } else {
@ html "<a href=''$home/login''>Login</a> "
@ }
@ </th1></div>
@ ');
@ REPLACE INTO config VALUES('footer','<div class="footer">
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
@ ');
;
/*
** A tan theme with the project title above the user identification
** and no logo image.
*/
static const char zBuiltinSkin2[] =
@ REPLACE INTO config VALUES('css','/* General settings for the entire page */
@ body {
@ margin: 0ex 0ex;
@ padding: 0px;
@ background-color: #fef3bc;
@ font-family: sans-serif;
@ }
@
|
|
>
>
|
|
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
@ if {[info exists login]} {
@ html "<a href=''$home/login''>Logout</a> "
@ } else {
@ html "<a href=''$home/login''>Login</a> "
@ }
@ </th1></div>
@ ');
@ REPLACE INTO config(name,mtime,value)
@ VALUES('footer',now(),'<div class="footer">
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
@ ');
;
/*
** A tan theme with the project title above the user identification
** and no logo image.
*/
static const char zBuiltinSkin2[] =
@ REPLACE INTO config(name,mtime,value)
@ VALUES('css',now(),'/* General settings for the entire page */
@ body {
@ margin: 0ex 0ex;
@ padding: 0px;
@ background-color: #fef3bc;
@ font-family: sans-serif;
@ }
@
|
| ︙ | | | ︙ | |
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
|
@ /* The label/value pairs on (for example) the ci page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }
@ ');
@ REPLACE INTO config VALUES('header','<html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss">
@ <link rel="stylesheet" href="$home/style.css?tan" type="text/css"
@ media="screen">
@ </head>
|
|
|
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
|
@ /* The label/value pairs on (for example) the ci page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }
@ ');
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss">
@ <link rel="stylesheet" href="$home/style.css?tan" type="text/css"
@ media="screen">
@ </head>
|
| ︙ | | | ︙ | |
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
|
@ if {[info exists login]} {
@ html "<a href=''$home/login''>Logout</a> "
@ } else {
@ html "<a href=''$home/login''>Login</a> "
@ }
@ </th1></div>
@ ');
@ REPLACE INTO config VALUES('footer','<div class="footer">
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
@ ');
;
/*
** Black letters on a white or cream background with the main menu
** stuck on the left-hand side.
*/
static const char zBuiltinSkin3[] =
@ REPLACE INTO config VALUES('css','/* General settings for the entire page */
@ body {
@ margin:0px 0px 0px 0px;
@ padding:0px;
@ font-family:verdana, arial, helvetica, "sans serif";
@ color:#333;
@ background-color:white;
@ }
|
|
>
>
|
|
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
|
@ if {[info exists login]} {
@ html "<a href=''$home/login''>Logout</a> "
@ } else {
@ html "<a href=''$home/login''>Login</a> "
@ }
@ </th1></div>
@ ');
@ REPLACE INTO config(name,mtime,value)
@ VALUES('footer',now(),'<div class="footer">
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
@ ');
;
/*
** Black letters on a white or cream background with the main menu
** stuck on the left-hand side.
*/
static const char zBuiltinSkin3[] =
@ REPLACE INTO config(name,mtime,value)
@ VALUES('css',now(),'/* General settings for the entire page */
@ body {
@ margin:0px 0px 0px 0px;
@ padding:0px;
@ font-family:verdana, arial, helvetica, "sans serif";
@ color:#333;
@ background-color:white;
@ }
|
| ︙ | | | ︙ | |
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
|
@
@ /* The label/value pairs on (for example) the ci page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }');
@ REPLACE INTO config VALUES('header','<html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss">
@ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
@ media="screen">
@ </head>
|
|
|
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
|
@
@ /* The label/value pairs on (for example) the ci page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }');
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss">
@ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
@ media="screen">
@ </head>
|
| ︙ | | | ︙ | |
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
|
@ html "<li><a href=''$home/login''>Logout</a></li>"
@ } else {
@ html "<li><a href=''$home/login''>Login</a></li>"
@ }
@ </th1></ul></div>
@ <div id="container">
@ ');
@ REPLACE INTO config VALUES('footer','</div>
@ <div class="footer">
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
@ ');
;
/*
** Gradients and rounded corners.
*/
static const char zBuiltinSkin4[] =
@ REPLACE INTO config VALUES('css','/* General settings for the entire page */
@ html {
@ min-height: 100%;
@ }
@ body {
@ margin: 0ex 1ex;
@ padding: 0px;
@ background-color: white;
|
|
>
|
|
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
|
@ html "<li><a href=''$home/login''>Logout</a></li>"
@ } else {
@ html "<li><a href=''$home/login''>Login</a></li>"
@ }
@ </th1></ul></div>
@ <div id="container">
@ ');
@ REPLACE INTO config(name,mtime,value) VALUES('footer',now(),'</div>
@ <div class="footer">
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
@ ');
;
/*
** Gradients and rounded corners.
*/
static const char zBuiltinSkin4[] =
@ REPLACE INTO config(name,mtime,value)
@ VALUES('css',now(),'/* General settings for the entire page */
@ html {
@ min-height: 100%;
@ }
@ body {
@ margin: 0ex 1ex;
@ padding: 0px;
@ background-color: white;
|
| ︙ | | | ︙ | |
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
|
@ table.report tr td {
@ padding: 3px 5px;
@ }
@
@ textarea {
@ font-size: 1em;
@ }');
@ REPLACE INTO config VALUES('header','<html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss">
@ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
@ media="screen">
@ </head>
|
|
|
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
|
@ table.report tr td {
@ padding: 3px 5px;
@ }
@
@ textarea {
@ font-size: 1em;
@ }');
@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html>
@ <head>
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss">
@ <link rel="stylesheet" href="$home/style.css?black2" type="text/css"
@ media="screen">
@ </head>
|
| ︙ | | | ︙ | |
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
|
@ html "<a href=''$home/login''>Logout</a>"
@ } else {
@ html "<a href=''$home/login''>Login</a>"
@ }
@ </th1></ul></div>
@ <div id="container">
@ ');
@ REPLACE INTO config VALUES('footer','</div>
@ <div class="footer">
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
@ ');
;
|
|
|
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
|
@ html "<a href=''$home/login''>Logout</a>"
@ } else {
@ html "<a href=''$home/login''>Login</a>"
@ }
@ </th1></ul></div>
@ <div id="container">
@ ');
@ REPLACE INTO config(name,mtime,value) VALUES('footer',now(),'</div>
@ <div class="footer">
@ Fossil version $manifest_version $manifest_date
@ </div>
@ </body></html>
@ ');
;
|
| ︙ | | | ︙ | |
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
|
** useDefault==0 or a string for the default skin if useDefault==1.
**
** Memory to hold the returned string is obtained from malloc.
*/
static char *getSkin(int useDefault){
Blob val;
blob_zero(&val);
blob_appendf(&val, "REPLACE INTO config VALUES('css',%Q);\n",
useDefault ? zDefaultCSS : db_get("css", (char*)zDefaultCSS)
);
blob_appendf(&val, "REPLACE INTO config VALUES('header',%Q);\n",
useDefault ? zDefaultHeader : db_get("header", (char*)zDefaultHeader)
);
blob_appendf(&val, "REPLACE INTO config VALUES('footer',%Q);\n",
useDefault ? zDefaultFooter : db_get("footer", (char*)zDefaultFooter)
);
return blob_str(&val);
}
/*
** Construct the default skin string and fill in the corresponding
|
|
>
|
>
|
>
|
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
|
** useDefault==0 or a string for the default skin if useDefault==1.
**
** Memory to hold the returned string is obtained from malloc.
*/
static char *getSkin(int useDefault){
Blob val;
blob_zero(&val);
blob_appendf(&val,
"REPLACE INTO config(name,value,mtime) VALUES('css',%Q,now());\n",
useDefault ? zDefaultCSS : db_get("css", (char*)zDefaultCSS)
);
blob_appendf(&val,
"REPLACE INTO config(name,value,mtime) VALUES('header',%Q,now());\n",
useDefault ? zDefaultHeader : db_get("header", (char*)zDefaultHeader)
);
blob_appendf(&val,
"REPLACE INTO config(name,value,mtime) VALUES('footer',%Q,now());\n",
useDefault ? zDefaultFooter : db_get("footer", (char*)zDefaultFooter)
);
return blob_str(&val);
}
/*
** Construct the default skin string and fill in the corresponding
|
| ︙ | | | ︙ | |
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
|
if( P("save")!=0 && (zName = skinVarName(P("save"),0))!=0 ){
if( db_exists("SELECT 1 FROM config WHERE name=%Q", zName)
|| strcmp(zName, "Default")==0 ){
zErr = mprintf("Skin name \"%h\" already exists. "
"Choose a different name.", P("sn"));
}else{
db_multi_exec("INSERT INTO config VALUES(%Q,%Q)",
zName, zCurrent
);
}
}
/* The user pressed the "Use This Skin" button. */
if( P("load") && (z = P("sn"))!=0 && z[0] ){
int seen = 0;
for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
seen = 1;
break;
}
}
if( !seen ){
seen = db_exists("SELECT 1 FROM config WHERE name GLOB 'skin:*'"
" AND value=%Q", zCurrent);
}
if( !seen ){
db_multi_exec(
"INSERT INTO config VALUES("
" strftime('skin:Backup On %%Y-%%m-%%d %%H:%%M:%%S'),"
" %Q)", zCurrent
);
}
seen = 0;
for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
if( strcmp(aBuiltinSkin[i].zName, z)==0 ){
seen = 1;
zCurrent = aBuiltinSkin[i].zValue;
|
|
|
|
|
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
|
if( P("save")!=0 && (zName = skinVarName(P("save"),0))!=0 ){
if( db_exists("SELECT 1 FROM config WHERE name=%Q", zName)
|| strcmp(zName, "Default")==0 ){
zErr = mprintf("Skin name \"%h\" already exists. "
"Choose a different name.", P("sn"));
}else{
db_multi_exec("INSERT INTO config(name,value,mtime) VALUES(%Q,%Q,now())",
zName, zCurrent
);
}
}
/* The user pressed the "Use This Skin" button. */
if( P("load") && (z = P("sn"))!=0 && z[0] ){
int seen = 0;
for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
seen = 1;
break;
}
}
if( !seen ){
seen = db_exists("SELECT 1 FROM config WHERE name GLOB 'skin:*'"
" AND value=%Q", zCurrent);
}
if( !seen ){
db_multi_exec(
"INSERT INTO config(name,value,mtime) VALUES("
" strftime('skin:Backup On %%Y-%%m-%%d %%H:%%M:%%S'),"
" %Q,now())", zCurrent
);
}
seen = 0;
for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
if( strcmp(aBuiltinSkin[i].zName, z)==0 ){
seen = 1;
zCurrent = aBuiltinSkin[i].zValue;
|
| ︙ | | | ︙ | |