index.html 2.64 KB
Newer Older
1
2
3
<!DOCTYPE html>
<html>
  <head>
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
4
    <title>Secreton</title>
5
    <link rel="stylesheet" href="style/main.css" type="text/css">
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
6
7
8
    <link rel="stylesheet" href="style/tooltip.css" type="text/css">
    <script src="/_utils/script/jquery.js"></script>
    <script src="/_utils/script/jquery.couch.js"></script>
9
10
  </head>
  <body>
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
11
12
13
14
15
  <div id="request">
  <form>
    <fieldset>
        <label for="nameSearch">by replicon name (ex:BUMA001c02)</label>
        <input type="text" name="nameSearch" id="nameInput"/>
16
17
18
19
        <select name="queryType" id="nameQueryType">
            <option value="is" selected="selected">is</option>
            <option value="start_with" >start_with</option>
        </select>
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
20
21
        <button type="button" id="nameButton">search by name</button>  
    </fieldset> 
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
22
23
24
25
26
    <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>
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
27
28
29
30
31
32
  </form>
  </div>
  <div id="results">
  
  
  </div>  
33
  </body>
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
34
35
36
37
38
39
40
41
42
43
44
45
46
  <script type="text/javascript">
$(".tooltip" , "#results").live('mouseenter', function(){
    var link$ = $(this).find("a");
    timer = setTimeout(function(){ 
        var pos = link$.position();
        var top = pos.top + link$.outerHeight(true)+3;
        var left = pos.left + link$.outerWidth(false)-25;
        link$.next().css({top: top+"px", left: left+"px"}).show(300)}, 
        500);
    }).live( 'mouseleave', function(){
         clearTimeout(timer);
         $(this).find("ul").hide(300)});
</script>
47

Bertrand  NÉRON's avatar
Bertrand NÉRON committed
48
49
50
51
52
53
  <script type="text/javascript">
  var get_results = function( view , args ){
	  var url= document.location.href.split('/').slice(0, -1).concat(['_list','index',view]).join('/');
	  $("#results").load(url , args );
  }
  $("#nameButton").click( function(){
54
55
56
57
58
59
60
61
62
63
64
65
66
	  var params = {limit:45+1};
	  var $query= $("#nameQueryType").attr("value")
	  if ( $query == "start_with" ){
		  var key= $("#nameInput").attr("value");
		  if( key ){ 
			  params.startkey='"'+key+'"';
			  params.endkey='"'+key+'\uFFFF"';
			  params.query_type="start_with";
		  }
	  }else{
		  var key= $("#nameInput").attr("value");
		  if( key ){ params.key='"'+key+'"'}
	  }
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
67
68
69
	  get_results( 'by_replicon_name', $.param(params)); 
  });
  
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
70
71
72
73
74
75
  $("#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)); 
  });
Bertrand  NÉRON's avatar
Bertrand NÉRON committed
76
77
78
79
80
81
82
  
  $("#paginate .nav_page").live( 'click', function(){
	  var url = $(this).attr('data-href');
	  $("#results").load( url );
  });
  
 		  
83
84
  </script>
</html>