Fossil SCM

pikchrshow: added 'p' as alias for 'content' URL parameter in the interest of simplifying linking directly to small scripts from the pikchr user manual.

stephan 2020-09-13 00:50 trunk
Commit a34e88e007cab1dbc85bd33b95b6df438abbbd55d6f2c7c2cc15cf5d9d153856
1 file changed +4 -1
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -27,20 +27,23 @@
2727
** WEBPAGE: pikchrshow
2828
**
2929
** A pikchr code editor and previewer, allowing users to experiment
3030
** with pikchr code or prototype it for use in copy/pasting into forum
3131
** posts, wiki pages, or embedded docs.
32
+**
33
+** It optionally accepts a p=pikchr-script-code URL parameter or POST
34
+** value to pre-populate the editor with that code.
3235
*/
3336
void pikchrshow_page(void){
3437
const char *zContent = 0;
3538
int isDark; /* true if the current skin is "dark" */
3639
3740
login_check_credentials();
3841
if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
3942
cgi_redirectf("%s/login?g=%s/pikchrshow", g.zTop, g.zTop);
4043
}
41
- zContent = P("content");
44
+ zContent = PD("content",P("p"));
4245
if(P("ajax")!=0){
4346
/* Called from the JS-side preview updater. */
4447
cgi_set_content_type("text/html");
4548
if(zContent && *zContent){
4649
int w = 0, h = 0;
4750
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -27,20 +27,23 @@
27 ** WEBPAGE: pikchrshow
28 **
29 ** A pikchr code editor and previewer, allowing users to experiment
30 ** with pikchr code or prototype it for use in copy/pasting into forum
31 ** posts, wiki pages, or embedded docs.
 
 
 
32 */
33 void pikchrshow_page(void){
34 const char *zContent = 0;
35 int isDark; /* true if the current skin is "dark" */
36
37 login_check_credentials();
38 if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
39 cgi_redirectf("%s/login?g=%s/pikchrshow", g.zTop, g.zTop);
40 }
41 zContent = P("content");
42 if(P("ajax")!=0){
43 /* Called from the JS-side preview updater. */
44 cgi_set_content_type("text/html");
45 if(zContent && *zContent){
46 int w = 0, h = 0;
47
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -27,20 +27,23 @@
27 ** WEBPAGE: pikchrshow
28 **
29 ** A pikchr code editor and previewer, allowing users to experiment
30 ** with pikchr code or prototype it for use in copy/pasting into forum
31 ** posts, wiki pages, or embedded docs.
32 **
33 ** It optionally accepts a p=pikchr-script-code URL parameter or POST
34 ** value to pre-populate the editor with that code.
35 */
36 void pikchrshow_page(void){
37 const char *zContent = 0;
38 int isDark; /* true if the current skin is "dark" */
39
40 login_check_credentials();
41 if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
42 cgi_redirectf("%s/login?g=%s/pikchrshow", g.zTop, g.zTop);
43 }
44 zContent = PD("content",P("p"));
45 if(P("ajax")!=0){
46 /* Called from the JS-side preview updater. */
47 cgi_set_content_type("text/html");
48 if(zContent && *zContent){
49 int w = 0, h = 0;
50

Keyboard Shortcuts

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