Page 1 of 1

Problem, adding javascript popup function in template head

Posted: Thu Jun 01, 2006 3:05 pm
by Defix
I use cmsms 0.12.2-multilang-beta1
When I copy ImageGallery tag popup javascript in template head and want to preview template says: Access Denied

Anyone can help me?

Re: Problem, adding javascript popup function in template head

Posted: Fri Jun 02, 2006 5:04 am
by Dr.CSS
what code did you use...
you know what does it look like, how did you put it in?...
input more input...

Re: Problem, adding javascript popup function in template head

Posted: Fri Jun 02, 2006 6:24 am
by Defix
I use ImageGallery tag popup code, I find it bottom the ImageGallery tag help page.
# type e.g. type="click" or type="popup"
For the "popup" function to work you need to include the popup javascript into the head of your template e.g. "". The javascript is at the bottom of this page! The default is 'click'.

The popup javascript

Code: Select all

{literal}
<__script__ type="text/javascript">
<!--
function PopupPic(bigPic,title,w,h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	var smarty_hack = 'head';
	newWindow = window.open('',title,'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,scrollbars=0');
	newWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
	newWindow.document.write('<__html><head><title>'+title+'</title>');
	newWindow.document.write('<meta http-equiv="content-type" content="text/html; charset=UTF-8" />');
	newWindow.document.write('<style type="text/css"><!-- html, body {margin: 0px; background-color: #000;} --></style>');
	newWindow.document.write('</'+smarty_hack+'></__body onclick="self.close()">');
	newWindow.document.write('<p><img src="'+bigPic+'" alt="'+title+'" /></p>');
	newWindow.document.write('<__body></__html>');
	newWindow.document.close();
	newWindow.focus();
}
-->
</__script>
{/literal}

I insert it into my template " here ".
And Access denied

Re: Problem, adding javascript popup function in template head

Posted: Fri Jun 02, 2006 11:42 am
by Dr.CSS
have you tried it without the {literal} tags?

Re: Problem, adding javascript popup function in template head

Posted: Fri Jun 02, 2006 1:05 pm
by Defix
Yes I try, but same thing >:(
Cant understand, whats wrong. I try to put the popup script directly in template, but nothing.
Then I go to Content > Global Content Block and add popup script in new Global Content Block. When I press submit button: white page with Access Denied message.

Whats wrong whit that popup script???
JavaScript for IE page width in Global Content Block works fine and I can edit it all ok?

Re: Problem, adding javascript popup function in template head

Posted: Fri Jun 02, 2006 1:23 pm
by Defix
Not working even 0.13 Final version :P
Please step by step instruction how to include ImageGallery tag popup javascript in page template!
The script is bottom in ImageGallery tag help page.

Re: Problem, adding javascript popup function in template head

Posted: Fri Jun 02, 2006 2:41 pm
by Dr.CSS
you are Right the thing don't work...
tried it here.... no white page denial but not working...  http://www.multiintech.com/index.php?page=image_gallery
second gallery down

with it in the head and as an external script...