public/ckeditor/4.4dev/core/editable.js
function( element ) {
				// Prepare for the insertion. For example - focus editor (#11848).
				beforeInsert( this );

				var editor = this.editor,
					enterMode = editor.activeEnterMode,
					selection = editor.getSelection(),
					range = selection.getRanges()[ 0 ],
					elementName = element.getName(),
					isBlock = CKEDITOR.dtd.$block[ elementName ];

				// Insert element into first range only and ignore the rest (#11183).
				if ( this.insertElementIntoRange( element, range ) ) {
					range.moveToPosition( element, CKEDITOR.POSITION_AFTER_END );

					// If we're inserting a block element, the new cursor position must be
					// optimized. (#3100,#5436,#8950)
					if ( isBlock ) {
						// Find next, meaningful element.
						var next = element.getNext( function( node ) {
							return isNotEmpty( node ) && !isBogus( node );
						} );

						if ( next && next.type == CKEDITOR.NODE_ELEMENT && next.is( CKEDITOR.dtd.$block ) ) {
							// If the next one is a text block, move cursor to the start of it's content.
							if ( next.getDtd()[ '#' ] )
								range.moveToElementEditStart( next );
							// Otherwise move cursor to the before end of the last element.
							else
								range.moveToElementEditEnd( element );
						}
						// Open a new line if the block is inserted at the end of parent.
						else if ( !next && enterMode != CKEDITOR.ENTER_BR ) {
							next = range.fixBlock( true, enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
							range.moveToElementEditStart( next );
						}
					}
				}

				// Set up the correct selection.
				selection.selectRanges( [ range ] );

				afterInsert( this );
			}
function( element ) {
				// Prepare for the insertion. For example - focus editor (#11848).
				beforeInsert( this );

				var editor = this.editor,
					enterMode = editor.activeEnterMode,
					selection = editor.getSelection(),
					range = selection.getRanges()[ 0 ],
					elementName = element.getName(),
					isBlock = CKEDITOR.dtd.$block[ elementName ];

				// Insert element into first range only and ignore the rest (#11183).
				if ( this.insertElementIntoRange( element, range ) ) {
					range.moveToPosition( element, CKEDITOR.POSITION_AFTER_END );

					// If we're inserting a block element, the new cursor position must be
					// optimized. (#3100,#5436,#8950)
					if ( isBlock ) {
						// Find next, meaningful element.
						var next = element.getNext( function( node ) {
							return isNotEmpty( node ) && !isBogus( node );
						} );

						if ( next && next.type == CKEDITOR.NODE_ELEMENT && next.is( CKEDITOR.dtd.$block ) ) {
							// If the next one is a text block, move cursor to the start of it's content.
							if ( next.getDtd()[ '#' ] )
								range.moveToElementEditStart( next );
							// Otherwise move cursor to the before end of the last element.
							else
								range.moveToElementEditEnd( element );
						}
						// Open a new line if the block is inserted at the end of parent.
						else if ( !next && enterMode != CKEDITOR.ENTER_BR ) {
							next = range.fixBlock( true, enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
							range.moveToElementEditStart( next );
						}
					}
				}

				// Set up the correct selection.
				selection.selectRanges( [ range ] );

				afterInsert( this );
			}
function ( element ) { // Prepare for the insertion. For example - focus editor (#11848). beforeInsert ( this ) ; var editor = this . editor , enterMode = editor . activeEnterMode , selection = editor . getSelection ( ) , range = selection . getRanges ( ) [ 0 ] , elementName = element . getName ( ) , isBlock = CKEDITOR . dtd . $block [ elementName ] ; // Insert element into first range only and ignore the rest (#11183). if ( this . insertElementIntoRange ( element , range ) ) { range . moveToPosition ( element , CKEDITOR . POSITION_AFTER_END ) ; // If we're inserting a block element, the new cursor position must be // optimized. (#3100,#5436,#8950) if ( isBlock ) { // Find next, meaningful element. var next = element . getNext ( function ( node ) { return isNotEmpty ( node ) && ! isBogus ( node ) ; } ) ; if ( next && next . type == CKEDITOR . NODE_ELEMENT && next . is ( CKEDITOR . dtd . $block ) ) { // If the next one is a text block, move cursor to the start of it's content. if ( next . getDtd ( ) [ '#' ] ) range . moveToElementEditStart ( next ) ; // Otherwise move cursor to the before end of the last element. else range . moveToElementEditEnd ( element ) ; } // Open a new line if the block is inserted at the end of parent. else if ( ! next && enterMode != CKEDITOR . ENTER_BR ) { next = range . fixBlock ( true , enterMode == CKEDITOR . ENTER_DIV ? 'div' : 'p' ) ; range . moveToElementEditStart ( next ) ; } } } // Set up the correct selection. selection . selectRanges ( [ range ] ) ; afterInsert ( this ) ; }
Inserts an element into the currently selected position in the editor.

@param {CKEDITOR.dom.element} element The element to be inserted.
Inserts an element into the currently selected position in the editor .