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.
Commit
a34e88e007cab1dbc85bd33b95b6df438abbbd55d6f2c7c2cc15cf5d9d153856
Parent
27a26bb44d44119…
1 file changed
+4
-1
+4
-1
| --- src/pikchrshow.c | ||
| +++ src/pikchrshow.c | ||
| @@ -27,20 +27,23 @@ | ||
| 27 | 27 | ** WEBPAGE: pikchrshow |
| 28 | 28 | ** |
| 29 | 29 | ** A pikchr code editor and previewer, allowing users to experiment |
| 30 | 30 | ** with pikchr code or prototype it for use in copy/pasting into forum |
| 31 | 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. | |
| 32 | 35 | */ |
| 33 | 36 | void pikchrshow_page(void){ |
| 34 | 37 | const char *zContent = 0; |
| 35 | 38 | int isDark; /* true if the current skin is "dark" */ |
| 36 | 39 | |
| 37 | 40 | login_check_credentials(); |
| 38 | 41 | if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){ |
| 39 | 42 | cgi_redirectf("%s/login?g=%s/pikchrshow", g.zTop, g.zTop); |
| 40 | 43 | } |
| 41 | - zContent = P("content"); | |
| 44 | + zContent = PD("content",P("p")); | |
| 42 | 45 | if(P("ajax")!=0){ |
| 43 | 46 | /* Called from the JS-side preview updater. */ |
| 44 | 47 | cgi_set_content_type("text/html"); |
| 45 | 48 | if(zContent && *zContent){ |
| 46 | 49 | int w = 0, h = 0; |
| 47 | 50 |
| --- 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 |