Fossil SCM

Cherry-pick the show-in-pikchrview feature that was added to the omit-cr branch.

drh 2024-10-14 01:10 trunk
Commit 521da5cd31fa47d66d020784fb0435233a6f3f8fd6330f708eca16cafc1ad998
+29 -6
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
16811681
DOM structure:
16821682
<DIV.pikchr-wrapper>
16831683
<DIV.pikchr-svg>
16841684
<SVG.pikchr>...</SVG>
16851685
</DIV.pikchr-svg>
1686
- <PRE.pikchr-src>...</PRE>
1686
+ <DIV.pikchr-src>
1687
+ <PRE>pikchr source code</PRE>
1688
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
1689
+ <!-- ^^^ is unhidden and activated by JS code -->
1690
+ </DIV.pikchr-src>
16871691
</DIV.pikchr-wrapper>
16881692
16891693
************************************************************/
16901694
div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
16911695
div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
16921696
svg.pikchr {/*pikchr SVG*/
16931697
width: 100%/*necessary for SOME SVGs for Chrome!*/;
16941698
}
1695
-pre.pikchr-src {/*source code view for a pikchr (see fossil.pikchr.js)*/
1699
+
1700
+div.pikchr-src {
1701
+ /*Wrapper for source code view of a pikchr (see fossil.pikchr.js)*/
1702
+ display: flex;
1703
+ flex-direction: column;
1704
+}
1705
+div.pikchr-src > pre {
1706
+ /*Source code for a pikchr*/
16961707
box-sizing: border-box;
16971708
text-align: left;
1709
+}
1710
+div.pikchr-src > span {
1711
+ /*Wrapper for a link to open a pikchr in /pikchrshow*/
1712
+ margin-top: 0.5em;
1713
+ margin-bottom: 0.5em;
1714
+ font-size: 85%;
1715
+}
1716
+div.pikchr-src > span::before {
1717
+ content: "[";
1718
+}
1719
+div.pikchr-src > span::after {
1720
+ content: "]";
16981721
}
16991722
/* The .source-inline class tells the .source class that the
17001723
source view, when enabled, should be "inline" (same position
17011724
as the graphic), else the sources are shifted to the left as
17021725
if they were "plain text". */
@@ -1712,14 +1735,14 @@
17121735
still-seemingly-legitimate browsers don't support grid mode. */
17131736
}
17141737
div.pikchr-wrapper.center > div.pikchr-svg {
17151738
width: 100%/*necessary for Chrome!*/;
17161739
}
1717
-div.pikchr-wrapper.center:not(.source) > pre.pikchr-src,
1740
+div.pikchr-wrapper.center:not(.source) > div.pikchr-src,
17181741
div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
17191742
/* ^^^ Centered non-source-view elements */
1720
-div.pikchr-wrapper.center.source.source-inline > pre.pikchr-src,
1743
+div.pikchr-wrapper.center.source.source-inline div.pikchr-src,
17211744
div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
17221745
/* ^^^ Centered inline-source-view elements */{
17231746
display:inline-block/*allows parent text-align to do the alignment*/;
17241747
/* ^^^^ Browser incompatibility: inline-block causes the centered
17251748
pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
17431766
padding: 4em;
17441767
}
17451768
17461769
/* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
17471770
svg.pikchr visibility... */
1748
-div.pikchr-wrapper.source > pre.pikchr-src {
1771
+div.pikchr-wrapper.source > div.pikchr-src {
17491772
/* Source code ^^^^^^^ is visible, else it is hidden */
17501773
}
1751
-div.pikchr-wrapper:not(.source) > pre.pikchr-src {
1774
+div.pikchr-wrapper:not(.source) > div.pikchr-src {
17521775
/* Hide sources when image is being shown. */
17531776
position: absolute !important;
17541777
opacity: 0 !important;
17551778
pointer-events: none !important;
17561779
display: none !important;
17571780
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
1681 DOM structure:
1682 <DIV.pikchr-wrapper>
1683 <DIV.pikchr-svg>
1684 <SVG.pikchr>...</SVG>
1685 </DIV.pikchr-svg>
1686 <PRE.pikchr-src>...</PRE>
 
 
 
 
1687 </DIV.pikchr-wrapper>
1688
1689 ************************************************************/
1690 div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
1691 div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
1692 svg.pikchr {/*pikchr SVG*/
1693 width: 100%/*necessary for SOME SVGs for Chrome!*/;
1694 }
1695 pre.pikchr-src {/*source code view for a pikchr (see fossil.pikchr.js)*/
 
 
 
 
 
 
 
1696 box-sizing: border-box;
1697 text-align: left;
 
 
 
 
 
 
 
 
 
 
 
 
1698 }
1699 /* The .source-inline class tells the .source class that the
1700 source view, when enabled, should be "inline" (same position
1701 as the graphic), else the sources are shifted to the left as
1702 if they were "plain text". */
@@ -1712,14 +1735,14 @@
1712 still-seemingly-legitimate browsers don't support grid mode. */
1713 }
1714 div.pikchr-wrapper.center > div.pikchr-svg {
1715 width: 100%/*necessary for Chrome!*/;
1716 }
1717 div.pikchr-wrapper.center:not(.source) > pre.pikchr-src,
1718 div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
1719 /* ^^^ Centered non-source-view elements */
1720 div.pikchr-wrapper.center.source.source-inline > pre.pikchr-src,
1721 div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
1722 /* ^^^ Centered inline-source-view elements */{
1723 display:inline-block/*allows parent text-align to do the alignment*/;
1724 /* ^^^^ Browser incompatibility: inline-block causes the centered
1725 pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
1743 padding: 4em;
1744 }
1745
1746 /* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
1747 svg.pikchr visibility... */
1748 div.pikchr-wrapper.source > pre.pikchr-src {
1749 /* Source code ^^^^^^^ is visible, else it is hidden */
1750 }
1751 div.pikchr-wrapper:not(.source) > pre.pikchr-src {
1752 /* Hide sources when image is being shown. */
1753 position: absolute !important;
1754 opacity: 0 !important;
1755 pointer-events: none !important;
1756 display: none !important;
1757
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
1681 DOM structure:
1682 <DIV.pikchr-wrapper>
1683 <DIV.pikchr-svg>
1684 <SVG.pikchr>...</SVG>
1685 </DIV.pikchr-svg>
1686 <DIV.pikchr-src>
1687 <PRE>pikchr source code</PRE>
1688 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
1689 <!-- ^^^ is unhidden and activated by JS code -->
1690 </DIV.pikchr-src>
1691 </DIV.pikchr-wrapper>
1692
1693 ************************************************************/
1694 div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
1695 div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
1696 svg.pikchr {/*pikchr SVG*/
1697 width: 100%/*necessary for SOME SVGs for Chrome!*/;
1698 }
1699
1700 div.pikchr-src {
1701 /*Wrapper for source code view of a pikchr (see fossil.pikchr.js)*/
1702 display: flex;
1703 flex-direction: column;
1704 }
1705 div.pikchr-src > pre {
1706 /*Source code for a pikchr*/
1707 box-sizing: border-box;
1708 text-align: left;
1709 }
1710 div.pikchr-src > span {
1711 /*Wrapper for a link to open a pikchr in /pikchrshow*/
1712 margin-top: 0.5em;
1713 margin-bottom: 0.5em;
1714 font-size: 85%;
1715 }
1716 div.pikchr-src > span::before {
1717 content: "[";
1718 }
1719 div.pikchr-src > span::after {
1720 content: "]";
1721 }
1722 /* The .source-inline class tells the .source class that the
1723 source view, when enabled, should be "inline" (same position
1724 as the graphic), else the sources are shifted to the left as
1725 if they were "plain text". */
@@ -1712,14 +1735,14 @@
1735 still-seemingly-legitimate browsers don't support grid mode. */
1736 }
1737 div.pikchr-wrapper.center > div.pikchr-svg {
1738 width: 100%/*necessary for Chrome!*/;
1739 }
1740 div.pikchr-wrapper.center:not(.source) > div.pikchr-src,
1741 div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
1742 /* ^^^ Centered non-source-view elements */
1743 div.pikchr-wrapper.center.source.source-inline div.pikchr-src,
1744 div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
1745 /* ^^^ Centered inline-source-view elements */{
1746 display:inline-block/*allows parent text-align to do the alignment*/;
1747 /* ^^^^ Browser incompatibility: inline-block causes the centered
1748 pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
1766 padding: 4em;
1767 }
1768
1769 /* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
1770 svg.pikchr visibility... */
1771 div.pikchr-wrapper.source > div.pikchr-src {
1772 /* Source code ^^^^^^^ is visible, else it is hidden */
1773 }
1774 div.pikchr-wrapper:not(.source) > div.pikchr-src {
1775 /* Hide sources when image is being shown. */
1776 position: absolute !important;
1777 opacity: 0 !important;
1778 pointer-events: none !important;
1779 display: none !important;
1780
+29 -6
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
16811681
DOM structure:
16821682
<DIV.pikchr-wrapper>
16831683
<DIV.pikchr-svg>
16841684
<SVG.pikchr>...</SVG>
16851685
</DIV.pikchr-svg>
1686
- <PRE.pikchr-src>...</PRE>
1686
+ <DIV.pikchr-src>
1687
+ <PRE>pikchr source code</PRE>
1688
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
1689
+ <!-- ^^^ is unhidden and activated by JS code -->
1690
+ </DIV.pikchr-src>
16871691
</DIV.pikchr-wrapper>
16881692
16891693
************************************************************/
16901694
div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
16911695
div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
16921696
svg.pikchr {/*pikchr SVG*/
16931697
width: 100%/*necessary for SOME SVGs for Chrome!*/;
16941698
}
1695
-pre.pikchr-src {/*source code view for a pikchr (see fossil.pikchr.js)*/
1699
+
1700
+div.pikchr-src {
1701
+ /*Wrapper for source code view of a pikchr (see fossil.pikchr.js)*/
1702
+ display: flex;
1703
+ flex-direction: column;
1704
+}
1705
+div.pikchr-src > pre {
1706
+ /*Source code for a pikchr*/
16961707
box-sizing: border-box;
16971708
text-align: left;
1709
+}
1710
+div.pikchr-src > span {
1711
+ /*Wrapper for a link to open a pikchr in /pikchrshow*/
1712
+ margin-top: 0.5em;
1713
+ margin-bottom: 0.5em;
1714
+ font-size: 85%;
1715
+}
1716
+div.pikchr-src > span::before {
1717
+ content: "[";
1718
+}
1719
+div.pikchr-src > span::after {
1720
+ content: "]";
16981721
}
16991722
/* The .source-inline class tells the .source class that the
17001723
source view, when enabled, should be "inline" (same position
17011724
as the graphic), else the sources are shifted to the left as
17021725
if they were "plain text". */
@@ -1712,14 +1735,14 @@
17121735
still-seemingly-legitimate browsers don't support grid mode. */
17131736
}
17141737
div.pikchr-wrapper.center > div.pikchr-svg {
17151738
width: 100%/*necessary for Chrome!*/;
17161739
}
1717
-div.pikchr-wrapper.center:not(.source) > pre.pikchr-src,
1740
+div.pikchr-wrapper.center:not(.source) > div.pikchr-src,
17181741
div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
17191742
/* ^^^ Centered non-source-view elements */
1720
-div.pikchr-wrapper.center.source.source-inline > pre.pikchr-src,
1743
+div.pikchr-wrapper.center.source.source-inline div.pikchr-src,
17211744
div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
17221745
/* ^^^ Centered inline-source-view elements */{
17231746
display:inline-block/*allows parent text-align to do the alignment*/;
17241747
/* ^^^^ Browser incompatibility: inline-block causes the centered
17251748
pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
17431766
padding: 4em;
17441767
}
17451768
17461769
/* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
17471770
svg.pikchr visibility... */
1748
-div.pikchr-wrapper.source > pre.pikchr-src {
1771
+div.pikchr-wrapper.source > div.pikchr-src {
17491772
/* Source code ^^^^^^^ is visible, else it is hidden */
17501773
}
1751
-div.pikchr-wrapper:not(.source) > pre.pikchr-src {
1774
+div.pikchr-wrapper:not(.source) > div.pikchr-src {
17521775
/* Hide sources when image is being shown. */
17531776
position: absolute !important;
17541777
opacity: 0 !important;
17551778
pointer-events: none !important;
17561779
display: none !important;
17571780
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
1681 DOM structure:
1682 <DIV.pikchr-wrapper>
1683 <DIV.pikchr-svg>
1684 <SVG.pikchr>...</SVG>
1685 </DIV.pikchr-svg>
1686 <PRE.pikchr-src>...</PRE>
 
 
 
 
1687 </DIV.pikchr-wrapper>
1688
1689 ************************************************************/
1690 div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
1691 div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
1692 svg.pikchr {/*pikchr SVG*/
1693 width: 100%/*necessary for SOME SVGs for Chrome!*/;
1694 }
1695 pre.pikchr-src {/*source code view for a pikchr (see fossil.pikchr.js)*/
 
 
 
 
 
 
 
1696 box-sizing: border-box;
1697 text-align: left;
 
 
 
 
 
 
 
 
 
 
 
 
1698 }
1699 /* The .source-inline class tells the .source class that the
1700 source view, when enabled, should be "inline" (same position
1701 as the graphic), else the sources are shifted to the left as
1702 if they were "plain text". */
@@ -1712,14 +1735,14 @@
1712 still-seemingly-legitimate browsers don't support grid mode. */
1713 }
1714 div.pikchr-wrapper.center > div.pikchr-svg {
1715 width: 100%/*necessary for Chrome!*/;
1716 }
1717 div.pikchr-wrapper.center:not(.source) > pre.pikchr-src,
1718 div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
1719 /* ^^^ Centered non-source-view elements */
1720 div.pikchr-wrapper.center.source.source-inline > pre.pikchr-src,
1721 div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
1722 /* ^^^ Centered inline-source-view elements */{
1723 display:inline-block/*allows parent text-align to do the alignment*/;
1724 /* ^^^^ Browser incompatibility: inline-block causes the centered
1725 pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
1743 padding: 4em;
1744 }
1745
1746 /* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
1747 svg.pikchr visibility... */
1748 div.pikchr-wrapper.source > pre.pikchr-src {
1749 /* Source code ^^^^^^^ is visible, else it is hidden */
1750 }
1751 div.pikchr-wrapper:not(.source) > pre.pikchr-src {
1752 /* Hide sources when image is being shown. */
1753 position: absolute !important;
1754 opacity: 0 !important;
1755 pointer-events: none !important;
1756 display: none !important;
1757
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
1681 DOM structure:
1682 <DIV.pikchr-wrapper>
1683 <DIV.pikchr-svg>
1684 <SVG.pikchr>...</SVG>
1685 </DIV.pikchr-svg>
1686 <DIV.pikchr-src>
1687 <PRE>pikchr source code</PRE>
1688 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
1689 <!-- ^^^ is unhidden and activated by JS code -->
1690 </DIV.pikchr-src>
1691 </DIV.pikchr-wrapper>
1692
1693 ************************************************************/
1694 div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
1695 div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
1696 svg.pikchr {/*pikchr SVG*/
1697 width: 100%/*necessary for SOME SVGs for Chrome!*/;
1698 }
1699
1700 div.pikchr-src {
1701 /*Wrapper for source code view of a pikchr (see fossil.pikchr.js)*/
1702 display: flex;
1703 flex-direction: column;
1704 }
1705 div.pikchr-src > pre {
1706 /*Source code for a pikchr*/
1707 box-sizing: border-box;
1708 text-align: left;
1709 }
1710 div.pikchr-src > span {
1711 /*Wrapper for a link to open a pikchr in /pikchrshow*/
1712 margin-top: 0.5em;
1713 margin-bottom: 0.5em;
1714 font-size: 85%;
1715 }
1716 div.pikchr-src > span::before {
1717 content: "[";
1718 }
1719 div.pikchr-src > span::after {
1720 content: "]";
1721 }
1722 /* The .source-inline class tells the .source class that the
1723 source view, when enabled, should be "inline" (same position
1724 as the graphic), else the sources are shifted to the left as
1725 if they were "plain text". */
@@ -1712,14 +1735,14 @@
1735 still-seemingly-legitimate browsers don't support grid mode. */
1736 }
1737 div.pikchr-wrapper.center > div.pikchr-svg {
1738 width: 100%/*necessary for Chrome!*/;
1739 }
1740 div.pikchr-wrapper.center:not(.source) > div.pikchr-src,
1741 div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
1742 /* ^^^ Centered non-source-view elements */
1743 div.pikchr-wrapper.center.source.source-inline div.pikchr-src,
1744 div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
1745 /* ^^^ Centered inline-source-view elements */{
1746 display:inline-block/*allows parent text-align to do the alignment*/;
1747 /* ^^^^ Browser incompatibility: inline-block causes the centered
1748 pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
1766 padding: 4em;
1767 }
1768
1769 /* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
1770 svg.pikchr visibility... */
1771 div.pikchr-wrapper.source > div.pikchr-src {
1772 /* Source code ^^^^^^^ is visible, else it is hidden */
1773 }
1774 div.pikchr-wrapper:not(.source) > div.pikchr-src {
1775 /* Hide sources when image is being shown. */
1776 position: absolute !important;
1777 opacity: 0 !important;
1778 pointer-events: none !important;
1779 display: none !important;
1780
+29 -6
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
16811681
DOM structure:
16821682
<DIV.pikchr-wrapper>
16831683
<DIV.pikchr-svg>
16841684
<SVG.pikchr>...</SVG>
16851685
</DIV.pikchr-svg>
1686
- <PRE.pikchr-src>...</PRE>
1686
+ <DIV.pikchr-src>
1687
+ <PRE>pikchr source code</PRE>
1688
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
1689
+ <!-- ^^^ is unhidden and activated by JS code -->
1690
+ </DIV.pikchr-src>
16871691
</DIV.pikchr-wrapper>
16881692
16891693
************************************************************/
16901694
div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
16911695
div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
16921696
svg.pikchr {/*pikchr SVG*/
16931697
width: 100%/*necessary for SOME SVGs for Chrome!*/;
16941698
}
1695
-pre.pikchr-src {/*source code view for a pikchr (see fossil.pikchr.js)*/
1699
+
1700
+div.pikchr-src {
1701
+ /*Wrapper for source code view of a pikchr (see fossil.pikchr.js)*/
1702
+ display: flex;
1703
+ flex-direction: column;
1704
+}
1705
+div.pikchr-src > pre {
1706
+ /*Source code for a pikchr*/
16961707
box-sizing: border-box;
16971708
text-align: left;
1709
+}
1710
+div.pikchr-src > span {
1711
+ /*Wrapper for a link to open a pikchr in /pikchrshow*/
1712
+ margin-top: 0.5em;
1713
+ margin-bottom: 0.5em;
1714
+ font-size: 85%;
1715
+}
1716
+div.pikchr-src > span::before {
1717
+ content: "[";
1718
+}
1719
+div.pikchr-src > span::after {
1720
+ content: "]";
16981721
}
16991722
/* The .source-inline class tells the .source class that the
17001723
source view, when enabled, should be "inline" (same position
17011724
as the graphic), else the sources are shifted to the left as
17021725
if they were "plain text". */
@@ -1712,14 +1735,14 @@
17121735
still-seemingly-legitimate browsers don't support grid mode. */
17131736
}
17141737
div.pikchr-wrapper.center > div.pikchr-svg {
17151738
width: 100%/*necessary for Chrome!*/;
17161739
}
1717
-div.pikchr-wrapper.center:not(.source) > pre.pikchr-src,
1740
+div.pikchr-wrapper.center:not(.source) > div.pikchr-src,
17181741
div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
17191742
/* ^^^ Centered non-source-view elements */
1720
-div.pikchr-wrapper.center.source.source-inline > pre.pikchr-src,
1743
+div.pikchr-wrapper.center.source.source-inline div.pikchr-src,
17211744
div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
17221745
/* ^^^ Centered inline-source-view elements */{
17231746
display:inline-block/*allows parent text-align to do the alignment*/;
17241747
/* ^^^^ Browser incompatibility: inline-block causes the centered
17251748
pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
17431766
padding: 4em;
17441767
}
17451768
17461769
/* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
17471770
svg.pikchr visibility... */
1748
-div.pikchr-wrapper.source > pre.pikchr-src {
1771
+div.pikchr-wrapper.source > div.pikchr-src {
17491772
/* Source code ^^^^^^^ is visible, else it is hidden */
17501773
}
1751
-div.pikchr-wrapper:not(.source) > pre.pikchr-src {
1774
+div.pikchr-wrapper:not(.source) > div.pikchr-src {
17521775
/* Hide sources when image is being shown. */
17531776
position: absolute !important;
17541777
opacity: 0 !important;
17551778
pointer-events: none !important;
17561779
display: none !important;
17571780
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
1681 DOM structure:
1682 <DIV.pikchr-wrapper>
1683 <DIV.pikchr-svg>
1684 <SVG.pikchr>...</SVG>
1685 </DIV.pikchr-svg>
1686 <PRE.pikchr-src>...</PRE>
 
 
 
 
1687 </DIV.pikchr-wrapper>
1688
1689 ************************************************************/
1690 div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
1691 div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
1692 svg.pikchr {/*pikchr SVG*/
1693 width: 100%/*necessary for SOME SVGs for Chrome!*/;
1694 }
1695 pre.pikchr-src {/*source code view for a pikchr (see fossil.pikchr.js)*/
 
 
 
 
 
 
 
1696 box-sizing: border-box;
1697 text-align: left;
 
 
 
 
 
 
 
 
 
 
 
 
1698 }
1699 /* The .source-inline class tells the .source class that the
1700 source view, when enabled, should be "inline" (same position
1701 as the graphic), else the sources are shifted to the left as
1702 if they were "plain text". */
@@ -1712,14 +1735,14 @@
1712 still-seemingly-legitimate browsers don't support grid mode. */
1713 }
1714 div.pikchr-wrapper.center > div.pikchr-svg {
1715 width: 100%/*necessary for Chrome!*/;
1716 }
1717 div.pikchr-wrapper.center:not(.source) > pre.pikchr-src,
1718 div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
1719 /* ^^^ Centered non-source-view elements */
1720 div.pikchr-wrapper.center.source.source-inline > pre.pikchr-src,
1721 div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
1722 /* ^^^ Centered inline-source-view elements */{
1723 display:inline-block/*allows parent text-align to do the alignment*/;
1724 /* ^^^^ Browser incompatibility: inline-block causes the centered
1725 pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
1743 padding: 4em;
1744 }
1745
1746 /* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
1747 svg.pikchr visibility... */
1748 div.pikchr-wrapper.source > pre.pikchr-src {
1749 /* Source code ^^^^^^^ is visible, else it is hidden */
1750 }
1751 div.pikchr-wrapper:not(.source) > pre.pikchr-src {
1752 /* Hide sources when image is being shown. */
1753 position: absolute !important;
1754 opacity: 0 !important;
1755 pointer-events: none !important;
1756 display: none !important;
1757
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
1681 DOM structure:
1682 <DIV.pikchr-wrapper>
1683 <DIV.pikchr-svg>
1684 <SVG.pikchr>...</SVG>
1685 </DIV.pikchr-svg>
1686 <DIV.pikchr-src>
1687 <PRE>pikchr source code</PRE>
1688 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
1689 <!-- ^^^ is unhidden and activated by JS code -->
1690 </DIV.pikchr-src>
1691 </DIV.pikchr-wrapper>
1692
1693 ************************************************************/
1694 div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
1695 div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
1696 svg.pikchr {/*pikchr SVG*/
1697 width: 100%/*necessary for SOME SVGs for Chrome!*/;
1698 }
1699
1700 div.pikchr-src {
1701 /*Wrapper for source code view of a pikchr (see fossil.pikchr.js)*/
1702 display: flex;
1703 flex-direction: column;
1704 }
1705 div.pikchr-src > pre {
1706 /*Source code for a pikchr*/
1707 box-sizing: border-box;
1708 text-align: left;
1709 }
1710 div.pikchr-src > span {
1711 /*Wrapper for a link to open a pikchr in /pikchrshow*/
1712 margin-top: 0.5em;
1713 margin-bottom: 0.5em;
1714 font-size: 85%;
1715 }
1716 div.pikchr-src > span::before {
1717 content: "[";
1718 }
1719 div.pikchr-src > span::after {
1720 content: "]";
1721 }
1722 /* The .source-inline class tells the .source class that the
1723 source view, when enabled, should be "inline" (same position
1724 as the graphic), else the sources are shifted to the left as
1725 if they were "plain text". */
@@ -1712,14 +1735,14 @@
1735 still-seemingly-legitimate browsers don't support grid mode. */
1736 }
1737 div.pikchr-wrapper.center > div.pikchr-svg {
1738 width: 100%/*necessary for Chrome!*/;
1739 }
1740 div.pikchr-wrapper.center:not(.source) > div.pikchr-src,
1741 div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
1742 /* ^^^ Centered non-source-view elements */
1743 div.pikchr-wrapper.center.source.source-inline div.pikchr-src,
1744 div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
1745 /* ^^^ Centered inline-source-view elements */{
1746 display:inline-block/*allows parent text-align to do the alignment*/;
1747 /* ^^^^ Browser incompatibility: inline-block causes the centered
1748 pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
1766 padding: 4em;
1767 }
1768
1769 /* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
1770 svg.pikchr visibility... */
1771 div.pikchr-wrapper.source > div.pikchr-src {
1772 /* Source code ^^^^^^^ is visible, else it is hidden */
1773 }
1774 div.pikchr-wrapper:not(.source) > div.pikchr-src {
1775 /* Hide sources when image is being shown. */
1776 position: absolute !important;
1777 opacity: 0 !important;
1778 pointer-events: none !important;
1779 display: none !important;
1780
+29 -6
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
16811681
DOM structure:
16821682
<DIV.pikchr-wrapper>
16831683
<DIV.pikchr-svg>
16841684
<SVG.pikchr>...</SVG>
16851685
</DIV.pikchr-svg>
1686
- <PRE.pikchr-src>...</PRE>
1686
+ <DIV.pikchr-src>
1687
+ <PRE>pikchr source code</PRE>
1688
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
1689
+ <!-- ^^^ is unhidden and activated by JS code -->
1690
+ </DIV.pikchr-src>
16871691
</DIV.pikchr-wrapper>
16881692
16891693
************************************************************/
16901694
div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
16911695
div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
16921696
svg.pikchr {/*pikchr SVG*/
16931697
width: 100%/*necessary for SOME SVGs for Chrome!*/;
16941698
}
1695
-pre.pikchr-src {/*source code view for a pikchr (see fossil.pikchr.js)*/
1699
+
1700
+div.pikchr-src {
1701
+ /*Wrapper for source code view of a pikchr (see fossil.pikchr.js)*/
1702
+ display: flex;
1703
+ flex-direction: column;
1704
+}
1705
+div.pikchr-src > pre {
1706
+ /*Source code for a pikchr*/
16961707
box-sizing: border-box;
16971708
text-align: left;
1709
+}
1710
+div.pikchr-src > span {
1711
+ /*Wrapper for a link to open a pikchr in /pikchrshow*/
1712
+ margin-top: 0.5em;
1713
+ margin-bottom: 0.5em;
1714
+ font-size: 85%;
1715
+}
1716
+div.pikchr-src > span::before {
1717
+ content: "[";
1718
+}
1719
+div.pikchr-src > span::after {
1720
+ content: "]";
16981721
}
16991722
/* The .source-inline class tells the .source class that the
17001723
source view, when enabled, should be "inline" (same position
17011724
as the graphic), else the sources are shifted to the left as
17021725
if they were "plain text". */
@@ -1712,14 +1735,14 @@
17121735
still-seemingly-legitimate browsers don't support grid mode. */
17131736
}
17141737
div.pikchr-wrapper.center > div.pikchr-svg {
17151738
width: 100%/*necessary for Chrome!*/;
17161739
}
1717
-div.pikchr-wrapper.center:not(.source) > pre.pikchr-src,
1740
+div.pikchr-wrapper.center:not(.source) > div.pikchr-src,
17181741
div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
17191742
/* ^^^ Centered non-source-view elements */
1720
-div.pikchr-wrapper.center.source.source-inline > pre.pikchr-src,
1743
+div.pikchr-wrapper.center.source.source-inline div.pikchr-src,
17211744
div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
17221745
/* ^^^ Centered inline-source-view elements */{
17231746
display:inline-block/*allows parent text-align to do the alignment*/;
17241747
/* ^^^^ Browser incompatibility: inline-block causes the centered
17251748
pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
17431766
padding: 4em;
17441767
}
17451768
17461769
/* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
17471770
svg.pikchr visibility... */
1748
-div.pikchr-wrapper.source > pre.pikchr-src {
1771
+div.pikchr-wrapper.source > div.pikchr-src {
17491772
/* Source code ^^^^^^^ is visible, else it is hidden */
17501773
}
1751
-div.pikchr-wrapper:not(.source) > pre.pikchr-src {
1774
+div.pikchr-wrapper:not(.source) > div.pikchr-src {
17521775
/* Hide sources when image is being shown. */
17531776
position: absolute !important;
17541777
opacity: 0 !important;
17551778
pointer-events: none !important;
17561779
display: none !important;
17571780
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
1681 DOM structure:
1682 <DIV.pikchr-wrapper>
1683 <DIV.pikchr-svg>
1684 <SVG.pikchr>...</SVG>
1685 </DIV.pikchr-svg>
1686 <PRE.pikchr-src>...</PRE>
 
 
 
 
1687 </DIV.pikchr-wrapper>
1688
1689 ************************************************************/
1690 div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
1691 div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
1692 svg.pikchr {/*pikchr SVG*/
1693 width: 100%/*necessary for SOME SVGs for Chrome!*/;
1694 }
1695 pre.pikchr-src {/*source code view for a pikchr (see fossil.pikchr.js)*/
 
 
 
 
 
 
 
1696 box-sizing: border-box;
1697 text-align: left;
 
 
 
 
 
 
 
 
 
 
 
 
1698 }
1699 /* The .source-inline class tells the .source class that the
1700 source view, when enabled, should be "inline" (same position
1701 as the graphic), else the sources are shifted to the left as
1702 if they were "plain text". */
@@ -1712,14 +1735,14 @@
1712 still-seemingly-legitimate browsers don't support grid mode. */
1713 }
1714 div.pikchr-wrapper.center > div.pikchr-svg {
1715 width: 100%/*necessary for Chrome!*/;
1716 }
1717 div.pikchr-wrapper.center:not(.source) > pre.pikchr-src,
1718 div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
1719 /* ^^^ Centered non-source-view elements */
1720 div.pikchr-wrapper.center.source.source-inline > pre.pikchr-src,
1721 div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
1722 /* ^^^ Centered inline-source-view elements */{
1723 display:inline-block/*allows parent text-align to do the alignment*/;
1724 /* ^^^^ Browser incompatibility: inline-block causes the centered
1725 pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
1743 padding: 4em;
1744 }
1745
1746 /* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
1747 svg.pikchr visibility... */
1748 div.pikchr-wrapper.source > pre.pikchr-src {
1749 /* Source code ^^^^^^^ is visible, else it is hidden */
1750 }
1751 div.pikchr-wrapper:not(.source) > pre.pikchr-src {
1752 /* Hide sources when image is being shown. */
1753 position: absolute !important;
1754 opacity: 0 !important;
1755 pointer-events: none !important;
1756 display: none !important;
1757
--- src/default.css
+++ src/default.css
@@ -1681,22 +1681,45 @@
1681 DOM structure:
1682 <DIV.pikchr-wrapper>
1683 <DIV.pikchr-svg>
1684 <SVG.pikchr>...</SVG>
1685 </DIV.pikchr-svg>
1686 <DIV.pikchr-src>
1687 <PRE>pikchr source code</PRE>
1688 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
1689 <!-- ^^^ is unhidden and activated by JS code -->
1690 </DIV.pikchr-src>
1691 </DIV.pikchr-wrapper>
1692
1693 ************************************************************/
1694 div.pikchr-wrapper {/*outer wrapper elem for a pikchr construct*/}
1695 div.pikchr-svg {/*wrapper for SVG.pikchr element*/}
1696 svg.pikchr {/*pikchr SVG*/
1697 width: 100%/*necessary for SOME SVGs for Chrome!*/;
1698 }
1699
1700 div.pikchr-src {
1701 /*Wrapper for source code view of a pikchr (see fossil.pikchr.js)*/
1702 display: flex;
1703 flex-direction: column;
1704 }
1705 div.pikchr-src > pre {
1706 /*Source code for a pikchr*/
1707 box-sizing: border-box;
1708 text-align: left;
1709 }
1710 div.pikchr-src > span {
1711 /*Wrapper for a link to open a pikchr in /pikchrshow*/
1712 margin-top: 0.5em;
1713 margin-bottom: 0.5em;
1714 font-size: 85%;
1715 }
1716 div.pikchr-src > span::before {
1717 content: "[";
1718 }
1719 div.pikchr-src > span::after {
1720 content: "]";
1721 }
1722 /* The .source-inline class tells the .source class that the
1723 source view, when enabled, should be "inline" (same position
1724 as the graphic), else the sources are shifted to the left as
1725 if they were "plain text". */
@@ -1712,14 +1735,14 @@
1735 still-seemingly-legitimate browsers don't support grid mode. */
1736 }
1737 div.pikchr-wrapper.center > div.pikchr-svg {
1738 width: 100%/*necessary for Chrome!*/;
1739 }
1740 div.pikchr-wrapper.center:not(.source) > div.pikchr-src,
1741 div.pikchr-wrapper.center:not(.source) > div.pikchr-svg,
1742 /* ^^^ Centered non-source-view elements */
1743 div.pikchr-wrapper.center.source.source-inline div.pikchr-src,
1744 div.pikchr-wrapper.center.source.source-inline > div.pikchr-svg
1745 /* ^^^ Centered inline-source-view elements */{
1746 display:inline-block/*allows parent text-align to do the alignment*/;
1747 /* ^^^^ Browser incompatibility: inline-block causes the centered
1748 pikchr to shrink to the point of illegiblity in Chrome. The
@@ -1743,14 +1766,14 @@
1766 padding: 4em;
1767 }
1768
1769 /* For pikchr-wrapper.source mode, toggle pre.pikchr-src and
1770 svg.pikchr visibility... */
1771 div.pikchr-wrapper.source > div.pikchr-src {
1772 /* Source code ^^^^^^^ is visible, else it is hidden */
1773 }
1774 div.pikchr-wrapper:not(.source) > div.pikchr-src {
1775 /* Hide sources when image is being shown. */
1776 position: absolute !important;
1777 opacity: 0 !important;
1778 pointer-events: none !important;
1779 display: none !important;
1780
--- src/fossil.page.pikchrshowasm.js
+++ src/fossil.page.pikchrshowasm.js
@@ -206,11 +206,11 @@
206206
const text = getCurrentText();
207207
if(text) PS.render(text);
208208
};
209209
const setCurrentText = function(txt){
210210
taInput.value = txt;
211
- renderCurrentText();
211
+ renderCurrentText();
212212
};
213213
PS.e.btnRender.addEventListener('click',function(ev){
214214
ev.preventDefault();
215215
renderCurrentText();
216216
},false);
@@ -427,13 +427,25 @@
427427
btnToggle.addEventListener('click', function(){
428428
fs.classList.toggle('collapsed');
429429
content.forEach((d)=>d.classList.toggle('hidden'));
430430
}, false);
431431
});
432
+
433
+ if(window.sessionStorage){
434
+ /* If sessionStorage['pikchr-xfer'] exists and the "fromSession"
435
+ URL argument was passed to this page, load the pikchr source
436
+ from the session. This is used by the "open in pikchrshow"
437
+ link in the forum. */
438
+ const src = window.sessionStorage.getItem('pikchr-xfer');
439
+ if( src && (new URL(self.location.href).searchParams).has('fromSession') ){
440
+ taInput.value = src;
441
+ window.sessionStorage.removeItem('pikchr-xfer');
442
+ }
443
+ }
432444
433445
PS.e.btnRender.click();
434
-
446
+
435447
/** Debounce handler for auto-rendering while typing. */
436448
const debounceAutoRender = F.debounce(function f(){
437449
if(!PS._isDirty) return;
438450
const text = getCurrentText();
439451
if(f._ === text){
@@ -618,11 +630,11 @@
618630
"Darlene" above aligned
619631
620632
# fill in content for the Alice lane
621633
right
622634
A1: circle rad 0.1in at end of first line + (0.2,-0.2) \
623
- fill white thickness 1.5px "1"
635
+ fill white thickness 1.5px "1"
624636
arrow right 50%
625637
circle same "2"
626638
arrow right until even with first box.e - (0.65,0.0)
627639
ellipse "future" fit fill white height 0.2 width 0.5 thickness 1.5px
628640
A3: circle same at A1+(0.8,-0.3) "3" fill 0xc0c0c0
629641
--- src/fossil.page.pikchrshowasm.js
+++ src/fossil.page.pikchrshowasm.js
@@ -206,11 +206,11 @@
206 const text = getCurrentText();
207 if(text) PS.render(text);
208 };
209 const setCurrentText = function(txt){
210 taInput.value = txt;
211 renderCurrentText();
212 };
213 PS.e.btnRender.addEventListener('click',function(ev){
214 ev.preventDefault();
215 renderCurrentText();
216 },false);
@@ -427,13 +427,25 @@
427 btnToggle.addEventListener('click', function(){
428 fs.classList.toggle('collapsed');
429 content.forEach((d)=>d.classList.toggle('hidden'));
430 }, false);
431 });
 
 
 
 
 
 
 
 
 
 
 
 
432
433 PS.e.btnRender.click();
434
435 /** Debounce handler for auto-rendering while typing. */
436 const debounceAutoRender = F.debounce(function f(){
437 if(!PS._isDirty) return;
438 const text = getCurrentText();
439 if(f._ === text){
@@ -618,11 +630,11 @@
618 "Darlene" above aligned
619
620 # fill in content for the Alice lane
621 right
622 A1: circle rad 0.1in at end of first line + (0.2,-0.2) \
623 fill white thickness 1.5px "1"
624 arrow right 50%
625 circle same "2"
626 arrow right until even with first box.e - (0.65,0.0)
627 ellipse "future" fit fill white height 0.2 width 0.5 thickness 1.5px
628 A3: circle same at A1+(0.8,-0.3) "3" fill 0xc0c0c0
629
--- src/fossil.page.pikchrshowasm.js
+++ src/fossil.page.pikchrshowasm.js
@@ -206,11 +206,11 @@
206 const text = getCurrentText();
207 if(text) PS.render(text);
208 };
209 const setCurrentText = function(txt){
210 taInput.value = txt;
211 renderCurrentText();
212 };
213 PS.e.btnRender.addEventListener('click',function(ev){
214 ev.preventDefault();
215 renderCurrentText();
216 },false);
@@ -427,13 +427,25 @@
427 btnToggle.addEventListener('click', function(){
428 fs.classList.toggle('collapsed');
429 content.forEach((d)=>d.classList.toggle('hidden'));
430 }, false);
431 });
432
433 if(window.sessionStorage){
434 /* If sessionStorage['pikchr-xfer'] exists and the "fromSession"
435 URL argument was passed to this page, load the pikchr source
436 from the session. This is used by the "open in pikchrshow"
437 link in the forum. */
438 const src = window.sessionStorage.getItem('pikchr-xfer');
439 if( src && (new URL(self.location.href).searchParams).has('fromSession') ){
440 taInput.value = src;
441 window.sessionStorage.removeItem('pikchr-xfer');
442 }
443 }
444
445 PS.e.btnRender.click();
446
447 /** Debounce handler for auto-rendering while typing. */
448 const debounceAutoRender = F.debounce(function f(){
449 if(!PS._isDirty) return;
450 const text = getCurrentText();
451 if(f._ === text){
@@ -618,11 +630,11 @@
630 "Darlene" above aligned
631
632 # fill in content for the Alice lane
633 right
634 A1: circle rad 0.1in at end of first line + (0.2,-0.2) \
635 fill white thickness 1.5px "1"
636 arrow right 50%
637 circle same "2"
638 arrow right until even with first box.e - (0.65,0.0)
639 ellipse "future" fit fill white height 0.2 width 0.5 thickness 1.5px
640 A3: circle same at A1+(0.8,-0.3) "3" fill 0xc0c0c0
641
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
3838
This code expects the following structure around the SVGs, and
3939
will not process any which don't match this:
4040
4141
<DIV.pikchr-wrapper>
4242
<DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43
- <PRE.pikchr-src></PRE>
43
+ <DIV.pikchr-src>
44
+ <PRE>pikchr source code</PRE>
45
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46
+ </DIV>
4447
</DIV>
4548
*/
4649
P.addSrcView = function f(svg){
4750
if(!f.hasOwnProperty('parentClick')){
4851
f.parentClick = function(ev){
@@ -58,10 +61,46 @@
5861
this.classList.toggle('source');
5962
ev.stopPropagation();
6063
ev.preventDefault();
6164
}
6265
};
66
+ /**
67
+ Event handler for the "open in pikchrshow" links: store the
68
+ source code for the link's pikchr in
69
+ window.sessionStorage['pikchr-xfer'] then open
70
+ /pikchrshow?fromSession to trigger loading of that pikchr.
71
+ */
72
+ f.clickPikchrShow = function(ev){
73
+ const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74
+ if(!pId) return;
75
+ const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76
+ if(!ePikchr) return;
77
+ ev.stopPropagation() /* keep pikchr source view from toggling */;
78
+ window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79
+ /*
80
+ After returning from this function the link element will
81
+ open [/pikchrshow?fromSession], and pikchrshow will extract
82
+ the pikchr source code from sessionStorage['pikchr-xfer'].
83
+
84
+ Quirks of this ^^^ design:
85
+
86
+ We use only a single slot in sessionStorage. We could
87
+ alternately use a key like pikchr-$pId and pass that key on
88
+ to /pikchrshow via fromSession=pikchr-$pId, but that would
89
+ eventually lead to stale session entries if loading of
90
+ pikchrshow were interrupted at an untimely point. The
91
+ down-side of _not_ doing that is that some user (or
92
+ automation) options multiple "open in pikchrshow" links
93
+ rapidly enough, the will open the same pikchr (the one which
94
+ was stored in the session's slot most recently). The
95
+ current approach should be fine for normal human interaction
96
+ speeds, but if it proves to be a problem we can instead use
97
+ the above-described approach of storing each pikchr in its
98
+ own session slot and simply accept that there may be stale
99
+ entries at some point.
100
+ */
101
+ };
63102
};
64103
if(!svg) svg = 'svg.pikchr';
65104
if('string' === typeof svg){
66105
document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67106
return this;
@@ -71,15 +110,24 @@
71110
}
72111
if(svg.dataset.pikchrProcessed){
73112
return this;
74113
}
75114
svg.dataset.pikchrProcessed = 1;
76
- const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77
- const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78
- if(!srcView || !srcView.classList.contains('pikchr-src')){
115
+ const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116
+ const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117
+ if(srcView && srcView.classList.contains('pikchr-src')){
79118
/* Without this element, there's nothing for us to do here. */
80
- return this;
119
+ parent.addEventListener('click', f.parentClick, false);
120
+ const eSpan = window.sessionStorage
121
+ ? srcView.querySelector('span') /* "open in..." link wrapper */
122
+ : undefined;
123
+ if(eSpan){
124
+ const openLink = eSpan.querySelector('a');
125
+ if(openLink){
126
+ openLink.addEventListener('click', f.clickPikchrShow, false);
127
+ eSpan.classList.remove('hidden');
128
+ }
129
+ }
81130
}
82
- parent.addEventListener('click', f.parentClick, false);
83131
return this;
84132
};
85133
})(window.fossil);
86134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <PRE.pikchr-src></PRE>
 
 
 
44 </DIV>
45 */
46 P.addSrcView = function f(svg){
47 if(!f.hasOwnProperty('parentClick')){
48 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
58 this.classList.toggle('source');
59 ev.stopPropagation();
60 ev.preventDefault();
61 }
62 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63 };
64 if(!svg) svg = 'svg.pikchr';
65 if('string' === typeof svg){
66 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67 return this;
@@ -71,15 +110,24 @@
71 }
72 if(svg.dataset.pikchrProcessed){
73 return this;
74 }
75 svg.dataset.pikchrProcessed = 1;
76 const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77 const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78 if(!srcView || !srcView.classList.contains('pikchr-src')){
79 /* Without this element, there's nothing for us to do here. */
80 return this;
 
 
 
 
 
 
 
 
 
 
81 }
82 parent.addEventListener('click', f.parentClick, false);
83 return this;
84 };
85 })(window.fossil);
86
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <DIV.pikchr-src>
44 <PRE>pikchr source code</PRE>
45 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46 </DIV>
47 </DIV>
48 */
49 P.addSrcView = function f(svg){
50 if(!f.hasOwnProperty('parentClick')){
51 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
61 this.classList.toggle('source');
62 ev.stopPropagation();
63 ev.preventDefault();
64 }
65 };
66 /**
67 Event handler for the "open in pikchrshow" links: store the
68 source code for the link's pikchr in
69 window.sessionStorage['pikchr-xfer'] then open
70 /pikchrshow?fromSession to trigger loading of that pikchr.
71 */
72 f.clickPikchrShow = function(ev){
73 const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74 if(!pId) return;
75 const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76 if(!ePikchr) return;
77 ev.stopPropagation() /* keep pikchr source view from toggling */;
78 window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79 /*
80 After returning from this function the link element will
81 open [/pikchrshow?fromSession], and pikchrshow will extract
82 the pikchr source code from sessionStorage['pikchr-xfer'].
83
84 Quirks of this ^^^ design:
85
86 We use only a single slot in sessionStorage. We could
87 alternately use a key like pikchr-$pId and pass that key on
88 to /pikchrshow via fromSession=pikchr-$pId, but that would
89 eventually lead to stale session entries if loading of
90 pikchrshow were interrupted at an untimely point. The
91 down-side of _not_ doing that is that some user (or
92 automation) options multiple "open in pikchrshow" links
93 rapidly enough, the will open the same pikchr (the one which
94 was stored in the session's slot most recently). The
95 current approach should be fine for normal human interaction
96 speeds, but if it proves to be a problem we can instead use
97 the above-described approach of storing each pikchr in its
98 own session slot and simply accept that there may be stale
99 entries at some point.
100 */
101 };
102 };
103 if(!svg) svg = 'svg.pikchr';
104 if('string' === typeof svg){
105 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
106 return this;
@@ -71,15 +110,24 @@
110 }
111 if(svg.dataset.pikchrProcessed){
112 return this;
113 }
114 svg.dataset.pikchrProcessed = 1;
115 const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116 const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117 if(srcView && srcView.classList.contains('pikchr-src')){
118 /* Without this element, there's nothing for us to do here. */
119 parent.addEventListener('click', f.parentClick, false);
120 const eSpan = window.sessionStorage
121 ? srcView.querySelector('span') /* "open in..." link wrapper */
122 : undefined;
123 if(eSpan){
124 const openLink = eSpan.querySelector('a');
125 if(openLink){
126 openLink.addEventListener('click', f.clickPikchrShow, false);
127 eSpan.classList.remove('hidden');
128 }
129 }
130 }
 
131 return this;
132 };
133 })(window.fossil);
134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
3838
This code expects the following structure around the SVGs, and
3939
will not process any which don't match this:
4040
4141
<DIV.pikchr-wrapper>
4242
<DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43
- <PRE.pikchr-src></PRE>
43
+ <DIV.pikchr-src>
44
+ <PRE>pikchr source code</PRE>
45
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46
+ </DIV>
4447
</DIV>
4548
*/
4649
P.addSrcView = function f(svg){
4750
if(!f.hasOwnProperty('parentClick')){
4851
f.parentClick = function(ev){
@@ -58,10 +61,46 @@
5861
this.classList.toggle('source');
5962
ev.stopPropagation();
6063
ev.preventDefault();
6164
}
6265
};
66
+ /**
67
+ Event handler for the "open in pikchrshow" links: store the
68
+ source code for the link's pikchr in
69
+ window.sessionStorage['pikchr-xfer'] then open
70
+ /pikchrshow?fromSession to trigger loading of that pikchr.
71
+ */
72
+ f.clickPikchrShow = function(ev){
73
+ const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74
+ if(!pId) return;
75
+ const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76
+ if(!ePikchr) return;
77
+ ev.stopPropagation() /* keep pikchr source view from toggling */;
78
+ window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79
+ /*
80
+ After returning from this function the link element will
81
+ open [/pikchrshow?fromSession], and pikchrshow will extract
82
+ the pikchr source code from sessionStorage['pikchr-xfer'].
83
+
84
+ Quirks of this ^^^ design:
85
+
86
+ We use only a single slot in sessionStorage. We could
87
+ alternately use a key like pikchr-$pId and pass that key on
88
+ to /pikchrshow via fromSession=pikchr-$pId, but that would
89
+ eventually lead to stale session entries if loading of
90
+ pikchrshow were interrupted at an untimely point. The
91
+ down-side of _not_ doing that is that some user (or
92
+ automation) options multiple "open in pikchrshow" links
93
+ rapidly enough, the will open the same pikchr (the one which
94
+ was stored in the session's slot most recently). The
95
+ current approach should be fine for normal human interaction
96
+ speeds, but if it proves to be a problem we can instead use
97
+ the above-described approach of storing each pikchr in its
98
+ own session slot and simply accept that there may be stale
99
+ entries at some point.
100
+ */
101
+ };
63102
};
64103
if(!svg) svg = 'svg.pikchr';
65104
if('string' === typeof svg){
66105
document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67106
return this;
@@ -71,15 +110,24 @@
71110
}
72111
if(svg.dataset.pikchrProcessed){
73112
return this;
74113
}
75114
svg.dataset.pikchrProcessed = 1;
76
- const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77
- const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78
- if(!srcView || !srcView.classList.contains('pikchr-src')){
115
+ const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116
+ const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117
+ if(srcView && srcView.classList.contains('pikchr-src')){
79118
/* Without this element, there's nothing for us to do here. */
80
- return this;
119
+ parent.addEventListener('click', f.parentClick, false);
120
+ const eSpan = window.sessionStorage
121
+ ? srcView.querySelector('span') /* "open in..." link wrapper */
122
+ : undefined;
123
+ if(eSpan){
124
+ const openLink = eSpan.querySelector('a');
125
+ if(openLink){
126
+ openLink.addEventListener('click', f.clickPikchrShow, false);
127
+ eSpan.classList.remove('hidden');
128
+ }
129
+ }
81130
}
82
- parent.addEventListener('click', f.parentClick, false);
83131
return this;
84132
};
85133
})(window.fossil);
86134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <PRE.pikchr-src></PRE>
 
 
 
44 </DIV>
45 */
46 P.addSrcView = function f(svg){
47 if(!f.hasOwnProperty('parentClick')){
48 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
58 this.classList.toggle('source');
59 ev.stopPropagation();
60 ev.preventDefault();
61 }
62 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63 };
64 if(!svg) svg = 'svg.pikchr';
65 if('string' === typeof svg){
66 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67 return this;
@@ -71,15 +110,24 @@
71 }
72 if(svg.dataset.pikchrProcessed){
73 return this;
74 }
75 svg.dataset.pikchrProcessed = 1;
76 const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77 const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78 if(!srcView || !srcView.classList.contains('pikchr-src')){
79 /* Without this element, there's nothing for us to do here. */
80 return this;
 
 
 
 
 
 
 
 
 
 
81 }
82 parent.addEventListener('click', f.parentClick, false);
83 return this;
84 };
85 })(window.fossil);
86
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <DIV.pikchr-src>
44 <PRE>pikchr source code</PRE>
45 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46 </DIV>
47 </DIV>
48 */
49 P.addSrcView = function f(svg){
50 if(!f.hasOwnProperty('parentClick')){
51 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
61 this.classList.toggle('source');
62 ev.stopPropagation();
63 ev.preventDefault();
64 }
65 };
66 /**
67 Event handler for the "open in pikchrshow" links: store the
68 source code for the link's pikchr in
69 window.sessionStorage['pikchr-xfer'] then open
70 /pikchrshow?fromSession to trigger loading of that pikchr.
71 */
72 f.clickPikchrShow = function(ev){
73 const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74 if(!pId) return;
75 const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76 if(!ePikchr) return;
77 ev.stopPropagation() /* keep pikchr source view from toggling */;
78 window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79 /*
80 After returning from this function the link element will
81 open [/pikchrshow?fromSession], and pikchrshow will extract
82 the pikchr source code from sessionStorage['pikchr-xfer'].
83
84 Quirks of this ^^^ design:
85
86 We use only a single slot in sessionStorage. We could
87 alternately use a key like pikchr-$pId and pass that key on
88 to /pikchrshow via fromSession=pikchr-$pId, but that would
89 eventually lead to stale session entries if loading of
90 pikchrshow were interrupted at an untimely point. The
91 down-side of _not_ doing that is that some user (or
92 automation) options multiple "open in pikchrshow" links
93 rapidly enough, the will open the same pikchr (the one which
94 was stored in the session's slot most recently). The
95 current approach should be fine for normal human interaction
96 speeds, but if it proves to be a problem we can instead use
97 the above-described approach of storing each pikchr in its
98 own session slot and simply accept that there may be stale
99 entries at some point.
100 */
101 };
102 };
103 if(!svg) svg = 'svg.pikchr';
104 if('string' === typeof svg){
105 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
106 return this;
@@ -71,15 +110,24 @@
110 }
111 if(svg.dataset.pikchrProcessed){
112 return this;
113 }
114 svg.dataset.pikchrProcessed = 1;
115 const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116 const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117 if(srcView && srcView.classList.contains('pikchr-src')){
118 /* Without this element, there's nothing for us to do here. */
119 parent.addEventListener('click', f.parentClick, false);
120 const eSpan = window.sessionStorage
121 ? srcView.querySelector('span') /* "open in..." link wrapper */
122 : undefined;
123 if(eSpan){
124 const openLink = eSpan.querySelector('a');
125 if(openLink){
126 openLink.addEventListener('click', f.clickPikchrShow, false);
127 eSpan.classList.remove('hidden');
128 }
129 }
130 }
 
131 return this;
132 };
133 })(window.fossil);
134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
3838
This code expects the following structure around the SVGs, and
3939
will not process any which don't match this:
4040
4141
<DIV.pikchr-wrapper>
4242
<DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43
- <PRE.pikchr-src></PRE>
43
+ <DIV.pikchr-src>
44
+ <PRE>pikchr source code</PRE>
45
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46
+ </DIV>
4447
</DIV>
4548
*/
4649
P.addSrcView = function f(svg){
4750
if(!f.hasOwnProperty('parentClick')){
4851
f.parentClick = function(ev){
@@ -58,10 +61,46 @@
5861
this.classList.toggle('source');
5962
ev.stopPropagation();
6063
ev.preventDefault();
6164
}
6265
};
66
+ /**
67
+ Event handler for the "open in pikchrshow" links: store the
68
+ source code for the link's pikchr in
69
+ window.sessionStorage['pikchr-xfer'] then open
70
+ /pikchrshow?fromSession to trigger loading of that pikchr.
71
+ */
72
+ f.clickPikchrShow = function(ev){
73
+ const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74
+ if(!pId) return;
75
+ const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76
+ if(!ePikchr) return;
77
+ ev.stopPropagation() /* keep pikchr source view from toggling */;
78
+ window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79
+ /*
80
+ After returning from this function the link element will
81
+ open [/pikchrshow?fromSession], and pikchrshow will extract
82
+ the pikchr source code from sessionStorage['pikchr-xfer'].
83
+
84
+ Quirks of this ^^^ design:
85
+
86
+ We use only a single slot in sessionStorage. We could
87
+ alternately use a key like pikchr-$pId and pass that key on
88
+ to /pikchrshow via fromSession=pikchr-$pId, but that would
89
+ eventually lead to stale session entries if loading of
90
+ pikchrshow were interrupted at an untimely point. The
91
+ down-side of _not_ doing that is that some user (or
92
+ automation) options multiple "open in pikchrshow" links
93
+ rapidly enough, the will open the same pikchr (the one which
94
+ was stored in the session's slot most recently). The
95
+ current approach should be fine for normal human interaction
96
+ speeds, but if it proves to be a problem we can instead use
97
+ the above-described approach of storing each pikchr in its
98
+ own session slot and simply accept that there may be stale
99
+ entries at some point.
100
+ */
101
+ };
63102
};
64103
if(!svg) svg = 'svg.pikchr';
65104
if('string' === typeof svg){
66105
document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67106
return this;
@@ -71,15 +110,24 @@
71110
}
72111
if(svg.dataset.pikchrProcessed){
73112
return this;
74113
}
75114
svg.dataset.pikchrProcessed = 1;
76
- const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77
- const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78
- if(!srcView || !srcView.classList.contains('pikchr-src')){
115
+ const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116
+ const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117
+ if(srcView && srcView.classList.contains('pikchr-src')){
79118
/* Without this element, there's nothing for us to do here. */
80
- return this;
119
+ parent.addEventListener('click', f.parentClick, false);
120
+ const eSpan = window.sessionStorage
121
+ ? srcView.querySelector('span') /* "open in..." link wrapper */
122
+ : undefined;
123
+ if(eSpan){
124
+ const openLink = eSpan.querySelector('a');
125
+ if(openLink){
126
+ openLink.addEventListener('click', f.clickPikchrShow, false);
127
+ eSpan.classList.remove('hidden');
128
+ }
129
+ }
81130
}
82
- parent.addEventListener('click', f.parentClick, false);
83131
return this;
84132
};
85133
})(window.fossil);
86134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <PRE.pikchr-src></PRE>
 
 
 
44 </DIV>
45 */
46 P.addSrcView = function f(svg){
47 if(!f.hasOwnProperty('parentClick')){
48 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
58 this.classList.toggle('source');
59 ev.stopPropagation();
60 ev.preventDefault();
61 }
62 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63 };
64 if(!svg) svg = 'svg.pikchr';
65 if('string' === typeof svg){
66 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67 return this;
@@ -71,15 +110,24 @@
71 }
72 if(svg.dataset.pikchrProcessed){
73 return this;
74 }
75 svg.dataset.pikchrProcessed = 1;
76 const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77 const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78 if(!srcView || !srcView.classList.contains('pikchr-src')){
79 /* Without this element, there's nothing for us to do here. */
80 return this;
 
 
 
 
 
 
 
 
 
 
81 }
82 parent.addEventListener('click', f.parentClick, false);
83 return this;
84 };
85 })(window.fossil);
86
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <DIV.pikchr-src>
44 <PRE>pikchr source code</PRE>
45 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46 </DIV>
47 </DIV>
48 */
49 P.addSrcView = function f(svg){
50 if(!f.hasOwnProperty('parentClick')){
51 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
61 this.classList.toggle('source');
62 ev.stopPropagation();
63 ev.preventDefault();
64 }
65 };
66 /**
67 Event handler for the "open in pikchrshow" links: store the
68 source code for the link's pikchr in
69 window.sessionStorage['pikchr-xfer'] then open
70 /pikchrshow?fromSession to trigger loading of that pikchr.
71 */
72 f.clickPikchrShow = function(ev){
73 const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74 if(!pId) return;
75 const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76 if(!ePikchr) return;
77 ev.stopPropagation() /* keep pikchr source view from toggling */;
78 window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79 /*
80 After returning from this function the link element will
81 open [/pikchrshow?fromSession], and pikchrshow will extract
82 the pikchr source code from sessionStorage['pikchr-xfer'].
83
84 Quirks of this ^^^ design:
85
86 We use only a single slot in sessionStorage. We could
87 alternately use a key like pikchr-$pId and pass that key on
88 to /pikchrshow via fromSession=pikchr-$pId, but that would
89 eventually lead to stale session entries if loading of
90 pikchrshow were interrupted at an untimely point. The
91 down-side of _not_ doing that is that some user (or
92 automation) options multiple "open in pikchrshow" links
93 rapidly enough, the will open the same pikchr (the one which
94 was stored in the session's slot most recently). The
95 current approach should be fine for normal human interaction
96 speeds, but if it proves to be a problem we can instead use
97 the above-described approach of storing each pikchr in its
98 own session slot and simply accept that there may be stale
99 entries at some point.
100 */
101 };
102 };
103 if(!svg) svg = 'svg.pikchr';
104 if('string' === typeof svg){
105 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
106 return this;
@@ -71,15 +110,24 @@
110 }
111 if(svg.dataset.pikchrProcessed){
112 return this;
113 }
114 svg.dataset.pikchrProcessed = 1;
115 const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116 const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117 if(srcView && srcView.classList.contains('pikchr-src')){
118 /* Without this element, there's nothing for us to do here. */
119 parent.addEventListener('click', f.parentClick, false);
120 const eSpan = window.sessionStorage
121 ? srcView.querySelector('span') /* "open in..." link wrapper */
122 : undefined;
123 if(eSpan){
124 const openLink = eSpan.querySelector('a');
125 if(openLink){
126 openLink.addEventListener('click', f.clickPikchrShow, false);
127 eSpan.classList.remove('hidden');
128 }
129 }
130 }
 
131 return this;
132 };
133 })(window.fossil);
134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
3838
This code expects the following structure around the SVGs, and
3939
will not process any which don't match this:
4040
4141
<DIV.pikchr-wrapper>
4242
<DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43
- <PRE.pikchr-src></PRE>
43
+ <DIV.pikchr-src>
44
+ <PRE>pikchr source code</PRE>
45
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46
+ </DIV>
4447
</DIV>
4548
*/
4649
P.addSrcView = function f(svg){
4750
if(!f.hasOwnProperty('parentClick')){
4851
f.parentClick = function(ev){
@@ -58,10 +61,46 @@
5861
this.classList.toggle('source');
5962
ev.stopPropagation();
6063
ev.preventDefault();
6164
}
6265
};
66
+ /**
67
+ Event handler for the "open in pikchrshow" links: store the
68
+ source code for the link's pikchr in
69
+ window.sessionStorage['pikchr-xfer'] then open
70
+ /pikchrshow?fromSession to trigger loading of that pikchr.
71
+ */
72
+ f.clickPikchrShow = function(ev){
73
+ const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74
+ if(!pId) return;
75
+ const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76
+ if(!ePikchr) return;
77
+ ev.stopPropagation() /* keep pikchr source view from toggling */;
78
+ window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79
+ /*
80
+ After returning from this function the link element will
81
+ open [/pikchrshow?fromSession], and pikchrshow will extract
82
+ the pikchr source code from sessionStorage['pikchr-xfer'].
83
+
84
+ Quirks of this ^^^ design:
85
+
86
+ We use only a single slot in sessionStorage. We could
87
+ alternately use a key like pikchr-$pId and pass that key on
88
+ to /pikchrshow via fromSession=pikchr-$pId, but that would
89
+ eventually lead to stale session entries if loading of
90
+ pikchrshow were interrupted at an untimely point. The
91
+ down-side of _not_ doing that is that some user (or
92
+ automation) options multiple "open in pikchrshow" links
93
+ rapidly enough, the will open the same pikchr (the one which
94
+ was stored in the session's slot most recently). The
95
+ current approach should be fine for normal human interaction
96
+ speeds, but if it proves to be a problem we can instead use
97
+ the above-described approach of storing each pikchr in its
98
+ own session slot and simply accept that there may be stale
99
+ entries at some point.
100
+ */
101
+ };
63102
};
64103
if(!svg) svg = 'svg.pikchr';
65104
if('string' === typeof svg){
66105
document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67106
return this;
@@ -71,15 +110,24 @@
71110
}
72111
if(svg.dataset.pikchrProcessed){
73112
return this;
74113
}
75114
svg.dataset.pikchrProcessed = 1;
76
- const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77
- const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78
- if(!srcView || !srcView.classList.contains('pikchr-src')){
115
+ const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116
+ const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117
+ if(srcView && srcView.classList.contains('pikchr-src')){
79118
/* Without this element, there's nothing for us to do here. */
80
- return this;
119
+ parent.addEventListener('click', f.parentClick, false);
120
+ const eSpan = window.sessionStorage
121
+ ? srcView.querySelector('span') /* "open in..." link wrapper */
122
+ : undefined;
123
+ if(eSpan){
124
+ const openLink = eSpan.querySelector('a');
125
+ if(openLink){
126
+ openLink.addEventListener('click', f.clickPikchrShow, false);
127
+ eSpan.classList.remove('hidden');
128
+ }
129
+ }
81130
}
82
- parent.addEventListener('click', f.parentClick, false);
83131
return this;
84132
};
85133
})(window.fossil);
86134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <PRE.pikchr-src></PRE>
 
 
 
44 </DIV>
45 */
46 P.addSrcView = function f(svg){
47 if(!f.hasOwnProperty('parentClick')){
48 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
58 this.classList.toggle('source');
59 ev.stopPropagation();
60 ev.preventDefault();
61 }
62 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63 };
64 if(!svg) svg = 'svg.pikchr';
65 if('string' === typeof svg){
66 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67 return this;
@@ -71,15 +110,24 @@
71 }
72 if(svg.dataset.pikchrProcessed){
73 return this;
74 }
75 svg.dataset.pikchrProcessed = 1;
76 const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77 const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78 if(!srcView || !srcView.classList.contains('pikchr-src')){
79 /* Without this element, there's nothing for us to do here. */
80 return this;
 
 
 
 
 
 
 
 
 
 
81 }
82 parent.addEventListener('click', f.parentClick, false);
83 return this;
84 };
85 })(window.fossil);
86
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <DIV.pikchr-src>
44 <PRE>pikchr source code</PRE>
45 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46 </DIV>
47 </DIV>
48 */
49 P.addSrcView = function f(svg){
50 if(!f.hasOwnProperty('parentClick')){
51 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
61 this.classList.toggle('source');
62 ev.stopPropagation();
63 ev.preventDefault();
64 }
65 };
66 /**
67 Event handler for the "open in pikchrshow" links: store the
68 source code for the link's pikchr in
69 window.sessionStorage['pikchr-xfer'] then open
70 /pikchrshow?fromSession to trigger loading of that pikchr.
71 */
72 f.clickPikchrShow = function(ev){
73 const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74 if(!pId) return;
75 const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76 if(!ePikchr) return;
77 ev.stopPropagation() /* keep pikchr source view from toggling */;
78 window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79 /*
80 After returning from this function the link element will
81 open [/pikchrshow?fromSession], and pikchrshow will extract
82 the pikchr source code from sessionStorage['pikchr-xfer'].
83
84 Quirks of this ^^^ design:
85
86 We use only a single slot in sessionStorage. We could
87 alternately use a key like pikchr-$pId and pass that key on
88 to /pikchrshow via fromSession=pikchr-$pId, but that would
89 eventually lead to stale session entries if loading of
90 pikchrshow were interrupted at an untimely point. The
91 down-side of _not_ doing that is that some user (or
92 automation) options multiple "open in pikchrshow" links
93 rapidly enough, the will open the same pikchr (the one which
94 was stored in the session's slot most recently). The
95 current approach should be fine for normal human interaction
96 speeds, but if it proves to be a problem we can instead use
97 the above-described approach of storing each pikchr in its
98 own session slot and simply accept that there may be stale
99 entries at some point.
100 */
101 };
102 };
103 if(!svg) svg = 'svg.pikchr';
104 if('string' === typeof svg){
105 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
106 return this;
@@ -71,15 +110,24 @@
110 }
111 if(svg.dataset.pikchrProcessed){
112 return this;
113 }
114 svg.dataset.pikchrProcessed = 1;
115 const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116 const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117 if(srcView && srcView.classList.contains('pikchr-src')){
118 /* Without this element, there's nothing for us to do here. */
119 parent.addEventListener('click', f.parentClick, false);
120 const eSpan = window.sessionStorage
121 ? srcView.querySelector('span') /* "open in..." link wrapper */
122 : undefined;
123 if(eSpan){
124 const openLink = eSpan.querySelector('a');
125 if(openLink){
126 openLink.addEventListener('click', f.clickPikchrShow, false);
127 eSpan.classList.remove('hidden');
128 }
129 }
130 }
 
131 return this;
132 };
133 })(window.fossil);
134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
3838
This code expects the following structure around the SVGs, and
3939
will not process any which don't match this:
4040
4141
<DIV.pikchr-wrapper>
4242
<DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43
- <PRE.pikchr-src></PRE>
43
+ <DIV.pikchr-src>
44
+ <PRE>pikchr source code</PRE>
45
+ <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46
+ </DIV>
4447
</DIV>
4548
*/
4649
P.addSrcView = function f(svg){
4750
if(!f.hasOwnProperty('parentClick')){
4851
f.parentClick = function(ev){
@@ -58,10 +61,46 @@
5861
this.classList.toggle('source');
5962
ev.stopPropagation();
6063
ev.preventDefault();
6164
}
6265
};
66
+ /**
67
+ Event handler for the "open in pikchrshow" links: store the
68
+ source code for the link's pikchr in
69
+ window.sessionStorage['pikchr-xfer'] then open
70
+ /pikchrshow?fromSession to trigger loading of that pikchr.
71
+ */
72
+ f.clickPikchrShow = function(ev){
73
+ const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74
+ if(!pId) return;
75
+ const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76
+ if(!ePikchr) return;
77
+ ev.stopPropagation() /* keep pikchr source view from toggling */;
78
+ window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79
+ /*
80
+ After returning from this function the link element will
81
+ open [/pikchrshow?fromSession], and pikchrshow will extract
82
+ the pikchr source code from sessionStorage['pikchr-xfer'].
83
+
84
+ Quirks of this ^^^ design:
85
+
86
+ We use only a single slot in sessionStorage. We could
87
+ alternately use a key like pikchr-$pId and pass that key on
88
+ to /pikchrshow via fromSession=pikchr-$pId, but that would
89
+ eventually lead to stale session entries if loading of
90
+ pikchrshow were interrupted at an untimely point. The
91
+ down-side of _not_ doing that is that some user (or
92
+ automation) options multiple "open in pikchrshow" links
93
+ rapidly enough, the will open the same pikchr (the one which
94
+ was stored in the session's slot most recently). The
95
+ current approach should be fine for normal human interaction
96
+ speeds, but if it proves to be a problem we can instead use
97
+ the above-described approach of storing each pikchr in its
98
+ own session slot and simply accept that there may be stale
99
+ entries at some point.
100
+ */
101
+ };
63102
};
64103
if(!svg) svg = 'svg.pikchr';
65104
if('string' === typeof svg){
66105
document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67106
return this;
@@ -71,15 +110,24 @@
71110
}
72111
if(svg.dataset.pikchrProcessed){
73112
return this;
74113
}
75114
svg.dataset.pikchrProcessed = 1;
76
- const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77
- const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78
- if(!srcView || !srcView.classList.contains('pikchr-src')){
115
+ const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116
+ const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117
+ if(srcView && srcView.classList.contains('pikchr-src')){
79118
/* Without this element, there's nothing for us to do here. */
80
- return this;
119
+ parent.addEventListener('click', f.parentClick, false);
120
+ const eSpan = window.sessionStorage
121
+ ? srcView.querySelector('span') /* "open in..." link wrapper */
122
+ : undefined;
123
+ if(eSpan){
124
+ const openLink = eSpan.querySelector('a');
125
+ if(openLink){
126
+ openLink.addEventListener('click', f.clickPikchrShow, false);
127
+ eSpan.classList.remove('hidden');
128
+ }
129
+ }
81130
}
82
- parent.addEventListener('click', f.parentClick, false);
83131
return this;
84132
};
85133
})(window.fossil);
86134
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <PRE.pikchr-src></PRE>
 
 
 
44 </DIV>
45 */
46 P.addSrcView = function f(svg){
47 if(!f.hasOwnProperty('parentClick')){
48 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
58 this.classList.toggle('source');
59 ev.stopPropagation();
60 ev.preventDefault();
61 }
62 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63 };
64 if(!svg) svg = 'svg.pikchr';
65 if('string' === typeof svg){
66 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
67 return this;
@@ -71,15 +110,24 @@
71 }
72 if(svg.dataset.pikchrProcessed){
73 return this;
74 }
75 svg.dataset.pikchrProcessed = 1;
76 const parent = svg.parentNode.parentNode /* outermost div.pikchr-wrapper */;
77 const srcView = parent ? svg.parentNode.nextElementSibling : undefined;
78 if(!srcView || !srcView.classList.contains('pikchr-src')){
79 /* Without this element, there's nothing for us to do here. */
80 return this;
 
 
 
 
 
 
 
 
 
 
81 }
82 parent.addEventListener('click', f.parentClick, false);
83 return this;
84 };
85 })(window.fossil);
86
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -38,11 +38,14 @@
38 This code expects the following structure around the SVGs, and
39 will not process any which don't match this:
40
41 <DIV.pikchr-wrapper>
42 <DIV.pikchr-svg><SVG.pikchr></SVG></DIV>
43 <DIV.pikchr-src>
44 <PRE>pikchr source code</PRE>
45 <SPAN class='hidden'><A>link to open pikchr in /pikchrshow</A></SPAN>
46 </DIV>
47 </DIV>
48 */
49 P.addSrcView = function f(svg){
50 if(!f.hasOwnProperty('parentClick')){
51 f.parentClick = function(ev){
@@ -58,10 +61,46 @@
61 this.classList.toggle('source');
62 ev.stopPropagation();
63 ev.preventDefault();
64 }
65 };
66 /**
67 Event handler for the "open in pikchrshow" links: store the
68 source code for the link's pikchr in
69 window.sessionStorage['pikchr-xfer'] then open
70 /pikchrshow?fromSession to trigger loading of that pikchr.
71 */
72 f.clickPikchrShow = function(ev){
73 const pId = this.dataset['pikchrid'] /* ID of the associated pikchr source code element */;
74 if(!pId) return;
75 const ePikchr = this.parentNode.parentNode.querySelector('#'+pId);
76 if(!ePikchr) return;
77 ev.stopPropagation() /* keep pikchr source view from toggling */;
78 window.sessionStorage.setItem('pikchr-xfer', ePikchr.innerText);
79 /*
80 After returning from this function the link element will
81 open [/pikchrshow?fromSession], and pikchrshow will extract
82 the pikchr source code from sessionStorage['pikchr-xfer'].
83
84 Quirks of this ^^^ design:
85
86 We use only a single slot in sessionStorage. We could
87 alternately use a key like pikchr-$pId and pass that key on
88 to /pikchrshow via fromSession=pikchr-$pId, but that would
89 eventually lead to stale session entries if loading of
90 pikchrshow were interrupted at an untimely point. The
91 down-side of _not_ doing that is that some user (or
92 automation) options multiple "open in pikchrshow" links
93 rapidly enough, the will open the same pikchr (the one which
94 was stored in the session's slot most recently). The
95 current approach should be fine for normal human interaction
96 speeds, but if it proves to be a problem we can instead use
97 the above-described approach of storing each pikchr in its
98 own session slot and simply accept that there may be stale
99 entries at some point.
100 */
101 };
102 };
103 if(!svg) svg = 'svg.pikchr';
104 if('string' === typeof svg){
105 document.querySelectorAll(svg).forEach((e)=>f.call(this, e));
106 return this;
@@ -71,15 +110,24 @@
110 }
111 if(svg.dataset.pikchrProcessed){
112 return this;
113 }
114 svg.dataset.pikchrProcessed = 1;
115 const parent = svg.parentNode.parentNode /* outermost DIV.pikchr-wrapper */;
116 const srcView = parent ? svg.parentNode.nextElementSibling /* DIV.pikchr-src */ : undefined;
117 if(srcView && srcView.classList.contains('pikchr-src')){
118 /* Without this element, there's nothing for us to do here. */
119 parent.addEventListener('click', f.parentClick, false);
120 const eSpan = window.sessionStorage
121 ? srcView.querySelector('span') /* "open in..." link wrapper */
122 : undefined;
123 if(eSpan){
124 const openLink = eSpan.querySelector('a');
125 if(openLink){
126 openLink.addEventListener('click', f.clickPikchrShow, false);
127 eSpan.classList.remove('hidden');
128 }
129 }
130 }
 
131 return this;
132 };
133 })(window.fossil);
134
+12 -2
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207207
blob_append(pOut, zOut, -1);
208208
if(PIKCHR_PROCESS_DIV & pikFlags){
209209
blob_append(pOut, "</div>\n", 7);
210210
}
211211
if(PIKCHR_PROCESS_SRC & pikFlags){
212
- blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213
- blob_str(&bIn));
212
+ static int counter = 0;
213
+ ++counter;
214
+ blob_appendf(pOut, "<div class='pikchr-src'>"
215
+ "<pre id='pikchr-src-%d'>%h</pre>"
216
+ "<span class='hidden'>"
217
+ "<a href='%R/pikchrshow?fromSession' "
218
+ "class='pikchr-src-pikchrshow' target='_new-%d' "
219
+ "data-pikchrid='pikchr-src-%d' "
220
+ "title='Open this pikchr in /pikchrshow'"
221
+ ">&rarr; /pikchrshow</a></span>"
222
+ "</div>\n",
223
+ counter, blob_str(&bIn), counter, counter);
214224
}
215225
if(PIKCHR_PROCESS_DIV & pikFlags){
216226
blob_append(pOut, "</div>\n", 7);
217227
}
218228
}else{
219229
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213 blob_str(&bIn));
 
 
 
 
 
 
 
 
 
 
214 }
215 if(PIKCHR_PROCESS_DIV & pikFlags){
216 blob_append(pOut, "</div>\n", 7);
217 }
218 }else{
219
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 static int counter = 0;
213 ++counter;
214 blob_appendf(pOut, "<div class='pikchr-src'>"
215 "<pre id='pikchr-src-%d'>%h</pre>"
216 "<span class='hidden'>"
217 "<a href='%R/pikchrshow?fromSession' "
218 "class='pikchr-src-pikchrshow' target='_new-%d' "
219 "data-pikchrid='pikchr-src-%d' "
220 "title='Open this pikchr in /pikchrshow'"
221 ">&rarr; /pikchrshow</a></span>"
222 "</div>\n",
223 counter, blob_str(&bIn), counter, counter);
224 }
225 if(PIKCHR_PROCESS_DIV & pikFlags){
226 blob_append(pOut, "</div>\n", 7);
227 }
228 }else{
229
+12 -2
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207207
blob_append(pOut, zOut, -1);
208208
if(PIKCHR_PROCESS_DIV & pikFlags){
209209
blob_append(pOut, "</div>\n", 7);
210210
}
211211
if(PIKCHR_PROCESS_SRC & pikFlags){
212
- blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213
- blob_str(&bIn));
212
+ static int counter = 0;
213
+ ++counter;
214
+ blob_appendf(pOut, "<div class='pikchr-src'>"
215
+ "<pre id='pikchr-src-%d'>%h</pre>"
216
+ "<span class='hidden'>"
217
+ "<a href='%R/pikchrshow?fromSession' "
218
+ "class='pikchr-src-pikchrshow' target='_new-%d' "
219
+ "data-pikchrid='pikchr-src-%d' "
220
+ "title='Open this pikchr in /pikchrshow'"
221
+ ">&rarr; /pikchrshow</a></span>"
222
+ "</div>\n",
223
+ counter, blob_str(&bIn), counter, counter);
214224
}
215225
if(PIKCHR_PROCESS_DIV & pikFlags){
216226
blob_append(pOut, "</div>\n", 7);
217227
}
218228
}else{
219229
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213 blob_str(&bIn));
 
 
 
 
 
 
 
 
 
 
214 }
215 if(PIKCHR_PROCESS_DIV & pikFlags){
216 blob_append(pOut, "</div>\n", 7);
217 }
218 }else{
219
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 static int counter = 0;
213 ++counter;
214 blob_appendf(pOut, "<div class='pikchr-src'>"
215 "<pre id='pikchr-src-%d'>%h</pre>"
216 "<span class='hidden'>"
217 "<a href='%R/pikchrshow?fromSession' "
218 "class='pikchr-src-pikchrshow' target='_new-%d' "
219 "data-pikchrid='pikchr-src-%d' "
220 "title='Open this pikchr in /pikchrshow'"
221 ">&rarr; /pikchrshow</a></span>"
222 "</div>\n",
223 counter, blob_str(&bIn), counter, counter);
224 }
225 if(PIKCHR_PROCESS_DIV & pikFlags){
226 blob_append(pOut, "</div>\n", 7);
227 }
228 }else{
229
+12 -2
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207207
blob_append(pOut, zOut, -1);
208208
if(PIKCHR_PROCESS_DIV & pikFlags){
209209
blob_append(pOut, "</div>\n", 7);
210210
}
211211
if(PIKCHR_PROCESS_SRC & pikFlags){
212
- blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213
- blob_str(&bIn));
212
+ static int counter = 0;
213
+ ++counter;
214
+ blob_appendf(pOut, "<div class='pikchr-src'>"
215
+ "<pre id='pikchr-src-%d'>%h</pre>"
216
+ "<span class='hidden'>"
217
+ "<a href='%R/pikchrshow?fromSession' "
218
+ "class='pikchr-src-pikchrshow' target='_new-%d' "
219
+ "data-pikchrid='pikchr-src-%d' "
220
+ "title='Open this pikchr in /pikchrshow'"
221
+ ">&rarr; /pikchrshow</a></span>"
222
+ "</div>\n",
223
+ counter, blob_str(&bIn), counter, counter);
214224
}
215225
if(PIKCHR_PROCESS_DIV & pikFlags){
216226
blob_append(pOut, "</div>\n", 7);
217227
}
218228
}else{
219229
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213 blob_str(&bIn));
 
 
 
 
 
 
 
 
 
 
214 }
215 if(PIKCHR_PROCESS_DIV & pikFlags){
216 blob_append(pOut, "</div>\n", 7);
217 }
218 }else{
219
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 static int counter = 0;
213 ++counter;
214 blob_appendf(pOut, "<div class='pikchr-src'>"
215 "<pre id='pikchr-src-%d'>%h</pre>"
216 "<span class='hidden'>"
217 "<a href='%R/pikchrshow?fromSession' "
218 "class='pikchr-src-pikchrshow' target='_new-%d' "
219 "data-pikchrid='pikchr-src-%d' "
220 "title='Open this pikchr in /pikchrshow'"
221 ">&rarr; /pikchrshow</a></span>"
222 "</div>\n",
223 counter, blob_str(&bIn), counter, counter);
224 }
225 if(PIKCHR_PROCESS_DIV & pikFlags){
226 blob_append(pOut, "</div>\n", 7);
227 }
228 }else{
229
+12 -2
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207207
blob_append(pOut, zOut, -1);
208208
if(PIKCHR_PROCESS_DIV & pikFlags){
209209
blob_append(pOut, "</div>\n", 7);
210210
}
211211
if(PIKCHR_PROCESS_SRC & pikFlags){
212
- blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213
- blob_str(&bIn));
212
+ static int counter = 0;
213
+ ++counter;
214
+ blob_appendf(pOut, "<div class='pikchr-src'>"
215
+ "<pre id='pikchr-src-%d'>%h</pre>"
216
+ "<span class='hidden'>"
217
+ "<a href='%R/pikchrshow?fromSession' "
218
+ "class='pikchr-src-pikchrshow' target='_new-%d' "
219
+ "data-pikchrid='pikchr-src-%d' "
220
+ "title='Open this pikchr in /pikchrshow'"
221
+ ">&rarr; /pikchrshow</a></span>"
222
+ "</div>\n",
223
+ counter, blob_str(&bIn), counter, counter);
214224
}
215225
if(PIKCHR_PROCESS_DIV & pikFlags){
216226
blob_append(pOut, "</div>\n", 7);
217227
}
218228
}else{
219229
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213 blob_str(&bIn));
 
 
 
 
 
 
 
 
 
 
214 }
215 if(PIKCHR_PROCESS_DIV & pikFlags){
216 blob_append(pOut, "</div>\n", 7);
217 }
218 }else{
219
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 static int counter = 0;
213 ++counter;
214 blob_appendf(pOut, "<div class='pikchr-src'>"
215 "<pre id='pikchr-src-%d'>%h</pre>"
216 "<span class='hidden'>"
217 "<a href='%R/pikchrshow?fromSession' "
218 "class='pikchr-src-pikchrshow' target='_new-%d' "
219 "data-pikchrid='pikchr-src-%d' "
220 "title='Open this pikchr in /pikchrshow'"
221 ">&rarr; /pikchrshow</a></span>"
222 "</div>\n",
223 counter, blob_str(&bIn), counter, counter);
224 }
225 if(PIKCHR_PROCESS_DIV & pikFlags){
226 blob_append(pOut, "</div>\n", 7);
227 }
228 }else{
229
+12 -2
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207207
blob_append(pOut, zOut, -1);
208208
if(PIKCHR_PROCESS_DIV & pikFlags){
209209
blob_append(pOut, "</div>\n", 7);
210210
}
211211
if(PIKCHR_PROCESS_SRC & pikFlags){
212
- blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213
- blob_str(&bIn));
212
+ static int counter = 0;
213
+ ++counter;
214
+ blob_appendf(pOut, "<div class='pikchr-src'>"
215
+ "<pre id='pikchr-src-%d'>%h</pre>"
216
+ "<span class='hidden'>"
217
+ "<a href='%R/pikchrshow?fromSession' "
218
+ "class='pikchr-src-pikchrshow' target='_new-%d' "
219
+ "data-pikchrid='pikchr-src-%d' "
220
+ "title='Open this pikchr in /pikchrshow'"
221
+ ">&rarr; /pikchrshow</a></span>"
222
+ "</div>\n",
223
+ counter, blob_str(&bIn), counter, counter);
214224
}
215225
if(PIKCHR_PROCESS_DIV & pikFlags){
216226
blob_append(pOut, "</div>\n", 7);
217227
}
218228
}else{
219229
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213 blob_str(&bIn));
 
 
 
 
 
 
 
 
 
 
214 }
215 if(PIKCHR_PROCESS_DIV & pikFlags){
216 blob_append(pOut, "</div>\n", 7);
217 }
218 }else{
219
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 static int counter = 0;
213 ++counter;
214 blob_appendf(pOut, "<div class='pikchr-src'>"
215 "<pre id='pikchr-src-%d'>%h</pre>"
216 "<span class='hidden'>"
217 "<a href='%R/pikchrshow?fromSession' "
218 "class='pikchr-src-pikchrshow' target='_new-%d' "
219 "data-pikchrid='pikchr-src-%d' "
220 "title='Open this pikchr in /pikchrshow'"
221 ">&rarr; /pikchrshow</a></span>"
222 "</div>\n",
223 counter, blob_str(&bIn), counter, counter);
224 }
225 if(PIKCHR_PROCESS_DIV & pikFlags){
226 blob_append(pOut, "</div>\n", 7);
227 }
228 }else{
229
+12 -2
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207207
blob_append(pOut, zOut, -1);
208208
if(PIKCHR_PROCESS_DIV & pikFlags){
209209
blob_append(pOut, "</div>\n", 7);
210210
}
211211
if(PIKCHR_PROCESS_SRC & pikFlags){
212
- blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213
- blob_str(&bIn));
212
+ static int counter = 0;
213
+ ++counter;
214
+ blob_appendf(pOut, "<div class='pikchr-src'>"
215
+ "<pre id='pikchr-src-%d'>%h</pre>"
216
+ "<span class='hidden'>"
217
+ "<a href='%R/pikchrshow?fromSession' "
218
+ "class='pikchr-src-pikchrshow' target='_new-%d' "
219
+ "data-pikchrid='pikchr-src-%d' "
220
+ "title='Open this pikchr in /pikchrshow'"
221
+ ">&rarr; /pikchrshow</a></span>"
222
+ "</div>\n",
223
+ counter, blob_str(&bIn), counter, counter);
214224
}
215225
if(PIKCHR_PROCESS_DIV & pikFlags){
216226
blob_append(pOut, "</div>\n", 7);
217227
}
218228
}else{
219229
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 blob_appendf(pOut, "<pre class='pikchr-src'>%h</pre>\n",
213 blob_str(&bIn));
 
 
 
 
 
 
 
 
 
 
214 }
215 if(PIKCHR_PROCESS_DIV & pikFlags){
216 blob_append(pOut, "</div>\n", 7);
217 }
218 }else{
219
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -207,12 +207,22 @@
207 blob_append(pOut, zOut, -1);
208 if(PIKCHR_PROCESS_DIV & pikFlags){
209 blob_append(pOut, "</div>\n", 7);
210 }
211 if(PIKCHR_PROCESS_SRC & pikFlags){
212 static int counter = 0;
213 ++counter;
214 blob_appendf(pOut, "<div class='pikchr-src'>"
215 "<pre id='pikchr-src-%d'>%h</pre>"
216 "<span class='hidden'>"
217 "<a href='%R/pikchrshow?fromSession' "
218 "class='pikchr-src-pikchrshow' target='_new-%d' "
219 "data-pikchrid='pikchr-src-%d' "
220 "title='Open this pikchr in /pikchrshow'"
221 ">&rarr; /pikchrshow</a></span>"
222 "</div>\n",
223 counter, blob_str(&bIn), counter, counter);
224 }
225 if(PIKCHR_PROCESS_DIV & pikFlags){
226 blob_append(pOut, "</div>\n", 7);
227 }
228 }else{
229

Keyboard Shortcuts

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