test.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. document.addEventListener('keyup', (event) => {
  2. if (event.key == 'ArrowRight') {
  3. $.ajax({
  4. type: "PUT",
  5. url: "../Manuel",
  6. headers: {"content-id": "input"},
  7. data: { style_url: "mystyleURL", document_url: 'www.nixdrin.at' },
  8. success: function(res) {
  9. location.reload();
  10. },
  11. error: function (request, status, error) {
  12. alert(request.responseText + status + error);
  13. }
  14. });
  15. }
  16. if (event.key == 'ArrowUp') {
  17. $.ajax({
  18. type: "POST",
  19. url: "../Manuel",
  20. headers: {"content-id": "frame"},
  21. data: { lx: "2", ly: '0', rx: '1', ry: '2', url: 'https://centurio.work/' },
  22. success: function(res) {
  23. location.reload();
  24. },
  25. error: function (request, status, error) {
  26. alert(request.responseText + status + error);
  27. }
  28. });
  29. }
  30. if (event.key == 'ArrowDown') {
  31. $.ajax({
  32. type: "POST",
  33. url: "../Manuel",
  34. headers: {"content-id": "frame"},
  35. data: { lx: "0", ly: '0', rx: '2', ry: '2', url: 'https://centurio.work/flow-test/' },
  36. success: function(res) {
  37. location.reload();
  38. },
  39. error: function (request, status, error) {
  40. alert(request.responseText + status + error);
  41. }
  42. });
  43. }
  44. if (event.key == 'ArrowLeft') {
  45. $.ajax({
  46. type: "POST",
  47. url: "../Manuel",
  48. headers: {"content-id": "frame"},
  49. data: { lx: "1", ly: '1', rx: '2', ry: '2', url: 'https://centurio.work/customers/evva/was/ui/' },
  50. success: function(res) {
  51. location.reload();
  52. },
  53. error: function (request, status, error) {
  54. alert(request.responseText + status + error);
  55. }
  56. });
  57. }
  58. });