mirror of
https://github.com/kdnk/obsidian-automatic-linker.git
synced 2026-07-22 12:00:30 +00:00
feat: add JIRA URL formatting settings to plugin configuration
- Introduce toggle for formatting JIRA URLs on save - Add text area for configuring multiple JIRA domain URLs - Enable users to customize JIRA URL formatting behavior
This commit is contained in:
parent
f0947406e1
commit
6852b93b42
1 changed files with 38 additions and 0 deletions
|
|
@ -158,5 +158,43 @@ export class AutomaticLinkerPluginSettingsTab extends PluginSettingTab {
|
|||
text.inputEl.rows = 4;
|
||||
text.inputEl.cols = 50;
|
||||
});
|
||||
|
||||
// Toggle for formatting JIRA URLs on save
|
||||
new Setting(containerEl)
|
||||
.setName("Format JIRA URLs on Save")
|
||||
.setDesc(
|
||||
"When enabled, JIRA URLs will be formatted when saving the file.",
|
||||
)
|
||||
.addToggle((toggle) => {
|
||||
toggle
|
||||
.setValue(this.plugin.settings.formatJiraURLs)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.formatJiraURLs = value;
|
||||
await this.plugin.saveData(this.plugin.settings);
|
||||
});
|
||||
});
|
||||
|
||||
// Add JIRA URLs setting
|
||||
new Setting(containerEl)
|
||||
.setName("JIRA URLs")
|
||||
.setDesc(
|
||||
"Enter JIRA URLs (one per line). Example: jira.enterprise.com",
|
||||
)
|
||||
.addTextArea((text) => {
|
||||
text.setPlaceholder("jira.enterprise.com\njira.company.com")
|
||||
.setValue(this.plugin.settings.jiraURLs.join("\n"))
|
||||
.onChange(async (value) => {
|
||||
// Split by newlines and filter out empty lines
|
||||
const urls = value
|
||||
.split("\n")
|
||||
.map((url) => url.trim())
|
||||
.filter(Boolean);
|
||||
this.plugin.settings.jiraURLs = urls;
|
||||
await this.plugin.saveData(this.plugin.settings);
|
||||
});
|
||||
// Make the text area taller
|
||||
text.inputEl.rows = 4;
|
||||
text.inputEl.cols = 50;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue