generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format code with prettier and standardjs
- Loading branch information
1 parent
2c395eb
commit fd448f5
Showing
1 changed file
with
28 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,38 @@ | ||
|
||
import ObsidianCamera from "main"; | ||
import { App, PluginSettingTab, Setting } from "obsidian"; | ||
|
||
export interface CameraPluginSettings { | ||
chosenFolderPath: string; | ||
|
||
chosenFolderPath: string; | ||
} | ||
|
||
export const DEFAULT_SETTINGS: CameraPluginSettings = { | ||
chosenFolderPath: 'attachments/snaps' | ||
} | ||
chosenFolderPath: "attachments/snaps", | ||
}; | ||
|
||
export default class CameraSettingsTab extends PluginSettingTab { | ||
plugin: ObsidianCamera; | ||
|
||
constructor(app: App, plugin: ObsidianCamera) { | ||
super(app, plugin); | ||
this.plugin = plugin; | ||
} | ||
|
||
display(): void { | ||
const { containerEl } = this; | ||
containerEl.empty(); | ||
containerEl.createEl('h2', { text: 'Obsidian-Camera settings' }); | ||
|
||
new Setting(containerEl) | ||
.setName('Folder Path') | ||
.setDesc('Folder where the videos and snaps should be saved') | ||
.addText(text => text | ||
.setPlaceholder('Enter your secret') | ||
.setValue(this.plugin.settings.chosenFolderPath) | ||
.onChange(async (value) => { | ||
|
||
this.plugin.settings.chosenFolderPath = value; | ||
await this.plugin.saveSettings(); | ||
})); | ||
} | ||
plugin: ObsidianCamera; | ||
|
||
constructor(app: App, plugin: ObsidianCamera) { | ||
super(app, plugin); | ||
this.plugin = plugin; | ||
} | ||
|
||
display(): void { | ||
const { containerEl } = this; | ||
containerEl.empty(); | ||
containerEl.createEl("h2", { text: "Obsidian-Camera settings" }); | ||
|
||
new Setting(containerEl) | ||
.setName("Folder Path") | ||
.setDesc("Folder where the videos and snaps should be saved") | ||
.addText((text) => | ||
text | ||
.setPlaceholder("Enter your secret") | ||
.setValue(this.plugin.settings.chosenFolderPath) | ||
.onChange(async (value) => { | ||
this.plugin.settings.chosenFolderPath = value; | ||
await this.plugin.saveSettings(); | ||
}) | ||
); | ||
} | ||
} |