v0.7.8 - Added Quill Editor to all sites - Fixed Event name/subname showance in news.index
This commit is contained in:
@@ -11,23 +11,25 @@
|
||||
|
||||
@section("content")
|
||||
<style>
|
||||
.ck-editor__main {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.toggle__label::before, .toggle__label::after {
|
||||
border-color: black;
|
||||
}
|
||||
.toggle__text::before {
|
||||
border-color: black;
|
||||
}
|
||||
|
||||
#editor {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/classic/ckeditor.js"></script>
|
||||
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
|
||||
<h1>Opret Vejledning</h1>
|
||||
<form method="post" action="{{ route("guides.store") }}">
|
||||
@csrf
|
||||
<label for="title">Titel på guiden</label>
|
||||
<input type="text" name="name" id="title" required>
|
||||
<textarea name="guide_articles" id="editor"></textarea>
|
||||
<div id="editor"></div>
|
||||
<textarea name="guide_articles" class="d-none" id="hiddenArea"></textarea>
|
||||
<label class="toggle">
|
||||
<input class="toggle__input" type="checkbox" name="newsoption">
|
||||
<span class="toggle__label">
|
||||
@@ -37,19 +39,33 @@
|
||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
|
||||
<script>
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#editor' ) )
|
||||
.then( editor => {
|
||||
console.log( editor );
|
||||
} )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
var container = document.getElementById("editor");
|
||||
var fullEditor = new Quill(container, {
|
||||
modules: {
|
||||
'toolbar': [
|
||||
[ 'bold', 'italic', 'underline', 'strike' ],
|
||||
[{ 'color': [] }, { 'background': [] }],
|
||||
[{ 'script': 'super' }, { 'script': 'sub' }],
|
||||
[{ 'header': '1' }, { 'header': '2' }, 'blockquote', 'code-block' ],
|
||||
[{ 'list': 'ordered' }, { 'list': 'bullet'}, { 'indent': '-1' }, { 'indent': '+1' }],
|
||||
[ {'direction': 'rtl'}, { 'align': [] }],
|
||||
[ 'link' ],
|
||||
[ 'clean' ]
|
||||
],
|
||||
},
|
||||
theme: 'snow'
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var form = document.querySelector('form');
|
||||
form.onsubmit = function() {
|
||||
var myEditor = document.getElementById('editor');
|
||||
var html = myEditor.children[0].innerHTML;
|
||||
document.getElementById('hiddenArea').innerText = html;
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@section("scripts")
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user