Opened 11 years ago

Closed 11 years ago

#10487 closed Bug (invalid)

issuse while entering the content in ckeditor

Reported by: rajanit74 Owned by:
Priority: Normal Milestone:
Component: File Browser Version: 3.6.5
Keywords: Cc:

Description

actually we arte using track changes in ckeditor.we are unable insert the text in ckeditor.

fakeObj = (String.fromCharCode(evt.data.keyCode)).toLowerCase();

var realElement = new CKEDITOR.dom.element('spandia7'); realElement.appendText(fakeObj);

editor.insertElement(realElement); if we use this output is <spandia7>r</spandia7>r .

we will append the content with that tag and insert the tag using insertHtml() and content is coming outside of tag because of the insertion of the browser.

it is coming like this,can u rectify and say where to make changes for this.

Change History (1)

comment:1 Changed 11 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

This isn't support site or forum. Please ask your implementation questions there.

NOTE: in CKE 4.1.1 the code would look like this. You will need to adjust it to CKE 3.x you use or update to newer version.

var editor = CKEDITOR.replace( 'editor1', {
allowedContent:true
});
editor.on( 'pluginsLoaded', function( event ) {
			var ed = event.editor;
			ed.on( 'contentDom' , function(ev) {
				ed.editable().attachListener(	this.document, 'keydown',	function(e) {					
					console.log(e);					
					var key = e.data.getKey();
					var fakeObj = (String.fromCharCode(key)).toLowerCase();
					var realElement = new CKEDITOR.dom.element('spandia7'); 
					realElement.appendText(fakeObj);
					editor.insertElement(realElement); 		
					e.data.preventDefault();
				});
			});
		});	

This ticket will not be continued.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy