Ticket #8950: 8950.patch
File 8950.patch, 5.4 KB (added by , 12 years ago) |
---|
-
_source/core/dom/elementpath.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
103 103 return true; 104 104 }, 105 105 106 contains : function( tagNames ) 106 /** 107 * Search the path elements that meets the specified criteria. 108 * @param {*} query The criteria that can be either a tag name, list of tag names, or an node evaluator function. 109 * @param {Boolean} fromTop Search start from the topmost element instead of bottom. 110 * @return {CKEDITOR.dom.element} The first matched dom element. 111 */ 112 contains: function( query, fromTop ) 107 113 { 108 var elements = this.elements; 109 for ( var i = 0 ; i < elements.length ; i++ ) 110 { 111 if ( elements[ i ].getName() in tagNames ) 114 var evaluator; 115 if ( typeof query == 'string' ) 116 evaluator = function( node ) 117 { 118 return node.getName() == query; 119 }; 120 if ( query instanceof CKEDITOR.dom.element ) 121 evaluator = function( node ) 122 { 123 return node.equals( query ); 124 }; 125 else if ( CKEDITOR.tools.isArray( query ) ) 126 evaluator = function( node ) 127 { 128 return CKEDITOR.tools.indexOf( node.getName() ) > -1; 129 }; 130 else if ( typeof query == 'function' ) 131 evaluator = query; 132 else if ( typeof query == 'object' ) 133 evaluator = function( node ) 134 { 135 return node.getName() in query; 136 }; 137 138 var elements = this.elements, 139 length = elements.length; 140 141 if ( fromTop ) 142 { 143 elements = Array.prototype.slice.call( elements, 0 ); 144 elements.reverse(); 145 } 146 147 for ( var i = 0; i < length; i++ ) 148 { 149 if ( evaluator( elements[ i ] ) ) 112 150 return elements[ i ]; 113 151 } 114 152 -
_source/plugins/wysiwygarea/plugin.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
265 265 266 266 if ( lastElement ) 267 267 { 268 range.moveToPosition( lastElement, CKEDITOR.POSITION_AFTER_END ); 268 // Cursor should be placed at the end of the inserted content. 269 range.moveToElementEditEnd( lastElement ); 269 270 270 // If we're inserting a block element immediatelly followed by 271 // another block element, the selection must move there. (#3100,#5436) 272 if ( isBlock ) 271 // If we're inserting a empty block element immediately followed by 272 // another text block, the selection must move there. (#3100,#5436) 273 var path = new CKEDITOR.dom.elementPath( range.startContainer ); 274 if ( !( path.contains( lastElement ) || path.block ) ) 273 275 { 274 276 var next = lastElement.getNext( notWhitespaceEval ), 275 277 nextName = next && next.type == CKEDITOR.NODE_ELEMENT && next.getName(); -
_source/core/dom/element.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
736 736 || this.getComputedStyle( 'display' ) == 'none' 737 737 || this.getComputedStyle( 'visibility' ) == 'hidden' 738 738 || this.is( 'a' ) && this.data( 'cke-saved-name' ) && !this.getChildCount() 739 || CKEDITOR.dtd.$nonEditable[ name ] ) 739 || CKEDITOR.dtd.$nonEditable[ name ] 740 || CKEDITOR.dtd.$empty[ name ] ) 740 741 { 741 742 return false; 742 743 } -
_source/core/dom/range.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
513 513 if ( serializable ) 514 514 { 515 515 baseId = 'cke_bm_' + CKEDITOR.tools.getNextNumber(); 516 startNode.setAttribute( 'id', baseId + 'S');516 startNode.setAttribute( 'id', baseId + ( collapsed ? 'C' : 'S' ) ); 517 517 } 518 518 519 519 // If collapsed, the endNode will not be created. … … 544 544 this.moveToPosition( startNode, CKEDITOR.POSITION_AFTER_END ); 545 545 546 546 return { 547 startNode : serializable ? baseId + 'S': startNode,547 startNode : serializable ? baseId + ( collapsed ? 'C' : 'S' ) : startNode, 548 548 endNode : serializable ? baseId + 'E' : endNode, 549 549 serializable : serializable, 550 550 collapsed : collapsed … … 1938 1938 { 1939 1939 var next; 1940 1940 1941 if ( node.type == CKEDITOR.NODE_ELEMENT 1942 && node.isEditable( false ) 1943 && !CKEDITOR.dtd.$nonEditable[ node.getName() ] ) 1944 { 1941 if ( node.type == CKEDITOR.NODE_ELEMENT && node.isEditable( false ) ) 1945 1942 next = node[ isMoveToEnd ? 'getLast' : 'getFirst' ]( nonWhitespaceOrBookmarkEval ); 1946 }1947 1943 1948 1944 if ( !childOnly && !next ) 1949 1945 next = node[ isMoveToEnd ? 'getPrevious' : 'getNext' ]( nonWhitespaceOrBookmarkEval ); 1950 1946 1951 1947 return next; 1948 } 1949 1950 // Handle non-editable element e.g. HR. 1951 if ( el.type == CKEDITOR.NODE_ELEMENT && !el.isEditable( false ) ) 1952 { 1953 this.moveToPosition( el, isMoveToEnd ? 1954 CKEDITOR.POSITION_AFTER_END : 1955 CKEDITOR.POSITION_BEFORE_START ); 1956 return true; 1952 1957 } 1953 1958 1954 1959 var found = 0;