Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
9d86cbaf
Commit
9d86cbaf
authored
Mar 03, 2019
by
bbaer
Browse files
fix for #7783
parent
a292f669
Changes
1
Hide whitespace changes
Inline
Side-by-side
javascript/src/CodeCorrection.js
View file @
9d86cbaf
...
...
@@ -63,22 +63,15 @@ var QfqNS = QfqNS || {};
this
.
currentUser
=
$container
.
data
(
"
uid
"
);
var
that
=
this
;
if
(
this
.
readOnly
)
{
var
jsonAnnotations
=
this
.
$parent
.
data
(
"
annotations
"
);
this
.
annotations
=
jsonAnnotations
.
annotations
;
this
.
users
=
jsonAnnotations
.
users
;
}
else
{
if
(
this
.
$target
.
val
())
{
var
jImport
=
$
.
parseJSON
(
this
.
$target
.
val
());
if
(
jImport
.
annotations
)
{
this
.
annotations
=
jImport
.
annotations
;
console
.
log
(
"
[CodeCorrection] Imported Annotations:
"
+
this
.
annotations
.
length
);
}
if
(
jImport
.
users
)
{
this
.
users
=
jImport
.
users
;
console
.
log
(
"
[CodeCorrection] Imported Users:
"
+
this
.
users
.
length
);
}
if
(
this
.
$parent
.
data
(
"
annotations
"
))
{
var
jsonAnnotations
=
this
.
$parent
.
data
(
"
annotations
"
);
this
.
annotations
=
jsonAnnotations
.
annotations
;
this
.
users
=
jsonAnnotations
.
users
;
}
else
{
this
.
_importFromTarget
();
}
}
else
{
this
.
_importFromTarget
();
}
if
(
this
.
data
.
url
)
{
...
...
@@ -94,6 +87,20 @@ var QfqNS = QfqNS || {};
}
};
n
.
CodeCorrection
.
prototype
.
_importFromTarget
=
function
()
{
if
(
this
.
$target
.
val
())
{
var
jImport
=
$
.
parseJSON
(
this
.
$target
.
val
());
if
(
jImport
.
annotations
)
{
this
.
annotations
=
jImport
.
annotations
;
console
.
log
(
"
[CodeCorrection] Imported Annotations:
"
+
this
.
annotations
.
length
);
}
if
(
jImport
.
users
)
{
this
.
users
=
jImport
.
users
;
console
.
log
(
"
[CodeCorrection] Imported Users:
"
+
this
.
users
.
length
);
}
}
};
n
.
CodeCorrection
.
prototype
.
_prepareBuild
=
function
()
{
var
that
=
this
;
this
.
syntaxHighlight
=
new
n
.
SyntaxHighlighter
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment