mirror of
https://github.com/zigholding/obsidian-notesync-plugin.git
synced 2026-07-22 05:43:30 +00:00
update
This commit is contained in:
parent
4ba68e4f24
commit
1539fb2eb8
3 changed files with 23 additions and 6 deletions
|
|
@ -244,10 +244,7 @@ const cmd_export_as_single_note = (plugin: NoteSyncPlugin) => ({
|
|||
const path = require("path");
|
||||
const { dialog } = require("electron").remote;
|
||||
|
||||
let cfiles = [];
|
||||
if(plugin.easyapi.nc){
|
||||
cfiles = plugin.easyapi.nc.chain.get_selected_files()
|
||||
}
|
||||
let cfiles = plugin.easyapi.file.get_selected_files();
|
||||
if(cfiles.length<=2){
|
||||
// 1. 当前文件
|
||||
let cfile = plugin.easyapi.cfile;
|
||||
|
|
|
|||
|
|
@ -164,5 +164,25 @@ export class File {
|
|||
}
|
||||
return tags
|
||||
}
|
||||
|
||||
get_selected_files(current_if_no_selected = true) {
|
||||
let selector = document.querySelectorAll(
|
||||
".tree-item-self.is-selected"
|
||||
);
|
||||
let items = Object.values(selector).map((x: any) => {
|
||||
var _a;
|
||||
return (_a = x.dataset) == null ? void 0 : _a.path;
|
||||
});
|
||||
let tfiles = items.map(
|
||||
(x) => this.get_tfile(x)).filter((x) => x.extension == "md"
|
||||
)
|
||||
if (tfiles.length > 0) {
|
||||
return tfiles
|
||||
} else if (current_if_no_selected && this.app.workspace.getActiveFile()) {
|
||||
return [this.app.workspace.getActiveFile()]
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ export class Strings{
|
|||
|
||||
get cmd_export_as_single_note(){
|
||||
if(this.language=='zh'){
|
||||
return '导出目录文件';
|
||||
return '导出多条笔记';
|
||||
}else{
|
||||
return 'Export folder';
|
||||
return 'Export notes';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue