form: add notice about userpage on success modal, userpage title

uses new strings in the form lang section.
This commit is contained in:
Harvey Tindall
2023-06-22 10:11:56 +01:00
parent 4f298bbc8c
commit db97c3b2d4
6 changed files with 12 additions and 2 deletions
+5
View File
@@ -35,6 +35,7 @@ interface formWindow extends Window {
captcha: boolean;
reCAPTCHA: boolean;
reCAPTCHASiteKey: string;
userPageEnabled: boolean;
}
loadLangSelector("form");
@@ -343,6 +344,10 @@ const create = (event: SubmitEvent) => {
const url = ((document.getElementById("modal-success") as HTMLDivElement).querySelector("a.submit") as HTMLAnchorElement).href;
window.location.href = url;
} else {
if (window.userPageEnabled) {
const userPageNoticeArea = document.getElementById("modal-success-user-page-area");
userPageNoticeArea.textContent = userPageNoticeArea.textContent.replace("{myAccount}", userPageNoticeArea.getAttribute("my-account-term"));
}
window.successModal.show();
}
} else {