Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joypan1 committed Feb 14, 2024
2 parents 588c1bc + 0cadb7c commit bd6da54
Show file tree
Hide file tree
Showing 2,591 changed files with 320,288 additions and 303 deletions.
2 changes: 2 additions & 0 deletions .deployment
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[config]
SCM_DO_BUILD_DURING_DEPLOYMENT=true
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"appService.zipIgnorePattern": [
"node_modules{,/**}",
".vscode{,/**}"
],
"appService.defaultWebAppToDeploy": "/subscriptions/75452281-a54f-4c9c-8599-687235b1ed8e/resourceGroups/Soucting2024_group/providers/Microsoft.Web/sites/Soucting2024",
"appService.deploySubpath": "."
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1> Longmetal 7127 </h1>
<h1>Teams</h1>
<form id="new-team-form">
<input type="text" name="new-team-input" id="new-team-input" placeholder="Input TeamName_Number (ex. LongMetal_7127)" />
<input type="submit" id="new-team-submit" value="Add Team" />
<input type="submit" id="new-team-submit" value="Add Team" />
</form>
</header>
<main>
Expand Down
52 changes: 27 additions & 25 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const db = new Dexie("Todo App");
db.version(1).stores({ todos: "++id, todo" });
db.version(1).stores({ todos: "++id, todo, globalid" });

const form = document.querySelector("#new-team-form");
const input = document.querySelector("#new-team-input");
Expand All @@ -9,7 +9,8 @@ const list_el = document.querySelector("#teams");
form.onsubmit = async (event) => {
event.preventDefault();
const todo = input.value;
await db.todos.add({ todo });
const globalid = Date.UTC();
await db.todos.add({ todo , globalid });
await getTodos();
form.reset();
};
Expand All @@ -27,6 +28,7 @@ const getTodos = async () => {
</div>
<div class="actions">
<button class="delete" onclick="deleteTodo(event, ${todo.id})">Delete</button>
<button class="edit" onclick="window.open(/pages/teamdetails.html, "_blank");">Edit</button>
</div>
</div>
`
Expand All @@ -43,27 +45,27 @@ const deleteTodo = async (event, id) => {

// CHATGPT CODE TO CONNECT TO MYSQL SERVER

function saveTeam(teamName) {
db.teams.add({ name: teamName }).then(() => {
syncTeamWithServer(teamName);
});
}
// function saveTeam(teamName) {
// db.teams.add({ name: teamName }).then(() => {
// syncTeamWithServer(teamName);
// });
// }

function syncTeamWithServer(teamName) {
fetch('/sync', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ teamName: teamName })
})
.then(response => {
if (!response.ok) {
throw new Error('Failed to sync data');
}
return response.json();
})
.catch(error => {
console.error(error);
});
}
// function syncTeamWithServer(teamName) {
// fetch('/sync', {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify({ teamName: teamName })
// })
// .then(response => {
// if (!response.ok) {
// throw new Error('Failed to sync data');
// }
// return response.json();
// })
// .catch(error => {
// console.error(error);
// });
// }
12 changes: 12 additions & 0 deletions node_modules/.bin/karma

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

17 changes: 17 additions & 0 deletions node_modules/.bin/karma.cmd

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

28 changes: 28 additions & 0 deletions node_modules/.bin/karma.ps1

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

12 changes: 12 additions & 0 deletions node_modules/.bin/mime

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

17 changes: 17 additions & 0 deletions node_modules/.bin/mime.cmd

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

28 changes: 28 additions & 0 deletions node_modules/.bin/mime.ps1

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

12 changes: 12 additions & 0 deletions node_modules/.bin/mkdirp

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

17 changes: 17 additions & 0 deletions node_modules/.bin/mkdirp.cmd

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

28 changes: 28 additions & 0 deletions node_modules/.bin/mkdirp.ps1

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

12 changes: 12 additions & 0 deletions node_modules/.bin/rimraf

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

17 changes: 17 additions & 0 deletions node_modules/.bin/rimraf.cmd

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

28 changes: 28 additions & 0 deletions node_modules/.bin/rimraf.ps1

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

Loading

0 comments on commit bd6da54

Please sign in to comment.