Commit 438097a8 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Changement de stratégie pour tinymce

parent 539dedaf
Loading
Loading
Loading
Loading
Loading
+1 −33
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ use UnicaenAutoform\Entity\Db\Champ;
$options = ($champ->getOptions() !== null)??explode(';', $champ->getOptions());
?>

<?php if (in_array('non modifiable', $options)) : ?>
<?php if (is_array($options) AND in_array('non modifiable', $options)) : ?>
    <div>
        <?php if ($champ->getTexte() !== 'nil') : ?>
            <?php echo $champ->getLibelle(); ?>&nbsp;:
@@ -52,35 +52,3 @@ $options = ($champ->getOptions() !== null)??explode(';', $champ->getOptions());
        margin-bottom : 10px;
    }
</style>

<script>
    $(document).ready(function() {

        tinymce.remove();
        tinymce.init({
            selector: '.autoform-textarea',
            toolbar: 'newdocument undo redo | bold italic underline removeformat | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck : true,
            branding: false,
            menu: {},
            menubar: false,
            body_id: 'textarea_<?php echo $champ->getId(); ?>',
            setup: function (editor) {
                 editor.on("focusout", function () {
                     let id = $(this).attr('id');
                     // console.log(id);
                     $('#'+id).text(tinymce.get(id).getContent());
                     // console.log(tinymce.get(id).getContent());
                     // console.log($('#'+id).text());
                    checkForEmpty();
                 });
            }
        });
    });


</script>
 No newline at end of file
+33 −0
Original line number Diff line number Diff line
@@ -214,8 +214,41 @@ $qbottom = !((isset($options['raccourci-bottom']) and $options['raccourci-bottom
    $(document).ready(function() {
        checkForEmpty();
    });


</script>

<script>
    $(document).ready(function() {

        tinymce.remove();
        tinymce.init({
            selector: '.autoform-textarea',
            toolbar: 'newdocument undo redo | bold italic underline removeformat | bullist',
            resize: true,
            language: 'fr_FR',
            plugins: 'lists',
            statusbar: true,
            browser_spellcheck : true,
            branding: false,
            menu: {},
            menubar: false,
            body_id: 'textarea_<?php echo $champ->getId(); ?>',
            setup: function (editor) {
                editor.on("focusout", function () {
                    let id = $(this).attr('id');
                    // console.log(id);
                    $('#'+id).text(tinymce.get(id).getContent());
                    // console.log(tinymce.get(id).getContent());
                    // console.log($('#'+id).text());
                    checkForEmpty();
                });
            }
        });
    });


</script>
<style>
    h3.categorie {
        border-bottom: 1px solid #31708f;