diff --git a/CHANGES.md b/CHANGES.md index bfeae095e93..a1884ca1899 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,10 @@ CKEditor 4 Changelog ## CKEditor 4.4 +New Features: + +* [#11225](http://dev.ckeditor.com/ticket/11225): Introduced the [`CKEDITOR.tools.transparentImageData`](http://localhost/cksource/ckeditor-docs/build/#!/api/CKEDITOR.tools-property-transparentImageData) property which contains transparent image data to be used in CSS or as images' source. + ## CKEditor 4.3.3 Fixed Issues: diff --git a/core/tools.js b/core/tools.js index 7f35343c3a8..883df95e633 100644 --- a/core/tools.js +++ b/core/tools.js @@ -1116,7 +1116,15 @@ if ( withAppend ) doc.appendChild( el ); } - } + }, + + /** + * The data URI of a transparent image. May be used e.g. in HTML as an image source or in CSS in `url()`. + * + * @since 4.3.1 + * @readonly + */ + transparentImageData: 'data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==' }; } )(); diff --git a/plugins/fakeobjects/images/spacer.gif b/plugins/fakeobjects/images/spacer.gif deleted file mode 100644 index 5bfd67a2d6f..00000000000 Binary files a/plugins/fakeobjects/images/spacer.gif and /dev/null differ diff --git a/plugins/fakeobjects/plugin.js b/plugins/fakeobjects/plugin.js index f2b13cadf06..923bd2daf2c 100644 --- a/plugins/fakeobjects/plugin.js +++ b/plugins/fakeobjects/plugin.js @@ -88,7 +88,7 @@ // Do not set "src" on high-contrast so the alt text is displayed. (#8945) if ( !CKEDITOR.env.hc ) - attributes.src = CKEDITOR.getUrl( plugin.path + 'images/spacer.gif' ); + attributes.src = CKEDITOR.tools.transparentImageData; if ( realElementType ) attributes[ 'data-cke-real-element-type' ] = realElementType; @@ -133,7 +133,7 @@ // Do not set "src" on high-contrast so the alt text is displayed. (#8945) if ( !CKEDITOR.env.hc ) - attributes.src = CKEDITOR.getUrl( plugin.path + 'images/spacer.gif' ); + attributes.src = CKEDITOR.tools.transparentImageData; if ( realElementType ) attributes[ 'data-cke-real-element-type' ] = realElementType; diff --git a/plugins/widget/plugin.js b/plugins/widget/plugin.js index bce90ea33b2..339c6ad03fc 100644 --- a/plugins/widget/plugin.js +++ b/plugins/widget/plugin.js @@ -2454,9 +2454,8 @@ // WIDGET helpers --------------------------------------------------------- // - var transparentImageData = 'data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D', - // LEFT, RIGHT, UP, DOWN, DEL, BACKSPACE - unblock default fake sel handlers. - keystrokesNotBlockedByWidget = { 37: 1, 38: 1, 39: 1, 40: 1, 8: 1, 46: 1 }; + // LEFT, RIGHT, UP, DOWN, DEL, BACKSPACE - unblock default fake sel handlers. + var keystrokesNotBlockedByWidget = { 37: 1, 38: 1, 39: 1, 40: 1, 8: 1, 46: 1 }; function cancel( evt ) { evt.cancel(); @@ -2597,7 +2596,7 @@ img.setAttributes( { 'class': 'cke_reset cke_widget_drag_handler', 'data-cke-widget-drag-handler': '1', - src: transparentImageData, + src: CKEDITOR.tools.transparentImageData, width: DRAG_HANDLER_SIZE, title: editor.lang.widget.move, height: DRAG_HANDLER_SIZE @@ -2748,7 +2747,7 @@ if ( !img ) { img = new CKEDITOR.dom.element( 'img', widget.editor.document ); img.setAttributes( { - src: transparentImageData, + src: CKEDITOR.tools.transparentImageData, 'class': 'cke_reset cke_widget_mask' } ); widget.wrapper.append( img );