Skip to content

Commit

Permalink
Add VSCode Dev & default options bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zvizvi committed Apr 4, 2022
1 parent a329f32 commit d0dae67
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: GitHub-Web-IDE
ko_fi: # Replace with a single Ko-fi username
open_collective: # Replace with a single Open Collective username
ko_fi: zvizvi
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This extension adds to any GitHub repository a new drop down menu which offers l
Services currently supported:

* [GitHub Dev](https://github.dev/)
* [VSCode Dev](https://vscode.dev/)
* [CodeSandbox](https://codesandbox.io/)
* [GitHub1s](https://github1s.com/)
* [Repl.it](https://replit.com/)
Expand All @@ -26,6 +27,7 @@ Services currently supported:


### What's changed?
* v2.0.1 Open in VSCodeDev option
* v2.0.0
* Extension customizing options page.
* Open in VSCode Remote Repositories option.
Expand Down
11 changes: 8 additions & 3 deletions src/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ <h2 class="Subhead-heading">Enabled IDE list</h2>
GitHub Dev
</label>
</div>
<div class="form-checkbox">
<label>
<input type="checkbox" id="vsCodeDev" />
VSCode Dev
</label>
</div>
<div class="form-checkbox">
<label>
<input type="checkbox" id="codeSandbox" />
Expand Down Expand Up @@ -153,9 +159,8 @@ <h2 class="Subhead-heading">Opening options</h2>
</div>
</div>

<div class="text-center mt-6 mb-4">
<button id="reset-button" type="button" class="btn mr-2">Reset</button>
<button id="save-button" type="button" class="btn btn-primary">Save changes</button>
<div class="mt-6 mb-4">
<button id="reset-button" type="button" class="btn mr-2">Reset to default</button>
</div>

</div>
Expand Down
27 changes: 26 additions & 1 deletion src/js/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const defaultOptions = {
gitHubDev: true,
vsCodeDev: true,
codeSandbox: true,
gitHub1s: true,
replit: true,
Expand Down Expand Up @@ -56,14 +57,9 @@ const show = function () {
}
};

// Reset to defaults
const reset = async function () {
await save(defaultOptions);
};

// On save button clicked
document.addEventListener('click', async (event) => {
if (event.target.id === 'save-button') {
// On checkbox changed
document.addEventListener('input', async (event) => {
if (event.target.type === 'checkbox') {
for (const key in defaultOptions) {
switch (typeof defaultOptions[key]) {
case ('boolean'): {
Expand All @@ -81,6 +77,11 @@ document.addEventListener('click', async (event) => {
}
});

// Reset to defaults
const reset = async function () {
await save(defaultOptions);
};

// On reset button clicked
document.addEventListener('click', async (event) => {
if (event.target.id === 'reset-button') {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"manifest_version": 3,
"update_url": "https://clients2.google.com/service/update2/crx",
"homepage_url": "https://github.com/zvizvi/GitHub-Web-IDE",
"version": "2.0.0",
"version": "2.0.1",
"author": "zvizvi5@outlook.com",
"action": {
"default_icon": {
Expand Down
4 changes: 2 additions & 2 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-web-ide",
"version": "2.0.0",
"version": "2.0.1",
"description": "⚡ Open GitHub repositories in online web IDE",
"main": "README.md",
"dependencies": {
Expand Down

0 comments on commit d0dae67

Please sign in to comment.