WebAdventure/web/index.html

66 lines
2.1 KiB
HTML
Raw Normal View History

2019-06-05 22:18:59 +02:00
<!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")
{
2019-06-21 06:43:29 +02:00
$.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/IO?intent=lookaroundintent");
2019-06-05 22:18:59 +02:00
}
else if ($(this).text()==="examineintent")
{
2019-06-21 06:43:29 +02:00
$.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/IO?intent=examineintent");
2019-06-05 22:18:59 +02:00
}
else
{
2019-06-21 06:43:29 +02:00
$.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/IO?intent="+$(this).text()+"&slot="+replaceUml($("#itemList :selected").text()));
2019-06-05 22:18:59 +02:00
}
});
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>