parent
7a3d7cc9b8
commit
444ee3b928
@ -0,0 +1,69 @@
|
||||
<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;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
font-family: sans, sans-serif;
|
||||
}
|
||||
|
||||
#output { flex: 99 1 auto; }
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var STATIC_BASE = "/rewards/";
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#search").click(update_search);
|
||||
$("#item").keypress(function(e) {
|
||||
if (e.which == 13) { update_search(); }
|
||||
});
|
||||
setup_autocomplete();
|
||||
});
|
||||
|
||||
function encode_utf8(s) {
|
||||
return unescape(encodeURIComponent(s));
|
||||
}
|
||||
|
||||
function setup_autocomplete() {
|
||||
$.getJSON(STATIC_BASE + "items.json",
|
||||
function(data) {
|
||||
$("#item").autocomplete({ source: data });
|
||||
});
|
||||
}
|
||||
|
||||
function update_search() {
|
||||
var item_name = $.trim($("#item").val());
|
||||
|
||||
$.get(STATIC_BASE + encode_utf8(item_name) + ".txt",
|
||||
function(data) {
|
||||
$("#output").text(data);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flex">
|
||||
<div>
|
||||
<label for="item">Item:</label>
|
||||
<input id="item" type="text" size="20" />
|
||||
<button id="search">Ask Poogie</button>
|
||||
<a href="http://www.reddit.com/r/MonsterHunter/comments/2z4pz3/finding_the_best_quest_to_farm_an_item_python/">(output explanation)</a>
|
||||
</div>
|
||||
<br />
|
||||
<textarea readonly="true" rows="10" cols="80" id="output"></textarea>
|
||||
</div>
|
||||
</body>
|
||||
Loading…
Reference in new issue