ckeditor where usefull

This commit is contained in:
Olivier Legat 2022-02-01 08:57:34 +01:00
parent 9c050451e3
commit 45ddacee92
5 changed files with 110 additions and 6 deletions

View file

@ -82,3 +82,57 @@
</div>
</form>
@endsection
@push('scripts')
<script type="text/javascript">
var editorConfig = {
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo'],
heading: {
options: [{
model: 'paragraph',
title: 'Paragraph',
class: 'ck-heading_paragraph'
},
{
model: 'heading1',
view: 'h1',
title: 'Heading 1',
class: 'ck-heading_heading1'
},
{
model: 'heading2',
view: 'h2',
title: 'Heading 2',
class: 'ck-heading_heading2'
},
{
model: 'heading3',
view: 'h3',
title: 'Heading 3',
class: 'ck-heading_heading3'
},
{
model: 'heading4',
view: 'h4',
title: 'Heading 4',
class: 'ck-heading_heading4'
}
]
},
table: {
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells']
}
};
ClassicEditor
.create(document.querySelector('#text1'), editorConfig)
.catch(error => {
console.error(error);
});
ClassicEditor
.create(document.querySelector('#text2'), editorConfig)
.catch(error => {
console.error(error);
});
</script>
@endpush

View file

@ -51,3 +51,52 @@
<?php } ?>
</form>
@endsection
@push('scripts')
<script type="text/javascript">
var editorConfig = {
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|', 'undo', 'redo'],
heading: {
options: [{
model: 'paragraph',
title: 'Paragraph',
class: 'ck-heading_paragraph'
},
{
model: 'heading1',
view: 'h1',
title: 'Heading 1',
class: 'ck-heading_heading1'
},
{
model: 'heading2',
view: 'h2',
title: 'Heading 2',
class: 'ck-heading_heading2'
},
{
model: 'heading3',
view: 'h3',
title: 'Heading 3',
class: 'ck-heading_heading3'
},
{
model: 'heading4',
view: 'h4',
title: 'Heading 4',
class: 'ck-heading_heading4'
}
]
},
table: {
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells']
}
};
ClassicEditor
.create(document.querySelector('#text'), editorConfig)
.catch(error => {
console.error(error);
});
</script>
@endpush

View file

@ -16,7 +16,7 @@
</form>
@endsection
@section('scripts')
@push('scripts')
<script type="text/javascript">
var editorConfig = {
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
@ -58,9 +58,9 @@
}
};
ClassicEditor
.create(document.querySelector('#text'), editorConfig)
.create(document.querySelector('#description'), editorConfig)
.catch(error => {
console.error(error);
});
</script>
@endsection
@endpush

View file

@ -17,7 +17,7 @@
</form>
@endsection
@section('scripts')
@push('scripts')
<script type="text/javascript">
var editorConfig = {
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
@ -59,9 +59,9 @@
}
};
ClassicEditor
.create(document.querySelector('#text'), editorConfig)
.create(document.querySelector('#description'), editorConfig)
.catch(error => {
console.error(error);
});
</script>
@endsection
@endpush

View file

@ -22,6 +22,7 @@
<link rel="icon" href="/favicon.png" type="image/png">
{{--@preload('mix-manifest.json')--}}
<script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script>
<!-- STYLES -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" integrity="sha256-hHKA3d/HttC8OW3Sl093W8DoZudhHJDj++kZYo6MLzA=" crossorigin="anonymous">