fix an intriguing issue raised by lint.
[sgn.git] / mason / cview / map / overlay_form.mas
blob5a793a49a055c444069b0f6b408c871a82db0398
2 <%doc>
4 =head1 NAME
6 /cview/map/overlay_form.mas - displays a form for the data overlay function
8 =head1 DESCRIPTION
10 Displays a info section with a form to overlay data on to the map.
12 parameters:
13 $map_version_id: the map_version_id specifying the map
14 $map_items: a string with map items to overlay
15 $size: the size parameter for the image size of the map
16 $hilite: a space/comma separated list of markers to hilite
18 =head1 AUTHOR
20 Lukas Mueller <lam87@cornell.edu>
22 =cut
25 </%doc>
27 <%args>
28 $map_version_id
29 $map_items => undef
30 $size
31 $hilite
32 $can_overlay => 0
33 $map_url
34 </%args>
36 <%perl>
38 if (!$can_overlay) { return; }
40 my $collapsed = !!defined $map_items;
42 </%perl>
44 <&| /page/info_section.mas, title=>'Overlay Custom Data', collapsible=>1, collapsed=>$collapsed &>
45       <table><tr><td width="50">&nbsp;</td><td>
46       <form style="width: 60%" action="<% $map_url %>" name="overlay_form" >
47         <p>To add labels to the diagram above, enter chromosome numbers, offsets (in the map's units), and names in the box below (<a href="javascript:overlay_show_example()">example</a>):</p>
48         <textarea class="form-control" id="map_items" name="map_items" cols="50" rows="5"><% $map_items %></textarea>
49         <input type="hidden" name="map_version_id" value="<% $map_version_id%>" />
50         <input type="hidden" name="size" value="<% $size %>" />
51         <input type="hidden" name="hilite" value="<% $hilite %>" />
52         <input type="hidden" name="force" value="1" /><br />
53         <button class="btn btn-primary" type="submit" value="overlay information" >Overlay Information</button>
54         <button class="btn btn-default" type="button" value="clear" onclick="overlay_clear_map_items(); return false" >Clear</button>
55       </form>
56       </td></tr></table>
58       <script language="javascript">
59         function overlay_show_example() {
60           var textarea = document.getElementById("map_items");
61           textarea.value = "1  50 foo\n2  80  bar";
62         }
64         function overlay_clear_map_items() {
65            var textarea = document.getElementById("map_items");
66            textarea.value = "";
67         }
68         </script>
69 </&>