Permalink
Browse files

fix broken handling of embedded double quotes in imagemap callbacks, …

…which were causing broken images to appear in balloons
  • Loading branch information...
1 parent 867984c commit 32dba287be402b041c412b92a2bd239dfff287db Lincoln Stein committed Nov 28, 2011
Showing with 11 additions and 5 deletions.
  1. +1 −0 Changes
  2. +2 −1 lib/Bio/Graphics/Browser2/DataSource.pm
  3. +8 −4 lib/Bio/Graphics/Browser2/RenderPanels.pm
View
1 Changes
@@ -6,6 +6,7 @@
mouse hovers or clicks on the feature. This noticeably speeds up track generation time. Drawback
is that this increases the delay before balloon pops up on the hover operation when run in
cgi-bin mode (still fast in FastCGI mode). Restore original behavior by setting "inline imagemaps"
+ (or "inline imagemap").
to true in [TRACK DEFAULTS] or individual track definitions.
* Can now close tracks from main view even when corresponding track checkbox not showing
in the track listing.
View
3 lib/Bio/Graphics/Browser2/DataSource.pm
@@ -1355,7 +1355,8 @@ the actions are generated by Ajax callbacks
sub use_inline_imagemap {
my $self = shift;
my ($label,$length) = @_;
- my $inline = $self->semantic_fallback_setting($label=>'inline imagemaps',$length);
+ my $inline = $self->semantic_fallback_setting($label=>'inline imagemaps',$length)
+ ||$self->semantic_fallback_setting($label=>'inline imagemap', $length);
return $inline if defined $inline;
my $db = $self->open_database($label,$length) or return 1;
return !$db->can('get_feature_by_id');
View
12 lib/Bio/Graphics/Browser2/RenderPanels.pm
@@ -1267,9 +1267,9 @@ sub make_imagemap_element_inline {
#retrieve the content of the balloon from configuration files
# if it looks like a URL, we treat it as a URL.
my ($balloon_ht,$balloonhover) =
- $self->balloon_tip_setting('balloon hover',$label,$feature,$panel,$track);
+ $self->balloon_tip_setting('balloon hover',$label,$feature,$panel,$track,'inline');
my ($balloon_ct,$balloonclick) =
- $self->balloon_tip_setting('balloon click',$label,$feature,$panel,$track);
+ $self->balloon_tip_setting('balloon click',$label,$feature,$panel,$track,'inline');
$balloonhover ||= $title if $use_titles_for_balloons;
$balloon_ht ||= $balloon_style;
@@ -2557,7 +2557,7 @@ sub make_link_target {
sub balloon_tip_setting {
my $self = shift;
- my ($option,$label,$feature,$panel,$track) = @_;
+ my ($option,$label,$feature,$panel,$track,$inline) = @_;
my $length = $self->segment_length($label);
$option ||= 'balloon tip';
my $source = $self->source;
@@ -2582,7 +2582,11 @@ sub balloon_tip_setting {
}
# escape quotes
$val =~ s/'/\\'/g;
- $val =~ s/"/"/g;
+ if ($inline) {
+ $val =~ s/"/"/g;
+ } else {
+ $val =~ s/"/\\"/g;
+ }
return ($balloon_type,$val);
}

0 comments on commit 32dba28

Please sign in to comment.