PopUp Window

Questions? Suggestions? Need help? Talk about anything related to Yawcam...

PopUp Window

Postby felix » Thu Aug 26, 2004 11:43 am

Is it possible to get the Yawcam Applet in a PopUp Window ?
How can do that ?

THX for your Help
:-) Felix
felix
 

Advertisement

Postby malun » Mon Aug 30, 2004 8:08 pm

Yes it is! What you will have to do is to change the html code in your webpages. You will have to add a javascript. There exists a lot of scripts doing this. I searched in google and fond this one I'm using in the following example:

First make a copy of your index.html located in the yawcam stream directory (i.e. c:\program files\yawcam\stream\index.html). Call the new copy popindex.html. Now edit popindex.html so it looks like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Yawcam</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript">
//Free JavaScripts on http://www.ScriptBreaker.com
function newWindow(mypage,myname,w,h,features) {
if(screen.width){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
}else{winl = 0;wint =0;}
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += features;
win = window.open(mypage,myname,settings);
win.window.focus();
}
</script>
<body>
<div align="center">
<p><strong><font size="5" face="Verdana, Arial, Helvetica, sans-serif">My webcam!</font></strong> </p>
<p>
<APPLET CODE=YawApplet.class WIDTH="Dont change the original value written here" HEIGHT="Dont change the original value written here">
<param name="Host" value="Dont change the original value written here">
<param name="Port" value="Dont change the original value written here">
</APPLET>
</p>
<p align="center"><a href="JavaScript:newWindow('popup.html','popup',335,260,'')">Click here for a popup window!</a></p>
<br>
<p><a href="http://www.yawcam.com" target="_blank"> <font face="Verdana, Arial, Helvetica, sans-serif">www.yawcam.com</font></a></p>
</div>
</body>
</html>


Then create a file called popup.html in your yawcam stream directory (i.e. c:\program files\yawcam\stream\popup.html) and edit it so it looks like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Yawcam</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<div align="center">
<p>
<APPLET CODE=YawApplet.class WIDTH="320" HEIGHT="240">
<param name="Host" value="192.168.0.2">
<param name="Port" value="8081">
</APPLET>
</p>
<p><a href="http://www.yawcam.com" target="_blank"> <font face="Verdana, Arial, Helvetica, sans-serif">www.yawcam.com</font></a></p>
</div>
</body>
</html>


Note that you will have to change the text written in red above, so that the code will work on your system and settings.
Now you should be able to access the "popup page" by entering http://address-to-yawcam-computer:8081/popindex.html in your web browser.
This was just an example... You can still edit this so it looks like you want.

Good Luck!
/malun
malun
Site Admin
 
Posts: 1356
Joined: Sun Jan 04, 2004 1:29 pm
Location: Gothenburg, Sweden


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests