Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Upload Iamge plugin and prevent logging error in case of missing configuration #1266

Merged
merged 5 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

## CKEditor 4.8

**Important Notes:**

* [#1249](https://github.com/ckeditor/ckeditor-dev/issues/1249): Enabled the [Upload Image](https://ckeditor.com/cke4/addon/uploadimage) plugin by default in standard and full presets. Also it will no longer log an error in case of missing [`config.imageUploadUrl`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-imageUploadUrl) property.

New Features:

* [#662](https://github.com/ckeditor/ckeditor-dev/issues/662): Introduced image inlining for the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin.
Expand Down
1 change: 1 addition & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ CKEDITOR.editorConfig = function( config ) {
'templates,' +
'toolbar,' +
'undo,' +
'uploadimage,' +
'wysiwygarea';
// %REMOVE_END%
};
Expand Down
1 change: 1 addition & 0 deletions dev/builder/build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ var CKBUILDER_CONFIG = {
templates: 1,
toolbar: 1,
undo: 1,
uploadimage: 1,
wysiwygarea: 1
}
};
1 change: 0 additions & 1 deletion plugins/uploadimage/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
uploadUrl = fileTools.getUploadUrl( editor.config, 'image' );

if ( !uploadUrl ) {
CKEDITOR.error( 'uploadimage-config' );
return;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/plugins/uploadimage/manual/configerror.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@bender-ui: collapsed
@bender-tags: 4.5.1, bug, trac13486, filetools
@bender-tags: 4.5.1, bug, trac13486, 4.8.0, 1249, filetools
@bender-ckeditor-plugins: uploadimage, wysiwygarea, toolbar, basicstyles

Run this test with the console opened.

Expected:

* Editor should be fully functional except the `uploadimage` plugin.
* No errors on IE8-9, an error logged in the console that `upload URL` was not set on other browsers.
* No errors in the console on any browser.
14 changes: 14 additions & 0 deletions tests/plugins/uploadimage/uploadimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,20 @@
} );

wait();
},

'test no error if missing configuration': function() {
var spy = sinon.spy( CKEDITOR, 'error' );

bender.editorBot.create( {
name: 'configerror_test',
extraPlugins: 'uploadimage'
}, function( bot ) {
spy.restore();

assert.areSame( 0, spy.callCount, 'CKEDITOR.error call count' );
assert.isFalse( !!bot.editor.widgets.registered.uploadimage, 'uploadimage widget' );
} );
}
} );
} )();