code snippet to add a CW toggle keybind
window.onload = function() {
console.log("CW Toggle script loaded");
let area = document.querySelector(".compose-form textarea");
let cwArea = document.querySelector("#cw-spoiler-input");
let cwButton = document.querySelector(".compose-form .compose-form__buttons button[aria-controls='cw-spoiler-input']");
function toggleCW(e) {
if (e.altKey && e.key == "c") {
cwButton.click();
}
}
area.addEventListener("keydown", toggleCW);
cwArea.addEventListener("keydown", toggleCW);
};
can easily be run with something like the {Grease, Tamper}monkey addons
this works so nicely damn, why doesn't mastodon just have this