76 lines
2.2 KiB
JavaScript
76 lines
2.2 KiB
JavaScript
/**
|
|
* Headline-Editor
|
|
* Stellt die Funktionalität für die Bearbeitung der Überschriften zur Verfügung
|
|
*
|
|
* Created by CS medien- & kommunikationssysteme.
|
|
* @author Christian Steinle
|
|
* @date 11.10.2016
|
|
*
|
|
* @copyright CS medien- & kommunikationssysteme (http://www.steinle-computer.de)
|
|
*/
|
|
|
|
var Headline = {
|
|
headlineEditor: null,
|
|
|
|
headlineElement: null,
|
|
|
|
init: function() {
|
|
Headline.initElements();
|
|
},
|
|
|
|
initElements: function() {
|
|
Headline.headlineElement = $('#navHeadline');
|
|
},
|
|
|
|
fillEditorContent: function () {
|
|
if (CS.editorData === null || CS.editorHtml === '') {
|
|
window.setTimeout('Headline.fillEditorContent()', 50);
|
|
return true;
|
|
}
|
|
|
|
Headline.init();
|
|
|
|
CS.editorData.navHeadline = '<h1>' + CS.editorData.navHeadline + '</h1>';
|
|
$.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);
|
|
|
|
Headline.headlineEditor = Headline.headlineElement.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
|
|
*/
|
|
Headline.headlineElement.ckeditor().on('instanceReady.ckeditor', function() {
|
|
$('.cke_combo.cke_combo__format.cke_combo_off').hide();
|
|
});
|
|
|
|
Headline.headlineEditor.on('key', function (event) {
|
|
if (event.data.keyCode === 13) {
|
|
event.cancel();
|
|
return true;
|
|
}
|
|
});
|
|
|
|
},
|
|
|
|
close: function () {
|
|
|
|
}
|
|
|
|
};
|