ckeditor.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import DecoupledDocumentEditor from '../../build/ckeditor';
  6. const editorData = `<h2>About CKEditor&nbsp;5</h2>
  7. <p>This is <a href="https://ckeditor5.github.io">CKEditor&nbsp;5</a>.</p>
  8. <figure class="image">
  9. <img src="./sample.jpg" alt="Autumn fields" />
  10. </figure>
  11. <p>After more than 2 years of building the next generation editor from scratch and closing over 980 tickets,
  12. we created a highly <strong>extensible and flexible architecture</strong> which consists of an <strong>amazing
  13. editing framework</strong> and <strong>editing solutions</strong> that will be built on top of it.</p>
  14. <p>We explained this design choice in
  15. <a href="https://medium.com/content-uneditable/ckeditor-5-the-future-of-rich-text-editing-2b9300f9df2c">&ldquo;CKEditor 5:
  16. The future of rich text editing&ldquo;</a>:</p>
  17. <blockquote><p>(…) we are changing our approach with CKEditor 5. We will no longer have only two solutions
  18. available, instead CKEditor will be seen as a framework for editing solutions. At the same time, we will be
  19. developing several out-of-the-box solutions based on it, which will be available to use in many different contexts.
  20. It will be a real “one size fits all” approach, from little requirements, to super advanced full featured
  21. applications.</p></blockquote>
  22. <h3>Notes</h3>
  23. <p><a href="https://ckeditor5.github.io">CKEditor&nbsp;5</a> is <i>under heavy development</i> and this demo
  24. is not production-ready software. For example:</p>
  25. <ul>
  26. <li><strong>Only Chrome, Opera and Safari are supported</strong>.</li>
  27. <li>Firefox requires enabling the
  28. <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">
  29. &ldquo;dom.select_events.enabled&rdquo;</a> option.</li>
  30. <li><a href="https://github.com/ckeditor/ckeditor5/issues/342">Support for pasting</a>
  31. is under development (content filtering is unstable).</li>
  32. </ul>
  33. <p>It has <em>bugs</em> that we are aware of &mdash; and that we will be working on in the next few
  34. iterations of the project. Stay tuned for some updates soon!</p>`;
  35. DecoupledDocumentEditor
  36. .create( editorData, {
  37. toolbarContainer: '.toolbar-container',
  38. editableContainer: '.editable-container',
  39. } )
  40. .then( editor => {
  41. window.editor = editor;
  42. } )
  43. .catch( err => {
  44. console.error( err.stack );
  45. } );