@qualityunit/liveagent-components-editor
v0.0.60
Published
Editor component for LiveAgent
Downloads
508
Keywords
Readme
Editor component for LiveAgent
Basic usage example:
<ckeditor5-classic placeHolder="Type text" lang="sk"/>
or
const editor = document.createElement('ckeditor5-classic');
editor.placeHolder = 'Type text';
editor.lang = 'sk';
document.body.appendChild(editor);
Advanced usage example:
const editor = document.createElement('ckeditor5-classic');
// needed for "imageUpload" when this feature is enabled
editor.insertImageServiceUrl = 'https://hosted.la.localhost/LiveAgent/server/agent/index.php?C=La_Agent_ImageUpload&M=upload&S=rghw2zc7hs9yfi0jh7qvoqxbl61t4nah&T=1720005193335e4&FormRequest=Y&FormResponse=Y';
// needed for "imageUpload" when this feature is enabled
editor.getImageServiceUrl = 'https://hosted.la.localhost/LiveAgent/server/scripts/file.php';
editor.items = ['undo', 'redo', '|', 'heading', 'bold', 'italic', 'strikethrough', 'underline', 'fontColor', 'fontBackgroundColor', 'fontFamily', 'fontSize', '|', 'numberedList', 'bulletedList', '|', 'outdent', 'indent', 'blockQuote', '|', 'alignment', '|', 'link', 'imageUpload', 'mediaEmbed', 'horizontalLine', 'specialCharacters', 'code', 'codeBlock', 'insertTable', '|', 'style', '|', 'removeFormat', 'selectAll', '|', 'sourceEditing'];
editor.allowHtmlSupport = false;
editor.value = 'Your text';
editor.placeHolder = 'Type text';
editor.lang = 'sk';
editor.valueChange = (evt, data) => {
console.log("Value change: " + editor.value, data);
};
editor.stateChange = (evt, data) => {
console.log("Status change: " + data);
};
editor.sourceEditingModeChange = (evt, data) => {
console.log("Source editing mode change: " + data);
};
editor.selectionRangeChange = (evt, data) => {
console.log("Selection range change: ", data);
};
document.body.appendChild(editor);