[abbr] BBCode Tag

@Conq @Arkte

Would it be possible to add the [abbr] tag which creates mouseover text?

Yes, it would be possible.

There's a guide here although I don't think it's the same type of forum so idk how useful it'll be.

No, it is not the same kind of forum. And in either case, we don't really need a guide for it. It would be as simple as implementing a small addon. My only issue with this is that rather than showing full text on click, it would show it constantly. So if someone uses lots of abbreviations, seeing the full text after each one would be quite annoying.

I'll take a look in to it some time tomorrow and see if I can find a way to make it work, and I'll inform you if I come up with something.
 
Yes, it would be possible.

No, it is not the same kind of forum. And in either case, we don't really need a guide for it. It would be as simple as implementing a small addon. My only issue with this is that rather than showing full text on click, it would show it constantly. So if someone uses lots of abbreviations, seeing the full text after each one would be quite annoying.

I'll take a look in to it some time tomorrow and see if I can find a way to make it work, and I'll inform you if I come up with something.
Awesome, thanks :D

The use I had in mind was adding a mouseover to the ilvls of each player in the 101 armory thread, which would show more detailed information like number of sockets/leech etc.
 
Awesome, thanks :D

The use I had in mind was adding a mouseover to the ilvls of each player in the 101 armory thread, which would show more detailed information like number of sockets/leech etc.

I've spent a few hours trying to implement this somehow. After some searching, I was unable to find any addons which would provide this functionality, as they are all outdated or otherwise no longer available. So I decided to try to do it manually with the custom bbcode editor. The results of my testing showed that it does in fact work for all HTML formatting, by simply expanding or reducing the list:

array(
'#\[b\](.*?)\[\/b\]#is',
'#\[i\](.*?)\[\/i\]#is',
'#\[abbr\](.*?)\[\/abbr\]#is'
),

array(
'<span style="font-weight: bold;">$1</span>',
'<span style="font-style: italic;">$1</span>',
'<abbr>$1</abbr>'
),

However, it can be used only with a one-dimensional bbcode and replacement:

Code:
[abbr]{SIMPLETEXT1}[/abbr]

Not with:

Code:
[abbr={SIMPLETEXT1}]{SIMPLETEXT2}[/abbr]

With that being said, implementing it in this way would mean it could not be used for your purpose. I will continue to work on this in my spare time and if I figure out a way to get it to work, I will let you know.
 
I've spent a few hours trying to implement this somehow. After some searching, I was unable to find any addons which would provide this functionality, as they are all outdated or otherwise no longer available. So I decided to try to do it manually with the custom bbcode editor. The results of my testing showed that it does in fact work for all HTML formatting, by simply expanding or reducing the list:

With that being said, implementing it in this way would mean it could not be used for your purpose. I will continue to work on this in my spare time and if I figure out a way to get it to work, I will let you know.

Thanks for trying! Don't spend too much time on it if it's a hassle though, it's not super important :)

Do you have an admin panel for adding BBCodes like this? https://xenforo.com/community/threads/custom-bb-codes.66206/
 
Thanks for trying! Don't spend too much time on it if it's a hassle though, it's not super important :)

No problem, that's what I'm here for. And it is important to me, not just for the users but also as a personal accomplishment.

Do you have an admin panel for adding BBCodes like this? https://xenforo.com/community/threads/custom-bb-codes.66206/

Yes, we use that exact custom bbcode editor on this site. I managed to get the code to work, the problem is that it always defaults to whatever HTML replacement was set, completely ignoring whatever you put within the code itself. I'm sure there is some way to get it to work properly, but what is certain at this point is that it cannot be done with the standard use of the HTML5 abbr element. I'll keep playing around with it until I figure it out.
 
Yes, we use that exact custom bbcode editor on this site. I managed to get the code to work, the problem is that it always defaults to whatever HTML replacement was set, completely ignoring whatever you put within the code itself. Also, it seems to ignore any text appearing after the code itself. I'm sure there is some way to get it to work properly, but what is certain at this point is that it cannot be done with the standard use of the HTML5 abbr tag. I'll keep playing around with it until I figure it out.
Hmm so just to check, you tried a HTML Replacement similar to this?
Code:
<abbr title="{option}">{text}</abbr>
 
It seems as if I've managed to figure out how to make it function, just not properly. The mouse over seems to work, but the text which is displayed is that of the HTML replacement. For example, when this code is written in the forum:

Code:
[abbr=test]When Hovered over, this should say "Test"[/abbr]

It displays as follows:

When Hovered over, this should say "Test"

The exact HTML replacement I used in the custom BB Code editor is:

Code:
<abbr title="{option}">{param}</abbr>

Which would explain where the {param} is coming from, but not why.

I've tried using {text} instead, and it does the exact same thing. I'm not sure exactly what needs to be done to make it work correctly, but I'm still working at it. I'll let you know if I figure it out.
 
Good news! The abbr tag has been fixed and is now functioning properly. The correct formatting for use of this tag is as follows:

Code:
[abbr=Text to be displayed on hover]Text that will display hover text when hovered over[/abbr]

You can all thank Selaya for the fix. It turns out that it was a very simple syntax error that was XF specific. Probably something I would have never figured out, since my dev skills don't cover this platform. xD

Anyways, have fun with the new tag and please inform us if you encounter any issues with it.
 
Text that will display hover text when hovered over

/cheers
 
Good news! The abbr tag has been fixed and is now functioning properly. The correct formatting for use of this tag is as follows:

Code:
[abbr=Text to be displayed on hover]Text that will display hover text when hovered over[/abbr]

You can all thank Selaya for the fix. It turns out that it was a very simple syntax error that was XF specific. Probably something I would have never figured out, since my dev skills don't cover this platform. xD

Anyways, have fun with the new tag and please inform us if you encounter any issues with it.
Thanks @Arkte for your valiant effort and @Selaya for the final fix :)

I'll put it to good use tomorrow when I modify the armory scanner for @Changzu's 101 armory thread!
 

Users who are viewing this thread

Top