Skip to content

Commit

Permalink
Merge branch 't/13603'
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Aug 10, 2015
2 parents d927e87 + a626481 commit e52e3b8
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CKEditor 4 Changelog
New Features:

* [#13501](http://dev.ckeditor.com/ticket/13501): Added [`config.fileTools_defaultFileName`](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-fileTools_defaultFileName) option to allow setting default filename for paste uploads.
* [#13603](http://dev.ckeditor.com/ticket/13603): Added support for uploading dropped BMP images.

Fixed Issues:

Expand Down
2 changes: 1 addition & 1 deletion plugins/uploadimage/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

// Handle images which are available in the dataTransfer.
fileTools.addUploadWidget( editor, 'uploadimage', {
supportedTypes: /image\/(jpeg|png|gif)/,
supportedTypes: /image\/(jpeg|png|gif|bmp)/,

uploadUrl: uploadUrl,

Expand Down
58 changes: 41 additions & 17 deletions tests/plugins/uploadimage/uploadimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,39 +206,63 @@
},

'test supportedTypes png': function() {
var editor = this.editors.classic;
var bot = this.editorBots.classic,
editor = this.editors.classic;

resumeAfter( editor, 'paste', function() {
assertUploadingWidgets( editor, LOADING_IMG );
} );
bot.setData( '', function() {
resumeAfter( editor, 'paste', function() {
assertUploadingWidgets( editor, LOADING_IMG );
} );

pasteFiles( editor, [ { name: 'test.png', type: 'image/png' } ] );
pasteFiles( editor, [ { name: 'test.png', type: 'image/png' } ] );

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

'test supportedTypes jpg': function() {
var editor = this.editors.classic;
var bot = this.editorBots.classic,
editor = this.editors.classic;

resumeAfter( editor, 'paste', function() {
assertUploadingWidgets( editor, LOADING_IMG );
} );
bot.setData( '', function() {
resumeAfter( editor, 'paste', function() {
assertUploadingWidgets( editor, LOADING_IMG );
} );

pasteFiles( editor, [ { name: 'test.jpg', type: 'image/jpeg' } ] );
pasteFiles( editor, [ { name: 'test.jpg', type: 'image/jpeg' } ] );

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

'test supportedTypes gif': function() {
var editor = this.editors.classic;
var bot = this.editorBots.classic,
editor = this.editors.classic;

resumeAfter( editor, 'paste', function() {
assertUploadingWidgets( editor, LOADING_IMG );
bot.setData( '', function() {
resumeAfter( editor, 'paste', function() {
assertUploadingWidgets( editor, LOADING_IMG );
} );

pasteFiles( editor, [ { name: 'test.gif', type: 'image/gif' } ] );

wait();
} );
},

pasteFiles( editor, [ { name: 'test.gif', type: 'image/gif' } ] );
'test supportedTypes bmp': function() {
var bot = this.editorBots.classic,
editor = this.editors.classic;

wait();
bot.setData( '', function() {
resumeAfter( editor, 'paste', function() {
assertUploadingWidgets( editor, LOADING_IMG );
} );

pasteFiles( editor, [ { name: 'test.bmp', type: 'image/bmp' } ] );

wait();
} );
},

'test not supportedTypes tiff': function() {
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/uploadwidget/manual/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Test if photo uploading works properly:

* Dropped image should be replaced by a temporary `upload widget` and by the final image (`image` plugin) when upload is done.
* `jpg`, `png` and `gif` files should be supported.
* `jpg`, `png`, `gif` and `bmp` files should be supported.
* Undo and redo during and after upload should work fine.
* It should be possible to format text and copy image during upload.
* If image is removed during upload, the process should be aborted.
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/uploadwidget/manual/image2.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Test if photo uploading works properly:

* Dropped image should be replaced by a temporary `upload widget` and by the final image (`image2` plugin) when upload is dome.
* `jpg`, `png` and `gif` files should be supported.
* `jpg`, `png`, `gif` and `bmp` files should be supported.
* Undo and redo during and after upload should work fine.
* It should be possible to format text and copy image during upload.
* If image is removed during upload, the process should be aborted.
Expand Down

0 comments on commit e52e3b8

Please sign in to comment.