flarum / issue-archive

0 stars 0 forks source link

[BBCode/Markdown] Shrink/expand long code blocks #375

Open jordanjay29 opened 8 years ago

jordanjay29 commented 8 years ago

Example: https://discuss.flarum.org/d/1658-401-unauthorized/22

There really needs to be a way to shrink/expand long code blocks in a forum post so that they don't obnoxiously fill the screen. Scrollbars would be one way to do it, or have a javascript (JQuery?) shrink/expand function which would be more "modern" and definitely more mobile friendly.

franzliedke commented 8 years ago

Very good idea, I agree. I kind of like the "expand" idea, that in combination with scrollbars might be best.

matpompili commented 8 years ago

I'm working on it. I think I'll use this script: https://github.com/jedfoster/Readmore.js What do you think?

jordanjay29 commented 8 years ago

Can it be localized? I think the encapsulation of the language strings might be a problem.

matpompili commented 8 years ago

Yes it can be localized. In the Use section of the README.md there are lots of options to customize the script, such as more and less strings

JoshyPHP commented 8 years ago

Personally I'd rather see some sort of thin div at the bottom with a or symbol that either expands or shrinks the code block when clicked. You wouldn't have to localise it.

tobyzerner commented 8 years ago

I agree with @JoshyPHP. Also, for the sake of file size, unless we can find a microlibrary that does exactly what we need in only a few lines, we can probably just write our own JS - e.g. https://github.com/esotalk/esoTalk/blob/develop/core/js/conversation.js#L581

tobyzerner commented 8 years ago

@franzliedke and I discussed this and agree that we should implement an "expand" toggle button which increases the height of a code block/quote so that all of its contents is visible.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!