Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | pikchrshow: corrected clipboard copy contents for raw SVG mode (it was including containing DIV element). |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
bb56d3d5a2e39f508998062c4f40a0b8 |
User & Date: | stephan 2020-09-14 21:40:58.415 |
Context
2020-09-14
| ||
23:42 | The window.fossil bootstrapping code now adds the CSS class 'fossil-dark-style' to the body element if the skin has a true white-foreground setting. The initial use case for this is CSS-based color changing for pikchr SVGs, so that the same pikchrs work in light and dark themes. ... (check-in: e8f603f0 user: stephan tags: trunk) | |
21:40 | pikchrshow: corrected clipboard copy contents for raw SVG mode (it was including containing DIV element). ... (check-in: bb56d3d5 user: stephan tags: trunk) | |
17:03 | New pikchr.c that fixes an additional problem with "to" terms on line paths and that ensures that "dot" objects to not change the exit point. ... (check-in: 863d2722 user: drh tags: trunk) | |
Changes
Changes to src/fossil.page.pikchrshow.js.
︙ | ︙ | |||
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | P.e.markupAlignWrapper.classList[showIt ? 'remove' : 'add']('hidden'); }; f.getMarkupAlignmentClass = function(){ if(P.e.markupAlignCenter.checked) return ' center'; else if(P.e.markupAlignIndent.checked) return ' indent'; return ''; }; } const preTgt = this.e.previewTarget; if(this.response.isError){ D.append(D.clearElement(preTgt), D.parseHtml(P.response.raw)); D.addClass(preTgt, 'error'); this.e.previewModeLabel.innerText = "Error"; return; } D.removeClass(preTgt, 'error'); D.removeClass(this.e.previewCopyButton, 'disabled'); D.removeClass(this.e.markupAlignWrapper, 'hidden'); D.enable(this.e.previewModeToggle, this.e.markupAlignRadios); | > > > > > | > > | < > | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | P.e.markupAlignWrapper.classList[showIt ? 'remove' : 'add']('hidden'); }; f.getMarkupAlignmentClass = function(){ if(P.e.markupAlignCenter.checked) return ' center'; else if(P.e.markupAlignIndent.checked) return ' indent'; return ''; }; f.getSvgNode = function(txt){ const childs = D.parseHtml(txt); const wrapper = childs.filter((e)=>'DIV'===e.tagName)[0]; return wrapper ? wrapper.querySelector('svg.pikchr') : undefined; }; } const preTgt = this.e.previewTarget; if(this.response.isError){ D.append(D.clearElement(preTgt), D.parseHtml(P.response.raw)); D.addClass(preTgt, 'error'); this.e.previewModeLabel.innerText = "Error"; return; } D.removeClass(preTgt, 'error'); D.removeClass(this.e.previewCopyButton, 'disabled'); D.removeClass(this.e.markupAlignWrapper, 'hidden'); D.enable(this.e.previewModeToggle, this.e.markupAlignRadios); let label, svg; switch(this.previewMode){ case 0: label = "SVG"; f.showMarkupAlignment(false); D.parseHtml(D.clearElement(preTgt), P.response.raw); svg = f.getSvgNode(this.response.raw); if(svg){ /*for copy button*/ this.e.taPreviewText.value = svg.outerHTML; } if(F.pikchr){ F.pikchr.addSrcView(preTgt.querySelector('svg')); } break; case 1: label = "Markdown"; f.showMarkupAlignment(true); |
︙ | ︙ | |||
337 338 339 340 341 342 343 | '">', this.response.inputText.trim(), '</verbatim>' ].join(''); D.append(D.clearElement(preTgt), this.e.taPreviewText); break; case 3: label = "Raw SVG"; f.showMarkupAlignment(false); | | < < | 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | '">', this.response.inputText.trim(), '</verbatim>' ].join(''); D.append(D.clearElement(preTgt), this.e.taPreviewText); break; case 3: label = "Raw SVG"; f.showMarkupAlignment(false); svg = f.getSvgNode(this.response.raw); if(svg){ this.e.taPreviewText.value = svg.outerHTML; }else{ this.e.taPreviewText.value = "ERROR parsing response HTML:\n"+ this.response.raw; console.error("svg parsed HTML nodes:",childs); } |
︙ | ︙ |