Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
draftToCode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Didaktik der Informatik
ovk-informatik
draftToCode
Compare Revisions
1512a7b0ece771b736fac2d21516714f47d583c7...3ff98a9360866f61bbfe38c01d4d34019a215ad8
Source
3ff98a9360866f61bbfe38c01d4d34019a215ad8
Select Git revision
...
Target
1512a7b0ece771b736fac2d21516714f47d583c7
Select Git revision
Compare
Commits (4)
auto reload webpack serve
· 72043b28
Thiemo
authored
Dec 17, 2019
72043b28
Licence
· a7f4d6c5
Thiemo
authored
Dec 17, 2019
minor changes
a7f4d6c5
0.5.1
· 857e41d5
Thiemo
authored
Dec 17, 2019
857e41d5
add auto build
· 3ff98a93
Thiemo
authored
Dec 17, 2019
3ff98a93
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
53 deletions
+71
-53
.gitlab-ci.yml
.gitlab-ci.yml
+27
-0
license.md
license.md
+1
-1
package-lock.json
package-lock.json
+1
-1
package.json
package.json
+2
-2
src/helpers/generator.js
src/helpers/generator.js
+28
-18
src/index.js
src/index.js
+3
-30
webpack.config.js
webpack.config.js
+9
-1
No files found.
.gitlab-ci.yml
0 → 100644
View file @
3ff98a93
stages
:
-
build
buildGame
:
image
:
node:latest
stage
:
build
script
:
-
PATH="./node_modules/.bin:$PATH"
-
npm install
-
npm build
-
cd build
-
tar -czf tool.tar.gz *
-
mv ./tool.tar.gz ..
artifacts
:
paths
:
-
tool.tar.gz
deployGame
:
image
:
alpine:latest
stage
:
deploy
script
:
-
apk add --no-cache curl
-
curl -v --data-binary @game.tar.gz ${DEPLOY_URL}/${CI_PROJECT_NAME}?token=${DEPLOY_TOKEN} | cat
variables
:
GIT_STRATEGY
:
none
only
:
-
webpack
license.md
View file @
3ff98a93
The MIT License (MIT)
Copyright © 2019
Klaus Ramm
Copyright © 2019
Didaktik der Informatik der TU Dresden
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
...
...
package-lock.json
View file @
3ff98a93
{
"name"
:
"drafttocode"
,
"version"
:
"0.5.
0
"
,
"version"
:
"0.5.
1
"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
...
...
package.json
View file @
3ff98a93
{
"name"
:
"drafttocode"
,
"version"
:
"0.5.
0
"
,
"version"
:
"0.5.
1
"
,
"description"
:
"Webprogramm zur Erstellung von Struktogrammen / PAP sowie zur Umwandlung dessen in Code (Python, PHP, Javascript)"
,
"private"
:
true
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"watch"
:
"webpack
--watch
"
,
"watch"
:
"webpack
serve
"
,
"build"
:
"webpack --mode production"
},
"repository"
:
{
...
...
src/helpers/generator.js
View file @
3ff98a93
...
...
@@ -102,33 +102,43 @@ export function generateHtmltree () {
// footer
let
fspan1
=
document
.
createElement
(
'
span
'
)
fspan1
.
innerHTML
=
(
'
© 2019 Didaktik der Informatik
'
)
let
fspan2
=
document
.
createElement
(
'
span
'
)
fspan2
.
innerHTML
=
'
(
'
let
fspan3
=
document
.
createElement
(
'
span
'
)
fspan3
.
innerHTML
=
'
)
'
let
flink
=
document
.
createElement
(
'
a
'
)
let
ftext
=
document
.
createTextNode
(
'
MIT License
'
)
// strong
flink
.
innerHTML
=
ftext
flink
.
title
=
''
flink
.
href
=
'
license.html
'
fspan1
.
innerHTML
=
(
'
© 2019 Didaktik der Informatik der TU Dresden
'
)
let
fdiv
=
document
.
createElement
(
'
div
'
)
fdiv
.
setAttribute
(
'
class
'
,
'
column
'
)
fdiv
.
appendChild
(
fspan1
)
fdiv
.
appendChild
(
fspan2
)
fdiv
.
appendChild
(
flink
)
fdiv
.
appendChild
(
fspan3
)
let
footer
=
document
.
createElement
(
'
footer
'
)
footer
.
appendChild
(
fdiv
)
document
.
body
.
appendChild
(
header
)
// append <div class="divider"></div>
document
.
body
.
appendChild
(
main
)
document
.
body
.
appendChild
(
footer
)
// reset button must be last defined
let
resetButtonDiv
=
document
.
createElement
(
'
div
'
)
resetButtonDiv
.
classList
.
add
(
'
options-element
'
,
'
resetIcon
'
,
'
tooltip
'
,
'
tooltip-bottom
'
,
'
hand
'
)
resetButtonDiv
.
setAttribute
(
'
data-tooltip
'
,
'
Reset
'
)
resetButtonDiv
.
addEventListener
(
'
click
'
,
()
=>
{
const
content
=
document
.
getElementById
(
'
modal-content
'
)
const
footer
=
document
.
getElementById
(
'
modal-footer
'
)
while
(
content
.
hasChildNodes
())
{
content
.
removeChild
(
content
.
lastChild
)
}
while
(
footer
.
hasChildNodes
())
{
footer
.
removeChild
(
footer
.
lastChild
)
}
content
.
appendChild
(
document
.
createTextNode
(
'
Alles löschen?
'
))
const
doButton
=
document
.
createElement
(
'
div
'
)
doButton
.
classList
.
add
(
'
modal-buttons
'
,
'
acceptIcon
'
,
'
hand
'
)
doButton
.
addEventListener
(
'
click
'
,
()
=>
presenter
.
resetModel
())
footer
.
appendChild
(
doButton
)
const
cancelButton
=
document
.
createElement
(
'
div
'
)
cancelButton
.
classList
.
add
(
'
modal-buttons
'
,
'
deleteIcon
'
,
'
hand
'
)
cancelButton
.
addEventListener
(
'
click
'
,
()
=>
document
.
getElementById
(
'
IEModal
'
).
classList
.
remove
(
'
active
'
))
footer
.
appendChild
(
cancelButton
)
document
.
getElementById
(
'
IEModal
'
).
classList
.
add
(
'
active
'
)
})
document
.
getElementById
(
'
optionButtons
'
).
appendChild
(
resetButtonDiv
)
}
src/index.js
View file @
3ff98a93
...
...
@@ -15,14 +15,14 @@ window.onload = function () {
const
template
=
url
.
searchParams
.
get
(
'
template
'
)
if
(
template
in
templates
)
{
if
(
'
model
'
in
templates
[
template
])
{
localStorage
.
tree
=
JSON
.
stringify
(
templates
[
template
].
model
)
window
.
localStorage
.
tree
=
JSON
.
stringify
(
templates
[
template
].
model
)
model
.
setTree
(
templates
[
template
].
model
)
}
if
(
'
lang
'
in
templates
[
template
])
{
localStorage
.
lang
=
templates
[
template
].
lang
window
.
localStorage
.
lang
=
templates
[
template
].
lang
}
if
(
'
displaySourcecode
'
in
templates
[
template
])
{
localStorage
.
displaySourcecode
=
templates
[
template
].
displaySourcecode
window
.
localStorage
.
displaySourcecode
=
templates
[
template
].
displaySourcecode
}
}
}
...
...
@@ -41,32 +41,5 @@ window.onload = function () {
const
importExport
=
new
ImportExport
(
presenter
,
document
.
getElementById
(
'
Export
'
))
presenter
.
addView
(
importExport
)
// reset button must be last defined
let
resetButtonDiv
=
document
.
createElement
(
'
div
'
)
resetButtonDiv
.
classList
.
add
(
'
options-element
'
,
'
resetIcon
'
,
'
tooltip
'
,
'
tooltip-bottom
'
,
'
hand
'
)
resetButtonDiv
.
setAttribute
(
'
data-tooltip
'
,
'
Reset
'
)
resetButtonDiv
.
addEventListener
(
'
click
'
,
()
=>
{
const
content
=
document
.
getElementById
(
'
modal-content
'
)
const
footer
=
document
.
getElementById
(
'
modal-footer
'
)
while
(
content
.
hasChildNodes
())
{
content
.
removeChild
(
content
.
lastChild
)
}
while
(
footer
.
hasChildNodes
())
{
footer
.
removeChild
(
footer
.
lastChild
)
}
content
.
appendChild
(
document
.
createTextNode
(
'
Alles löschen?
'
))
const
doButton
=
document
.
createElement
(
'
div
'
)
doButton
.
classList
.
add
(
'
modal-buttons
'
,
'
acceptIcon
'
,
'
hand
'
)
doButton
.
addEventListener
(
'
click
'
,
()
=>
presenter
.
resetModel
())
footer
.
appendChild
(
doButton
)
const
cancelButton
=
document
.
createElement
(
'
div
'
)
cancelButton
.
classList
.
add
(
'
modal-buttons
'
,
'
deleteIcon
'
,
'
hand
'
)
cancelButton
.
addEventListener
(
'
click
'
,
()
=>
document
.
getElementById
(
'
IEModal
'
).
classList
.
remove
(
'
active
'
))
footer
.
appendChild
(
cancelButton
)
document
.
getElementById
(
'
IEModal
'
).
classList
.
add
(
'
active
'
)
})
document
.
getElementById
(
'
optionButtons
'
).
appendChild
(
resetButtonDiv
)
presenter
.
init
()
}
webpack.config.js
View file @
3ff98a93
...
...
@@ -69,7 +69,15 @@ var config = {
title
:
'
Struktogramm
'
,
meta
:
{
viewport
:
'
width=device-width, initial-scale=1, user-scalable=no
'
}
})
]
],
devServer
:
{
port
:
8080
,
contentBase
:
'
./src
'
,
watchOptions
:
{
poll
:
true
},
open
:
true
}
}
module
.
exports
=
(
env
,
argv
)
=>
{
...
...