Commit 8cb4b4a7 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

Merge branch 'dev'

parents 08a37a1b fe603c57
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -184,14 +184,17 @@ declare
function max:getFullDocument($project, $doc, $search as xs:string ?, $focus as xs:string ?){
    let $docName := $doc || ".xml"
    let $xmlDoc := (doc(max.config:getProjectDBPath($project) || "/" || $docName)/*)[1]
    let $xml := 
    	<div id='text'>
        	{max.util:getTextHookFragment($project, $docName)}
            {$xmlDoc}
        </div>
    let $txml := max:transformEditionFragment($project, $xml, $doc)
    let $html := max.html:render(
            $project, "doc/" || $docName,
            <div>
                <div>{max.html:invokePluginXQueries($project, $docName, ())}</div>
                <div id='text'>
                    {max.util:getTextHookFragment($project, $docName)}
                    {max:transformEditionFragment($project, $xmlDoc, $docName)}
                </div>
                {$txml}
            </div>)
    return max:applySearchMarkup($html, $search, $focus)
};
+9 −13
Original line number Diff line number Diff line
@@ -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() {
@@ -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'));
@@ -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);
                })
            }
        })


+4 −0
Original line number Diff line number Diff line
@@ -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'>
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ echo 'Install Max Tei DEMO'
./MaX/tools/max.sh --d-tei
if [[ $OSTYPE == 'darwin'* ]]
then
  open -a http://localhost:4242/max_tei_demo
  open -a firefox http://localhost:4242/max_tei_demo
else
  firefox http://localhost:4242/max_tei_demo
fi