add basic webapp
This commit is contained in:
57
web/index.html
Normal file
57
web/index.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Monster Hunter Item Search</title>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
|
||||
|
||||
<style>
|
||||
.flex {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#output { flex: 99 1 auto; }
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#search").click(update_search);
|
||||
$("#item").keypress(function(e) {
|
||||
if (e.which == 13) { update_search(); }
|
||||
});
|
||||
setup_autocomplete();
|
||||
});
|
||||
|
||||
function setup_autocomplete() {
|
||||
$.getJSON("/mhapi/item_name_list",
|
||||
function(data) {
|
||||
$("#item").autocomplete({ source: data });
|
||||
});
|
||||
}
|
||||
|
||||
function update_search() {
|
||||
var item_name = $.trim($("#item").val());
|
||||
|
||||
$.get("/mhapi/rewards",
|
||||
{ "item_name": item_name },
|
||||
function(data) {
|
||||
$("#output").text(data);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flex">
|
||||
<label for="item">Item:</label>
|
||||
<input id="item" type="text" size="20" />
|
||||
<br />
|
||||
<button id="search">Find Quests and Monsters</button>
|
||||
<br />
|
||||
<textarea readonly="true" rows="10" cols="80" id="output"></textarea>
|
||||
</div>
|
||||
</body>
|
||||
Reference in New Issue
Block a user