summaryrefslogtreecommitdiff
path: root/interface.php
blob: d1f3f72bb3f917bd28e5dd60d91aee75e2e7fd96 (plain)
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
<html>
<head>
  <meta charset="utf-8" />
  <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="init()">

<?php include("header.php"); ?>

<!-- Source and target -->
<table>
<tr>
  <td align="right">Source:</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="target_textarea" name="target" cols="80" rows="1" onkeypress="catch_return(event)"></textarea></td>
</tr>
</table>
<!-- /Source and target -->

<!-- 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 id="overview_wrapper">
<strong>Document overview</strong>
<table id="overview">
<?php
$SESSION_DIR="/fast_scratch/simianer/lfpe/sessions";
$j = file_get_contents($SESSION_DIR."/".$_GET["key"]."/data.json");
$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 -->

<!-- Help -->
<div id="help">
<strong>Help</strong><br />
<p>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>
<p class="xtrasmall">Support: <a href="mailto://simianer &auml;t cl.uni-heidelberg.de">Mail</a></p>
<p class="xtrasmall">Session: #<?php echo $_GET["key"]; ?> | <a href="http://coltrane.cl.uni-heidelberg.de:<?php echo $a->port; ?>/debug" target="_blank">Debug</a></p>
</div>
<!-- /Help -->

<?php include("footer.php"); ?>

</body>
</html>

<!-- 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>
<textarea style="display:none" id="port"><?php echo $a->port; ?></textarea>
<!-- /Data -->