first commit

This commit is contained in:
schmieders
2022-12-10 12:25:13 +01:00
commit 06cedbd790
36 changed files with 3550 additions and 0 deletions
@@ -0,0 +1,35 @@
let logicHandler = new LogicHandler()
let modalHandler = new StudyProgramModalHandler()
function renderStudyProgramModal(id) {
id = typeof id == "undefined" ? "Create" : id
let studyProgram = id == "Create" ? getEmptyStudyProgram() : logicHandler.getItem("studyPrograms", id)
document.body.append(modalHandler.getStudyProgramModal(studyProgram))
document.body.append(modalHandler.getStudyProgramModalButton(id))
let htmlButton = document.getElementById("modalButton" + id)
htmlButton.click()
htmlButton.remove()
}
function cancelStudyProgramModal(id) {
document.getElementById("studyProgramModal" + id).remove()
}
function saveStudyProgram(id) {
logicHandler.saveItem("studyProgram", id)
}
function removeStudyProgram(id) {
logicHandler.removeItem("studyPrograms", id)
document.getElementById("row" + id).remove()
}
function getEmptyStudyProgram() {
return {
id: "Create",
name: "",
short: ""
}
}