diff --git a/application/views/Studentenverwaltung.php b/application/views/Studentenverwaltung.php index 613a40abe..4fbc0fecd 100644 --- a/application/views/Studentenverwaltung.php +++ b/application/views/Studentenverwaltung.php @@ -8,6 +8,7 @@ #'primevue3' => true, #'filtercomponent' => true, 'tabulator5' => true, + 'tinymce5' => true, 'phrases' => [], 'customCSSs' => [ 'public/css/components/vue-datepicker.css', diff --git a/public/js/components/Notiz/Notiz.js b/public/js/components/Notiz/Notiz.js index 0882b41b5..f1aa63280 100644 --- a/public/js/components/Notiz/Notiz.js +++ b/public/js/components/Notiz/Notiz.js @@ -1,7 +1,7 @@ import VueDatePicker from '../vueDatepicker.js.php'; -import tinymce from '../tinymce.js.php'; import PvAutoComplete from "../../../../index.ci.php/public/js/components/primevue/autocomplete/autocomplete.esm.min.js"; import File from '../Form/Upload/File.js'; +import FormUploadDms from '../Form/Upload/Dms.js'; import {CoreRESTClient} from "../../RESTClient"; export default { @@ -9,12 +9,12 @@ export default { VueDatePicker, File, PvAutoComplete, - tinymce + FormUploadDms }, props: [ 'typeId', 'titel', - 'text', + 'propText', 'lastChange', 'von', 'bis', @@ -32,6 +32,7 @@ export default { multiupload: true, mitarbeiter: [], filteredMitarbeiter: [], + zwischenvar: null } }, computed: { @@ -51,6 +52,14 @@ export default { this.$emit('update:text', value); } }, +/* intPropText: { + get() { + return this.propText; + }, + set(value) { + this.$emit('update:propText', value); + } + },*/ intVon: { get() { return this.von; @@ -131,19 +140,35 @@ export default { this.filteredMitarbeiter = CoreRESTClient.getData(result.data); }); }, - methods: { - initTinyMCE() { - //console.log(" before initfile"); - tinymce.init({ - selector: '#editor', // Use the ID of your textarea or div - plugins: ['autoresize', 'lists'], - toolbar: 'undo redo | styleselect | bold italic | bullist numlist', - autoresize_bottom_margin: 16, - setup: (editor) => { - // for additional setup or customization here - }, - }); - }, + initTinyMCE() { + tinymce.init({ + selector: '#editor', + //height: 800, + plugins: ['autoresize', 'lists'], + toolbar: "undo redo | blocks | bold italic | alignleft aligncenter alignright alignjustify | outdent indent", + + autoresize_bottom_margin: 16, + setup: (editor) => { + +/* editor.on('input', () => { + this.$emit('update:propText', editor.getContent()); + });*/ + + // workaround for avoiding conflict id of frame: same Id as textarea + // working just for new notes + //Todo(manu) find a solution for update notes + editor.on('input', () => { + this.intText = editor.getContent(); + //this.$emit('update:intText', editor.getContent()); + + }); + }, + }); + }, + updateContent(event) { + // Manually update the content when the textarea is edited + tinymce.get('editor').setContent(event.target.value); + console.log(event.target.value); }, }, mounted() { @@ -152,7 +177,6 @@ export default { beforeDestroy() { tinymce.get('editor').destroy(); }, - template: `
- -
- - - - -
-
- +
+ +
- + +
- -
+ - - -
- +
+ + +
+
-
@@ -274,8 +282,11 @@ export default {

{{this.lastChange}}

- + + + intText: {{intText}} |
propText: {{propText}} |
text: {{text}}
{{intPropText}} + ` } diff --git a/public/js/components/tinymce.js.php b/public/js/components/tinymce.js.php deleted file mode 100644 index 101306442..000000000 --- a/public/js/components/tinymce.js.php +++ /dev/null @@ -1,22 +0,0 @@ -