Skip to content

Commit

Permalink
work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ehanahamed committed Oct 25, 2024
1 parent 0ce8730 commit 379c476
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions web/views/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ <h2>¯\_(ツ)_/¯</h2>
};*/
</script>
<eta> if (data.authed) { </eta>
<!-- and data.new is true (creating a new studyset, not updating one) -->
<script>
var doubleReq = false;
document.getElementById("create-button-authed").addEventListener("click", function () {
Expand Down Expand Up @@ -333,9 +334,13 @@ <h2>¯\_(ツ)_/¯</h2>
</script>
<eta> } </eta>
<eta> } else if (data.studysetId) { </eta>
<!-- data.new is false (updating an existing studyset, not creating one) -->
<eta> if (data.authed) { </eta>
<script>
if (client.hasSession()) {
client.req({ method: "GET", path: "/studysets/<eta>= data.studysetId </eta>" }, function (result) {
/*
fetch("/api/v0/studysets/<eta>= data.studysetId </eta>", {
method: "GET"
}, function (result) {
if (result.error) {
alert("error, could not load studyset while trying to edit")
} else {
Expand All @@ -349,7 +354,7 @@ <h2>¯\_(ツ)_/¯</h2>
document.getElementById("edit-private-true").classList.remove("selected");
}
}
})
})*/
document.getElementById("save-button").addEventListener("click", function () {
var private = document.getElementById("edit-private-true").classList.contains("selected");
client.req({
Expand All @@ -376,10 +381,8 @@ <h2>¯\_(ツ)_/¯</h2>
}
})
})
} else {
alert("not signed in :(")
}
</script>
<eta> } </eta>
<eta> } </eta>
</body>
</html>

0 comments on commit 379c476

Please sign in to comment.