Skip to content
Snippets Groups Projects
Commit 438097a8 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Changement de stratégie pour tinymce

parent 539dedaf
No related branches found
No related tags found
No related merge requests found
Pipeline #38113 passed
...@@ -9,7 +9,7 @@ use UnicaenAutoform\Entity\Db\Champ; ...@@ -9,7 +9,7 @@ use UnicaenAutoform\Entity\Db\Champ;
$options = ($champ->getOptions() !== null)??explode(';', $champ->getOptions()); $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> <div>
<?php if ($champ->getTexte() !== 'nil') : ?> <?php if ($champ->getTexte() !== 'nil') : ?>
<?php echo $champ->getLibelle(); ?>&nbsp;: <?php echo $champ->getLibelle(); ?>&nbsp;:
...@@ -52,35 +52,3 @@ $options = ($champ->getOptions() !== null)??explode(';', $champ->getOptions()); ...@@ -52,35 +52,3 @@ $options = ($champ->getOptions() !== null)??explode(';', $champ->getOptions());
margin-bottom : 10px; margin-bottom : 10px;
} }
</style> </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
...@@ -214,8 +214,41 @@ $qbottom = !((isset($options['raccourci-bottom']) and $options['raccourci-bottom ...@@ -214,8 +214,41 @@ $qbottom = !((isset($options['raccourci-bottom']) and $options['raccourci-bottom
$(document).ready(function() { $(document).ready(function() {
checkForEmpty(); checkForEmpty();
}); });
</script> </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> <style>
h3.categorie { h3.categorie {
border-bottom: 1px solid #31708f; border-bottom: 1px solid #31708f;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment