Initial Commit

This commit is contained in:
Jai A
2020-05-09 22:11:48 -07:00
commit da19743ba5
12 changed files with 2681 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>{{name}} Example</title>
</head>
<body>
<h1>{{name}} example</h1>
<p>This is an example of how to use {{name}} with Actix-Web.</p>
</body>
</html>

View File

@@ -0,0 +1,38 @@
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Search</title>
</head>
<body>
<h1>Test Mod Search</h1>
<form>
<label for="search-input">Search for Mods:</label>
<input type="text" id="search-input" oninput="handleSearch()">
</form>
<p>{{results}}</p>
<script>
let input = document.getElementById("search-input");
function handleSearch() {
let safeName = encodeURIComponent(input.value).replace(/%20/g,'+');
let xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {
console.log(xmlHttp.responseText);
console.log(JSON.parse(xmlHttp.responseText));
}
}
xmlHttp.open("POST", "search?q=" + safeName, true);
xmlHttp.send(null);
window.history.pushState('Search', 'Search', '/search?q=' + safeName);
}
</script>
</body>
</html>