mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
Revert "feat(rtl): add language switcher toolbar"
This reverts commit e930ae5f407b28de9edd65f038237d061f8d8c16.
This commit is contained in:
parent
8d60429b9c
commit
c99c4a4302
4
libraries/ckeditor/ckeditor.js
vendored
4
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
@ -110,102 +110,85 @@ export function buildConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function buildToolbarConfig(isClassicToolbar: boolean) {
|
export function buildToolbarConfig(isClassicToolbar: boolean) {
|
||||||
const languages = JSON.parse(options.get("languages") ?? "[]") as string[];
|
|
||||||
const enableLanguageSwitcher = languages.length > 1;
|
|
||||||
|
|
||||||
if (isClassicToolbar) {
|
if (isClassicToolbar) {
|
||||||
const multilineToolbar = utils.isDesktop() && options.get("textNoteEditorMultilineToolbar") === "true"
|
const multilineToolbar = utils.isDesktop() && options.get("textNoteEditorMultilineToolbar") === "true"
|
||||||
return buildClassicToolbar(multilineToolbar, enableLanguageSwitcher);
|
return buildClassicToolbar(multilineToolbar);
|
||||||
} else {
|
} else {
|
||||||
return buildFloatingToolbar(enableLanguageSwitcher);
|
return buildFloatingToolbar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildClassicToolbar(multilineToolbar: boolean, enableLanguageSwitcher: boolean) {
|
function buildClassicToolbar(multilineToolbar: boolean) {
|
||||||
const 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',
|
|
||||||
];
|
|
||||||
|
|
||||||
if (enableLanguageSwitcher) {
|
|
||||||
items.push('|');
|
|
||||||
items.push('textPartLanguage');
|
|
||||||
}
|
|
||||||
|
|
||||||
// For nested toolbars, refer to https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/toolbar.html#grouping-toolbar-items-in-dropdowns-nested-toolbars.
|
// For nested toolbars, refer to https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/toolbar.html#grouping-toolbar-items-in-dropdowns-nested-toolbars.
|
||||||
return {
|
return {
|
||||||
toolbar: {
|
toolbar: {
|
||||||
items,
|
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'
|
||||||
|
],
|
||||||
shouldNotGroupWhenFull: multilineToolbar
|
shouldNotGroupWhenFull: multilineToolbar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildFloatingToolbar(enableLanguageSwitcher: boolean) {
|
function buildFloatingToolbar() {
|
||||||
const items = [
|
|
||||||
'fontSize',
|
|
||||||
'bold',
|
|
||||||
'italic',
|
|
||||||
'underline',
|
|
||||||
'strikethrough',
|
|
||||||
'superscript',
|
|
||||||
'subscript',
|
|
||||||
'fontColor',
|
|
||||||
'fontBackgroundColor',
|
|
||||||
'code',
|
|
||||||
'link',
|
|
||||||
'removeFormat',
|
|
||||||
'internallink',
|
|
||||||
'cuttonote'
|
|
||||||
];
|
|
||||||
|
|
||||||
if (enableLanguageSwitcher) {
|
|
||||||
items.push('|');
|
|
||||||
items.push('textPartLanguage');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
toolbar: {
|
toolbar: {
|
||||||
items
|
items: [
|
||||||
|
'fontSize',
|
||||||
|
'bold',
|
||||||
|
'italic',
|
||||||
|
'underline',
|
||||||
|
'strikethrough',
|
||||||
|
'superscript',
|
||||||
|
'subscript',
|
||||||
|
'fontColor',
|
||||||
|
'fontBackgroundColor',
|
||||||
|
'code',
|
||||||
|
'link',
|
||||||
|
'removeFormat',
|
||||||
|
'internallink',
|
||||||
|
'cuttonote'
|
||||||
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
blockToolbar: [
|
blockToolbar: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user