mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 18:42:28 +08:00
refactor(editor): move classic toolbar config into this repo
This commit is contained in:
parent
bd5232ed14
commit
2ac5e860b1
2
libraries/ckeditor/ckeditor.js
vendored
2
libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
2
libraries/ckeditor/ckeditor.js.map
vendored
2
libraries/ckeditor/ckeditor.js.map
vendored
File diff suppressed because one or more lines are too long
61
src/public/app/widgets/type_widgets/ckeditor/toolbars.ts
Normal file
61
src/public/app/widgets/type_widgets/ckeditor/toolbars.ts
Normal file
@ -0,0 +1,61 @@
|
||||
export function buildToolbarConfig() {
|
||||
return buildClassicToolbar();
|
||||
}
|
||||
|
||||
function buildClassicToolbar() {
|
||||
// For nested toolbars, refer to https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/toolbar.html#grouping-toolbar-items-in-dropdowns-nested-toolbars.
|
||||
return {
|
||||
items: [
|
||||
'heading',
|
||||
'fontSize',
|
||||
'|',
|
||||
'bold',
|
||||
'italic',
|
||||
{
|
||||
label: "Text formatting",
|
||||
icon: "text",
|
||||
items: [
|
||||
'underline',
|
||||
'strikethrough',
|
||||
'superscript',
|
||||
'subscript',
|
||||
'code',
|
||||
],
|
||||
},
|
||||
'|',
|
||||
'fontColor',
|
||||
'fontBackgroundColor',
|
||||
'removeFormat',
|
||||
'|',
|
||||
'bulletedList', 'numberedList', 'todoList',
|
||||
'|',
|
||||
'blockQuote',
|
||||
'insertTable',
|
||||
'codeBlock',
|
||||
'footnote',
|
||||
{
|
||||
label: "Insert",
|
||||
icon: "plus",
|
||||
items: [
|
||||
'imageUpload',
|
||||
'|',
|
||||
'link',
|
||||
'internallink',
|
||||
'includeNote',
|
||||
'|',
|
||||
'specialCharacters',
|
||||
'math',
|
||||
'mermaid',
|
||||
'horizontalLine',
|
||||
'pageBreak'
|
||||
]
|
||||
},
|
||||
'|',
|
||||
'outdent', 'indent',
|
||||
'|',
|
||||
'markdownImport',
|
||||
'cuttonote',
|
||||
'findAndReplace'
|
||||
]
|
||||
}
|
||||
}
|
@ -15,6 +15,7 @@ import options from "../../services/options.js";
|
||||
import toast from "../../services/toast.js";
|
||||
import { getMermaidConfig } from "../mermaid.js";
|
||||
import { normalizeMimeTypeForCKEditor } from "../../services/mime_type_definitions.js";
|
||||
import { buildToolbarConfig } from "./ckeditor/toolbars.js";
|
||||
|
||||
const ENABLE_INSPECTOR = false;
|
||||
|
||||
@ -186,6 +187,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
const extraOpts = {};
|
||||
if (isClassicEditor) {
|
||||
extraOpts.toolbar = {
|
||||
...buildToolbarConfig(),
|
||||
shouldNotGroupWhenFull: utils.isDesktop() && options.get("textNoteEditorMultilineToolbar") === "true"
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user