Skip to content

Commit

Permalink
fix: applied Obsidian style guide recommendations to code
Browse files Browse the repository at this point in the history
  • Loading branch information
scooper4711 committed Jun 24, 2024
1 parent a3cb6ac commit fc405a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 5 additions & 7 deletions src/SyrinscapeSettingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ export class SyrinscapeSettingsTab extends PluginSettingTab {

containerEl.empty();

containerEl.createEl('h2', { text: 'Syrinscape Plugin Settings' });

// create an anchor link to the Syrinscape control panel
const desc:DocumentFragment=new DocumentFragment();
desc.appendText("Enter your Syrinscape Auth token here. You can find it in your ")
desc.append(desc.createEl('a', {"href": "https://syrinscape.com/online/cp/", text: "Syrinscape control panel."}))

new Setting(containerEl)
.setName('Auth Token')
.setName('Auth token')
.setDesc(desc)
.addText(text => text
.setPlaceholder(DEFAULT_SETTINGS.authToken)
Expand All @@ -35,7 +33,7 @@ export class SyrinscapeSettingsTab extends PluginSettingTab {

// Number setting for the maximum cache age, in days
new Setting(containerEl)
.setName('Cache Age')
.setName('Cache age')
.setDesc(`Enter the maximum age of the cache in days. Default is ${DEFAULT_SETTINGS.maxCacheAge.toString()} days.`)
.addText(text => text
.setPlaceholder(DEFAULT_SETTINGS.maxCacheAge.toString())
Expand All @@ -48,7 +46,7 @@ export class SyrinscapeSettingsTab extends PluginSettingTab {

// String setting for the trigger word, e.g. `syrinscape` or `sscape`
new Setting(containerEl)
.setName('Trigger Word')
.setName('Trigger word')
.setDesc('Enter the word that the Syrinscape player plugin will look for. Default is "syrinscape"')
.addText(text => text
.setPlaceholder(DEFAULT_SETTINGS.triggerWord)
Expand All @@ -67,10 +65,10 @@ export class SyrinscapeSettingsTab extends PluginSettingTab {
dateText.appendText(this.plugin.settings.lastUpdated?this.plugin.settings.lastUpdated.toDateString():'never');
buttonDesc.append(dateText);
new Setting(containerEl)
.setName('Clear Remote Links')
.setName('Clear remote links')
.setDesc(buttonDesc)
.addButton(button => button
.setButtonText('Clear Remote Links')
.setButtonText('Clear remote links')
.onClick(async () => {
this.plugin.clearCache();
this.plugin.fetchRemoteLinks();
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface SyrinscapeSettings {
};

export const DEFAULT_SETTINGS: SyrinscapeSettings = {
authToken: 'insert-your-auth-token-here',
authToken: '',
triggerWord: 'syrinscape',
csvContent: '',
lastUpdated: null,
Expand Down Expand Up @@ -131,7 +131,8 @@ class SyrinscapeRenderChild extends MarkdownRenderChild {
const apiUrl = `https://syrinscape.com/online/frontend-api/${this.type}s/${this.soundid}/${cmd}/`;

try {
const response = await fetch(apiUrl, {
const response = await requestUrl({
url: apiUrl,
method: 'GET',
headers: {
'Content-Type': 'application',
Expand Down

0 comments on commit fc405a8

Please sign in to comment.