2.1
parent
55ec581373
commit
1520711a5c
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Theenoro
|
||||
|
||||
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 the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -1,2 +1,5 @@
|
|||
# wochenbericht-manager
|
||||
# Wochenbericht Manager
|
||||
|
||||
[](https://gitlab.thee.moe/theenoro/wochenbericht-manager/commits/master)
|
||||
|
||||
[Online Version](https://wbm.lucajaents.ch)
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "wochenbericht-manager",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"chance": "^1.0.16",
|
||||
"jspdf": "^1.4.1",
|
||||
"moment": "^2.22.2",
|
||||
"nunjucks": "^3.1.3",
|
||||
"random-weighted-choice": "^0.1.3",
|
||||
"rc-tabs": "^9.3.1",
|
||||
"react": "^16.4.1",
|
||||
"react-dom": "^16.4.1",
|
||||
"react-infinite-calendar": "^2.3.1",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"react-scripts": "1.1.4",
|
||||
"shuffle-array": "^1.0.1",
|
||||
"sql.js": "^0.5.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject",
|
||||
"less": "less-watch-compiler ./src_less ./public/ main.less"
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="theme-color" content="#000000">
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is added to the
|
||||
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||
<link rel="stylesheet" href="%PUBLIC_URL%/main.css">
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
You need to enable JavaScript to run this app.
|
||||
</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,895 @@
|
|||
@font-face {
|
||||
font-family: 'Exo';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Exo Regular'), local('Exo-Regular'), url(/font/exo.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Exo', monospace !important;
|
||||
}
|
||||
#container {
|
||||
display: flex;
|
||||
}
|
||||
#nav {
|
||||
height: 100vh;
|
||||
width: 200px;
|
||||
line-height: 50px;
|
||||
box-shadow: 0 0 5px #454545;
|
||||
background-color: #3C6F9B;
|
||||
color: #fff;
|
||||
}
|
||||
#nav .header {
|
||||
background-color: #004F5B;
|
||||
height: 98px;
|
||||
line-height: 98px;
|
||||
font-size: 41px;
|
||||
text-align: center;
|
||||
text-shadow: 1px 1px 3px #000000;
|
||||
}
|
||||
#nav button {
|
||||
display: block;
|
||||
margin: 5px;
|
||||
padding: 10px;
|
||||
width: calc(100% - 10px);
|
||||
background: none;
|
||||
border: none;
|
||||
color: #ffffff;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
text-align: left;
|
||||
border-bottom: 3px solid;
|
||||
border-color: transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
#nav button:hover {
|
||||
border-color: white;
|
||||
}
|
||||
#content {
|
||||
width: calc(100% - 200px);
|
||||
}
|
||||
#content > div {
|
||||
box-shadow: 0px 0px 5px #454545;
|
||||
}
|
||||
#editor-frame {
|
||||
display: flex;
|
||||
}
|
||||
#editor-frame #mask {
|
||||
width: 100%;
|
||||
}
|
||||
#editor-frame #mask .header {
|
||||
display: block;
|
||||
min-height: 98px;
|
||||
background-color: #004F5B;
|
||||
}
|
||||
#editor-frame #mask .lower-header {
|
||||
height: 49px;
|
||||
display: block;
|
||||
background-color: #004F5B;
|
||||
}
|
||||
#editor-frame #mask .inputGroup {
|
||||
font: 16px 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
padding: 10px;
|
||||
}
|
||||
#editor-frame #mask .inputGroup .input {
|
||||
border-bottom: 1px solid #a2a2a2;
|
||||
padding: 5px;
|
||||
}
|
||||
#editor-frame #mask .inputGroup label {
|
||||
display: block;
|
||||
}
|
||||
#editor-frame #mask .inputGroup input,
|
||||
#editor-frame #mask .inputGroup textarea {
|
||||
width: 100%;
|
||||
font: 16px 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
input {
|
||||
padding: 5px;
|
||||
height: 34px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#generator-frame textarea {
|
||||
min-height: 337px;
|
||||
min-width: 604px;
|
||||
}
|
||||
#generator-frame .rc-tabs-tabpane {
|
||||
vertical-align: top;
|
||||
}
|
||||
button.btn,
|
||||
button {
|
||||
margin: 5px;
|
||||
padding: 10px;
|
||||
background: #FFF;
|
||||
border: 3px solid #004F5B;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
button.btn.success,
|
||||
button.success {
|
||||
border-color: #62D6CE;
|
||||
background: #62D6CE;
|
||||
color: #F9F9E8;
|
||||
}
|
||||
button.btn.success:hover,
|
||||
button.success:hover {
|
||||
border-color: #EDD1A1;
|
||||
background: #62D6CE;
|
||||
}
|
||||
#generator-frame .header {
|
||||
height: 98px;
|
||||
background-color: #004F5B;
|
||||
color: #FFF;
|
||||
line-height: 98px;
|
||||
padding: 0 25px;
|
||||
font-size: 30px;
|
||||
}
|
||||
/*
|
||||
* Range selection styles
|
||||
*/
|
||||
.Cal__Day__root {
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width: 14.28571%;
|
||||
list-style: none;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.Cal__Day__root:first-child {
|
||||
position: relative;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__enabled.Cal__Day__highlighted {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__enabled.Cal__Day__highlighted:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
margin-top: -26px;
|
||||
margin-left: -26px;
|
||||
border-radius: 50%;
|
||||
background-color: #EFEFEF;
|
||||
z-index: -1;
|
||||
opacity: 1;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__enabled:active {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__enabled:active:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
margin-top: -26px;
|
||||
margin-left: -26px;
|
||||
border-radius: 50%;
|
||||
background-color: #EFEFEF;
|
||||
z-index: -1;
|
||||
opacity: 1;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__enabled:hover {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__enabled:hover:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
margin-top: -26px;
|
||||
margin-left: -26px;
|
||||
border-radius: 50%;
|
||||
background-color: #EFEFEF;
|
||||
z-index: -1;
|
||||
opacity: 0.5;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__today {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__today > span {
|
||||
color: #3d3d3d;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__today:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
margin-top: -26px;
|
||||
margin-left: -26px;
|
||||
border-radius: 50%;
|
||||
box-shadow: inset 0 0 0 1px;
|
||||
z-index: -1;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__today.Cal__Day__disabled > span {
|
||||
color: #AAA;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__today.Cal__Day__disabled:before {
|
||||
box-shadow: inset 0 0 0 1px #BBB;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__selected {
|
||||
position: relative;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__selected > .Cal__Day__month {
|
||||
display: none;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__selected > .Cal__Day__year {
|
||||
display: none;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__selected:before {
|
||||
display: none;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__selected .Cal__Day__selection {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
margin-top: -26px;
|
||||
margin-left: -26px;
|
||||
border-radius: 50%;
|
||||
line-height: 56px;
|
||||
z-index: 2;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__selected .Cal__Day__selection .Cal__Day__month {
|
||||
top: 9px;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__selected .Cal__Day__selection .Cal__Day__day {
|
||||
position: relative;
|
||||
top: 5px;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
}
|
||||
.Cal__Day__root.Cal__Day__disabled {
|
||||
color: #AAA;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.Cal__Day__month {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
text-transform: capitalize;
|
||||
top: 5px;
|
||||
}
|
||||
.Cal__Day__year {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
text-transform: capitalize;
|
||||
bottom: 5px;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__start:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 50%;
|
||||
height: 52px;
|
||||
margin-top: -26px;
|
||||
box-shadow: inset 56px 56px;
|
||||
right: 0;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__start .Cal__Day__selection {
|
||||
border-top-left-radius: 50%;
|
||||
border-bottom-left-radius: 50%;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__end:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 50%;
|
||||
height: 52px;
|
||||
margin-top: -26px;
|
||||
box-shadow: inset 56px 56px;
|
||||
left: 0;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__end .Cal__Day__selection {
|
||||
border-top-right-radius: 50%;
|
||||
border-bottom-right-radius: 50%;
|
||||
color: inherit !important;
|
||||
background-color: #FFF !important;
|
||||
border: 2px solid;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__end .Cal__Day__selection .Cal__Day__day {
|
||||
top: 4px;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__disabled .Cal__Day__selection.Cal__Day__selection {
|
||||
background-color: #EEE !important;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__disabled .Cal__Day__selection.Cal__Day__selection .Cal__Day__day {
|
||||
color: #AAA;
|
||||
font-weight: 300;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__disabled .Cal__Day__selection.Cal__Day__selection .Cal__Day__month {
|
||||
color: #AAA;
|
||||
font-weight: 300;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__start.Cal__Day__end:after {
|
||||
display: none;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__betweenRange .Cal__Day__selection {
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 0;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__betweenRange .Cal__Day__day {
|
||||
top: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
.Cal__Day__range.Cal__Day__selected.Cal__Day__betweenRange .Cal__Day__month {
|
||||
display: none;
|
||||
}
|
||||
.Cal__Container__root {
|
||||
position: relative;
|
||||
display: table;
|
||||
z-index: 1;
|
||||
font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
line-height: 1.4em;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
font-weight: 300;
|
||||
outline: none;
|
||||
text-align: left;
|
||||
}
|
||||
.Cal__Container__root.Cal__Container__landscape {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.Cal__Container__root.Cal__Container__landscape .Cal__Container__wrapper {
|
||||
position: relative;
|
||||
flex-grow: 1;
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
border-top-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
}
|
||||
.Cal__Container__listWrapper {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background-color: #FFF;
|
||||
}
|
||||
.Cal__Header__root {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
min-height: 98px;
|
||||
padding: 20px;
|
||||
line-height: 1.3;
|
||||
font-weight: 400;
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
}
|
||||
.Cal__Header__root.Cal__Header__landscape {
|
||||
align-items: flex-start;
|
||||
min-width: 200px;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
.Cal__Header__root.Cal__Header__landscape .Cal__Header__dateWrapper.Cal__Header__day {
|
||||
flex-grow: 1;
|
||||
height: 76px;
|
||||
}
|
||||
.Cal__Header__wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
.Cal__Header__wrapper.Cal__Header__blank {
|
||||
height: 58px;
|
||||
line-height: 58px;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
font-size: 18px;
|
||||
cursor: default;
|
||||
}
|
||||
.Cal__Header__dateWrapper {
|
||||
position: relative;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
.Cal__Header__dateWrapper.Cal__Header__active {
|
||||
color: white;
|
||||
}
|
||||
.Cal__Header__dateWrapper.Cal__Header__day {
|
||||
height: 38px;
|
||||
font-size: 36px;
|
||||
line-height: 36px;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
.Cal__Header__dateWrapper.Cal__Header__year {
|
||||
height: 20px;
|
||||
font-size: 18px;
|
||||
line-height: 18px;
|
||||
}
|
||||
.Cal__Header__date {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.Cal__Header__range {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.Cal__Header__range .Cal__Header__dateWrapper {
|
||||
overflow: visible;
|
||||
}
|
||||
.Cal__Header__range .Cal__Header__wrapper:first-child:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-top: -50px;
|
||||
margin-left: -50px;
|
||||
border-top: 100px solid transparent;
|
||||
border-bottom: 100px solid transparent;
|
||||
border-left: 60px solid;
|
||||
color: rgba(255, 255, 255, 0.15);
|
||||
transform: translateX(1px);
|
||||
}
|
||||
.Cal__Header__range .Cal__Header__wrapper:first-child:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-top: -50px;
|
||||
margin-left: -50px;
|
||||
border-top: 100px solid transparent;
|
||||
border-bottom: 100px solid transparent;
|
||||
border-left: 60px solid;
|
||||
}
|
||||
.Cal__Header__range .Cal__Header__wrapper:last-child {
|
||||
margin-left: 60px;
|
||||
}
|
||||
.Cal__Header__range .Cal__Header__wrapper .Cal__Header__date {
|
||||
white-space: nowrap;
|
||||
z-index: 1;
|
||||
}
|
||||
.Cal__Today__root {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 32px;
|
||||
padding: 6px;
|
||||
box-sizing: border-box;
|
||||
transform: translate3d(0, -100%, 0);
|
||||
font-weight: 500;
|
||||
line-height: 0;
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
transition: transform 0.3s ease;
|
||||
transition-delay: 0.3s;
|
||||
}
|
||||
.Cal__Today__root .Cal__Today__chevron {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
margin-left: 5px;
|
||||
transform: rotate(270deg);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
.Cal__Today__root.Cal__Today__show {
|
||||
transform: translate3d(0, 0, 0);
|
||||
transition-delay: 0s;
|
||||
}
|
||||
.Cal__Today__root.Cal__Today__show .Cal__Today__chevron {
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
.Cal__Today__root.Cal__Today__chevronUp .Cal__Today__chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.Cal__Today__root.Cal__Today__chevronDown .Cal__Today__chevron {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
.Cal__MonthList__root {
|
||||
width: 100% !important;
|
||||
background-color: #FFF;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.Cal__MonthList__root.Cal__MonthList__scrolling > div {
|
||||
pointer-events: none;
|
||||
}
|
||||
.Cal__MonthList__root.Cal__MonthList__scrolling label {
|
||||
opacity: 1;
|
||||
}
|
||||
.Cal__Weekdays__root {
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
display: flex;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
box-shadow: inset 0 -1px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.Cal__Weekdays__day {
|
||||
padding: 15px 0;
|
||||
flex-basis: 14.28571%;
|
||||
flex-grow: 1;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
}
|
||||
.Cal__Years__root {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
.Cal__Years__root:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.Cal__Years__root:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
bottom: 0;
|
||||
background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 100%);
|
||||
}
|
||||
.Cal__Years__list {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.Cal__Years__list.Cal__Years__center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.Cal__Years__year {
|
||||
display: flex;
|
||||
padding: 0 20px;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.Cal__Years__year label {
|
||||
flex-basis: 42%;
|
||||
}
|
||||
.Cal__Years__year label span {
|
||||
flex-shrink: 0;
|
||||
color: #333;
|
||||
}
|
||||
.Cal__Years__year ol {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.Cal__Years__year ol li {
|
||||
display: flex;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
list-style: none;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
color: #444;
|
||||
font-weight: 400;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
.Cal__Years__year ol li:hover {
|
||||
background-color: #EFEFEF;
|
||||
}
|
||||
.Cal__Years__year ol li.Cal__Years__currentMonth {
|
||||
border: 1px solid;
|
||||
}
|
||||
.Cal__Years__year ol li.Cal__Years__selected {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background-color: blue;
|
||||
color: #FFF !important;
|
||||
border: 0;
|
||||
}
|
||||
.Cal__Years__year ol li.Cal__Years__disabled {
|
||||
cursor: not-allowed;
|
||||
color: #AAA;
|
||||
}
|
||||
.Cal__Years__year ol li.Cal__Years__disabled:hover {
|
||||
background-color: inherit;
|
||||
}
|
||||
.Cal__Years__year:hover {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
.Cal__Years__year:hover label > span {
|
||||
color: inherit;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__withMonths {
|
||||
border-bottom: 1px solid #E9E9E9;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__withMonths label {
|
||||
height: 88px;
|
||||
padding-top: 12px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__active {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
font-size: 32px;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__active label > span {
|
||||
color: inherit;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__currentYear {
|
||||
position: relative;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__currentYear label > span {
|
||||
min-width: 50px;
|
||||
padding-bottom: 5px;
|
||||
border-bottom: 3px solid;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__currentYear.Cal__Years__active label > span {
|
||||
min-width: 85px;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__first {
|
||||
padding-top: 40px;
|
||||
}
|
||||
.Cal__Years__year.Cal__Years__last {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
.Cal__Animation__enter {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, -100%, 0);
|
||||
transition: 0.25s ease;
|
||||
}
|
||||
.Cal__Animation__enter.Cal__Animation__enterActive {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
.Cal__Animation__leave {
|
||||
transform: translate3d(0, 0, 0);
|
||||
transition: 0.25s ease;
|
||||
}
|
||||
.Cal__Animation__leave.Cal__Animation__leaveActive {
|
||||
opacity: 0;
|
||||
transform: translate3d(0, 100%, 0);
|
||||
}
|
||||
.Cal__Slider__root {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.Cal__Slider__slide {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 20px 65px;
|
||||
}
|
||||
.Cal__Slider__slide:first-child {
|
||||
padding-left: 20px;
|
||||
}
|
||||
.Cal__Slider__wrapper {
|
||||
height: 100%;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
.Cal__Slider__arrow {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 100%;
|
||||
opacity: 0.7;
|
||||
cursor: pointer;
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.Cal__Slider__arrow svg {
|
||||
width: 15px;
|
||||
}
|
||||
.Cal__Slider__arrow:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
.Cal__Slider__arrowRight {
|
||||
right: 0;
|
||||
}
|
||||
.Cal__Slider__arrowLeft {
|
||||
left: 0;
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
.Cal__transition__enter {
|
||||
opacity: 0;
|
||||
}
|
||||
.Cal__transition__enterActive {
|
||||
opacity: 1;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
.Cal__transition__leave {
|
||||
opacity: 1;
|
||||
}
|
||||
.Cal__transition__leaveActive {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
.Cal__Month__rows {
|
||||
position: relative;
|
||||
background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.05) 100%);
|
||||
}
|
||||
.Cal__Month__row {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.Cal__Month__row:first-child {
|
||||
text-align: right;
|
||||
}
|
||||
.Cal__Month__row:first-child li {
|
||||
background-color: #FFF;
|
||||
box-shadow: 0 -1px 0 #E9E9E9;
|
||||
}
|
||||
.Cal__Month__row:nth-child(2) {
|
||||
box-shadow: 0 -1px 0 #E9E9E9;
|
||||
}
|
||||
.Cal__Month__row.Cal__Month__partial:first-child li:first-child {
|
||||
box-shadow: 0px -1px 0 #E9E9E9, inset 1px 0 0 #E9E9E9;
|
||||
}
|
||||
.Cal__Month__row.Cal__Month__partial:last-of-type li {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.Cal__Month__label {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
font-size: 30px;
|
||||
font-weight: 500;
|
||||
z-index: 3;
|
||||
pointer-events: none;
|
||||
background-color: rgba(255, 255, 255, 0.6);
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
.Cal__Month__label > span {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
.Cal__Month__label.Cal__Month__partialFirstRow {
|
||||
top: 56px;
|
||||
}
|
||||
.rc-tabs {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.rc-tabs .rc-tabs-ink-bar {
|
||||
display: none !important;
|
||||
}
|
||||
.rc-tabs .rc-tabs-nav {
|
||||
display: flex;
|
||||
background-color: #3C6F9B;
|
||||
color: #FFF;
|
||||
font-size: 15px;
|
||||
height: 49px;
|
||||
line-height: 33px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.rc-tabs .rc-tabs-nav .rc-tabs-tab {
|
||||
width: auto;
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.rc-tabs .rc-tabs-nav .rc-tabs-tab:hover {
|
||||
background-color: #003942;
|
||||
}
|
||||
.rc-tabs .rc-tabs-content {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.rc-tabs .rc-tabs-content .rc-tabs-tabpane {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
#fileloader-frame {
|
||||
background: rgba(0, 0, 0, 0.61);
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
left: 0;
|
||||
}
|
||||
#fileloader-frame button {
|
||||
width: 100%;
|
||||
}
|
||||
#fileloader-frame .contents {
|
||||
border: 1px solid;
|
||||
width: 300px;
|
||||
position: fixed;
|
||||
top: 50px;
|
||||
left: calc(50% - 160px);
|
||||
background-color: #FFF;
|
||||
box-shadow: 1px 1px 1px #454545;
|
||||
padding: 10px;
|
||||
}
|
||||
#print-frame .header {
|
||||
height: 98px;
|
||||
background-color: #004F5B;
|
||||
color: #FFF;
|
||||
display: flex;
|
||||
}
|
||||
#print-frame .header div {
|
||||
vertical-align: middle;
|
||||
line-height: 100px;
|
||||
margin: 0 5px 0px 5px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#print-frame #pdf {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
height: calc(100vh - 102px);
|
||||
border: none;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
}
|
||||
],
|
||||
"start_url": "./index.html",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style type="text/css">
|
||||
html {
|
||||
background: #eaeaea;
|
||||
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
|
||||
font-size: 3mm;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
border: 0.1mm solid black;
|
||||
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
|
||||
font-size: 3mm;
|
||||
border-spacing:0;
|
||||
}
|
||||
|
||||
.name {
|
||||
display: flex;
|
||||
flex-flow: row-reverse;
|
||||
}
|
||||
|
||||
.nachweis {
|
||||
margin-top: 2mm;
|
||||
}
|
||||
|
||||
.unterschrift {
|
||||
margin-top: 2mm;
|
||||
}
|
||||
|
||||
.height {
|
||||
padding: 10mm;
|
||||
}
|
||||
|
||||
.bheight {
|
||||
padding: 100px;
|
||||
}
|
||||
|
||||
.bemerkung {}
|
||||
|
||||
.bericht {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
|
||||
.bericht table {
|
||||
width: 210mm;
|
||||
margin-top: 2mm;
|
||||
}
|
||||
|
||||
.bericht td:nth-child(1),
|
||||
.bericht th:nth-child(1) {
|
||||
width: 28mm;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bericht td:nth-child(2),
|
||||
.bericht th:nth-child(2) {
|
||||
width: 28mm;
|
||||
overflow: hidden;
|
||||
}
|
||||
/*●*/
|
||||
|
||||
td,
|
||||
th {
|
||||
vertical-align: top;
|
||||
padding: 2mm 2mm 2mm 2mm;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.bericht ul {
|
||||
padding: 0mm 5mm;
|
||||
-webkit-margin-before: 1em;
|
||||
-webkit-margin-after: 1mm;
|
||||
-webkit-margin-start: 0mm;
|
||||
-webkit-margin-end: 0mm;
|
||||
-webkit-padding-start: 5mm;
|
||||
}
|
||||
.task {
|
||||
display: list-item;
|
||||
list-style-position: initial;
|
||||
margin-left: 5mm;
|
||||
list-style-type: none;
|
||||
}
|
||||
.task::before{
|
||||
content: "● ";
|
||||
font-size: 2mm;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.page {
|
||||
width: 210.1mm;
|
||||
min-height: 269.9mm;
|
||||
padding: 20mm;
|
||||
margin: 10mm auto;
|
||||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@media print {
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 210mm;
|
||||
min-height: 297mm;
|
||||
background: #FFF;
|
||||
}
|
||||
.page {
|
||||
page-break-before : always;
|
||||
box-shadow: 0 0 0 transparent;
|
||||
background: #FFF;
|
||||
width: 210.1mm;
|
||||
height: 269.9mm;
|
||||
margin: 0;
|
||||
padding: 20mm;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
|
@ -0,0 +1,100 @@
|
|||
{% for id, week in weeks %}
|
||||
<div class="page">
|
||||
<div class="name">
|
||||
<table border=1 style="width:100%">
|
||||
|
||||
<tr>
|
||||
<th style="width:30mm">Name, Vorname:</th>
|
||||
<td>
|
||||
<p id="nv">{{name}}</p>
|
||||
</td>
|
||||
</td>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div class="nachweis">
|
||||
<table border=1 style="width:100%">
|
||||
|
||||
<tr>
|
||||
<th>Ausbildungsnachweis Nr.:</th>
|
||||
<td>
|
||||
<p id="num">{{week.num}}</p>
|
||||
</td>
|
||||
<td>Von:</td>
|
||||
<td>
|
||||
<p id="ws">{{week.start}}</p>
|
||||
</td>
|
||||
<td>Bis:</td>
|
||||
<td>
|
||||
<p id="we">{{week.end}}</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="unterschrift">
|
||||
<table border="1" style="width: 100%;">
|
||||
<tr>
|
||||
<th style="width:50%;text-align:left"> Für die Richtigkeit aller Angaben:</th>
|
||||
<th style="width:50%;text-align:left"> Für die Richtigkeit aller Angaben über die betriebliche Ausbildung:</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Auszubildender </br>
|
||||
Unterschrift + Datum</td>
|
||||
<td> Ausbilder </br> Unterschrift + Datum </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="height">{{unterschrift}}</td>
|
||||
<td class="height"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="bericht">
|
||||
<table border="1" style="width: 100%;">
|
||||
<tr>
|
||||
<th>
|
||||
Tag
|
||||
</th>
|
||||
<th>
|
||||
Von - Bis
|
||||
</th>
|
||||
<th>
|
||||
Tätigkeiten
|
||||
</th>
|
||||
</tr>
|
||||
{% for day in week.data %}
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<p id="day">{{day[1]}}</p>
|
||||
</td>
|
||||
<td>
|
||||
<p id="time">{{day[2]}} - {{day[4]}}</p>
|
||||
</td>
|
||||
<td>
|
||||
{% for task in day[5] %}
|
||||
<div class="task">{{task}}</div>
|
||||
{% endfor %}
|
||||
</td>
|
||||
<!-- Tätigkeit -->
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<p>Bemerkung des Ausbilders:</p>
|
||||
|
||||
<div class="bemerkung">
|
||||
<table border="1" style="width: 100%;">
|
||||
<tr>
|
||||
<td>Bemerkung über ausgeführte Ausbildungsarbeiten, Zwischenprüfungen, Ausbildungslehrgänge, Ausbildungsnachweis
|
||||
usw.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
|
@ -0,0 +1,28 @@
|
|||
.App {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #222;
|
||||
height: 150px;
|
||||
padding: 20px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.App-title {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.App-intro {
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
import React, { Component } from 'react';
|
||||
import logo from './logo.svg';
|
||||
import './App.css';
|
||||
|
||||
import {Nav} from './jsx/ui/nav';
|
||||
|
||||
class App extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="App">
|
||||
<Nav/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
|
@ -0,0 +1,9 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(<App />, div);
|
||||
ReactDOM.unmountComponentAtNode(div);
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: sans-serif;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import registerServiceWorker from './registerServiceWorker';
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'));
|
||||
registerServiceWorker();
|
|
@ -0,0 +1,22 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
|
||||
import {FileLoader} from './ui/fileLoader';
|
||||
import {Nav} from './ui/nav';
|
||||
|
||||
|
||||
class Welcome extends React.Component {
|
||||
render() {
|
||||
return <h1>Hello, {this.props.name}</h1>;
|
||||
}
|
||||
}
|
||||
const element = (
|
||||
<div >
|
||||
<FileLoader/>
|
||||
</div>
|
||||
);
|
||||
ReactDOM.render(
|
||||
element,
|
||||
document.getElementById('root')
|
||||
);
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
export class Log{
|
||||
static debug(txt){
|
||||
console.debug('%cDEBUG: '+txt, 'background: #222; color: #bada55');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,243 @@
|
|||
import {Log} from './debug';
|
||||
|
||||
const SQL = require('sql.js')
|
||||
|
||||
|
||||
export class DB{
|
||||
static cdb;
|
||||
static loaded = false;
|
||||
static loadedCB = [];
|
||||
static newDB(){
|
||||
Log.debug('create new database');
|
||||
DB.cdb = new SQL.Database();
|
||||
DB.cdb.exec(
|
||||
`CREATE TABLE settings (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
ke TEXT not null,
|
||||
val TEXT not null
|
||||
);
|
||||
CREATE TABLE days (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
date DATETIME ,
|
||||
startTime DATETIME ,
|
||||
breakTime INTEGER ,
|
||||
endTime DATETIME ,
|
||||
taskList TEXT
|
||||
);
|
||||
CREATE TABLE tasks (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
taskName TEXT not NULL
|
||||
);
|
||||
INSERT INTO settings (ke,val)
|
||||
VALUES ('name','Max');
|
||||
INSERT INTO settings (ke,val)
|
||||
VALUES ('start','2018-08-01');
|
||||
`)
|
||||
DB.loaded = true;
|
||||
DB.__load()
|
||||
DB.storeLocalStorage()
|
||||
}
|
||||
static storeLocalStorage(){
|
||||
var data = DB.cdb.export();
|
||||
var buffer = new Buffer(data);
|
||||
var blob = new Blob([buffer]);
|
||||
var reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
localStorage.setItem('storage',reader.result)
|
||||
}
|
||||
reader.readAsBinaryString(blob);
|
||||
}
|
||||
static loadLocalStorage(){
|
||||
var i, l, d, array;
|
||||
array = new Uint8Array(localStorage.getItem('storage'));
|
||||
for (var i = 0; i < l; i++){
|
||||
array[i] = d.charCodeAt(i);
|
||||
}
|
||||
DB.loadDB(array);
|
||||
DB.loaded = true;
|
||||
DB.__load()
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {type:Uint8Array} file Uint8Array
|
||||
*/
|
||||
static loadDB(file){
|
||||
Log.debug('load database');
|
||||
|
||||
DB.cdb = new SQL.Database(file);
|
||||
DB.storeLocalStorage()
|
||||
DB.loaded = true;
|
||||
DB.__load()
|
||||
return "";
|
||||
}
|
||||
static __load(){
|
||||
Log.debug('DB onload EVENT');
|
||||
for(var l in DB.loadedCB){
|
||||
DB.loadedCB[l]();
|
||||
}
|
||||
}
|
||||
static onLoad(cb){
|
||||
Log.debug('added DB onload EVENT');
|
||||
DB.loadedCB.push(cb);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static exportDB(){
|
||||
Log.debug('export database');
|
||||
var data = DB.cdb.export();
|
||||
var buffer = new Buffer(data);
|
||||
console.log(buffer);
|
||||
var blob = new Blob([buffer],{type:'application/x-sqlite3'});
|
||||
console.log(blob);
|
||||
console.log(window.URL.createObjectURL(blob));
|
||||
var link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
var fileName = "wbm.sqlite";
|
||||
link.download = fileName;
|
||||
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(link);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} date
|
||||
*/
|
||||
static loadDate(date){
|
||||
//var re = DB.cdb.exec("SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'");
|
||||
//console.log(re)
|
||||
console.log(date)
|
||||
Log.debug('load from date:'+date.getTime())
|
||||
var sql = `SELECT * FROM days WHERE date=:date;`;
|
||||
var stmt = DB.cdb.prepare(sql);
|
||||
var res = stmt.getAsObject({":date":date.getTime()})
|
||||
stmt.free();
|
||||
Log.debug(JSON.stringify(res));
|
||||
|
||||
if(Object.keys(res).length === 0){
|
||||
return {breakTime: 0, date: null,startTime:null, endTime: null, taskList:[]}
|
||||
}else{
|
||||
var tasks = res.taskList.split(',');
|
||||
sql = `SELECT * FROM tasks WHERE id=:id`;
|
||||
for ( var task in tasks){
|
||||
stmt = DB.cdb.prepare(sql);
|
||||
tasks[task] = stmt.getAsObject({":id":tasks[task]}).taskName;
|
||||
stmt.free();
|
||||
}
|
||||
res.taskList = tasks;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
static saveDate(args){
|
||||
Log.debug('save date');
|
||||
Log.debug(JSON.stringify(args))
|
||||
var sql;
|
||||
var stmt;
|
||||
var res;
|
||||
var tasks = args.taskList;
|
||||
var taskss = []
|
||||
console.log(tasks);
|
||||
for(var t in tasks){
|
||||
if(typeof tasks[t] === 'undefined'){
|
||||
continue;
|
||||
}
|
||||
tasks[t] = tasks[t].trim();
|
||||
sql = `SELECT * FROM tasks WHERE taskName=:task`;
|
||||
stmt = DB.cdb.prepare(sql);
|
||||
res = stmt.getAsObject({':task':tasks[t]});
|
||||
stmt.free();
|
||||
console.log(res);
|
||||
if(Object.keys(res).length === 0){
|
||||
sql = `INSERT INTO tasks(taskName) VALUES(:task);`;
|
||||
stmt = DB.cdb.prepare(sql);
|
||||
res = stmt.getAsObject(
|
||||
{
|
||||
":task":tasks[t]
|
||||
}
|
||||
)
|
||||
stmt.free()
|
||||
sql = `SELECT * FROM tasks WHERE taskName=:task`;
|
||||
stmt = DB.cdb.prepare(sql);
|
||||
res = stmt.getAsObject({':task':tasks[t]});
|
||||
stmt.free();
|
||||
console.log(res);
|
||||
}
|
||||
taskss[t]= res.id;
|
||||
|
||||
}
|
||||
sql = `SELECT * FROM days WHERE date=:date;`;
|
||||
stmt = DB.cdb.prepare(sql);
|
||||
console.log(args);
|
||||
res = stmt.getAsObject({":date":args.date})
|
||||
stmt.free()
|
||||
|
||||
if(Object.keys(res).length === 0){
|
||||
Log.debug('added new entry');
|
||||
Log.debug(JSON.stringify(args))
|
||||
sql = `INSERT INTO days(date,startTime,breakTime,endTime,taskList) VALUES(:date,:startTime,:breakTime,:endTime,:taskList);`;
|
||||
stmt = DB.cdb.prepare(sql);
|