new web index, refactor, data fixes
This commit is contained in:
70
web/recommends.html
Normal file
70
web/recommends.html
Normal file
@@ -0,0 +1,70 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Poogie Recommends</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>
|
||||
|
||||
<script src="js/common.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 DATA_PATH = get_base_path() + "/rewards/";
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#search").click(update_search);
|
||||
$("#item").keypress(function(e) {
|
||||
if (e.which == 13) { update_search(); }
|
||||
});
|
||||
setup_item_autocomplete("#item");
|
||||
var item_name = $.QueryString["item"];
|
||||
if (item_name) {
|
||||
$("#item").val(item_name);
|
||||
update_search();
|
||||
}
|
||||
});
|
||||
|
||||
function update_search() {
|
||||
var item_name = $.trim($("#item").val());
|
||||
var normalized_name = normalize_name(item_name);
|
||||
|
||||
$.get(DATA_PATH + encode_utf8(normalized_name) + ".txt",
|
||||
function(data) {
|
||||
$("#output").text(data);
|
||||
}).fail(
|
||||
function() {
|
||||
$("#output").text("Error: item '" + normalized_name + "' not found");
|
||||
});
|
||||
}
|
||||
</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="https://github.com/bd4/monster-hunter-scripts/blob/master/RECOMMENDATIONS.adoc">Understanding Results</a>
|
||||
(<a href="https://github.com/bd4/monster-hunter-scripts">source</a>)
|
||||
</div>
|
||||
<br />
|
||||
<textarea readonly="true" rows="10" cols="80" id="output"></textarea>
|
||||
</div>
|
||||
</body>
|
||||
Reference in New Issue
Block a user