mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 10:29:42 +00:00
Setup alias for use in standalone chill-bundles project and replace relative paths
This commit is contained in:
@@ -1,30 +1,32 @@
|
||||
import ClassicEditorBase from "@ckeditor/ckeditor5-editor-classic/src/classiceditor";
|
||||
import EssentialsPlugin from "@ckeditor/ckeditor5-essentials/src/essentials";
|
||||
import MarkdownPlugin from "@ckeditor/ckeditor5-markdown-gfm/src/markdown";
|
||||
import BoldPlugin from "@ckeditor/ckeditor5-basic-styles/src/bold";
|
||||
import ItalicPlugin from "@ckeditor/ckeditor5-basic-styles/src/italic";
|
||||
import BlockQuotePlugin from "@ckeditor/ckeditor5-block-quote/src/blockquote";
|
||||
import HeadingPlugin from "@ckeditor/ckeditor5-heading/src/heading";
|
||||
import LinkPlugin from "@ckeditor/ckeditor5-link/src/link";
|
||||
import ListPlugin from "@ckeditor/ckeditor5-list/src/list";
|
||||
import ParagraphPlugin from "@ckeditor/ckeditor5-paragraph/src/paragraph";
|
||||
import {
|
||||
Essentials,
|
||||
Bold,
|
||||
Italic,
|
||||
Paragraph,
|
||||
Markdown,
|
||||
BlockQuote,
|
||||
Heading,
|
||||
Link,
|
||||
List,
|
||||
} from "ckeditor5";
|
||||
import coreTranslations from "ckeditor5/translations/fr.js";
|
||||
|
||||
import "ckeditor5/ckeditor5.css";
|
||||
|
||||
import "./index.scss";
|
||||
|
||||
export default class ClassicEditor extends ClassicEditorBase {}
|
||||
|
||||
ClassicEditor.builtinPlugins = [
|
||||
EssentialsPlugin,
|
||||
MarkdownPlugin,
|
||||
BoldPlugin,
|
||||
ItalicPlugin,
|
||||
BlockQuotePlugin,
|
||||
HeadingPlugin,
|
||||
LinkPlugin,
|
||||
ListPlugin,
|
||||
ParagraphPlugin,
|
||||
];
|
||||
|
||||
ClassicEditor.defaultConfig = {
|
||||
export default {
|
||||
plugins: [
|
||||
Essentials,
|
||||
Markdown,
|
||||
Bold,
|
||||
Italic,
|
||||
BlockQuote,
|
||||
Heading,
|
||||
Link,
|
||||
List,
|
||||
Paragraph,
|
||||
],
|
||||
toolbar: {
|
||||
items: [
|
||||
"heading",
|
||||
@@ -39,5 +41,6 @@ ClassicEditor.defaultConfig = {
|
||||
"redo",
|
||||
],
|
||||
},
|
||||
language: "fr",
|
||||
translations: [coreTranslations],
|
||||
licenseKey: "GPL",
|
||||
};
|
||||
|
@@ -1,14 +1,12 @@
|
||||
import ClassicEditor from "./editor_config";
|
||||
import config from "./editor_config";
|
||||
import { ClassicEditor } from "ckeditor5";
|
||||
|
||||
const ckeditorFields: NodeListOf<HTMLTextAreaElement> =
|
||||
document.querySelectorAll("textarea[ckeditor]");
|
||||
ckeditorFields.forEach((field: HTMLTextAreaElement): void => {
|
||||
ClassicEditor.create(field)
|
||||
.then((editor) => {
|
||||
//console.log( 'CkEditor was initialized', editor );
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error.stack);
|
||||
});
|
||||
ClassicEditor.create(field, config).catch((error) => {
|
||||
console.error(error.stack);
|
||||
throw error;
|
||||
});
|
||||
});
|
||||
//Fields.push.apply(Fields, document.querySelectorAll('.cf-fields textarea'));
|
||||
|
Reference in New Issue
Block a user