mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 18:30:53 +00:00
optimize code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { processor } from '@seafile/seafile-editor/dist/utils/seafile-markdown2html';
|
||||
import { processor } from '@seafile/seafile-editor';
|
||||
import { Button, Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
||||
import { gettext } from '../../../utils/constants';
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Toolbar, MarkdownEditor, UserHelp } from '@seafile/seafile-editor';
|
||||
import EditorBuilder from '@seafile/seafile-editor/dist/editor/editor-builder';
|
||||
import { EditorBuilder, Toolbar, MarkdownEditor, UserHelp } from '@seafile/seafile-editor';
|
||||
import SidePanel from './side-panel';
|
||||
|
||||
import '../css/rich-editor.css';
|
||||
@@ -14,7 +13,6 @@ const propTypes = {
|
||||
fileInfo: PropTypes.object,
|
||||
readOnly: PropTypes.bool,
|
||||
editorApi: PropTypes.object,
|
||||
collabUsers: PropTypes.array,
|
||||
onSave: PropTypes.func.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
resetRichValue: PropTypes.func,
|
||||
@@ -22,9 +20,10 @@ const propTypes = {
|
||||
onFileTagChanged: PropTypes.func,
|
||||
participants: PropTypes.array,
|
||||
onParticipantsChange: PropTypes.func,
|
||||
openDialogs: PropTypes.func,
|
||||
};
|
||||
|
||||
class RichEditor extends React.Component {
|
||||
class RichMarkdownEditor extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@@ -121,7 +120,7 @@ class RichEditor extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
RichEditor.propTypes = propTypes;
|
||||
RichMarkdownEditor.propTypes = propTypes;
|
||||
|
||||
|
||||
export default RichEditor;
|
||||
export default RichMarkdownEditor;
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { deserialize, serialize, PlainMarkdownEditor } from '@seafile/seafile-editor';
|
||||
import toaster from '../../../components/toast';
|
||||
import { gettext } from '../../../utils/constants';
|
||||
import RichEditor from '../rich-editor';
|
||||
import RichMarkdownEditor from '../rich-markdown-editor';
|
||||
|
||||
const propTypes = {
|
||||
mode: PropTypes.string,
|
||||
@@ -222,7 +222,7 @@ class SeafileEditor extends React.Component {
|
||||
|
||||
if (this.props.editorMode === 'rich') {
|
||||
return (
|
||||
<RichEditor
|
||||
<RichMarkdownEditor
|
||||
scriptSource={this.props.scriptSource}
|
||||
readOnly={this.props.readOnly}
|
||||
value={this.state.richValue}
|
||||
|
Reference in New Issue
Block a user