Loading src/UnicaenAide/View/Helper/partial/dictionnaire.phtml +12 −2 Original line number Diff line number Diff line Loading @@ -45,12 +45,22 @@ $useHistorisee = (isset($options['historise']) AND $options['historise'] === tru ?> <?php endforeach; ?> function stripAbbr(html) { // let tmp = document.createElement("DIV"); // tmp.innerHTML = html; // return tmp.textContent || tmp.innerText || ""; let txt = html.replace(/(<([^>]+)>)/gi, ""); return txt; } function display_definition(text) { let definition = dictionnary[text.toLowerCase()]; if (definition === undefined) { definition = "Aucune définition pour ce terme."; // return text; } return "<abbr title='"+definition+"' data-toggle='tooltip' data-html='true'>" + text + "</abbr>"; let stripped = stripAbbr(definition); return stripped; } </script> No newline at end of file view/unicaen-aide/glossaire/afficher.phtml +4 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ $this->headTitle("Glossaire"); <script> $("abbr").each(function() { $(this).html(display_definition($(this).text())); let text = display_definition($(this).text()); $(this).attr('data-bs-title', text); $(this).attr('data-bs-toggle', 'tooltip'); $(this).attr('data-bs-html', true); }); </script> No newline at end of file Loading
src/UnicaenAide/View/Helper/partial/dictionnaire.phtml +12 −2 Original line number Diff line number Diff line Loading @@ -45,12 +45,22 @@ $useHistorisee = (isset($options['historise']) AND $options['historise'] === tru ?> <?php endforeach; ?> function stripAbbr(html) { // let tmp = document.createElement("DIV"); // tmp.innerHTML = html; // return tmp.textContent || tmp.innerText || ""; let txt = html.replace(/(<([^>]+)>)/gi, ""); return txt; } function display_definition(text) { let definition = dictionnary[text.toLowerCase()]; if (definition === undefined) { definition = "Aucune définition pour ce terme."; // return text; } return "<abbr title='"+definition+"' data-toggle='tooltip' data-html='true'>" + text + "</abbr>"; let stripped = stripAbbr(definition); return stripped; } </script> No newline at end of file
view/unicaen-aide/glossaire/afficher.phtml +4 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ $this->headTitle("Glossaire"); <script> $("abbr").each(function() { $(this).html(display_definition($(this).text())); let text = display_definition($(this).text()); $(this).attr('data-bs-title', text); $(this).attr('data-bs-toggle', 'tooltip'); $(this).attr('data-bs-html', true); }); </script> No newline at end of file