Loading src/UnicaenAide/Form/Documentation/Lien/LienForm.php +1 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ class LienForm extends Form { 'lien_url' => [ 'required' => true, ], 'description' => [ 'required' => false, ], 'ordre' => [ 'required' => false, ], 'roles' => [ 'required' => false, ], ])); } } No newline at end of file src/UnicaenAide/Form/Faq/Question/QuestionForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class QuestionForm extends Form { ], 'attributes' => [ 'id' => 'description', 'class' => "type2", 'class' => "tinymce", ], ]); //ordre Loading view/unicaen-aide/default/default-form.phtml +16 −26 Original line number Diff line number Diff line Loading @@ -12,13 +12,16 @@ use Laminas\Form\Form; <script> $(document).ready(function () { //$('select').select2(); tinymce.remove(); tinymce.init({ selector: '.type2', toolbar: 'newdocument undo redo | bold italic underline removeformat | bullist | highlight', selector: '.tinymce', toolbar: 'newdocument undo redo | bold italic underline removeformat | bullist numlist | link', resize: true, language: 'fr_FR', plugins: 'lists', entity_encoding: "raw", plugins: 'lists link', statusbar: true, browser_spellcheck: true, branding: false, Loading @@ -29,28 +32,15 @@ use Laminas\Form\Form; console.log(tinymce.get('description').getContent()); $('textarea').val(tinymce.get('description').getContent()); }); editor.addButton('highlight', { text: '', icon: 'codesample', title: 'Définition', onclick: function () { let content = editor.selection.getContent(); if (content !== '') { let new_content = ""; let regex = /<abbr title="">.*<\/abbr>/g; let found = content.match(regex); if (found) { new_content = content.replace('</abbr>', ''); new_content = new_content.replace('<abbr title="">', ''); } else { new_content = '<abbr title="">' + content + '</abbr>'; } editor.insertContent(new_content); } } }); document.addEventListener('focusin', (e) => { if (e.target.closest(".tox-tinymce-aux, .moxman-window, .tam-assetmanager-root") !== null) { e.stopImmediatePropagation(); } }); }); $('select').selectpicker(); Loading Loading
src/UnicaenAide/Form/Documentation/Lien/LienForm.php +1 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,7 @@ class LienForm extends Form { 'lien_url' => [ 'required' => true, ], 'description' => [ 'required' => false, ], 'ordre' => [ 'required' => false, ], 'roles' => [ 'required' => false, ], ])); } } No newline at end of file
src/UnicaenAide/Form/Faq/Question/QuestionForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ class QuestionForm extends Form { ], 'attributes' => [ 'id' => 'description', 'class' => "type2", 'class' => "tinymce", ], ]); //ordre Loading
view/unicaen-aide/default/default-form.phtml +16 −26 Original line number Diff line number Diff line Loading @@ -12,13 +12,16 @@ use Laminas\Form\Form; <script> $(document).ready(function () { //$('select').select2(); tinymce.remove(); tinymce.init({ selector: '.type2', toolbar: 'newdocument undo redo | bold italic underline removeformat | bullist | highlight', selector: '.tinymce', toolbar: 'newdocument undo redo | bold italic underline removeformat | bullist numlist | link', resize: true, language: 'fr_FR', plugins: 'lists', entity_encoding: "raw", plugins: 'lists link', statusbar: true, browser_spellcheck: true, branding: false, Loading @@ -29,28 +32,15 @@ use Laminas\Form\Form; console.log(tinymce.get('description').getContent()); $('textarea').val(tinymce.get('description').getContent()); }); editor.addButton('highlight', { text: '', icon: 'codesample', title: 'Définition', onclick: function () { let content = editor.selection.getContent(); if (content !== '') { let new_content = ""; let regex = /<abbr title="">.*<\/abbr>/g; let found = content.match(regex); if (found) { new_content = content.replace('</abbr>', ''); new_content = new_content.replace('<abbr title="">', ''); } else { new_content = '<abbr title="">' + content + '</abbr>'; } editor.insertContent(new_content); } } }); document.addEventListener('focusin', (e) => { if (e.target.closest(".tox-tinymce-aux, .moxman-window, .tam-assetmanager-root") !== null) { e.stopImmediatePropagation(); } }); }); $('select').selectpicker(); Loading