| | @@ -230,22 +230,20 @@ |
| 230 | 230 | blob_reset(&bIn); |
| 231 | 231 | return isErr; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /* |
| 235 | | -** WEBPAGE: pikchrshowcs* |
| 235 | +** Legacy impl of /pikchrshow. pikchrshow_page() will delegate to |
| 236 | +** this one if the "legacy" or "ajax" request arguments are set. |
| 236 | 237 | ** |
| 237 | 238 | ** A pikchr code editor and previewer, allowing users to experiment |
| 238 | 239 | ** with pikchr code or prototype it for use in copy/pasting into forum |
| 239 | 240 | ** posts, wiki pages, or embedded docs. This version of pikchrshow |
| 240 | 241 | ** uses JavaScript to send pikchr code to the server for |
| 241 | 242 | ** processing. The newer /pikchrshow applications runs pikchr on the |
| 242 | 243 | ** client machine, without the need for back-and-forth network |
| 243 | 244 | ** traffic. |
| 244 | | -** |
| 245 | | -** It optionally accepts a p=pikchr-script-code URL parameter or POST |
| 246 | | -** value to pre-populate the editor with that code. |
| 247 | 245 | */ |
| 248 | 246 | void pikchrshowcs_page(void){ |
| 249 | 247 | const char *zContent = 0; |
| 250 | 248 | int isDark; /* true if the current skin is "dark" */ |
| 251 | 249 | int pikFlags = |
| | @@ -393,12 +391,16 @@ |
| 393 | 391 | ** A pikchr code editor and previewer, allowing users to experiment |
| 394 | 392 | ** with pikchr code or prototype it for use in copy/pasting into forum |
| 395 | 393 | ** posts, wiki pages, or embedded docs. This version of pikchrshow |
| 396 | 394 | ** uses WebAssembly to run entirely in the client browser, without a |
| 397 | 395 | ** need for back-and-forth client/server traffic to perform the |
| 398 | | -** rendering. The "legacy" version of this application can be found at |
| 399 | | -** /pikchrshowcs. |
| 396 | +** rendering. The "legacy" version of this application, which sends |
| 397 | +** all input to the server for rendering, can be accessed by adding |
| 398 | +** the "legacy" URL argument. |
| 399 | +** |
| 400 | +** It optionally accepts a p=pikchr-script-code URL parameter or POST |
| 401 | +** value to pre-populate the editor with that code. |
| 400 | 402 | */ |
| 401 | 403 | void pikchrshow_page(void){ |
| 402 | 404 | const char *zContent = 0; |
| 403 | 405 | |
| 404 | 406 | if(P("legacy") || P("ajax")){ |
| | @@ -417,10 +419,11 @@ |
| 417 | 419 | "box rad 10px \"Markdown\" \"Formatter\" \"(markdown.c)\" fit\n" |
| 418 | 420 | "arrow right 200% \"HTML+SVG\" \"Output\"\n" |
| 419 | 421 | "arrow <-> down from last box.s\n" |
| 420 | 422 | "box same \"Pikchr\" \"Formatter\" \"(pikchr.c)\" fit\n"; |
| 421 | 423 | } |
| 424 | + /* Wasm load/init progress widget... */ |
| 422 | 425 | CX("<div class='emscripten'>"); { |
| 423 | 426 | CX("<figure id='module-spinner'>"); |
| 424 | 427 | CX("<div class='spinner'></div>"); |
| 425 | 428 | CX("<div class='center'><strong>Initializing app...</strong></div>"); |
| 426 | 429 | CX("<div class='center'>"); |
| | @@ -432,10 +435,11 @@ |
| 432 | 435 | CX("</figure>"); |
| 433 | 436 | CX("<div class='emscripten' id='module-status'>Downloading...</div>"); |
| 434 | 437 | CX("<progress value='0' max='100' id='module-progress' hidden='1'>" |
| 435 | 438 | "</progress>"); |
| 436 | 439 | } CX("</div><!-- .emscripten -->"); |
| 440 | + /* Main view... */ |
| 437 | 441 | CX("<div id='view-split' class='app-view initially-hidden'>"); { |
| 438 | 442 | CX("<div class='fieldset options collapsible'>"); { |
| 439 | 443 | CX("<span class='legend'><span>Options</span></span>"); |
| 440 | 444 | CX("<div>"); |
| 441 | 445 | CX("<span class='labeled-input'>"); |
| | @@ -470,11 +474,11 @@ |
| 470 | 474 | CX("</div><!-- options wrapper -->"); |
| 471 | 475 | } CX("</div><!-- .fieldset -->"); |
| 472 | 476 | CX("<div id='main-wrapper' class=''>"); { |
| 473 | 477 | CX("<div class='zone-wrapper input'>"); { |
| 474 | 478 | CX("<textarea id='input'"); |
| 475 | | - CX("placeholder='Shell input. Ctrl-enter/shift-enter runs it.'>"); |
| 479 | + CX("placeholder='Pikchr input. Ctrl-enter/shift-enter runs it.'>"); |
| 476 | 480 | CX("/**\n"); |
| 477 | 481 | CX(" Use ctrl-enter or shift-enter to execute\n"); |
| 478 | 482 | CX(" pikchr code. If only a subset is currently\n"); |
| 479 | 483 | CX(" selected, only that part is evaluated.\n*/\n"); |
| 480 | 484 | CX("%s</textarea>",zContent/*safe-for-%s*/); |
| 481 | 485 | |