Spoiler Alert BBCode for Flarum.
Run following command via SSH while you're in Flarum root folder:
composer require sijad/flarum-ext-spoiler-alert
[SPOILER]Content To Hide[/SPOILER]
sijad mobile web not work
Note in case you already installed old extension, you need disable and remove that using following command before installing this one.
composer remove sijad/flarum-spoiler
Bek yw! recaptcha is a good idea I'll take a look
Hi it's very nice to get the blur effect.
Ok, that's pretty cool ?
Kulga I guess it has conflict with a few of mediaembed services though
Kulga Ok, that's pretty cool
i like that
sijad Yep, can't "unblur" a mediaembed imgur image.
Should note that urls are blurred until you click on them, but this also loads the link. Probably not a good thing ?
Thanks for updating this sijad , one request - wouldit be possible to have an admin option to have the spoiled text/image either blurred or, as with your previous version, removed?
Also is it possible to have a title for the spoiled code?
Kulga yea, I'll try to fix that
These are the type of spoilers that I love <3 Blurr to make a blind person having a hard time, have an even harder time.
wignu do you consider details?
@sijad For future reference, if you add a title for the spoiler I recommend naming the bbcode parameter explicitely in the definition, e.g. [SPOILER title={TEXT2}]{TEXT}[/SPOILER]. If you don't name it, it'll be called spoiler.
[SPOILER title={TEXT2}]{TEXT}[/SPOILER]
spoiler
The value will be available in the template either as @title wherever XPath is expected or as {TEXT2} anywhere else.
@title
{TEXT2}
@sijad, thanks for that, would you be able to do that but with spoiler BBCode?
wignu you mean title?
sijad wignu you mean title?
Yes with the title, the ability to hide whatever's spoilt completely and just have a default spoiled label if no title is set ?. Be great if it was possible thanks.
wignu I'll put title in todo but I'm not sure about hiding as long as details do the same
@sijad The spoiler markup currently uses a span element. It prevents it from hosting a block element like a quote or code block, or an embedded video with a responsive div wrapper. Have you thought about using a div element, perhaps with display: inline-block?
span
div
display: inline-block
This is related to that post.
JoshyPHP thanks for informing me. do you think it's ok? sijad/flarum-ext-spoiler-alert@d238f43
d238f43
I'm not sure about display: inline-block, because other elements (like <p> tags) are display: block;, and it prevents displaying spoiler inline with other elements any way, what do you think?
<p>
display: block;
You're right about p and div. If you change it to a div I think it'll break the current paragraph. The best solution might be to have different BBCodes for inline spoilers and block spoilers.
p
JoshyPHP Maybe add in the original click-to-show implementation for block-style spoilers? Makes sense you'd want to hide large items like quotes and codes, but keep inline content "hidden" just behind a blur.
JoshyPHP The best solution might be to have different BBCodes for inline spoilers and block spoilers.
don't you think there might be a better solution? this may confuse users