Skip to content

Commit

Permalink
Merge pull request #20 from Lavish883/lavishBranch
Browse files Browse the repository at this point in the history
updated critical dependencies
  • Loading branch information
Lavish883 authored Jul 19, 2023
2 parents 383896d + 77f7ee8 commit 228b2cb
Show file tree
Hide file tree
Showing 8 changed files with 1,441 additions and 1,365 deletions.
1 change: 1 addition & 0 deletions mainJS/pathFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ function genreateFormCSS(theme){
--main-questionBackgroundColor: ${theme.questionBackgroundColor};
--main-formBackgroundColor: ${theme.formBackgroundColor};
--main-backgroundColor: ${theme.backgroundColor};
--main-formEndTextColor: ${theme.formEndTextColor};
}
`
return css;
Expand Down
2,768 changes: 1,409 additions & 1,359 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"bcrypt": "^5.1.0",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"mongoose": "^6.8.0",
"mongoose": "^6.11.4",
"nodemailer": "^6.8.0",
"nodemon": "^2.0.20",
"pug": "^3.0.2",
Expand Down
2 changes: 2 additions & 0 deletions views/filterData.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ html
main
div.dividePage
div#applyFilters
// need to add options so the teachers can see all the pdfs at once
// with all the people who are filtered out
div#results
script
include js/filterData.js
Expand Down
5 changes: 4 additions & 1 deletion views/form.pug
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ html
script(src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.13/cropper.min.js" integrity="sha512-6lplKUSl86rUVprDIjiW8DuOniNX8UDoRATqZSds/7t6zCQZfaCe3e5zcGaQwxa8Kpn5RTM9Fvl3X2lLV4grPQ==" crossorigin="anonymous" referrerpolicy="no-referrer")

script
include js/form.js
include js/form.js

script.
var formEndText = !{JSON.stringify(formSettings.formEndText).replace(/<\//g, '<\\/')}
5 changes: 5 additions & 0 deletions views/includes/formSettingsContainer.pug
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ mixin formSettingsContainer(formSettings, formName, formId)
textarea(oninput="autoResize(this)" id="formIntroductionTextArea", placeholder="Form Introduction") #{formSettings.formIntroduction}
div.textNextToImage
input(id="textNextToImageInput", type="text", placeholder="Text next to image upload", value=formSettings.textNextToImage)
div.formEndText
input(id="formEndTextInput", type="text", placeholder="Form End Text", value=formSettings.formEndText)
div.themeDivider
div.themeHeader(onclick="toggleThemeOptions()")
div(style="display: flex; align-items: center;")
Expand All @@ -34,6 +36,9 @@ mixin formSettingsContainer(formSettings, formName, formId)
div.backgroundColor.themeOption
span Background Color:
input(type="color", value=formSettings.theme.backgroundColor)
div.formEndTextColor.themeOption
span Form End Text Color:
input(type="color", value=formSettings.theme.formEndTextColor)
div.pdfImage
div Logo to display on PDF:
input(type="file", id="pdfImageInput" accept="image/*")
Expand Down
1 change: 1 addition & 0 deletions views/js/editForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ function getFormSettingsData(){
"imageUploadWantedInForm": document.getElementById("imageUploadWantedInFormInput").checked,
"formIntroduction": document.getElementById("formIntroductionTextArea").value,
"textNextToImage": document.getElementById("textNextToImageInput").value,
"formEndText": document.getElementById("formEndTextInput").value,
"theme": {}
}
// go all find all the theme options and add them to the settings
Expand Down
22 changes: 18 additions & 4 deletions views/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ async function validateForm(event) {
}
if (finishedGoingOver){
await saveFormToServer(true);
document.body.innerHTML = '<h1 style="text-align: center; margin-top: 30vh;color:white;">Thank you for filling out the form. You can always come back and edit it before deadline.</h1>';
document.body.innerHTML = `<h1 class="formEndTextColor" style="text-align: center; margin-top: 30vh;">${formEndText}</h1>`;
} else {
alert('Please go over the form again and make sure everything is correct');
finishedGoingOver = true;
Expand Down Expand Up @@ -371,8 +371,22 @@ async function autoSave() {
}

// add event listeners
document.getElementById('personImage').addEventListener('change', intializeCropper);
document.getElementById('doneWithImage').addEventListener('click', closeCropper);
document.getElementById('sumbitFormBtn').addEventListener('click', validateForm);
try {
document.getElementById('personImage').addEventListener('change', intializeCropper);
} catch (error){
console.log(error);
}

try {
document.getElementById('doneWithImage').addEventListener('click', closeCropper);
} catch (error){
console.log(error);
}

try {
document.getElementById('sumbitFormBtn').addEventListener('click', validateForm);
} catch (error){
console.log(error);
}

setTimeout(autoSave, 20 * 1000);

0 comments on commit 228b2cb

Please sign in to comment.