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

[shared file view] markdown: redesigned it for 'no outline' & 'short outline'

This commit is contained in:
llj
2022-05-30 18:47:52 +08:00
parent 7db323a63a
commit fe62254f31
4 changed files with 23 additions and 11 deletions

View File

@@ -12,7 +12,7 @@
"@seafile/react-image-lightbox": "0.0.1",
"@seafile/resumablejs": "1.1.16",
"@seafile/seafile-calendar": "0.0.12",
"@seafile/seafile-editor": "0.3.102",
"@seafile/seafile-editor": "0.3.103",
"chart.js": "2.9.4",
"classnames": "^2.2.6",
"copy-to-clipboard": "^3.0.8",
@@ -5085,9 +5085,9 @@
}
},
"node_modules/@seafile/seafile-editor": {
"version": "0.3.102",
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-0.3.102.tgz",
"integrity": "sha512-9/BOs0yPOORsju11/xuO49t0Z/B6ubXYLl8IamMo3eFe8JBGIfi35rJXmTCrzwjKycr3V0cXBrM6DWzDLkGddA==",
"version": "0.3.103",
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-0.3.103.tgz",
"integrity": "sha512-xtXkFzFTBGKKVMRaJ1KXPFuxVtDmi3CO+SYyuead4jbJ4RZeZ4CwYjdXO6Yz+DGL0Xg6JAeHG8kLC4rXLoGn8g==",
"dependencies": {
"@seafile/react-image-lightbox": "^0.0.9",
"@seafile/slate-react": "^0.54.13",
@@ -32025,9 +32025,9 @@
}
},
"@seafile/seafile-editor": {
"version": "0.3.102",
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-0.3.102.tgz",
"integrity": "sha512-9/BOs0yPOORsju11/xuO49t0Z/B6ubXYLl8IamMo3eFe8JBGIfi35rJXmTCrzwjKycr3V0cXBrM6DWzDLkGddA==",
"version": "0.3.103",
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-0.3.103.tgz",
"integrity": "sha512-xtXkFzFTBGKKVMRaJ1KXPFuxVtDmi3CO+SYyuead4jbJ4RZeZ4CwYjdXO6Yz+DGL0Xg6JAeHG8kLC4rXLoGn8g==",
"requires": {
"@seafile/react-image-lightbox": "^0.0.9",
"@seafile/slate-react": "^0.54.13",

View File

@@ -7,7 +7,7 @@
"@seafile/react-image-lightbox": "0.0.1",
"@seafile/resumablejs": "1.1.16",
"@seafile/seafile-calendar": "0.0.12",
"@seafile/seafile-editor": "0.3.102",
"@seafile/seafile-editor": "0.3.103",
"chart.js": "2.9.4",
"classnames": "^2.2.6",
"copy-to-clipboard": "^3.0.8",

View File

@@ -48,16 +48,20 @@
}
.shared-file-view-body .article {
min-height: calc(100% - 40px);
min-height: calc(100% - 15px);
background: #fff;
padding: 40px 60px;
margin: 0 340px 15px 40px;
border: 1px solid #e6e6dd;
}
.shared-file-view-body .article-no-outline {
max-width: 950px;
margin: 0 auto 15px;
}
.shared-file-view-body .seafile-markdown-outline {
width: 300px;
border-left: 1px solid #e6e6dd;
top: 145px;
bottom: 30px;
height: auto;

View File

@@ -65,6 +65,13 @@ class FileContent extends React.Component {
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() {
if (err) {
return <SharedFileViewTip />;
@@ -76,11 +83,12 @@ class FileContent extends React.Component {
return (
<div className="shared-file-view-body">
<div className="md-view">
<div className="md-view h-100">
<MarkdownViewer
scriptSource={mediaUrl + 'js/mathjax/tex-svg.js'}
markdownContent={this.state.markdownContent}
showTOC={true}
updateForNoOutline={this.updateForNoOutline}
activeTitleIndex={''}
serviceURL={serviceURL}
sharedToken={sharedToken}