File size: 3,151 Bytes
d5bfab8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
<!doctype html>
<html lang="en"><head><meta charset="utf-8">
<meta name="robots" content="noindex">
<title>Task {{task_id}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no">
<link media="all" rel="stylesheet" type="text/css" href="/static/page_shared.css">
<link media="all" rel="stylesheet" type="text/css" href="/static/page_inspect_task.css">
<link media="all" rel="stylesheet" type="text/css" href="/static/page_reply.css">
<script>
function setupKeyboardShortcuts() {
let keydownHandler = function(event) {
if(event.defaultPrevented) {
return; // Should do nothing if the default action has been cancelled
}
const isMetaKey = event.metaKey || event.ctrlKey;
const isEnterKeyCode = (event.keyCode == 10) || (event.keyCode == 13);
const isEscapeKeyCode = (event.keyCode == 27);
// intercept CTRL+ENTER, and submit the form.
if(isEnterKeyCode && isMetaKey) {
console.log("ctrl+enter: submit form");
event.preventDefault(); // Suppress "double action"
document.getElementById("replyForm").submit();
return;
}
};
window.addEventListener('keydown', keydownHandler, true);
}
</script>
</head>
<body onload="setupKeyboardShortcuts()">
<header class="titlebar-container">
<div class="titlebar-item titlebar-item-left">
<a class="seconday-button" href="{{ task_href }}">Task</a>
<a class="seconday-button" href="{{ prompt_href }}">Prompt</a>
</div>
<div class="titlebar-item titlebar-item-center">Task {{task_id}} > Reply</div>
<div class="titlebar-item titlebar-item-right">
<form id="replyForm" name="replyForm" method="post" enctype="application/x-www-form-urlencoded">
<input class="primary-button" type="submit" value="Submit reply (Ctrl+Enter)">
</form>
</div>
</header>
<main id="main-outer">
<div id="main-inner">
<textarea form="replyForm" id="prompt-reply-textarea" name="reply_text" autofocus placeholder="Paste answer here, and submit">{{reply_text}}</textarea>
<div class="split-screen">
<!-- Left content -->
<div class="split-screen-half">
<h1>Expected</h1>
{{ expected_image_html|safe }}
</div>
<!-- Right content -->
<div class="split-screen-half">
<h1>Predicted</h1>
{{ predicted_image_html|safe }}
</div>
</div>
{% if post_reply_result %}
<div>
<h1>Result</h1>
<pre>{{post_reply_result}}</pre>
</div>
{% endif %}
</div>
</main>
<footer id="page-footer">
<div id="page-footer-item0" class="page-footer-item">
<!-- footer -->
</div>
<div id="page-footer-item1" class="page-footer-item">
<!-- footer -->
</div>
</footer>
</body>
</html>
|