mirror of
https://github.com/mousebomb/obsidian-diary-ics.git
synced 2026-07-22 05:49:47 +00:00
修正styles放入css
This commit is contained in:
parent
feaef4128c
commit
07b93660c6
2 changed files with 21 additions and 12 deletions
15
main.ts
15
main.ts
|
|
@ -522,28 +522,19 @@ class DiaryIcsSettingTab extends PluginSettingTab {
|
|||
await this.plugin.saveSettings(false);
|
||||
}));
|
||||
|
||||
const templateExample = containerEl.createEl('div', {text: locale.templateExampleTitle});
|
||||
templateExample.style.padding = '5px';
|
||||
templateExample.style.fontSize = '0.8em';
|
||||
templateExample.style.color = '#888';
|
||||
const templateExample = containerEl.createEl('div', {text: locale.templateExampleTitle, cls: 'diary-ics-template-example'});
|
||||
templateExample.createEl('div', {text: locale.templateExample1});
|
||||
templateExample.createEl('div', {text: locale.templateExample2});
|
||||
templateExample.createEl('div', {text: locale.templateExample3});
|
||||
templateExample.createEl('div', {text: locale.templateExample4});
|
||||
templateExample.style.marginBottom = '20px';
|
||||
|
||||
// 显示当前ICS订阅链接
|
||||
const localIP = this.plugin.getLocalIP();
|
||||
containerEl.createEl('h3', {text: locale.icsLinkTitle});
|
||||
const linkEl = containerEl.createEl('div', {text: `http://${localIP}:${this.plugin.settings.port}/feed.ics`});
|
||||
linkEl.style.padding = '10px';
|
||||
linkEl.style.backgroundColor = '#f5f5f5';
|
||||
linkEl.style.borderRadius = '5px';
|
||||
linkEl.style.marginBottom = '20px';
|
||||
const linkEl = containerEl.createEl('div', {text: `http://${localIP}:${this.plugin.settings.port}/feed.ics`, cls: 'diary-ics-link-div'});
|
||||
|
||||
// 添加复制按钮
|
||||
const copyButton = containerEl.createEl('button', {text: locale.copyLinkButton});
|
||||
copyButton.style.marginBottom = '20px';
|
||||
const copyButton = containerEl.createEl('button', {text: locale.copyLinkButton, cls: 'diary-ics-copy-button'});
|
||||
copyButton.addEventListener('click', () => {
|
||||
const url = `http://${localIP}:${this.plugin.settings.port}/feed.ics`;
|
||||
navigator.clipboard.writeText(url);
|
||||
|
|
|
|||
18
styles.css
18
styles.css
|
|
@ -6,3 +6,21 @@ available in the app when your plugin is enabled.
|
|||
If your plugin does not need CSS, delete this file.
|
||||
|
||||
*/
|
||||
|
||||
.diary-ics-template-example {
|
||||
padding: 5px;
|
||||
font-size: 0.8em;
|
||||
color: #888;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.diary-ics-link-div {
|
||||
padding: 10px;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.diary-ics-copy-button {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue