wysiwyg.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {% removeemptylines %}
  2. {% assign id = include.id | default: 'mytextarea' %}
  3. <form method="post">
  4. <textarea id="hugerte-{{ id }}">Hello, <b>Tabler</b>!</textarea>
  5. </form>
  6. {% capture script %}
  7. {% removeemptylines %}
  8. <script>
  9. document.addEventListener("DOMContentLoaded", function () {
  10. let options = {
  11. selector: '#hugerte-{{ id }}',
  12. height: 300,
  13. menubar: false,
  14. statusbar: false,
  15. license_key: 'gpl',
  16. plugins: [
  17. 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview', 'anchor',
  18. 'searchreplace', 'visualblocks', 'code', 'fullscreen',
  19. 'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount'
  20. ],
  21. toolbar: 'undo redo | formatselect | ' +
  22. 'bold italic backcolor | alignleft aligncenter ' +
  23. 'alignright alignjustify | bullist numlist outdent indent | ' +
  24. 'removeformat',
  25. content_style: 'body { font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }'
  26. }
  27. if (localStorage.getItem("tablerTheme") === 'dark') {
  28. options.skin = 'oxide-dark';
  29. options.content_css = 'dark';
  30. }
  31. hugeRTE.init(options);
  32. })
  33. </script>
  34. {% endremoveemptylines %}
  35. {% endcapture -%}
  36. {%- capture_script %}
  37. {{ script }}
  38. {% endcapture_script %}
  39. {% endremoveemptylines %}