From b140c972d5ae487806205238eca25ca726d78fff Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Fri, 21 May 2021 22:28:36 -0700 Subject: [PATCH 1/2] Add .idea/ to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c94b9d4..98a92fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ extension.zip -node_modules +node_modules/ +.idea/ From 9348347b47a392391d73bfafad340fe9067ad833 Mon Sep 17 00:00:00 2001 From: Frieder Bluemle Date: Fri, 21 May 2021 22:28:09 -0700 Subject: [PATCH 2/2] Update token prompts with GitHub scope info --- README.md | 2 +- src/background.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7cfadcf..77a5e3f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ To enable viewing size of private repositories; 1. Install extension from chrome webstore, if you haven't. 2. Go to https://github.com/settings/tokens to generate your personal access token. - Check `repo` scope to enable this extension on private repo. -3. Click on the Github Repo Size extension (this extension)'s icon aside the address bar. +3. Click on the GitHub Repo Size extension (this extension)'s icon aside the address bar. 4. Paste your access token there in the prompt box. ### Temporarily override the token diff --git a/src/background.js b/src/background.js index 2d52e86..fb21156 100644 --- a/src/background.js +++ b/src/background.js @@ -11,7 +11,7 @@ function setGithubToken (key, cb) { obj[GITHUB_TOKEN_KEY] = key storage.set(obj, function () { - alert('Your Github token has been set successfully. Reload the Github page to see changes.') + alert('Your GitHub token has been set successfully. Reload the GitHub page to see changes.') cb() }) @@ -22,9 +22,9 @@ function handleOldGithubToken (cb) { const oldGithubToken = storedData[GITHUB_TOKEN_KEY] if (oldGithubToken) { - if (confirm('You have already set your Github token. Do you want to remove it?')) { + if (confirm('You have already set your GitHub token. Do you want to remove it?')) { storage.remove(GITHUB_TOKEN_KEY, function () { - alert('You have successfully removed Github token. Click extension icon again to set a new token.') + alert('You have successfully removed your GitHub token. Click the extension icon again to set a new token.') cb(null, false) }) @@ -49,7 +49,7 @@ function informUserAboutGithubTokenFeature () { const userKnows = storedData[TOKEN_FEATURE_INFORMATION_KEY] if (!userKnows) { - if (confirm('GitHub Repository Size now supports private repositories through Github personal access tokens. Do you want to add a token?')) { + if (confirm('GitHub Repository Size supports private repositories through a GitHub personal access token (with "repo" scope). Do you want to add it now?')) { askGithubToken(() => { userNowKnowsAboutGithubTokenFeature(() => {}) }) @@ -63,7 +63,7 @@ function informUserAboutGithubTokenFeature () { } const askGithubToken = (cb) => { - const githubToken = prompt('Please enter your Github token') + const githubToken = prompt('Please enter your GitHub token (requires "repo" scope)') if (githubToken === null) return