Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Yesterday at 02:04 PM
Day_ Posted April 22, 2015 Posted April 22, 2015 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;
opentype Posted April 22, 2015 Posted April 22, 2015 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;
Day_ Posted April 22, 2015 Author Posted April 22, 2015 Thanks, that worked with the paste, empty paragraphs didn't but that's not a major. Appreciate it
Nathan Explosion Posted April 22, 2015 Posted April 22, 2015 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; };
Starship Posted April 22, 2015 Posted April 22, 2015 This works for me: CKEDITOR.editorConfig = function( config ) { // config.uiColor = '#553360'; config.forcePasteAsPlainText = true; };
Nathan Explosion Posted April 22, 2015 Posted April 22, 2015 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.