...
 
Commits (4)
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
The MIT License (MIT) 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 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 this software and associated documentation files (the “Software”), to deal in
......
{ {
"name": "drafttocode", "name": "drafttocode",
"version": "0.5.0", "version": "0.5.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "drafttocode", "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)", "description": "Webprogramm zur Erstellung von Struktogrammen / PAP sowie zur Umwandlung dessen in Code (Python, PHP, Javascript)",
"private": true, "private": true,
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch", "watch": "webpack serve",
"build": "webpack --mode production" "build": "webpack --mode production"
}, },
"repository": { "repository": {
......
...@@ -102,33 +102,43 @@ export function generateHtmltree () { ...@@ -102,33 +102,43 @@ export function generateHtmltree () {
// footer // footer
let fspan1 = document.createElement('span') let fspan1 = document.createElement('span')
fspan1.innerHTML = ('© 2019 Didaktik der Informatik') fspan1.innerHTML = ('© 2019 Didaktik der Informatik der TU Dresden')
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'
let fdiv = document.createElement('div') let fdiv = document.createElement('div')
fdiv.setAttribute('class', 'column') fdiv.setAttribute('class', 'column')
fdiv.appendChild(fspan1) fdiv.appendChild(fspan1)
fdiv.appendChild(fspan2)
fdiv.appendChild(flink)
fdiv.appendChild(fspan3)
let footer = document.createElement('footer') let footer = document.createElement('footer')
footer.appendChild(fdiv) footer.appendChild(fdiv)
document.body.appendChild(header) document.body.appendChild(header)
// append <div class="divider"></div>
document.body.appendChild(main) document.body.appendChild(main)
document.body.appendChild(footer) 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)
} }
...@@ -15,14 +15,14 @@ window.onload = function () { ...@@ -15,14 +15,14 @@ window.onload = function () {
const template = url.searchParams.get('template') const template = url.searchParams.get('template')
if (template in templates) { if (template in templates) {
if ('model' in templates[template]) { 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) model.setTree(templates[template].model)
} }
if ('lang' in templates[template]) { if ('lang' in templates[template]) {
localStorage.lang = templates[template].lang window.localStorage.lang = templates[template].lang
} }
if ('displaySourcecode' in templates[template]) { if ('displaySourcecode' in templates[template]) {
localStorage.displaySourcecode = templates[template].displaySourcecode window.localStorage.displaySourcecode = templates[template].displaySourcecode
} }
} }
} }
...@@ -41,32 +41,5 @@ window.onload = function () { ...@@ -41,32 +41,5 @@ window.onload = function () {
const importExport = new ImportExport(presenter, document.getElementById('Export')) const importExport = new ImportExport(presenter, document.getElementById('Export'))
presenter.addView(importExport) 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() presenter.init()
} }
...@@ -69,7 +69,15 @@ var config = { ...@@ -69,7 +69,15 @@ var config = {
title: 'Struktogramm', title: 'Struktogramm',
meta: { viewport: 'width=device-width, initial-scale=1, user-scalable=no' } 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) => { module.exports = (env, argv) => {
......