vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB Chat (https://vborg.vbsupport.ru/forumdisplay.php?f=107)
-   -   Opening a Link to vBchat in a New Smaller window (https://vborg.vbsupport.ru/showthread.php?t=79968)

oglsmm 04-15-2005 05:21 PM

Opening a Link to vBchat in a New Smaller window
 
I have a link to my vBchat section on a seperate page. How do I make this link open up the chat into a seperate smaller window, instead of the full screen one it does by default.

Sarizaddi 04-21-2005 02:13 PM

In your Admin Templates, you changed a few, one of them being "navbar". Go back into your control panel, Styles & Templates, Style Manager, select "Edit Templates", expand all "[<< >>]", go back to modify the "navbar" template.

The code you added should've been:

Quote:

Originally Posted by navbar
<script type="text/javascript">
<!--

function OpenvBChat(){
vBChat = window.open('vBChat.php?$session[sessionurl]','vBChat','directories=no,height='+window.screen. height+',width='+window.screen.width+',location=no ,menubar=no,scrollbars=yes,status=no,toolbar=no')

return false;
}

-->
</script>
<td class="vbmenu_control"><a href="vBChat.php?$session[sessionurl]" onclick="return OpenvBChat();">vBChat</a></td>

take that out and substitute instead:

Quote:

Originally Posted by Sarizaddi
<script type="text/javascript">
<!--

function OpenvBChat(){

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

return false;
}

-->
</script>
<td class="vbmenu_control"><a href="vBChat.php?$session[sessionurl]"

In the above, you will see "var ws = screen.width*0.85;" and "var hs = screen.height*0.7;" In there, Screen Width is a percentage, currently being 85% of the user's screen. Same with Height, at 70%. You can manually adjust these, like if you wanted 90% and 90% you'd use .9 and .9

Doing this will not only allow it to pop up in a smaller window, but will also allow it to be user resizable.

Please note in the snippet, the forum is adding a space in resizable, making it "resiza ble" I can not correct that in my post, but it needs to be corrected before you insert it in the navbar template.

oglsmm 04-25-2005 01:06 PM

Thank You!

greenhybrid 04-25-2005 07:37 PM

Or, you can just make it open in a new window/tab by taking out the javascript and replacing the onclick function with target="_blank" in the links to it.


All times are GMT. The time now is 11:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04816 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete