update the script and support both notionnext and general database

This commit is contained in:
Jiaxin Peng
2023-11-05 17:32:10 +00:00
parent 8617878582
commit 398b785e03
14 changed files with 650 additions and 410 deletions

View File

@@ -1,7 +1,7 @@
import {i18nConfig} from "src/lang/I18n";
import {Editor, MarkdownView} from "obsidian";
import {FuzzySuggester, DatabaseList} from "./FuzzySuggester";
import {uploadCommand} from "../upload/uploadCommand";
import {uploadCommandGeneral, uploadCommandNext} from "../upload/uploadCommand";
import ObsidianSyncNotionPlugin from "src/main";
// create the commands list
@@ -12,19 +12,19 @@ export default class RibbonCommands {
Ncommand = [
{
id: "share-to-notionnext",
name: i18nConfig.ribbonIcon, // Use the translated text from i18nConfig
name: i18nConfig.CommandName, // Use the translated text from i18nConfig
editorCallback: async (editor: Editor, view: MarkdownView) => {
// await this.plugin.uploadCommand()
await uploadCommand(this.plugin, this.plugin.settings, this.plugin.app)
await uploadCommandNext(this.plugin, this.plugin.settings, this.plugin.app)
}
},
// {
// id: "share-to-notion",
// name: i18nConfig.CommandNameGeneral, // Use the translated text from i18nConfig
// editorCallback: async (editor: Editor, view: MarkdownView) => {
// await this.plugin.upload();
// }
// }
{
id: "share-to-notion",
name: i18nConfig.CommandNameGeneral, // Use the translated text from i18nConfig
editorCallback: async (editor: Editor, view: MarkdownView) => {
await uploadCommandGeneral(this.plugin, this.plugin.settings, this.plugin.app);
}
}
];
async ribbonDisplay() {