You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Kidnappd Test</title>
  5. <meta charset=utf-8>
  6. <link rel="stylesheet" type="text/css" href="style.css">
  7. </head>
  8. <body>
  9. <h1>Kidnapp'd</h1>
  10. <div id=btns>
  11. <div><button>inspectintent</button>
  12. </div>
  13. <div><button id=um>lookaroundintent</button>
  14. </div>
  15. <div><button>examineintent</button>
  16. </div>
  17. <div><button>takeintent</button>
  18. </div>
  19. <div><button>openintent</button>
  20. </div>
  21. <select id="itemList">
  22. <option>Tür</option>
  23. <option>Schloss</option>
  24. <option>Schlüssel</option>
  25. </select>
  26. </div>
  27. <div id="output">
  28. <ol id="logList"></ol>
  29. </div>
  30. <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
  31. <script>
  32. $("button").click(function(){
  33. if ($(this).text()==="lookaroundintent")
  34. {
  35. $.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/Logic?intent=lookaroundintent");
  36. }
  37. else if ($(this).text()==="examineintent")
  38. {
  39. $.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/Logic?intent=examineintent");
  40. }
  41. else
  42. {
  43. $.post("https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/Logic?intent="+$(this).text()+"&slot="+replaceUml($("#itemList :selected").text()));
  44. }
  45. });
  46. function printOutput(data) {
  47. $("#output").animate({opacity:1},1000)
  48. $("#logList").append(("<li><span>" + data + "</span></li>"));
  49. }
  50. function replaceUml(value) {
  51. value = value.replace(/ä/g, 'ae');
  52. value = value.replace(/ö/g, 'oe');
  53. value = value.replace(/ü/g, 'ue');
  54. return value;
  55. }
  56. </script>
  57. </body>
  58. </html>