From e1bbf92a8bc8ae97408092a29da106821e276d20 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Wed, 28 Oct 2015 10:04:37 +0100 Subject: enabled use of graphical ui and switching between grahpical and textual ui --- common.js | 58 +++++++++++ interface.php | 51 ++++++--- lfpe.js | 325 +++++++++++++++++++++++++++++++--------------------------- server.rb | 57 +++++++--- 4 files changed, 308 insertions(+), 183 deletions(-) create mode 100644 common.js diff --git a/common.js b/common.js new file mode 100644 index 0000000..11dcdba --- /dev/null +++ b/common.js @@ -0,0 +1,58 @@ +var data, + ui_type; + + +/* + * hacky way to remove class from node + * + */ +function removeClass(node, className) +{ + node.className = + node.className.replace(" "+className,''); + node.className = + node.className.replace(" "+className,''); // ??? + + return false; +} + +/* + * + * + */ +function toggleDisplay(node) +{ + if (node.style.display=='none') { + node.style.display = 'block'; + } else { + node.style.display = 'none'; + } + + return false; +} + +/* + * trim string + * + */ +function trim(s) +{ + return s.replace(/^\s+|\s+$/g, ''); +} + +/* + * cross-site request + * + */ +function CreateCORSRequest(method, url) +{ + var xhr = new XMLHttpRequest(); + if ("withCredentials" in xhr) { + xhr.open(method, url, true); + } else { + xhr = null; + } + + return xhr; +} + diff --git a/interface.php b/interface.php index 19a8cbd..df82d97 100644 --- a/interface.php +++ b/interface.php @@ -2,26 +2,47 @@ Post-editing application (Session: #<?php echo $_GET["key"]; ?>) + + + + + - + - - - - - - - - - - -
Source:
Target:
- + +
+
+ + +
+ + + +
+ + + + + + + + + +
Source:
Target:
+
+
+

Unknown words:
+ Please enter a translation for each source word.

+
+
+ +
@@ -61,7 +82,7 @@ foreach($db->raw_source_segments as $s) { - +