Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted April 22, 20159 yr I'm trying to make some changes to CKEditor through the config file but struggling a bit. I'm looking to add:config.forcePasteAsPlainText = true;andconfig.ignoreEmptyParagraph = false; (I'm thinking this will remove the extra empty paragraphs which are created when a user hits enter several times after a post)I've added the lines to the config.js in applications > core > interface > ckeditor > ckeditor but neither work/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.editorConfig=function(a){a.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}];a.removeButtons="Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript"; a.removeDialogTabs="link:advanced"}; config.forcePasteAsPlainText = true; config.ignoreEmptyParagraph = true;
April 22, 20159 yr At least for the plain text, that should work. It’s exactly how I do it. /* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.editorConfig=function(a){a.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}];a.removeButtons="Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript"; a.removeDialogTabs="link:advanced"}; CKEDITOR.config.forcePasteAsPlainText = true;
April 22, 20159 yr Author Thanks, that worked with the paste, empty paragraphs didn't but that's not a major. Appreciate it
April 22, 20159 yr Another option to use would be to move the items into the existing editorConfig function:/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.editorConfig=function(a){ a.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}]; a.removeButtons="Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript"; a.removeDialogTabs="link:advanced", a.forcePasteAsPlainText = true; a.ignoreEmptyParagraph = true; };
April 22, 20159 yr This works for me: CKEDITOR.editorConfig = function( config ) { // config.uiColor = '#553360'; config.forcePasteAsPlainText = true; };
April 22, 20159 yr Yep - they are all ways of achieving the same thing. You can create a new config function, add to an existing one, or just go it alone with the single line entry.
Archived
This topic is now archived and is closed to further replies.