Skip to content
Browse files

fix merge conflict

  • Loading branch information...
2 parents 9244cca + 879aa80 commit 788b8304f73adb58c264c25c1b400242d31e4b4d @lstein lstein committed Jul 18, 2011
View
11 htdocs/css/gbrowse_warm.css
@@ -147,3 +147,14 @@ BODY { background-color: #F7FBFF;
.public_even span.source_note {
color: #999999;
}
+.snapshot_button:hover {
+ border-color: #F0A040;
+ border-width: 2px;
+ border-style: solid;
+}
+.snapshot_icon:hover {
+ background-color: #F0A040;
+ border-width: 1px;
+ border-style: solid;
+ border-color: black;
+}
View
BIN htdocs/images/buttons/snap_mail.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN htdocs/images/buttons/snap_send.png
Deleted file not rendered
View
26 htdocs/js/controller.js
@@ -34,7 +34,6 @@ var search_form_objects_id = 'search_form_objects';
var userdata_table_id = 'userdata_table_div';
var custom_tracks_id = 'custom_tracks';
var community_tracks_id = 'community_tracks';
-// Allows you to update the snapshot table asynchronously %%
var snapshot_table_id = 'snapshots_page';
var GlobalDrag;
@@ -366,8 +365,11 @@ var GBrowseController = Class.create({
// Kick-off Render Methods ****************************************
update_coordinates:
- function (action) {
-
+ function (action, snapshot) {
+ if (snapshot == null){
+ snapshot = false;
+ }
+
// submit search form if the detail panel doesn't exist
if ( null == $(detail_container_id) ){
document.searchform.force_submit.value = 1;
@@ -395,7 +397,8 @@ var GBrowseController = Class.create({
action: 'navigate', // 'action' triggers an async call
navigate: action, // 'navigate' is an argument passed to the async routine
view_start: Math.round(TrackPan.get_start()),
- view_stop: Math.round(TrackPan.get_stop())
+ view_stop: Math.round(TrackPan.get_stop()),
+ snapshot: snapshot // Is true when a snapshot is being loaded, and false otherwise
},
onSuccess: function(transport) {
var results = transport.responseJSON;
@@ -445,8 +448,9 @@ var GBrowseController = Class.create({
}, // end update_coordinates
refresh_tracks:
- function () {
- Controller.update_coordinates('left 0');
+ function (snapshot) {
+ // The snapshot flag indicates that a snapshot is being loaded and refreshes the tracks accordingly
+ Controller.update_coordinates('left 0', snapshot);
}, // end refresh_tracks
scroll:
@@ -465,11 +469,11 @@ var GBrowseController = Class.create({
add_tracks:
function(track_names, onSuccessFunc, force, onTop) {
-
if (force == null)
force = false;
var request_str = "action=add_tracks";
var found_track = false;
+ track_names.reverse();
for (var i = 0; i < track_names.length; i++) {
var track_name = track_names[i];
@@ -478,11 +482,11 @@ var GBrowseController = Class.create({
found_track = true;
}
}
-
+ //track_names.reverse();
if (!found_track) return false;
this.busy();
-
+
new Ajax.Request(Controller.url, {
method: 'post',
parameters: request_str,
@@ -494,7 +498,9 @@ var GBrowseController = Class.create({
var track_keys = new Object();
var get_tracks = false;
- for (var ret_track_id in track_data) {
+ for (var i = 0; i < track_names.length; i++) {
+ var ret_track_id = track_names[i];
+
if (Controller.gbtracks.get(ret_track_id) != null)
continue; //oops already know this one
View
198 htdocs/js/snapshotManager.js
@@ -2,30 +2,7 @@
// *** Snapshot functions ***
GBrowseController.addMethods({
- hide_snapshot_prompt:
- function(){
- $('save_snapshot').hide();
- },
-
- submitWithEnter:
- function(e){
-
- var sessionName = document.getElementById('snapshot_name').value;
-
- // Store the value of the key entered
- if (!e) var e = window.event;
- if (e.keyCode) code = e.keyCode;
- else if (e.which) code = e.which;
-
- // If the user presses enter, the snapshot is saved
- if (code==13) {
- Controller.hide_snapshot_prompt();
-
- Controller.saveSnapshot('snapshot_name')
-
- }
- },
-
+
killSnapshot:
function(snapshot){
var snapshot_row = document.getElementById(snapshot);
@@ -44,20 +21,28 @@ GBrowseController.addMethods({
}});
// Removes the snapshot from the pages title if it was the last one set
- if($('snapshot_page_title').innerHTML == 'Current Snapshot : ' + snapshot){
- $('snapshot_page_title').innerHTML = 'Current Snapshot : ';
+ if($('snapshot_page_title').innerHTML == 'Snapshot : ' + snapshot){
+ $('snapshot_page_title').innerHTML = 'Snapshot : ';
$('snapshot_page_title').hide();
}
},
saveSnapshot:
- function(textFieldId){
-
- var sessionName = document.getElementById(textFieldId).value;
+ function(){
+ var sessionName = $('snapshot_name').value;
+ if(Controller.snapshotExists(sessionName)){
+ return;
+ }
// If a value was entered for the name of the snapshot then it is saved
- if(sessionName){
+ else if(sessionName){
+
+ $('busy_indicator').show();
+ $('snapshot_page_title').update('Saving Snapshot...');
+ $('snapshot_page_title').style.color = 'red';
+ $('snapshot_page_title').show();
+
// An asynchronous request is made to save a snapshot of the session
new Ajax.Request(document.URL, {
method: 'POST',
@@ -67,12 +52,6 @@ GBrowseController.addMethods({
name: sessionName,
}});
- // The page title is updated to reflect the current snapshot
- $('snapshot_page_title').innerHTML = 'Current Snapshot : ' + sessionName;
- $('snapshot_page_title').show();
-
- $('busy_indicator').show();
-
// A timer is used to ensure that the snapshot table is recreated only after the information has been updated
setTimeout(function(){
@@ -83,62 +62,74 @@ GBrowseController.addMethods({
// Another timeout is used to end the busy indicator after the table has been created
setTimeout(function(){
Sortable.create('snapshotTable',{tag:'div',only:'draggable'});
- $('busy_indicator').hide();
+ $('busy_indicator').hide();
+
+ // The page title is updated to reflect the current snapshot
+ //$('snapshot_page_title').update('Snapshot : ' + sessionName);
+ //$('snapshot_page_title').style.color = 'navy';
+ $('snapshot_page_title').hide();
},1500)
},2500)
+ } else {
+ alert("Please enter a name for the snapshot. The snapshot was not saved.");
}
},
-
+
setSnapshot:
function(sessionName){
+ $('busy_indicator').show();
+ $('snapshot_page_title').update('Loading Snapshot...');
+ $('snapshot_page_title').style.color = 'red';
+ $('snapshot_page_title').show();
+ var active = new Array();
+
// A request is made to update the current session
new Ajax.Request(document.URL, {
method: 'POST',
- asynchronous:false,
+ asynchronous:true,
parameters: {
action: 'set_session',
name: sessionName,
},
onSuccess: function(transport) {
+ // The array of selected tracks is stored
+ active = transport.responseJSON.toString();
+ active = active.split(",");
+
// The various sections of the browser affected when a session is changed are updated
var sections = new Array(track_listing_id, page_title_id, custom_tracks_id, community_tracks_id, search_form_objects_id, snapshot_table_id);
Controller.update_sections(sections);
}
});
-
- $('busy_indicator').show();
-
// A timeout is used to ensure that the sections are updated before further changes are made
setTimeout(function(){
Sortable.create('snapshotTable',{tag:'div',only:'draggable'});
// All the children of the tracks_panel are stored
var children = $A($("tracks_panel").descendants());
- var active_children = new Array();
// Each child that is active, is added to the active children array, and inactive children are removed from the track listing
children.each(function(child) {
var track_name = child.id.substring(0, (child.id.length - 6));
- if(child.className == 'track_title activeTrack'){
- active_children.push(track_name);
- }
- // All tracks are initially deleted (and unregistered)
- Controller.delete_track(track_name);
+ // All tracks are initially deleted (and unregistered)
+ Controller.delete_track(track_name);
});
// The tracks are added and browser is refreshed.
- Controller.add_tracks(active_children,function(){Controller.refresh_tracks();}, true);
+ Controller.add_tracks(active,function(){Controller.refresh_tracks(true);}, true);
- // The title is updated to reflect the new snapshot that has been set
- $('snapshot_page_title').innerHTML = 'Current Snapshot : ' + sessionName;
- $('snapshot_page_title').show();
-
// The busy indicator is removed after all actions have been completed
setTimeout(function(){
$('busy_indicator').hide();
+
+ // The title is updated to reflect the new snapshot that has been set
+ //$('snapshot_page_title').update('Snapshot : ' + sessionName);
+ //$('snapshot_page_title').style.color = 'navy';
+ Controller.select_tab('main_page')
+ $('snapshot_page_title').hide();
}, 2000)
},2000)
},
@@ -172,62 +163,25 @@ GBrowseController.addMethods({
asynchronous:true,
parameters: {
action: 'send_session',
- name: snapshot
+ name: snapshot,
+ url: document.location.href,
},
onSuccess: function(transport) {
// Upon success, the snapshot code is output to the user for copying
var results = transport.responseText;
- $('send_snapshot_url_' + snapshot).innerHTML = results;
+ $('send_snapshot_url_' + snapshot).update(results);
}
});
},
- loadSnapshot:
- function(){
-
- var load_name = $('load_snapshot_name').value;
- var load_snapshot = $('load_snapshot_code').value;
-
- $('load_snapshot').hide();
- $('busy_indicator').show();
-
- // An asynchronous request is made to add the snapshot to the current session
- new Ajax.Request(document.URL, {
- method: 'POST',
- asynchronous:true,
- parameters: {
- action: 'load_session',
- name: load_name,
- snapshot: load_snapshot,
- },
- onSuccess: function(transport) {
- // The loaded session is set to be the current session
- setSnapshot(load_name);
- $('busy_indicator').hide();
- }
- });
- },
-
- downSnapshot:
+ pushForward:
function(snapshot){
-
- $('busy_indicator').show();
-
- // An asynchronous request is made to retrieve the snapshot information
- new Ajax.Request(document.URL, {
- method: 'POST',
- asynchronous:true,
- parameters: {
- action: 'down_session',
- name: snapshot
- },
- onSuccess: function(transport) {
- // Upon success, the user can download the snapshot
- $('busy_indicator').hide();
- //window.open(/home/aelnaiem/Desktop/snapshot.txt, 'Download');
- }
- });
- },
+ var draggable = $$('.draggable');
+ draggable.each(function(drag){
+ drag.style.zIndex = 0;
+ })
+ $(snapshot).style.zIndex = 1000;
+ },
mailSnapshot:
function(snapshot){
@@ -250,17 +204,15 @@ GBrowseController.addMethods({
$('busy_indicator').hide();
}
});
-
-
},
checkSnapshot:
function(){
// The source, session, and snapshot information are stored
var browser_source = Controller.findParameter("source");
- var session = Controller.findParameter("session");
+ var session = Controller.findParameter("id");
var snapshot = Controller.findParameter("snapshot");
-
+
if(browser_source != null && session != null && snapshot != null){
// An asynchronous request loads the snapshot into the browser
new Ajax.Request(document.URL, {
@@ -269,12 +221,15 @@ GBrowseController.addMethods({
parameters: {
action: 'load_url',
name: snapshot,
- userid: session,
+ id: session,
browser_source: browser_source,
},
onSuccess: function(transport) {
$('busy_indicator').show();
Controller.setSnapshot(snapshot);
+ },
+ on504: function() {
+ alert("GBrowse could not find the provided session or snapshot");
}
});
}
@@ -296,7 +251,36 @@ GBrowseController.addMethods({
var params = search.split('=');
if(params[0] == param) return params[1];
}
- return null;
-}
+ return null;
+ },
+
+ enlarge_image:
+ function(image){
+ $('large_snapshot').setAttribute('src', image);
+ Box.prototype.greyout(true);
+ $('enlarge_image').show();
+ },
+
+ snapshotExists:
+ function(snapshot){
+ // If the snapshot exists, the user is prompted to see if they want to overwrite it
+ // False is returned if the snapshot does not exist or will be overwritten
+ var check = document.getElementById(snapshot);
+
+ if (check){
+ if(check.style.display == 'none'){
+ return false;
+ }
+ var choice = confirm('A snapshot with the same name has already been saved, would you like to overwrite it?');
+ if (choice){
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+
});
View
153 lib/Bio/Graphics/Browser2/Action.pm
@@ -79,8 +79,8 @@ sub ACTION_navigate {
my $view_start = $q->param('view_start');
my $view_stop = $q->param('view_stop');
-
- unless (!defined $view_start or $view_start eq 'NaN' or $view_stop eq 'NaN') {
+ my $snapshot = $q->param('snapshot');
+ unless (!defined $view_start or $view_start eq 'NaN' or $view_stop eq 'NaN' or $snapshot) {
$render->state->{view_start} = ($view_start && $view_start >= 0)? $view_start : $render->state->{view_start},
$render->state->{view_stop} = ($view_stop && $view_stop >= 0)? $view_stop : $render->state->{view_stop},
}
@@ -241,13 +241,14 @@ sub ACTION_add_tracks {
my $q = shift;
my $render = $self->render;
-
my @track_names = $q->param('track_names');
-
+
$render->init_database();
$render->init_plugins();
+
my $track_data = $render->add_tracks(\@track_names);
my $return_object = { track_data => $track_data, };
+
$self->session->flush;
return ( 200, 'application/json', $return_object );
}
@@ -336,12 +337,12 @@ sub ACTION_delete_session {
my $q = shift;
my $name = $q->param('name');
+ my $source = $self->data_source->name;
my $settings = $self->state;
-
- delete($settings->{snapshot_active});
- delete($settings->{current_session});
- my %snapshot = %{$settings};
- delete %snapshot->{snapshots}->{$name};
+ my $session = $self->session->session->{'_DATA'}->{$source};
+
+ my $snapshot = $session;
+ delete $snapshot->{snapshots}->{$name};
$self->session->flush;
@@ -351,99 +352,69 @@ sub ACTION_delete_session {
sub ACTION_save_session {
my $self = shift;
my $q = shift;
- my $name = $q->param('name');
-
+ my $name = $q->param('name');
+ my $source = $self->data_source->name;
my $settings = $self->state;
+ my $session = $self->session->session->{'_DATA'}->{$source};
+
my $imageURL = $self->render->image_link($settings);
-
- my $UTCtime = strftime("%Y-%m-%d %H:%M:%S\n", gmtime(time));
- $settings->{session_time}=$UTCtime;
- $settings->{image_url} = $imageURL;
+ my $UTCtime = strftime("%Y-%m-%d %H:%M:%S\n", gmtime(time));
# Creating a deep copy of the snapshot
my %snapshot = %{dclone $settings};
- $settings->{snapshots}->{$name} = \%snapshot;
- # Updating the snapshots hash
- $settings->{snapshots}->{$name}->{snapshots} = $settings->{snapshots};
+ $session->{snapshots}->{$name} = \%snapshot;
+ # Updating the snapshots hash
+ $session->{snapshots}->{$name}->{session_time}=$UTCtime;
+ $session->{snapshots}->{$name}->{image_url} = $imageURL;
+
$self->session->flush;
$self->ACTION_set_session($q);
-
+
return (204,'text/plain',undef);
}
sub ACTION_set_session {
my $self = shift;
my $q = shift;
my $name = $q->param('name');
+ my $source = $self->data_source->name;
my $settings = $self->state;
+ my $session = $self->session->session->{'_DATA'}->{$source};
- $settings->{snapshot_active} = 1;
- $settings->{current_session} = $name;
+# $settings->{current_session} = $name;
+
+ %{$settings} = %{dclone $session->{snapshots}->{$name}};
+ my @tracks = @{$settings->{tracks}};
- $settings->{snapshots}->{$name}->{snapshots} = $settings->{snapshots};
- $settings->{snapshots}->{$name}->{current_session} = $name;
- $settings->{snapshots}->{$name}->{snapshot_active} = 1;
- # Doing a deep copy of the selected snapshot
- $settings = dclone $settings->{snapshots}->{$name};
+ my @selected_tracks = ();
+ foreach (@tracks){
+ if ($settings->{features}->{$_}->{visible} == 1){
+ push(@selected_tracks, $_);
+ }
+ }
$self->session->flush;
-
- return(204,'text/plain',undef);
- }
-sub ACTION_send_session {
- my $self = shift;
- my $q = shift;
- my $name = $q->param('name');
- my $settings = $self->state;
-
- $Data::Dumper::Indent = 0;
- $Data::Dumper::Purity = 1;
- $Data::Dumper::Useqq = 1;
- # Storing the snapshot as a string
- my $snapshot = Dumper($settings->{snapshots}->{$name});
- return(200,'text/plain',$snapshot);
+ return(200,'application/json',\@selected_tracks);
}
-sub ACTION_down_session {
+sub ACTION_send_session {
my $self = shift;
my $q = shift;
my $name = $q->param('name');
- my $settings = $self->state;
-
- $Data::Dumper::Indent = 0;
- $Data::Dumper::Purity = 1;
- $Data::Dumper::Useqq = 1;
- #Storing the snapshot as a string and saving it to a textfile
- my $snapshot = Dumper($settings->{snapshots}->{$name});
- open SNAPSHOT, ">/home/aelnaiem/Desktop/$name.txt";
- print SNAPSHOT "$snapshot";
- close SNAPSHOT;
-
- return(204,'text/plain',undef);
- }
+ my $url = $q->param('url');
-sub ACTION_load_session {
- my $self = shift;
- my $q = shift;
- my $name = $q->param('name');
- my $snapshot_data = $q->param('snapshot');
- # The snapshot hash is created and saved to the session
- my $snap = eval "my $snapshot_data";
-
my $settings = $self->state;
- my $userid = $settings->{userid};
+ my $source = $settings->{source};
+ my $id = $self->session->uploadsid;
- my $UTCtime = strftime("%Y-%m-%d %H:%M:%S\n", gmtime(time));
- $snap->{session_time} = $UTCtime;
- $snap->{userid} = $userid;
-
- $settings->{snapshots}->{$name} = $snap;
- $settings->{snapshots}->{$name}->{snapshots} = $settings->{snapshots};
-
+ # The snapshot information is embedded into the URL
+ $url = "$url?id=$id&snapshot=$name&source=$source";
+ $url =~ s/ /%20/g;
$self->session->flush;
- return(204,'text/plain',undef);
+
+ return(200,'text/plain',$url);
}
sub ACTION_mail_session {
@@ -454,11 +425,12 @@ sub ACTION_mail_session {
my $url = $q->param('url');
my $settings = $self->state;
- my $userid = $settings->{userid};
my $source = $settings->{source};
+ my $id = $self->session->uploadsid;
+
# The snapshot information is embedded into the URL
- $url = "$url?source=$source&session=$userid&snapshot=$name;";
-
+ $url = "$url?id=$id&snapshot=$name&source=$source";
+ $url =~ s/ /%20/g;
my $globals = $self->render->globals;
my $subject = "Genome Browser Snapshot: $name";
@@ -481,27 +453,32 @@ sub ACTION_load_url {
my $q = shift;
my $source = $q->param('browser_source');
my $name = $q->param('name');
- my $from_userid = $q->param('userid');
-
+ $name =~ s/%20/ /g;
+ my $from_id = $q->param('id');
+
my $settings = $self->state;
my $userid = $settings->{userid};
# The snapshot is loaded from the global variable
my $globals = $self->render->globals;
- my $session = $globals->session($from_userid);
- my $snapshot = $session->{session}->{_DATA}->{$source}->{page_settings}->{'snapshots'}->{$name};
-
- my $UTCtime = strftime("%Y-%m-%d %H:%M:%S\n", gmtime(time));
- $snapshot->{session_time} = $UTCtime;
+ my $session = $globals->session($from_id);
+ my $snapshot = $session->{session}->{_DATA}->{$source}->{'snapshots'}->{$name};
- $snapshot->{userid} = $userid;
- # The snapshot is saved after updates to some of the information have been made
- $settings->{snapshots}->{$name} = $snapshot;
- $settings->{snapshots}->{$name}->{snapshots} = $settings->{snapshots};
+ if (!$snapshot || !$session){
+ return(504,'text/plain',undef);
+ } else {
- $self->session->flush;
+ my $UTCtime = strftime("%Y-%m-%d %H:%M:%S\n", gmtime(time));
+ $snapshot->{session_time} = $UTCtime;
+ $snapshot->{userid} = $userid;
+
+ # The snapshot is saved after updates to some of the information have been made
+ $self->session->session->{'_DATA'}->{$source}->{snapshots}->{$name} = $snapshot;
+
+ $self->session->flush;
- return(204,'text/plain',undef);
+ return(204,'text/plain',undef);
+ }
}
# END snapshot section
View
11 lib/Bio/Graphics/Browser2/Render.pm
@@ -553,7 +553,7 @@ sub add_tracks {
my $self = shift;
my $track_names = shift;
- warn "add_tracks(@$track_names)" if DEBUG;
+ warn "add_tracks(@$track_names)" if DEBUG;
my %track_data;
my $segment = $self->segment;
@@ -568,7 +568,6 @@ sub add_tracks {
$self->init_remote_sources if $remote;
if ($segment) {
-
foreach my $track_name ( @$track_names ) {
my @track_ids = $self->expand_track_names($track_name);
@@ -629,8 +628,7 @@ sub add_tracks {
};
}
}
- }
-
+ }
return \%track_data;
}
@@ -844,13 +842,12 @@ sub render_body {
}
my $tracks = $self->render_tracks_section;
+ my $saved_snapshots = $self->render_saved_snapshots_section;
my $community = $self->user_tracks->database? $self->render_community_tracks_section : "";
my $custom = $self->render_custom_tracks_section;
my $global_config = $self->render_global_config;
- # *** Initialize the snapshot change ***
- my $saved_snapshots = $self->render_saved_snapshots_section;
- $output .= $self->render_tabbed_pages($main_page,$tracks,$community,$custom,$global_config, $saved_snapshots);
+ $output .= $self->render_tabbed_pages($main_page,$tracks,$saved_snapshots,$community,$custom,$global_config);
$output .= $self->login_manager->render_confirm;
$output .= $self->render_bottom($features);
View
260 lib/Bio/Graphics/Browser2/Render/HTML.pm
@@ -95,36 +95,33 @@ sub render_login_required {
sub render_tabbed_pages {
my $self = shift;
# ***Add the title for the snapshots***
- my ($main_html,$tracks_html,$community_tracks_html,$custom_tracks_html,$settings_html,$snapshot_html) = @_;
+ my ($main_html,$tracks_html,$snapshot_html,$community_tracks_html,$custom_tracks_html,$settings_html) = @_;
my $uses_database = $self->user_tracks->database;
my $main_title = $self->translate('MAIN_PAGE');
my $tracks_title = $self->translate('SELECT_TRACKS');
+ my $snapshot_title = $self->translate('SNAPSHOT_SELECT');
my $community_tracks_title = $self->translate('COMMUNITY_TRACKS_PAGE') if $uses_database;
my $custom_tracks_title = $self->translate('CUSTOM_TRACKS_PAGE');
my $settings_title = $self->translate('SETTINGS_PAGE');
- # *** Snapshot title ***
- my $snapshot_title = $self->translate('SNAPSHOT_SELECT');
+
my $html = '';
$html .= div({-id=>'tabbed_section', -class=>'tabbed'},
div({-id=>'tabbed_menu',-class=>'tabmenu'},
span({id=>'main_page_select'}, $main_title),
span({id=>'track_page_select'}, $tracks_title),
+ span({id=>'saved_snapshots_page_select'}, $snapshot_title),
$uses_database? span({id=>'community_tracks_page_select'}, $community_tracks_title) : "",
- span({id=>'custom_tracks_page_select'}, $custom_tracks_title),
- span({id=>'settings_page_select'}, $settings_title),
- # *** Snapshot span ***
- span({id=>'saved_snapshots_page_select'}, $snapshot_title),
+ span({id=>'custom_tracks_page_select'}, $custom_tracks_title),,
+ span({id=>'settings_page_select'}, $settings_title)
),
div({-id=>'main_page', -class=>'tabbody'}, $main_html),
div({-id=>'track_page', -class=>'tabbody'}, $tracks_html),
+ div({-id=>'saved_snapshots_page', -class=>'tabbody'}, $snapshot_html),
$uses_database?div({-id=>'community_tracks_page',-class=>'tabbody'}, $community_tracks_html) : "",
div({-id=>'custom_tracks_page', -class=>'tabbody'}, $custom_tracks_html),
div({-id=>'settings_page', -class=>'tabbody'}, $settings_html),
- # *** Snapshot div ***
-
- div({-id=>'saved_snapshots_page', -class=>'tabbody'}, $snapshot_html),
);
return $html;
@@ -169,8 +166,7 @@ sub render_navbar {
my $settings = $self->state;
my $source = '/'.$self->session->source.'/';
- # *** Added button to close the snapshot div ***
- my $close = $self->translate('CLOSE');
+
my $searchform = join '',(
start_form(
-name => 'searchform',
@@ -190,22 +186,29 @@ sub render_navbar {
my $plugin_form = div({-id=>'plugin_form'},$self->plugin_form());
# *** Checks the state to see if a snapshot is active and assigns it ***
- my $isSnapshotActive = $settings->{snapshot_active};
+ #my $isSnapshotActive = $settings->{snapshot_active};
my $source_form = div({-id=>'source_form'},$self->source_form());
# *** Creates a variable to store the snapshot form ***
my $snapshot_form = div({-id=>'snapshot_form'},$self->snapshot_form());
my $sliderform = div({-id=>'slider_form'},$self->sliderform($segment));
-# *** Creates the save session button and assigns it to save_prompt ***
-my $saveSessionButton = div({-id=>'unsessionbutton', -style=>"position:absolute; right:67px; top: 160px"},$self->render_select_saveSession());
-my $saveSessionStyle = "position:absolute;right:20px;top:185px;width:200px;height:45px;background-color:#B4CDCD;z-index:1; border-style:solid;display:none;";
-my $save_prompt = div({-id => 'save_snapshot',-style=>"$saveSessionStyle"},
+ # *** Creates the save session button and assigns it to save_prompt ***
+ my $saveSessionButton = div({-id=>'unsessionbutton', -style=>"position:absolute; right:67px; top: 145px; width: 100px;"},$self->render_select_saveSession());
+ my $restoreSessionButton = div({-id=>'loadbutton', -style=>"position:absolute; right:67px; top: 175px; width: 100px;"},$self->render_select_loadSession());
+ my $saveSessionStyle = "position:absolute;right:20px;top:185px;width:184px;height:50px;background:whitesmoke;z-index:1; border:2px solid gray;display:none; padding: 5px;";
+ my $save_prompt = div({-id => 'save_snapshot',-style=>"$saveSessionStyle"},
$snapshot_form,
- a({-href=>'#', -onClick=>"Controller.hide_snapshot_prompt()", -style=>"position:relative;top:2px"},$close)
- );
-
-
+ input({ -type => "button",
+ -name => "Save",
+ -value => "Save",
+ -onclick => '$(\'save_snapshot\').hide(); this.style.zIndex = \'0\'; Controller.saveSnapshot();',
+ -style => 'margin-left:35px;',}),
+ input({ -type => "button",
+ -name => "Cancel",
+ -value => "Cancel",
+ -onclick => '$(\'save_snapshot\').hide(); this.style.zIndex = \'0\'',}),
+ ),;
return $self->toggle('Search',
div({-class=>'searchbody'},
@@ -223,6 +226,7 @@ my $save_prompt = div({-id => 'save_snapshot',-style=>"$saveSessionStyle"},
# *** Makes the save session button and prompt toggle
$saveSessionButton,
$save_prompt,
+ $restoreSessionButton,
$self->html_frag('html3',$self->state)
)
)
@@ -270,10 +274,11 @@ sub snapshot_form {
-type => "text",
-name => "snapshot_name",
-id => "snapshot_name",
- -onKeyPress=>"Controller.submitWithEnter(event);",
-style => "width:180px",
+ -maxlength => "50",
-value => $self->translate('SNAPSHOT_FORM'),
- -onClick => "this.value='';"}),
+ -onDblclick => "this.value='';"
+ }),
);
}
@@ -339,11 +344,13 @@ sub render_html_head {
my ($dsn,$title,@other_initialization) = @_;
my @plugin_list = $self->plugins->plugins;
my $uses_database = $self->user_tracks->database;
- # *** Store the snapshot session information in variables ***
- my $settings = $self->state;
- my $snapshotSessions = $settings->{snapshots};
- my @snapshotNames = keys %$snapshotSessions;
- my $snapshotsString = join(',',@snapshotNames);
+
+ # *** Store the snapshot session information in variables *** Not sure why Sonu did this...
+ #my $source = $self->data_source->name;
+ #my $session = $self->session->session->{'_DATA'}->{$source};
+ #my $snapshotSessions = $session->{snapshots};
+ #my @snapshotNames = keys %$snapshotSessions;
+ #my $snapshotsString = join(',',@snapshotNames);
return if $self->{started_html}++;
@@ -677,17 +684,17 @@ sub render_title {
: '';
}
-# *** Function to render the snapshot title ***
+# *** Function to render the snapshot title. This is not used ***
sub render_snapshotTitle {
my $self = shift;
my $error = shift;
my $currentSnapshot = $self->translate('CURRENT_SNAPSHOT');
my $settings = $self->state;
- my $title = ($settings->{snapshot_active}) ? $settings->{current_session} : " ";
+
if ($settings->{snapshot_active}){
- return h1({-id=>'snapshot_page_title',-class=>'normal'},"Current Snapshot : $title");
+ return h1({-id=>'snapshot_page_title',-class=>'normal'},"");
}else{
- return h1({-id=>'snapshot_page_title',-class=>'normal', -style=>'display: none;'},"Current Snapshot : $title");}
+ return h1({-id=>'snapshot_page_title',-class=>'normal', -style=>'display: none;'},"");}
}
# Renders the search & navigation instructions & examples.
@@ -1128,15 +1135,21 @@ sub render_select_clear_link {
# *** Render the save session button ***
sub render_select_saveSession {
my $self = shift;
-my $title = 'Save Session';
+my $title = 'Save Snapshot';
return button({-name=>$title,
- -onClick => "Effect.Appear('save_snapshot');",
-
-#
-# "Controller.update_section('range');"
- },
-
+ -onClick => '$(\'save_snapshot\').show(); $(\'snapshot_name\').select();',
+ },
+ );
+}
+
+sub render_select_loadSession {
+my $self = shift;
+my $title = 'Load Snapshot';
+
+ return button({-name=>$title,
+ -onClick => "Controller.select_tab('saved_snapshots_page');",
+ },
);
}
@@ -1241,175 +1254,6 @@ sub userdata_upload {
return $html;
}
-
-# *** Render saved snapshots listing ***
-sub render_saved_snapshots_listing{
- my $self = shift;
- my $settings = $self->state;
- my $snapshots = $settings->{snapshots};
- my @snapshot_keys = keys %$snapshots;
- my @sortedSnapshots = sort @snapshot_keys;
- my $imageURL;
- my $base;
- my $s;
- my $timeStamp;
- my $buttons = $self->data_source->globals->button_url;
- my $deleteSnapshotPath = "$buttons/snap_ex.png";
- my $setSnapshotPath = "$buttons/snap_check.png";
- my $sendSnapshotPath = "$buttons/snap_send.png";
- my $downSnapshotPath = "$buttons/snap_down.png";
- my $mailSnapshotPath = "$buttons/snap_mail.png";
- my $nameHeading = $self->translate('SNAPSHOT_FORM');
- my $timeStampHeading = $self->translate('TIMESTAMP');
- my $escapedKey;
-
-# creating the snapshot banner with the load and upload sections
- my $html = div({-id => "Snapshot_banner",},
- h2({-style => "position:relative;display: inline-block; margin-right: 1em;"}, $self->translate('SNAPSHOT_SELECT')),
- input({-type => "button", -name => "LoadSnapshot", -value => "Load Snapshot", -onclick => '$(\'load_snapshot\').show()',}),
- div(
- {-id =>"load_snapshot",
- -style => 'background-color:whiteSmoke; border-width:2px; border-style:solid; border-color:gray; position:absolute;left:200px; width:620px; z-index:1000000; display:none; padding:5px;'},
- div(
- {-id => "load_snapshot_contents",
- -style => 'color:black; font-family:sans-serif; font-size: 11pt; margin-top:5px;overflow-x: auto; overflow-y: auto;',},
- h1({-id => "load_snapshot_header",},"Load Snapshot"),
- p({-id => "load_snapshot_message",}, "Provide a name and insert the code for the snapshot to be loaded below:",
- input({-type => "text", -id => "load_snapshot_name", -value =>"Snapshot Name", -style => 'margin:10px; margin-left:0px;', -onclick => 'this.value = \'\'',},),
- textarea({-id => "load_snapshot_code", -style => 'width:605px; height:120px; padding:5px; border-color:gray;',},"",),),
- input({ -type => "button",
- -name => "Load",
- -value => "Load",
- -onclick => 'Controller.loadSnapshot()',}),
- input({ -type => "button",
- -name => "Cancel",
- -value => "Cancel",
- -onclick => '$(\'load_snapshot\').hide()',}),
- ),
- ),
- start_form({-enctype => "multipart/form", -method=>"post", -action=>"gbrowse_upload.pl",}),
- input({-type => "file", -name => "UpSnapshot", -value => "Upload Snapshot", -accept => "text/plain",}),
- input({-type => "submit", -name => "UploadSnapshot", -value => "Upload Snapshot",}),end_form(),
- );
-
-$html .= div({-id=>'headingRow',-style=>"height:30px;width:501px;background-color:#F0E68C"},
- h1({-style => "position:relative; left:3em; margin-right: 1em; width:180px"},$nameHeading),
- h1({-style => " position:relative; left:235px;bottom:30px;margin-right: 1em;"},$timeStampHeading),
- );
-$html.= qq(<div id = "snapshotTable">);
- for my $keys(@sortedSnapshots) {
- if($keys){
- $timeStamp = $snapshots->{$keys}->{session_time};
- $imageURL = $snapshots->{$keys}->{image_url};
- ($base,$s) = $self->globals->gbrowse_base;
- $escapedKey = $keys;
- $escapedKey =~ s/(['"])/\\$1/g;
- warn "time = $timeStamp" if DEBUG;
-# Creating the snapshots table with all the snapshot features
-if($keys ne " " || ""){
- $html .=
-
-
- div({
- -class=>"draggable",
- -id=>$keys || 'snapshotname',
- -style=> "padding-left:1em;width:485px;height:35px;border-style:solid;border-width:1px;border-color:#F0E68C; background-color:#FFF8DC; cursor: move;font-size:14px;position:relative;"},
- span({-id=>"set_${keys}"}, img({ -src => $setSnapshotPath,
- -id => "set",
- -onClick => "Controller.setSnapshot('$escapedKey')",
- -style => 'cursor:pointer;margin-top:10px',
-
- },
- )
- ),
- span({-id=>"kill_${keys}"}, img({ -src => $deleteSnapshotPath,
- -id => "kill",
- -onClick => "Controller.killSnapshot('$escapedKey')",
- -style => 'cursor:pointer;margin-top:10px',
-
- },
- )
- ),
- span({-id=>"send_${keys}"}, img({ -src => $sendSnapshotPath,
- -id => "send",
- -onClick => "Controller.sendSnapshot('$escapedKey')",
- -style => 'cursor:pointer;margin-top:10px',
-
- },
- )
- ),
- span({-id=>"down_${keys}"}, img({ -src => $downSnapshotPath,
- -id => "down",
- -onClick => "Controller.downSnapshot('$escapedKey')",
- -style => 'cursor:pointer;margin-top:10px',
-
- },
- )
- ),
- span({-id=>"mail_${keys}"}, img({ -src => $mailSnapshotPath,
- -id => "mail",
- -onClick => '$(\'' . "mail_snapshot_${keys}" . '\').show()',
- -style => 'cursor:pointer;margin-top:10px',
-
- },
- )
- ),
-
- div(
- {-id =>"send_snapshot_${keys}",
- -class =>"send_snapshot",
- -style => 'background-color:whiteSmoke; border-width:2px; border-style:solid; border-color:gray; position:absolute;left:200px; width:620px; z-index:1000000; display:none; padding:5px;'},
- div(
- {-id => "send_snapshot_contents",
- -style => 'color:black; font-family:sans-serif; font-size: 11pt; margin-top:5px;overflow-x: auto; overflow-y: auto;',},
- h1({-id => "snapshot_header_${keys}",},"Send Snapshot: ${keys}"),
- p({-id => "snapshot_message_${keys}",}, "To send this snapshot, use the following: ",),
- textarea({-id => "send_snapshot_url_${keys}", -style => 'width:605px; height:120px; padding:5px; border-color:gray;',},"",),
- input({ -type => "button",
- -name => "OK",
- -value => "OK",
- -onclick => '$(\'' . "send_snapshot_${keys}" . '\').hide(); this.style.zIndex = \'0\'',}),
- ),
- ),
-
- div(
- {-id =>"mail_snapshot_${keys}",
- -class =>"mail_snapshot",
- -style => 'background-color:whiteSmoke; border-width:2px; border-style:solid; border-color:gray; position:absolute;left:200px; width:420px; z-index:1000000; display:none; padding:5px;'},
- div(
- {-id => "mail_snapshot_contents",
- -style => 'color:black; font-family:sans-serif; font-size: 11pt; margin-top:5px;overflow-x: auto; overflow-y: auto;',},
- h1({-id => "mail_snap_header_${keys}",},"Mail Snapshot: ${keys}"),
- p({-id => "mail_snap_message_${keys}",}, "Enter the email of the person you wish to send the snapshot to: ",),
- input({-type => "text", -id => "email_${keys}", -style => 'width:280px; border-color:gray;',},"",),
- input({ -type => "button",
- -name => "Mail",
- -value => "Send",
- -onclick => "Controller.mailSnapshot('$escapedKey')",}),
- input({ -type => "button",
- -name => "Cancel",
- -value => "Cancel",
- -onclick => '$(\'' . "mail_snapshot_${keys}" . '\').hide(); this.style.zIndex = \'0\'',}),
- ),
- ),
-
-
- span({-style=>"width:230px;"},
- span({-class => "snapshot_names", -style=>"margin-top:10px; margin-left: 10px;"}, $keys)),
- span({-class => "timestamps",-style=>"width:230px;position:absolute;left:235px;bottom:7px;margin-top:10px;font-size:14px"},$timeStamp,
- img({-src => $imageURL, -width=>"50",-height=>"30", -style=>"position:absolute;left:180px;top:-8px;",
--onmouseover => 'this.style.width=\'650px\'; this.style.height=\'auto\'; this.style.zIndex=\'1000\';',
--onmouseout => 'this.style.width=\'50px\'; this.style.height=\'30px\'; this.style.zIndex=\'0\';'},),) ),
-
- }
-
- }
- }
-
-$html .= qq(</div>);
- return $html;
-}
-
# Render Community Track Listing - Returns the HTML listing of public tracks available to a user.
sub render_community_track_listing {
my $self = shift;
View
133 lib/Bio/Graphics/Browser2/Render/SnapshotManager.pm
@@ -24,56 +24,62 @@ use constant HAVE_SVG => eval "require GD::SVG; 1";
sub render_saved_snapshots_listing{
my $self = shift;
+ my $source = $self->data_source->name;
my $settings = $self->state;
- my $snapshots = $settings->{snapshots};
+ my $session = $self->session->session->{'_DATA'}->{$source};
+ my $snapshots = $session->{snapshots};
my @snapshot_keys = keys %$snapshots;
my @sortedSnapshots = sort @snapshot_keys;
my $imageURL;
my $base;
my $s;
my $timeStamp;
my $buttons = $self->data_source->globals->button_url;
- my $deleteSnapshotPath = "$buttons/snap_ex.png";
- my $setSnapshotPath = "$buttons/snap_check.png";
- my $sendSnapshotPath = "$buttons/snap_send.png";
- my $downSnapshotPath = "$buttons/snap_down.png";
+ my $deleteSnapshotPath = "$buttons/snap_trash.png";
+ #my $setSnapshotPath = "$buttons/snap_check.png";
+ my $sendSnapshotPath = "$buttons/snap_share.png";
my $mailSnapshotPath = "$buttons/snap_mail.png";
+ my $closeImage = "$buttons/ex.png";
my $nameHeading = $self->translate('SNAPSHOT_FORM');
my $timeStampHeading = $self->translate('TIMESTAMP');
+ my $url = $self->globals->gbrowse_url();
my $escapedKey;
-# creating the snapshot banner with the load and upload sections
+# creating the snapshot banner
my $html = div({-id => "Snapshot_banner",},
- h2({-style => "position:relative;display: inline-block; margin-right: 1em;"}, $self->translate('SNAPSHOT_SELECT')),
- input({-type => "button", -name => "LoadSnapshot", -value => "Load Snapshot", -onclick => '$(\'load_snapshot\').show()',}),
- div(
- {-id =>"load_snapshot",
- -style => 'background-color:whiteSmoke; border-width:2px; border-style:solid; border-color:gray; position:absolute;left:200px; width:620px; z-index:1000000; display:none; padding:5px;'},
- div(
- {-id => "load_snapshot_contents",
- -style => 'color:black; font-family:sans-serif; font-size: 11pt; margin-top:5px;overflow-x: auto; overflow-y: auto;',},
- h1({-id => "load_snapshot_header",},"Load Snapshot"),
- p({-id => "load_snapshot_message",}, "Provide a name and insert the code for the snapshot to be loaded below:",
- input({-type => "text", -id => "load_snapshot_name", -value =>"Snapshot Name", -style => 'margin:10px; margin-left:0px;', -onclick => 'this.value = \'\'',},),
- textarea({-id => "load_snapshot_code", -style => 'width:605px; height:120px; padding:5px; border-color:gray;',},"",),),
- input({ -type => "button",
- -name => "Load",
- -value => "Load",
- -onclick => 'Controller.loadSnapshot()',}),
- input({ -type => "button",
- -name => "Cancel",
- -value => "Cancel",
- -onclick => '$(\'load_snapshot\').hide()',}),
- ),
- ),
- start_form({-enctype => "multipart/form", -method=>"post", -action=>"gbrowse_upload.pl",}),
- input({-type => "file", -name => "UpSnapshot", -value => "Upload Snapshot", -accept => "text/plain",}),
- input({-type => "submit", -name => "UploadSnapshot", -value => "Upload Snapshot",}),end_form(),
- );
+ h1({-style => "position:relative;display: inline-block; margin-right: 1em;"}, $self->translate('SNAPSHOT_SELECT')),
+ input({-type => "button", -name => "Save Snapshot", -value => "Save Snapshot", -onClick => '$(\'save_snapshot_2\').show(); $(\'snapshot_name_2\').select();',}),
+ div({-id => 'save_snapshot_2',-style => "width:184px;height:50px;background:whitesmoke;z-index:1; border:2px solid gray;display:none; padding: 5px; position: absolute; left: 140px; z-index: 1000000;"},
+ div({
+ -id=>'snapshot_form_2',},
+ input({
+ -type => "text",
+ -name => "snapshot_name",
+ -id => "snapshot_name_2",
+ -style => "width:180px",
+ -maxlength => "50",
+ -value => $self->translate('SNAPSHOT_FORM'),
+ -onDblclick => "this.value='';"
+ }),
+ input({ -type => "button",
+ -name => "Save",
+ -value => "Save",
+ -onclick => '$(\'save_snapshot_2\').hide(); this.style.zIndex = \'0\'; Controller.saveSnapshot();',
+ -style => 'margin-left:35px;',}),
+ input({ -type => "button",
+ -name => "Cancel",
+ -value => "Cancel",
+ -onclick => '$(\'save_snapshot_2\').hide(); this.style.zIndex = \'0\'',}),
+ ),),
+ div({-id => "enlarge_image",
+ -style => 'display: none; position:absolute; left: 155px; top:100px; width: 800px; border: #F0E68C; z-index: 10000;'},
+ img({-style => 'cursor:pointer;', -onclick=> '$(\'enlarge_image\').hide(); Box.prototype.greyout(false);', -src => "$closeImage"},),
+ img({-id => 'large_snapshot', -src => '', -width=>'1000', -height => 'auto'},),),
+ );
-$html .= div({-id=>'headingRow',-style=>"height:30px;width:501px;background-color:#F0E68C"},
- h1({-style => "position:relative; left:3em; margin-right: 1em; width:180px"},$nameHeading),
- h1({-style => " position:relative; left:235px;bottom:30px;margin-right: 1em;"},$timeStampHeading),
+$html .= div({-id=>'headingRow',-style=>"height:20px;background-color:#F0E68C"},
+ h1({-style => "position:relative; left:100px; margin-right: 1em; width:180px"},$nameHeading),
+ h1({-style => " position:relative; left:550px;bottom:30px;margin-right: 1em;"},$timeStampHeading),
);
$html.= qq(<div id = "snapshotTable">);
for my $keys(@sortedSnapshots) {
@@ -88,62 +94,59 @@ $html.= qq(<div id = "snapshotTable">);
if($keys ne " " || ""){
$html .=
-
div({
-class=>"draggable",
-id=>$keys || 'snapshotname',
- -style=> "padding-left:1em;width:485px;height:35px;border-style:solid;border-width:1px;border-color:#F0E68C; background-color:#FFF8DC; cursor: move;font-size:14px;position:relative;"},
- span({-id=>"set_${keys}"}, img({ -src => $setSnapshotPath,
- -id => "set",
+ -style=> "padding-left:1em;height:35px;border-style:solid;border-width:1px;border-color:#F0E68C; background-color:#FFF8DC; cursor: move;font-size:14px;position:relative;",},
+ span({-id=>"set_${keys}"}, input({ -type => "button",
+ -class => "snapshot_button",
+ -name => "set",
+ -value => "Load",
-onClick => "Controller.setSnapshot('$escapedKey')",
-style => 'cursor:pointer;margin-top:10px',
-
},
)
),
span({-id=>"kill_${keys}"}, img({ -src => $deleteSnapshotPath,
-id => "kill",
-onClick => "Controller.killSnapshot('$escapedKey')",
-style => 'cursor:pointer;margin-top:10px',
-
+ -title => 'Delete',
+ -class => 'snapshot_icon',
},
)
),
span({-id=>"send_${keys}"}, img({ -src => $sendSnapshotPath,
-id => "send",
-onClick => "Controller.sendSnapshot('$escapedKey')",
-style => 'cursor:pointer;margin-top:10px',
-
- },
- )
- ),
- span({-id=>"down_${keys}"}, img({ -src => $downSnapshotPath,
- -id => "down",
- -onClick => "Controller.downSnapshot('$escapedKey')",
- -style => 'cursor:pointer;margin-top:10px',
-
+ -title => 'Share',
+ -class => 'snapshot_icon',
},
)
),
span({-id=>"mail_${keys}"}, img({ -src => $mailSnapshotPath,
-id => "mail",
- -onClick => '$(\'' . "mail_snapshot_${keys}" . '\').show()',
+ -onClick => '$(\'' . "mail_snapshot_${keys}" . '\').show();'
+ . "Controller.pushForward('$escapedKey')",
-style => 'cursor:pointer;margin-top:10px',
-
+ -title => 'Email',
+ -class => 'snapshot_icon',
},
)
),
div(
{-id =>"send_snapshot_${keys}",
-class =>"send_snapshot",
- -style => 'background-color:whiteSmoke; border-width:2px; border-style:solid; border-color:gray; position:absolute;left:200px; width:620px; z-index:1000000; display:none; padding:5px;'},
+ -style => 'background-color:whiteSmoke; border-width:2px; border-style:solid; border-color:gray; position:absolute;left:200px; width:800px; z-index:1000000; display:none; padding:5px;'},
div(
{-id => "send_snapshot_contents",
-style => 'color:black; font-family:sans-serif; font-size: 11pt; margin-top:5px;overflow-x: auto; overflow-y: auto;',},
- h1({-id => "snapshot_header_${keys}",},"Send Snapshot: ${keys}"),
- p({-id => "snapshot_message_${keys}",}, "To send this snapshot, use the following: ",),
- textarea({-id => "send_snapshot_url_${keys}", -style => 'width:605px; height:120px; padding:5px; border-color:gray;',},"",),
+ div({-style => "border-bottom-style: solid; border-width: 1px; padding-left: 3px; width: 795px;"},
+ b({-id => "snapshot_header_${keys}",},"Send Snapshot: ${keys}"),),
+ p({-id => "snapshot_message_${keys}", -style => "font-size: small;",}, "To open this snapshot, use the following link: ",),
+ textarea({-id => "send_snapshot_url_${keys}", -style => 'width:785px; padding:5px; border-color:gray;',},"",),
input({ -type => "button",
-name => "OK",
-value => "OK",
@@ -158,9 +161,10 @@ if($keys ne " " || ""){
div(
{-id => "mail_snapshot_contents",
-style => 'color:black; font-family:sans-serif; font-size: 11pt; margin-top:5px;overflow-x: auto; overflow-y: auto;',},
- h1({-id => "mail_snap_header_${keys}",},"Mail Snapshot: ${keys}"),
- p({-id => "mail_snap_message_${keys}",}, "Enter the email of the person you wish to send the snapshot to: ",),
- input({-type => "text", -id => "email_${keys}", -style => 'width:280px; border-color:gray;',},"",),
+ div({-style => "border-bottom-style: solid; border-width: 1px; padding-left: 3px; width: 415px;"},
+ b({-id => "mail_snap_header_${keys}",},"Mail Snapshot: ${keys}"),),
+ p({-id => "mail_snap_message_${keys}", -style => "font-size: small;",}, "Enter the email of the person you wish to send the snapshot to: ",),
+ input({-type => "text", -id => "email_${keys}", -style => 'width:280px;',},"",),
input({ -type => "button",
-name => "Mail",
-value => "Send",
@@ -172,14 +176,13 @@ if($keys ne " " || ""){
),
),
-
span({-style=>"width:230px;"},
span({-class => "snapshot_names", -style=>"margin-top:10px; margin-left: 10px;"}, $keys)),
- span({-class => "timestamps",-style=>"width:230px;position:absolute;left:235px;bottom:7px;margin-top:10px;font-size:14px"},$timeStamp,
- img({-src => $imageURL, -width=>"50",-height=>"30", -style=>"position:absolute;left:180px;top:-8px;",
--onmouseover => 'this.style.width=\'650px\'; this.style.height=\'auto\'; this.style.zIndex=\'1000\';',
--onmouseout => 'this.style.width=\'50px\'; this.style.height=\'30px\'; this.style.zIndex=\'0\';'},),) ),
-
+ span({-class => "timestamps",-style=>"width:230px;position:absolute;left:550px;bottom:7px;margin-top:10px;font-size:14px"},$timeStamp,
+ img({-src => $imageURL, -width=>"50",-height=>"30", -style=>"position:absolute;left:180px;top:-8px;cursor:pointer;",
+-onclick => 'Controller.enlarge_image(' . "\'${imageURL}\'" . ');',
+-onmouseover => 'this.style.width=\'550px\'; this.style.height=\'auto\';' . "Controller.pushForward('$escapedKey');" . 'this.style.zIndex=\'1000\';',
+-onmouseout => 'this.style.width=\'50px\'; this.style.height=\'30px\'; this.style.zIndex=\'0\';'},),), ),
}
}
View
16 lib/Bio/Graphics/Browser2/Session.pm
@@ -372,18 +372,18 @@ sub config_hash {
my $session = $self->{session};
# *** Initialize the snapshot session data ***
my $settings =$session->{_DATA}->{$source}->{page_settings};
- my $snapshotName = $settings->{current_session};
- my $isSnapshotActive = 0;
- my $currentSnapshot = 0;
+# my $snapshotName = $settings->{current_session};
+# my $isSnapshotActive = 0;
+# my $currentSnapshot = 0;
# *** If there is a snapshot, activate it ***
-if ($snapshotName){
- $currentSnapshot = $settings->{snapshots}->{$snapshotName};
- $isSnapshotActive = $settings->{snapshot_active};
+#if ($snapshotName){
+# $currentSnapshot = $settings->{snapshots}->{$snapshotName};
+# $isSnapshotActive = $settings->{snapshot_active};
-}
+#}
# *** Change the settings based on the active snapshot ***
-$settings = ($isSnapshotActive) ? $currentSnapshot : $settings;
+#$settings = ($isSnapshotActive) ? $currentSnapshot : $settings;
# warn "active = $isSnapshotActive";
$session->{_DATA}->{$source}->{page_settings} = $settings;

0 comments on commit 788b830

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