Erster Checkin für die neue Version 2.0
This commit is contained in:
75
js/sublineEditor.js
Normal file
75
js/sublineEditor.js
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Subline-Editor
|
||||
* Stellt die Funktionalität für die Bearbeitung der Überschriften zur Verfügung
|
||||
*
|
||||
* Created by CS medien- & kommunikationssysteme.
|
||||
* @author Christian Steinle
|
||||
* @date 15.10.2016
|
||||
*
|
||||
* @copyright CS medien- & kommunikationssysteme (http://www.steinle-computer.de)
|
||||
*/
|
||||
|
||||
var Subline = {
|
||||
subLineEditor: null,
|
||||
|
||||
subLineElement: null,
|
||||
|
||||
init: function() {
|
||||
Subline.initElements();
|
||||
},
|
||||
|
||||
initElements: function() {
|
||||
Subline.subLineElement = $('#text');
|
||||
},
|
||||
|
||||
fillEditorContent: function () {
|
||||
if (CS.editorData === null || CS.editorHtml === '') {
|
||||
window.setTimeout('Subline.fillEditorContent()', 50);
|
||||
return true;
|
||||
}
|
||||
|
||||
Subline.init();
|
||||
|
||||
CS.editorData.text = '<h2>' + CS.editorData.text + '</h2>';
|
||||
$.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);
|
||||
});
|
||||
|
||||
$('#navName').html(CS.editorData.navName);
|
||||
|
||||
Subline.subLineEditor = Subline.subLineElement.ckeditor({
|
||||
extraPlugins: 'divarea',
|
||||
height: '70px',
|
||||
removeButtons: 'Redo,Font,FontSize',
|
||||
removePlugins: 'elementspath',
|
||||
resize_enabled: false,
|
||||
stylesSet: [
|
||||
{name: 'small', element: 'small'}
|
||||
],
|
||||
toolbarGroups: [
|
||||
{name: 'clipboard', groups: ['clipboard', 'undo']},
|
||||
{name: 'styles', groups: ['styles']}
|
||||
]
|
||||
}).editor;
|
||||
|
||||
/**
|
||||
* Entfernen des Format-DropDowns über Instanziierung nicht möglich, da die Styles der Überschrift sonst nicht angewendet wird
|
||||
*/
|
||||
Subline.subLineElement.ckeditor().on('instanceReady.ckeditor', function() {
|
||||
$('.cke_combo.cke_combo__format.cke_combo_off').hide();
|
||||
});
|
||||
|
||||
Subline.subLineEditor.on('key', function (event) {
|
||||
if (event.data.keyCode === 13) {
|
||||
event.cancel();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
close: function () {
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user