mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-03 03:11:31 +08:00
client: Set up ui for selecting editor UI
This commit is contained in:
parent
7a70fc14b3
commit
89420eafa3
@ -35,6 +35,7 @@ import AttachmentErasureTimeoutOptions from "./options/other/attachment_erasure_
|
|||||||
import RibbonOptions from "./options/appearance/ribbon.js";
|
import RibbonOptions from "./options/appearance/ribbon.js";
|
||||||
import LocalizationOptions from "./options/appearance/i18n.js";
|
import LocalizationOptions from "./options/appearance/i18n.js";
|
||||||
import CodeBlockOptions from "./options/appearance/code_block.js";
|
import CodeBlockOptions from "./options/appearance/code_block.js";
|
||||||
|
import EditorOptions from "./options/text_notes/editor.js";
|
||||||
|
|
||||||
const TPL = `<div class="note-detail-content-widget note-detail-printable">
|
const TPL = `<div class="note-detail-content-widget note-detail-printable">
|
||||||
<style>
|
<style>
|
||||||
@ -68,6 +69,7 @@ const CONTENT_WIDGETS = {
|
|||||||
],
|
],
|
||||||
_optionsShortcuts: [ KeyboardShortcutsOptions ],
|
_optionsShortcuts: [ KeyboardShortcutsOptions ],
|
||||||
_optionsTextNotes: [
|
_optionsTextNotes: [
|
||||||
|
EditorOptions,
|
||||||
HeadingStyleOptions,
|
HeadingStyleOptions,
|
||||||
TableOfContentsOptions,
|
TableOfContentsOptions,
|
||||||
HighlightsListOptions,
|
HighlightsListOptions,
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
import OptionsWidget from "../options_widget.js";
|
||||||
|
|
||||||
|
const TPL = `
|
||||||
|
<div class="options-section">
|
||||||
|
<h4>Editor</h4>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<div class="col-6">
|
||||||
|
<label>Editor type</label>
|
||||||
|
<select class="editor-type-select form-select">
|
||||||
|
<option value="ckeditor-balloon">CKEditor with floating toolbar (default)</option>
|
||||||
|
<option value="ckeditor-classic">CKEditor with fixed toolbar</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
export default class EditorOptions extends OptionsWidget {
|
||||||
|
doRender() {
|
||||||
|
this.$widget = $(TPL);
|
||||||
|
this.$body = $("body");
|
||||||
|
this.$editorType = this.$widget.find(".editor-type-select");
|
||||||
|
this.$editorType.on('change', () => {
|
||||||
|
const newEditorType = this.$editorType.val();
|
||||||
|
this.updateOption('textNoteEditorType', newEditorType);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async optionsLoaded(options) {
|
||||||
|
this.$editorType.val(options.textNoteEditorType);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user