28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
**
** A pikchr code editor and previewer, allowing users to experiment
** with pikchr code or prototype it for use in copy/pasting into forum
** posts, wiki pages, or embedded docs.
*/
void pikchrshow_page(void){
const char *zContent = 0;
int isDark, flipColors;
login_check_credentials();
if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
cgi_redirectf("%s/login?g=%s/pikchrshow", g.zTop, g.zTop);
}
zContent = P("content");
if(P("ajax")!=0){
|
|
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
**
** A pikchr code editor and previewer, allowing users to experiment
** with pikchr code or prototype it for use in copy/pasting into forum
** posts, wiki pages, or embedded docs.
*/
void pikchrshow_page(void){
const char *zContent = 0;
int isDark; /* true if the current skin is "dark" */
login_check_credentials();
if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
cgi_redirectf("%s/login?g=%s/pikchrshow", g.zTop, g.zTop);
}
zContent = P("content");
if(P("ajax")!=0){
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
}
fossil_free(zOut);
}else{
CX("<pre>No content! Nothing to render</pre>");
}
return;
}
isDark = skin_detail_boolean("white-foreground");
flipColors = zContent ? P("flipcolors")!=0 : isDark;
if(!zContent){
zContent = "arrow right 200% \"Markdown\" \"Source\"\n"
"box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
"arrow right 200% \"HTML+SVG\" \"Output\"\n"
"arrow <-> down from last box.s\n"
"box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
}
|
>
<
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
}
fossil_free(zOut);
}else{
CX("<pre>No content! Nothing to render</pre>");
}
return;
}
style_emit_noscript_for_js_page();
isDark = skin_detail_boolean("white-foreground");
if(!zContent){
zContent = "arrow right 200% \"Markdown\" \"Source\"\n"
"box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n"
"arrow right 200% \"HTML+SVG\" \"Output\"\n"
"arrow <-> down from last box.s\n"
"box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n";
}
|
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
CX("<div id='pikchrshow-form'>");
CX("<textarea id='content' name='content' rows='15'>%s</textarea>",
zContent/*safe-for-%s*/);
CX("<div id='pikchrshow-controls'>");
CX("<button id='pikchr-submit-preview'>Preview</button>");
style_labeled_checkbox("flipcolors-wrapper", "flipcolors",
"Dark mode?",
"1", flipColors, 0);
CX("</div>"/*#pikchrshow-controls*/);
CX("</div>"/*#pikchrshow-form*/);
CX("<fieldset id='pikchrshow-output-wrapper'>");
CX("<legend></legend>"
/* Reminder: Firefox does not properly flexbox a LEGEND element,
always flowing it in column mode (at least when its fieldset
has a flexbox column layout). */);
|
|
|
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
CX("<div id='pikchrshow-form'>");
CX("<textarea id='content' name='content' rows='15'>%s</textarea>",
zContent/*safe-for-%s*/);
CX("<div id='pikchrshow-controls'>");
CX("<button id='pikchr-submit-preview'>Preview</button>");
style_labeled_checkbox("flipcolors-wrapper", "flipcolors",
"Dark mode?",
"1", isDark, 0);
CX("</div>"/*#pikchrshow-controls*/);
CX("</div>"/*#pikchrshow-form*/);
CX("<fieldset id='pikchrshow-output-wrapper'>");
CX("<legend></legend>"
/* Reminder: Firefox does not properly flexbox a LEGEND element,
always flowing it in column mode (at least when its fieldset
has a flexbox column layout). */);
|