Open mdalmau opened 4 years ago
The current site presents an editorial annotation with a yellow icon that, when clicked, pops up the contents of the note: https://webapp1.dlib.indiana.edu/newton/mss/norm/ALCH00014/#anno_01.
The new site presents a pen/paper icon, when hover, presents the content of the notes, and when clicked, drops down to the note at the end of the document: http://possum.dlib.indiana.edu:8197/text/ALCH00014/normalized#anno_01-ref-1.
The new version works in that the reader is presented with a note when they hover over the link and when they click on the link, get taken down to the note -- just with a different icon and slightly different functionality.
Yes, a <ref>
whose @target
points to a <note>
is simply translated into an HTML <a>
whose @href
points to the HTML <div>
which is a rendition of the TEI <note>
. So the HTML follows the structure of the TEI.
But there are other TEI elements (namely <bibl>
citations) which are presented as popups that appear when you click on an icon.
The way the citations work is that the p5-to-html stylesheet renders the citation bibl
as an HTML a
pointing to the relevant part of the bibliography, but it also generates a snippet of HTML suitable for being displayed as a popup, and stores that snippet in a serialized form (i.e. as quoted HTML markup) as the value of the <a>
element's title
attribute. https://github.com/IUBLibTech/newton_chymistry/blob/master/xslt/p5-to-html.xsl#L450-L461
A later stage in the pipeline takes those hyperlinks (with the HTML in their title
attribute) and replaces them with HTML5 <details>
and <summary>
elements (i.e. popups). https://github.com/IUBLibTech/newton_chymistry/blob/master/xslt/lift-title-attributes-to-popups.xsl
It would be easy to do the same thing for any <ref>
which points to a <note>
by rendering the <ref>
as an HTML <a>
element whose title
attribute contained an HTML rendition of the linked note.
Note that that popup-creating stylesheet currently only performs the replacement for hyperlinks which have a title
attribute and were also generated from a TEI bibl
; i.e. if a[@class='tei-bibl'][@title]
. That would need to changed to something like a[@class=('tei-ref', 'tei-bibl')][@title]
to also do the job for ref
elements, or perhaps just a[starts-with(@title, '<')]
Thanks, @Conal-Tuohy, for the clarification. I personally don't think this needs to mimic the exact same functionality of the old/current site since it works, but I will be running through all the issues reported by the team.
Clicking on the icon for editorial annotations does not bring up a pop-up window, it takes you down to the back matter notes section of the manuscript. If you mouse over the note icon, it does show the text of the note, but I figure we want these note icons to work the way they do on the current site where if you click you get a pop up. Reported by Alex Wingate.