Skip to content

Commit

Permalink
icon for sources, link from sources
Browse files Browse the repository at this point in the history
  • Loading branch information
pboot committed Sep 1, 2021
1 parent 6a00282 commit 14cf079
Show file tree
Hide file tree
Showing 4 changed files with 451 additions and 297 deletions.
33 changes: 25 additions & 8 deletions edition source code/createhtml.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<xsl:output method="html"/>

<xsl:key name="source" match="hi:source[ancestor::tei:gloss]" use="@target"/>
<xsl:key name="source" match="hi:source[ancestor::tei:gloss[not(starts-with(@xml:id,'L0'))]]" use="@target"/>
<xsl:key name="glossGrp" match="hi:glossGrp" use="hi:removehash(@target)"/>
<xsl:key name="interp" match="tei:interp[parent::tei:interpGrp[@type='clusters']]" use="@xml:id"/>
<xsl:key name="language" match="tei:interp[parent::tei:interpGrp[@xml:id='lang']]" use="@xml:id"/>
Expand Down Expand Up @@ -368,11 +368,11 @@
</div>
</body>
</html>
<xsl:for-each select="//tei:div[@type='chapter']">
<xsl:for-each select="$preprocess//tei:div[@type='chapter']">
<xsl:apply-templates select="." mode="text"/>
<xsl:apply-templates select="." mode="gloss"/>
</xsl:for-each>
<xsl:apply-templates select="//tei:msDesc" mode="msgloss"/>
<xsl:apply-templates select="$preprocess//tei:msDesc" mode="msgloss"/>
</xsl:template>

<xsl:template match="@*|node()" mode="copy" priority="2">
Expand Down Expand Up @@ -410,7 +410,7 @@
<input type="checkbox" id="unclustonoffc" name="unclustonoffc" value="unclustonoffc" onclick="funclustonoff('c')"/>
<label for="unclustonoff"> Turn off display of isolated glosses?</label>
</p>
<xsl:apply-templates select=".//tei:seg" mode="gloss">
<xsl:apply-templates select=".//tei:seg[@type='lemma']" mode="gloss">
<xsl:with-param name="mode" select="'chapmode'" tunnel="yes"/>
</xsl:apply-templates>
</xsl:result-document>
Expand Down Expand Up @@ -448,7 +448,19 @@
<xsl:text>Language: </xsl:text>
<xsl:apply-templates select="key('language',@xml:lang)"/>
</xsl:attribute>
<img class="stylus" src="pics/language.svg" width="15px" heighth="15px"/></span>
<img class="stylus" src="pics/language.svg" width="15px" heighth="15px"/>
</span>
</xsl:if>
<xsl:if test="hi:source">
<xsl:for-each select="hi:source">
<span>
<xsl:attribute name="title">
<xsl:text>Source: </xsl:text>
<xsl:apply-templates select="key('bibl',hi:removehash(@target))/node()"/>
</xsl:attribute>
<img class="stylus" src="pics/open-book.svg" width="15px" heighth="15px"/>
</span>
</xsl:for-each>
</xsl:if>
</td>
<td class="glossnote">
Expand Down Expand Up @@ -552,7 +564,7 @@
<xsl:value-of select="@n"/>
</span>
</h4>
<xsl:apply-templates select=".//tei:seg" mode="gloss">
<xsl:apply-templates select=".//tei:seg[@type='lemma']" mode="gloss">
<xsl:with-param name="mode" select="'msmode'" tunnel="yes"/>
</xsl:apply-templates>
</xsl:template>
Expand Down Expand Up @@ -583,7 +595,12 @@
<xsl:apply-templates mode="source"/>
<xsl:text> (occurs: </xsl:text>
<xsl:for-each select="key('source',hi:addhash(@xml:id))">
<xsl:value-of select="hi:removehash(ancestor::hi:glossGrp/@target)"/>
<a href="{hi:addhash(hi:nodeid(ancestor::hi:glossGrp))}">
<xsl:attribute name="onclick">
<xsl:text>openhash();</xsl:text>
</xsl:attribute>
<xsl:value-of select="hi:removehash(ancestor::hi:glossGrp/@target)"/>
</a>
<xsl:if test="not(position() = last())">
<xsl:text>, </xsl:text>
</xsl:if>
Expand Down Expand Up @@ -752,7 +769,7 @@
<span class="suplink">
<a href="{concat('#',hi:nodeid(key('glossGrp',@xml:id)))}">
<xsl:attribute name="onclick">
<xsl:text>globalThis.useraction = true; gotolemma('</xsl:text>
<xsl:text>globalThis.useraction = true; gotochapgloss('</xsl:text>
<xsl:value-of select="ancestor::tei:div[@type='chapter']/@n"/>
<xsl:text>',true);</xsl:text>
</xsl:attribute>g</a>
Expand Down
78 changes: 42 additions & 36 deletions edition source code/isidore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,51 @@ window.onhashchange = function(){ // handling back and forward buttons
if (globalThis.useraction) {
globalThis.useraction = false;
} else {
switch (true) {
case (window.location.hash.startsWith('#left-')):
openlefttab(window.location.hash.substring(6),'',false)
break;
case (window.location.hash.startsWith('#right-')):
win = window.location.hash.substring(7);
if (document.getElementById(win).style.display == "none"){
openisitab(win,false);
}
break;
case (window.location.hash.startsWith('#network-')):
if (document.getElementById('network').style.display == "none"){
openisitab('network',false)
openhash();
}
}

function openhash() {
switch (true) {
case (window.location.hash.startsWith('#left-')):
openlefttab(window.location.hash.substring(6),'',false)
break;
case (window.location.hash.startsWith('#right-')):
win = window.location.hash.substring(7);
if (document.getElementById(win).style.display == "none"){
openisitab(win,false);
}
break;
case (window.location.hash.startsWith('#network-')):
if (document.getElementById('network').style.display == "none"){
openisitab('network',false)
}
win = window.location.hash.substring(9);
if (globalThis.networktype != win) {
setTimeout(function () {
creategraph(win,true,false)},250);
}
win = window.location.hash.substring(9);
if (globalThis.networktype != win) {
setTimeout(function () {
creategraph(win,true,false)},250);
}
break;
case (window.location.hash.startsWith('#msdesc-')):
openlefttab('msdesc','',false);
break;
case (window.location.hash.startsWith('#msstats-')):
openlefttab('msstats','',false);
break;
case (window.location.hash.startsWith('#glossms-')):
openmsgloss(window.location.hash.substring(9), false)
break;
case (window.location.hash.startsWith('#gg_L')):
t1 = window.location.hash.substring(5);
t2 = t1.substring(0,t1.indexOf('.'));
chap = romanize(parseInt(t2));
gotolemma(chap);
break;
}
break;
case (window.location.hash.startsWith('#msdesc-')):
openlefttab('msdesc','',false);
break;
case (window.location.hash.startsWith('#msstats-')):
openlefttab('msstats','',false);
break;
case (window.location.hash.startsWith('#glossms-')):
openmsgloss(window.location.hash.substring(9), false)
break;
case (window.location.hash.startsWith('#gg_L')):
t1 = window.location.hash.substring(5);
t2 = t1.substring(0,t1.indexOf('.'));
chap = romanize(parseInt(t2));
openchapgloss(chap);
break;
}
}



window.onload = function () {
currmss = JSON.parse(JSON.stringify(msslist));
currclust = JSON.parse(JSON.stringify(clustlist));
Expand Down Expand Up @@ -369,7 +375,7 @@ function openmsgloss(msid,sethash) {
openisitab('manuscripts',sethash)
}

function gotolemma(chap){
function openchapgloss(chap){
if (document.getElementById('gloss'+chap) == null){
fetch('htmlfrag/gloss' + chap + '.html').then(function (response) {
return response.text();
Expand Down
97 changes: 97 additions & 0 deletions pics/open-book.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 14cf079

Please sign in to comment.