Style the new checkbox

This commit is contained in:
Kuba Orlik 2023-02-03 14:56:33 +01:00
parent 180872e308
commit 63a2f18394
2 changed files with 74 additions and 54 deletions

View File

@ -99,4 +99,22 @@
#isso-root a:hover {
text-decoration: underline;
}
#isso-root a {
color: var(--whitegrey);
}
.isso-feedlink:hover,
.isso-comment > div.text-wrapper > .isso-comment-footer a:hover,
#isso-root a:hover {
color: #fff;
text-decoration: underline;
}
}
.comment-checkbox__label {
width: 100%;
display: grid;
grid-template-columns: 20px 1fr;
grid-column-gap: 10px;
}

View File

@ -141,6 +141,7 @@ into the {body} of the default.hbs template --}}
original_submit.style.setProperty("display", "none")
const faux_submit = document.createElement("input")
faux_submit.value = "Wyślij"
faux_submit.type = "submit"
const comment_checkbox_id = "comment-checkbox"
const checkbox = document.createElement("input")
checkbox.type = "checkbox"
@ -149,10 +150,11 @@ into the {body} of the default.hbs template --}}
const label = document.createElement("label")
label.for = comment_checkbox_id;
label.appendChild(checkbox)
label.id = comment_checkbox_id + "__label"
const label_text = document.createElement("span")
label_text.innerHTML = `akceptuję postanowienia <a href="#">regulaminu komentarzy</a>`
label.appendChild(label_text)
document.querySelector("#isso-thread .auth-section").appendChild(label)
document.querySelector("#isso-thread .auth-section").insertBefore(label, document.querySelector(".auth-section .post-action"))
faux_submit.addEventListener("click", ()=>{
if(!checkbox.checked){
checkbox.reportValidity()