Loading resources/javascript/xml_2_html.js +16 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ window.addEventListener('DOMContentLoaded', (event) => { initializeCollapsibleLists(); // open new windows //openFigureWindow(); openFigureWindow(elementId); //toc hightlighing on scroll document.querySelector('.left-contents').addEventListener("scroll", () => { Loading Loading @@ -160,20 +160,26 @@ function scrollToElementById(elementId) { for (let i = 0; i<figTables.length; i++ ) { let labels = figTables[i].getElementsByTagName("label"); let expand = figTables[i].getElementsByClassName("expand"); labels[0].setAttribute('onclick', "afficheTableau('"+i+"');"); expand[0].setAttribute('onclick', "afficheTableau('"+i+"');"); } } function afficheTableau(numero) { let tableCourante = figTables[numero].getElementsByTagName("table")[0]; let label = figTables[numero].getElementsByTagName("label")[0]; let triangle = figTables[numero].getElementsByClassName("expand")[0]; if (tableCourante.style.display === 'none' || tableCourante.style.display === '') { tableCourante.style.display = 'table'; tableCourante.style.backgroundColor = 'white'; triangle.textContent = "▾"; } else { tableCourante.style.display = 'none'; triangle.textContent = "▸"; } } Loading Loading @@ -228,7 +234,8 @@ function openFigureWindow(elementId) { margin: 25px 0px; } label {background-color: #454545;width:90%;} table { span.expand {display:none;} table, img { max-width:90% } td,th { Loading Loading @@ -266,6 +273,13 @@ function openFigureWindow(elementId) { // Clone the element to the new window's document const clonedElement = elementToClone.cloneNode(true); // Ensure that the cloned table is always visible const tableInClone = clonedElement.querySelector('table'); if (tableInClone) { // If a table exists, set its display style to 'table' tableInClone.style.display = 'table'; } // Append the cloned element to the new window's document body newWindowDocument.body.appendChild(clonedElement); } Loading resources/styles/xml_2_html.css +27 −3 Original line number Diff line number Diff line Loading @@ -258,8 +258,6 @@ img { .fig-call-window, .fig-call-window a, .fig-call-window a:visited, /*.figure-call .table-call,*/ .table-call-window, .table-call-window a, .table-call-window a:visited { Loading @@ -269,12 +267,18 @@ img { .table-call-window { position: relative; /* background-color: red;*/ top: -10px; left: 355px; margin-top: -26px; } /* right pane */ div[id='figures'] figure { border-bottom:1px solid var(--grey-color); padding-bottom: 30px; background-color: inherit; } /****** formula ******/ .fig-formula { background-color:white; Loading Loading @@ -312,6 +316,26 @@ td,th { padding: 10px; margin: 0; cursor: pointer; padding-left: 1em; max-width: 80%; } .expand { color: var(--third-color); text-decoration: none; position: relative; right: 45%; top: 37px; margin-top: -27px; } span[class='expand empty'] { color: var(--third-color); text-decoration: none; position: relative; right: 45%; top: 20px; margin-top: -27px; } .credits { Loading tei2html.xsl +25 −1 Original line number Diff line number Diff line Loading @@ -544,6 +544,22 @@ </img> </xsl:template> <xsl:template match="tei:graphic[parent::tei:figure[not(child::tei:head)]]"> <label class="generated"> <span class="fig-call" data-target="{parent::tei:figure/@xml:id}">[Ill.]</span> <span class="fig-call-window"> <a href="#" id="openFigureLink"> <xsl:attribute name="onclick"> <xsl:value-of select='concat("openFigureWindow('",parent::tei:figure/@xml:id,"')")'/> </xsl:attribute> <xsl:text> ↗ </xsl:text> </a> </span> </label> </xsl:template> <xsl:template match="tei:p[@rend='caption' or @rend='credits']"> <p class="{@rend}"> <xsl:apply-templates/> Loading @@ -559,10 +575,18 @@ <xsl:template match="tei:table"> <xsl:if test="parent::tei:figure/tei:head"> <span class="expand"><xsl:text>▸ </xsl:text></span> <label><!--span class="table-call"><xsl:text> ↓ </xsl:text></span--><xs:apply-templates select="parent::tei:figure/tei:head" mode="titleUp"/><!--span class="table-call"><xsl:text> ↓ </xsl:text></span--></label> <span class="table-call-window"><a href="#" id="openFigureLink"> <xsl:attribute name="onclick"><xsl:value-of select='concat("openFigureWindow('main-",parent::tei:figure/@xml:id,"')")'/></xsl:attribute> <!-- ="openFigureWindow('main-figure1')">--> <xsl:text> ↗ </xsl:text></a></span> </xsl:if> <xsl:if test="parent::tei:figure[not(child::tei:head)]"> <span class="expand empty"><xsl:text>▸ </xsl:text> </span> <label class="generated"/> <span class="table-call-window"><a href="#" id="openFigureLink"> <xsl:attribute name="onclick"><xsl:value-of select='concat("openFigureWindow('main-",parent::tei:figure/@xml:id,"')")'/></xsl:attribute> <xsl:text> ↗ </xsl:text></a></span> </xsl:if> <table> Loading Loading
resources/javascript/xml_2_html.js +16 −2 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ window.addEventListener('DOMContentLoaded', (event) => { initializeCollapsibleLists(); // open new windows //openFigureWindow(); openFigureWindow(elementId); //toc hightlighing on scroll document.querySelector('.left-contents').addEventListener("scroll", () => { Loading Loading @@ -160,20 +160,26 @@ function scrollToElementById(elementId) { for (let i = 0; i<figTables.length; i++ ) { let labels = figTables[i].getElementsByTagName("label"); let expand = figTables[i].getElementsByClassName("expand"); labels[0].setAttribute('onclick', "afficheTableau('"+i+"');"); expand[0].setAttribute('onclick', "afficheTableau('"+i+"');"); } } function afficheTableau(numero) { let tableCourante = figTables[numero].getElementsByTagName("table")[0]; let label = figTables[numero].getElementsByTagName("label")[0]; let triangle = figTables[numero].getElementsByClassName("expand")[0]; if (tableCourante.style.display === 'none' || tableCourante.style.display === '') { tableCourante.style.display = 'table'; tableCourante.style.backgroundColor = 'white'; triangle.textContent = "▾"; } else { tableCourante.style.display = 'none'; triangle.textContent = "▸"; } } Loading Loading @@ -228,7 +234,8 @@ function openFigureWindow(elementId) { margin: 25px 0px; } label {background-color: #454545;width:90%;} table { span.expand {display:none;} table, img { max-width:90% } td,th { Loading Loading @@ -266,6 +273,13 @@ function openFigureWindow(elementId) { // Clone the element to the new window's document const clonedElement = elementToClone.cloneNode(true); // Ensure that the cloned table is always visible const tableInClone = clonedElement.querySelector('table'); if (tableInClone) { // If a table exists, set its display style to 'table' tableInClone.style.display = 'table'; } // Append the cloned element to the new window's document body newWindowDocument.body.appendChild(clonedElement); } Loading
resources/styles/xml_2_html.css +27 −3 Original line number Diff line number Diff line Loading @@ -258,8 +258,6 @@ img { .fig-call-window, .fig-call-window a, .fig-call-window a:visited, /*.figure-call .table-call,*/ .table-call-window, .table-call-window a, .table-call-window a:visited { Loading @@ -269,12 +267,18 @@ img { .table-call-window { position: relative; /* background-color: red;*/ top: -10px; left: 355px; margin-top: -26px; } /* right pane */ div[id='figures'] figure { border-bottom:1px solid var(--grey-color); padding-bottom: 30px; background-color: inherit; } /****** formula ******/ .fig-formula { background-color:white; Loading Loading @@ -312,6 +316,26 @@ td,th { padding: 10px; margin: 0; cursor: pointer; padding-left: 1em; max-width: 80%; } .expand { color: var(--third-color); text-decoration: none; position: relative; right: 45%; top: 37px; margin-top: -27px; } span[class='expand empty'] { color: var(--third-color); text-decoration: none; position: relative; right: 45%; top: 20px; margin-top: -27px; } .credits { Loading
tei2html.xsl +25 −1 Original line number Diff line number Diff line Loading @@ -544,6 +544,22 @@ </img> </xsl:template> <xsl:template match="tei:graphic[parent::tei:figure[not(child::tei:head)]]"> <label class="generated"> <span class="fig-call" data-target="{parent::tei:figure/@xml:id}">[Ill.]</span> <span class="fig-call-window"> <a href="#" id="openFigureLink"> <xsl:attribute name="onclick"> <xsl:value-of select='concat("openFigureWindow('",parent::tei:figure/@xml:id,"')")'/> </xsl:attribute> <xsl:text> ↗ </xsl:text> </a> </span> </label> </xsl:template> <xsl:template match="tei:p[@rend='caption' or @rend='credits']"> <p class="{@rend}"> <xsl:apply-templates/> Loading @@ -559,10 +575,18 @@ <xsl:template match="tei:table"> <xsl:if test="parent::tei:figure/tei:head"> <span class="expand"><xsl:text>▸ </xsl:text></span> <label><!--span class="table-call"><xsl:text> ↓ </xsl:text></span--><xs:apply-templates select="parent::tei:figure/tei:head" mode="titleUp"/><!--span class="table-call"><xsl:text> ↓ </xsl:text></span--></label> <span class="table-call-window"><a href="#" id="openFigureLink"> <xsl:attribute name="onclick"><xsl:value-of select='concat("openFigureWindow('main-",parent::tei:figure/@xml:id,"')")'/></xsl:attribute> <!-- ="openFigureWindow('main-figure1')">--> <xsl:text> ↗ </xsl:text></a></span> </xsl:if> <xsl:if test="parent::tei:figure[not(child::tei:head)]"> <span class="expand empty"><xsl:text>▸ </xsl:text> </span> <label class="generated"/> <span class="table-call-window"><a href="#" id="openFigureLink"> <xsl:attribute name="onclick"><xsl:value-of select='concat("openFigureWindow('main-",parent::tei:figure/@xml:id,"')")'/></xsl:attribute> <xsl:text> ↗ </xsl:text></a></span> </xsl:if> <table> Loading