Repository navigation
Example Usage
Peace Ngara edited this page Mar 29, 2017
·
1 revision
There are 2 Ways the Plugin can be used:
- As a Laravel Plugin
- As a CK Editor Standalone Plugin
The Plugin already has an Implementation of Laravel and Database Usages see below:
<div class="container">
<div class="row">
<form name="save" id="save" action="/ckesavedata">
<textarea id="ckeditorplugin" class="ckeditor"><p>Initial editor content.</p></textarea>
<br/>
<button id="submit" class="btn btn-sm unisa-blue-btn bnt-success" name="submit">Save Data</button>
<input type="hidden" id="token" value="{{ csrf_token() }}"/>
</form>
<script>
/**
* Create a New Instance of the CK Editor
*/
CKEDITOR.replace('ckeditorplugin', {
// Load the Course Content Plugin to the Editor
extraPlugins: 'coursecontent'
}
);
CKEDITOR.document.appendStyleSheet("{{URL::asset('/vendor/ckeditorplugin/css/custom-contents.css')}}");
$('#submit').click(function (event) {
event.preventDefault();
CKEDITOR.instances.ckeditorplugin.updateElement();
var data = $('#ckeditorplugin').val();
$.ajax({
url: '/ckesavedata',
context: document.body,
data: {
data: data
},
success: function (response) {
alert(data); // Get Current Editor Data.
console.log(response);
}
});
});
</script>
<script>
//Dialogue Insertion Point -->
CKEDITOR.config = {
extraPlugins: 'dialog',
toolbar: [['LTIButton']],
allowedContent: true
};
</script>
</div>
</div>