Fossil SCM

Simplify new setting names and some internal names.

mistachkin 2020-07-16 13:48 customFavicon
Commit e6a3112f76f0e26b2287c5299b8d767897623fd3ec05addc552ed744273cc85b
+2 -2
--- src/configure.c
+++ src/configure.c
@@ -94,12 +94,12 @@
9494
{ "js", CONFIGSET_SKIN },
9595
{ "logo-mimetype", CONFIGSET_SKIN },
9696
{ "logo-image", CONFIGSET_SKIN },
9797
{ "background-mimetype", CONFIGSET_SKIN },
9898
{ "background-image", CONFIGSET_SKIN },
99
- { "favicon-mimetype", CONFIGSET_SKIN },
100
- { "favicon-image", CONFIGSET_SKIN },
99
+ { "icon-mimetype", CONFIGSET_SKIN },
100
+ { "icon-image", CONFIGSET_SKIN },
101101
{ "timeline-block-markup", CONFIGSET_SKIN },
102102
{ "timeline-date-format", CONFIGSET_SKIN },
103103
{ "timeline-default-style", CONFIGSET_SKIN },
104104
{ "timeline-dwelltime", CONFIGSET_SKIN },
105105
{ "timeline-closetime", CONFIGSET_SKIN },
106106
--- src/configure.c
+++ src/configure.c
@@ -94,12 +94,12 @@
94 { "js", CONFIGSET_SKIN },
95 { "logo-mimetype", CONFIGSET_SKIN },
96 { "logo-image", CONFIGSET_SKIN },
97 { "background-mimetype", CONFIGSET_SKIN },
98 { "background-image", CONFIGSET_SKIN },
99 { "favicon-mimetype", CONFIGSET_SKIN },
100 { "favicon-image", CONFIGSET_SKIN },
101 { "timeline-block-markup", CONFIGSET_SKIN },
102 { "timeline-date-format", CONFIGSET_SKIN },
103 { "timeline-default-style", CONFIGSET_SKIN },
104 { "timeline-dwelltime", CONFIGSET_SKIN },
105 { "timeline-closetime", CONFIGSET_SKIN },
106
--- src/configure.c
+++ src/configure.c
@@ -94,12 +94,12 @@
94 { "js", CONFIGSET_SKIN },
95 { "logo-mimetype", CONFIGSET_SKIN },
96 { "logo-image", CONFIGSET_SKIN },
97 { "background-mimetype", CONFIGSET_SKIN },
98 { "background-image", CONFIGSET_SKIN },
99 { "icon-mimetype", CONFIGSET_SKIN },
100 { "icon-image", CONFIGSET_SKIN },
101 { "timeline-block-markup", CONFIGSET_SKIN },
102 { "timeline-date-format", CONFIGSET_SKIN },
103 { "timeline-default-style", CONFIGSET_SKIN },
104 { "timeline-dwelltime", CONFIGSET_SKIN },
105 { "timeline-closetime", CONFIGSET_SKIN },
106
+12 -12
--- src/doc.c
+++ src/doc.c
@@ -1132,34 +1132,34 @@
11321132
11331133
11341134
/*
11351135
** WEBPAGE: favicon.ico
11361136
**
1137
-** Return the configured favicon.ico image. If no favicon.ico image is
1138
-** defined, the returned image is for the Fossil lizard icon.
1137
+** Return the configured "favicon.ico" image. If no "favicon.ico" image
1138
+** is defined, the returned image is for the Fossil lizard icon.
11391139
**
1140
-** The intended use case here is to supply a favicon for the "fossil ui"
1140
+** The intended use case here is to supply an icon for the "fossil ui"
11411141
** command. For a permanent website, the recommended process is for
1142
-** the admin to set up a project-specific favicon and reference that
1143
-** icon in the HTML header using a line like:
1142
+** the admin to set up a project-specific icon and reference that icon
1143
+** in the HTML header using a line like:
11441144
**
11451145
** <link rel="icon" href="URL-FOR-YOUR-ICON" type="MIMETYPE"/>
11461146
**
11471147
*/
11481148
void favicon_page(void){
1149
- Blob favicon;
1149
+ Blob icon;
11501150
char *zMime;
11511151
11521152
etag_check(ETAG_CONFIG, 0);
1153
- zMime = db_get("favicon-mimetype", "image/gif");
1154
- blob_zero(&favicon);
1155
- db_blob(&favicon, "SELECT value FROM config WHERE name='favicon-image'");
1156
- if( blob_size(&favicon)==0 ){
1157
- blob_init(&favicon, (char*)aLogo, sizeof(aLogo));
1153
+ zMime = db_get("icon-mimetype", "image/gif");
1154
+ blob_zero(&icon);
1155
+ db_blob(&icon, "SELECT value FROM config WHERE name='icon-image'");
1156
+ if( blob_size(&icon)==0 ){
1157
+ blob_init(&icon, (char*)aLogo, sizeof(aLogo));
11581158
}
11591159
cgi_set_content_type(zMime);
1160
- cgi_set_content(&favicon);
1160
+ cgi_set_content(&icon);
11611161
}
11621162
11631163
/*
11641164
** WEBPAGE: docsrch
11651165
**
11661166
--- src/doc.c
+++ src/doc.c
@@ -1132,34 +1132,34 @@
1132
1133
1134 /*
1135 ** WEBPAGE: favicon.ico
1136 **
1137 ** Return the configured favicon.ico image. If no favicon.ico image is
1138 ** defined, the returned image is for the Fossil lizard icon.
1139 **
1140 ** The intended use case here is to supply a favicon for the "fossil ui"
1141 ** command. For a permanent website, the recommended process is for
1142 ** the admin to set up a project-specific favicon and reference that
1143 ** icon in the HTML header using a line like:
1144 **
1145 ** <link rel="icon" href="URL-FOR-YOUR-ICON" type="MIMETYPE"/>
1146 **
1147 */
1148 void favicon_page(void){
1149 Blob favicon;
1150 char *zMime;
1151
1152 etag_check(ETAG_CONFIG, 0);
1153 zMime = db_get("favicon-mimetype", "image/gif");
1154 blob_zero(&favicon);
1155 db_blob(&favicon, "SELECT value FROM config WHERE name='favicon-image'");
1156 if( blob_size(&favicon)==0 ){
1157 blob_init(&favicon, (char*)aLogo, sizeof(aLogo));
1158 }
1159 cgi_set_content_type(zMime);
1160 cgi_set_content(&favicon);
1161 }
1162
1163 /*
1164 ** WEBPAGE: docsrch
1165 **
1166
--- src/doc.c
+++ src/doc.c
@@ -1132,34 +1132,34 @@
1132
1133
1134 /*
1135 ** WEBPAGE: favicon.ico
1136 **
1137 ** Return the configured "favicon.ico" image. If no "favicon.ico" image
1138 ** is defined, the returned image is for the Fossil lizard icon.
1139 **
1140 ** The intended use case here is to supply an icon for the "fossil ui"
1141 ** command. For a permanent website, the recommended process is for
1142 ** the admin to set up a project-specific icon and reference that icon
1143 ** in the HTML header using a line like:
1144 **
1145 ** <link rel="icon" href="URL-FOR-YOUR-ICON" type="MIMETYPE"/>
1146 **
1147 */
1148 void favicon_page(void){
1149 Blob icon;
1150 char *zMime;
1151
1152 etag_check(ETAG_CONFIG, 0);
1153 zMime = db_get("icon-mimetype", "image/gif");
1154 blob_zero(&icon);
1155 db_blob(&icon, "SELECT value FROM config WHERE name='icon-image'");
1156 if( blob_size(&icon)==0 ){
1157 blob_init(&icon, (char*)aLogo, sizeof(aLogo));
1158 }
1159 cgi_set_content_type(zMime);
1160 cgi_set_content(&icon);
1161 }
1162
1163 /*
1164 ** WEBPAGE: docsrch
1165 **
1166
--- src/json_config.c
+++ src/json_config.c
@@ -61,12 +61,12 @@
6161
{ "details", CONFIGSET_SKIN },
6262
{ "logo-mimetype", CONFIGSET_SKIN },
6363
{ "logo-image", CONFIGSET_SKIN },
6464
{ "background-mimetype", CONFIGSET_SKIN },
6565
{ "background-image", CONFIGSET_SKIN },
66
-{ "favicon-mimetype", CONFIGSET_SKIN },
67
-{ "favicon-image", CONFIGSET_SKIN },
66
+{ "icon-mimetype", CONFIGSET_SKIN },
67
+{ "icon-image", CONFIGSET_SKIN },
6868
{ "timeline-block-markup", CONFIGSET_SKIN },
6969
{ "timeline-max-comment", CONFIGSET_SKIN },
7070
{ "timeline-plaintext", CONFIGSET_SKIN },
7171
{ "adunit", CONFIGSET_SKIN },
7272
{ "adunit-omit-if-admin", CONFIGSET_SKIN },
7373
--- src/json_config.c
+++ src/json_config.c
@@ -61,12 +61,12 @@
61 { "details", CONFIGSET_SKIN },
62 { "logo-mimetype", CONFIGSET_SKIN },
63 { "logo-image", CONFIGSET_SKIN },
64 { "background-mimetype", CONFIGSET_SKIN },
65 { "background-image", CONFIGSET_SKIN },
66 { "favicon-mimetype", CONFIGSET_SKIN },
67 { "favicon-image", CONFIGSET_SKIN },
68 { "timeline-block-markup", CONFIGSET_SKIN },
69 { "timeline-max-comment", CONFIGSET_SKIN },
70 { "timeline-plaintext", CONFIGSET_SKIN },
71 { "adunit", CONFIGSET_SKIN },
72 { "adunit-omit-if-admin", CONFIGSET_SKIN },
73
--- src/json_config.c
+++ src/json_config.c
@@ -61,12 +61,12 @@
61 { "details", CONFIGSET_SKIN },
62 { "logo-mimetype", CONFIGSET_SKIN },
63 { "logo-image", CONFIGSET_SKIN },
64 { "background-mimetype", CONFIGSET_SKIN },
65 { "background-image", CONFIGSET_SKIN },
66 { "icon-mimetype", CONFIGSET_SKIN },
67 { "icon-image", CONFIGSET_SKIN },
68 { "timeline-block-markup", CONFIGSET_SKIN },
69 { "timeline-max-comment", CONFIGSET_SKIN },
70 { "timeline-plaintext", CONFIGSET_SKIN },
71 { "adunit", CONFIGSET_SKIN },
72 { "adunit-omit-if-admin", CONFIGSET_SKIN },
73
+6 -6
--- src/setup.c
+++ src/setup.c
@@ -1246,12 +1246,12 @@
12461246
int szLogoImg = atoi(PD("logoim:bytes","0"));
12471247
const char *zBgMtime = db_get_mtime("background-image", 0, 0);
12481248
const char *zBgMime = db_get("background-mimetype","image/gif");
12491249
const char *aBgImg = P("bgim");
12501250
int szBgImg = atoi(PD("bgim:bytes","0"));
1251
- const char *zIconMtime = db_get_mtime("favicon-image", 0, 0);
1252
- const char *zIconMime = db_get("favicon-mimetype","image/gif");
1251
+ const char *zIconMtime = db_get_mtime("icon-image", 0, 0);
1252
+ const char *zIconMime = db_get("icon-mimetype","image/gif");
12531253
const char *aIconImg = P("iconim");
12541254
int szIconImg = atoi(PD("iconim:bytes","0"));
12551255
if( szLogoImg>0 ){
12561256
zLogoMime = PD("logoim:mimetype","image/gif");
12571257
}
@@ -1322,26 +1322,26 @@
13221322
Blob img;
13231323
Stmt ins;
13241324
blob_init(&img, aIconImg, szIconImg);
13251325
db_prepare(&ins,
13261326
"REPLACE INTO config(name,value,mtime)"
1327
- " VALUES('favicon-image',:bytes,now())"
1327
+ " VALUES('icon-image',:bytes,now())"
13281328
);
13291329
db_bind_blob(&ins, ":bytes", &img);
13301330
db_step(&ins);
13311331
db_finalize(&ins);
13321332
db_multi_exec(
13331333
"REPLACE INTO config(name,value,mtime)"
1334
- " VALUES('favicon-mimetype',%Q,now())",
1334
+ " VALUES('icon-mimetype',%Q,now())",
13351335
zIconMime
13361336
);
13371337
db_end_transaction(0);
13381338
cgi_redirect("setup_logo");
13391339
}else if( P("clricon")!=0 ){
13401340
db_multi_exec(
13411341
"DELETE FROM config WHERE name IN "
1342
- "('favicon-image','favicon-mimetype')"
1342
+ "('icon-image','icon-mimetype')"
13431343
);
13441344
db_end_transaction(0);
13451345
cgi_redirect("setup_logo");
13461346
}
13471347
style_header("Edit Project Logo And Background");
@@ -1412,11 +1412,11 @@
14121412
@ <input type="file" name="iconim" size="60" accept="image/*" />
14131413
@ <p align="center">
14141414
@ <input type="submit" name="seticon" value="Change Icon" />
14151415
@ <input type="submit" name="clricon" value="Revert To Default" /></p>
14161416
@ </div></form>
1417
- @ <p>(Properties: "favicon-image" and "favicon-mimetype")
1417
+ @ <p>(Properties: "icon-image" and "icon-mimetype")
14181418
@ <hr />
14191419
@
14201420
@ <p><span class="note">Note:</span> Your browser has probably cached these
14211421
@ images, so you may need to press the Reload button before changes will
14221422
@ take effect. </p>
14231423
--- src/setup.c
+++ src/setup.c
@@ -1246,12 +1246,12 @@
1246 int szLogoImg = atoi(PD("logoim:bytes","0"));
1247 const char *zBgMtime = db_get_mtime("background-image", 0, 0);
1248 const char *zBgMime = db_get("background-mimetype","image/gif");
1249 const char *aBgImg = P("bgim");
1250 int szBgImg = atoi(PD("bgim:bytes","0"));
1251 const char *zIconMtime = db_get_mtime("favicon-image", 0, 0);
1252 const char *zIconMime = db_get("favicon-mimetype","image/gif");
1253 const char *aIconImg = P("iconim");
1254 int szIconImg = atoi(PD("iconim:bytes","0"));
1255 if( szLogoImg>0 ){
1256 zLogoMime = PD("logoim:mimetype","image/gif");
1257 }
@@ -1322,26 +1322,26 @@
1322 Blob img;
1323 Stmt ins;
1324 blob_init(&img, aIconImg, szIconImg);
1325 db_prepare(&ins,
1326 "REPLACE INTO config(name,value,mtime)"
1327 " VALUES('favicon-image',:bytes,now())"
1328 );
1329 db_bind_blob(&ins, ":bytes", &img);
1330 db_step(&ins);
1331 db_finalize(&ins);
1332 db_multi_exec(
1333 "REPLACE INTO config(name,value,mtime)"
1334 " VALUES('favicon-mimetype',%Q,now())",
1335 zIconMime
1336 );
1337 db_end_transaction(0);
1338 cgi_redirect("setup_logo");
1339 }else if( P("clricon")!=0 ){
1340 db_multi_exec(
1341 "DELETE FROM config WHERE name IN "
1342 "('favicon-image','favicon-mimetype')"
1343 );
1344 db_end_transaction(0);
1345 cgi_redirect("setup_logo");
1346 }
1347 style_header("Edit Project Logo And Background");
@@ -1412,11 +1412,11 @@
1412 @ <input type="file" name="iconim" size="60" accept="image/*" />
1413 @ <p align="center">
1414 @ <input type="submit" name="seticon" value="Change Icon" />
1415 @ <input type="submit" name="clricon" value="Revert To Default" /></p>
1416 @ </div></form>
1417 @ <p>(Properties: "favicon-image" and "favicon-mimetype")
1418 @ <hr />
1419 @
1420 @ <p><span class="note">Note:</span> Your browser has probably cached these
1421 @ images, so you may need to press the Reload button before changes will
1422 @ take effect. </p>
1423
--- src/setup.c
+++ src/setup.c
@@ -1246,12 +1246,12 @@
1246 int szLogoImg = atoi(PD("logoim:bytes","0"));
1247 const char *zBgMtime = db_get_mtime("background-image", 0, 0);
1248 const char *zBgMime = db_get("background-mimetype","image/gif");
1249 const char *aBgImg = P("bgim");
1250 int szBgImg = atoi(PD("bgim:bytes","0"));
1251 const char *zIconMtime = db_get_mtime("icon-image", 0, 0);
1252 const char *zIconMime = db_get("icon-mimetype","image/gif");
1253 const char *aIconImg = P("iconim");
1254 int szIconImg = atoi(PD("iconim:bytes","0"));
1255 if( szLogoImg>0 ){
1256 zLogoMime = PD("logoim:mimetype","image/gif");
1257 }
@@ -1322,26 +1322,26 @@
1322 Blob img;
1323 Stmt ins;
1324 blob_init(&img, aIconImg, szIconImg);
1325 db_prepare(&ins,
1326 "REPLACE INTO config(name,value,mtime)"
1327 " VALUES('icon-image',:bytes,now())"
1328 );
1329 db_bind_blob(&ins, ":bytes", &img);
1330 db_step(&ins);
1331 db_finalize(&ins);
1332 db_multi_exec(
1333 "REPLACE INTO config(name,value,mtime)"
1334 " VALUES('icon-mimetype',%Q,now())",
1335 zIconMime
1336 );
1337 db_end_transaction(0);
1338 cgi_redirect("setup_logo");
1339 }else if( P("clricon")!=0 ){
1340 db_multi_exec(
1341 "DELETE FROM config WHERE name IN "
1342 "('icon-image','icon-mimetype')"
1343 );
1344 db_end_transaction(0);
1345 cgi_redirect("setup_logo");
1346 }
1347 style_header("Edit Project Logo And Background");
@@ -1412,11 +1412,11 @@
1412 @ <input type="file" name="iconim" size="60" accept="image/*" />
1413 @ <p align="center">
1414 @ <input type="submit" name="seticon" value="Change Icon" />
1415 @ <input type="submit" name="clricon" value="Revert To Default" /></p>
1416 @ </div></form>
1417 @ <p>(Properties: "icon-image" and "icon-mimetype")
1418 @ <hr />
1419 @
1420 @ <p><span class="note">Note:</span> Your browser has probably cached these
1421 @ images, so you may need to press the Reload button before changes will
1422 @ take effect. </p>
1423

Keyboard Shortcuts

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