Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement a click-to-view spoiler system #460
this is to make spoilers/content warnings possible, and serves as a language independent solution to #239 and a replacement to rot13
here's a video of it in action https://www.youtube.com/watch?v=jQOapNNn8F0&
this might need some more testing, I haven't tested federation but I made it so it adds a "#spoiler" tag like sensitive content get the "#nsfw" tag, and consumes feeds with the same convention
I still don't know if this is the "right" solution to #239, so it might need some public vote? even if this doesn't get accepted it's still a good development exercise for me, so no skin off my back
This is exactly how I envisaged it! Or mostly, at least. Forgive for the delay in merging. I want to finish up my site settings feature first. As soon as I'm done with that I wanna merge this and polish it up a little. Like, the content warning input could have the same style as the regex filter input in home column settings, that would probably be less visually distracting. Also, I'm gonna see how you handled federation but I think it would be sensible to use an extra tag for the extra content, that way the normal ´´ would contain the content warning (it's the tag that every OStatus implementation supports atm) and the actual content would be in something like
Thanks so much!
IMO It might be good to keep the style of the content warning box similar to the compose box, since it's a required field when visible and also will become part of the status itself
I'll likely push up a "Show posts with content warnings" filter for the timeline tonight, so don't merge before then
on the actual implementation side it works like described in the first description of this PR, the first line of the status is the CW and the rest is covered by a click-to-show. when it renders there's a function wrap_spoilers in formatter that basically adds the spoiler class to every line but the first, and that's how it knows to render it
I added a "spoiler_text" column and used that instead of "text"
it's about functional now, I think it would be worth merging so you can look at how it federates
I'll make the "Show statuses with content warnings" filter a separate PR when I get to it.
I was also wondering what your opinion on putting the content warning box above the compose box would be, as that would make it clear to the user how it's formatted after posting (warning above content)