|
@@ -15,6 +15,7 @@ import loggerFactory from '~/utils/logger';
|
|
|
import { UncontrolledCodeMirror } from '../UncontrolledCodeMirror';
|
|
import { UncontrolledCodeMirror } from '../UncontrolledCodeMirror';
|
|
|
|
|
|
|
|
import AbstractEditor from './AbstractEditor';
|
|
import AbstractEditor from './AbstractEditor';
|
|
|
|
|
+import CommentMentionHelper from './CommentMentionHelper';
|
|
|
import DrawioModal from './DrawioModal';
|
|
import DrawioModal from './DrawioModal';
|
|
|
import EditorIcon from './EditorIcon';
|
|
import EditorIcon from './EditorIcon';
|
|
|
import EmojiPicker from './EmojiPicker';
|
|
import EmojiPicker from './EmojiPicker';
|
|
@@ -31,7 +32,6 @@ import pasteHelper from './PasteHelper';
|
|
|
import PreventMarkdownListInterceptor from './PreventMarkdownListInterceptor';
|
|
import PreventMarkdownListInterceptor from './PreventMarkdownListInterceptor';
|
|
|
import SimpleCheatsheet from './SimpleCheatsheet';
|
|
import SimpleCheatsheet from './SimpleCheatsheet';
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// Textlint
|
|
// Textlint
|
|
|
window.JSHINT = JSHINT;
|
|
window.JSHINT = JSHINT;
|
|
|
window.kuromojin = { dicPath: '/static/dict' };
|
|
window.kuromojin = { dicPath: '/static/dict' };
|
|
@@ -190,7 +190,13 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
|
|
|
|
|
// fold drawio section
|
|
// fold drawio section
|
|
|
this.foldDrawioSection();
|
|
this.foldDrawioSection();
|
|
|
|
|
+
|
|
|
|
|
+ // initialize commentMentionHelper if comment editor is opened
|
|
|
|
|
+ if (this.props.isComment) {
|
|
|
|
|
+ this.commentMentionHelper = new CommentMentionHelper(this.getCodeMirror());
|
|
|
|
|
+ }
|
|
|
this.emojiPickerHelper = new EmojiPickerHelper(this.getCodeMirror());
|
|
this.emojiPickerHelper = new EmojiPickerHelper(this.getCodeMirror());
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
componentWillReceiveProps(nextProps) {
|
|
@@ -567,6 +573,11 @@ export default class CodeMirrorEditor extends AbstractEditor {
|
|
|
|
|
|
|
|
this.updateCheatsheetStates(null, value);
|
|
this.updateCheatsheetStates(null, value);
|
|
|
|
|
|
|
|
|
|
+ // Show username hint on comment editor
|
|
|
|
|
+ if (this.props.isComment) {
|
|
|
|
|
+ this.commentMentionHelper.showUsernameHint();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
keyUpHandler(editor, event) {
|
|
keyUpHandler(editor, event) {
|