Skip to content

Commit

Permalink
Merge branch 'master' into t/ckeditor5-ui/262
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Nov 2, 2017
2 parents 070157b + 970be95 commit ef71bd0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 34 deletions.
20 changes: 10 additions & 10 deletions docs/_snippets/examples/balloon-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
/* globals console, window, document */

import BalloonEditor from '@ckeditor/ckeditor5-build-balloon/src/ckeditor';
import getToken from '@ckeditor/ckeditor5-easy-image/tests/_utils/gettoken';

getToken()
.then( token => {
return BalloonEditor
.create( document.querySelector( '#snippet-balloon-editor' ), {
cloudServices: { token }
} )
.then( editor => {
window.editor = editor;
} );
import { TOKEN_URL } from '@ckeditor/ckeditor5-cloudservices/tests/_utils/cloudservices-config';

BalloonEditor
.create( document.querySelector( '#snippet-balloon-editor' ), {
cloudServices: {
tokenUrl: TOKEN_URL
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err );
Expand Down
25 changes: 12 additions & 13 deletions docs/_snippets/examples/classic-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@

/* globals ClassicEditor, console, window, document */

import getToken from '@ckeditor/ckeditor5-easy-image/tests/_utils/gettoken';
import { TOKEN_URL } from '@ckeditor/ckeditor5-cloudservices/tests/_utils/cloudservices-config';

getToken()
.then( token => {
return ClassicEditor
.create( document.querySelector( '#snippet-classic-editor' ), {
cloudServices: { token },
toolbar: {
viewportTopOffset: 60
}
} )
.then( editor => {
window.editor = editor;
} );
ClassicEditor
.create( document.querySelector( '#snippet-classic-editor' ), {
cloudServices: {
tokenUrl: TOKEN_URL
},
toolbar: {
viewportTopOffset: 60
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err );
Expand Down
18 changes: 8 additions & 10 deletions docs/_snippets/examples/inline-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* globals console, window, document */

import InlineEditor from '@ckeditor/ckeditor5-build-inline/src/ckeditor';
import getToken from '@ckeditor/ckeditor5-easy-image/tests/_utils/gettoken';
import { TOKEN_URL } from '@ckeditor/ckeditor5-cloudservices/tests/_utils/cloudservices-config';

const inlineInjectElements = document.querySelectorAll( '#snippet-inline-editor [data-inline-inject]' );

Expand All @@ -18,6 +18,9 @@ Array.from( inlineInjectElements ).forEach( inlineElement => {
},
toolbar: {
viewportTopOffset: 60
},
cloudServices: {
tokenUrl: TOKEN_URL
}
};

Expand All @@ -36,15 +39,10 @@ Array.from( inlineInjectElements ).forEach( inlineElement => {
config.toolbar.items = [ 'headings', 'bold', 'italic', 'link' ];
}

getToken()
.then( token => {
config.cloudServices = { token };

return InlineEditor
.create( inlineElement, config )
.then( editor => {
window.editor = editor;
} );
InlineEditor
.create( inlineElement, config )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err );
Expand Down
2 changes: 1 addition & 1 deletion docs/features/image-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To make enabling image upload in CKEditor 5 a breeze, by default all builds incl
ClassicCreator
.create( document.querySelector( '#editor' ), {
cloudServices: {
token: 'token-retrieved-from-the-cs-token-server'
tokenUrl: 'http://url-to-retrieve-token.example.com/'
}
} )
.then( ... )
Expand Down

0 comments on commit ef71bd0

Please sign in to comment.