Helpful Information
 
 
Category: vB Chat
Open vBChat in a smaller window

Some users have asked on how to open the vBChat window, smaller than full-screen. Here is an answer to this issue:

Go into your navbar template, or wherever you are calling vBChat from, and find the script that opens up the window. Replace that script with this one:


<script type="text/javascript">
<!--

function OpenvBChat(){

var ws = screen.width*0.8;
var hs = screen.height*0.7;
var winParms = "height=" + hs + ",width=" + ws + "directories=no,resizeable=yes,location=no,menubar=no,scrollbars=yes,status=no,to olbar=no";
vBChat = window.open('vBChat.php?$session[sessionurl]','vBChat',winParms)

return false;
}

-->
</script>


You can change the factors 0.8 and 0.7 I use, in the variables ws and hs to suite your needs. As it is now, it will create a window with 0.8 times the screen width and 0.7 times the screen height of your user's screen.

Rgds

Now if we could just make vbChat make better use of the window size it has assigned to it we'd really be talking. It seems to be limited to a fixed number of characters per line which seems to be hard coded somewhere.

Now if we could just make vbChat make better use of the window size it has assigned to it we'd really be talking. It seems to be limited to a fixed number of characters per line which seems to be hard coded somewhere.
Unfortunatelly, even though I know how to find out the user's screen resolution via a javascript, I have no idea how to pass this parameter to HTML.

The characters per line, I can't remember if it hard encoded, but the vertical size of the main messages window is. This can be found in the chat_main template, if you look in there, you will find something like:


<td class='alt2' align='center' width='85%' height='300'>
<iframe width='100%' height='100%' frameborder='0' border='0' src='vBChat.php?&do=chatFrameBlank' name='vBChatFrame'>Your Browser Does Not Support Iframe's, Get One That Does!</iframe>


The syntax might be a bit different, because my installation is heavily customized. However, you will notice that height='300' in the td tag. If you change that, the main area of the chat window gets larger, so more rows fit in there. However, ideally, this shouldn't be an arbitrary number, hard-encoded in the template, but something that is derived from the screen's resolution or even better, the window size itself. BUT, as I said, I do not know how to pass a parameter I calculate in a javascript, to HTML.

As for the characters per line, I think you could do something in the declaration of the tables, mine certainly seem to resize OK horizontally. Check out the table tags in the chat main, if memory servers me right, that's the place to look for.

Sorry I can't be more helpful :-(

John,

I notice that making the depth a larger number makes the Room window larger but the scroll bar doesn't adjust accordingly. Is that a Mac/Firefox thing?

-Layne

I am not sure, I haven't tried lately to mess with the code at that point, I can't be very sure.

Also, as I said before, I do not know how to pass the width/height parameters from the JS to the HTML part, so I can't test if my theory to alter that 300 pixels number will work. My idea was that, based on the user's screen height, you could come up with a percentage to be used in place of that 300 pixels value.

We'll have to wait for the author to come up with a solution, I guess.










privacy (GDPR)