1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00

Fix WYSIWYG documentation (#2359)

This commit is contained in:
Paweł Kuna
2025-05-12 20:30:33 +02:00
committed by GitHub
parent b9d434dcd4
commit ddd3753cde
9 changed files with 45 additions and 126 deletions

View File

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

View File

@@ -1,34 +0,0 @@
.tox-hugerte {
border: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color) !important;
border-radius: $border-radius !important;
font-family: var(--#{$prefix}font-sans-serif) !important;
}
.tox-toolbar__group {
padding: 0 .5rem 0;
}
.tox .tox-toolbar__primary {
background: transparent !important;
}
.tox:not(.tox-hugerte-inline) {
.tox-editor-header {
border-bottom: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color) !important;
box-shadow: none !important;
padding: 0 !important;
}
}
.tox-tbtn {
margin: 0 !important;
}
.tox-statusbar {
border-top: var(--#{$prefix}border-width) var(--#{$prefix}border-style) var(--#{$prefix}border-color) !important;
}
.tox .tox-toolbar-overlord,
.tox:not(.tox-hugerte-inline) .tox-editor-header {
background: transparent !important;
}

View File

@@ -22,6 +22,18 @@
.tox-tbtn {
margin: 0 !important;
background: var(--#{$prefix}bg-surface) !important;
&:hover,
&.tox-tbtn--enabled {
background: var(--#{$prefix}bg-surface-secondary) !important;
}
}
.tox-edit-area {
&::before {
border: none !important
}
}
.tox-statusbar {

View File

@@ -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 %}

View File

@@ -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 %}

View File

@@ -4,7 +4,7 @@ page-header: HugeRTE
menu: base.wysiwyg
page-libs: [hugerte]
permalink: /wysiwyg.html
layout: single
layout: default
---
<div class="card">

View File

@@ -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"
}
}
},

View File

@@ -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 %}

View File

@@ -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>
{% endremoveemptylines %}
{% endcapture -%}
{%- capture_script %}
{{ script }}
{% endcapture_script %}
{% endremoveemptylines %}