Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.5.1
[ckeditor.git]
/
_source
/
core
/
dom
/
node.js
diff --git
a/_source/core/dom/node.js
b/_source/core/dom/node.js
index
6611545
..
ef41e06
100644
(file)
--- a/
_source/core/dom/node.js
+++ b/
_source/core/dom/node.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
@@
-107,24
+107,25
@@
CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype,
{
\r
var $clone = this.$.cloneNode( includeChildren );
\r
\r
{
\r
var $clone = this.$.cloneNode( includeChildren );
\r
\r
- if ( !cloneId )
\r
+ var removeIds = function( node )
\r
{
\r
{
\r
- var removeIds = function( node )
\r
- {
\r
- if ( node.nodeType != CKEDITOR.NODE_ELEMENT )
\r
- return;
\r
+ if ( node.nodeType != CKEDITOR.NODE_ELEMENT )
\r
+ return;
\r
\r
\r
- node.removeAttribute( 'id', false ) ;
\r
- node.removeAttribute( '_cke_expando', false ) ;
\r
+ if ( !cloneId )
\r
+ node.removeAttribute( 'id', false );
\r
+ node.removeAttribute( 'data-cke-expando', false );
\r
\r
\r
+ if ( includeChildren )
\r
+ {
\r
var childs = node.childNodes;
\r
var childs = node.childNodes;
\r
- for ( var i=0 ; i < childs.length ; i++ )
\r
+ for ( var i=0; i < childs.length; i++ )
\r
removeIds( childs[ i ] );
\r
removeIds( childs[ i ] );
\r
- };
\r
+ }
\r
+ };
\r
\r
\r
- // The "id" attribute should never be cloned to avoid duplication.
\r
- removeIds( $clone );
\r
- }
\r
+ // The "id" attribute should never be cloned to avoid duplication.
\r
+ removeIds( $clone );
\r
\r
return new CKEDITOR.dom.node( $clone );
\r
},
\r
\r
return new CKEDITOR.dom.node( $clone );
\r
},
\r
@@
-243,13
+244,7
@@
CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype,
*/
\r
getDocument : function()
\r
{
\r
*/
\r
getDocument : function()
\r
{
\r
- var document = new CKEDITOR.dom.document( this.$.ownerDocument || this.$.parentNode.ownerDocument );
\r
-
\r
- return (
\r
- this.getDocument = function()
\r
- {
\r
- return document;
\r
- })();
\r
+ return new CKEDITOR.dom.document( this.$.ownerDocument || this.$.parentNode.ownerDocument );
\r
},
\r
\r
getIndex : function()
\r
},
\r
\r
getIndex : function()
\r
@@
-669,13
+664,13
@@
CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype,
* @since 3.5
\r
* @example
\r
* // For the following HTML:
\r
* @since 3.5
\r
* @example
\r
* // For the following HTML:
\r
- * // <div contenteditable="false">Some <b>text</b></div>
\r
+ * // <div contenteditable="false">Some <b>text</b></div>
\r
*
\r
*
\r
- * // If "ele" is the above <div>
\r
- * ele.getReadOnlyRoot(); // the <div> element
\r
+ * // If "ele" is the above <div>
\r
+ * ele.isReadOnly(); // the <div> element
\r
*
\r
*
\r
- * // If "ele" is the above <b>
\r
- * ele.getReadOnlyRoot(); // the <div> element
\r
+ * // If "ele" is the above <b>
\r
+ * ele.isReadOnly(); // the <div> element
\r
*/
\r
isReadOnly : function()
\r
{
\r
*/
\r
isReadOnly : function()
\r
{
\r
@@
-684,7
+679,7
@@
CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype,
{
\r
if ( current.type == CKEDITOR.NODE_ELEMENT )
\r
{
\r
{
\r
if ( current.type == CKEDITOR.NODE_ELEMENT )
\r
{
\r
- if ( current.is( 'body' ) || current.getCustomData( '_cke_notReadOnly' ) )
\r
+ if ( current.is( 'body' ) || !!current.data( 'cke-editable' ) )
\r
break;
\r
\r
if ( current.getAttribute( 'contentEditable' ) == 'false' )
\r
break;
\r
\r
if ( current.getAttribute( 'contentEditable' ) == 'false' )
\r