5 <SCRIPT TYPE="text/javascript" SRC="overlibmws.js"></SCRIPT>
6 <SCRIPT TYPE="text/javascript" SRC="iframecontentmws.js"></SCRIPT>
8 include( '/elements/popup_link.html', { #hashref or a list, either way is fine
11 'action' => 'content.html', # uri for content of popup
12 'label' => 'click me', # text of <A> tag
15 'actionlabel => 'You clicked', # popup title
20 'closetext' => 'Go Away', # the value '' removes the link
24 % if ($action && $label) {
25 <A HREF="javascript:void(0);" onClick="<% $onclick %>"><% $label %></A>\
29 my($action, $label, $actionlabel) = ( '', '', '' );
30 my $closetext = 'Close';
32 my $color = '#333399';
35 if (ref($_[0]) eq 'HASH') {
36 #$params = { %$params, %{ $_[0] } };
39 #$params = { %$params, @_ };
43 $action = $params->{'action'} if exists $params->{'action'};
44 $label = $params->{'label'} if exists $params->{'label'};
45 $actionlabel = $params->{'actionlabel'} if exists $params->{'actionlabel'};
46 $width = $params->{'width'} if exists $params->{'width'};
47 $color = $params->{'color'} if exists $params->{'color'};
48 $closetext = $params->{'closetext'} if exists $params->{'closetext'};
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;
54 my $onclick = "overlib( OLiframeContent('$action', $width, 336, '$popup_name' ), CAPTION, '$actionlabel', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '$color', CGCOLOR, '$color', CLOSETEXT, '$closetext' ); return false;";