Jump to content

CKEditor acting strange?


rootKID
 Share

Recommended Posts

Hi, whenever my friend/customer is trying to add in a table/tr/td to he's website, i get ALOT of "<br>" for some random reason, you can see the same as i can here:

 

http://www.rightmatch.dk/referencer.php

 

My question, what am i doing wrong here Oo?

 

This is my form text-area code:

<script type='text/javascript'>	CKEDITOR.replace( 'editor',	{		on :		{			instanceReady : function( ev )			{				// Output paragraphs as <p>Text</p>.				this.dataProcessor.writer.setRules( 'p',				{					indent : false,					breakBeforeOpen : true,					breakAfterOpen : false,					breakBeforeClose : false,					breakAfterClose : false				});			}		},				on :		{			instanceReady : function( ev )			{				this.dataProcessor.writer.setRules( 'br',				{					indent: false,					breakBeforeOpen: false,					breakAfterOpen: false,					breakBeforeClose: false,					breakAfterClose: false				});			}		}	});</script>

And this is my SQL add code:

				$body = $_POST['editor'];								$query = "				UPDATE					page_generator				SET					pg_body = '$body'				WHERE					pg_id_runner = $id_run				";								$mysqli->query($query);

And this is my config.js file from the CKEditor project, i've tried some codes i found online to try to see if i was able to fix my "<br>" problem myself:

/** * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */CKEDITOR.editorConfig = function( config ) {	// Define changes to default configuration here. For example:	// config.language = 'fr';	// config.uiColor = '#AADC6E';		// Custom Added - to prevent annoying auto adding <p> - Working Oo?	//CKEDITOR.config.autoParagraph = false;		CKEDITOR.on('instanceReady', function (ev) {		var writer = ev.editor.dataProcessor.writer;		// The character sequence to use for every indentation step.		writer.indentationChars = '  ';				var 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 (var 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 (var e in CKEDITOR.tools.extend({}, dtd.$list, dtd.$listItem, dtd.$tableContent)) {			ev.editor.dataProcessor.writer.setRules(e, {				indent: true,			});		}	});};

The thing is i'm using the CSS-Framework called "GetSkeleton", and the CKEditor is destroying the design (only a little bit).

In the beginning the editor just added "<p></p>" around my text, and that was good, really good actually... but it also added "<br><br>" between each damn "<p>" tag... which means the damn space between words became... long.. VERY long... and i only wanted the P tags to show up instead of adding the damn breaks after and "maybe" before the P tag... Is there any way you can help me out? Not sure if i'm doing this correctly. I'm using latest version of the CKE online.

Thanks for your help if possible! :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...