Skip to content

Commit

Permalink
move tinymce soley into app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fredbradley committed Aug 30, 2024
1 parent ffe7f0d commit c33113b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
import './bootstrap';
import 'tinymce';
import 'bootstrap';
import '@popperjs/core';
import tinymce from 'tinymce';

tinymce.init({
selector: 'textarea.wysiwyg',
menubar: false,
statusbar: false,
browser_spellcheck: true,
toolbar1: 'undo redo | styleselect | bold italic | link bullist numlist outdent indent | forecolor backcolor | paste',
plugins: ['lists', 'link'],
contextmenu: [], // we do this so that TinyMCE doesn't overwrite our users right click context menu
paste_data_images: false,
paste_webkit_styles: "color",
paste_merge_formats: true,
setup: function (editor) {
editor.on('blur', function (e) {
var content = tinymce.activeEditor.getContent();
if (content.includes("<img src=")) {
alert("I've noticed your input contains an image. This cannot be saved here. Please save and then add the image as an attachment in notes.");
}
});
}
});

if (document.getElementById('logout-btn')) {
document.getElementById('logout-btn')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/raiseaconcern.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'resources/sass/app.scss'
])

@include('partials.tinymce')
{{-- @include('partials.tinymce')--}}
</head>
<body>
<div id="app">
Expand Down

0 comments on commit c33113b

Please sign in to comment.