Discourse Spoiler Alert provides the ability to hide content marked with a [spoiler] tag in posts.
Install Guide
This plugin is bundled with Discourse core. There is no need to install the plugin separately.
Enabling Spoiler Alert
This plugin is default enabled once installed but can be disabled/enabled from its settings, accessed from your admin/plugins page:
Features
Once enabled it adds a ‘Blur Spoiler’ option to the menu in the composer’s formatting bar. Simply highlight the text you’d like to blur and select ‘blur spoiler’ and it will wrap the selected text in the necessary [spoiler] tags:
[spoiler]
I wanna be your vacuum cleaner
Breathing in your dust
I wanna be your Ford Cortina
I will never rust
If you like your coffee hot
Let me be your coffee pot
You call the shots
I wanna be yours
https://johncooperclarke.com/poems/i-wanna-be-yours
[/spoiler]
I wanna be your vacuum cleaner
Breathing in your dust
I wanna be your Ford Cortina
I will never rust
If you like your coffee hot
Let me be your coffee pot
You call the shots
I wanna be yours
Clicking on the blur will reveal the hidden text, and clicking again will re-blur it.
It also works for images:
(to re-blur an image that is large enough to generate a lightbox, you can click on the adjacent white space or refresh the page)
¿Hay alguna forma de editar el aspecto de la vista previa del spoiler? La implementación actual se ve bien, pero no abstrae lo suficiente en cuanto a lo que está revelando.
Aquí tienes un ejemplo de un hilo que creé, donde los usuarios pueden subir sus capturas de pantalla. Si la captura de pantalla es un spoiler, debe etiquetarse como tal. Como puedes ver, la implementación actual no funciona realmente en el contexto de etiquetar como spoiler capturas de pantalla de momentos críticos en juegos, películas, etc.
Cualquiera que esté familiarizado con el juego que compartí sabría inmediatamente de qué se trata.
Editar: También me he dado cuenta de que si algún usuario hace clic en el historial de edición de una publicación que contiene spoilers, el historial de edición no etiquetará el contenido como spoiler.
Aquí está el CSS predeterminado para la parte de desenfoque
.spoiler-blurred img {
filter: blur(1em);
}
Cambia el 1em por algo más importante
.spoiler-blurred img {
filter: blur(5em);
}
Y si quieres desenfocar más cuando el cursor está sobre la imagen, añade estas líneas y cambia el 0.5em (con un valor menos importante que el anterior)