mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-31 18:18:36 +08:00
reorganise the setting coding
This commit is contained in:
@@ -142,19 +142,9 @@ export class ObsidianSettingTab extends PluginSettingTab {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const notionAPINextEl = containerEl.createDiv('api-next', (div) => {
|
const notionAPINextEl = this.createStyleDiv('api-next')
|
||||||
div.style.alignItems = "center";
|
|
||||||
div.style.borderTop = "none";
|
|
||||||
div.style.paddingBottom = "0";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const databaseIDNextEl = containerEl.createDiv('databaseID-next', (div) => {
|
const databaseIDNextEl = this.createStyleDiv('databaseID-next')
|
||||||
div.style.alignItems = "center";
|
|
||||||
div.style.borderTop = "none";
|
|
||||||
div.style.paddingBottom = "0";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -274,18 +264,9 @@ export class ObsidianSettingTab extends PluginSettingTab {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const CustomTitleEl = containerEl.createDiv('api-general', (div) => {
|
const CustomTitleEl = this.createStyleDiv('custom-title');
|
||||||
div.style.alignItems = "center";
|
|
||||||
div.style.borderTop = "none";
|
|
||||||
div.style.paddingBottom = "0";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const dynamicSettingContainer = containerEl.createDiv('setting-popover', (div) => {
|
const dynamicSettingContainer = this.createStyleDiv('dynamic-setting');
|
||||||
div.style.alignItems = "center";
|
|
||||||
div.style.borderTop = "none";
|
|
||||||
div.style.paddingBottom = "0";
|
|
||||||
});
|
|
||||||
|
|
||||||
// new Setting(containerEl)
|
// new Setting(containerEl)
|
||||||
// .setName("Convert tags(optional)")
|
// .setName("Convert tags(optional)")
|
||||||
@@ -299,21 +280,9 @@ export class ObsidianSettingTab extends PluginSettingTab {
|
|||||||
// })
|
// })
|
||||||
// );
|
// );
|
||||||
|
|
||||||
|
const notionAPIGeneralEl = this.createStyleDiv('api-general');
|
||||||
|
|
||||||
const notionAPIGeneralEl = containerEl.createDiv('api-general', (div) => {
|
const databaseIDGeneralEl = this.createStyleDiv('databaseID-general');
|
||||||
div.style.alignItems = "center";
|
|
||||||
div.style.borderTop = "none";
|
|
||||||
div.style.paddingBottom = "0";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const databaseIDGeneralEl = containerEl.createDiv('databaseID-general', (div) => {
|
|
||||||
div.style.alignItems = "center";
|
|
||||||
div.style.borderTop = "none";
|
|
||||||
div.style.paddingBottom = "0";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Custom Database Settings
|
// Custom Database Settings
|
||||||
|
|
||||||
@@ -331,4 +300,23 @@ export class ObsidianSettingTab extends PluginSettingTab {
|
|||||||
// })
|
// })
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create a function to create a div with a style for pop over elements
|
||||||
|
private createStyleDiv(className: string | DomElementInfo) {
|
||||||
|
return this.containerEl.createDiv(className, (div) => {
|
||||||
|
div.style.alignItems = "center";
|
||||||
|
div.style.borderTop = "none";
|
||||||
|
div.style.paddingBottom = "0";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// function to add one setting element in the setting tab.
|
||||||
|
private createSettingEl() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the setting display style in the setting tab
|
||||||
|
private updateSettingEl() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user