CKEDITOR.stylesSet.add("bechtle", [ { name: "Paragraph", element: "p", attributes: {} }, { name: "Leadin", element: "p", attributes: { class: "leadin" } }, { name: "Price Prefix", element: "span", attributes: { class: "price-prefix" } }, { name: "Price", element: "p", attributes: { class: "price" } }, { name: "Quote", element: "blockquote", attributes: { class: "neo-quote" } }, //Headlines mit h-Tag (SEO) { name: "h1", element: "h1", attributes: { class: "h1" } }, { name: "h2", element: "h2", attributes: { class: "h2" } }, { name: "h3", element: "h3", attributes: { class: "h3" } }, { name: "h4", element: "h4", attributes: { class: "h4" } }, { name: "h5", element: "h5", attributes: { class: "h5" } }, { name: "Headline Slab 1", element: "h1", attributes: { class: "h1 headline--slab" } }, { name: "Headline Slab large", element: "h1", attributes: { class: "h0 headline--slab" } }, { name: "Headline Slab Xl", element: "h1", attributes: { class: "hxl headline--slab" } }, { name: "Headline Slab XXl", element: "h1", attributes: { class: "hxxl headline--slab" } }, //Headlines ohne h-Tag (nur Gestaltung) { name: "Headline 1", element: "div", attributes: { class: "h1" } }, { name: "Headline 2", element: "div", attributes: { class: "h2" } }, { name: "Headline 3", element: "div", attributes: { class: "h3" } }, { name: "Headline 4", element: "div", attributes: { class: "h4" } }, { name: "Headline 5", element: "div", attributes: { class: "h5" } }, { name: "Headline Slab 1 (ohne h-Tag)", element: "div", attributes: { class: "h1 headline--slab" } }, { name: "Headline Slab large (ohne h-Tag)", element: "div", attributes: { class: "h0 headline--slab" } }, { name: "Headline Slab Xl (ohne h-Tag)", element: "div", attributes: { class: "hxl headline--slab" } }, { name: "Headline Slab XXl (ohne h-Tag)", element: "div", attributes: { class: "hxxl headline--slab" } }, { name: "Link To Anker", element: "a", attributes: { class: "neo-marker" } }, { name: "Anker", element: "a", attributes: { class: "neo-anker" } }, { name: "Back Button", element: "a", attributes: { class: "neo-button neo-button--back neo-button--grey" } }, { name: "Brand Button", element: "a", attributes: { class: "neo-button neo-button--brand" } }, { name: "Blue Button", element: "a", attributes: { class: "neo-button neo-button--blue" } }, { name: "Grey Button", element: "a", attributes: { class: "neo-button neo-button--grey" } }, { name: "Green Button", element: "a", attributes: { class: "neo-button neo-button--green" } }, { name: "Outline Button White", element: "a", attributes: { class: "neo-button neo-button--outline" } }, { name: "Outline Button Black", element: "a", attributes: { class: "neo-button neo-button--outlineDark" } }, { name: "Download Button Blue", element: "a", attributes: { class: "neo-button neo-button--blue neo-button--download" } }, { name: "Download Button Grey", element: "a", attributes: { class: "neo-button neo-button--download neo-button--grey" } }, { name: "Download Button Outline Black", element: "a", attributes: { class: "neo-button neo-button--download neo-button--outlineDark" } }, { name: "Download Button Outline White", element: "a", attributes: { class: "neo-button neo-button--download neo-button--outline" } }, { name: "Brand List", element: "ul", attributes: { class: "neo-list neo-list--brand" } }, { name: "Black List", element: "ul", attributes: { class: "neo-list neo-list--black" } }, { name: "Grey List", element: "ul", attributes: { class: "neo-list neo-list--grey" } }, { name: "White List", element: "ul", attributes: { class: "neo-list neo-list--white" } }, { name: "Yellow List", element: "ul", attributes: { class: "neo-list neo-list--yellow" } }, { name: "Number Liste", element: "ul", attributes: { class: "neo-list neo-list--number" } }, { name: "Border Table", element: "table", attributes: { class: "neo-table neo-table__border" } }, { name: "Odd/Even Table", element: "table", attributes: { class: "neo-table neo-table__evenodd" } }, { name: "Eventtable", element: "table", attributes: { class: "neo-table neo-table__event" } }, ]); CKEDITOR.on("dialogDefinition", function (ev) { "use strict"; let dialogName = ev.data.name; let dialogDefinition = ev.data.definition; if (dialogName === "table" || dialogName === "tableProperties") { // Get the properties tab reference let infoTab = dialogDefinition.getContents("info"); // Remove unnecessary bits from this tab infoTab.remove("cmbAlign"); infoTab.remove("txtWidth"); infoTab.remove("txtCellSpace"); infoTab.remove("txtCellPad"); infoTab.remove("txtCaption"); infoTab.remove("txtSummary"); infoTab.remove("selHeaders"); // Remove the 'Advanced' tab completely dialogDefinition.removeContents("advanced"); } if (dialogName === "cellProperties") { let tab = dialogDefinition.getContents("info"); tab.remove("cellType"); tab.remove("hAlign"); } if (dialogName === "link") { var advancedTab = dialogDefinition.getContents("advanced"); //remove unused fields from the "advanced" tab advancedTab.remove("advLangCode"); advancedTab.remove("advLangDir"); advancedTab.remove("advTabIndex"); advancedTab.remove("advContentType"); advancedTab.remove("advCharset"); advancedTab.remove("advStyles"); advancedTab.remove("advAccessKey"); advancedTab.remove("advId"); advancedTab.remove("advName"); advancedTab.remove("advRel"); advancedTab.remove("download"); advancedTab.get("advCSSClasses").hidden = true; } if (dialogName === "image") { dialogDefinition.removeContents("advanced"); } }); CKEDITOR.editorConfig = function (config) { "use strict"; config.toolbar = [ { name: "basicstyles", items: ["Bold", "Underline", "Subscript", "Superscript"] }, { name: "paragraph", items: ["BulletedList", "Blockquote", "HorizontalRule"] }, { name: "links", items: ["Link", "InternalLink", "Anchor", "DamLink", "Unlink"] }, { name: "insert", items: ["Image", "Table", "SpecialChar"] }, "/", { name: "styles", items: ["Styles"] }, { name: "textColor", items: ["TextColor"] }, { name: "alignment", items: ["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"] }, "/", { name: "clipboard", items: ["Cut", "Copy", "Paste", "PasteText"] }, { name: "tools", items: ["Undo", "Redo", "Source", "ShowBlocks", "RemoveFormat"] }, ]; // adds a single character to the table of special characters (first array part is the char itself, // shown in the table and, when selected, at the side in the bigger box. the second array entry is // the custom label, shown as tooltip only) // added the   at start to make it more visible config.specialChars = [[" ", "Protected space"]].concat(config.specialChars); // remove plugins let removePlugins = []; removePlugins.push("elementspath"); removePlugins.push("filebrowser"); config.removePlugins = removePlugins.join(","); // add plugins config.extraPlugins = "magnolialink,magnoliaFileBrowser,horizontalrule"; config.baseFloatZIndex = 150; // set styles config.stylesSet = "bechtle"; // css file let generalCSS = CKEDITOR.vaadinDirUrl.replace("VAADIN/", ".resources/bechtle-ui/webresources/css/neo-app.css"); let editorCSS = CKEDITOR.vaadinDirUrl.replace("VAADIN/", ".resources/bechtle-ui/config/ckeditor/ckeditor.css"); config.contentsCss = [generalCSS, editorCSS]; // colors config.colorButton_colors = "F7F7F7,545454,DBDCDE,6BC756,155195,6C98B5,FDDC03,FFFFFF,000000,939393,D94119,F5960E,4B4D3B,DBDCDE,969986,D7C2B1,9F8F7F,87D7E0,6B7A83,F0C072,FFE500,005191,008789,DB6254,36CEAF"; config.colorButton_colorsPerRow = 5; config.colorButton_enableMore = true; config.colorButton_enableAutomatic = true; config.colorButton_foreStyle = { element: "font", styles: { color: "#(color)" }, }; config.disallowedContent = "video, iframe, object, audio"; //prevent the user from using video, iframes, objects tags in RTE // convert al remaining non ascii chars to numerical html ones. config.entities_processNumerical = true; /* not needed anymore? CKEDITOR.on("instanceReady", function (ev) { let writer = ev.editor.dataProcessor.writer; // The character sequence to use for every indentation step. writer.indentationChars = " "; let dtd = CKEDITOR.dtd; // Elements taken as an example are: block-level elements (div or p), list items (li, dd), and table elements (td, tbody). for (let e in CKEDITOR.tools.extend({}, dtd.$block, dtd.$listItem, dtd.$tableContent)) { ev.editor.dataProcessor.writer.setRules(e, { // Indicates that an element creates indentation on line breaks that it contains. indent: false, // Inserts a line break before a tag. breakBeforeOpen: false, // Inserts a line break after a tag. breakAfterOpen: false, // Inserts a line break before the closing tag. breakBeforeClose: false, // Inserts a line break after the closing tag. breakAfterClose: false, }); } for (let e in CKEDITOR.tools.extend({}, dtd.$list, dtd.$listItem, dtd.$tableContent)) { ev.editor.dataProcessor.writer.setRules(e, { indent: true, }); } }); */ }; /* // all toolbar items ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'], '/', ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','HorizontalLine'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Anchor'], ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'], '/', ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['Maximize', 'ShowBlocks'] */ /* // bechtle colors colors: { 'F7F7F7':'FlaechenGrau','ACACAC':'BulletGrau','DBDCDE':'LinienGrau','6BC756':'Blattgruen','155195':'Zukunftsblau','6C98B5':'Taubenblau','FDDC03':'Knallgelb','FFFFFF':'Weiss','000000':'Schwarz','939393':'Grau','D94119':'Karminrot','F5960E':'Orange','008A4F':'Logogruen','4B4D3B':'Typograu','DBDCDE':'Flaechengrau','969986':'Mittelgrau','D7C2B1':'Sandbeige','9F8F7F':'Mausgrau','87D7E0':'Zartblau','6B7A83':'Wintergrau','F0C072':'Saharabeige' } */