Suggestion: Collapse large text/code blocks

Voice your opinions, concerns and suggestions on how to make the Transport Tycoon Forums better.

Moderator: General Forums Moderators

Post Reply
Dante123
Chief Executive
Chief Executive
Posts: 672
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Suggestion: Collapse large text/code blocks

Post by Dante123 »

Suggestion: Collapse large text/code blocks
sometimes (in the new grf development forum part) i want to paste large example of code.
what i want to prevent is getting a huge page you have to scroll down all the way.

my suggestion would be to add a new BBcode to be able to hide/collapse some part of text defined by the use.

a exampe of what it should look like:
1.PNG
1.PNG (7.22 KiB) Viewed 1916 times
2.PNG
2.PNG (14.21 KiB) Viewed 1916 times

the user can use use the bbcode like [hide]the text/code the user wants hidden[/hide]


For the forum admin:
in case this might get added to the forum, this can be done in administration panel at the "posting" tab
once in posting tab, at the left menu "BBcodes"
than click on "add new BBcode"

in the first field (the field called BBCode usage) the input should be:

Code: Select all

[hide]{TEXT}[/hide]
(ofc the term "hide" can be something else)

for the second field (the field called HTML replacement) the input should be:

Code: Select all

<div style="margin:20px; margin-top:5px"><div class="quotetitle"><input class="button2 btnlite" type="button" value="Show Hidden" style="text-align:center;width:100px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';      this.innerText = ''; this.value = 'Hide Hidden'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show Hidden'; }" /></div><div class="quotecontent"><div style="display: none;">{TEXT}</div></div></div>

for thelast field, the example field
something like this should do fine:

Code: Select all

[hide]Hidden text here[/hide]
[code]

(plus i think its best to check the box too that says "Display on posting page")

Dante
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Suggestion: Collapse large text/code blocks

Post by Yexo »

When it's an integral part of your post and not too big, you can inline it like you can already do know. When it's really too much code for that you could instead upload it as an attachment.
Post Reply

Return to “Forum Suggestions and Feedback”

Who is online

Users browsing this forum: No registered users and 8 guests