mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Started support for WYSIWYG details/summary blocks
This commit is contained in:
@ -8,6 +8,7 @@ import {getPlugin as getDrawioPlugin} from "./plugin-drawio";
|
||||
import {getPlugin as getCustomhrPlugin} from "./plugins-customhr";
|
||||
import {getPlugin as getImagemanagerPlugin} from "./plugins-imagemanager";
|
||||
import {getPlugin as getAboutPlugin} from "./plugins-about";
|
||||
import {getPlugin as getDetailsPlugin} from "./plugins-details";
|
||||
|
||||
const style_formats = [
|
||||
{title: "Large Header", format: "h2", preview: 'color: blue;'},
|
||||
@ -27,7 +28,6 @@ const style_formats = [
|
||||
];
|
||||
|
||||
const formats = {
|
||||
codeeditor: {selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div'},
|
||||
alignleft: {selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes: 'align-left'},
|
||||
aligncenter: {selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes: 'align-center'},
|
||||
alignright: {selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes: 'align-right'},
|
||||
@ -79,7 +79,7 @@ function buildToolbar(options) {
|
||||
insertoverflow: {
|
||||
icon: 'more-drawer',
|
||||
tooltip: 'More',
|
||||
items: 'hr codeeditor drawio media'
|
||||
items: 'hr codeeditor drawio media details'
|
||||
}
|
||||
};
|
||||
|
||||
@ -121,6 +121,7 @@ function gatherPlugins(options) {
|
||||
"media",
|
||||
"imagemanager",
|
||||
"about",
|
||||
"details",
|
||||
options.textDirection === 'rtl' ? 'directionality' : '',
|
||||
];
|
||||
|
||||
@ -128,6 +129,7 @@ function gatherPlugins(options) {
|
||||
window.tinymce.PluginManager.add('customhr', getCustomhrPlugin(options));
|
||||
window.tinymce.PluginManager.add('imagemanager', getImagemanagerPlugin(options));
|
||||
window.tinymce.PluginManager.add('about', getAboutPlugin(options));
|
||||
window.tinymce.PluginManager.add('details', getDetailsPlugin(options));
|
||||
|
||||
if (options.drawioUrl) {
|
||||
window.tinymce.PluginManager.add('drawio', getDrawioPlugin(options));
|
||||
@ -240,7 +242,7 @@ export function build(options) {
|
||||
statusbar: false,
|
||||
menubar: false,
|
||||
paste_data_images: false,
|
||||
extended_valid_elements: 'pre[*],svg[*],div[drawio-diagram]',
|
||||
extended_valid_elements: 'pre[*],svg[*],div[drawio-diagram],details[*],summary[*]',
|
||||
automatic_uploads: false,
|
||||
valid_children: "-div[p|h1|h2|h3|h4|h5|h6|blockquote],+div[pre],+div[img]",
|
||||
plugins: gatherPlugins(options),
|
||||
|
Reference in New Issue
Block a user