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:
@@ -2,7 +2,6 @@
|
|||||||
Markdown
|
Markdown
|
||||||
*/
|
*/
|
||||||
.markdown {
|
.markdown {
|
||||||
font-size: $font-size-200;
|
|
||||||
line-height: $line-height-xl;
|
line-height: $line-height-xl;
|
||||||
|
|
||||||
> :first-child {
|
> :first-child {
|
||||||
|
|||||||
34
core/scss/vendor/_tinymce.scss
vendored
34
core/scss/vendor/_tinymce.scss
vendored
@@ -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;
|
|
||||||
}
|
|
||||||
14
core/scss/vendor/_wysiwyg.scss
vendored
14
core/scss/vendor/_wysiwyg.scss
vendored
@@ -21,7 +21,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tox-tbtn {
|
.tox-tbtn {
|
||||||
margin: 0 !important;
|
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 {
|
.tox-statusbar {
|
||||||
|
|||||||
@@ -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
docs/content/ui/components/wysiwyg.md
Normal file
18
docs/content/ui/components/wysiwyg.md
Normal 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 %}
|
||||||
@@ -4,7 +4,7 @@ page-header: HugeRTE
|
|||||||
menu: base.wysiwyg
|
menu: base.wysiwyg
|
||||||
page-libs: [hugerte]
|
page-libs: [hugerte]
|
||||||
permalink: /wysiwyg.html
|
permalink: /wysiwyg.html
|
||||||
layout: single
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|||||||
@@ -250,9 +250,9 @@
|
|||||||
"title": "Inline player",
|
"title": "Inline player",
|
||||||
"url": "docs/inline-player.html"
|
"url": "docs/inline-player.html"
|
||||||
},
|
},
|
||||||
"tinymce": {
|
"wysiwyg": {
|
||||||
"title": "TinyMCE",
|
"title": "WYSIWYG Editor",
|
||||||
"url": "docs/tinymce.html"
|
"url": "docs/wysiwyg.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 %}
|
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
|
{% removeemptylines %}
|
||||||
{% assign id = include.id | default: 'mytextarea' %}
|
{% assign id = include.id | default: 'mytextarea' %}
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<textarea id="hugerte-{{ id }}">Hello, <b>Tabler</b>!</textarea>
|
<textarea id="hugerte-{{ id }}">Hello, <b>Tabler</b>!</textarea>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{% capture_script %}
|
{% capture script %}
|
||||||
|
{% removeemptylines %}
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
let options = {
|
let options = {
|
||||||
@@ -33,4 +34,10 @@
|
|||||||
hugeRTE.init(options);
|
hugeRTE.init(options);
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
{% endcapture_script %}
|
{% endremoveemptylines %}
|
||||||
|
{% endcapture -%}
|
||||||
|
|
||||||
|
{%- capture_script %}
|
||||||
|
{{ script }}
|
||||||
|
{% endcapture_script %}
|
||||||
|
{% endremoveemptylines %}
|
||||||
Reference in New Issue
Block a user