Skip to content
This repository
Browse code

some databases working

  • Loading branch information...
commit 0405e249dc4c8eaa090f3a21608796b318c32378 1 parent ddcedac
Lincoln Stein lstein authored
19 htdocs/js/controller.js
@@ -1360,8 +1360,23 @@ show_info_message:
1360 1360 },
1361 1361
1362 1362 callback:
1363   - function(element,fid) {
1364   - alert('element = '+element+' id= '+fid);
  1363 + function(element,dbid,fid) {
  1364 + // find track information
  1365 + var track_element = element.up(1).id;
  1366 + var track = track_element.sub(/^track_/,'');
  1367 + new Ajax.Request(Controller.url, {
  1368 + method: 'post',
  1369 + parameters:{
  1370 + action: 'get_feature_info',
  1371 + track: track,
  1372 + dbid: dbid,
  1373 + feature_id: fid,
  1374 + },
  1375 + onSuccess: function(transport) {
  1376 + var data = transport.responseText;
  1377 + alert(data);
  1378 + }
  1379 + });
1365 1380 }
1366 1381
1367 1382 });
14 lib/Bio/Graphics/Browser2/Action.pm
@@ -671,6 +671,20 @@ sub ACTION_autocomplete_user_search {
671 671 return (200,'text/html',$autocomplete);
672 672 }
673 673
  674 +sub ACTION_get_feature_info {
  675 + my $self = shift;
  676 + my $q = shift;
  677 + my $track = CGI::unescape($q->param('track')) or croak;
  678 + my $dbid = CGI::unescape($q->param('dbid')) or croak;
  679 + my $fid = CGI::unescape($q->param('feature_id')) or croak;
  680 + my $state = $self->state;
  681 + local $state->{dbid} = $dbid;
  682 + my $search = $self->render->get_search_object();
  683 + my $features = $search->search_features({-name=>"id:$fid"});
  684 + warn "dbid=$dbid, fid=$fid", scalar @$features;
  685 + return (200,'text/plain',"@$features");
  686 +}
  687 +
674 688 sub ACTION_reset_dsn {
675 689 my $self = shift;
676 690 $self->data_source->clear_cached_config();
5 lib/Bio/Graphics/Browser2/RenderPanels.pm
@@ -1190,10 +1190,11 @@ sub make_map {
1190 1190 foreach my $box (@$boxes){
1191 1191 my $feature = $box->[0];
1192 1192 next unless $feature->can('primary_tag');
1193   - my $id = eval {CGI::escape($feature->primary_id)} or next;
  1193 + my $id = eval {CGI::escape($feature->primary_id)} or next;
  1194 + my $dbid = eval {CGI::escape($feature->gbrowse_dbid)};
1194 1195 my %attributes = (
1195 1196 # onmouseover => "Controller.callback(this,'$id')",
1196   - onmousedown => "Controller.callback(this,'$id')",
  1197 + onmousedown => "Controller.callback(this,'$dbid','$id')",
1197 1198 style => 'cursor:pointer'
1198 1199 );
1199 1200 my $fname = eval {$feature->display_name} || eval{$box->[0]->name} || 'unnamed';

0 comments on commit 0405e24

Please sign in to comment.
Something went wrong with that request. Please try again.