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 Jan 15, 2021
1 parent 6abb6d0 commit 89b8fce
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions catalogues/dictionary_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -605,4 +605,7 @@
<entry xml:id="external">extern</entry>
<entry xml:id="without">ohne</entry>
<entry xml:id="mei_notesStmt">Bemerkungen</entry>
<entry xml:id="&#402;">Gulden (Florin)</entry>
<entry xml:id="&#9711;">Circularsymbol</entry>
<entry xml:id="&#2114;">Pfund (Gewichtsmaß)</entry>
</dictionary>
3 changes: 3 additions & 0 deletions catalogues/dictionary_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -575,4 +575,7 @@
<entry xml:id="external">external</entry>
<entry xml:id="without">without</entry>
<entry xml:id="mei_notesStmt">Remarks</entry>
<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 @@ -770,8 +770,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 89b8fce

Please sign in to comment.