mirror of https://github.com/laurent22/joplin.git
Clean up
parent
3f8833eaf1
commit
9a2f0bee29
|
@ -228,9 +228,6 @@ function AceEditor(props: NoteBodyEditorProps, ref: any) {
|
|||
useImperativeHandle(ref, () => {
|
||||
return {
|
||||
content: () => props.content,
|
||||
setContent: (body: string) => {
|
||||
aceEditor_change(body);
|
||||
},
|
||||
resetScroll: () => {
|
||||
resetScroll();
|
||||
},
|
||||
|
@ -246,11 +243,6 @@ function AceEditor(props: NoteBodyEditorProps, ref: any) {
|
|||
throw new Error(`Unsupported scroll options: ${options.type}`);
|
||||
}
|
||||
},
|
||||
clearState: () => {
|
||||
if (!editor) return;
|
||||
editor.clearSelection();
|
||||
editor.moveCursorTo(0, 0);
|
||||
},
|
||||
supportsCommand: (/* name:string*/) => {
|
||||
// TODO: not implemented, currently only used for "search" command
|
||||
// which is not directly supported by Ace Editor.
|
||||
|
|
|
@ -199,9 +199,6 @@ const TinyMCE = (props:NoteBodyEditorProps, ref:any) => {
|
|||
if (!editorRef.current) return '';
|
||||
return prop_htmlToMarkdownRef.current(props.contentMarkupLanguage, editorRef.current.getContent(), props.contentOriginalCss);
|
||||
},
|
||||
setContent: (/* body: string*/) => {
|
||||
console.warn('TinyMCE::setContent - not implemented');
|
||||
},
|
||||
resetScroll: () => {
|
||||
if (editor) editor.getWin().scrollTo(0,0);
|
||||
},
|
||||
|
@ -220,11 +217,6 @@ const TinyMCE = (props:NoteBodyEditorProps, ref:any) => {
|
|||
} else {
|
||||
throw new Error(`Unsupported scroll options: ${options.type}`);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
clearState: () => {
|
||||
console.warn('TinyMCE::clearState - not implemented');
|
||||
},
|
||||
supportsCommand: (name:string) => {
|
||||
// TODO: should also handle commands that are not in this map (insertText, focus, etc);
|
||||
|
|
|
@ -15,7 +15,7 @@ import useDropHandler from './utils/useDropHandler';
|
|||
import useMarkupToHtml from './utils/useMarkupToHtml';
|
||||
import useFormNote, { OnLoadEvent } from './utils/useFormNote';
|
||||
import styles_ from './styles';
|
||||
import { NoteTextProps, FormNote, ScrollOptions, ScrollOptionTypes, OnChangeEvent, NoteBodyEditorProps } from './utils/types';
|
||||
import { NoteEditorProps, FormNote, ScrollOptions, ScrollOptionTypes, OnChangeEvent, NoteBodyEditorProps } from './utils/types';
|
||||
import { attachResources } from './utils/resourceHandling';
|
||||
|
||||
const { themeStyle } = require('../../theme.js');
|
||||
|
@ -33,7 +33,7 @@ const eventManager = require('../../eventManager');
|
|||
const NoteRevisionViewer = require('../NoteRevisionViewer.min');
|
||||
const TagList = require('../TagList.min.js');
|
||||
|
||||
function NoteEditor(props: NoteTextProps) {
|
||||
function NoteEditor(props: NoteEditorProps) {
|
||||
const theme = themeStyle(props.theme);
|
||||
|
||||
const [showRevisions, setShowRevisions] = useState(false);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { NoteTextProps } from '../utils/types';
|
||||
import { NoteEditorProps } from '../utils/types';
|
||||
|
||||
const { buildStyle } = require('../../../theme.js');
|
||||
|
||||
export default function styles(props: NoteTextProps) {
|
||||
export default function styles(props: NoteEditorProps) {
|
||||
return buildStyle('NoteEditor', props.theme, (theme: any) => {
|
||||
return {
|
||||
root: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// eslint-disable-next-line no-unused-vars
|
||||
import AsyncActionQueue from '../../../lib/AsyncActionQueue';
|
||||
|
||||
export interface NoteTextProps {
|
||||
export interface NoteEditorProps {
|
||||
style: any;
|
||||
noteId: string;
|
||||
theme: number;
|
||||
|
|
Loading…
Reference in New Issue