BBcode [TT] broken? [FIXED]

Ideas and discussion


Post Reply
User avatar
MochiMoppel
Posts: 1123
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 361 times

BBcode [TT] broken? [FIXED]

Post by MochiMoppel »

It appears that the [TT=tooltip]TT[/TT] code doesn't work anymore. Is it just me or is the code broken?

Last edited by MochiMoppel on Tue Oct 04, 2022 2:28 am, edited 1 time in total.
User avatar
Flash
Moderator
Posts: 901
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 46 times
Been thanked: 105 times

Re: BBcode [TT] broken?

Post by Flash »

What's it supposed to do? I've never used it. Can you give a link to a post where you used it and it worked?

Chaos coordinator :?
User avatar
puppy_apprentice
Posts: 661
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 107 times

Re: BBcode [TT] broken?

Post by puppy_apprentice »

Flash wrote: Thu Sep 29, 2022 4:16 pm

What's it supposed to do? I've never used it. Can you give a link to a post where you used it and it worked?

https://www.w3schools.com/howto/tryit.a ... ss_tooltip

User avatar
rockedge
Site Admin
Posts: 5746
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2023 times
Been thanked: 2110 times
Contact:

Re: BBcode [TT] broken?

Post by rockedge »

I will take a look at it and test to see if it works at all

User avatar
rockedge
Site Admin
Posts: 5746
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2023 times
Been thanked: 2110 times
Contact:

Re: BBcode [TT] broken?

Post by rockedge »

Tool tip does work looking at the example

viewtopic.php?t=945&sid=410dc3609ecad53 ... 1ceb2ccd2b

Must look further when I am able to get off the phone

User avatar
MochiMoppel
Posts: 1123
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 361 times

Re: BBcode [TT] broken?

Post by MochiMoppel »

Flash wrote: Thu Sep 29, 2022 4:16 pm

Can you give a link to a post where you used it and it worked?

See the link posted by rockedge. These tooltips still work*) because at the time the examples were posted the server converted the BBcode to proper CSS code. However the conversion doesn't work anymore when you try to use the same BBcode in new posts.

*) Move mouse cursor over the text marked with dotted underlines or on a smartphone shortly tap on it.

User avatar
rockedge
Site Admin
Posts: 5746
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2023 times
Been thanked: 2110 times
Contact:

Re: BBcode [TT] broken?

Post by rockedge »

Here is an example of the new BBCode [tooltip].

Code: Select all

[tooltip=Here is the tooltip working again!!][u]Here[/u][/tooltip] is an example of the new BBCode  [c][tooltip][/c].
User avatar
rockedge
Site Admin
Posts: 5746
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2023 times
Been thanked: 2110 times
Contact:

Re: BBcode [TT] broken?

Post by rockedge »

I have adjusted the tooltip BBCode to work again and the syntax looks like this ->

Code: Select all

 [tooltip=Syntax refers to the rules that define the structure of a language.][u]syntax[/u][/tooltip] looks like this

Code: Select all

[tooltip=Adds to the visual effectivness][style=background-image: linear-gradient(red, yellow);font-weight: bold]Hover Here :thumbup2: [/style][/tooltip]

It might work with Hover Here :thumbup2:

User avatar
MochiMoppel
Posts: 1123
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 361 times

Re: BBcode [TT] broken?

Post by MochiMoppel »

rockedge wrote: Sun Oct 02, 2022 12:54 am

I have adjusted the tooltip BBCode to work again

Thanks. Using internally the title attribute is a good idea. This makes it consistent with all other tooltips of this site and removes some shortcomings of the old [TT] tag. Linefeeds within tooltips are now possible, however in this case the text must be enclosed in quotes.

More examples:
Without a visual hint the tooltip in htis text is difficult to spot.
Using a fake [​url] gives nice visual feedback.
A different cursor can help to distinguish a tooltip from a link

I wasn't able to get rid of the permanent underline :( . Seems to be part the normal style for links in posts, though links outside of posts on this site show this underline only in a hover state, i.e. when placing the mouse over the link.

User avatar
puppy_apprentice
Posts: 661
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 107 times

Re: BBcode [TT] broken? [FIXED]

Post by puppy_apprentice »

styled tooltip
styled tooltip
styled tooltip
styled tooltip
styled tooltip
styled tooltip

User avatar
Grey
Posts: 2003
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 364 times

Re: BBcode [TT] broken? [FIXED]

Post by Grey »

Well, there are two possible options :) Or we are waiting for beautifully and tastefully decorated topics... or it will be colored, crossed-out topics in the style of elementary school, even if there is no need. But most likely laziness will do its job and nothing will change much :)

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
puppy_apprentice
Posts: 661
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 107 times

Re: BBcode [TT] broken? [FIXED]

Post by puppy_apprentice »

For lazy people ;)
Copy this code:

Code: Select all

javascript:(function(){document.activeElement.value=document.activeElement.value+"[tooltip=xyz][style=text-decoration-line:underline;text-decoration-style:wavy;text-decoration-color:red]xyz[/style][/tooltip]";})()

and make new bookmark in eg. Bookmarks Toolbar:

Bookmarklet.jpg
Bookmarklet.jpg (21.12 KiB) Viewed 451 times

Choose: Bookmarks>Bookmarks Toolbar>Insert Tooltip to insert styled tooltip code.
xyz

Code: Select all

javascript:(function(){document.activeElement.value=document.activeElement.value+"[style=background-image:linear-gradient(red, yellow);font-weight:bold]xyz[/style]";})()
Gradient.jpg
Gradient.jpg (21.16 KiB) Viewed 438 times

Choose: Bookmarks>Bookmarks Toolbar>Insert Gradient to insert gradient code.
xyz

User avatar
puppy_apprentice
Posts: 661
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 107 times

Re: BBcode [TT] broken? [FIXED]

Post by puppy_apprentice »

1. One argument function:

Code: Select all

javascript: (function () {
  var txtarea = document.activeElement;
  var selstart = txtarea.selectionStart;
  var selend = txtarea.selectionEnd;
  var sel = txtarea.value.substring(selstart, selend);
  txtarea.setRangeText('[tag start]' + sel + '[/tag end]', selstart, selend, 'select');
})()

Bookmarklets:
Insert Gradient

Code: Select all

javascript:(function(){var txtarea=document.implementacja;var selstart=txtarea.selectionStart;var selend=txtarea.selectionEnd;var sel=txtarea.value.substring(selstart,selend);txtarea.setRangeText('[style=background-image:linear-gradient(red,yellow);font-weight:bold]'+sel+'[/style]',selstart,selend,'select');})()

Usage: Select something and use bookmark.
Select something and use bookmark.

2. Two argument function:

Code: Select all

javascript: (function () {
    var txtarea = document.activeElement;
    var selstart = txtarea.selectionStart;
    var selend = txtarea.selectionEnd;
    var sel = txtarea.value.substring(selstart, selend);
    array = sel.split('=');
  txtarea.setRangeText('[tag start=' + array[1] + ']' + array[0] + '[/tag end]', selstart, selend, 'select');
})()

Bookmarklets:
Insert URL

Code: Select all

javascript:(function(){var txtarea=document.activeElement;var selstart=txtarea.selectionStart;var selend=txtarea.selectionEnd;var sel=txtarea.value.substring(selstart,selend);array=sel.split('=');txtarea.setRangeText('[url='+array[1]+']'+array[0]+'[/url]',selstart,selend,'select');})()

Usage: Write eg. puppy forum=http://forum.puppylinux.com, select and use Insert URL bookmark.
puppy forum

Insert Tooltip

Code: Select all

javascript:(function(){var txtarea=document.activeElement;var selstart=txtarea.selectionStart;var selend=txtarea.selectionEnd;var sel=txtarea.value.substring(selstart,selend);array=sel.split('=');txtarea.setRangeText('[tooltip='+array[1]+'][style=text-decoration-line:underline;text-decoration-style:wavy;text-decoration-color:red]'+array[0]+'[/style][/tooltip]',selstart,selend,'select');})()

Usage: Write eg. banana=monkeys favorite fruit, select and use Insert Tooltip bookmark.
banana

TIP: You can unpack bookmarklets using this tool. You can pack js code into bookmarklets using this tool.

Post Reply

Return to “Forum Organization & Structure Council”