1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-13 13:50:07 +00:00

shared md & trash snapshot md

This commit is contained in:
杨顺强
2023-12-07 15:14:34 +08:00
parent 551213c429
commit da89c9a338
4 changed files with 35 additions and 72 deletions

View File

@@ -9,15 +9,14 @@ const { fileContent } = window.app.pageOptions;
class FileContent extends React.Component { class FileContent extends React.Component {
render() { render() {
return ( return (
<div className="file-view-content flex-1 o-auto"> <div className="file-view-content md-content">
<div className="md-content">
<MarkdownViewer <MarkdownViewer
markdownContent={fileContent} isFetching={false}
showTOC={false} value={fileContent}
scriptSource={mediaUrl + 'js/mathjax/tex-svg.js'} isShowOutline={false}
mathJaxSource={mediaUrl + 'js/mathjax/tex-svg.js'}
/> />
</div> </div>
</div>
); );
} }
} }

View File

@@ -1,9 +1,14 @@
.md-content { .file-view-content.md-content {
box-shadow: 0 0 6px #ccc; width: 100%;
border: 1px solid #ccc; height: 100%;
padding: 70px 75px; background: #f4f4f4;
width: calc(100% - 40px); border-right: none;
max-width: 950px; padding: 0;
background: #fff; display: flex;
margin: 0 auto; }
.md-content .sf-slate-viewer-scroll-container .article {
border: 1px solid #ccc;
box-shadow: 0 0 6px #ccc;
padding: 70px 75px;
} }

View File

@@ -48,24 +48,14 @@
overflow: auto; overflow: auto;
} }
.shared-file-view-body .article { .shared-file-view-body.md-view {
min-height: calc(100% - 15px); padding: 0;
background: #fff; display: flex;
padding: 40px 60px; min-height: 0;
margin: 0 340px 15px 40px;
border: 1px solid #e6e6dd;
} }
.shared-file-view-body .article-no-outline { .shared-file-view-body .sf-slate-viewer-outline {
max-width: 950px; top: 145px !important;
margin: 0 auto 15px;
}
.shared-file-view-body .seafile-markdown-outline {
width: 300px;
top: 145px;
bottom: 30px;
height: auto;
} }
@media (max-width: 991.98px) { @media (max-width: 991.98px) {
@@ -73,27 +63,10 @@
width: 100%; width: 100%;
padding: 10px 20px; padding: 10px 20px;
} }
.shared-file-view-body .md-view {
width: 95%;
}
.shared-file-view-body .md-view {
padding: 55px 50px;
}
}
@media (max-width: 768px) { .sf-slate-viewer-article-container {
.shared-file-view-body .md-view {
padding: 0 10px; padding: 0 10px;
width: 100%; width: 100%;
} margin: 0 !important;
.shared-file-view-body .md-view .article {
display: flex;
padding: 20px;
margin: 0;
}
.shared-file-view-body .seafile-markdown-outline {
display: none;
} }
} }

View File

@@ -65,13 +65,6 @@ class FileContent extends React.Component {
return Utils.changeMarkdownNodes(value, this.changeImageURL); return Utils.changeMarkdownNodes(value, this.changeImageURL);
}; };
updateForNoOutline = () => {
const $outline = document.querySelector('.md-view .seafile-markdown-outline');
const $main = document.querySelector('.md-view .article');
$outline.className += ' d-none';
$main.className += ' article-no-outline';
};
render() { render() {
if (err) { if (err) {
return <SharedFileViewTip />; return <SharedFileViewTip />;
@@ -82,21 +75,14 @@ class FileContent extends React.Component {
} }
return ( return (
<div className="shared-file-view-body"> <div className="shared-file-view-body md-view">
<div className="md-view">
<MarkdownViewer <MarkdownViewer
scriptSource={mediaUrl + 'js/mathjax/tex-svg.js'} value={this.state.markdownContent}
markdownContent={this.state.markdownContent} isShowOutline={true}
showTOC={true} mathJaxSource={mediaUrl + 'js/mathjax/tex-svg.js'}
updateForNoOutline={this.updateForNoOutline} beforeRenderCallback={this.modifyValueBeforeRender}
activeTitleIndex={''}
serviceURL={serviceURL}
sharedToken={sharedToken}
repoID={repoID}
modifyValueBeforeRender={this.modifyValueBeforeRender}
/> />
</div> </div>
</div>
); );
} }
} }