Skip to content

Instantly share code, notes, and snippets.

@ericabouaf
Created March 12, 2010 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericabouaf/330362 to your computer and use it in GitHub Desktop.
Save ericabouaf/330362 to your computer and use it in GitHub Desktop.
/**
* Set up the inline importer
*/
Exhibit.InlineImporter = { };
Exhibit.importers["inline"]
= Exhibit.InlineImporter;
Exhibit.InlineImporter.load
= function(data, database, cont) {
Exhibit.UI.showBusyIndicator();
database.loadData(data);
Exhibit.UI.hideBusyIndicator();
if (cont) cont();
};
$(document).ready(function(){
$("#probes").focus();
$('#geneSearchResults').hide();
$('#geneSearchFilters').hide();
});
/**
* Set up ajax call and inject data into Exhibit view
*/
Exhibit.UI.showBusyIndicator();
$.getJSON(url,
{mode: 'text', obj: 'probes', probes: probes},
function(data, status){
$('#geneSearchResults').hide();
$('#geneSearchFilters').hide();
// clear the whole database
window.database.removeAllStatements();
if(data.items.length>0){
Exhibit.InlineImporter
.load(data, window.database, "");
}else{
alert("No data")
}
Exhibit.UI.hideBusyIndicator();
$('#geneSearchFilters').show();
$('#geneSearchResults').show();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment