Created
March 12, 2010 14:38
-
-
Save ericabouaf/330362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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