Skip to content
Permalink
Browse files

Merge branch 't/13361'

  • Loading branch information
mlewand committed Oct 20, 2015
2 parents a1cbaa5 + cccaf79 commit e634323a9c14bdd314733fbbddad4b89800100c9
@@ -3,8 +3,11 @@ CKEditor 4 Changelog

## CKEditor 4.5.5

Fixed Issues:

* [#13790](https://dev.ckeditor.com/ticket/13790): Fixed: Allow for the iframe having been removed already. Thanks to [Stefan Rijnhart](https://github.com/StefanRijnhart)!
* [#13803](https://dev.ckeditor.com/ticket/13803): Fixed: Allow the editor to be destroyed before being fully initialized. Thanks to [Cyril Fluck](https://github.com/cyril-sf)!
* [#13361](http://dev.ckeditor.com/ticket/13361): Fixed: Images fail when site path includes parentheses because background-image path needs single-quotes around URL value.

## CKEditor 4.5.4

@@ -1,4 +1,4 @@
/**
/**
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
@@ -125,8 +125,12 @@
offset = overrideOffset || ( icon && icon.offset );
bgsize = overrideBgsize || ( icon && icon.bgsize ) || '16px';

// If we use apostrophes in background-image, we must escape apostrophes in path (just to be sure). (#13361)
if ( path )
path = path.replace( /'/g, '\\\'' );

return path &&
( 'background-image:url(' + CKEDITOR.getUrl( path ) + ');background-position:0 ' + offset + 'px;background-size:' + bgsize + ';' );
( 'background-image:url(\'' + CKEDITOR.getUrl( path ) + '\');background-position:0 ' + offset + 'px;background-size:' + bgsize + ';' );
}
};

@@ -0,0 +1,67 @@
/* bender-tags: skin, button, 13361 */
/* bender-ckeditor-plugins: button, toolbar */

( function() {
'use strict';

var globalPath = window.location.protocol + '//' + window.location.host + '%TEST_DIR%' + '_assets/',
saveIcon = globalPath + '(.png',
pasteIcon = globalPath + '\'.png',
undoIcon = globalPath + ').png';

bender.editor = {
config: {
toolbar: [ [ 'custom_save', 'custom_paste', 'custom_undo' ] ],
on: {
pluginsLoaded: function( evt ) {
var ed = evt.editor;

CKEDITOR.skin.addIcon( 'custom_save', saveIcon );
CKEDITOR.skin.addIcon( 'custom_paste', pasteIcon );
CKEDITOR.skin.addIcon( 'custom_undo', undoIcon );

ed.ui.addButton( 'custom_save', {
label: 'simple button with save icon'
} );
ed.ui.addButton( 'custom_paste', {
label: 'simple button with paste icon'
} );
ed.ui.addButton( 'custom_undo', {
label: 'simple button with undo icon'
} );
}
}
}
};

bender.test( {
'test icon with opening parenthesis': function() {
var saveBtn = this.editor.ui.get( 'custom_save' ),
saveBtnEl = CKEDITOR.document.getById( saveBtn._.id ),
saveBtnIcon = saveBtnEl.$.firstChild;

// Strict comparision doesn't make sense as old IEs return URI in other format;
// yet all browsers set elem.style.backgroundImage only if string is syntactically correct.
assert.areNotSame( '', saveBtnIcon.style.backgroundImage,
'check if custom_save button has correctly defined background-image' );
},

'test icon with closing parenthesis': function() {
var undoBtn = this.editor.ui.get( 'custom_undo' ),
undoBtnEl = CKEDITOR.document.getById( undoBtn._.id ),
undoBtnIcon = undoBtnEl.$.firstChild;

assert.areNotSame( '', undoBtnIcon.style.backgroundImage,
'check if custom_undo button has correctly defined background-image' );
},

'test icon with apostrophe': function() {
var pasteBtn = this.editor.ui.get( 'custom_paste' ),
pasteBtnEl = CKEDITOR.document.getById( pasteBtn._.id ),
pasteBtnIcon = pasteBtnEl.$.firstChild;

assert.areNotSame( '', pasteBtnIcon.style.backgroundImage,
'check if custom_paste button has correctly defined background-image' );
}
} );
} )();
@@ -0,0 +1,36 @@
<body>
<div id="editor">
<p>Example text</p>
</div>

<script>
( function() {
'use strict';

var globalPath = window.location.protocol + '//' + window.location.host + '%TEST_DIR%' + '_assets/';

CKEDITOR.replace( 'editor', {
toolbar: [ [ 'custom_save', 'custom_paste', 'custom_undo' ] ],
on: {
pluginsLoaded: function( evt ) {
var ed = evt.editor;

CKEDITOR.skin.addIcon( 'custom_save', globalPath + '(.png' );
CKEDITOR.skin.addIcon( 'custom_paste', globalPath + '\'.png' );
CKEDITOR.skin.addIcon( 'custom_undo', globalPath + ').png');

ed.ui.addButton( 'custom_save', {
label: 'simple button with save icon'
} );
ed.ui.addButton( 'custom_paste', {
label: 'simple button with paste icon'
} );
ed.ui.addButton( 'custom_undo', {
label: 'simple button with undo icon'
} );
}
}
} );
} )();
</script>
</body>
@@ -0,0 +1,12 @@
@bender-tags: tc, skin, button, 13361, 4.5.5
@bender-ui: collapsed
@bender-ckeditor-plugins: button, toolbar

----

1. Look at the editor's toolbar.

**Expected:**
* The button on the left should contain "save" icon.
* The button in the middle should contain "paste" icon.
* The button on the right should contain "undo" icon.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit e634323

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