mirror of
https://github.com/d7sd6u/obsidian-crosslink-advanced.git
synced 2026-07-22 05:41:20 +00:00
Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
481d7c875e | ||
|
|
c0949aed2c | ||
|
|
e1c09d282f | ||
|
|
59bc09e546 |
5 changed files with 29 additions and 20 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "crosslink-advanced",
|
||||
"name": "Crosslink Advanced",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.3",
|
||||
"minAppVersion": "1.8.0",
|
||||
"description": "Tag files using folders and symlinks system (ftags).",
|
||||
"author": "d7sd6u",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 6d64559440fa42f765db2906d5f74af3eed0ada8
|
||||
Subproject commit fb589401f0ba76fab5c01bab8b63684ceeff3290
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "crosslink-advanced",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.3",
|
||||
"description": "",
|
||||
"main": "./src/main.ts",
|
||||
"scripts": {
|
||||
|
|
|
|||
22
src/main.ts
22
src/main.ts
|
|
@ -458,15 +458,19 @@ export class FileAndDirChooser extends FuzzySuggestModal<TFile> {
|
|||
return this.inputEl.value;
|
||||
}
|
||||
private get hiddenChooser() {
|
||||
const chooser = (
|
||||
this as unknown as {
|
||||
chooser: {
|
||||
selectedItem: number | null;
|
||||
values: { item: TFile }[] | null;
|
||||
suggestions: unknown[];
|
||||
};
|
||||
}
|
||||
).chooser;
|
||||
interface WithChooser {
|
||||
chooser: {
|
||||
selectedItem: number | null;
|
||||
values:
|
||||
| {
|
||||
item: TFile;
|
||||
}[]
|
||||
| null;
|
||||
suggestions: unknown[];
|
||||
};
|
||||
}
|
||||
|
||||
const chooser = (this as unknown as WithChooser).chooser;
|
||||
return chooser;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { App, PluginSettingTab, Setting } from "obsidian";
|
||||
import Main from "./main";
|
||||
import { FolderSuggest } from "../obsidian-reusables/src/FolderSuggest";
|
||||
|
||||
export const DEFAULT_SETTINGS = {
|
||||
inbox: "Uncategorized",
|
||||
|
|
@ -13,6 +14,8 @@ export class MainPluginSettingsTab extends PluginSettingTab {
|
|||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
suggest?: FolderSuggest;
|
||||
|
||||
display() {
|
||||
const { containerEl } = this;
|
||||
containerEl.empty();
|
||||
|
|
@ -20,17 +23,19 @@ export class MainPluginSettingsTab extends PluginSettingTab {
|
|||
this.app.vault.getAllFolders().map((v) => [v.path, v.path]),
|
||||
);
|
||||
options["/"] = "/";
|
||||
|
||||
const setInbox = async (v: string) => {
|
||||
this.plugin.settings.inbox = v;
|
||||
await this.plugin.saveSettings();
|
||||
};
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Inbox folder")
|
||||
.setDesc("Folder where notes without explicit ftags are stored")
|
||||
.addDropdown((textArea) => {
|
||||
textArea
|
||||
.addOptions(options)
|
||||
.setValue(this.plugin.settings.inbox)
|
||||
.onChange(async (v) => {
|
||||
this.plugin.settings.inbox = v;
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
.addSearch((search) => {
|
||||
search.setValue(this.plugin.settings.inbox).onChange(setInbox);
|
||||
this.suggest = new FolderSuggest(this.app, search.inputEl);
|
||||
this.suggest.onSelect((v) => setInbox(v.path));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue