diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index 93c4e92..cbba596 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -33,6 +33,8 @@ export const en = { NotionUserDesc: "Collect from share link likes:https://username.notion.site. Your notion id is [username]", NotionUserText: "Enter your notion ID", + NotionLinkDisplay: "Notion Link Display", + NotionLinkDisplayDesc: "Default is ON, if you want to hide the link in the front matter, please turn it off", NotionGeneralSettingHeader: "General Notion Database Settings", NotionGeneralButton: "Notion General Sync", NotionGeneralButtonDesc: "Open this option, Sync to Notion General Database command will be displayed in the command palette (default: ON)", diff --git a/src/lang/locale/ja.ts b/src/lang/locale/ja.ts index d6ab0c8..0221025 100644 --- a/src/lang/locale/ja.ts +++ b/src/lang/locale/ja.ts @@ -31,6 +31,8 @@ export const ja = { NotionUser: "Notion ID(ユーザー名、任意)", NotionUserDesc: "共有リンクから取得(例:https://username.notion.site)。Notion IDは[username]です", NotionUserText: "Notion IDを入力", + NotionLinkDisplay: "Notionリンク表示", + NotionLinkDisplayDesc: "デフォルトはONです。front matterにリンクを非表示にしたい場合は、オフにしてください", NotionGeneralSettingHeader: "一般的なNotionデータベース設定", NotionGeneralButton: "一般的なNotion同期", NotionGeneralButtonDesc: "このオプションを開くと、一般的なNotionデータベース同期コマンドがコマンドパレットに表示されます(デフォルト:ON)", diff --git a/src/lang/locale/zh.ts b/src/lang/locale/zh.ts index 89f1f67..08a9375 100644 --- a/src/lang/locale/zh.ts +++ b/src/lang/locale/zh.ts @@ -33,6 +33,8 @@ export const zh = { NotionUserDesc: "数据库分享链接类似:https://username.notion.site/。你的 Notion ID 是 [username]", NotionUserText: "输入你的 Notion ID", + NotionLinkDisplay: "Notion 链接显示", + NotionLinkDisplayDesc: "默认开启,如果你不想在front matter中显示链接,请关闭", NotionGeneralSettingHeader: "普通 Notion 数据库设置", NotionGeneralButton: "普通数据库同步", NotionGeneralButtonDesc: "打开此选项,同步到普通数据库命令将显示在命令面板中(默认:开)", diff --git a/src/ui/settingTabs.ts b/src/ui/settingTabs.ts index 28291d3..d4316fc 100644 --- a/src/ui/settingTabs.ts +++ b/src/ui/settingTabs.ts @@ -13,6 +13,7 @@ export interface PluginSettings { databaseIDNext: string; bannerUrl: string; notionUser: string; + NotionLinkDisplay: boolean; proxy: string; GeneralButton: boolean; tagButton: boolean; @@ -37,7 +38,7 @@ export interface DatabaseDetails { tagButton: boolean; customTitleButton: boolean; customTitleName: string; - customProperties:{ customName: string, customType: string }[]; + customProperties:{ customName: string, customType: string, index: number}[]; // customValues: string; saved: boolean; } @@ -48,6 +49,7 @@ export const DEFAULT_SETTINGS: PluginSettings = { databaseIDNext: "", bannerUrl: "", notionUser: "", + NotionLinkDisplay: true, proxy: "", GeneralButton: true, tagButton: true, @@ -84,6 +86,10 @@ export class ObsidianSettingTab extends PluginSettingTab { this.createSettingEl(containerEl, i18nConfig.NotionUser, i18nConfig.NotionUserDesc, 'text', i18nConfig.NotionUserText, this.plugin.settings.notionUser, 'notionUser') + this.createSettingEl(containerEl, i18nConfig.NotionLinkDisplay, i18nConfig.NotionLinkDisplayDesc, 'toggle', i18nConfig.NotionLinkDisplay, this.plugin.settings.NotionLinkDisplay, 'NotionLinkDisplay') + + // TODO: add toggle to enable or disable link display + // add new button @@ -132,38 +138,6 @@ export class ObsidianSettingTab extends PluginSettingTab { // list all created database this.showDatabase(); - - - - - // // notion next database settings - // - // const NextTabs = new SettingNextTabs(this.app, this.plugin, this); - // - // NextTabs.display(); - // - // - // // General Database Settings - // const GeneralTabs = new SettingGeneralTabs(this.app, this.plugin, this); - // - // GeneralTabs.display(); - - - // Custom Database Settings - - // containerEl.createEl('h2', {text: i18nConfig.NotionCustomSettingHeader}); - // - // new Setting(containerEl) - // .setName(i18nConfig.NotionCustomButton) - // .setDesc(i18nConfig.NotionCustomButtonDesc) - // .addToggle((toggle) => - // toggle - // .setValue(this.plugin.settings.CustomButton) - // .onChange(async (value) => { - // this.plugin.settings.CustomButton = value; - // await this.plugin.saveSettings(); - // }) - // ); } // create a function to create a div with a style for pop over elements