Dismiss Notice
Hey there Anonymous! Now you can post on XPOFF without registering!

[abbr] BBCode Tag

Discussion in 'Website Feedback' started by Aelobin, Apr 15, 2017.

Share This Page

  1. Aelobin

    Aelobin DK Twink (80 / 85 / 101)

    Messages:
    1,829
    Likes Received:
    518
    Trophy Points:
    93
    @Conq @Arkte

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

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

    Arkte Banned

    Messages:
    212
    Likes Received:
    317
    Trophy Points:
    128
    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.
     
    • Like Like x 1
  3. OP
    Aelobin

    Aelobin DK Twink (80 / 85 / 101)

    Messages:
    1,829
    Likes Received:
    518
    Trophy Points:
    93
    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.
     
  4. Arkte

    Arkte Banned

    Messages:
    212
    Likes Received:
    317
    Trophy Points:
    128
    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.
     
  5. OP
    Aelobin

    Aelobin DK Twink (80 / 85 / 101)

    Messages:
    1,829
    Likes Received:
    518
    Trophy Points:
    93
    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/
     
  6. Arkte

    Arkte Banned

    Messages:
    212
    Likes Received:
    317
    Trophy Points:
    128
    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.

    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.
     
  7. OP
    Aelobin

    Aelobin DK Twink (80 / 85 / 101)

    Messages:
    1,829
    Likes Received:
    518
    Trophy Points:
    93
    Hmm so just to check, you tried a HTML Replacement similar to this?
    Code:
    <abbr title="{option}">{text}</abbr>
     
  8. Arkte

    Arkte Banned

    Messages:
    212
    Likes Received:
    317
    Trophy Points:
    128
    Yes.
     
  9. Arkte

    Arkte Banned

    Messages:
    212
    Likes Received:
    317
    Trophy Points:
    128
    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.
     
  10. Selaya

    Selaya Ɛ> Head Admin

    Messages:
    832
    Likes Received:
    427
    Trophy Points:
    63
    This has been corrected.
     
    • Like Like x 2
  11. Arkte

    Arkte Banned

    Messages:
    212
    Likes Received:
    317
    Trophy Points:
    128
    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.
     
    • Like Like x 1
  12. Ferib

    Ferib Veteran

    Messages:
    427
    Likes Received:
    111
    Trophy Points:
    43
    Text that will display hover text when hovered over

    /cheers
     
  13. OP
    Aelobin

    Aelobin DK Twink (80 / 85 / 101)

    Messages:
    1,829
    Likes Received:
    518
    Trophy Points:
    93
    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!
     
    • Like Like x 1

Users Who Have Read This Thread (Total: 0)

Share This Page