Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #50 from ckeditor/t/49
Browse files Browse the repository at this point in the history
Other: Changed from original to default image. Closes #49.
  • Loading branch information
Piotr Jasiun committed Aug 16, 2017
2 parents f4efd9b + 12e11a1 commit d8d61f3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/filerepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,13 @@ mix( FileLoader, ObservableMixin );
* resolved with an object containing information about uploaded file:
*
* {
* original: 'http://server/orginal-size.image.png'
* default: 'http://server/default-size.image.png'
* }
*
* Additionally, other image sizes can be provided:
*
* {
* original: 'http://server/orginal-size.image.png',
* default: 'http://server/default-size.image.png',
* '160': 'http://server/size-160.image.png',
* '500': 'http://server/size-500.image.png',
* '1000': 'http://server/size-1000.image.png'
Expand Down
2 changes: 1 addition & 1 deletion src/imageuploadengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default class ImageUploadEngine extends Plugin {
.then( data => {
doc.enqueueChanges( () => {
doc.batch( 'transparent' ).setAttribute( imageElement, 'uploadStatus', 'complete' );
doc.batch( 'transparent' ).setAttribute( imageElement, 'src', data.original );
doc.batch( 'transparent' ).setAttribute( imageElement, 'src', data.default );

// Srcset attribute for responsive images support.
const srcsetAttribute = Object.keys( data )
Expand Down
4 changes: 2 additions & 2 deletions tests/imageuploadengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe( 'ImageUploadEngine', () => {
done();
} );

adapterMock.mockSuccess( { original: 'image.png' } );
adapterMock.mockSuccess( { default: 'image.png' } );
} );

nativeReaderMock.mockSuccess( base64Sample );
Expand Down Expand Up @@ -354,7 +354,7 @@ describe( 'ImageUploadEngine', () => {
done();
} );

adapterMock.mockSuccess( { original: 'image.png', 500: 'image-500.png', 800: 'image-800.png' } );
adapterMock.mockSuccess( { default: 'image.png', 500: 'image-500.png', 800: 'image-800.png' } );
} );

nativeReaderMock.mockSuccess( base64Sample );
Expand Down
2 changes: 1 addition & 1 deletion tests/imageuploadprogress.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe( 'ImageUploadProgress', () => {
done();
} );

adapterMock.mockSuccess( { original: 'image.png' } );
adapterMock.mockSuccess( { default: 'image.png' } );
} );

nativeReaderMock.mockSuccess( base64Sample );
Expand Down
2 changes: 1 addition & 1 deletion tests/manual/imageupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function createProgressButton( loader, adapterMock ) {

if ( progress == total ) {
disableButtons();
adapterMock.mockSuccess( { original: './sample.jpg' } );
adapterMock.mockSuccess( { default: './sample.jpg' } );
}

progressInfo.innerHTML = `File: ${ fileName }. Progress: ${ loader.uploadedPercent }%.`;
Expand Down

0 comments on commit d8d61f3

Please sign in to comment.