Fossil

Check-in [22ba9a41]
Login

Check-in [22ba9a41]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Toggle between SVG and Pikchr source code using the "hidden" class and use ctrl-click rather than double-click.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 22ba9a41e4169887142092d28a969818a6c9ec501bc1fd10caa66e0ddd48980d
User & Date: drh 2020-09-17 19:30:35
Context
2020-09-17
19:31
Misuse of a potentially unsigned value, caught by clang. Only affected platforms where char is unsigned by default. ... (check-in: 5c92bbfc user: stephan tags: trunk)
19:30
Toggle between SVG and Pikchr source code using the "hidden" class and use ctrl-click rather than double-click. ... (check-in: 22ba9a41 user: drh tags: trunk)
19:20
Cleanup the double-click source display for Pikchr. ... (check-in: 5634dfeb user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/markdown_html.c.

376
377
378
379
380
381
382
383
384
385
386
387
388

389
390
391
392
393
394
395
396
397
      nArg -= i;
    }
    blob_appendf(ob, "<div id='svgid-%d'>\n", ++nSvg);
    blob_appendf(ob, "<div class='pikchr-svg' style='%s'>\n", blob_str(&css));
    blob_append(ob, zOut, -1);
    blob_appendf(ob, "</div>\n");
    blob_reset(&css);
    blob_appendf(ob, "<pre style='display:none;'><code>"
                     "%s</code></pre>\n", zIn);
    blob_appendf(ob, "</div>\n");
    blob_appendf(ob,
      "<script nonce='%s'>\n"
      "document.getElementById('svgid-%d').ondblclick=function(){\n"

      "  for(var c of this.children){\n"
      "    c.style.display = c.style.display=='none'?'block':'none';\n"
      "  }\n"
      "}\n"
      "</script>\n",
      style_nonce(), nSvg);
    blob_appendf(ob, "%s\n", zSafeNonce);
  }else{
    blob_appendf(ob, "<pre>\n%s\n</pre>\n", zOut);







|




|
>
|
<







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390

391
392
393
394
395
396
397
      nArg -= i;
    }
    blob_appendf(ob, "<div id='svgid-%d'>\n", ++nSvg);
    blob_appendf(ob, "<div class='pikchr-svg' style='%s'>\n", blob_str(&css));
    blob_append(ob, zOut, -1);
    blob_appendf(ob, "</div>\n");
    blob_reset(&css);
    blob_appendf(ob, "<pre class='hidden'><code>"
                     "%s</code></pre>\n", zIn);
    blob_appendf(ob, "</div>\n");
    blob_appendf(ob,
      "<script nonce='%s'>\n"
      "document.getElementById('svgid-%d').onclick=function(e){\n"
      "  if(e.ctrlKey){\n"
      "    for(var c of this.children){c.classList.toggle('hidden');}\n"

      "  }\n"
      "}\n"
      "</script>\n",
      style_nonce(), nSvg);
    blob_appendf(ob, "%s\n", zSafeNonce);
  }else{
    blob_appendf(ob, "<pre>\n%s\n</pre>\n", zOut);