Skip to content
Snippets Groups Projects
Commit f97b42da authored by Frank Steinberg's avatar Frank Steinberg
Browse files

Fixes.

parent c9cec417
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,6 @@ check: bjcp-2015-styleguide-orig.xml bjcp-2015-styleguide-de.xml ...@@ -51,7 +51,6 @@ check: bjcp-2015-styleguide-orig.xml bjcp-2015-styleguide-de.xml
@xmllint --noout --schema xsd/bjcp-styleguide-2015.xsd bjcp-2015-styleguide-de.xml @xmllint --noout --schema xsd/bjcp-styleguide-2015.xsd bjcp-2015-styleguide-de.xml
background: background:
@echo "updating in the background..."
@nohup sh -c 'if [ ! -e .background ] ; then touch .background ; rm -f .background-again bjcp-2015-styleguide-de.xml web/edit.html ; make web/edit.html ; rm .background ; if [ -e .background-again ] ; then rm bjcp-2015-styleguide-de.xml web/edit.html ; make background ; fi ; else touch .background-again ; fi' >/dev/null 2>&1 & @nohup sh -c 'if [ ! -e .background ] ; then touch .background ; rm -f .background-again bjcp-2015-styleguide-de.xml web/edit.html ; make web/edit.html ; rm .background ; if [ -e .background-again ] ; then rm bjcp-2015-styleguide-de.xml web/edit.html ; make background ; fi ; else touch .background-again ; fi' >/dev/null 2>&1 &
install: install:
......
...@@ -6,7 +6,10 @@ const original = document.getElementById("original"); ...@@ -6,7 +6,10 @@ const original = document.getElementById("original");
const markup = document.getElementById("markup"); const markup = document.getElementById("markup");
const render = document.getElementById("render"); const render = document.getElementById("render");
const author = document.getElementById("author"); const author = document.getElementById("author");
const lasttext = document.getElementById("lasttext"); const editstylename = document.getElementById("editstylename");
const editelemname = document.getElementById("editelemname");
const lastdate = document.getElementById("lastdate");
const lastauthor = document.getElementById("lastauthor");
var editelem; var editelem;
var tagname; var tagname;
...@@ -74,8 +77,8 @@ function doedit(elem) { ...@@ -74,8 +77,8 @@ function doedit(elem) {
editid = elem.parentNode.getAttribute("id"); editid = elem.parentNode.getAttribute("id");
editelem = elem; editelem = elem;
tagname = elem.tagName.toLowerCase(); tagname = elem.tagName.toLowerCase();
lastdate = elem.getAttribute("date"); editlastdate = elem.getAttribute("date");
lastauthor = elem.getAttribute("author"); editlastauthor = elem.getAttribute("author");
t = elem.innerHTML; t = elem.innerHTML;
t = t.replace(/^ */,""); t = t.replace(/^ */,"");
t = t.replace(/ *$/,""); t = t.replace(/ *$/,"");
...@@ -91,7 +94,10 @@ function doedit(elem) { ...@@ -91,7 +94,10 @@ function doedit(elem) {
} else { } else {
text = "" text = ""
} }
lasttext.innerText = text; editstylename.innerText = editid ? editid : "-";
editelemname.innerText = tagname ? tagname : "-";
lastdate.innerText = editlastdate ? editlastdate : "original";
lastauthor.innerText = editlastauthor ? editlastauthor : "original";
if (origelem) { if (origelem) {
original.innerHTML = origelem.innerHTML; original.innerHTML = origelem.innerHTML;
} }
...@@ -136,6 +142,7 @@ function dosave() { ...@@ -136,6 +142,7 @@ function dosave() {
user = author.value; user = author.value;
xhr.open('POST', "save.cgi?id=" + editid + "&elem=" + tagname + "&user=" + user, true); xhr.open('POST', "save.cgi?id=" + editid + "&elem=" + tagname + "&user=" + user, true);
xhr.setRequestHeader('Content-Type','text/xml; charset=UTF-8'); xhr.setRequestHeader('Content-Type','text/xml; charset=UTF-8');
xhr.responseType = "text";
xhr.send(x); xhr.send(x);
} }
...@@ -24,8 +24,8 @@ def log(msg): ...@@ -24,8 +24,8 @@ def log(msg):
print("Content-Type: text/plain") print("Content-Type: text/plain; charset=UTF-8")
print() print("")
if "QUERY_STRING" in os.environ: if "QUERY_STRING" in os.environ:
form = urllib.parse.parse_qs(os.environ["QUERY_STRING"], keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=50) form = urllib.parse.parse_qs(os.environ["QUERY_STRING"], keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=50)
...@@ -126,5 +126,3 @@ elif os.path.isfile(origfilename): ...@@ -126,5 +126,3 @@ elif os.path.isfile(origfilename):
else: else:
log("neither orig file %s nor translated file %s for id %s exists" % (origfilename, translatedfilename, id)) log("neither orig file %s nor translated file %s for id %s exists" % (origfilename, translatedfilename, id))
# TODO: parse, create response, show error response on client, write xml on server, git commit,
...@@ -45,18 +45,15 @@ ...@@ -45,18 +45,15 @@
<xsl:if test="not($edit = 'no')"> <xsl:if test="not($edit = 'no')">
<div id="editor"> <div id="editor">
<div id="editor-inner"> <div id="editor-inner">
<p>You are editing the translation of the following original text:</p> <p>Editing <span id="editstylename">-</span>, element: <span id="editelemname">-</span>, last change: <span id="lastdate">-</span> by <span id="lastauthor">-</span></p>
<div id="original">-</div> <div id="original">-</div>
<p>Your Author ID: <p>Your Author ID: <input type="text" name="author" id="author" /></p>
<input type="text" name="author" id="author" /> <div id="pelleditor">-</div>
<span id="lasttext"> </span> <div>Markup:<div id="markup">-</div></div>
</p> <!--
<div id="pelleditor"></div> <div>Preview:<div id="render">-</div></div>
-->
</div> </div>
<div>Markup:<div id="markup"></div></div>
<!--
<div>Preview:<div id="render"></div></div>
-->
</div> </div>
<div/> <div/>
<xsl:element name="script"> <xsl:element name="script">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment