mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +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':
|
||||
this.onOpenViaClient(dirent);
|
||||
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:
|
||||
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) => {
|
||||
const filePath = this.getDirentPath(dirent);
|
||||
seafileAPI.lockfile(this.props.repoID, filePath).then((res) => {
|
||||
|
@@ -2295,6 +2295,7 @@ class LibContentView extends React.Component {
|
||||
showDirentDetail={this.showDirentDetail}
|
||||
currentMode={this.state.currentMode}
|
||||
switchViewMode={this.switchViewMode}
|
||||
onItemConvert={this.onConvertItem}
|
||||
/>
|
||||
:
|
||||
<CurDirPath
|
||||
|
Reference in New Issue
Block a user