3.1.x Extensions Database 3.1 / 3.2[RC] Tables bbCode

<span class="qte-attr qte_31_32-qte">3.1.x &amp; 3.2.x</span>
User avatar

proavia
Users
Users
Posts: 65
Joined: 30 Aug 2015, 22:50
    Android Chrome

Re: [RC] Tables bbCodes

Post by proavia »

Is there a way to remove the <br>' s that occur only after a closing bracket ( /] ) of bbcodes that are between only the table bbcodes? I guess that would mean after all [/td] , [/tr], [/tbody], [/th] and [/thead] codes. Probably beyond the scope of this extension - and it's not that hard to do manually.

Right now on a larger table, I enter the line feed so it's easier for me to keep track of data in each row. Then I remove the line feeds after previewing/editing the contents of cells within the table body. Finally, one last preview to be sure the table header is good and then submit.

On my board, usually only admits and mods use tables anyway - and not that frequently.

[ Post made via Android ] Image

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1159
Joined: 14 Oct 2014, 19:01
    Windows 10 Firefox

Re: [RC] Tables bbCodes

Post by Sniper_E »

Would you like that answer in one word or two words? It's No or Hell No! :lol:

I played around with it trying to get that to happen and there is no way I could get it to strip the <br>s
Maybe someone with a larger brain than mine could make that happen but I'm clueless on how.
We have to follow the BBCode functions. If you put a <br> in it will show a <br>

This would have to be re-written in codes that only a master programmer could do.
I was told that anything is possible but I don't think it's possible for just anyone to do.
At least not me. I'm no programmer.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™

User avatar

proavia
Users
Users
Posts: 65
Joined: 30 Aug 2015, 22:50
    Android Chrome

Re: [RC] Tables bbCodes

Post by proavia »

Sniper_E wrote: 23 Oct 2016, 22:24 Would you like that answer in one word or two words? It's No or Hell No! :lol:
That was my first and second guesses! But I had to ask.... :rolling: :rolling:

Thanks for looking anyways! :thankyou:

[ Post made via Android ] Image

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1159
Joined: 14 Oct 2014, 19:01
    Windows 10 Firefox

Re: [RC] Tables bbCodes

Post by Sniper_E »

I did try a bunch of css and tried to manipulate it to work but nothing.

Image

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1159
Joined: 14 Oct 2014, 19:01
    Windows 10 Firefox

Re: [RC] Tables bbCodes

Post by Sniper_E »

@ proavia, try editing the HTML Replacement for the table= BBCode.

Code: Select all

<script>$('.tables br').remove();</script><span class="tables"><div class="forabg forumbg-table tbg {SIMPLETEXT}" style="width: {NUMBER}%"><div class="inner"><table class="table1">{TEXT}</table></div></div></span>
Then in posting put this in the texarea...

Code: Select all

[size=130]Table Title[/size]
[table=45 null][thead][tr=null][th=33]Title1[/th][th=33]Title2[/th][th=34]Title3[/th][/tr][/thead]
[tbody][tr=bg2][td]Text11[/td][td]Text21[/td][td]Text31[/td][/tr]
[tr=bg1][td]Text12[/td][td]Text22[/td][td]Text32[/td][/tr]
[tr=bg2][td]Text13[/td][td]Text23[/td][td]Text33[/td][/tr]
[tr=bg1][td]Text14[/td][td]Text24[/td][td]Text34[/td][/tr]
[tr=bg2][td]Text15[/td][td]Text25[/td][td]Text35[/td][/tr]
[tr=bg1][td]Text16[/td][td]Text26[/td][td]Text36[/td][/tr]
[tr=bg2][td]Text17[/td][td]Text27[/td][td]Text37[/td][/tr][/tbody][/table]
...and click Preview or Submit.

Almost... it was working until I came back to it and looked.

Got it, also create a new file... ./ext/sniper/tables/styles/template/event/overall_footer_body_after.html

Code: Select all

<script>$('.tables br').remove();</script>
and upload. Clear server cache.

The script in the table BBCode works while creating the table and the script in the footer holds it there. Need Testing.

User avatar

Puchahawa
Users
Users
Posts: 193
Joined: 20 Jun 2015, 17:58
    Windows 7 Chrome

Re: [RC] Tables bbCodes

Post by Puchahawa »

Tested using your example and it worked fine. Did you try adding a table by using the dropdown after you made the change? When I try to add another table. the dropdown list is all on one line instead of several lines. Not sure if that's something on my end or not so I'm doing more testing.

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1159
Joined: 14 Oct 2014, 19:01
    Windows 10 Firefox

Re: [RC] Tables bbCodes

Post by Sniper_E »

Yes it effected the drop down also. That will need another delivery setup in version 2.0.7 along with this strip br script.

Hey, setting the css margin up higher, or would that be lower, will do the trick for now.

Code: Select all

.tables:hover .table-selections { display: inline-block;position: absolute;padding: 4px 6px;margin-left: -350px;margin-top: 20px;

User avatar

proavia
Users
Users
Posts: 65
Joined: 30 Aug 2015, 22:50
    Windows 7 Internet Explorer

Re: [RC] Tables bbCodes

Post by proavia »

OK - I'm a little late to this most recent party.... But I just did the edits you posted and it works great.

Of course, I do get a single line of table sizes when I hover over the "Table" icon. If what I'm seeing is correct, your last edit moved the "table sizes on hover" box to the left so all possible sizes display on one line.

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1159
Joined: 14 Oct 2014, 19:01
    Windows 10 Firefox

Re: [RC] Tables bbCodes

Post by Sniper_E »

Yes change that margin-left: value in the tables.css - New version coming out later with all this in there.
Sniper_E wrote: 25 Oct 2016, 20:08 Yes it effected the drop down also. That will need another delivery setup in version 2.0.7 along with this strip br script.

Hey, setting the css margin up higher, or would that be lower, will do the trick for now.

Code: Select all

.tables:hover .table-selections { display: inline-block;position: absolute;padding: 4px 6px;margin-left: -350px;margin-top: 20px;

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1159
Joined: 14 Oct 2014, 19:01
    Windows 10 Firefox

Re: [RC] Tables bbCodes

Post by Sniper_E »

I think I will change the tables= bbcode html replacement to...

Code: Select all

<script>$('.tablesbr br').remove();</script><span class="tables"><div class="forabg forumbg-table tbg {SIMPLETEXT}" style="width: {NUMBER}%"><div class="inner"><table class="table1 tablesbr">{TEXT}</table></div></div></span>
And change the tables/.../event/overall_footer_body_after.html to...

Code: Select all

<script>$('.tablesbr br').remove();</script>
And keep the .tables:hover .table-selections css as margin-left: -48px;

Now I have to work on the lang file.

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1159
Joined: 14 Oct 2014, 19:01
    Android Chrome

Re: [RC] Tables bbCodes

Post by Sniper_E »

I'm working on this ext. The chat is too small to include it there so I'm not coding it for that location. I'm thinking it only needs to be in the posting page myself. Do you guys think that will be alright? I don't even think tables needs to be in the acp.

What are your thoughts on all that? Cool?

The br.remove is working good so it will insert into the text area the way you like. That was a good idea for this ext.

User avatar

proavia
Users
Users
Posts: 65
Joined: 30 Aug 2015, 22:50
    Windows 7 Internet Explorer

Re: [RC] Tables bbCodes

Post by proavia »

Personally, I see no need to ever use a table in chat. And the only thing I need in the ACP is to be able to enable it. :rolling: Can't think of why I'd want to disable certain features of it in the ACP.

The BR remove addition will certainly allow us to enter the correct table data easier when using multiple columns/rows! :eusa_dance:

Since you've been updating it frequently, I haven't done the custom edits for the table background color. But I assume it still will work as before.

Thanks for all the work you've put into this!

User avatar

Topic Author
Sniper_E
VIP
VIP
Posts: 1159
Joined: 14 Oct 2014, 19:01
    Android Chrome

Re: [RC] Tables bbCodes

Post by Sniper_E »

Thanks for the input.
When you do play around with creating a table, where do you do it at? The posting page?
I'm not even going to put it in quick reply. Not everyone has that and not critical.
I could put group permissions on it but don't see that's even needed.

User avatar

proavia
Users
Users
Posts: 65
Joined: 30 Aug 2015, 22:50
    Windows 7 Internet Explorer

Re: [RC] Tables bbCodes

Post by proavia »

The posting page. While I have QR installed, I'd never use it to create a table.

Since it uses bbcodes, you can set the group permissions for the "table" code under the Posting tab and edit the "table=" bbcode - if you ever needed to. I think that would limit the use if necessary.

User avatar

Puchahawa
Users
Users
Posts: 193
Joined: 20 Jun 2015, 17:58
    Windows 7 Chrome

Re: [RC] Tables bbCodes

Post by Puchahawa »

Morning Sniper. I agree with your thoughts on only having it on the posting page. That is where the reg users are and where it's going to get it's use IMO. :smile:

Post Reply Previous topicNext topic