mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +00:00
fix sdoc menu operations (#6775)
This commit is contained in:
@@ -195,11 +195,47 @@ class SelectedDirentsToolbar extends React.Component {
|
|||||||
case 'Open via Client':
|
case 'Open via Client':
|
||||||
this.onOpenViaClient(dirent);
|
this.onOpenViaClient(dirent);
|
||||||
break;
|
break;
|
||||||
|
case 'Convert to Markdown': {
|
||||||
|
this.props.onItemConvert(dirent, 'markdown');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'Convert to docx': {
|
||||||
|
this.props.onItemConvert(dirent, 'docx');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'Convert to sdoc': {
|
||||||
|
this.props.onItemConvert(dirent, 'sdoc');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'Export docx': {
|
||||||
|
this.exportDocx(dirent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'Export sdoc': {
|
||||||
|
this.exportSdoc(dirent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exportDocx = (dirent) => {
|
||||||
|
const serviceUrl = window.app.config.serviceURL;
|
||||||
|
let repoID = this.props.repoID;
|
||||||
|
let filePath = this.getDirentPath(dirent);
|
||||||
|
let exportToDocxUrl = serviceUrl + '/repo/sdoc_export_to_docx/' + repoID + '/?file_path=' + filePath;
|
||||||
|
window.location.href = exportToDocxUrl;
|
||||||
|
};
|
||||||
|
|
||||||
|
exportSdoc = (dirent) => {
|
||||||
|
const serviceUrl = window.app.config.serviceURL;
|
||||||
|
let repoID = this.props.repoID;
|
||||||
|
let filePath = this.getDirentPath(dirent);
|
||||||
|
let exportToSdocUrl = serviceUrl + '/lib/' + repoID + '/file/' + filePath + '?dl=1';
|
||||||
|
window.location.href = exportToSdocUrl;
|
||||||
|
};
|
||||||
|
|
||||||
lockFile = (dirent) => {
|
lockFile = (dirent) => {
|
||||||
const filePath = this.getDirentPath(dirent);
|
const filePath = this.getDirentPath(dirent);
|
||||||
seafileAPI.lockfile(this.props.repoID, filePath).then((res) => {
|
seafileAPI.lockfile(this.props.repoID, filePath).then((res) => {
|
||||||
|
@@ -2295,6 +2295,7 @@ class LibContentView extends React.Component {
|
|||||||
showDirentDetail={this.showDirentDetail}
|
showDirentDetail={this.showDirentDetail}
|
||||||
currentMode={this.state.currentMode}
|
currentMode={this.state.currentMode}
|
||||||
switchViewMode={this.switchViewMode}
|
switchViewMode={this.switchViewMode}
|
||||||
|
onItemConvert={this.onConvertItem}
|
||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
<CurDirPath
|
<CurDirPath
|
||||||
|
Reference in New Issue
Block a user