[Bio] / FigWebServices / subsys.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/subsys.cgi

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

revision 1.102, Sat Jul 30 18:05:42 2005 UTC revision 1.103, Sat Jul 30 20:25:38 2005 UTC
# Line 1  Line 1 
1  # -*- perl -*-  # -*- perl -*-
2    
3  use FIG;  use FIG;
4    use FIGjs;  # mouseover()
5  my $fig = new FIG;  my $fig = new FIG;
6    
7  use Subsystem;  use Subsystem;
# Line 1463  Line 1464 
1464          my @row_guide = ();          my @row_guide = ();
1465    
1466          #  Add pop-up tool tip with role name to abbreviations in column header          #  Add pop-up tool tip with role name to abbreviations in column header
1467          #  (a wonderful suggestion from Carl Woese). Building the onMouseover          #  (a wonderful suggestion from Carl Woese). -- GJO
         #  string has been put in a subroutine because it is big and ugly, and  
         #  it is necessary to escape the quotes in the strings. -- GJO  
1468    
1469          my( $role, %in_col, $abbrev, $mem, $abbrev_html );          my( $role, %in_col, $abbrev, $mem, $abbrev_html );
1470          foreach $role (grep { $activeC{$_} } $subsystem->get_roles)          foreach $role (grep { $activeC{$_} } $subsystem->get_roles)
# Line 1478  Line 1477 
1477                      push( @row_guide, [ map { [ $_, "-" . ($subsystem->get_role_index($_) + 1) ] } @$mem ] );                      push( @row_guide, [ map { [ $_, "-" . ($subsystem->get_role_index($_) + 1) ] } @$mem ] );
1478                      foreach $_ ( @$mem ) { $in_col{ $_ } = 1 };  #  Mark the roles that are done                      foreach $_ ( @$mem ) { $in_col{ $_ } = 1 };  #  Mark the roles that are done
1479                      my $rolelist = join '<br>', map { substr($_->[1],1) . ". $_->[0]" } @{$row_guide[-1]};                      my $rolelist = join '<br>', map { substr($_->[1],1) . ". $_->[0]" } @{$row_guide[-1]};
1480                      $abbrev_html = "<a " . js_onMouseover("Roles of $abbrev", $rolelist, '') . ">$abbrev</a>";                      $abbrev_html = "<a " . FIGjs::mouseover("Roles of $abbrev", $rolelist, '') . ">$abbrev</a>";
1481                      push( @$col_hdrs, $abbrev_html );                      push( @$col_hdrs, $abbrev_html );
1482                  }                  }
1483                  else                  else
1484                  {                  {
1485                      push( @row_guide, [ [ $role, "" ] ] );  #  No suffix on peg number                      push( @row_guide, [ [ $role, "" ] ] );  #  No suffix on peg number
1486                      $abbrev = $subsystem->get_role_abbr( $subsystem->get_role_index( $role ) );                      $abbrev = $subsystem->get_role_abbr( $subsystem->get_role_index( $role ) );
1487                      $abbrev_html = "<a " . js_onMouseover("Role of $abbrev", $role, '') . ">$abbrev</a>";                      $abbrev_html = "<a " . FIGjs::mouseover("Role of $abbrev", $role, '') . ">$abbrev</a>";
1488                      push( @$col_hdrs, $abbrev_html );                      push( @$col_hdrs, $abbrev_html );
1489                  }                  }
1490              }              }
# Line 1780  Line 1779 
1779  }  }
1780    
1781    
 #  The tool tips content strings need their quotes escaped.  
 #  
 #  They are in HTML double quotes, so double quotes have to become &quot;  
 #  They are in javascript single quotes, so single quotes have to become \'  
 #  They should probably also have their strings HTML escaped for '<'; but  
 #  that needs to be done as they are assembled, because we embed HTML tags  
 #  (such as <br>) in them. -- GJO  
 #  
 #  The following escapes each part and makes the onMouseover string:  
   
 sub js_onMouseover {  
     my ( $title, $body, $rest ) = @_;  
     $title = $title ? js_string_escape( $title ) : "";  
     $body  = $body  ? js_string_escape( $body  ) : "";  
     $rest  = $rest  ? js_string_escape( $rest  ) : "";  
         qq(onMouseover="javascript:if(! this.tooltip) this.tooltip=new Popup_Tooltip(this, '$title', '$body', '$rest'); this.tooltip.addHandler(); return false;");  
 }  
   
 sub js_string_escape {  
     my $string = $_[0];  
     if ( $string ) { $string =~ s/'/\\'/g; $string =~ s/"/&quot;/g }  
     $string;  
 }  
   
   
1782  sub group_by_clusters {  sub group_by_clusters {
1783      my($fig,$pegs) = @_;      my($fig,$pegs) = @_;
1784      my($peg,@clusters,@cluster,@colors,$color,%seen,%conn,$x,$peg1,@pegs,$i);      my($peg,@clusters,@cluster,@colors,$color,%seen,%conn,$x,$peg1,@pegs,$i);

Legend:
Removed from v.1.102  
changed lines
  Added in v.1.103

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3