Created
November 9, 2017 19:45
-
-
Save skiant/1bbd1e5c39eec8825afe29dc3d875613 to your computer and use it in GitHub Desktop.
Automatic CW in Mastodon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const composeBox = document.querySelector('.compose-form__autosuggest-wrapper textarea'); | |
const cwButton = document.querySelector('[aria-controls="cw-spoiler-input"]') | |
function autoCW(event) { | |
if (!event.relatedTarget) { | |
cwButton.click(); | |
} | |
} | |
composeBox.addEventListener('focus', autoCW); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment