Ticket #3151: 3151.patch
File 3151.patch, 5.4 KB (added by , 15 years ago) |
---|
-
_source/plugins/blockquote/plugin.js
105 105 // If no paragraphs, create one from the current selection position. 106 106 if ( paragraphs.length < 1 ) 107 107 { 108 var para = editor.document.createElement( editor.config.enterMode ),108 var para = editor.document.createElement( editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ), 109 109 firstBookmark = bookmarks.shift(); 110 110 range.insertNode( para ); 111 111 para.append( new CKEDITOR.dom.text( '\ufeff', editor.document ) ); … … 245 245 bqBlock.remove(); 246 246 } 247 247 248 if ( editor.config.enterMode == 'br')248 if ( editor.config.enterMode == CKEDITOR.ENTER_BR ) 249 249 { 250 250 var firstTime = true; 251 251 while ( movedNodes.length ) -
_source/plugins/wysiwygarea/plugin.js
52 52 var toSplit; 53 53 54 54 // If the new node is a block element, split the current block (if any). 55 if ( this.config.enterMode != 'br'&& isBlock )55 if ( this.config.enterMode != CKEDITOR.ENTER_BR && isBlock ) 56 56 { 57 57 var startPath = new CKEDITOR.dom.elementPath( range.startContainer ), 58 58 j = 0, -
_source/plugins/list/plugin.js
77 77 rootNode = null, 78 78 currentIndex = baseIndex, 79 79 indentLevel = Math.max( listArray[ baseIndex ].indent, 0 ), 80 currentListItem = null; 80 currentListItem = null, 81 paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' ); 81 82 while ( true ) 82 83 { 83 84 var item = listArray[ currentIndex ]; … … 85 86 { 86 87 if ( !rootNode || listArray[ currentIndex ].parent.getName() != rootNode.getName() ) 87 88 { 88 rootNode = listArray[ currentIndex ].parent.clone( false );89 rootNode = listArray[ currentIndex ].parent.clone( false, true ); 89 90 retval.append( rootNode ); 90 91 } 91 92 currentListItem = rootNode.append( doc.createElement( 'li' ) ); 92 93 for ( var i = 0 ; i < item.contents.length ; i++ ) 93 currentListItem.append( item.contents[i].clone( true ) );94 currentListItem.append( item.contents[i].clone( true, true ) ); 94 95 currentIndex++; 95 96 } 96 97 else if ( item.indent == Math.max( indentLevel, 0 ) + 1 ) … … 106 107 currentListItem = doc.createElement( 'li' ); 107 108 else 108 109 { 109 if ( paragraphMode != 'br'&& item.grandparent.getName() != 'td' )110 currentListItem = doc.createElement( paragraph Mode );110 if ( paragraphMode != CKEDITOR.ENTER_BR && item.grandparent.getName() != 'td' ) 111 currentListItem = doc.createElement( paragraphName ); 111 112 else 112 113 currentListItem = new CKEDITOR.dom.documentFragment( doc ); 113 114 } 114 115 115 116 for ( var i = 0 ; i < item.contents.length ; i++ ) 116 currentListItem.append( item.contents[i].clone( true ) );117 currentListItem.append( item.contents[i].clone( true, true ) ); 117 118 118 119 if ( currentListItem.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT ) 119 120 { … … 124 125 currentListItem.append( doc.createElement( 'br' ) ); 125 126 } 126 127 127 if ( currentListItem.getName() == paragraph Mode && currentListItem.$.firstChild )128 if ( currentListItem.getName() == paragraphName && currentListItem.$.firstChild ) 128 129 { 129 130 currentListItem.trim(); 130 131 var firstChild = currentListItem.getFirst(); … … 364 365 body.trim(); 365 366 if ( !body.getFirst() ) 366 367 { 367 var paragraph = doc.createElement( editor.config.enterMode ); 368 var paragraph = doc.createElement( editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' : 369 ( editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'br' ) ); 368 370 paragraph.appendTo( body ); 369 371 ranges = [ new CKEDITOR.dom.range( doc ) ]; 370 372 ranges[0].selectNodeContents( paragraph ); -
_source/core/dom/node.js
92 92 return element; 93 93 }, 94 94 95 clone : function( includeChildren )95 clone : function( includeChildren, cloneId ) 96 96 { 97 97 var $clone = this.$.cloneNode( includeChildren ); 98 98 99 if ( this.type == CKEDITOR.NODE_ELEMENT )99 if ( this.type == CKEDITOR.NODE_ELEMENT && !cloneId ) 100 100 { 101 101 // The "id" attribute should never be cloned to avoid duplication. 102 102 $clone.removeAttribute( 'id', false ) ; -
_source/core/dom/documentFragment.js
34 34 'getLast' : 1, 35 35 'appendTo' : 1, 36 36 'moveChildren' : 1, 37 'insertBefore' : 1, 37 38 'insertAfterNode' : 1, 38 39 'replace' : 1, 39 40 'trim' : 1, … … 43 44 'getChildCount' : 1, 44 45 'getChild' : 1, 45 46 'getChildren' : 1 46 } ); 47 No newline at end of file 47 } );