Ticket #7216: 7216.patch
File 7216.patch, 5.9 KB (added by , 13 years ago) |
---|
-
_source/core/dom/node.js
648 648 } 649 649 }, 650 650 651 /**652 * Checks is this node is read-only (should not be changed). It653 * additionaly returns the element, if any, which defines the read-only654 * state of this node. It may be the node itself or any of its parent655 * nodes.656 * @returns {CKEDITOR.dom.element|Boolean} An element containing657 * read-only attributes or "false" if none is found.658 * @since 3.5659 * @example660 * // For the following HTML:661 * // <div contenteditable="false">Some <b>text</b></div>662 *663 * // If "ele" is the above <div>664 * ele.isReadOnly(); // the <div> element665 *666 * // If "ele" is the above <b>667 * ele.isReadOnly(); // the <div> element668 */669 651 isReadOnly : function() 670 652 { 671 var current = this; 672 while( current ) 673 { 674 if ( current.type == CKEDITOR.NODE_ELEMENT ) 675 { 676 if ( current.is( 'body' ) || !!current.data( 'cke-editable' ) ) 677 break; 678 679 if ( current.getAttribute( 'contentEditable' ) == 'false' ) 680 return current; 681 else if ( current.getAttribute( 'contentEditable' ) == 'true' ) 682 break; 683 } 684 current = current.getParent(); 685 } 686 653 // The full implementation is in the "noneditable" plugin 687 654 return false; 688 655 } 689 656 } -
_source/plugins/noneditable/plugin.js
Property changes on: _source\plugins\noneditable ___________________________________________________________________ Added: bugtraq:label + Ticket Added: bugtraq:url + http://dev.ckeditor.com/ticket/%BUGID% Added: webviewer:pathrevision + http://dev.fckeditor.net/browser/%PATH%?rev=%REVISION% Added: webviewer:revision + http://dev.fckeditor.net/changeset/%REVISION% Added: bugtraq:logregex + (?:ticket: *|#)(\d+) *(?:, *(\d+))*
1 /* 2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 */ 5 6 /** 7 * @fileOverview The "non-Editable" plugin. Adds additional styles, functions 8 * and event handlers to provide correct support for contentEditable=false 9 * elements. 10 */ 11 12 CKEDITOR.plugins.add( 'noneditable', 13 { 14 init : function( editor ) 15 { 16 17 // IE>=8 stricts mode doesn't have 'contentEditable' in effect 18 // on element unless it has layout. (#5562) 19 if ( CKEDITOR.document.$.documentMode >= 8 ) 20 { 21 editor.addCss( 'html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}' ); 22 23 var selectors = []; 24 for ( var tag in CKEDITOR.dtd.$removeEmpty ) 25 selectors.push( 'html.CSS1Compat ' + tag + '[contenteditable=false]' ); 26 editor.addCss( selectors.join( ',' ) + '{ display:inline-block;}' ); 27 } 28 29 } 30 }); 31 32 33 /** 34 * Checks if this node is read-only (should not be changed). It 35 * additionaly returns the element, if any, which defines the read-only 36 * state of this node. It may be the node itself or any of its parent 37 * nodes. 38 * Since 3.x the default implementation is a placeholder, to get the full 39 * functionality the 'noneditable' plugin must be loaded. 40 * @returns {CKEDITOR.dom.element|Boolean} An element containing 41 * read-only attributes or "false" if none is found. 42 * @since 3.5 43 * @example 44 * // For the following HTML: 45 * // <div contenteditable="false">Some <b>text</b></div> 46 * 47 * // If "ele" is the above <div> 48 * ele.isReadOnly(); // the <div> element 49 * 50 * // If "ele" is the above <b> 51 * ele.isReadOnly(); // the <div> element 52 */ 53 CKEDITOR.dom.node.prototype.isReadOnly = function() 54 { 55 var current = this; 56 while( current ) 57 { 58 if ( current.type == CKEDITOR.NODE_ELEMENT ) 59 { 60 if ( current.is( 'body' ) || !!current.data( 'cke-editable' ) ) 61 break; 62 63 if ( current.getAttribute( 'contentEditable' ) == 'false' ) 64 return current; 65 else if ( current.getAttribute( 'contentEditable' ) == 'true' ) 66 break; 67 } 68 current = current.getParent(); 69 } 70 71 return false; 72 } 73 -
_source/plugins/placeholder/plugin.js
13 13 var placeholderReplaceRegex = /\[\[[^\]]+\]\]/g; 14 14 CKEDITOR.plugins.add( 'placeholder', 15 15 { 16 requires : [ 'dialog' ],16 requires : [ 'dialog', 'noneditable' ], 17 17 lang : [ 'en' ], 18 18 init : function( editor ) 19 19 { -
_source/plugins/wysiwygarea/plugin.js
1109 1109 editor.document.$.title = frameLabel; 1110 1110 }); 1111 1111 1112 // IE>=8 stricts mode doesn't have 'contentEditable' in effect1113 // on element unless it has layout. (#5562)1114 if ( CKEDITOR.document.$.documentMode >= 8 )1115 {1116 editor.addCss( 'html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}' );1117 1118 var selectors = [];1119 for ( var tag in CKEDITOR.dtd.$removeEmpty )1120 selectors.push( 'html.CSS1Compat ' + tag + '[contenteditable=false]' );1121 editor.addCss( selectors.join( ',' ) + '{ display:inline-block;}' );1122 }1123 1112 // Set the HTML style to 100% to have the text cursor in affect (#6341) 1124 elseif ( CKEDITOR.env.gecko )1113 if ( CKEDITOR.env.gecko ) 1125 1114 editor.addCss( 'html { height: 100% !important; }' ); 1126 1115 1127 1116 // Switch on design mode for a short while and close it after then.