Toggle display/edit of inline footnotes

Post here questions and problems related to oXygen frameworks/document types.
hatchjk
Posts: 16
Joined: Tue Nov 13, 2007 6:02 pm

Toggle display/edit of inline footnotes

Post by hatchjk » Thu Apr 04, 2019 11:14 pm

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

Radu
Posts: 6512
Joined: Fri Jul 09, 2004 5:18 pm

Re: Toggle display/edit of inline footnotes

Post by Radu » Fri Apr 05, 2019 10:45 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

hatchjk
Posts: 16
Joined: Tue Nov 13, 2007 6:02 pm

Re: Toggle display/edit of inline footnotes

Post by hatchjk » Fri Apr 05, 2019 5:02 pm

Radu,

This looks like a very elegant solution. Thank you!

Jeff

hatchjk
Posts: 16
Joined: Tue Nov 13, 2007 6:02 pm

Re: Toggle display/edit of inline footnotes

Post by hatchjk » Wed Apr 10, 2019 11:00 pm

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?

Radu
Posts: 6512
Joined: Fri Jul 09, 2004 5:18 pm

Re: Toggle display/edit of inline footnotes

Post by Radu » Thu Apr 11, 2019 2:00 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

hatchjk
Posts: 16
Joined: Tue Nov 13, 2007 6:02 pm

Re: Toggle display/edit of inline footnotes

Post by hatchjk » Thu Apr 11, 2019 5:02 pm

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

Radu
Posts: 6512
Joined: Fri Jul 09, 2004 5:18 pm

Re: Toggle display/edit of inline footnotes

Post by Radu » Fri Apr 12, 2019 8:54 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply