Page 1 of 1

Toggle display/edit of inline footnotes

Posted: Thu Apr 04, 2019 11:14 pm
by hatchjk
I've been tasked with an implementation challenge and I'd appreciate any suggestions. In a future specification of our content model, footnotes will be placed inline, at the point of reference, within the text. The footnotes in this code is the lds:footnote elements (there are two):

Code: Select all

<test>
<p>Another paragraph</p>
<p id="89e3951b-6739-4bab-a0d7-61930eab9ec7">Today I feel compelled to discuss with you a matter of great importance. Some weeks ago, I released a statement regarding a course correction for the name of the Church.<lds:footnote lds:id="9ae0ed0a-1ef1-440c-9924-21cba0017aa6"><lds:p lds:id="236a3dd9-1766-4a1b-9969-78b63d1c005a">“The Lord has impressed upon my mind the importance of the name He has revealed for His Church, even The Church of Jesus Christ of Latter-day Saints. We have work before us to bring ourselves in harmony with His will. In recent weeks, various Church leaders and departments have initiated the necessary steps to do so. Additional information about this important matter will be made available in the coming months” (Russell M. Nelson, in “<lds:a href="https://www.mormonnewsroom.org/article/name-of-the-church">The Name of the Church</lds:a>” [official statement, Aug. 16, 2018], mormonnewsroom.org).</lds:p></lds:footnote> I did this because the Lord impressed upon my mind the importance of the name He decreed for His Church, even The Church of Jesus Christ of Latter-day Saints.<lds:footnote lds:id="b1067924-aa2f-4680-b9bb-ed62ce70100b"><lds:p lds:id="945ca76c-8513-45bc-8274-ba7b5d2e3d5c">Preceding Presidents of the Church have made similar requests. For example, President George Albert Smith said: “Don’t let the Lord down by calling this the Mormon Church. He didn’t call it the Mormon Church” (in Conference Report, Apr. 1948, 160).</lds:p></lds:footnote></p>
<p>Another paragraph</p>
</test>
In Author, by default I need to suppress display of these footnotes to allow for normal proofing/editing of the main body of content. I also need to provide users a way to toggle display of the footnotes so they can be individually edited. Ideally, this toggle would be accomplished with some sort of button or link icon, rather than toggling activation of alternate CSS using the Styles menu. This solution would be needed in both Web Author and standalone XML Editor applications.

Interestingly, the footnotes are in a paragraph (html5 p element), and each footnote itself contains one or more paragraphs (bound to a proprietary namespace implementation).

Any suggestions for the best way to handle this? I don't need actual code, but rather some direction as to what part of the Author API might be best to extend.

Thanks,

Jeff

Re: Toggle display/edit of inline footnotes

Posted: Fri Apr 05, 2019 10:45 am
by Radu
Hi Jeff,

There is a demo here with a TEI document containing footnotes:

https://www.oxygenxml.com/oxygen-xml-we ... =Anonymous

The CSS for it is available here:

https://www.oxygenxml.com/oxygen-xml-we ... ss/all.css

You can open it in Oxygen using its "File->Open URL" dialog and then navigate in all the imported CSSs and see how that works.

Regards,
Radu

Re: Toggle display/edit of inline footnotes

Posted: Fri Apr 05, 2019 5:02 pm
by hatchjk
Radu,

This looks like a very elegant solution. Thank you!

Jeff

Re: Toggle display/edit of inline footnotes

Posted: Wed Apr 10, 2019 11:00 pm
by hatchjk
Quick follow-up question: We've never seen implementation of the :before selector receiving parameterization or constraint being passed to it, as you seem to be doing in the css for this demo (the "(101)" on :before):

Code: Select all

note:before(101) {
...
...
}
Is this implementation proprietary to Oxygen, and if so, do you have documentation?

Re: Toggle display/edit of inline footnotes

Posted: Thu Apr 11, 2019 2:00 pm
by Radu
Hi,

At some point those E:before(n) and E:after(n) selectors were defined in a working draft of the CSS level 3 specification. But they were removed from the draft. So Oxygen supports them, they are very useful and we'll continue to support them. But this is why we do not have much documentation about them, we relied on the CSS3 specification which changed and removed the description and examples for them. I will add an internal issue to document them and provide a few usage examples. In the meantime if you have any particular questions about using them we can help.

Regards,
Radu

Re: Toggle display/edit of inline footnotes

Posted: Thu Apr 11, 2019 5:02 pm
by hatchjk
Radu,

Thank you. What exactly does the n represent in these selectors? I see integer values used in your implementations. Can you provide just a quick run-down here?

Best,

Jeff

Re: Toggle display/edit of inline footnotes

Posted: Fri Apr 12, 2019 8:54 am
by Radu
Hi Jeff,

Applying this CSS:

Code: Select all

tag:before(2){
content:"a";
}

/* tag:before(1) is equivalent to tag:before */
tag:before(1){
content:"b";
}
tag{
content:"c";
}
/* tag:after(1) is equivalent to tag:after */
tag:after(1){
content:"d";
}
tag:after(2){
content:"e";
}
on this XML document:

Code: Select all

<<root>
<tag>content</tag>
</root>
yields in the Author visual editing mode:

abccontentde

Regards,
Radu