Big Beautiful BBcodes
- Edited
v0.2.0.1 Released!
https://github.com/zerosonesfun/bbbbcode/releases/tag/v0.2.0.1-beta.8
- Almost fixed the popup CSS issue happening on small screens where the popup isn’t resizing properly. Everything worked in this mobile emulator I used. But, now that I’m testing it on my iPhone, the popup still isn’t resizing properly. It is usable though. It just doesn’t look as good as it should on iPhone. I will research and fix this at some point.
010101 brainly.com register, and after registration you will see the form data
- Edited
v0.2.0.2 Released!
https://github.com/zerosonesfun/bbbbcode/releases/tag/v0.2.0.2-beta.8
- Fixed CSS issue on mobile involving the new popup BBcode.
- Now that this is fixed, and all BBcodes are working well, most likely this will be the last release at least for a little bit. Unless I think of a really crucial BBcode that is needed.
As always - see first post for extension details and examples.
LOVE IT.
We definitely need a BBCode Manager down the line at this rate
- Edited
New version released which adds an audio bbcode.
Audio:
[audio mp3="song.mp3" ogg="song.ogg"]
or
[audio mp3="song.mp3"]
Result would be the browser's default audio player. I'm not including a screenshot since each browser is different. Also, I'm the author of the Soundmanager 2 audio extension. That extension is not compatible with the audio bbcode in this extension. So, you have a decision to make. Use this extension and have default browser audio players which sometimes look cool and have nice features like volume control and a download menu. Or, use my Soundmanager 2 extension which is compatible with more audio types, and will look the same in different browsers. But the player is simply a button basically. No controls.
- Edited
v0.3.1 Released!
https://github.com/zerosonesfun/bbbbcode/releases/tag/0.3.1
- Added a chat transcript bbcode (see first post for example and instructions)
- Added a vertical space bbcode (due to the way certain bbcodes are styled, sometimes you might want a little bit of extra space between something like your accordion, or your chat, and the next line of text. It just ensures things are spaced nicely. All you have to do is put the following on a new line:
[space][/space]
v0.3.4 Released!
https://github.com/zerosonesfun/bbbbcode/releases/tag/0.3.4
- Added a [spoiler] bbcode. (Although this extension already has an accordion, it could be a little too fancy for some. Or, just not quite what someone is looking for. This spoiler is very basic. And, as with all of the bbbbcode, it is pure HTML & CSS. No JavaScript needed.)
- The [spoiler] bbcode is set up so that you may turn any word or even a sentence into the part you click on. The hidden text is within the opening spoiler tag. For example:
*[spoiler="THIS IS THE HIDDEN TEXT"]Click at your own risk[/spoiler]
* A font awesome arrow is added to the right of your spoiler as well. - I believe there is already a spoiler bbcode or two out there for Flarum. This one may or may not be compatible. It depends on how the other ones are coded (if they happen to use the same CSS classes for example, I'm sure there would be trouble).
- The [spoiler] bbcode is set up so that you may turn any word or even a sentence into the part you click on. The hidden text is within the opening spoiler tag. For example:
See the first post for a GIF example.
katos Anything's possible. But, that's out of my realm. The only thing I could do for you at this time is tell you how to disable the popup one completely. Or, one could make the bbcode very specific/unique, almost like a password, so that a regular member wouldn't know how to do it. For example, one could make the popup bbcode something like, [pop019284746]. Making it really hard for a normal user to guess what the bbcode is to make a popup.
- Edited
katos I don't know if that's possible, as the Formatter configuration (which includes plugins added through extensions such as fof/formatting and custom bbcodes) is cached, so is only called when enabling/disabling some extensions and clearing the cache.
Perhaps one can simply make it so it doesn't render it (still processed though).
010101 one could make the bbcode very specific/unique, almost like a password, so that a regular member wouldn't know how to do it
If the bbcode is rendered in the editor preview, then its name can be found in the javascript source code.
Disabling the bbcode for certain groups could be done in the backend of frontend. In the backend you'd have to hook to the Rendering event and alter the html output by either completely removing it, or removing/adding a class that would disable it.
Or it could be done completely client side, by looking at the post author's groups or a policy on the post payload and using that information to allow opening the modal or not.
- Edited
Version 1.0 Released!
- One reason is there's no reason for this to have a beta looking version number, so BBBBcode is now stable!
- Also, my new little hashtag extension was conflicting with the popup BBcode. Things work out for the best though because now the popup code is WAY shorter and minimal. Still just CSS working the popup magic, no JavaScript needed.
- This also forced me though to remove the 5 step popup "tour" style BBcode. But, I don't think it was very useful anyway.
- See first post for more info.
First off, these are great features to have, thanks for making this extension!
There are several problems I've noticed, though:
[spoiler]
completely breaks if there's more than one of them in a thread. Attempting to "show" a second or third spoiler in a thread just jumps up the page and opens up the first one (but can't close it again). This means there's no way to see content hidden under a second or third spoiler.[pop]
breaks in this same way-- attempting to "show" a second or third popup in a thread just opens up the first one.[spoiler]
doesn't work if there's any BBcode formatting in the spoiled text (I assume it interferes with the brackets of the [spoiler] tag itself).[spoiler]
also doesn't work if there are any line breaks in the text (i.e. multiple paragraphs). Markdown in the spoiled text doesn't break the[spoiler]
, but it simply doesn't format (it just displays as asterisks etc.). This severely limits the applicability of the tag.- Design suggestion: On all BBcode-using platforms I've come across on the net, the standard way to code a spoiler is
[spoiler=description text]hidden text[/spoiler]
. BBBBcode's spoiler is[spoiler=hidden text]description text[/spoiler]
. This switch has the potential to confuse users used to other forum platforms, as well as violating the principle that the shorter text should be mapped to the attribute field and the longer text mapped to the actual content field. - There is no way to close an
[accordion]
box after opening it, except by opening another accordion (even though the box shows a "close" arrow when it's open, this button does nothing). This means that once the first accordion has been clicked, there will always be a single accordion open; you cannot have either no accordions open or multiple accordions open. It would be great to be able to close everything back up or open multiple boxes at once. [accordion]
titles, like[spoiler]
hidden texts, break with any BBcode and don't allow the use of Markdown.- Design suggestion: It would be nice if the accordions were styled based on the custom CSS/default styling of the forum they're being used on instead of a static set of CSS. The blue, rectangular, Arial-set accordions look very out-of-place in a Flarum where everything else is --for example -- orange, slightly rounded, and set in Segoe UI.
- It would be great to add an extension settings page (like that of FoF's Formatting extension) so that forum owners can choose which tags they want to actually use.
I understand that it's fun to try and make all these without using JS, but I wonder if it's more trouble than it's worth (your call though).
010101 putting BBcode inside of BBcode isn’t compatible no matter what
Actually, it is very possible. You'll need to use XSL for it. You can see an example @ https://github.com/FriendsOfFlarum/bbcode-tabs/blob/master/extend.php#L25.
PS: I learned how to do this today
- Edited
datitisev I don’t understand how I could go the XSL route to allow all standard BBcode inside of a tag like this: [bbcode=“this is [b]bold[/b]”]
It seems like, if that was allowed, it would just work. I get using XSL for additional custom tags/parameters, but I’m not immediately seeing how it would need to be set up to allow all of the standard BBcode inside of the opening tag. But, I’m also not sure I want to allow that anyway.
- Edited
Somyrion - Thanks again for the suggestions. I'll be releasing a new version shortly. Below is a summary of your suggestions and what I've been able to address:
- [spoiler] completely breaks if there's more than one of them in a thread. Same with popup.
- This is fixed as long as users create unique titles. What I mean is, for the spoiler, the text that you click on, that needs to be unique within the thread. In other words, you can't use "click here" for every spoiler. Same goes for the popup, the title of each popup needs to be different. Not across the entire forum of course, just within that thread, users need to give their popups/spoilers unique titles. Which most of the time I would think this will happen and things will work fine. Everyone should have different reasons for using the BBcode and different content; therefore without even thinking about it, most of the time the titles should be different.
- [spoiler] doesn't work if there's any BBcode formatting in the spoiled text.
- I'll keep asking around, but I think the core BBcode formatting code we use with Flarum may not allow this. If this is true, there's nothing I can do about this.
- This is what I think is not allowed: [bbcode]Your text here with
[b]
bold[/b]
bbcode instead of custom bbcode tags[/bbcode] EDIT: Never mind. That is allowed. What’s not allowed is [bbcode=“some[b]bold[/b]
text”]
- Design suggestion: On all BBcode-using platforms I've come across on the net, the standard way to code a spoiler is [spoiler=description text]hidden text[/spoiler].
- Thanks; I flipped it.
- There is no way to close an [accordion] box after opening it, except by opening another accordion (even though the box shows a "close" arrow when it's open, this button does nothing).
- Yes, that's how this particular accordion works. Maybe I'll re-do the accordion in a future version, but not for this immediate release I'm doing.
- Design suggestion: It would be nice if the accordions were styled based on the custom CSS/default styling of the forum they're being used on instead of a static set of CSS.
- Good suggestion and this should work better now.
- It would be great to add an extension settings page (like that of FoF's Formatting extension) so that forum owners can choose which tags they want to actually use.
- This would require another dev to contribute the code. I haven't been able to figure out that side of Flarum yet.
But, we don't even have this for the core standard BBcode.
- This would require another dev to contribute the code. I haven't been able to figure out that side of Flarum yet.
Version 1.1 Released!
- Fixed not being able to have multiple popups or spoilers in one discussion.
- Fixed certain BBcodes not using the forum's colors. Now the accordion, popup button, and even the chat transcript BBcode, will use your forum's primary colors.
- BREAKING change: Flipped the spoiler (what goes where). Which means if you have already used the spoiler in this extension, you will have to edit those posts, and flip flop your verbiage. Now, the text you click on is inside of the opening tag. Then the hidden text is between the opening and closing tags.
How to update:
1) Run composer update zerosonesfun/bbbbcode
2) Empty CDN cache like Cloudflare if you use it.
3) Go to your dashboard, click on tools, and empty that cache.
4) Clear your browser cache and cookies.