mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 04:18:21 +00:00
Update sdoc module code (#5441)
* update code * optimize code * update sdoc version
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import React from 'react';
|
||||
import React, { Suspense } from 'react';
|
||||
import ReactDom from 'react-dom';
|
||||
import { SimpleViewer } from '@seafile/sdoc-editor';
|
||||
import { I18nextProvider } from 'react-i18next';
|
||||
import i18n from './_i18n/i18n-sdoc-editor';
|
||||
import Loading from './components/loading';
|
||||
|
||||
const { serviceURL } = window.app.config;
|
||||
const { repoID, filePath, fileName } = window.shared.pageOptions;
|
||||
|
||||
const { rawPath } = window.shared.pageOptions;
|
||||
const { username } = window.app.pageOptions;
|
||||
const { repoID, filePath, fileName, rawPath } = window.shared.pageOptions;
|
||||
|
||||
window.seafile = {
|
||||
repoID,
|
||||
@@ -13,14 +15,14 @@ window.seafile = {
|
||||
docName: fileName, // required
|
||||
docPath: filePath,
|
||||
serviceUrl: serviceURL,
|
||||
username,
|
||||
};
|
||||
|
||||
class ViewFileSdoc extends React.Component {
|
||||
|
||||
render() {
|
||||
return <SimpleViewer />;
|
||||
}
|
||||
}
|
||||
|
||||
ReactDom.render(<ViewFileSdoc />, document.getElementById('wrapper'));
|
||||
|
||||
ReactDom.render(
|
||||
<I18nextProvider i18n={ i18n } >
|
||||
<Suspense fallback={<Loading />}>
|
||||
<SimpleViewer />
|
||||
</Suspense>
|
||||
</I18nextProvider>,
|
||||
document.getElementById('wrapper')
|
||||
);
|
||||
|
Reference in New Issue
Block a user