From 4e5ead06642714990b054ecf68f88b79dbd7b489 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Wed, 27 May 2015 19:19:06 +0200 Subject: bits & pieces --- img/institut_cl.png | Bin 0 -> 3301 bytes img/logo_neu_204x107.jpg | Bin 0 -> 14111 bytes index.php | 36 ++++++++++++++++++++++++++---------- kill | 4 ++++ lfpe.css | 30 +++++++++++++++++++++++++++--- lfpe.js | 14 +++++++++----- server.rb | 4 +++- 7 files changed, 69 insertions(+), 19 deletions(-) create mode 100644 img/institut_cl.png create mode 100644 img/logo_neu_204x107.jpg create mode 100755 kill diff --git a/img/institut_cl.png b/img/institut_cl.png new file mode 100644 index 0000000..6c56df6 Binary files /dev/null and b/img/institut_cl.png differ diff --git a/img/logo_neu_204x107.jpg b/img/logo_neu_204x107.jpg new file mode 100644 index 0000000..870dcb4 Binary files /dev/null and b/img/logo_neu_204x107.jpg differ diff --git a/index.php b/index.php index 7439c91..4d79798 100644 --- a/index.php +++ b/index.php @@ -10,29 +10,45 @@
-
- + -
- -
+ + + + + + + + + +
Source:
Target:

+

+Help
+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). +

+ + +
+

- translating + Translating

-

-Press the 'Next' to submit your post-edit and request the next segment to translate -(or just press enter when the textarea is in focus). -

+ diff --git a/kill b/kill new file mode 100755 index 0000000..34d7ed4 --- /dev/null +++ b/kill @@ -0,0 +1,4 @@ +#!/bin/bash + +for i in {1..6}; do ps ax | grep -P "(server.rb|atools|net_fa|sa.extract|dtrain)" | grep -v vim | grep -v -P "^\s\+$" | cut -d " " -f $i | xargs kill -9; done + diff --git a/lfpe.css b/lfpe.css index 91b8c3a..59d62eb 100644 --- a/lfpe.css +++ b/lfpe.css @@ -5,7 +5,7 @@ textarea { p#translating_status { display: none; margin-left: 4.2em; - margin-top: -5.5em + /*margin-top: -5.5em*/ } button { @@ -20,14 +20,38 @@ p#fi { } div#wrapper { - margin: 4em; + margin: 2em; padding: 1em; border: 1px dashed #000 } +div#header { + margin-bottom: 2em; +} + +p#footer { + text-align:right; + font-size: 0.5em; + font-weight:bold; + margin:0; + padding:0; + color:#ccc +} + p#desc { font-size:0.8em; + width:40%; color: #ccc; - position: fixed + text-align:justify +} + +p#desc:hover { + color: #000 +} + +img#cl { + margin-bottom:20px; + margin-left:10px; + vertical-align:bottom; } diff --git a/lfpe.js b/lfpe.js index bf7aa0e..c6cd97f 100644 --- a/lfpe.js +++ b/lfpe.js @@ -28,7 +28,7 @@ function Next() url = "http://coltrane.cl.uni-heidelberg.de:60666/next"; var pe = document.getElementById("trgt").value; if (pe != "") { - var src = document.getElementById("src").value; + var src = document.getElementById("src_pp").value; url += "?example="+src+" %7C%7C%7C "+pe; } document.getElementById("translating_status").style.display = "block"; @@ -47,10 +47,14 @@ function Next() document.getElementById("next").innerHTML = "Thank you!"; document.getElementById("next").disabled = true; } else { - document.getElementById("src").value = x[0]; - document.getElementById("src").cols = x[0].length; - document.getElementById("trgt").value = x[1]; - document.getElementById("trgt").cols = x[1].length; + document.getElementById("src_pp").value = x[0]; + document.getElementById("src").value = x[2]; + document.getElementById("src").rows = Math.round(x[2].length/80)+1; + var firstLetter = x[1][0].toUpperCase(); + var rest = x[1].substring(1); + var t = firstLetter + rest; + document.getElementById("trgt").value = t; + document.getElementById("trgt").rows = Math.round(x[1].length/80)+1; document.getElementById("translating_status").style.display = "none"; document.getElementById("trgt").focus(); document.getElementById("trgt").selectionStart = 0; diff --git a/server.rb b/server.rb index 86fc53f..a0dcd9c 100755 --- a/server.rb +++ b/server.rb @@ -8,6 +8,7 @@ require 'digest' require_relative "#{ARGV[0]}" INPUT = ReadFile.readlines INPUT_FILE +INPUT_RAW = ReadFile.readlines RAW_INPUT_FILE `mkdir -p #{WORK_DIR}/g` def start_daemon cmd, name, addr @@ -102,6 +103,7 @@ get '/next' do STDERR.write "[extractor] < got '#{env[:extractor][:socket].recv}'\n" end source = INPUT.shift + raw_source = INPUT_RAW.shift if !source # input is done -> displays 'Thank you!' STDERR.write ">>> end of input, sending 'fi'\n" "fi" @@ -121,7 +123,7 @@ get '/next' do STDERR.write "[dtrain] waiting for translation ...\n" transl = env[:dtrain][:socket].recv.force_encoding "UTF-8" STDERR.write "[dtrain] < received translation: '#{transl}'\n" - "#{source}\t#{transl}" + "#{source}\t#{transl.strip}\t#{raw_source}" end end -- cgit v1.2.3