Procházet zdrojové kódy

Refactor: Replace TinyMCE with HugeRTE and update related documentation

codecalm před 4 měsíci
rodič
revize
0e935316f5

+ 0 - 1
core/scss/ui/_markdown.scss

@@ -2,7 +2,6 @@
 Markdown
  */
 .markdown {
-  font-size: $font-size-200;
   line-height: $line-height-xl;
 
   > :first-child {

+ 0 - 47
docs/content/ui/components/tinymce.md

@@ -1,47 +0,0 @@
----
-title: TinyMCE
-docs-libs: tinymce
-summary: The WYSIWYG editor that is flexible, customizable, and designed with the user in mind. TinyMCE can handle any challenge, from the most simple implementation through to the most complex use case.
-description: Flexible WYSIWYG editor for content.
----
-
-[TinyMCE](https://www.tiny.cloud/docs/) documentation.
-
-## Default text editor
-
-Initialize TinyMCE 6 on any element (or elements) on the web page by passing an object containing a selector value to `tinymce.init()`. The selector value can be any valid CSS selector.
-
-{% capture html -%}
-<form method="post">
-  <textarea id="tinymce-default">Hello, <b>Tabler</b>!</textarea>
-</form>
-<script src="{{ cdnUrl }}/dist/libs/tinymce/tinymce.min.js" defer></script>
-<script>
-  document.addEventListener("DOMContentLoaded", function () {
-    let options = {
-      selector: "#tinymce-default",
-      height: 300,
-      menubar: false,
-      statusbar: false,
-      plugins: [
-        "advlist autolink lists link image charmap print preview anchor",
-        "searchreplace visualblocks code fullscreen",
-        "insertdatetime media table paste code help wordcount",
-      ],
-      toolbar:
-        "undo redo | formatselect | " +
-        "bold italic backcolor | alignleft aligncenter " +
-        "alignright alignjustify | bullist numlist outdent indent | " +
-        "removeformat",
-      content_style:
-        "body { font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }",
-    };
-    if (localStorage.getItem("tablerTheme") === "dark") {
-      options.skin = "oxide-dark";
-      options.content_css = "dark";
-    }
-    tinyMCE.init(options);
-  });
-</script>
-{%- endcapture %}
-{% include "docs/example.html" html=html %}

+ 18 - 0
docs/content/ui/components/wysiwyg.md

@@ -0,0 +1,18 @@
+---
+title: Wysiwyg editor
+docs-libs: [hugerte]
+summary: The WYSIWYG editor that is flexible, customizable, and designed with the user in mind. HugeRTE can handle any challenge, from the most simple implementation through to the most complex use case.
+description: Flexible WYSIWYG editor for content.
+---
+
+[HugeRTE](https://hugerte.org/) documentation.
+
+## Default text editor
+
+Initialize HugeRTE on any element (or elements) on the web page by passing an object containing a selector value to `hugerte.init()`. The selector value can be any valid CSS selector.
+
+{% capture html -%}
+{% include "ui/wysiwyg.html" %}
+{{ script }}
+{%- endcapture %}
+{% include "docs/example.html" html=html %}

+ 3 - 3
shared/data/docs.json

@@ -250,9 +250,9 @@
         "title": "Inline player",
         "url": "docs/inline-player.html"
       },
-      "tinymce": {
-        "title": "TinyMCE",
-        "url": "docs/tinymce.html"
+      "wysiwyg": {
+        "title": "WYSIWYG Editor",
+        "url": "docs/wysiwyg.html"
       }
     }
   },

+ 0 - 36
shared/includes/ui/tinymce.html

@@ -1,36 +0,0 @@
-{% assign id = include.id | default: 'mytextarea' %}
-
-<form method="post">
-	<textarea id="hugerte-{{ id }}">Hello, <b>Tabler</b>!</textarea>
-</form>
-
-{% capture_script %}
-<script>
-  document.addEventListener("DOMContentLoaded", function () {
-    let options = {
-      selector: '#hugerte-{{ id }}',
-      height: 300,
-      menubar: false,
-      statusbar: false,
-		license_key: 'gpl',
-      plugins: [
-        'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview', 'anchor',
-        'searchreplace', 'visualblocks', 'code', 'fullscreen',
-        'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount'
-      ],
-      toolbar: 'undo redo | formatselect | ' +
-        'bold italic backcolor | alignleft aligncenter ' +
-        'alignright alignjustify | bullist numlist outdent indent | ' +
-        'removeformat',
-      content_style: 'body { font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }'
-    }
-
-    if (localStorage.getItem("tablerTheme") === 'dark') {
-      options.skin = 'oxide-dark';
-      options.content_css = 'dark';
-    }
-
-    hugeRTE.init(options);
-  })
-</script>
-{% endcapture_script %}

+ 10 - 3
shared/includes/ui/wysiwyg.html

@@ -1,10 +1,11 @@
+{% removeemptylines %}
 {% assign id = include.id | default: 'mytextarea' %}
-
 <form method="post">
 	<textarea id="hugerte-{{ id }}">Hello, <b>Tabler</b>!</textarea>
 </form>
 
-{% capture_script %}
+{% capture script %}
+{% removeemptylines %}
 <script>
   document.addEventListener("DOMContentLoaded", function () {
     let options = {
@@ -33,4 +34,10 @@
     hugeRTE.init(options);
   })
 </script>
-{% endcapture_script %}
+{% endremoveemptylines %}
+{% endcapture -%}
+
+{%- capture_script %}
+{{ script }}
+{% endcapture_script %}
+{% endremoveemptylines %}