Skip to content

Commit

Permalink
Edit settings: add shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
HyeonseoNam committed Mar 19, 2023
1 parent 1ed0826 commit 16e6a81
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,29 @@ export class AutoTaggerSettingTab extends PluginSettingTab {
const { containerEl } = this;
const commandOption = this.plugin.settings.commandOption;

containerEl.empty();
// shortcut button
const shortcutEl = new Setting(this.containerEl)
.setDesc('')
.addButton((cb) => {
cb.setButtonText("Specify shortcuts")
.setCta()
.onClick(() => {
// @ts-ignore
app.setting.openTabById("hotkeys");
// @ts-ignore
const tab = app.setting.activeTab;
tab.searchInputEl.value = `${this.plugin.manifest.name}:`;
tab.updateHotkeyVisibility();
});
});
shortcutEl.descEl.innerHTML += `
This plugin does not have default shortcuts to prevent conflicts. <br>
Assig shortcuts to commands for different input types.`


// ------- [API Setting] -------
// API Key input
containerEl.empty();
containerEl.createEl('h1', { text: 'API Setting' });
const apiKeySetting = new Setting(containerEl)
.setName('ChatGPT API Key')
Expand Down

0 comments on commit 16e6a81

Please sign in to comment.