Files
einundzwanzig-portal/resources/views/components/input/simple-mde.blade.php
2023-02-09 22:09:05 +01:00

61 lines
2.1 KiB
PHP

<div
wire:ignore
x-data="{
value: @entangle($attributes->wire('model')).defer,
init() {
let editor = new EasyMDE({
element: this.$refs.editor,
lineNumbers: true,
uploadImage: false,
{{-- imageMaxSize: 1024 * 1024 * 10,--}}
{{-- imageUploadFunction: (file, onSuccess, onError) => {--}}
{{-- @this.upload('images', file, (uploadedFilename) => {--}}
{{-- const currentImage = @this.get('currentImage');--}}
{{-- const temporaryUrls = @this.get('temporaryUrls');--}}
{{-- onSuccess(temporaryUrls[currentImage]);--}}
{{-- @this.set('currentImage', currentImage + 1)--}}
{{-- }, () => {--}}
{{-- // Error callback.--}}
{{-- }, (event) => {--}}
{{-- // Progress callback.--}}
{{-- // event.detail.progress contains a number between 1 and 100 as the upload progresses.--}}
{{-- })--}}
{{-- },--}}
showIcons: [
'heading',
'heading-smaller',
'heading-bigger',
'heading-1',
'heading-2',
'heading-3',
'code',
'table',
'quote',
'strikethrough',
'unordered-list',
'ordered-list',
'clean-block',
'horizontal-rule',
'undo',
'redo',
//'upload-image',
],
})
editor.value(this.value)
editor.codemirror.on('change', () => {
this.value = editor.value()
})
},
}"
class="w-full"
>
<textarea x-ref="editor"></textarea>
<style>
.EasyMDEContainer {
background-color: white;
}
</style>
</div>