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