Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
8b27ddf5
Commit
8b27ddf5
authored
4 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
68eb1d19
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/static/js/nopaque.lists.js
+6
-6
6 additions, 6 deletions
app/static/js/nopaque.lists.js
with
6 additions
and
6 deletions
app/static/js/nopaque.lists.js
+
6
−
6
View file @
8b27ddf5
...
@@ -177,7 +177,7 @@ class ResultsList extends List {
...
@@ -177,7 +177,7 @@ class ResultsList extends List {
);
);
}
}
HTMLTStroElement
(
htmlStr
)
{
HTMLTStr
T
oElement
(
htmlStr
)
{
// https://stackoverflow.com/questions/494143/creating-a-new-dom-element-from-an-html-string-using-built-in-dom-methods-or-pro/35385518#35385518
// https://stackoverflow.com/questions/494143/creating-a-new-dom-element-from-an-html-string-using-built-in-dom-methods-or-pro/35385518#35385518
let
template
=
document
.
createElement
(
"
template
"
);
let
template
=
document
.
createElement
(
"
template
"
);
htmlStr
=
htmlStr
.
trim
();
htmlStr
=
htmlStr
.
trim
();
...
@@ -229,7 +229,7 @@ class ResultsList extends List {
...
@@ -229,7 +229,7 @@ class ResultsList extends List {
`data-cpos="
${
cpos
}
">`
+
`data-cpos="
${
cpos
}
">`
+
`
${
token
.
word
}
`
+
`
${
token
.
word
}
`
+
`</span>`
;
`</span>`
;
tokenHTMlElement
=
this
.
HTMLTStroElement
(
htmlTokenStr
)
tokenHTMlElement
=
this
.
HTMLTStr
T
oElement
(
htmlTokenStr
)
tokenHTMLArray
.
push
(
tokenHTMlElement
);
tokenHTMLArray
.
push
(
tokenHTMlElement
);
}
}
for
(
let
cpos
of
c
)
{
for
(
let
cpos
of
c
)
{
...
@@ -241,7 +241,7 @@ class ResultsList extends List {
...
@@ -241,7 +241,7 @@ class ResultsList extends List {
`style="text-decoration-line: underline;">`
+
`style="text-decoration-line: underline;">`
+
`
${
token
.
word
}
`
+
`
${
token
.
word
}
`
+
`</span>`
;
`</span>`
;
tokenHTMlElement
=
this
.
HTMLTStroElement
(
htmlTokenStr
)
tokenHTMlElement
=
this
.
HTMLTStr
T
oElement
(
htmlTokenStr
)
tokenHTMLArray
.
push
(
tokenHTMlElement
);
tokenHTMLArray
.
push
(
tokenHTMlElement
);
}
}
for
(
let
cpos
of
rc
)
{
for
(
let
cpos
of
rc
)
{
...
@@ -252,7 +252,7 @@ class ResultsList extends List {
...
@@ -252,7 +252,7 @@ class ResultsList extends List {
`data-cpos="
${
cpos
}
">`
+
`data-cpos="
${
cpos
}
">`
+
`
${
token
.
word
}
`
+
`
${
token
.
word
}
`
+
`</span>`
;
`</span>`
;
tokenHTMlElement
=
this
.
HTMLTStroElement
(
htmlTokenStr
)
tokenHTMlElement
=
this
.
HTMLTStr
T
oElement
(
htmlTokenStr
)
tokenHTMLArray
.
push
(
tokenHTMlElement
);
tokenHTMLArray
.
push
(
tokenHTMlElement
);
}
}
console
.
log
(
tokenHTMLArray
);
console
.
log
(
tokenHTMLArray
);
...
@@ -260,8 +260,8 @@ class ResultsList extends List {
...
@@ -260,8 +260,8 @@ class ResultsList extends List {
partElement
=
document
.
createElement
(
"
p
"
);
partElement
=
document
.
createElement
(
"
p
"
);
for
(
let
sId
of
uniqueS
)
{
for
(
let
sId
of
uniqueS
)
{
let
htmlSentence
=
`<div class="sentence
s12
" data-sid="
${
sId
}
">`
;
let
htmlSentence
=
`<div class="sentence" data-sid="
${
sId
}
">
</div>
`
;
let
sentenceElement
=
this
.
HTMLTStroElement
(
htmlSentence
);
let
sentenceElement
=
this
.
HTMLTStr
T
oElement
(
htmlSentence
);
for
(
let
tokenElement
of
tokenHTMLArray
)
{
for
(
let
tokenElement
of
tokenHTMLArray
)
{
if
(
tokenElement
.
dataset
.
sid
==
sId
)
{
if
(
tokenElement
.
dataset
.
sid
==
sId
)
{
sentenceElement
.
appendChild
(
tokenElement
);
sentenceElement
.
appendChild
(
tokenElement
);
...
...
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