-
Jan 12th, 2016, 07:18 PM
#1
Thread Starter
PowerPoster
Width of code 'Box'.
I spent ages writing a post in HERE yesterday, I definitely clicked 'Submit New Thread' but it's not here !
I shall try again...
When posting or reading posts which include a 'Code Box', why is it that the 'Code Box' is always much narrower than the page it's on ? There are always very large margins either side of this 'Code Box', other text is much wider on the page than a 'Code Box'.
I have tried to make the box wider without success, even when I've clicked the link to expand the form to full width, the 'Code Box' has not changed it's width.
The narrow width of the box often forces lines of code to wrap to the line below, making complicated code even more difficult to read.
Is there something I'm doing wrong, or maybe something I'm not doing, to make code boxes more readable ?
Poppa.
Last edited by Poppa Mintin; Jan 12th, 2016 at 07:33 PM.
Reason: Typo correction
Along with the sunshine there has to be a little rain sometime.
-
Jan 12th, 2016, 07:50 PM
#2
Re: Width of code 'Box'.
I second this motion. @Poppa Mintin, I don't think that it's anything that you're doing because I see the same thing and I have the same issue with it. I don't see why code boxes should not expand to the full width of the page. In this age of widescreen monitors, it seems sill to restrict the width of page elements like that, especially when, as you say, it can make code quite hard to read at times.
-
Jan 13th, 2016, 09:24 AM
#3
Re: Width of code 'Box'.
vBulletin is a third party software product, so we have some limits on what we can change. I know the code box is set to work on a screen that is 1280 pixels wide in general as that is a happy median. I don't believe there is a dynamic setting in vBulletin to push the code box to change with the changing of the screen width. If someone knows of such a setting (and where it is), let me know.
Brad!
-
Jan 13th, 2016, 11:01 AM
#4
Thread Starter
PowerPoster
Re: Width of code 'Box'.
Brad,
Is there a chance the third party would answer that question ?
Is there a chance the third party might be prevailed upon to provide a means to adjust the width if it doesn't already exist ?
Poppa.
Along with the sunshine there has to be a little rain sometime.
-
Jan 13th, 2016, 11:18 AM
#5
Re: Width of code 'Box'.
Third party is vBulletin. It seems that we went though this discussion a while back on one of our dev forums (this one or Codeguru most likely). It isn't as simply as being dynamic because the box is within a box within a structure, etc. More to the point, the layout of the site is templatized so that you can change things around. That means dynamic widths within areas that are also dynamic start to get.....iffy.
Having said all that, I've not looked at this in a while (beyond a look earlier today where I couldn't find all the settings.....) Something might have changed, so we can take a look as time allows.
Edit: I did find the setting for the vertical height (set to 30 lines maximum). I didn't find the width setting. As stated earlier, if anyone knows where that is, let me know. I know we have a few vBulliten experts that roam this site!)
-
Jan 13th, 2016, 12:29 PM
#6
Re: Width of code 'Box'.
Originally Posted by brad jones
Edit: I did find the setting for the vertical height (set to 30 lines maximum). I didn't find the width setting. As stated earlier, if anyone knows where that is, let me know. I know we have a few vBulliten experts that roam this site!)
Its somewhere in the HTML where it says, p.className=='bbcode_code , and was hard coded to 650 pixels.... cause when I was using firefox I sometimes used to enable this script i made to make the code boxes as wide as possible.
-
Jan 13th, 2016, 01:33 PM
#7
Re: Width of code 'Box'.
Originally Posted by Edgemeal
Its somewhere in the HTML
That's likely the HTML code generated by the vBulletin software. A lot of the pages are dynamically generated. There are thousands of settings, configuration files, and other markup things that are used to customize things like the code box width, where things are displayed, and what is displayed. While hacking code could be done.... it is not the approach we take. Hacks get overwritten when we do updates. As such, we have to find the right spot int he configurations and such to make sure we fix this in a way that doesn't get undone in the future.
Thanks, however, for pointing that out as it might help me find the right spot.
-
Jan 13th, 2016, 01:35 PM
#8
Re: Width of code 'Box'.
Originally Posted by brad jones
That's likely the HTML code generated by the vBulletin software. A lot of the pages are dynamically generated. There are thousands of settings, configuration files, and other markup things that are used to customize things like the code box width, where things are displayed, and what is displayed. While hacking code could be done.... it is not the approach we take. Hacks get overwritten when we do updates. As such, we have to find the right spot int he configurations and such to make sure we fix this in a way that doesn't get undone in the future.
Thanks, however, for pointing that out as it might help me find the right spot.
Ya I realized that after posting, but the width is hard coded to 650(or was last time i looked a year ago), and when looking at other forums I notice they use a percentage to set the code box widths.
Thanks again!
-
Jan 13th, 2016, 01:39 PM
#9
Re: Width of code 'Box'.
Originally Posted by Edgemeal
Ya I realized that after posting, but the width is hard coded to 650(or was last time i looked a year ago), and when looking at other forums I notice they use a percentage to set the code box widths.
Thanks again!
Do you know if the other forums were using vBulletin? If so, then we know we can make it work
-
Jan 13th, 2016, 01:43 PM
#10
Re: Width of code 'Box'.
Originally Posted by brad jones
Do you know if the other forums were using vBulletin? If so, then we know we can make it work
Ya vBulletin, "vBulletin 4.2.2", for example,
http://www.xtremesystems.org/forums/...ltiThread-Test
-
Jan 13th, 2016, 03:32 PM
#11
Re: Width of code 'Box'.
Testing....
Test 3
Code:
This is a bunch of code Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1Line 1
Line 2 Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2 Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2Line 2 Line 2Line 2Line 2Line 2Line 2Line 2Line 2 Line 2Line 2Line 2Line 2Line 2Line 2Line 2
Line 3 Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3 Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3Line 3 Line 3Line 3Line 3Line 3Line 3Line 3Line 3 Line 3Line 3Line 3Line 3Line 3Line 3
Test 2
Code:
this is code
this is code
this is line3
-
Jan 13th, 2016, 03:38 PM
#12
Re: Width of code 'Box'.
Here is the code for setting the width. Anyone want to suggest what should change to make it dynamic?
Code:
<div class="bbcode_container">
<div class="bbcode_description">{vb:rawphrase code}:</div>
<pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']">style="width:650px;height:<vb:if condition="$blockheight<$vboptions['codemaxlines']">{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}
<vb:else />{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}}</vb:if>;"</vb:if>>{vb:raw code}</pre>
</div>
-
Jan 13th, 2016, 03:39 PM
#13
Re: Width of code 'Box'.
(and as a note - I had Heidi adjust it to 850px from 650px. This will help for those using larger resolutions. For those with lower resolutions, it might push the right rail ads a bit off the screen.... )
-
Jan 13th, 2016, 05:36 PM
#14
Re: Width of code 'Box'.
Originally Posted by brad jones
(and as a note - I had Heidi adjust it to 850px from 650px. This will help for those using larger resolutions. For those with lower resolutions, it might push the right rail ads a bit off the screen.... )
Instead of 850px can you use a percentage like i did in my FF script?, that way the code window will auto size.
Odd?...When I'm previewing my post in edit mode I can see and use the Horiz scrollbar for code box ( Chrome/Win7), but not when I'm just browsing!
-
Jan 13th, 2016, 05:46 PM
#15
Re: Width of code 'Box'.
Let me talk to Heidi tomorrow about the percentage. If she has time, we can test it and see what it does.
-
Jan 14th, 2016, 03:09 PM
#16
Re: Width of code 'Box'.
Originally Posted by brad jones
Let me talk to Heidi tomorrow about the percentage. If she has time, we can test it and see what it does.
Well that extra 200px helps a lot, Thanks again!
EDIT Are the vb.net Code windows still only 650?
Looking at my old test here for example the "Code" and "vb.net Code" have different widths (CHROME/WIN7).
Last edited by Edgemeal; Jan 14th, 2016 at 03:23 PM.
-
Jan 14th, 2016, 03:30 PM
#17
Re: Width of code 'Box'.
Originally Posted by Edgemeal
EDIT Are the vb.net Code windows still only 650?
Probably. I think Heidi only mentioned code and php. Likely we overlooked vb. Is vb still important?
Brad!
(yes, that was a joke)
-
Jan 14th, 2016, 09:26 PM
#18
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|