Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bjcp-2015-styleguide
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frank Steinberg
bjcp-2015-styleguide
Commits
f97b42da
Commit
f97b42da
authored
5 years ago
by
Frank Steinberg
Browse files
Options
Downloads
Patches
Plain Diff
Fixes.
parent
c9cec417
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+0
-1
0 additions, 1 deletion
Makefile
web/edit.js
+11
-4
11 additions, 4 deletions
web/edit.js
web/save.cgi
+2
-4
2 additions, 4 deletions
web/save.cgi
xsl/bjcp-2015-styleguide-html.xsl
+7
-10
7 additions, 10 deletions
xsl/bjcp-2015-styleguide-html.xsl
with
20 additions
and
19 deletions
Makefile
+
0
−
1
View file @
f97b42da
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
web/edit.js
+
11
−
4
View file @
f97b42da
...
@@ -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
"
);
edit
lastdate
=
elem
.
getAttribute
(
"
date
"
);
lastauthor
=
elem
.
getAttribute
(
"
author
"
);
edit
lastauthor
=
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
);
}
}
This diff is collapsed.
Click to expand it.
web/save.cgi
+
2
−
4
View file @
f97b42da
...
@@ -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,
This diff is collapsed.
Click to expand it.
xsl/bjcp-2015-styleguide-html.xsl
+
7
−
10
View file @
f97b42da
...
@@ -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"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment