Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
pdn-certic
MaX
Commits
fe603c57
Commit
fe603c57
authored
Apr 29, 2022
by
Jerome Chauveau
Browse files
Merge branch 'ag/pluginApparat' into 'dev'
correctif pour lacuna du plugin apparat See merge request pdn-certic/MaX!84
parents
f18a6530
d329cb01
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/apparat_critique/apparat_critique.js
View file @
fe603c57
...
...
@@ -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
);
})
}
})
...
...
plugins/apparat_critique/apparat_critique.xsl
View file @
fe603c57
...
...
@@ -38,6 +38,10 @@ For conditions of distribution and use, see the accompanying legal.txt file.
</span>
</xsl:template>
<xsl:template
match=
"//tei:witDetail"
>
<xsl:apply-templates/>
</xsl:template>
<xsl:template
match=
"//tei:lacunaStart | //tei:lacunaEnd"
>
<span>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment