1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

change markdown preview dialog internal link (#6829)

This commit is contained in:
Michael An
2024-09-23 16:21:08 +08:00
committed by GitHub
parent 5e55cbd1fe
commit 9983d50e76
7 changed files with 16 additions and 17 deletions

View File

@@ -16,18 +16,18 @@
height: 48px; height: 48px;
} }
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-left-name > span { .seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-left-name img {
margin-right: 6px; margin-right: 6px;
} }
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-right-tool > span { .seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-right-tool>span {
margin-left: 10px; margin-left: 10px;
cursor: pointer; cursor: pointer;
color: #000; color: #000;
opacity: 0.5; opacity: 0.5;
} }
.seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-right-tool > span:hover { .seafile-markdown-viewer-modal-header .seafile-markdown-viewer-modal-header-right-tool>span:hover {
opacity: 0.75; opacity: 0.75;
} }

View File

@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import { Modal, ModalBody } from 'reactstrap'; import { Modal, ModalBody } from 'reactstrap';
import { mediaUrl } from '../../utils/constants'; import { mediaUrl } from '../../utils/constants';
import SeafileMarkdownViewer from '../seafile-markdown-viewer'; import SeafileMarkdownViewer from '../seafile-markdown-viewer';
import InternalLinkOperation from '../operations/internal-link-operation';
import { Utils } from '../../utils/utils';
import './markdown-viewer-dialog.css'; import './markdown-viewer-dialog.css';
@@ -22,6 +24,7 @@ const propTypes = {
class MarkdownViewerDialog extends React.Component { class MarkdownViewerDialog extends React.Component {
render() { render() {
const { repoID, filePath, fileName } = this.props;
return ( return (
<Modal <Modal
isOpen={true} isOpen={true}
@@ -33,7 +36,8 @@ class MarkdownViewerDialog extends React.Component {
<div className='seafile-markdown-viewer-modal-header'> <div className='seafile-markdown-viewer-modal-header'>
<div className='seafile-markdown-viewer-modal-header-left-name'> <div className='seafile-markdown-viewer-modal-header-left-name'>
<span><img src={`${mediaUrl}img/file/256/md.png`} width='24' alt='' /></span> <span><img src={`${mediaUrl}img/file/256/md.png`} width='24' alt='' /></span>
<span>{this.props.fileName}</span> <span>{fileName}</span>
<InternalLinkOperation path={Utils.joinPath(filePath, fileName)} repoID={repoID} />
</div> </div>
<div className='seafile-markdown-viewer-modal-header-right-tool'> <div className='seafile-markdown-viewer-modal-header-right-tool'>
<span className='sf3-font sf3-font-open' onClick={this.props.openMarkdownFile}></span> <span className='sf3-font sf3-font-open' onClick={this.props.openMarkdownFile}></span>
@@ -48,8 +52,8 @@ class MarkdownViewerDialog extends React.Component {
lastModified = {this.props.lastModified} lastModified = {this.props.lastModified}
latestContributor={this.props.latestContributor} latestContributor={this.props.latestContributor}
onLinkClick={this.props.onLinkClick} onLinkClick={this.props.onLinkClick}
repoID={this.props.repoID} repoID={repoID}
path={this.props.filePath} path={filePath}
> >
</SeafileMarkdownViewer> </SeafileMarkdownViewer>
</ModalBody> </ModalBody>

View File

@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import moment from 'moment'; import moment from 'moment';
import { isPro, gettext, mediaUrl, siteRoot } from '../../utils/constants'; import { isPro, gettext, mediaUrl, siteRoot } from '../../utils/constants';
import { InternalLinkOperation } from '../operations'; import InternalLinkOperation from '../operations/internal-link-operation';
const propTypes = { const propTypes = {
toggleStar: PropTypes.func.isRequired, toggleStar: PropTypes.func.isRequired,

View File

@@ -1,6 +0,0 @@
import InternalLinkOperation from './internal-link-operation';
import './style.css';
export {
InternalLinkOperation,
};

View File

@@ -1,5 +1,5 @@
.dialog-operation { .dialog-operation {
display: flex; display: inline-flex;
align-items: center; align-items: center;
} }

View File

@@ -1,7 +1,8 @@
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { gettext } from '../../../utils/constants'; import { gettext } from '../../utils/constants';
import InternalLinkDialog from '../../dialog/internal-link-dialog'; import InternalLinkDialog from '../dialog/internal-link-dialog';
import './internal-link-operation.css';
const propTypes = { const propTypes = {
repoID: PropTypes.string.isRequired, repoID: PropTypes.string.isRequired,

View File

@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import moment from 'moment'; import moment from 'moment';
import { gettext } from '../../../utils/constants'; import { gettext } from '../../../utils/constants';
import { InternalLinkOperation } from '../../../components/operations'; import InternalLinkOperation from '../../../components/operations/internal-link-operation';
const { repoID, filePath } = window.app.pageOptions; const { repoID, filePath } = window.app.pageOptions;