Commit 57b30421 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Fix pbs

parent be50e701
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ class QuestionForm extends Form {
            ],
            'attributes' => [
                'id' => 'description',
                'class' => "type2",
                'class' => "tinymce",
            ],
        ]);
        //ordre
+16 −26
Original line number Diff line number Diff line
@@ -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,
@@ -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();