|
| 1 | +/** |
| 2 | + * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. |
| 3 | + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options |
| 4 | + */ |
| 5 | + |
| 6 | +/* globals console, window, document, ClassicEditor, CKEditorPlugins, CS_CONFIG */ |
| 7 | + |
| 8 | +import { TOKEN_URL } from '@ckeditor/ckeditor5-ckbox/tests/_utils/ckbox-config.js'; |
| 9 | + |
| 10 | +ClassicEditor |
| 11 | + .create( document.querySelector( '#snippet-link' ), { |
| 12 | + extraPlugins: [ ...Object.values( CKEditorPlugins ) ], |
| 13 | + cloudServices: CS_CONFIG, |
| 14 | + toolbar: { |
| 15 | + items: [ |
| 16 | + 'undo', 'redo', '|', 'heading', |
| 17 | + '|', 'bold', 'italic', |
| 18 | + '|', 'link', 'bookmark', 'insertImage', 'insertTable', 'mediaEmbed', |
| 19 | + '|', 'bulletedList', 'numberedList', 'outdent', 'indent' |
| 20 | + ] |
| 21 | + }, |
| 22 | + image: { |
| 23 | + toolbar: [ |
| 24 | + 'imageStyle:inline', 'imageStyle:block', 'imageStyle:wrapText', '|', |
| 25 | + 'toggleImageCaption', 'imageTextAlternative', 'ckboxImageEdit' |
| 26 | + ] |
| 27 | + }, |
| 28 | + ui: { |
| 29 | + viewportOffset: { |
| 30 | + top: window.getViewportTopOffsetConfig() |
| 31 | + } |
| 32 | + }, |
| 33 | + ckbox: { |
| 34 | + tokenUrl: TOKEN_URL, |
| 35 | + allowExternalImagesEditing: [ /^data:/, 'origin', /ckbox/ ], |
| 36 | + forceDemoLabel: true |
| 37 | + }, |
| 38 | + licenseKey: 'GPL' |
| 39 | + } ) |
| 40 | + .then( editor => { |
| 41 | + window.editor = editor; |
| 42 | + |
| 43 | + window.attachTourBalloon( { |
| 44 | + target: window.findToolbarItem( editor.ui.view.toolbar, item => item.label && item.label === 'Link' ), |
| 45 | + text: 'Click to create a link.', |
| 46 | + editor |
| 47 | + } ); |
| 48 | + } ) |
| 49 | + .catch( err => { |
| 50 | + console.error( err.stack ); |
| 51 | + } ); |
0 commit comments