Skip to content
Permalink
Browse files

Merge branch 't/13080' into major

  • Loading branch information...
Reinmar committed Jun 2, 2015
2 parents 303f15d + e776c78 commit 68643debb7b98a3b628b9bf8a8bc82b9a497ffbb
@@ -23,6 +23,7 @@ Fixed Issues:
* [#13140](http://dev.ckeditor.com/ticket/13140): Fixed: Error thrown when dropping a block widget right after itself.
* [#13176](http://dev.ckeditor.com/ticket/13176): [IE8] Fixed: Errors while drag&drop of embed widgets.
* [#13015](http://dev.ckeditor.com/ticket/13015): Fixed: Dropping image file on [Enhanced Image](http://ckeditor.com/addon/image2) causes page reload.
* [#13080](http://dev.ckeditor.com/ticket/13080): Fixed: Ugly notification when response has HTML content.
* [#13128](http://dev.ckeditor.com/ticket/13128): Fixed: Various issues regarding cloning IDs of elements:
* Fixed the default behavior of [`range.cloneContents()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.range-method-cloneContents), [`range.extractContents()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.range-method-extractContents) methods which now clone IDs similarly to their native counterparts.
* Added `cloneId` arguments to the above methods and [`range.splitBlock()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.range-method-splitBlock) and [`element.breakParent()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-breakParent). Mind the default values and special behavior in the `extracContents()` method.
@@ -9,5 +9,5 @@ CKEDITOR.plugins.setLang( 'filetools', 'en', {
httpError403: 'HTTP error occurred during file uploading (403: Forbidden).',
httpError: 'HTTP error occurred during file uploading (error status: %1).',
noUrlError: 'Upload URL is not defined.',
responseError: 'Incorrect server response format: %1'
} );
responseError: 'Incorrect server response.'
} );
@@ -178,7 +178,9 @@
}
} catch ( err ) {
// Response parsing error.
data.message = fileLoader.lang.filetools.responseError.replace( '%1', xhr.responseText );
data.message = fileLoader.lang.filetools.responseError;
window.console && window.console.log( xhr.responseText );

evt.cancel();
}
}, null, null, 999 );
@@ -637,7 +637,7 @@
},

'test error incorrect response': function() {
editorMock.lang = { filetools: { responseError: 'responseError %1' } };
editorMock.lang = { filetools: { responseError: 'responseError' } };

var loader = new FileLoader( editorMock, testFile ),
observer = observeEvents( loader );
@@ -649,8 +649,8 @@
'uploading[uploading,name.png,0/0/82,-,-,-]',
'update[uploading,name.png,0/0/82,-,-,-]',
'update[uploading,name.png,41/0/82,-,-,-]',
'error[error,name.png,82/0/82,responseError incorrect,-,-]',
'update[error,name.png,82/0/82,responseError incorrect,-,-]' ] );
'error[error,name.png,82/0/82,responseError,-,-]',
'update[error,name.png,82/0/82,responseError,-,-]' ] );
} );

loader.upload( 'http:\/\/url\/' );
@@ -170,6 +170,35 @@
sinon.stub( repository.loaders[ 1 ], 'isFinished' ).returns( true );

assert.isTrue( repository.isFinished(), '3/3' );
},

'test fileUploadResponse event': function() {
var log = window.console && sinon.stub( window.console, 'log' );

var message = 'Not a JSON';
var error = 'Error.';

// Mock.
var data = {
fileLoader: {
xhr: {
responseText: message
},

lang: {
filetools: {
responseError: error
}
}
}
};

this.editor.fire( 'fileUploadResponse', data );

log && log.restore();

assert.areEqual( data.message, error );
assert.isTrue( log ? log.calledWith( message ) : true );
}
} );
} )();

0 comments on commit 68643de

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