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
19 'closetext' => 'Go Away', # the value '' removes the link
28 my( $action, $actionlabel, $frame ) = ( '', '', '' );
29 my( $width, $height ) = ( 540, 336 );
30 my $closetext = 'Close';
31 my $color = '#333399';
34 if (ref($_[0]) eq 'HASH') {
35 #$params = { %$params, %{ $_[0] } };
38 #$params = { %$params, @_ };
42 $action = $params->{'action'} if exists $params->{'action'};
43 $actionlabel = $params->{'actionlabel'} if exists $params->{'actionlabel'};
44 $width = $params->{'width'} if exists $params->{'width'};
45 $height = $params->{'height'} if exists $params->{'height'};
46 $color = $params->{'color'} if exists $params->{'color'};
47 $closetext = $params->{'closetext'} if exists $params->{'closetext'};
48 $frame = $params->{'frame'} if exists $params->{'frame'};
50 #stupid safari is caching the "location" of popup iframs, and submitting them
51 #instead of displaying them. this should prevent that.
52 my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32;
55 "overlib( OLiframeContent('$action', $width, $height, '$popup_name' ), ".
56 "CAPTION, '$actionlabel', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, ".
57 "DRAGGABLE, CLOSECLICK, ".
58 "BGCOLOR, '$color', CGCOLOR, '$color', CLOSETEXT, '$closetext'".
59 ( $frame ? ", FRAME, $frame" : '' ).