[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.10, Sat Jul 30 20:22:05 2005 UTC revision 1.11, Wed Nov 23 20:34:59 2005 UTC
# Line 32  Line 32 
32    
33    
34  #  Cleaned, simplified and commented -- GJO  #  Cleaned, simplified and commented -- GJO
35  #  
36  #  The text strings supplied must already be HTML escaped (< or & will be  =head2 mouseover()
37  #  treated as HTML, not text).  
38  #  Single quotes are in javascript single quoted string and need a backslash.  Generate a mouseover for your code.
39  #  Double quotes are in an HTML double quote, and need HMTL quoting.  
40    You can use it like this:
41    push @$html, "<a " . FIGjs::mouseover("Title", "Body Text", "Menu", $parent, $title_bg_color, $text_bg_color) . " href='link.cgi'>a link</a>";
42    
43    and the appropriate javascript will be added for you.
44    
45    Title: The title of the popup that appears in bold
46    Body Text: The text to appear in the box.
47    Menu: This is probably the alternate menu that appears on the pinned regions page??
48    
49    Please note these should be HTML code so <b>text</b> will appear as bold. Also, please don't put linebreaks in the text since that breaks everything.
50    The text strings supplied must already be HTML escaped (< or & will be treated as HTML, not text).
51    
52    $parent is whether to place the box under the cursor or elsewhere on the page (e.g. top right corner)
53    Please note that there is an error at the moment and the value of parent doesn't affect anything.
54    Note also that I (RAE) didn't add this, but I have left it here for compatability with mouseover calls that expect it to be here.
55    
56    $title_bg_color is the color of the background for the title. The default blue color is #333399. Please include the # in describing the color
57    $text_bg_color is the color of the body of the text. The default body color is #CCCCFF. Please include the # in describing the color
58    
59    You don't need to supply the default colors, but can make the box red or green if you like.
60    
61    =cut
62    
63    
64  sub mouseover {  sub mouseover {
65      my ($title, $text, $menu) = @_;      my ($title, $text, $menu, $parent, $hc, $bc) = @_;
66    
67      defined( $title ) or $title = '';      defined( $title ) or $title = '';
68      $title =~ s/'/\\'/g;    # escape '      $title =~ s/'/\\'/g;    # escape '
# Line 53  Line 76 
76      $menu =~ s/'/\\'/g;    #'      $menu =~ s/'/\\'/g;    #'
77      $menu =~ s/"/&quot;/g; #"      $menu =~ s/"/&quot;/g; #"
78    
79      qq( onMouseover="javascript:if(!this.tooltip) this.tooltip=new Popup_Tooltip(this,'$title','$text','$menu');this.tooltip.addHandler(); return false;" );      qq( onMouseover="javascript:if(!this.tooltip) this.tooltip=new Popup_Tooltip(this,'$title','$text','$menu','$parent','$hc','$bc');this.tooltip.addHandler(); return false;" );
80  }  }
81    
82    
83  #  I'm not sure that this exists -- GJO  #  I'm not sure that this exists -- GJO
84    #  I agree, and I don't think it is ever called. I have added a die statement on 11/17/2005, feel free to delete this
85    #  if it has been a while and no one has complained about things dying -- Rob
86    
87  sub toolTipLink {  sub toolTipLink {
88        die "toolTipLink was called. Please email this error to Rob (RobE\@thefig.info). Sorry\n";
89      return '<script src="Html/popup_tooltip.js" type="text/javascript"></script>';      return '<script src="Html/popup_tooltip.js" type="text/javascript"></script>';
90  }  }
91    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3