mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-31 18:18:36 +08:00
complete the basic customisation feature
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { FuzzySuggestModal, FuzzyMatch } from 'obsidian';
|
||||
import MyPlugin from "../main";
|
||||
import {i18nConfig} from "../lang/I18n";
|
||||
import { i18nConfig } from "../lang/I18n";
|
||||
|
||||
/**
|
||||
* Simple interface for what should be displayed and stored for suggester
|
||||
@@ -38,7 +38,7 @@ export class FuzzySuggester extends FuzzySuggestModal<DatabaseList>{
|
||||
return item.name
|
||||
}
|
||||
|
||||
onChooseItem(item: DatabaseList, evt:MouseEvent | KeyboardEvent): void { }
|
||||
onChooseItem(item: DatabaseList, evt: MouseEvent | KeyboardEvent): void { }
|
||||
|
||||
onChooseSuggestion(item: FuzzyMatch<DatabaseList>, evt: MouseEvent | KeyboardEvent): void {
|
||||
this.callback(item.item, evt)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {i18nConfig} from "src/lang/I18n";
|
||||
import {Editor, MarkdownView} from "obsidian";
|
||||
import {FuzzySuggester, DatabaseList} from "./FuzzySuggester";
|
||||
import {uploadCommandGeneral, uploadCommandNext} from "../upload/uploadCommand";
|
||||
import { i18nConfig } from "src/lang/I18n";
|
||||
import { Editor, MarkdownView } from "obsidian";
|
||||
import { FuzzySuggester, DatabaseList } from "./FuzzySuggester";
|
||||
import { uploadCommandGeneral, uploadCommandNext } from "../upload/uploadCommand";
|
||||
import ObsidianSyncNotionPlugin from "src/main";
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ interface Command {
|
||||
|
||||
// create the commands list
|
||||
export default class RibbonCommands {
|
||||
plugin: ObsidianSyncNotionPlugin;
|
||||
plugin: ObsidianSyncNotionPlugin;
|
||||
|
||||
Ncommand: Command[] = [];
|
||||
|
||||
@@ -55,22 +55,22 @@ export default class RibbonCommands {
|
||||
});
|
||||
}
|
||||
|
||||
async ribbonDisplay() {
|
||||
const NcommandList: DatabaseList[] = [];
|
||||
async ribbonDisplay() {
|
||||
const NcommandList: DatabaseList[] = [];
|
||||
|
||||
this.Ncommand.map(command => NcommandList.push(
|
||||
{
|
||||
name:command.name,
|
||||
match: command.editorCallback
|
||||
}
|
||||
)
|
||||
);
|
||||
this.Ncommand.map(command => NcommandList.push(
|
||||
{
|
||||
name: command.name,
|
||||
match: command.editorCallback
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
const fusg = new FuzzySuggester(this.plugin);
|
||||
const fusg = new FuzzySuggester(this.plugin);
|
||||
|
||||
fusg.setSuggesterData(NcommandList);
|
||||
await fusg.display(async (results) => {await results.match()})
|
||||
};
|
||||
fusg.setSuggesterData(NcommandList);
|
||||
await fusg.display(async (results) => { await results.match() })
|
||||
};
|
||||
|
||||
// if the setting has been changed, try to rebuild the command list
|
||||
async updateCommand() {
|
||||
|
||||
Reference in New Issue
Block a user