iframe-content.js 1002 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* globals document, window, console, $ */
  6. import BalloonEditor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor';
  7. import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
  8. // Display an info when this file is ran as a standalone test.
  9. if ( window.top === window ) {
  10. document.getElementById( 'info' ).style.display = 'block';
  11. } else {
  12. BalloonEditor
  13. .create( document.querySelector( '#editor' ), {
  14. plugins: [ ArticlePluginSet ],
  15. toolbar: [ 'bold', 'link' ]
  16. } )
  17. .then( editor => {
  18. window.editor = editor;
  19. $( '#modal' ).modal( {
  20. // Make sure the modal does not steal the input focus (e.g. when editing a link).
  21. // https://github.com/ckeditor/ckeditor5/issues/1147
  22. focus: false
  23. } );
  24. } )
  25. .catch( err => {
  26. console.error( err.stack );
  27. } );
  28. }