Skip to content

Commit d0dae67

Browse files
committed
Add VSCode Dev & default options bug fix
1 parent a329f32 commit d0dae67

8 files changed

+51
-18
lines changed

.github/FUNDING.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
44
patreon: # Replace with a single Patreon username
5-
open_collective: GitHub-Web-IDE
6-
ko_fi: # Replace with a single Ko-fi username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: zvizvi
77
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
88
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
99
liberapay: # Replace with a single Liberapay username

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This extension adds to any GitHub repository a new drop down menu which offers l
1111
Services currently supported:
1212

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

2728

2829
### What's changed?
30+
* v2.0.1 Open in VSCodeDev option
2931
* v2.0.0
3032
* Extension customizing options page.
3133
* Open in VSCode Remote Repositories option.

src/html/options.html

+8-3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ <h2 class="Subhead-heading">Enabled IDE list</h2>
6868
GitHub Dev
6969
</label>
7070
</div>
71+
<div class="form-checkbox">
72+
<label>
73+
<input type="checkbox" id="vsCodeDev" />
74+
VSCode Dev
75+
</label>
76+
</div>
7177
<div class="form-checkbox">
7278
<label>
7379
<input type="checkbox" id="codeSandbox" />
@@ -153,9 +159,8 @@ <h2 class="Subhead-heading">Opening options</h2>
153159
</div>
154160
</div>
155161

156-
<div class="text-center mt-6 mb-4">
157-
<button id="reset-button" type="button" class="btn mr-2">Reset</button>
158-
<button id="save-button" type="button" class="btn btn-primary">Save changes</button>
162+
<div class="mt-6 mb-4">
163+
<button id="reset-button" type="button" class="btn mr-2">Reset to default</button>
159164
</div>
160165

161166
</div>

src/js/main.js

+26-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/options.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const defaultOptions = {
44
gitHubDev: true,
5+
vsCodeDev: true,
56
codeSandbox: true,
67
gitHub1s: true,
78
replit: true,
@@ -56,14 +57,9 @@ const show = function () {
5657
}
5758
};
5859

59-
// Reset to defaults
60-
const reset = async function () {
61-
await save(defaultOptions);
62-
};
63-
64-
// On save button clicked
65-
document.addEventListener('click', async (event) => {
66-
if (event.target.id === 'save-button') {
60+
// On checkbox changed
61+
document.addEventListener('input', async (event) => {
62+
if (event.target.type === 'checkbox') {
6763
for (const key in defaultOptions) {
6864
switch (typeof defaultOptions[key]) {
6965
case ('boolean'): {
@@ -81,6 +77,11 @@ document.addEventListener('click', async (event) => {
8177
}
8278
});
8379

80+
// Reset to defaults
81+
const reset = async function () {
82+
await save(defaultOptions);
83+
};
84+
8485
// On reset button clicked
8586
document.addEventListener('click', async (event) => {
8687
if (event.target.id === 'reset-button') {

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"manifest_version": 3,
55
"update_url": "https://clients2.google.com/service/update2/crx",
66
"homepage_url": "https://github.com/zvizvi/GitHub-Web-IDE",
7-
"version": "2.0.0",
7+
"version": "2.0.1",
88
"author": "[email protected]",
99
"action": {
1010
"default_icon": {

src/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-web-ide",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "⚡ Open GitHub repositories in online web IDE",
55
"main": "README.md",
66
"dependencies": {

0 commit comments

Comments
 (0)