PDA

View Full Version : clever popup code, if anyone wants it.


gabrielcrowe
20-Oct-2006, 03:45 PM
We were annoyed at actinics handling of extended popups, so i knocked this up. Various code cobbled together from the intearweb. It makes a popup window auto resize, to the exact dims of an image passed into it. The code ignores the numbers passed to it by actinic. Clicking the image in the popup closes the window.
nice and clean.

Warning: produced in a factory where nuts are handled.

<HTML>
<HEAD>
<Actinic:WINDOW WIDTH="NETQUOTEVAR:INFOIMAGEWIDTH" HEIGHT="NETQUOTEVAR:INFOIMAGEHEIGHT"/>
<TITLE>NETQUOTEVAR:PAGETITLE</TITLE>
<Actinic:BASEHREF VALUE="NETQUOTEVAR:BASEHREF"/>
<script language='javascript'>
var arrTemp=self.location.href.split("?");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

function FitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;
iHeight = (NS)?window.innerHeight:document.body.clientHeight;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight);
self.focus();
};
</script>
</HEAD>
<BODY bgcolor="#000000" onload='FitPic();' topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<A HREF=\"javascript:window.close();\"><IMG SRC=\"NETQUOTEVAR:INFOIMAGE\" WIDTH=NETQUOTEVAR:INFOIMAGEWIDTH HEIGHT=NETQUOTEVAR:INFOIMAGEHEIGHT border=\"0\"></a>" );
</script>

</BODY>
</HTML>

after you save this file, set it as the default popup code in your Design > Options > default extended info template.

/me tips hat

jont
21-Oct-2006, 08:29 AM
Nice one Gabriel.

Lee did one back in v6 which should still work in v7 also http://community.actinic.com/showthread.php?t=8203

cdicken
23-Oct-2006, 11:40 AM
Awesome. I'll adapt this for v8 and add it to the Advanced User Guide

cdicken
27-Oct-2006, 09:45 AM
Here's the version 8 code:

<html>
<head>
<Actinic:WINDOW width="<Actinic:Variable Name="ExtendedInfoImageWidth"/>" height="<Actinic:Variable Name="ExtendedInfoImageHeight"/>"/>
<title><actinic:variable name="PageTitle" /></title>
<actinic:variable name="BaseHref" />
<script language='javascript'>
var arrTemp=self.location.href.split("?");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

function FitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;
iHeight = (NS)?window.innerHeight:document.body.clientHeight;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight); self.focus(); };
</script>
</head>
<body bgcolor="#000000" onload='FitPic();' topmargin="0" marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<a href=\"javascript:window.close();\"><img src=\"<Actinic:Variable Name="ExtendedInfoImage"/>\" width=\"<Actinic:Variable Name="ExtendedInfoImageWidth"/>\" height=\"<Actinic:Variable Name="ExtendedInfoImageHeight"/>\" border=\"0\"></a>" );
</script>
</body>
</html>