Commit f97c5434 authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

index.hml

add box to search by taxid

modify views by_replicon_taxid map to emit data nneede to display the tooltip in results
parent 1c0608ac
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
</select> </select>
<button type="button" id="nameButton">search by name</button> <button type="button" id="nameButton">search by name</button>
</fieldset> </fieldset>
<fieldset>
<label for="taxidSearch">by replicon taxon id (ex:155864)</label>
<input type="text" name="taxidSearch" id="taxidInput"/>
<button type="button" id="taxidButton">search by taxid</button>
</fieldset>
</form> </form>
</div> </div>
<div id="results"> <div id="results">
...@@ -62,11 +67,15 @@ $(".tooltip" , "#results").live('mouseenter', function(){ ...@@ -62,11 +67,15 @@ $(".tooltip" , "#results").live('mouseenter', function(){
get_results( 'by_replicon_name', $.param(params)); get_results( 'by_replicon_name', $.param(params));
}); });
$("#taxidButton").click( function(){
var params = {limit:45+1};
var key= $("#taxidInput").attr("value");
if( key ){ params.key=key}
get_results( 'by_replicon_taxid', $.param(params));
});
$("#paginate .nav_page").live( 'click', function(){ $("#paginate .nav_page").live( 'click', function(){
console.log('paginate click' );
var url = $(this).attr('data-href'); var url = $(this).attr('data-href');
console.log("url="+url);
$("#results").load( url ); $("#results").load( url );
}); });
......
function(doc) { function(doc) {
emit(doc.replicon.taxid, doc._id); emit(doc.replicon.taxid, {
"id" : doc._id,
"code" : doc.code ,
"name" : doc.replicon.name ,
"T3SS_family" : doc.T3SS_family,
"taxid" : doc.replicon.taxid,
"strain" : doc.replicon.strain ,
"taxonomy" : doc.replicon.taxonomy.join( ", ") ,
"type" : doc.replicon.type
});
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment