summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-06-10 12:31:09 +0200
committerPatrick Simianer <p@simianer.de>2015-06-10 12:31:09 +0200
commit334c3820c673c9226513b69df93b43ac37308bd1 (patch)
treef76cf42d270280a01288ee30d6c8a26dd4c485c0 /index.php
parent30d056ba5cb3b9262b193407adfbbd288c63dc3e (diff)
stable system
Diffstat (limited to 'index.php')
-rw-r--r--index.php68
1 files changed, 51 insertions, 17 deletions
diff --git a/index.php b/index.php
index 4d79798..3947b42 100644
--- a/index.php
+++ b/index.php
@@ -1,54 +1,88 @@
<html>
<head>
<meta charset="utf-8" />
- <title>Post-editing application</title>
+ <title>Post-editing application (key: <?php echo $_GET["key"]; ?></title>
<script src="lfpe.js"></script>
<link rel="stylesheet" type="text/css" href="lfpe.css" />
</head>
-<body onload="Next()">
+<body onload="">
+<!-- Wrapper -->
<div id="wrapper">
+<!-- Header -->
<div id="header">
-<img src="img/logo_neu_204x107.jpg" />
-<img id="cl" src="img/institut_cl.png" />
+ <img id="uni" src="img/logo_neu_204x107.jpg" />
+ <img id="cl" src="img/institut_cl.png" />
</div>
+<!-- /Header -->
+<!-- Source and target -->
<table>
<tr>
<td align="right">Source:</td>
- <td><textarea id="src" name="source" cols="80" rows="1" readonly></textarea></td>
+ <td><textarea id="raw_source_textarea" name="source" cols="80" rows="1" disabled></textarea></td>
</tr>
<tr>
<td align="right">Target:</td>
- <td><textarea id="trgt" name="target" cols="80" rows="1" onkeypress="submit(event)"></textarea></td>
+ <td><textarea id="target_textarea" name="target" cols="80" rows="1" onkeypress="catch_return(event)"></textarea></td>
</tr>
</table>
+<!-- /Source and target -->
-<p>
- <button id="next" type="button" onclick="Next()">Next</button>
-</p>
+<!-- Next button -->
+<div>
+ <button id="pause_button" type="button" onclick="pause()">Pause</button>
+ <button id="next" type="button" onclick="Next()">Start/Continue</button>
+ <span id="status"><strong>Working</strong> <img src="img/ajax-loader-large.gif" width="20px" /></span>
+</div>
+<!-- /Next button -->
+
+<!-- Document overview -->
+<div>
+<strong>Document overview</strong>
+<table id="overview">
+<?php
+$j = file_get_contents("/fast_scratch/simianer/lfpe/example_session/".$_GET["key"].".json"); # FIXME: from database
+$a = json_decode($j);
+$i = 0;
+foreach($a->raw_source_segments as $s) {
+ if ($i <= $a->progress) {
+ echo "<tr id='seg_".$i."'><td>".($i+1).".</td><td>".$s."</td><td class='seg_text' id='seg_".$i."_t'>".$a->post_edits_raw[$i]."</td></tr>";
+ } else {
+ echo "<tr id='seg_".$i."'><td>".($i+1).".</td><td>".$s."</td><td class='seg_text' id='seg_".$i."_t'></td></tr>";
+ }
+ $i += 1;
+}
+?>
+</table>
+</div>
+<!-- /Document overview -->
-<p id="desc">
+<!-- Help -->
+<p id="help">
<strong>Help</strong><br />
Press the 'Next' to submit your post-edit and to request the next segment to translate
(or just press enter when the 'Target' textarea is in focus).
</p>
+<!-- /Help -->
+<!-- Footer -->
<p id="footer">
&copy;2015 Heidelberg University/Institute for Computational Linguistics
</p>
+<!-- /Footer -->
</div>
+<!-- /Wrapper -->
-
-<p id="translating_status">
- <strong>Translating</strong> <img src="img/ajax-loader-large.gif" width="20px" />
-</p>
-
-
-<textarea style="display:none" id="src_pp"></textarea>
+<!-- Data -->
+<textarea style="display:none" id="key"><?php echo $_GET['key']; ?></textarea>
+<textarea style="display:none" id="source"></textarea>
+<textarea style="display:none" id="current_seg_id">0</textarea>
+<textarea style="display:none" id="paused">0</textarea>
+<!-- /Data -->
</body>
</html>