Skip to content
Permalink
Browse files

Merge branch 't/11478b'

  • Loading branch information...
adelura committed Jun 11, 2014
2 parents 91779e8 + 734f9f1 commit c41e10c756e8d3dd1a8b50d6e8fdd3224ecd9c98
Showing with 64 additions and 0 deletions.
  1. +1 −0 CHANGES.md
  2. +4 −0 core/tools.js
  3. +32 −0 tests/core/tools.js
  4. +2 −0 tests/tickets/11478/1.html
  5. +25 −0 tests/tickets/11478/1.js
@@ -5,6 +5,7 @@ CKEditor 4 Changelog

Fixed Issues:

* [#11478](http://dev.ckeditor.com/ticket/11478): Fixed: Issue with passing jQuery objects to adapter configuration.
* [#10867](http://dev.ckeditor.com/ticket/10867): Fixed: Issue with setting encoded URI as image's link.
* [#10091](http://dev.ckeditor.com/ticket/10091): Blockquote should be treated like an object by the styles system. Thanks to [dan-james-deeson](https://github.com/dan-james-deeson)!
* [#11983](http://dev.ckeditor.com/ticket/11983): Fixed: Clicking a nested widget does not focus it. Additionally, performance of the [`widget.repository.getByElement()`](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget.repository-method-getByElement) method has been improved.
@@ -109,6 +109,10 @@
if ( obj === null || ( typeof( obj ) != 'object' ) || ( obj instanceof String ) || ( obj instanceof Number ) || ( obj instanceof Boolean ) || ( obj instanceof Date ) || ( obj instanceof RegExp ) )
return obj;

// DOM objects and window.
if ( obj.nodeType || obj.window === obj )
return obj;

// Objects.
clone = new obj.constructor();

@@ -141,10 +141,42 @@ bender.test(
assert.areSame( 'John', obj.name );
assert.areSame( 'Paul', clone.name );

assert.areNotSame( obj.cars, clone.cars );
assert.areSame( 'red', obj.cars.Porsche.color );
assert.areSame( 'silver', clone.cars.Porsche.color );
},

test_clone_DOM: function() {
var anchor = document.createElement( 'a' );
var obj = {
anchor: anchor
};

var clone = CKEDITOR.tools.clone( obj );

assert.areSame( clone.anchor, anchor );
},

test_clone_Window: function() {
var obj = {
window: window
};

var clone = CKEDITOR.tools.clone( obj );

assert.areSame( clone.window, window );
},

test_clone_Document: function() {
var obj = {
document: document
};

var clone = CKEDITOR.tools.clone( obj );

assert.areSame( clone.document, document );
},

test_repeat: function() {
assert.areSame( '   ', CKEDITOR.tools.repeat( ' ', 3 ) );
},
@@ -0,0 +1,2 @@
<div id="container"></div>
<textarea id="editable" cols="80" rows="10">editor1</textarea>
@@ -0,0 +1,25 @@
/* bender-tags: editor,unit */
/* bender-ckeditor-adapters: jquery */
/* bender-ckeditor-plugins: wysiwygarea */

( function() {
'use strict';

bender.test( {
'test pass jQuery object into config': function() {
var configObj = {
element: $( '#container' )
};

$( '#editable' ).ckeditor( function() {
var editor = this;

resume( function() {
assert.areSame( configObj.element[ 0 ], editor.config.element[ 0 ], 'element was passed safely to editor.config' );
} );
}, configObj );

wait();
}
} );
} )();

0 comments on commit c41e10c

Please sign in to comment.
You can’t perform that action at this time.