Skip to content
Permalink
Browse files

Merge branch 't/13103'

  • Loading branch information...
Reinmar committed May 4, 2015
2 parents 08cc370 + d9992cf commit 56ad8fc19faa198d948c2652a9384fff428f59fe
@@ -14,6 +14,7 @@ Fixed Issues:
* [#12729](http://dev.ckeditor.com/ticket/12729): Incorrect structure created when merging a block into a list item on *Backspace* and *Delete*.
* [#13031](http://dev.ckeditor.com/ticket/13031): [Firefox] Fixed: No more line breaks in source view since Firefox 36.
* [#13131](http://dev.ckeditor.com/ticket/13131): Fixed: The [Code Snippet](http://ckeditor.com/addon/codesnippet) plugin cannot be used without the [IFrame Editing Area](http://ckeditor.com/addon/wysiwygarea) plugin.
* [#13103](http://dev.ckeditor.com/ticket/13103): Upgraded [Bender.js](https://github.com/benderjs/benderjs) to 0.2.3.

Other Changes:

@@ -3,7 +3,7 @@
"version": "4.4.8",
"description": "The development version of CKEditor - JavaScript WYSIWYG web text editor.",
"devDependencies": {
"benderjs": "~0.2.1",
"benderjs": "~0.2.3",
"benderjs-jquery": "~0.3.0",
"benderjs-sinon": "~0.2.1",
"benderjs-yui": "~0.2.3",
@@ -38,8 +38,9 @@ module.exports = {

// add CKEditor plugins/adapters configuration if needed
if ( data.ckeditor && (
data.ckeditor.plugins || data.ckeditor[ 'remove-plugins' ] || data.ckeditor.adapters
) ) {
data.ckeditor.plugins || data.ckeditor[ 'remove-plugins' ] ||
( data.ckeditor.remove && data.ckeditor.remove.plugins ) || data.ckeditor.adapters
) ) {
head.push(
'<script>\n(function (bender) {\n',
'bender.configureEditor(',
@@ -14,8 +14,19 @@
* @return {Object}
*/
function build( data ) {
function toArray( str ) {
return str.replace( /\s/g, '' ).split( ',' );
// converts recursively strings found in an object to arrays
function convert( obj ) {
if ( typeof obj == 'string' ) {
return obj.trim().split( /\s*,\s*/ );
}

if ( obj && typeof obj == 'object' && !Array.isArray( obj ) ) {
Object.keys( obj ).forEach( function( key ) {
obj[ key ] = convert( obj[ key ] );
} );
}

return obj;
}

Object.keys( data.tests ).forEach( function( id ) {
@@ -25,9 +36,7 @@ function build( data ) {
return;
}

Object.keys( test.ckeditor ).forEach( function( key ) {
test.ckeditor[ key ] = toArray( test.ckeditor[ key ] );
} );
test.ckeditor = convert( test.ckeditor );
} );

return data;
@@ -353,8 +353,9 @@
}

bender.configureEditor = function( config ) {
var regexp,
toLoad = 0,
var toLoad = 0,
removePlugins,
regexp,
i;

if ( config.plugins ) {
@@ -363,10 +364,13 @@
config.plugins.join( ',' );
}

if ( config[ 'remove-plugins' ] ) {
CKEDITOR.config.removePlugins = config[ 'remove-plugins' ].join( ',' );
// support both Bender <= 0.2.2 and >= 0.2.3 directives
removePlugins = config[ 'remove-plugins' ] || ( config.remove && config.remove.plugins );

regexp = new RegExp( '(?:^|,)(' + config[ 'remove-plugins' ].join( '|' ) + ')(?=,|$)', 'g' );
if ( removePlugins ) {
CKEDITOR.config.removePlugins = removePlugins.join( ',' );

regexp = new RegExp( '(?:^|,)(' + removePlugins.join( '|' ) + ')(?=,|$)', 'g' );

CKEDITOR.config.plugins = CKEDITOR.config.plugins
.replace( regexp, '' )
@@ -481,7 +485,7 @@
if ( bender.editor ) {
if ( tests[ 'async:init' ] || tests.init ) {
throw 'The "init/async:init" is not supported in conjunction' +
' with bender.editor, use "setUp" instead.';
' with bender.editor, use "setUp" instead.';
}

tests[ 'async:init' ] = function() {

0 comments on commit 56ad8fc

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