Skip to content

Commit

Permalink
B&I warning wasn't shown at all times anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
DeKleineKobini committed Dec 9, 2024
1 parent 608dbc8 commit 563955c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion extension/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"fixes": [
{ "message": "Fix personal stat average injection on Firefox.", "contributor": "tiksan" },
{ "message": "Fix jail score filter not working properly anymore.", "contributor": "DeKleineKobini" },
{ "message": "Fix drug details not showing on the item page.", "contributor": "DeKleineKobini" }
{ "message": "Fix drug details not showing on the item page.", "contributor": "DeKleineKobini" },
{ "message": "Bugs & Issues forum warning wasn't showing up in all places anymore.", "contributor": "DeKleineKobini" }
],
"changes": [
{
Expand Down
17 changes: 10 additions & 7 deletions extension/scripts/features/forum-warning/ttForumWarning.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@
parent = document.find("#editor-wrapper");
position = "beforebegin";

parent.find("[class*='actionButtonsWrapper__'] button").addEventListener("click", handleDisabledPost, { capture: true, once: true });

const input = parent.find(".editor-content.mce-content-body");
const text = "I'm currently posting this with TornTools enabled.";
if (!input.innerText.includes(text)) {
input.innerHTML = text + "<br>" + input.innerHTML;
}
requireElement("[class*='actionButtonsWrapper__'] button", { parent }).then((button) =>
button.addEventListener("click", handleDisabledPost, { capture: true, once: true })
);

requireElement(".editor-content.mce-content-body", { parent }).then((input) => {
const text = "I'm currently posting this with TornTools enabled.";
if (!input.innerText.includes(text)) {
input.innerHTML = text + "<br>" + input.innerHTML;
}
});
}

parent.insertAdjacentElement(
Expand Down

0 comments on commit 563955c

Please sign in to comment.