553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
|
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
|
-
+
|
mimetype_from_name_custom(aMime[i].zSuffix)!=0){
zFlag = "<em><strong>!</strong></em> ";
}
@ <tr><td>%s(zFlag)%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr>
}
@ </tbody></table>
style_table_sorter();
style_body_and_footer("mimetypes");
style_finish_page("mimetypes");
}
/*
** Check to see if the file in the pContent blob is "embedded HTML". Return
** true if it is, and fill pTitle with the document title.
**
** An "embedded HTML" file is HTML that lacks a header and a footer. The
|
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
|
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
|
-
+
-
+
-
+
-
+
-
+
-
+
|
style_header("%s", blob_str(&title));
wiki_convert(&tail, 0, WIKI_BUTTONS);
}else{
style_header("%s", zDefaultTitle);
wiki_convert(pBody, 0, WIKI_BUTTONS);
}
document_emit_js();
style_body_and_footer("doc");
style_finish_page("doc");
}else if( fossil_strcmp(zMime, "text/x-markdown")==0 ){
Blob tail = BLOB_INITIALIZER;
markdown_to_html(pBody, &title, &tail);
if( blob_size(&title)>0 ){
style_header("%s", blob_str(&title));
}else{
style_header("%s", zDefaultTitle);
}
convert_href_and_output(&tail);
document_emit_js();
style_body_and_footer("doc");
style_finish_page("doc");
}else if( fossil_strcmp(zMime, "text/plain")==0 ){
style_header("%s", zDefaultTitle);
@ <blockquote><pre>
@ %h(blob_str(pBody))
@ </pre></blockquote>
document_emit_js();
style_body_and_footer("doc");
style_finish_page("doc");
}else if( fossil_strcmp(zMime, "text/html")==0
&& doc_is_embedded_html(pBody, &title) ){
if( blob_size(&title)==0 ) blob_append(&title,zFilename,-1);
style_header("%s", blob_str(&title));
convert_href_and_output(pBody);
document_emit_js();
style_body_and_footer("doc");
style_finish_page("doc");
}else if( fossil_strcmp(zMime, "text/x-pikchr")==0 ){
style_adunit_config(ADUNIT_RIGHT_OK);
style_header("%s", zDefaultTitle);
wiki_render_by_mimetype(pBody, zMime);
style_body_and_footer("doc");
style_finish_page("doc");
#ifdef FOSSIL_ENABLE_TH1_DOCS
}else if( Th_AreDocsEnabled() &&
fossil_strcmp(zMime, "application/x-th1")==0 ){
int raw = P("raw")!=0;
if( !raw ){
Blob tail;
blob_zero(&tail);
if( wiki_find_title(pBody, &title, &tail) ){
style_header("%s", blob_str(&title));
Th_Render(blob_str(&tail));
blob_reset(&tail);
}else{
style_header("%h", zFilename);
Th_Render(blob_str(pBody));
}
}else{
Th_Render(blob_str(pBody));
}
if( !raw ){
document_emit_js();
style_body_and_footer("doc");
style_finish_page("doc");
}
#endif
}else{
fossil_free(style_csp(1));
cgi_set_content_type(zMime);
cgi_set_content(pBody);
}
|
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
|
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
|
-
+
|
}
cgi_set_status(404, "Not Found");
style_header("Not Found");
@ <p>Document %h(zOrigName) not found
if( fossil_strcmp(zCheckin,"ckout")!=0 ){
@ in %z(href("%R/tree?ci=%T",zCheckin))%h(zCheckin)</a>
}
style_body_and_footer("doc");
style_finish_page("doc");
return;
}
/*
** The default logo.
*/
static const unsigned char aLogo[] = {
|
1200
1201
1202
1203
1204
1205
1206
1207
1208
|
1200
1201
1202
1203
1204
1205
1206
1207
1208
|
-
+
|
**
** s=PATTERN Search for PATTERN
*/
void doc_search_page(void){
login_check_credentials();
style_header("Document Search");
search_screen(SRCH_DOC, 0);
style_body_and_footer("docsrch");
style_finish_page("docsrch");
}
|