You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2004/09/02 13:55:56 UTC

adding a close control to help popups

Hi All

Not all browsers work well with the Matt Kruse PopUp windows used for 
CForms Help. In Safari for instance, it is not possible to make the 
popup close by clicking outside it's region.

Because of this, I would like to add a close link to the popup.

I have a working version, that adds a 6x6 pixel grey bordered square 
graphic, floated top/right in the popup, that when clicked closes the 
popup.

I have it tested in Safari and Firefox (MacOSX).

Does anyone object to my adding this modification to the CForms XSLT ?


thanks

regards Jeremy



--------------------------------------------------------

                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!
--------------------------------------------------------

Re: adding a close control to help popups

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 2 Sep 2004, at 13:55, Steven Noels wrote:

> On 02 Sep 2004, at 13:55, Jeremy Quinn wrote:
>
>> Does anyone object to my adding this modification to the CForms XSLT ?
>
> Please do. It's been annoying me as well. Top left might be better 
> since sometimes these pop-ups are chopped off by my right browser edge 
> as well.

Thanks for your response Steven.
I tried it on the left, but it is not quite so discreet, ie. it has a 
bigger effect on the overall layout.

I am away all next week, and pretty busy until then, so I am not sure 
if I will have a chance to apply this before I go.

If you would like to experiment for yourself, here is what I did .....

this is a template in "forms-advanced-field-styling.xsl" :

<xsl:template match="fi:help">
   <xsl:variable name="id" select="generate-id()"/>
   <div class="forms-help" id="help{$id}" style="visibility:hidden; 
position:absolute;">
	<!-- close button -->
     <span style="float:right"><a href="#" 
onClick="helpWin{$id}.hidePopup();return false;"><img align="top" 
alt="close" src="{$resources-uri}/close.gif" height="6" 
width="6"/></a></span>
	<!-- / close button -->
     <xsl:apply-templates select="node()"/>
   </div>
   <script type="text/javascript">
     var helpWin<xsl:value-of select="$id"/> = 
forms_createPopupWindow('help<xsl:value-of select="$id"/>');
   </script>
   <a id="{$id}" name="{$id}" href="#" 
onclick="helpWin{$id}.showPopup('{$id}');return false;">
     <!-- TODO: i18n key for helppopup -->
     <img src="{$resources-uri}/help.gif" alt="helppopup"/>
   </a>
</xsl:template>

And the gif (if it helps) is here -->

Re: adding a close control to help popups

Posted by Steven Noels <st...@outerthought.org>.
On 02 Sep 2004, at 13:55, Jeremy Quinn wrote:

> Does anyone object to my adding this modification to the CForms XSLT ?

Please do. It's been annoying me as well. Top left might be better 
since sometimes these pop-ups are chopped off by my right browser edge 
as well.

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source Java & XML            An Orixo Member
Read my weblog at            http://blogs.cocoondev.org/stevenn/
stevenn at outerthought.org                stevenn at apache.org