Files
editors/js/textEditor.js

58 lines
1.7 KiB
JavaScript

/**
* Text-Editor
* Stellt die Funktionalität für die Bearbeitung der Texte zur Verfügung
*
* Created by CS medien- & kommunikationssysteme.
* @author Christian Steinle
* @date 13.10.2016
*
* @copyright CS medien- & kommunikationssysteme (http://www.steinle-computer.de)
*/
var Text = {
textEditor: null,
textElement: null,
init: function() {
Text.initElements();
},
initElements: function() {
Text.textInput = $('#text');
},
fillEditorContent: function () {
if (CS.editorData === null || CS.editorHtml === '') {
window.setTimeout('Text.fillEditorContent()', 50);
return true;
}
Text.init();
CS.editorData.text = '<p>' + CS.editorData.text + '</p>';
$.each(CS.editorData, function (key, value) {
$("input[type='text'][name='" + key + "'], input[type='hidden'][name='" + key + "'], select[name='" + key + "'], textarea[name='" + key + "']", CS.contentElement).val(value);
});
Text.textEditor = Text.textInput.ckeditor({
enterMode: CKEDITOR.ENTER_BR,
extraPlugins: 'divarea',
height: '500px',
removeButtons: 'Redo,Font,FontSize',
removePlugins: 'elementspath',
toolbarGroups: [
{name: 'clipboard', groups: ['clipboard', 'undo']},
{name: 'editing', groups: ['find', 'selection', 'spellchecker']},
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
{name: 'paragraph', groups: ['list']},
{name: 'links'},
{name: 'about'}
]
}).editor;
},
close: function () {
}
};