Fossil

Check-in [ff73526517]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Permit the 'favicon.ico' page to be customized via TH1.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | th1Favicon
Files: files | file ages | folders
SHA3-256: ff735265175830b0073804b395b2f90e6f0869a5d4cbccde7c606a052eee116b
User & Date: mistachkin 2020-06-27 17:15:31
Context
2020-06-28
16:29
Merge updates from trunk. (Leaf check-in: c40c3272cd user: mistachkin tags: th1Favicon)
2020-06-27
17:15
Permit the 'favicon.ico' page to be customized via TH1. (check-in: ff73526517 user: mistachkin tags: th1Favicon)
17:05
Typos in the help text and the change log. (check-in: cd061779d2 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/doc.c.

1130
1131
1132
1133
1134
1135
1136
1137
1138




1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149


1150
1151



1152






1153



1154
1155
1156
1157
1158
1159
1160
1161
  cgi_set_content(&bgimg);
}


/*
** WEBPAGE: favicon.ico
**
** Return the default favicon.ico image.  The returned image is for the
** Fossil lizard icon.




**
** The intended use case here is to supply a favicon for the "fossil ui"
** command.  For a permanent website, the recommended process is for
** the admin to set up a project-specific favicon and reference that
** icon in the HTML header using a line like:
**
**   <link rel="icon" href="URL-FOR-YOUR-ICON" type="MIMETYPE"/>
** 
*/
void favicon_page(void){
  Blob favicon;



  etag_check(ETAG_CONFIG, 0);



  blob_zero(&favicon);






  blob_init(&favicon, (char*)aLogo, sizeof(aLogo));



  cgi_set_content_type("image/gif");
  cgi_set_content(&favicon);
}

/*
** WEBPAGE: docsrch
**
** Search for documents that match a user-supplied full-text search pattern.







|
|
>
>
>
>











>
>

<
>
>
>
|
>
>
>
>
>
>
|
>
>
>
|







1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156

1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
  cgi_set_content(&bgimg);
}


/*
** WEBPAGE: favicon.ico
**
** Return the configured favicon.ico image.  If the TH1 style variables
** "favicon_data" and "favicon_mimetype" exist, they must be the base64
** encoded data for the image to use and its associated MIME type,
** respectively; otherwise, the returned image is for the Fossil lizard
** icon.  Since this page does not make use of the style header, these
** TH1 variables should generally be set in the "th1-setup" script.
**
** The intended use case here is to supply a favicon for the "fossil ui"
** command.  For a permanent website, the recommended process is for
** the admin to set up a project-specific favicon and reference that
** icon in the HTML header using a line like:
**
**   <link rel="icon" href="URL-FOR-YOUR-ICON" type="MIMETYPE"/>
** 
*/
void favicon_page(void){
  Blob favicon;
  const char *zMime = 0;
  const char *zData = Th_Fetch("favicon_data", 0);


  if( zData ){
    int nData = 0;
    zData = decode64(zData, &nData);
    blob_zero(&favicon);
    blob_append(&favicon, zData, nData);
    fossil_free((char*)zData);
    zMime = Th_Fetch("favicon_mimetype", 0);
    if( zMime==0 ) zMime = "image/x-icon";
  }else{
    blob_zero(&favicon);
    blob_init(&favicon, (char*)aLogo, sizeof(aLogo));
  }
  etag_check(ETAG_CONFIG, 0);
  if( zMime==0 ) zMime = "image/gif";
  cgi_set_content_type(zMime);
  cgi_set_content(&favicon);
}

/*
** WEBPAGE: docsrch
**
** Search for documents that match a user-supplied full-text search pattern.

Changes to www/customskin.md.

396
397
398
399
400
401
402







403
404
405
406
407
408
409
       by Fossil.

   *   **log\_image\_url** - A URL for the logo image for this project, as
       configured on the Admin/Logo page.

   *   **background\_image\_url** - A URL for a background image for this
       project, as configured on the Admin/Logo page.








All of the above are variables in the sense that either the header or the
footer is free to change or erase them.  But they should probably be treated
as constants.  New predefined values are likely to be added in future
releases of Fossil.









>
>
>
>
>
>
>







396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
       by Fossil.

   *   **log\_image\_url** - A URL for the logo image for this project, as
       configured on the Admin/Logo page.

   *   **background\_image\_url** - A URL for a background image for this
       project, as configured on the Admin/Logo page.

   *   **favicon\_data** - The base64 encoded data for the image to return
       from the "favicon.ico" page.

   *   **favicon\_mimetype** - The MIME type associated with the image to
       return from the "favicon.ico" page.  This will not be used unless
       custom image data has been specified.

All of the above are variables in the sense that either the header or the
footer is free to change or erase them.  But they should probably be treated
as constants.  New predefined values are likely to be added in future
releases of Fossil.