Dears, I was wondering how to once clicking on a image (thumbnail) I would get the full-size image in a fitted new window, without buttons, address field etc. I can realise how to do it with javascript but I don't know, if it's the only way, how to integrate javascript in a zpt. A example/tutorial would be very welcome so. If it can be done without javascript, just with zope tools, that would be very appreciated. Many thanks in advance. Cheers, Alan
I was wondering how to once clicking on a image (thumbnail) I would get the full-size image in a fitted new window, without buttons, address field etc. I can realise how to do it with javascript but I don't know, if it's the only way, how to integrate javascript in a zpt. A example/tutorial would be very welcome so. What you're asking for? How to insert javascript code into html page?
-- Maciej Wisniowski
The answer to your question is Yes if there's no other way of clicking on a link and open an image in a fitted new window of my browser that zope can cope without using javascript. But putting in other words what I really would like to know: does zope have its own way of clicking on a link and open an image in a fitted new window without buttons, address field etc.? Cheers, Alan On 22/03/07, Maciej Wisniowski <maciej.wisniowski@coig.katowice.pl> wrote:
I was wondering how to once clicking on a image (thumbnail) I would get the full-size image in a fitted new window, without buttons, address field etc. I can realise how to do it with javascript but I don't know, if it's the only way, how to integrate javascript in a zpt. A example/tutorial would be very welcome so. What you're asking for? How to insert javascript code into html page?
-- Maciej Wisniowski
-- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, Cambridge CB2 1GA, UK.
----- Original Message ----- From: "Alan" <alanwilter@gmail.com> To: "Maciej Wisniowski" <maciej.wisniowski@coig.katowice.pl> Cc: <zope@zope.org> Sent: Thursday, March 22, 2007 9:01 AM Subject: Re: [Zope] open image in a fitted new window
The answer to your question is Yes if there's no other way of clicking on a link and open an image in a fitted new window of my browser that zope can cope without using javascript.
But putting in other words what I really would like to know: does zope have its own way of clicking on a link and open an image in a fitted new window without buttons, address field etc.?
Zope only performs server-side actions. What you are describing are actions that occur on the client-side (ie. on the user's pc/browser), therefore you must use client-side tools (ie. javascript). Jonathan
Thanks Jonathan, I can understand your point. So I will google for a way (example/tutorial) of how integrating javascript in a zpt. Cheers, Alan On 22/03/07, Jonathan <dev101@magma.ca> wrote:
----- Original Message ----- From: "Alan" <alanwilter@gmail.com> To: "Maciej Wisniowski" <maciej.wisniowski@coig.katowice.pl> Cc: <zope@zope.org> Sent: Thursday, March 22, 2007 9:01 AM Subject: Re: [Zope] open image in a fitted new window
The answer to your question is Yes if there's no other way of clicking on a link and open an image in a fitted new window of my browser that zope can cope without using javascript.
But putting in other words what I really would like to know: does zope have its own way of clicking on a link and open an image in a fitted new window without buttons, address field etc.?
Zope only performs server-side actions. What you are describing are actions that occur on the client-side (ie. on the user's pc/browser), therefore you must use client-side tools (ie. javascript).
Jonathan
-- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, Cambridge CB2 1GA, UK.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alan wrote:
Thanks Jonathan, I can understand your point. So I will google for a way (example/tutorial) of how integrating javascript in a zpt.
Cheers, Alan
On 22/03/07, Jonathan <dev101@magma.ca> wrote:
----- Original Message ----- From: "Alan" <alanwilter@gmail.com> To: "Maciej Wisniowski" <maciej.wisniowski@coig.katowice.pl> Cc: <zope@zope.org> Sent: Thursday, March 22, 2007 9:01 AM Subject: Re: [Zope] open image in a fitted new window
The answer to your question is Yes if there's no other way of clicking on a link and open an image in a fitted new window of my browser that zope can cope without using javascript.
But putting in other words what I really would like to know: does zope have its own way of clicking on a link and open an image in a fitted new window without buttons, address field etc.? Zope only performs server-side actions. What you are describing are actions that occur on the client-side (ie. on the user's pc/browser), therefore you must use client-side tools (ie. javascript).
The only trick here is to get the javascript to include the "dynamic" URL; everything else is not specific to Zope or ZPT. Here is the hack I usually use for that:: <!-- assumes that 'image' is bound to an actual Zope image object --> <script type="text/javascript" lang="JavaScript" tal:define="img_url image/absolute_url" tal:content="string:var img_url='${img_url}';"></script> Your popup javascript can then refer to the 'img_url' JS variable to set the window location. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGAoJb+gerLs4ltQ4RAjCXAJ9KJ+RELcq5iTNkfUSWMYy8D9mDDwCfVLNE /Bo+E5mRc5Ntft8f0dB7IG0= =fizE -----END PGP SIGNATURE-----
Tres Seaver schrieb: ...
The only trick here is to get the javascript to include the "dynamic" URL; everything else is not specific to Zope or ZPT. Here is the hack I usually use for that::
<!-- assumes that 'image' is bound to an actual Zope image object --> <script type="text/javascript" lang="JavaScript" tal:define="img_url image/absolute_url" tal:content="string:var img_url='${img_url}';"></script>
Your popup javascript can then refer to the 'img_url' JS variable to set the window location.
A little bit cleaner approach would be to have an ordinary link: <a class="magnify" href="path/to/big/image"><img src="path/to/thumbnail" width, height ... /></a> and have a general javascript which scans thru the DOM after load, finds the a-objects with class-attribute magnify and installs an handler for mouse click which overrides the usual link action and either pops up a window or uses layers the big view on top with little DOM action (preferred). You dont even net buzzy "Ajax" for this. The URL for the big picture is just encoded in the HTML already, so you can use the usual tal: attributes to define in ZPT. The result is clean xhtml code which works in any case and only is improved in case of javascript beeing available. Regards Tino
participants (5)
-
Alan -
Jonathan -
Maciej Wisniowski -
Tino Wildenhain -
Tres Seaver