[Bio] / FigKernelPackages / FIGjs.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIGjs.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9, Fri Jul 22 21:50:44 2005 UTC revision 1.10, Sat Jul 30 20:22:05 2005 UTC
# Line 1  Line 1 
1  package FIGjs;  package FIGjs;
2  use FIG;  use FIG;
3    use strict;
4    
5  =pod  =pod
6    
# Line 15  Line 16 
16    
17  =cut  =cut
18    
 sub toolTipScript {  
   
19   # Note that the actual script has now been put into FigCSS/FIG.js   # Note that the actual script has now been put into FigCSS/FIG.js
20   # this contains several javascript methods, separates them from the html, and keeps things cleaner  # this contains several javascript methods, separates them from the html,
21   # this method is here because it is almost certainly being called in places I have missed.  # and keeps things cleaner this method is here because it is almost certainly
22    # being called in places I have missed.
23   # RAE   # RAE
24    
25      my $url = &FIG::cgi_url() . "/Html/css/FIG.js";  sub toolTipScript {
26      return qq(<script language"JavaScript" type="text/javascript" src="$url"></script>);      #  my $url = &FIG::cgi_url() . "/Html/css/FIG.js";
27        #  Changed to relative URL -- GJO
28    
29        my $url = "Html/css/FIG.js";
30        qq(<script language"JavaScript" type="text/javascript" src="$url"></script>);
31  }  }
32    
33    
34    #  Cleaned, simplified and commented -- GJO
35    #
36    #  The text strings supplied must already be HTML escaped (< or & will be
37    #  treated as HTML, not text).
38    #  Single quotes are in javascript single quoted string and need a backslash.
39    #  Double quotes are in an HTML double quote, and need HMTL quoting.
40    
41  sub mouseover {  sub mouseover {
42      my ($title, $text, $menu) = @_;      my ($title, $text, $menu) = @_;
43      $info =~ s/'/\\'/g;  
44      $info =~ s/"/&quot;/g; #"      defined( $title ) or $title = '';
45      $title =~ s/'/\\'/g;      $title =~ s/'/\\'/g;    # escape '
46      $title =~ s/"/&quot;/g; #"      $title =~ s/"/&quot;/g; #"
47    
48        defined( $text ) or $text = '';
49      $text =~ s/"/&quot;/g; #"      $text =~ s/"/&quot;/g; #"
50      $text =~ s/'/&quot;/g; #'      $text =~ s/'/&quot;/g; #'
51    
52      $menu =~ s/'/\\'/g;      defined( $menu ) or $menu = '';
53        $menu =~ s/'/\\'/g;    #'
54      $menu =~ s/"/&quot;/g; #"      $menu =~ s/"/&quot;/g; #"
55    
56        qq( onMouseover="javascript:if(!this.tooltip) this.tooltip=new Popup_Tooltip(this,'$title','$text','$menu');this.tooltip.addHandler(); return false;" );
57    }
58    
     return " onMouseover=\"javascript:if(!this.tooltip) this.tooltip=new Popup_Tooltip(this,'".$title."','".$text."','".$menu."');this.tooltip.addHandler(); return false;\" ";  
59    
60  }  #  I'm not sure that this exists -- GJO
61    
62  sub toolTipLink {  sub toolTipLink {
63      return '<script src="Html/popup_tooltip.js" type="text/javascript"></script>';      return '<script src="Html/popup_tooltip.js" type="text/javascript"></script>';
64  }  }
 sub setValueScript {  
65    
66  my $script = <<'SCRIPT';  
67    sub setValueScript {
68    return <<'SCRIPT';
69  <script type="text/javascript">  <script type="text/javascript">
70  function setValue(id , val) {  function setValue(id , val) {
71     var element = document.getElementById(id);     var element = document.getElementById(id);
# Line 58  Line 73 
73  }  }
74  </script>  </script>
75  SCRIPT  SCRIPT
   
 return $script;  
   
76  }  }
77    
78  1;  1;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3