66 lines
2.1 KiB
HTML
66 lines
2.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Kidnappd Test</title>
|
|
<meta charset=utf-8>
|
|
<link rel="stylesheet" type="text/css" href="style.css">
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<h1>Kidnapp'd</h1>
|
|
<div id=btns>
|
|
|
|
<div><button>inspectintent</button>
|
|
</div>
|
|
<div><button id=um>lookaroundintent</button>
|
|
</div>
|
|
<div><button>examineintent</button>
|
|
</div>
|
|
<div><button>takeintent</button>
|
|
</div>
|
|
<div><button>openintent</button>
|
|
</div>
|
|
<select id="itemList">
|
|
<option>Tür</option>
|
|
<option>Schloss</option>
|
|
<option>Schlüssel</option>
|
|
</select>
|
|
</div>
|
|
<div id="output">
|
|
<ol id="logList"></ol>
|
|
</div>
|
|
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
|
|
<script>
|
|
|
|
$("button").click(function(){
|
|
if ($(this).text()==="lookaroundintent")
|
|
{
|
|
$.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/IO?intent=lookaroundintent");
|
|
}
|
|
else if ($(this).text()==="examineintent")
|
|
{
|
|
$.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/IO?intent=examineintent");
|
|
}
|
|
else
|
|
{
|
|
$.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/IO?intent="+$(this).text()+"&slot="+replaceUml($("#itemList :selected").text()));
|
|
}
|
|
});
|
|
|
|
function printOutput(data) {
|
|
$("#output").animate({opacity:1},1000)
|
|
$("#logList").append(("<li><span>" + data + "</span></li>"));
|
|
}
|
|
|
|
function replaceUml(value) {
|
|
value = value.replace(/ä/g, 'ae');
|
|
value = value.replace(/ö/g, 'oe');
|
|
value = value.replace(/ü/g, 'ue');
|
|
return value;
|
|
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html> |