Skip to content

Commit

Permalink
add tooltips to first set of symbols #378
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Sep 6, 2022
1 parent 24bc5f2 commit 9546cef
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
5 changes: 4 additions & 1 deletion catalogues/dictionary_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -651,4 +651,7 @@
<entry xml:id="linesSg">Zeile</entry>
<entry xml:id="approx">ca.</entry>
<entry xml:id="supplied">ergänzt von den Herausgeber:innen</entry>
</dictionary>
<entry xml:id="&#402;">Gulden (Florin)</entry>
<entry xml:id="&#9711;">Circularsymbol</entry>
<entry xml:id="&#2114;">Pfund (Gewichtsmaß)</entry>
</dictionary>
5 changes: 4 additions & 1 deletion catalogues/dictionary_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -621,4 +621,7 @@
<entry xml:id="linesSg">line</entry>
<entry xml:id="approx">approx.</entry>
<entry xml:id="supplied">supplied by the editors</entry>
</dictionary>
<entry xml:id="&#402;">Guilder (Florin)</entry>
<entry xml:id="&#9711;">Circular letter symbol</entry>
<entry xml:id="&#2114;">Pound (mass)</entry>
</dictionary>
3 changes: 2 additions & 1 deletion resources/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,9 @@ function updatePage(params) {

/* activate tooltips for jubilees on start page
* as well as for Julian dates on person pages
* and symbols elsewhere in texts
*/
$('.jubilee, .jul').tooltip();
$('.jubilee, .jul, .symbol').tooltip();

/* Initialise select2 plugin for facets on index pages */
$('.allFilter select').facets();
Expand Down
12 changes: 11 additions & 1 deletion xsl/common_main.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<!-- <xsl:variable name="optionsFile" select="'/db/webapp/xml/wegaOptions.xml'"/>-->
<xsl:variable name="blockLevelElements" as="xs:string+" select="('p', 'list', 'table')"/>
<xsl:variable name="musical-symbols" as="xs:string" select="'[&#x1d100;-&#x1d1ff;♭-♯]+'"/>
<xsl:variable name="symbols" as="xs:string">[&#9711;&#402;&#2114;]</xsl:variable>
<xsl:variable name="fa-exclamation-circle" as="xs:string" select="'&#xf06a;'"/>
<xsl:param name="optionsFile"/>
<xsl:param name="baseHref"/>
Expand Down Expand Up @@ -211,7 +212,7 @@
<xsl:template match="tei:lb[(following-sibling::text()[not(functx:all-whitespace(.))] | following-sibling::*)[1] = following-sibling::tei:signed[@rend]]" priority="0.6"/>

<xsl:template match="text()" mode="#all">
<xsl:variable name="regex" select="string-join((&#34;'&#34;, $musical-symbols, $fa-exclamation-circle), '|')"/>
<xsl:variable name="regex" select="string-join((&#34;'&#34;, $musical-symbols, $fa-exclamation-circle, $symbols), '|')"/>
<xsl:analyze-string select="." regex="{$regex}">
<xsl:matching-substring>
<!-- Ersetzen von Pfundzeichen in Bild -->
Expand All @@ -238,6 +239,15 @@
<xsl:attribute name="aria-hidden" select="'true'"/>
</xsl:element>
</xsl:if>
<xsl:if test="matches(., $symbols)">
<xsl:element name="span">
<xsl:attribute name="title" select="wega:getLanguageString(., $lang)"/>
<xsl:attribute name="data-toggle">tooltip</xsl:attribute>
<xsl:attribute name="tabindex">0</xsl:attribute>
<xsl:attribute name="class">symbol</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
</xsl:if>
</xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="."/>
Expand Down

0 comments on commit 9546cef

Please sign in to comment.