Ticket #6735: 6735.patch
File 6735.patch, 3.0 KB (added by , 14 years ago) |
---|
-
_source/core/dom/node.js
684 684 { 685 685 if ( current.type == CKEDITOR.NODE_ELEMENT ) 686 686 { 687 if ( current.is( 'body' ) || current.getCustomData( '_cke_notReadOnly' ) ) 688 break; 689 690 if ( current.getAttribute( 'contentEditable' ) == 'false' ) 687 if ( current.getAttribute( 'contentEditable' ) == 'false' && !current.getCustomData( '_cke_notReadOnly' ) ) 691 688 return current; 692 else if ( current. getAttribute( 'contentEditable' ) == 'true' )689 else if ( current.is( 'body' ) || current.getAttribute( 'contentEditable' ) == 'true' ) 693 690 break; 694 691 } 695 692 current = current.getParent(); -
_source/plugins/selection/plugin.js
1222 1222 // range position and scroll relatively to it. 1223 1223 var start = this.getStartElement(); 1224 1224 start.scrollIntoView(); 1225 }, 1226 1227 /** 1228 * Check if current selection is read only with respect to contenteditable="false" blocks 1229 */ 1230 checkIsReadOnly : function() 1231 { 1232 var ranges = this.getRanges(), 1233 startNode = ranges[0].startContainer, 1234 endNode = ranges[ ranges.length - 1 ].endContainer, 1235 commonAncestor = startNode.getCommonAncestor( endNode ), 1236 currentNode = startNode; 1237 if ( endNode === startNode ) 1238 endNode = 0; 1239 do { 1240 if ( currentNode.isReadOnly() ) 1241 return true; 1242 } while ( currentNode!==commonAncestor && ( currentNode = currentNode.getParent() ) || ( currentNode = endNode ) && !( endNode = 0 ) ); 1243 return false; 1225 1244 } 1226 1245 }; 1227 1246 })(); -
_source/plugins/wysiwygarea/plugin.js
1 /*1 /* 2 2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 25 25 || element.isBlockBoundary() && CKEDITOR.dtd.$empty[ element.getName() ]; 26 26 } 27 27 28 function checkReadOnly( selection )29 {30 if ( selection.getType() == CKEDITOR.SELECTION_ELEMENT )31 return selection.getSelectedElement().isReadOnly();32 else33 return selection.getCommonAncestor().isReadOnly();34 }35 36 28 function onInsertHtml( evt ) 37 29 { 38 30 if ( this.mode == 'wysiwyg' ) … … 40 32 this.focus(); 41 33 42 34 var selection = this.getSelection(); 43 if ( checkReadOnly( selection) )35 if ( selection.checkIsReadOnly() ) 44 36 return; 45 37 46 38 var data = evt.data; … … 116 108 this.focus(); 117 109 118 110 var selection = this.getSelection(); 119 if ( checkReadOnly( selection) )111 if ( selection.checkIsReadOnly() ) 120 112 return; 121 113 122 114 this.fire( 'saveSnapshot' );