editor.js 844 B

12345678910111213141516171819202122232425262728293031323334353637
  1. function startEditors(){
  2. let element_visual = document.getElementById("visual-editor");
  3. if(element_visual !== null) {
  4. start_visual_editor(element_visual);
  5. }
  6. }
  7. function start_visual_editor(element){
  8. let options = {
  9. "clear_button": true,
  10. "link": true,
  11. "heading": true,
  12. "list": true,
  13. "table": true,
  14. "image": true,
  15. "block": true,
  16. "code": true,
  17. "embed": true,
  18. "save": true,
  19. "load": true
  20. };
  21. visual_editor = new creta('visual-editor', element, options);
  22. let div = document.createElement('div');
  23. div.innerHTML += `<div id="error-ui" class="popup overflow-popup" style="display:none;">
  24. <div id="text_error">Write container class</div>
  25. <div class="close_button" onclick="this.parentElement.parentElement.style.display = 'none';">🗙</div>
  26. </div>`;
  27. visual_editor.add_ui_element(element, div);
  28. }