diff --git a/original-schema.json b/original-schema.json new file mode 100644 index 0000000..c57285f --- /dev/null +++ b/original-schema.json @@ -0,0 +1,43 @@ +[ + { + "family": "doe", + "emails": [ + { + "email": "jane@doe.com" + }, + { + "email": "john@doe.com" + }], + "responded": false, + "members": [ + { + "name": "john doe" + }, + { + "name": "jane doe" + }, + { + "name": "baby doe" + } + ], + "american": false, + "songs": + [ + ] + }, + { + "family": "trump", + "emails": [ + { + "email": "donald@duck.gov" + } + ], + "responded": false, + "members": [ + { + "name": "donald trump" + } + ], + "american": true + } +] \ No newline at end of file diff --git a/proposed-schema.json b/proposed-schema.json index e613ea9..c48fd4e 100644 --- a/proposed-schema.json +++ b/proposed-schema.json @@ -3,12 +3,10 @@ "family": "doe", "emails": [ { - "email": "jane@doe.com", - "code": "C3PO" + "email": "jane@doe.com" }, { - "email": "john@doe.com", - "code": "R2D2" + "email": "john@doe.com" }], "responded": true, "members": [ diff --git a/savethedate.html b/savethedate.html index 04bb320..1af2c5b 100644 --- a/savethedate.html +++ b/savethedate.html @@ -53,6 +53,7 @@ } closeModal("myNav"); + disableAll(); openModal("myList"); } @@ -76,11 +77,49 @@ disableAccomodations(); } - function disableAccomodations() { - document.getElementById("iWantHotel").disabled = true; - document.getElementById("iWantCamping").disabled = true; + function disableAccomodations(){ + changeAccomodations(true); } + function enableAccomodations(){ + changeAccomodations(false); + } + + function changeAccomodations(trueOrFalse) { + document.getElementById("iWantHotel").disabled = trueOrFalse; + document.getElementById("iWantCamping").disabled = trueOrFalse; + } + + function disableSongs(){ + changeSongs(true); + } + + function enableSongs(){ + changeSongs(false); + } + + function changeSongs(trueOrFalse){ + var songInputs = document.getElementsByClassName("song"); + for(var i = 0; i < songInputs.length; i++){ + songInputs[i].disabled = trueOrFalse; + } + } + + function disableAll(){ + disableAccomodations(); + disableSongs(); + } + + function enableAll(){ + enableAccomodations(); + enableSongs(); + } + + function finish(){ + closeModal("myList"); + } + + function checkAttendees() { var listModal = document.getElementById("attendeesList"); var checkBoxes = listModal.getElementsByTagName("input"); @@ -103,6 +142,9 @@ if (!hasYeses) { openModal("sorryMessage"); } + else{ + enableAll(); + } } else { console.log("More to go!"); @@ -208,14 +250,16 @@