Loading plugins/apparat_critique/apparat_critique.js +9 −13 Original line number Diff line number Diff line Loading @@ -13,14 +13,15 @@ class ApparatPlugin extends Plugin{ document.querySelectorAll(".apparat-witnesses").forEach((e) => e.style.display = 'none'); return; } this.wrapLacunas(); this.showWitness("lem"); this.witnessTooltiping(); } showWitness(witnessClass) { document.querySelectorAll(".apparat").forEach((e) => e.style.display = 'none'); document.querySelectorAll("." + witnessClass).forEach((e) => e.style.display = 'inline'); this.hideLacunas(witnessClass); document.querySelectorAll(".lacuna, ." + witnessClass).forEach((e) => e.style.display = 'inline'); document.querySelectorAll(".lacuna" + "."+witnessClass).forEach((e) => e.style.display = 'none'); } witnessTooltiping() { Loading @@ -30,17 +31,11 @@ class ApparatPlugin extends Plugin{ }) } hideLacunas(witId) { /*masque les lacunas à partir des lacunaStarts - cherche la lacuneEnd correspondante - Si la lacunaEnd n'existe pas (elle se trouve dans un autre fragment), l'intégralité du texte suivant est masqué */ wrapLacunas() { document.querySelectorAll('.lacunaStart').forEach((lstart) => { if (lstart.getAttribute('data-lacuna-wit').indexOf('\#' + witId) > -1) { //on echappe les . et # de l'id cible de la lacunaEnd correspondante let searchedId = lstart.getAttribute('data-lacuna-synch');//.replace(/([#.])/g,'\\$1'); const wit = lstart.getAttribute('data-lacuna-wit').replace('#',''); console.log('wit->',wit); let searchedId = lstart.getAttribute('data-lacuna-synch'); console.log("searchedid ", searchedId); let endElement = document.getElementById(searchedId); console.log('traitement de la lacuna ' + lstart.getAttribute('id')); Loading @@ -50,10 +45,11 @@ class ApparatPlugin extends Plugin{ eltsBetween.forEach((elt) => { let span = document.createElement("span"); span.classList.add('generated_lacuna'); span.classList.add('lacuna'); span.classList.add(wit); span.append(elt.cloneNode(true)); elt.replaceWith(span); }) } }) Loading plugins/apparat_critique/apparat_critique.xsl +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,10 @@ For conditions of distribution and use, see the accompanying legal.txt file. </xsl:template> <xsl:template match="//tei:witDetail"> <xsl:apply-templates/> </xsl:template> <xsl:template match="//tei:lacunaStart | //tei:lacunaEnd"> <span> <xsl:attribute name='class'> Loading Loading
plugins/apparat_critique/apparat_critique.js +9 −13 Original line number Diff line number Diff line Loading @@ -13,14 +13,15 @@ class ApparatPlugin extends Plugin{ document.querySelectorAll(".apparat-witnesses").forEach((e) => e.style.display = 'none'); return; } this.wrapLacunas(); this.showWitness("lem"); this.witnessTooltiping(); } showWitness(witnessClass) { document.querySelectorAll(".apparat").forEach((e) => e.style.display = 'none'); document.querySelectorAll("." + witnessClass).forEach((e) => e.style.display = 'inline'); this.hideLacunas(witnessClass); document.querySelectorAll(".lacuna, ." + witnessClass).forEach((e) => e.style.display = 'inline'); document.querySelectorAll(".lacuna" + "."+witnessClass).forEach((e) => e.style.display = 'none'); } witnessTooltiping() { Loading @@ -30,17 +31,11 @@ class ApparatPlugin extends Plugin{ }) } hideLacunas(witId) { /*masque les lacunas à partir des lacunaStarts - cherche la lacuneEnd correspondante - Si la lacunaEnd n'existe pas (elle se trouve dans un autre fragment), l'intégralité du texte suivant est masqué */ wrapLacunas() { document.querySelectorAll('.lacunaStart').forEach((lstart) => { if (lstart.getAttribute('data-lacuna-wit').indexOf('\#' + witId) > -1) { //on echappe les . et # de l'id cible de la lacunaEnd correspondante let searchedId = lstart.getAttribute('data-lacuna-synch');//.replace(/([#.])/g,'\\$1'); const wit = lstart.getAttribute('data-lacuna-wit').replace('#',''); console.log('wit->',wit); let searchedId = lstart.getAttribute('data-lacuna-synch'); console.log("searchedid ", searchedId); let endElement = document.getElementById(searchedId); console.log('traitement de la lacuna ' + lstart.getAttribute('id')); Loading @@ -50,10 +45,11 @@ class ApparatPlugin extends Plugin{ eltsBetween.forEach((elt) => { let span = document.createElement("span"); span.classList.add('generated_lacuna'); span.classList.add('lacuna'); span.classList.add(wit); span.append(elt.cloneNode(true)); elt.replaceWith(span); }) } }) Loading
plugins/apparat_critique/apparat_critique.xsl +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,10 @@ For conditions of distribution and use, see the accompanying legal.txt file. </xsl:template> <xsl:template match="//tei:witDetail"> <xsl:apply-templates/> </xsl:template> <xsl:template match="//tei:lacunaStart | //tei:lacunaEnd"> <span> <xsl:attribute name='class'> Loading