Skip to content

Commit 56ad8fc

Browse files
committed
Merge branch 't/13103'
2 parents 08cc370 + d9992cf commit 56ad8fc

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Fixed Issues:
1414
* [#12729](http://dev.ckeditor.com/ticket/12729): Incorrect structure created when merging a block into a list item on *Backspace* and *Delete*.
1515
* [#13031](http://dev.ckeditor.com/ticket/13031): [Firefox] Fixed: No more line breaks in source view since Firefox 36.
1616
* [#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.
17+
* [#13103](http://dev.ckeditor.com/ticket/13103): Upgraded [Bender.js](https://github.com/benderjs/benderjs) to 0.2.3.
1718

1819
Other Changes:
1920

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "4.4.8",
44
"description": "The development version of CKEditor - JavaScript WYSIWYG web text editor.",
55
"devDependencies": {
6-
"benderjs": "~0.2.1",
6+
"benderjs": "~0.2.3",
77
"benderjs-jquery": "~0.3.0",
88
"benderjs-sinon": "~0.2.1",
99
"benderjs-yui": "~0.2.3",

tests/_benderjs/ckeditor/lib/pagebuilder.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ module.exports = {
3838

3939
// add CKEditor plugins/adapters configuration if needed
4040
if ( data.ckeditor && (
41-
data.ckeditor.plugins || data.ckeditor[ 'remove-plugins' ] || data.ckeditor.adapters
42-
) ) {
41+
data.ckeditor.plugins || data.ckeditor[ 'remove-plugins' ] ||
42+
( data.ckeditor.remove && data.ckeditor.remove.plugins ) || data.ckeditor.adapters
43+
) ) {
4344
head.push(
4445
'<script>\n(function (bender) {\n',
4546
'bender.configureEditor(',

tests/_benderjs/ckeditor/lib/testbuilder.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@
1414
* @return {Object}
1515
*/
1616
function build( data ) {
17-
function toArray( str ) {
18-
return str.replace( /\s/g, '' ).split( ',' );
17+
// converts recursively strings found in an object to arrays
18+
function convert( obj ) {
19+
if ( typeof obj == 'string' ) {
20+
return obj.trim().split( /\s*,\s*/ );
21+
}
22+
23+
if ( obj && typeof obj == 'object' && !Array.isArray( obj ) ) {
24+
Object.keys( obj ).forEach( function( key ) {
25+
obj[ key ] = convert( obj[ key ] );
26+
} );
27+
}
28+
29+
return obj;
1930
}
2031

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

28-
Object.keys( test.ckeditor ).forEach( function( key ) {
29-
test.ckeditor[ key ] = toArray( test.ckeditor[ key ] );
30-
} );
39+
test.ckeditor = convert( test.ckeditor );
3140
} );
3241

3342
return data;

tests/_benderjs/ckeditor/static/extensions.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@
353353
}
354354

355355
bender.configureEditor = function( config ) {
356-
var regexp,
357-
toLoad = 0,
356+
var toLoad = 0,
357+
removePlugins,
358+
regexp,
358359
i;
359360

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

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

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

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

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

0 commit comments

Comments
 (0)