476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
|
** Show the built-in table used to guess embedded document mimetypes
** from file suffixes.
*/
void mimetype_list_page(void){
int i;
char *zCustomList = 0; /* value of the mimetypes setting */
int nCustomEntries = 0; /* number of entries in the mimetypes
setting */
mimetype_verify();
style_header("Mimetype List");
@ <p>The Fossil <a href="%R/help?cmd=/doc">/doc</a> page uses filename
@ suffixes and the following tables to guess at the appropriate mimetype
@ for each document.</p>
@ <h1>Repository-specific mimetypes</h1>
@ <p>The following extension-to-mimetype mappings are defined via
@ the <a href="%R/help?cmd=mimetypes">mimetypes setting</a>.</p>
@ <table class='sortable mimetypetable' border=1 cellpadding=0 \
@ data-column-types='tt' data-init-sort='0'>
@ <thead>
@ <tr><th>Suffix<th>Mimetype
@ </thead>
@ <tbody>
zCustomList = db_get("mimetypes",0);
if( zCustomList!=0 ){
Blob list, entry, key, val;
blob_set(&list, zCustomList);
while( blob_line(&list, &entry)>0 ){
const char *zKey;
if( blob_token(&entry, &key)==0 ) continue;
if( blob_token(&entry, &val)==0 ) continue;
zKey = blob_str(&key);
if( zKey[0]=='.' ) zKey++;
@ <tr><td>%h(zKey)<td>%h(blob_str(&val))</tr>
nCustomEntries++;
}
fossil_free(zCustomList);
}
if( nCustomEntries==0 ){
@ <tr><td colspan="2"><em>none</em></tr>
}
@ </tbody></table>
@ <h1>Default built-in mimetypes</h1>
if(nCustomEntries>0){
@ <p>Entries starting with an exclamation mark <em><strong>!</strong></em>
@ are overwritten by repository-specific settings.</p>
}
@ <table class='sortable mimetypetable' border=1 cellpadding=0 \
@ data-column-types='tt' data-init-sort='1'>
|
|
|
<
<
|
<
<
<
<
<
<
>
>
>
>
>
>
>
>
>
<
|
>
>
|
|
|
>
|
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
|
** Show the built-in table used to guess embedded document mimetypes
** from file suffixes.
*/
void mimetype_list_page(void){
int i;
char *zCustomList = 0; /* value of the mimetypes setting */
int nCustomEntries = 0; /* number of entries in the mimetypes
** setting */
mimetype_verify();
style_header("Mimetype List");
@ <p>The Fossil <a href="%R/help?cmd=/doc">/doc</a> page uses filename
@ suffixes and the following tables to guess at the appropriate mimetype
@ for each document. Mimetypes may be customized and overridden using
@ <a href="%R/help?cmd=mimetypes">the mimetypes config setting</a>.</p>
zCustomList = db_get("mimetypes",0);
if( zCustomList!=0 ){
Blob list, entry, key, val;
@ <h1>Repository-specific mimetypes</h1>
@ <p>The following extension-to-mimetype mappings are defined via
@ the <a href="%R/help?cmd=mimetypes">mimetypes setting</a>.</p>
@ <table class='sortable mimetypetable' border=1 cellpadding=0 \
@ data-column-types='tt' data-init-sort='0'>
@ <thead>
@ <tr><th>Suffix<th>Mimetype
@ </thead>
@ <tbody>
blob_set(&list, zCustomList);
while( blob_line(&list, &entry)>0 ){
const char *zKey;
if( blob_token(&entry, &key)==0 ) continue;
if( blob_token(&entry, &val)==0 ) continue;
zKey = blob_str(&key);
if( zKey[0]=='.' ) zKey++;
@ <tr><td>%h(zKey)<td>%h(blob_str(&val))</tr>
nCustomEntries++;
}
fossil_free(zCustomList);
if( nCustomEntries==0 ){
/* This can happen if the option is set to an empty/space-only
** value. */
@ <tr><td colspan="2"><em>none</em></tr>
}
@ </tbody></table>
}
@ <h1>Default built-in mimetypes</h1>
if(nCustomEntries>0){
@ <p>Entries starting with an exclamation mark <em><strong>!</strong></em>
@ are overwritten by repository-specific settings.</p>
}
@ <table class='sortable mimetypetable' border=1 cellpadding=0 \
@ data-column-types='tt' data-init-sort='1'>
|