diff --git a/main.js b/main.js index 39d57e3..c7ef952 100644 --- a/main.js +++ b/main.js @@ -1009,7 +1009,8 @@ var GitHubContributionsSettingTab = class extends import_obsidian.PluginSettingT const oauthSetting = new import_obsidian.Setting(containerEl).setName("Connect GitHub account").setDesc("Click to start the authorization flow"); oauthSetting.addButton( (btn) => btn.setButtonText("Connect GitHub").setCta().onClick(async () => { - btn.setButtonText("Connecting...").setDisabled(true); + btn.setButtonText("Connecting..."); + btn.buttonEl.setAttr("disabled", "true"); cancelled = false; try { const device = await requestDeviceCode(); @@ -1040,7 +1041,8 @@ var GitHubContributionsSettingTab = class extends import_obsidian.PluginSettingT oauthSetting.setDesc("\u26A0 " + msg); new import_obsidian.Notice("GitHub connection failed: " + msg); } - btn.setButtonText("Connect GitHub").setDisabled(false); + btn.setButtonText("Connect GitHub"); + btn.buttonEl.removeAttribute("disabled"); } }) ); @@ -1048,7 +1050,7 @@ var GitHubContributionsSettingTab = class extends import_obsidian.PluginSettingT (btn) => btn.setButtonText("Cancel").onClick(() => { cancelled = true; oauthSetting.setDesc("Cancelled."); - btn.setDisabled(true); + btn.buttonEl.setAttr("disabled", "true"); }) ); } @@ -1075,14 +1077,18 @@ var GitHubContributionsSettingTab = class extends import_obsidian.PluginSettingT t.onChange((v) => { this.plugin.settings.localRepoRoot = v.trim(); }); - }).addButton( - (btn) => btn.setButtonText("Scan").setTooltip("Save path and scan for repositories").onClick(async () => { - btn.setButtonText("Scanning\u2026").setDisabled(true); + }).addButton((btn) => { + btn.setButtonText("Scan"); + btn.buttonEl.setAttr("title", "Save path and scan for repositories"); + btn.onClick(async () => { + btn.setButtonText("Scanning\u2026"); + btn.buttonEl.setAttr("disabled", "true"); await this.plugin.saveSettings(); - btn.setButtonText("Scan").setDisabled(false); + btn.setButtonText("Scan"); + btn.buttonEl.removeAttribute("disabled"); new import_obsidian.Notice("Repo scan complete - refresh the panel to see results"); - }) - ); + }); + }); new import_obsidian.Setting(containerEl).setName("Scan depth").setDesc("How many folder levels deep to search for git repos").addDropdown( (d) => d.addOption("2", "2 levels").addOption("3", "3 levels").addOption("4", "4 levels").addOption("5", "5 levels").addOption("0", "Unlimited (slow on large drives)").setValue(String(this.plugin.settings.scanDepth)).onChange(async (v) => { this.plugin.settings.scanDepth = parseInt(v); diff --git a/manifest.json b/manifest.json index 36f14f2..66d9b02 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "github-contributions", "name": "GitHub Contributions", - "version": "1.0.3", + "version": "1.0.4", "minAppVersion": "1.0.0", "description": "View GitHub and local Git contributions directly in the sidebar with streak tracking, repository breakdowns, color palettes, and daily note integration.", "author": "gearheaded", diff --git a/package.json b/package.json index a5a7cf3..be06af8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-github-contributions", - "version": "1.0.3", + "version": "1.0.4", "description": "GitHub contribution graph for Obsidian", "main": "main.js", "scripts": { @@ -14,7 +14,6 @@ "@types/node": "^16.11.6", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.29.0", - "builtin-modules": "3.3.0", "esbuild": "0.17.3", "obsidian": "latest", "tslib": "^2.4.0", diff --git a/src/main.ts b/src/main.ts index a55418d..4fc179c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1327,7 +1327,8 @@ class GitHubContributionsSettingTab extends PluginSettingTab { .setButtonText("Connect GitHub") .setCta() .onClick(async () => { - btn.setButtonText("Connecting...").setDisabled(true); + btn.setButtonText("Connecting..."); + btn.buttonEl.setAttr("disabled", "true"); cancelled = false; try { const device = await requestDeviceCode(); @@ -1365,14 +1366,15 @@ class GitHubContributionsSettingTab extends PluginSettingTab { oauthSetting.setDesc("⚠ " + msg); new Notice("GitHub connection failed: " + msg); } - btn.setButtonText("Connect GitHub").setDisabled(false); + btn.setButtonText("Connect GitHub"); + btn.buttonEl.removeAttribute("disabled"); } }) ); oauthSetting.addButton(btn => btn .setButtonText("Cancel") - .onClick(() => { cancelled = true; oauthSetting.setDesc("Cancelled."); btn.setDisabled(true); }) + .onClick(() => { cancelled = true; oauthSetting.setDesc("Cancelled."); btn.buttonEl.setAttr("disabled", "true"); }) ); } } else { @@ -1405,16 +1407,18 @@ class GitHubContributionsSettingTab extends PluginSettingTab { // Store value in memory as user types but don't save/scan yet t.onChange(v => { this.plugin.settings.localRepoRoot = v.trim(); }); }) - .addButton(btn => btn - .setButtonText("Scan") - .setTooltip("Save path and scan for repositories") - .onClick(async () => { - btn.setButtonText("Scanning…").setDisabled(true); + .addButton(btn => { + btn.setButtonText("Scan"); + btn.buttonEl.setAttr("title", "Save path and scan for repositories"); + btn.onClick(async () => { + btn.setButtonText("Scanning…"); + btn.buttonEl.setAttr("disabled", "true"); await this.plugin.saveSettings(); - btn.setButtonText("Scan").setDisabled(false); + btn.setButtonText("Scan"); + btn.buttonEl.removeAttribute("disabled"); new Notice("Repo scan complete - refresh the panel to see results"); - }) - ); + }); + }); new Setting(containerEl) .setName("Scan depth") diff --git a/versions.json b/versions.json index c961191..0305806 100644 --- a/versions.json +++ b/versions.json @@ -2,5 +2,6 @@ "1.0.0": "0.15.0", "1.0.1": "0.15.0", "1.0.2": "0.15.0", - "1.0.3": "1.0.0" + "1.0.3": "1.0.0", + "1.0.4": "1.0.0" } \ No newline at end of file