-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
224 lines (197 loc) · 8.77 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE html>
<html lang="en">
<head>
<title>NomenMatch</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href='http://fonts.googleapis.com/css?family=Roboto|Slabo+27px&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cerulean/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<!--script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" crossorigin="anonymous"></script-->
<link href="css/default.css" rel="stylesheet">
</head>
<body>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-63174146-1', 'auto');
ga('send', 'pageview');
</script>
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href='#' style="color:#fff" >NomenMatch</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
<ul class="nav navbar-nav">
<li><a href="about.html">About</a></li>
<li><a href="index.html">Match</a></li>
<li><a href="howto.html">How-To</a></li>
<li><a href="api-doc.html">API</a></li>
</ul>
</div>
</div>
</div>
<!-- introduction panel -->
<div class="container">
<br/>
<div class="panel">
<div class="panel-body">
<h3>NomenMatch (code name: MyMatch): a scientific-name checking tool</h3>
</div>
</div>
</div>
<!-- /introduction panel -->
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Query settings</h3>
</div>
<div class="panel-body">
<!-- settings -->
<form action="api.php" method='post'>
<table class="table">
<tr>
<td>Result format
<select name="format" class="form-control" id="format">
<option name='format' value='table' selected="selected"/>table</option>
<option name='format' value='plain'/>plain text</option>
<option name='format' value='json'/>json</option>
<option name='format' value='csv'/>csv</option>
</select>
</td>
<td>
<div id='source_wrapper'>
Sources
<select name="against" class="form-control" id="sources">
<option value='' selected="selected"/>All<br/>
</select>
</div>
</td>
<td>
<div id='source_revisions_wrapper'>
Version
<div id='source_revisions'>
<div><a></a></div>
</div>
</div>
</td>
<td>Best results only?
<select name="best" class="form-control" id="best">
<option value='yes' selected="selected"/>Yes (fast and simple)</option>
<option value='mid'/>Medium (fast and informative)</option>
<option value='no'/>No (slow and most informative)</option>
</select>
</td>
<td>Solr endpoints
<select name="ep" class="solr_endpoints form-control" id="solr_endpoint_selector">
<option id="default_solr_endpoint" value='http://solr:8983/solr/taxa' selected="selected" /> DEFAULT (@placeholder) </option>
<!--input class='solr_endpoints' type='radio' name='ep' value='http://example.org/solr'> Test solr endpoint selection <br/-->
<option value='http://match.taibif.tw:8983/solr'/> [email protected]</option>
</select>
</td>
</tr>
</table>
<!-- /settings -->
</div>
</div>
<!-- queryNames -->
<div class="panel panel-default">
<div class="panel-body">
<h3 class="panel-title">Scientific names<h3/>
<small>You can input one scientific name per line without or with authors,
such as <i>Taiwania cryptomerioides</i> or <i>Taiwania cryptomerioides</i> Hayata</small>
<textarea class="form-control" rows="10" name="names" placeholder='Taiwania cryptomerioides'></textarea><br/>
<input class="btn btn-primary" id='submit_query' type='submit' name='query' value='Check names'/>
<!--input type='hidden' name='lang' value='zh'/-->
</div>
</div>
<div id="citations">
</div>
</form>
<!-- /queryNames -->
<div id='source_tpl' style='display:none'><option value='' selected='selected'> ALL </option></div>
<div id='citation_tpl' style='display:none'><div>Data Citations</div></div>
</div>
<script>
$(document).ready(function(){
// read info from default solr endpoint
$.get("./conf/solr_endpoint", function (solr_endpoint) {
var ep = solr_endpoint;
//$('#default_endpoint_host').text(ep.split('//')[1].split('/')[0].split(':')[0].replace('localhost', window.location.host));
var default_ep_host = $('#default_solr_endpoint').text().replace('@placeholder', ep.replace('localhost', window.location.host).replace('\n', ''));
$('#default_solr_endpoint').text(default_ep_host);
//$('#default_endpoint').val(ep).change();
ep_encoded = encodeURIComponent(ep);
$.get("count.php?ep=" + ep_encoded, function (data) {
if (data.length > 0) {
$("#sources").html($("#source_tpl").html());
$("#citations").html($("#citation_tpl").html());
var sources_html = "";
var citations_html = "";
var revisions_html = "<div style='display:none;' class='revision_link revision_link_no_0'><a>#N/A</a></div>";
for (var i=0; i<data.length; i++) {
//$("#"+data[i].source+"_num").html(data[i].count);
sources_html += "<option value='"+data[i].source+"'> "+data[i].name+": "+data[i].count+"</option>";
citations_html += "<li>"+data[i].citation+"</li>";
revisions_html += "<div style='display:none;' class='revision_link revision_link_no_" + (i+1) + "'><a href='" + data[i].url + "'>" + data[i].version + "</a></div>";
}
$("#sources").html($("#sources").html()+sources_html);
$("#citations").html($("#citations").html()+citations_html);
$("#source_revisions").html(revisions_html);
$(".revision_link_no_0").css("display", "inline");
$('#submit_query').attr('disabled', false);
}
}, 'json')
});
// read info from user-selected solr endpoint
$('.solr_endpoints').change(function (e) {
var ep_encoded = encodeURIComponent(this.value);
$.get("count.php?ep=" + ep_encoded, function (data) {
if (data.length > 0) {
$("#sources").html($("#source_tpl").html());
$("#citations").html($("#citation_tpl").html());
var sources_html = "";
var citations_html = "";
var revisions_html = "<div style='display:none;' class='revision_link revision_link_no_0'><a>#N/A</a></div>";
for (var i=0; i<data.length; i++) {
//$("#"+data[i].source+"_num").html(data[i].count);
sources_html += "<option value='"+data[i].source+"'> "+data[i].name+": "+data[i].count+"</option>";
citations_html += "<li>"+data[i].citation+"</li>";
revisions_html += "<div style='display:none;' class='revision_link revision_link_no_" + (i+1) + "'><a href='" + data[i].url + "'>" + data[i].version + "</a></div>";
}
$("#sources").html($("#sources").html()+sources_html);
$("#citations").html($("#citations").html()+citations_html);
$('#submit_query').attr('disabled', false);
}
else {
$("#sources").html("no source");
$("#citations").html($("#citation_tpl").html() + "<li>no citation</li>");
$('#submit_query').attr('disabled', true);
}
}, 'json')
$('.revision_link').css('display', 'none');
$('.revision_link_no_0').css('display', 'inline');
});
$('#sources').change(function(e) {
var sid = e.target.selectedIndex;
$('.revision_link').css('display', 'none');
$('.revision_link_no_' + sid).css('display', 'inline');
});
});
</script>
<footer class="footer">
<div class="container">
<p class="text-muted">NomenMatch © Jason Mai (TaiBIF/TaiBON Team)</p>
</div>
</footer>
</body>
</html>