GBrowse

 view release on metacpan or  search on metacpan

htdocs/js/snapshotManager.js  view on Meta::CPAN

		onFailure: function(transport) {
		    alert('failed');
		},
		on504: function() {
		    alert("GBrowse could not find the provided session or snapshot");
		}
	    });
	    location.href=location.href.substr(0,location.href.indexOf('?'));
	}
	
    },

    findParameter:
    function(param, search){
	if(search == null){
		// Searches the URL for the value of the parameter passed in
	   	search = window.location.search.substring(1);
	}
   	if(search.indexOf('&') > -1) {
      		var params = search.split('&');
      		for(var i = 0; i < params.length; i++) {
          		var key_value = params[i].split('=');
          		if(key_value[0] == param) return key_value[1];
      		}
   	} else {
      		var params = search.split('=');
      		if(params[0] == param) return params[1];
   	}
        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;
	}
 },

      /* this code has nothing to do with snapshots
       * but is instead a hack for xyplot overlays
       * disable it for now
 linkTrackLegend:
  function(){
	var subtrack_groups = $$('.subtrack_group');

	subtrack_groups.each(function(subtrack_group) {
		var subtracks = subtrack_group.childElements();
		if(subtracks.size() > 1){
		    subtracks.each(function(subtrack) {
			    var label = subtrack.down().down().innerHTML;
			    var track_div = subtrack.ancestors()[2];
			    var map = track_div.down('map');
			    areas = map.childElements()				 
				areas.each(function(area) {
					var href = area.readAttribute('href');
					href = href.replace(/;/g, "&");
					var param = Controller.findParameter('name', href);
					if(param == label){
					    subtrack.down().href = href.replace(/&/g, ";");
					    area.remove();
					    throw $break;
					}
				    });
			});
		}
	    });
  }
      */

});



( run in 0.687 second using v1.01-cache-2.11-cpan-600a1bdf6e4 )