FIX #2056: areYouSure now reacts also on changes in CKEditor

This commit is contained in:
Michal Kváček
2017-08-02 14:10:37 +02:00
parent 3d73bffa6e
commit 3a1e4b9c5b
2 changed files with 34 additions and 26 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
</div>
@endif
<form method="POST" enctype="multipart/form-data" action="{{route('content.newPost', ['moduleId' => $module->id])}}">
<form method="POST" enctype="multipart/form-data" action="{{route('content.newPost', ['module' => $module])}}">
{!! csrf_field() !!}
@include('admin.content.formInputs')
@@ -1,29 +1,37 @@
<script src="{{asset('/resources/assets/js/vendor/ckeditor/ckeditor.js')}}"></script>
<script type="application/javascript">
CKEDITOR.replace ('{{$textareaId}}', {
uiColor: "#F5F5F5",
filebrowserUploadUrl: '{{route('upload.postFile', ['_token' => csrf_token()])}}',
forcePasteAsPlainText: true,
entities: false,
basicEntities: false,
entities_greek: false,
entities_latin: false,
height: 550,
removePlugins: 'about,scayt', //elementspath
extraPlugins: 'justify',
enterMode: CKEDITOR.ENTER_P,
toolbarGroups: [
{name: 'undo', groups: ['undo']},
{name: 'styles'},
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
{name: 'paragraph', groups: ['list', 'indent', 'align', 'blocks']},
{name: 'links'},
{name: 'editing', groups: ['find', 'selection']},
{name: 'insert'},
{name: 'forms'},
{name: 'document', groups: ['mode', 'document', 'doctools']},
{name: 'tools'}
]
});
CKEDITOR.on('instanceCreated', function(e) {
e.editor.on('change', function(event) {
var textarea = event.editor.element.$;
$(textarea).val(event.editor.getData().trim());
$(textarea.form).trigger('checkform.areYouSure');
});
})
CKEDITOR.replace ('{{$textareaId}}', {
uiColor: "#F5F5F5",
filebrowserUploadUrl: '{{route('upload.postFile', ['_token' => csrf_token()])}}',
forcePasteAsPlainText: true,
entities: false,
basicEntities: false,
entities_greek: false,
entities_latin: false,
height: 550,
removePlugins: 'about,scayt', //elementspath
extraPlugins: 'justify',
enterMode: CKEDITOR.ENTER_P,
toolbarGroups: [
{name: 'undo', groups: ['undo']},
{name: 'styles'},
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
{name: 'paragraph', groups: ['list', 'indent', 'align', 'blocks']},
{name: 'links'},
{name: 'editing', groups: ['find', 'selection']},
{name: 'insert'},
{name: 'forms'},
{name: 'document', groups: ['mode', 'document', 'doctools']},
{name: 'tools'}
]
});
</script>