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

add widget to search secreton db for strain

I use Jquery-ui autocompleter with jquery-ui smootheness style
parent 5978cc0e
......@@ -4,8 +4,10 @@
<title>Secreton</title>
<link rel="stylesheet" href="style/main.css" type="text/css">
<link rel="stylesheet" href="style/tooltip.css" type="text/css">
<link rel="stylesheet" href="style/smoothness/jquery-ui-1.8.17.custom.css" type="text/css">
<script src="/_utils/script/jquery.js"></script>
<script src="/_utils/script/jquery.couch.js"></script>
<script src="/_utils/script/jquery-ui-1.8.11.custom.min.js"></script>
</head>
<body>
<div id="request">
......@@ -24,15 +26,15 @@
<input type="text" name="taxidSearch" id="taxidInput"/>
<button type="button" id="taxidButton">search by taxid</button>
</fieldset>
<fieldset>
<label for="famillySearch">by T3SS family (ex:Hrp2)</label>
<input type="text" name="familySearch" id="familyInput"/>
<button type="button" id="familyButton">search by family</button>
<label for="famillySearch">by T3SS family</label>
<select name="familySearch" id="familyList">
</select>
</fieldset>
<fieldset>
<label for="famillySearch2">by T3SS family (ex:Hrp2)</label>
<select name="familySearch2" id="familyList">
</select>
<label for="strainSearch">by strain</label>
<input type text="text" name="strainSearch" id="strainInput" size="100"/>
</fieldset>
</form>
</div>
......@@ -105,6 +107,29 @@ $(".tooltip" , "#results").live('mouseenter', function(){
});
});
$("#strainInput").autocomplete({
source: function(req , response){
var term = '"'+$.trim(req.term).toLowerCase()+'"';
var suggestions =[];
$.getJSON("_view/strain", {key:term} , function(suggested_strain){
var cur_value ;
for(var i =0; i<suggested_strain.rows.length; i++){
if (cur_value != suggested_strain.rows[i].value){
suggestions.push(suggested_strain.rows[i].value);
cur_value = suggested_strain.rows[i].value;
}
}
response(suggestions);
});
},
select: function(evt , ui ){
strain= ui.item.value ;
params = { key: '"'+strain+'"' };
get_results( 'by_replicon_strain', params);
},
minLength:3
});
$("#paginate .nav_page").live( 'click', function(){
var url = $(this).attr('data-href');
$("#results").load( url );
......
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