Increase comment timeout

This commit is contained in:
Kuba Orlik 2023-08-01 16:02:25 +02:00
parent dd08715d87
commit c45e2a54a9

View File

@ -1,3 +1,8 @@
<style>
.post-action {
margin-top: -3rem !important;
}
</style>
<script> <script>
function addCheckbox(container = document) { function addCheckbox(container = document) {
const original_submit = container.querySelector( const original_submit = container.querySelector(
@ -35,6 +40,7 @@
legal.style.setProperty("font-style", "italic"); legal.style.setProperty("font-style", "italic");
legal.style.setProperty("font-size", "1.333rem"); legal.style.setProperty("font-size", "1.333rem");
legal.style.setProperty("line-height", "150%"); legal.style.setProperty("line-height", "150%");
legal.style.setProperty("padding-bottom", "3rem");
container container
.querySelector("#isso-thread .auth-section") .querySelector("#isso-thread .auth-section")
.insertBefore( .insertBefore(
@ -56,14 +62,19 @@
original_submit.parentElement.appendChild(faux_submit); original_submit.parentElement.appendChild(faux_submit);
} }
(async function () { async function waitForSelector(selector) {
for (let i = 0; i <= 20; i++) { for (let i = 0; i <= 100; i++) {
if (document.querySelector(".post-action input[type='submit']")) { if (document.querySelector(selector)) {
continue; break;
} }
await new Promise((resolve) => setTimeout(resolve, 200)); await new Promise((resolve) => setTimeout(resolve, 200));
} }
}
(async function () {
await waitForSelector(".post-action input[type='submit']");
addCheckbox(document.querySelector("#isso-thread")); addCheckbox(document.querySelector("#isso-thread"));
await waitForSelector(".isso-comment-footer a.reply");
document.querySelectorAll(".isso-comment-footer a.reply").forEach((el) => document.querySelectorAll(".isso-comment-footer a.reply").forEach((el) =>
el.addEventListener("click", (e) => el.addEventListener("click", (e) =>
setTimeout(() => { setTimeout(() => {