mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	feat(emoji): disable auto-completion only
This commit is contained in:
		| @@ -236,8 +236,8 @@ function getLicenseKey() { | |||||||
| function getDisabledPlugins() { | function getDisabledPlugins() { | ||||||
|     let disabledPlugins: string[] = []; |     let disabledPlugins: string[] = []; | ||||||
|  |  | ||||||
|     if (options.get("textNoteEmojiEnabled") !== "true") { |     if (options.get("textNoteEmojiCompletionEnabled") !== "true") { | ||||||
|         disabledPlugins.push("Emoji"); |         disabledPlugins.push("EmojiMention"); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     return disabledPlugins; |     return disabledPlugins; | ||||||
|   | |||||||
| @@ -6,25 +6,25 @@ const TPL = /*html*/` | |||||||
|     <h4>Features</h4> |     <h4>Features</h4> | ||||||
|  |  | ||||||
|     <label class="tn-checkbox"> |     <label class="tn-checkbox"> | ||||||
|         <input type="checkbox" name="emoji-enabled" /> |         <input type="checkbox" name="emoji-completion-enabled" /> | ||||||
|         Enable Emoji support and auto-completion |         Enable Emoji auto-completion | ||||||
|     </label> |     </label> | ||||||
| </div> | </div> | ||||||
| `; | `; | ||||||
|  |  | ||||||
| export default class EditorFeaturesOptions extends OptionsWidget { | export default class EditorFeaturesOptions extends OptionsWidget { | ||||||
|  |  | ||||||
|     private $emojiEnabledCheckbox!: JQuery<HTMLElement>; |     private $emojiCompletionEnabledCheckbox!: JQuery<HTMLElement>; | ||||||
|  |  | ||||||
|     doRender() { |     doRender() { | ||||||
|         this.$widget = $(TPL); |         this.$widget = $(TPL); | ||||||
|  |  | ||||||
|         this.$emojiEnabledCheckbox = this.$widget.find(`input[name="emoji-enabled"]`); |         this.$emojiCompletionEnabledCheckbox = this.$widget.find(`input[name="emoji-completion-enabled"]`); | ||||||
|         this.$emojiEnabledCheckbox.on("change", () => this.updateCheckboxOption("textNoteEmojiEnabled", this.$emojiEnabledCheckbox)) |         this.$emojiCompletionEnabledCheckbox.on("change", () => this.updateCheckboxOption("textNoteEmojiCompletionEnabled", this.$emojiCompletionEnabledCheckbox)) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     optionsLoaded(options: OptionMap) { |     optionsLoaded(options: OptionMap) { | ||||||
|         this.setCheckboxState(this.$emojiEnabledCheckbox, options.textNoteEmojiEnabled); |         this.setCheckboxState(this.$emojiCompletionEnabledCheckbox, options.textNoteEmojiCompletionEnabled); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -85,7 +85,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([ | |||||||
|     "languages", |     "languages", | ||||||
|     "textNoteEditorType", |     "textNoteEditorType", | ||||||
|     "textNoteEditorMultilineToolbar", |     "textNoteEditorMultilineToolbar", | ||||||
|     "textNoteEmojiEnabled", |     "textNoteEmojiCompletionEnabled", | ||||||
|     "layoutOrientation", |     "layoutOrientation", | ||||||
|     "backgroundEffects", |     "backgroundEffects", | ||||||
|     "allowedHtmlTags", |     "allowedHtmlTags", | ||||||
|   | |||||||
| @@ -178,7 +178,7 @@ const defaultOptions: DefaultOption[] = [ | |||||||
|     // Text note configuration |     // Text note configuration | ||||||
|     { name: "textNoteEditorType", value: "ckeditor-balloon", isSynced: true }, |     { name: "textNoteEditorType", value: "ckeditor-balloon", isSynced: true }, | ||||||
|     { name: "textNoteEditorMultilineToolbar", value: "false", isSynced: true }, |     { name: "textNoteEditorMultilineToolbar", value: "false", isSynced: true }, | ||||||
|     { name: "textNoteEmojiEnabled", value: "true", isSynced: true }, |     { name: "textNoteEmojiCompletionEnabled", value: "true", isSynced: true }, | ||||||
|  |  | ||||||
|     // HTML import configuration |     // HTML import configuration | ||||||
|     { name: "layoutOrientation", value: "vertical", isSynced: false }, |     { name: "layoutOrientation", value: "vertical", isSynced: false }, | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| import { Autoformat, AutoLink, BlockQuote, BlockToolbar, Bold, CKFinderUploadAdapter, Clipboard, Code, CodeBlock, Enter, FindAndReplace, Font, FontBackgroundColor, FontColor, GeneralHtmlSupport, Heading, HeadingButtonsUI, HorizontalLine, Image, ImageCaption, ImageInline, ImageResize, ImageStyle, ImageToolbar, ImageUpload, Alignment, Indent, IndentBlock, Italic, Link, List, ListProperties, Mention, PageBreak, Paragraph, ParagraphButtonUI, PasteFromOffice, PictureEditing, RemoveFormat, SelectAll, ShiftEnter, SpecialCharacters, SpecialCharactersEssentials, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableSelection, TableToolbar, TextPartLanguage, TextTransformation, TodoList, Typing, Underline, Undo, Bookmark, Emoji, Notification } from "ckeditor5"; | import { Autoformat, AutoLink, BlockQuote, BlockToolbar, Bold, CKFinderUploadAdapter, Clipboard, Code, CodeBlock, Enter, FindAndReplace, Font, FontBackgroundColor, FontColor, GeneralHtmlSupport, Heading, HeadingButtonsUI, HorizontalLine, Image, ImageCaption, ImageInline, ImageResize, ImageStyle, ImageToolbar, ImageUpload, Alignment, Indent, IndentBlock, Italic, Link, List, ListProperties, Mention, PageBreak, Paragraph, ParagraphButtonUI, PasteFromOffice, PictureEditing, RemoveFormat, SelectAll, ShiftEnter, SpecialCharacters, SpecialCharactersEssentials, Strikethrough, Style, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableSelection, TableToolbar, TextPartLanguage, TextTransformation, TodoList, Typing, Underline, Undo, Bookmark, Emoji, Notification, EmojiMention, EmojiPicker } from "ckeditor5"; | ||||||
| import { SlashCommand, Template } from "ckeditor5-premium-features"; | import { SlashCommand, Template } from "ckeditor5-premium-features"; | ||||||
| import type { Plugin } from "ckeditor5"; | import type { Plugin } from "ckeditor5"; | ||||||
| import CutToNotePlugin from "./plugins/cuttonote.js"; | import CutToNotePlugin from "./plugins/cuttonote.js"; | ||||||
| @@ -145,7 +145,8 @@ export const COMMON_PLUGINS: typeof Plugin[] = [ | |||||||
| 	TextPartLanguage, | 	TextPartLanguage, | ||||||
|     Style, |     Style, | ||||||
|     Bookmark, |     Bookmark, | ||||||
|     Emoji, |     EmojiMention, | ||||||
|  |     EmojiPicker, | ||||||
|  |  | ||||||
|     ...TRILIUM_PLUGINS, |     ...TRILIUM_PLUGINS, | ||||||
|     ...EXTERNAL_PLUGINS |     ...EXTERNAL_PLUGINS | ||||||
|   | |||||||
| @@ -118,7 +118,7 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActi | |||||||
|     editedNotesOpenInRibbon: boolean; |     editedNotesOpenInRibbon: boolean; | ||||||
|     codeBlockWordWrap: boolean; |     codeBlockWordWrap: boolean; | ||||||
|     textNoteEditorMultilineToolbar: boolean; |     textNoteEditorMultilineToolbar: boolean; | ||||||
|     textNoteEmojiEnabled: boolean; |     textNoteEmojiCompletionEnabled: boolean; | ||||||
|     backgroundEffects: boolean; |     backgroundEffects: boolean; | ||||||
|  |  | ||||||
|     // Share settings |     // Share settings | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user