147 lines
3.2 KiB
TypeScript
147 lines
3.2 KiB
TypeScript
const plugins =
|
|
"a11ychecker advcode advtable advtemplate typography casechange checklist editimage mediaembed export footnotes formatpainter inlinecss mergetags pageembed permanentpen powerpaste autocorrect tableofcontents accordion advlist anchor autolink autoresize autosave charmap code codesample directionality emoticons fullscreen help image importcss insertdatetime link lists media nonbreaking pagebreak preview quickbars save searchreplace table template visualblocks visualchars wordcount".split(
|
|
" ",
|
|
);
|
|
const reducer = (pv, cv) => {
|
|
return { ...pv, [cv]: `plugins/${cv}/plugin.min.js` };
|
|
};
|
|
|
|
const external_plugins = plugins.reduce((pv, cv) => {
|
|
return { ...pv, [cv]: `plugins/${cv}/plugin.min.js` };
|
|
}, {});
|
|
const base_url = "/tinymce";
|
|
export const fancy = {
|
|
branding: false,
|
|
base_url,
|
|
menubar: false,
|
|
elementpath: false,
|
|
formats: {
|
|
bold: {
|
|
inline: "b",
|
|
},
|
|
italic: {
|
|
inline: "i",
|
|
},
|
|
underline: {
|
|
inline: "u",
|
|
},
|
|
},
|
|
schema: "html5",
|
|
custom_colors: true,
|
|
style_formats: [
|
|
// { title: 'Image formats' },
|
|
{
|
|
title: "Blocks",
|
|
items: [
|
|
{ title: "p", block: "p" },
|
|
{ title: "div", block: "div" },
|
|
{ title: "pre", block: "pre" },
|
|
],
|
|
},
|
|
{
|
|
title: "Image",
|
|
items: [
|
|
{
|
|
title: "Image Left",
|
|
|
|
styles: { float: "left", margin: "0 10px 0 10px" },
|
|
},
|
|
{
|
|
title: "Image Right",
|
|
|
|
styles: { float: "right", margin: "0 0 10px 10px" },
|
|
},
|
|
{ title: "Rounded corners", styles: { "border-radius": "0.7em" } },
|
|
],
|
|
},
|
|
{
|
|
title: "Code/Monospace",
|
|
|
|
classes: ["font-mono"],
|
|
},
|
|
],
|
|
toolbar_groups: {
|
|
alignment: {
|
|
icon: "align-left",
|
|
tooltip: "Alignment",
|
|
items: "alignleft aligncenter alignright | alignjustify",
|
|
},
|
|
heading: {
|
|
icon: "format",
|
|
tooltip: "Header",
|
|
items: "h1 h2 h3 h4 h5 h6",
|
|
},
|
|
},
|
|
toolbar: "undo redo | paste | bold italic underline | hr image link | forecolor styles | heading alignment | code",
|
|
contextmenu: "bold italic underline | hr | link | image | paste",
|
|
external_plugins,
|
|
};
|
|
export const comment = {
|
|
branding: false,
|
|
base_url,
|
|
height: 200,
|
|
menubar: false,
|
|
elementpath: false,
|
|
formats: {
|
|
bold: {
|
|
inline: "b",
|
|
},
|
|
italic: {
|
|
inline: "i",
|
|
},
|
|
underline: {
|
|
inline: "u",
|
|
},
|
|
},
|
|
schema: "html5",
|
|
external_plugins,
|
|
toolbar: "bold italic underline | link",
|
|
contextmenu: "bold italic underline | paste | link",
|
|
};
|
|
|
|
export const story = {
|
|
base_url,
|
|
branding: false,
|
|
height: 500,
|
|
menubar: false,
|
|
elementpath: false,
|
|
formats: {
|
|
bold: {
|
|
inline: "b",
|
|
},
|
|
italic: {
|
|
inline: "i",
|
|
},
|
|
underline: {
|
|
inline: "u",
|
|
},
|
|
},
|
|
content_css: ["/test.css", "/quickfix.css"],
|
|
schema: "html5",
|
|
external_plugins,
|
|
toolbar: "undo redo | paste |" + "bold italic underline | hr | alignleft aligncenter " + "alignright alignjustify | " + "| code",
|
|
contextmenu: "bold italic underline | hr | paste | link",
|
|
};
|
|
export const bare = {
|
|
base_url,
|
|
branding: false,
|
|
height: 200,
|
|
menubar: false,
|
|
elementpath: false,
|
|
formats: {
|
|
bold: {
|
|
inline: "b",
|
|
},
|
|
italic: {
|
|
inline: "i",
|
|
},
|
|
underline: {
|
|
inline: "u",
|
|
},
|
|
},
|
|
schema: "html5",
|
|
external_plugins,
|
|
toolbar: "bold italic underline | hr link",
|
|
contextmenu: "bold italic underline | paste | hr link",
|
|
};
|