5 include('/elements/init_overlib.html')
7 include( '/elements/popup_link_onclick.html', { #hashref or a list, either way
10 'action' => 'content.html', # uri for content of popup
13 'actionlabel => 'You clicked', # popup title
18 'closetext' => 'Go Away', # the value '' removes the link
27 my( $action, $actionlabel, $frame ) = ( '', '', '' );
28 my( $width, $height ) = ( 540, 336 );
29 my $closetext = 'Close';
30 my $color = '#333399';
33 if (ref($_[0]) eq 'HASH') {
34 #$params = { %$params, %{ $_[0] } };
37 #$params = { %$params, @_ };
41 $action = $params->{'action'} if exists $params->{'action'};
42 $actionlabel = $params->{'actionlabel'} if exists $params->{'actionlabel'};
43 $width = $params->{'width'} if exists $params->{'width'};
44 $height = $params->{'height'} if exists $params->{'height'};
45 $color = $params->{'color'} if exists $params->{'color'};
46 $closetext = $params->{'closetext'} if exists $params->{'closetext'};
47 $frame = $params->{'frame'} if exists $params->{'frame'};
49 #stupid safari is caching the "location" of popup iframs, and submitting them
50 #instead of displaying them. this should prevent that.
51 my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32;
54 "overlib( OLiframeContent('$action', $width, $height, '$popup_name' ), ".
55 "CAPTION, '$actionlabel', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, ".
56 "DRAGGABLE, CLOSECLICK, ".
57 "BGCOLOR, '$color', CGCOLOR, '$color', CLOSETEXT, '$closetext'".
58 ( $frame ? ", FRAME, $frame" : '' ).