1
0
mirror of https://github.com/tabler/tabler.git synced 2026-01-09 06:00:09 +04:00

Replaced TinyMCE with Hugerte to address license violation (#2008)

This commit is contained in:
Paweł Kuna
2025-03-23 20:50:54 +01:00
committed by GitHub
parent 19a3d20fad
commit 92a3afe492
11 changed files with 105 additions and 30 deletions

View File

@@ -21,7 +21,7 @@
"jsvectormap-world": "jsvectormap/dist/maps/world.js",
"jsvectormap-world-merc": "jsvectormap/dist/maps/world-merc.js",
"fslightbox": "fslightbox/index.js",
"tinymce": "tinymce/tinymce.min.js",
"hugerte": "hugerte/hugerte.min.js",
"plyr": "plyr/dist/plyr.min.js",
"dropzone": "dropzone/dist/dropzone-min.js",
"star-rating.js": "star-rating.js/dist/star-rating.min.js",
@@ -39,6 +39,6 @@
"nouislider": "nouislider/dist/nouislider.min.css"
},
"js-copy": {
"tinymce" :"tinymce/*"
"hugerte" :"hugerte/*"
}
}

View File

@@ -411,9 +411,9 @@
"url": "maps-vector.html",
"title": "Map vector"
},
"tinymce": {
"title": "TinyMCE",
"url": "tinymce.html"
"wysiwyg": {
"url": "wysiwyg.html",
"title": "WYSIWYG editor"
}
}
},

View File

@@ -1,14 +1,14 @@
{% assign id = include.id | default: 'mytextarea' %}
<form method="post">
<textarea id="tinymce-{{ id }}">Hello, <b>Tabler</b>!</textarea>
<textarea id="hugerte-{{ id }}">Hello, <b>Tabler</b>!</textarea>
</form>
{% capture_script %}
<script>
document.addEventListener("DOMContentLoaded", function () {
let options = {
selector: '#tinymce-{{ id }}',
selector: '#hugerte-{{ id }}',
height: 300,
menubar: false,
statusbar: false,
@@ -30,7 +30,7 @@
options.content_css = 'dark';
}
tinyMCE.init(options);
hugeRTE.init(options);
})
</script>
{% endcapture_script %}

View File

@@ -0,0 +1,36 @@
{% 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 %}

View File

@@ -1,10 +1,10 @@
---
title: TinyMCE
page-header: TinyMCE
page-menu: plugins.tinymce
page-libs: [tinymce]
layout: default
permalink: tinymce.html
title: HugeRTE
page-header: HugeRTE
menu: base.wysiwyg
page-libs: [hugerte]
permalink: /wysiwyg.html
layout: single
---
<div class="card">
@@ -17,7 +17,7 @@ permalink: tinymce.html
<div class="mb-3">
<label class="form-label">Description</label>
{% include "ui/tinymce.html" %}
{% include "ui/wysiwyg.html" %}
</div>
</div>
</div>