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
9b298896
Commit
9b298896
authored
Jan 30, 2019
by
bbaer
Browse files
Fixed initialization of code correction
parent
84a1b4af
Pipeline
#1443
passed with stage
in 1 minute and 58 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Resources/Public/Json/javascript.json
0 → 100644
View file @
9b298896
{
"language"
:
"javascript"
,
"classes"
:
[
{
"position"
:
0
,
"name"
:
"qfqSyntaxDoc"
,
"description"
:
"jsDoc"
},
{
"position"
:
1
,
"name"
:
"qfqSyntaxWord"
,
"description"
:
"Reserved Words"
},
{
"position"
:
2
,
"name"
:
"qfqSyntaxData"
,
"description"
:
"Datatypes"
}
],
"multiLine"
:
[
{
"start"
:
"(
\/\\
*
\\
*)(.*)$"
,
"end"
:
"(
\\
*
\/
)(.*)$"
,
"styleId"
:
0
}
],
"singleWord"
:
[
{
"regex"
:
"^(.*)(
\\\"
.*
\\\"
)(.*)$"
,
"styleId"
:
2
},
{
"regex"
:
"(.*)(function)(.*)"
,
"styleId"
:
1
},
{
"regex"
:
"^(.*)( if )(.*)$"
,
"styleId"
:
1
},
{
"regex"
:
"^(.*)( for )(.*)$"
,
"styleId"
:
1
},
{
"regex"
:
"^(.*)(this)(.*)$"
,
"styleId"
:
1
},
{
"regex"
:
"^(.*)( var )(/*)$"
,
"styleId"
:
1
},
{
"regex"
:
"^(.*)([0-9]+)(.*)$"
,
"styleId"
:
2
}
]
}
\ No newline at end of file
javascript/src/CodeCorrection.js
View file @
9b298896
...
...
@@ -52,8 +52,11 @@ var QfqNS = QfqNS || {};
this
.
$parent
=
$container
;
this
.
$target
=
$
(
"
#
"
+
$container
.
data
(
"
target
"
));
this
.
data
=
{
url
:
$container
.
data
(
"
file
"
)
url
:
this
.
$parent
.
data
(
"
file
"
),
text
:
this
.
$parent
.
data
(
"
text
"
)
};
this
.
language
=
this
.
$parent
.
data
(
"
highlight
"
)
||
"
typo3conf/ext/qfq/Resources/Public/Json/javascript.json
"
;
console
.
log
(
this
.
data
);
this
.
currentUser
=
$container
.
data
(
"
uid
"
);
var
that
=
this
;
if
(
this
.
$target
.
val
())
{
...
...
@@ -72,6 +75,7 @@ var QfqNS = QfqNS || {};
// Get data of a file and write it to data.text
$
.
get
(
this
.
data
.
url
,
function
(
response
)
{
that
.
data
.
text
=
response
;
console
.
log
(
response
);
that
.
_prepareBuild
();
});
}
else
if
(
this
.
data
.
text
)
{
...
...
@@ -170,15 +174,14 @@ var QfqNS = QfqNS || {};
class
:
'
pull-left qfqLineCount
'
,
text
:
lineCount
});
var
cLine
=
line
.
replace
(
/
\s
/g
,
'
'
)
var
cLine
=
line
.
replace
(
'
&
'
,
'
&
'
)
.
replace
(
'
;
'
,
'
;
'
)
.
replace
(
'
<
'
,
'
<
'
)
.
replace
(
'
>
'
,
'
>
'
)
.
replace
(
'
&
'
,
'
&
'
)
.
replace
(
'
;
'
,
'
;
'
)
.
replace
(
/
\s
/g
,
'
'
)
.
replace
(
'
"
'
,
'
"
'
)
.
replace
(
'
\'
'
,
'
'
'
)
.
replace
(
'
\\
'
,
'
\
'
)
.
replace
(
'
/
'
,
'
/
'
);
.
replace
(
'
\\
'
,
'
\
'
);
cLine
=
this
.
syntaxHighlight
.
highlightLine
(
cLine
);
var
htmlCodeLine
=
$
(
'
<div/>
'
,
{
class
:
'
pull-right qfqCode
'
...
...
javascript/src/Element/ElementBuilder.js
View file @
9b298896
...
...
@@ -91,9 +91,6 @@ var QfqNS = QfqNS || {};
n
.
ElementBuilder
.
prototype
.
_buildInput
=
function
()
{
var
$block
=
{};
if
(
this
.
type
!==
"
hidden
"
)
{
$block
=
this
.
_buildBlock
(
this
.
width
);
}
var
options
=
{
class
:
this
.
_getOption
(
this
.
class
),
...
...
@@ -106,6 +103,12 @@ var QfqNS = QfqNS || {};
options
.
checked
=
this
.
checked
;
}
if
(
this
.
type
!==
"
hidden
"
)
{
$block
=
this
.
_buildBlock
(
this
.
width
);
}
else
{
options
.
required
=
false
;
}
var
$input
=
$
(
"
<input />
"
,
options
);
if
(
this
.
onClick
===
"
submit
"
)
{
...
...
@@ -119,6 +122,7 @@ var QfqNS = QfqNS || {};
$block
.
append
(
$input
);
return
$block
;
}
else
{
$input
.
removeAttr
(
"
pattern
"
);
return
$input
;
}
};
...
...
mockup/codeCorrection.html
View file @
9b298896
...
...
@@ -46,7 +46,7 @@
data-uid=
'{uid: 5, name: "Definitely not an AI", avatar: "mockData/avatar1.png"}'
data-file=
"../javascript/src/CodeCorrection.js"
data-target=
"codeCorrection-output1"
data-highlight=
"javascript"
data-highlight=
"
mockData/
javascript
.json
"
>
</div>
<input
id=
"codeCorrection-output1"
name=
"correction-data"
type=
"hidden"
...
...
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