qcobjectsnewapp 2.4.5 → 2.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +7 -0
- package/.gitlab-ci.yml +2 -1
- package/Dockerfile +55 -10
- package/README.md +11 -1
- package/VERSION +1 -1
- package/config.json +38 -0
- package/css/desktop/container.css +1 -1
- package/css/desktop/content.css +6 -6
- package/css/index.css +22 -22
- package/css/mobile/content.css +7 -7
- package/css/theme/basic/style.css +3 -3
- package/css/theme/cyan/style.css +3 -3
- package/css/theme/redlight/style.css +3 -3
- package/js/init.js +7 -8
- package/js/packages/com.qcobjects.installer.js +10 -13
- package/js/packages/com.qcobjects.services.github.js +89 -108
- package/js/packages/org.quickcorp.custom.components.js +5 -20
- package/js/packages/org.quickcorp.custom.controllers.js +109 -120
- package/js/packages/org.quickcorp.custom.effects.js +7 -11
- package/js/packages/org.quickcorp.custom.js +1 -1
- package/js/packages/org.quickcorp.custom.models.js +9 -10
- package/js/packages/org.quickcorp.custom.views.js +7 -11
- package/package.json +13 -10
- package/spec/testsSpec.js +25 -29
- package/sw.js +122 -122
- package/templates/components/card.tpl.html +2 -2
- package/templates/components/contentblock.tpl.html +2 -2
- package/templates/components/layout-basic.tpl.html +9 -9
- package/templates/components/loading.tpl.html +2 -2
- package/templates/components/login2.tpl.html +1 -1
- package/templates/components/product.tpl.html +2 -2
- package/templates/components/section1.tpl.html +1 -1
- package/templates/components/section2.tpl.html +1 -1
- package/templates/components/signup-form.tpl.html +3 -3
- package/templates/components/signup.tpl.html +2 -2
- package/templates/components/signupform.tpl.html +2 -2
- package/templates/components/signuppage.tpl.html +4 -4
- package/templates/components/signupsuccessful.tpl.html +2 -2
- package/templates/components/topmenu.tpl.html +1 -1
- package/.eslintrc.json +0 -8
package/.eslintrc.js
ADDED
package/.gitlab-ci.yml
CHANGED
package/Dockerfile
CHANGED
|
@@ -1,18 +1,63 @@
|
|
|
1
1
|
FROM quickcorp/qcobjects:latest
|
|
2
|
+
###
|
|
3
|
+
# QCObjects Framework
|
|
4
|
+
# ________________
|
|
5
|
+
#
|
|
6
|
+
# Author: Jean Machuca <correojean@gmail.com>
|
|
7
|
+
#
|
|
8
|
+
# Cross Browser Javascript Framework for MVC Patterns
|
|
9
|
+
# QuickCorp/QCObjects is licensed under the
|
|
10
|
+
# GNU Lesser General Public License v3.0
|
|
11
|
+
# [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
|
|
12
|
+
#
|
|
13
|
+
# Permissions of this copyleft license are conditioned on making available
|
|
14
|
+
# complete source code of licensed works and modifications under the same
|
|
15
|
+
# license or the GNU GPLv3. Copyright and license notices must be preserved.
|
|
16
|
+
# Contributors provide an express grant of patent rights. However, a larger
|
|
17
|
+
# work using the licensed work through interfaces provided by the licensed
|
|
18
|
+
# work may be distributed under different terms and without source code for
|
|
19
|
+
# the larger work.
|
|
20
|
+
#
|
|
21
|
+
# Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
|
|
22
|
+
#
|
|
23
|
+
# Everyone is permitted to copy and distribute verbatim copies of this
|
|
24
|
+
# license document, but changing it is not allowed.
|
|
25
|
+
###
|
|
26
|
+
USER root
|
|
2
27
|
|
|
3
|
-
|
|
28
|
+
ENV XDG_RUNTIME_DIR $(id -u)
|
|
29
|
+
ENV container docker
|
|
30
|
+
ENV LC_ALL C
|
|
31
|
+
ENV DEBIAN_FRONTEND noninteractive
|
|
4
32
|
|
|
5
|
-
|
|
6
|
-
ENV
|
|
33
|
+
LABEL MAINTAINER "Jean Machuca <jean@qcobjects.com>"
|
|
34
|
+
ENV container docker
|
|
7
35
|
|
|
8
|
-
|
|
9
|
-
RUN npm install
|
|
36
|
+
RUN npm i -g qcobjects qcobjects-sdk qcobjects-cli
|
|
10
37
|
|
|
11
|
-
|
|
38
|
+
USER qcobjects
|
|
12
39
|
|
|
13
|
-
|
|
14
|
-
|
|
40
|
+
#Configure the internal user permissions
|
|
41
|
+
RUN mkdir -p /home/qcobjects/app && chown -R qcobjects:qcobjects /home/qcobjects/app
|
|
42
|
+
|
|
43
|
+
#Setting the work directory
|
|
44
|
+
WORKDIR /home/qcobjects/app
|
|
45
|
+
ENV DOCUMENT_ROOT /home/qcobjects/app/
|
|
46
|
+
ENV DATA_PATH $DOCUMENT_ROOT/data/
|
|
47
|
+
COPY package*.json ./
|
|
48
|
+
|
|
49
|
+
#Run the initial install init scripts for jasmine and cache verify
|
|
50
|
+
#RUN jasmine init
|
|
51
|
+
RUN npm cache verify
|
|
52
|
+
RUN npm ci --save --only=production
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
USER root
|
|
56
|
+
|
|
57
|
+
# Bundle app source
|
|
58
|
+
COPY --chown=qcobjects:qcobjects . .
|
|
59
|
+
|
|
60
|
+
EXPOSE 8080:8080
|
|
61
|
+
EXPOSE 8443:8443
|
|
15
62
|
|
|
16
|
-
EXPOSE $PORT_HTTP
|
|
17
|
-
EXPOSE $PORT_HTTPS
|
|
18
63
|
CMD [ "npm", "start" ]
|
package/README.md
CHANGED
|
@@ -148,4 +148,14 @@ npm run gae-server
|
|
|
148
148
|
```shell
|
|
149
149
|
# This command will be implemented in the future for TypeScript
|
|
150
150
|
npm run build
|
|
151
|
-
```
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
# Docker installation
|
|
154
|
+
|
|
155
|
+
To run this app with docker, execute the following command:
|
|
156
|
+
|
|
157
|
+
```shell
|
|
158
|
+
docker run -p 8080:8080 -p 8443:8443 --name qcobjects-newapp -d qcobjects/qcobjects-newapp
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Then go to [https://127.0.0.1:8443/](https://127.0.0.1:8443/)
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.4.
|
|
1
|
+
2.4.9
|
package/config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"devmode":"debug",
|
|
3
|
+
"autodiscover":true,
|
|
4
|
+
"cacheControl":"max-age=31536000",
|
|
5
|
+
"relativeImportPath":"js/packages/",
|
|
6
|
+
"serverPortHTTP": "8080",
|
|
7
|
+
"serverPortHTTPS": "8443",
|
|
8
|
+
"useLocalSDK":true,
|
|
9
|
+
"backend":{
|
|
10
|
+
"routes":[
|
|
11
|
+
{
|
|
12
|
+
"name":"QCObjects-SDK.js for demo folder",
|
|
13
|
+
"description":"Redirection of QCObjects SDK",
|
|
14
|
+
"path":"^/demo-tests/QCObjects-SDK.js$",
|
|
15
|
+
"microservice":"com.qcobjects.backend.microservice.static",
|
|
16
|
+
"redirect_to": "./node_modules/qcobjects-sdk/QCObjects-SDK.js",
|
|
17
|
+
"responseHeaders":{
|
|
18
|
+
},
|
|
19
|
+
"cors":{
|
|
20
|
+
"allow_origins":"*"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name":"QCObjects-SDK Components for demo folder",
|
|
25
|
+
"description":"Redirection of QCObjects SDK",
|
|
26
|
+
"path":"^/demo-tests/qcobjects-sdk/(.*)$",
|
|
27
|
+
"microservice":"com.qcobjects.backend.microservice.static",
|
|
28
|
+
"redirect_to": "./node_modules/qcobjects-sdk/$1",
|
|
29
|
+
"responseHeaders":{},
|
|
30
|
+
"cors":{
|
|
31
|
+
"allow_origins":"*"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
package/css/desktop/content.css
CHANGED
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
|
|
29
29
|
/* LOGIN 2 FORM */
|
|
30
30
|
|
|
31
|
-
component[name=loginform].login2 input[type=text],
|
|
32
|
-
component[name=loginform].login2 input[type=password] {
|
|
31
|
+
quick-component[name=loginform].login2 input[type=text],
|
|
32
|
+
quick-component[name=loginform].login2 input[type=password] {
|
|
33
33
|
width: 30%;
|
|
34
34
|
padding: 15px;
|
|
35
35
|
margin: 5px 0 22px 0;
|
|
@@ -39,19 +39,19 @@ component[name=loginform].login2 input[type=password] {
|
|
|
39
39
|
margin: 7px;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
component[name=loginform].login2 input[type=text]:focus,
|
|
43
|
-
component[name=loginform].login2 input[type=password]:focus {
|
|
42
|
+
quick-component[name=loginform].login2 input[type=text]:focus,
|
|
43
|
+
quick-component[name=loginform].login2 input[type=password]:focus {
|
|
44
44
|
background-color: #ddd;
|
|
45
45
|
outline: none;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
component[name=loginform].login2 form {
|
|
48
|
+
quick-component[name=loginform].login2 form {
|
|
49
49
|
width: 70% !important;
|
|
50
50
|
margin: 0 auto;
|
|
51
51
|
grid-auto-flow: column;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
component[name=loginform].login2 form breakline {
|
|
54
|
+
quick-component[name=loginform].login2 form breakline {
|
|
55
55
|
display: block;
|
|
56
56
|
}
|
|
57
57
|
|
package/css/index.css
CHANGED
|
@@ -99,7 +99,7 @@ nav {
|
|
|
99
99
|
padding: 20px;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
nav > component {
|
|
102
|
+
nav > quick-component {
|
|
103
103
|
width: 0;
|
|
104
104
|
position: fixed;
|
|
105
105
|
z-index: 1;
|
|
@@ -114,7 +114,7 @@ nav > component {
|
|
|
114
114
|
padding-bottom: 20%;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
nav > component a {
|
|
117
|
+
nav > quick-component a {
|
|
118
118
|
padding: 8px 8px 8px 32px;
|
|
119
119
|
text-decoration: none;
|
|
120
120
|
font-size: 15px;
|
|
@@ -123,7 +123,7 @@ nav > component a {
|
|
|
123
123
|
transition: 0.3s;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
nav > component a:hover {
|
|
126
|
+
nav > quick-component a:hover {
|
|
127
127
|
color: #f1f1f1;
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -169,7 +169,7 @@ nav > button.navbtn {
|
|
|
169
169
|
}
|
|
170
170
|
nav > button.navbtn::after { content: '\2630'; }
|
|
171
171
|
|
|
172
|
-
nav > component > span.closebtn {
|
|
172
|
+
nav > quick-component > span.closebtn {
|
|
173
173
|
position: fixed;
|
|
174
174
|
display: none;
|
|
175
175
|
top: 0;
|
|
@@ -178,7 +178,7 @@ nav > component > span.closebtn {
|
|
|
178
178
|
margin-left: 50px;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
nav > component > span.closebtn::after { content: "\00d7"; }
|
|
181
|
+
nav > quick-component > span.closebtn::after { content: "\00d7"; }
|
|
182
182
|
|
|
183
183
|
nav .navcontent {
|
|
184
184
|
padding-top: 20px;
|
|
@@ -261,7 +261,7 @@ nav form {
|
|
|
261
261
|
/* END TOPNAV */
|
|
262
262
|
|
|
263
263
|
/* HEADER */
|
|
264
|
-
component[name=header] {
|
|
264
|
+
quick-component[name=header] {
|
|
265
265
|
width: 100%;
|
|
266
266
|
padding-top: 80px;
|
|
267
267
|
|
|
@@ -331,8 +331,8 @@ button:not(.navbtn):hover {
|
|
|
331
331
|
/* FORM ELEMENTS FOR SIGNUP */
|
|
332
332
|
|
|
333
333
|
/* Full-width input fields */
|
|
334
|
-
component[name=signup] input[type=text],
|
|
335
|
-
component[name=signup] input[type=password] {
|
|
334
|
+
quick-component[name=signup] input[type=text],
|
|
335
|
+
quick-component[name=signup] input[type=password] {
|
|
336
336
|
width: 80%;
|
|
337
337
|
padding: 15px;
|
|
338
338
|
margin: 5px 0 22px 0;
|
|
@@ -341,24 +341,24 @@ component[name=signup] input[type=password] {
|
|
|
341
341
|
background: #f1f1f1;
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
component[name=signup] input[type=checkbox] {
|
|
344
|
+
quick-component[name=signup] input[type=checkbox] {
|
|
345
345
|
margin-left: 20px;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
component[name=signup] input[type=text]:focus,
|
|
349
|
-
component[name=signup] input[type=password]:focus {
|
|
348
|
+
quick-component[name=signup] input[type=text]:focus,
|
|
349
|
+
quick-component[name=signup] input[type=password]:focus {
|
|
350
350
|
background-color: #ddd;
|
|
351
351
|
outline: none;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
-
component[name=signup] hr {
|
|
354
|
+
quick-component[name=signup] hr {
|
|
355
355
|
border: 1px solid #f1f1f1;
|
|
356
356
|
margin-bottom: 25px;
|
|
357
357
|
width: 100% !important;
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
/* Set a style for all buttons */
|
|
361
|
-
component[name=signup] button {
|
|
361
|
+
quick-component[name=signup] button {
|
|
362
362
|
color: white;
|
|
363
363
|
padding: 14px 20px;
|
|
364
364
|
margin: 8px 0;
|
|
@@ -368,34 +368,34 @@ component[name=signup] button {
|
|
|
368
368
|
opacity: 0.9;
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
component[name=signup] button:hover {
|
|
371
|
+
quick-component[name=signup] button:hover {
|
|
372
372
|
opacity: 1;
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
/* Extra styles for the cancel button */
|
|
376
|
-
component[name=signup] .cancelbtn {
|
|
376
|
+
quick-component[name=signup] .cancelbtn {
|
|
377
377
|
padding: 14px 20px;
|
|
378
378
|
background-color: #f44336;
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
/* Float cancel and signup buttons and add an equal width */
|
|
382
|
-
component[name=footer] .cancelbtn,
|
|
383
|
-
component[name=footer] .signupbtn {
|
|
382
|
+
quick-component[name=footer] .cancelbtn,
|
|
383
|
+
quick-component[name=footer] .signupbtn {
|
|
384
384
|
float: left;
|
|
385
385
|
width: 45%;
|
|
386
386
|
margin: 0.5%;
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
/* Add padding to container elements */
|
|
390
|
-
component[name=signup] .container {
|
|
390
|
+
quick-component[name=signup] .container {
|
|
391
391
|
padding: 20px;
|
|
392
392
|
width: 87% !important;
|
|
393
393
|
height: 100%;
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
/* Clear floats */
|
|
397
|
-
component[name=signup] .clearfix::after,
|
|
398
|
-
component[name=footer] .clearfix::after {
|
|
397
|
+
quick-component[name=signup] .clearfix::after,
|
|
398
|
+
quick-component[name=footer] .clearfix::after {
|
|
399
399
|
content: "";
|
|
400
400
|
clear: both;
|
|
401
401
|
display: table;
|
|
@@ -403,8 +403,8 @@ component[name=footer] .clearfix::after {
|
|
|
403
403
|
|
|
404
404
|
/* Change styles for cancel button and signup button on extra small screens */
|
|
405
405
|
@media screen and (max-width: 300px) {
|
|
406
|
-
component[name=signup] .cancelbtn,
|
|
407
|
-
component[name=signup] .signupbtn {
|
|
406
|
+
quick-component[name=signup] .cancelbtn,
|
|
407
|
+
quick-component[name=signup] .signupbtn {
|
|
408
408
|
width: 100%;
|
|
409
409
|
}
|
|
410
410
|
}
|
package/css/mobile/content.css
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/* Insert here your custom CSS */
|
|
28
28
|
|
|
29
29
|
/* GRID */
|
|
30
|
-
component[name=grid] {
|
|
30
|
+
quick-component[name=grid] {
|
|
31
31
|
display: grid;
|
|
32
32
|
grid-template-rows: auto;
|
|
33
33
|
grid-template-columns: 50% 50%;
|
|
@@ -41,8 +41,8 @@ header {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/* LOGIN 2 FORM */
|
|
44
|
-
component[name=loginform].login2 input[type=text],
|
|
45
|
-
component[name=loginform].login2 input[type=password] {
|
|
44
|
+
quick-component[name=loginform].login2 input[type=text],
|
|
45
|
+
quick-component[name=loginform].login2 input[type=password] {
|
|
46
46
|
width: 80% !important;
|
|
47
47
|
padding: 15px;
|
|
48
48
|
margin: 5px 0 22px 0;
|
|
@@ -51,18 +51,18 @@ component[name=loginform].login2 input[type=password] {
|
|
|
51
51
|
background: #f1f1f1;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
component[name=loginform].login2 input[type=text]:focus,
|
|
55
|
-
component[name=loginform].login2 input[type=password]:focus {
|
|
54
|
+
quick-component[name=loginform].login2 input[type=text]:focus,
|
|
55
|
+
quick-component[name=loginform].login2 input[type=password]:focus {
|
|
56
56
|
background-color: #ddd;
|
|
57
57
|
outline: none;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
component[name=loginform].login2 form {
|
|
60
|
+
quick-component[name=loginform].login2 form {
|
|
61
61
|
width: 100% !important;
|
|
62
62
|
margin: 0 auto;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
component[name=loginform].login2 form breakline {
|
|
65
|
+
quick-component[name=loginform].login2 form breakline {
|
|
66
66
|
display: none;
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
/* NAV */
|
|
28
|
-
nav > component {
|
|
28
|
+
nav > quick-component {
|
|
29
29
|
background-color: #111;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
nav > component a {
|
|
32
|
+
nav > quick-component a {
|
|
33
33
|
font-size: 15px;
|
|
34
34
|
color: #ecffc7;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
nav > component a:hover {
|
|
37
|
+
nav > quick-component a:hover {
|
|
38
38
|
color: #f1f1f1;
|
|
39
39
|
}
|
|
40
40
|
|
package/css/theme/cyan/style.css
CHANGED
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
/* NAV */
|
|
28
|
-
nav > component {
|
|
28
|
+
nav > quick-component {
|
|
29
29
|
background-color: rgb(106, 229, 245);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
nav > component a {
|
|
32
|
+
nav > quick-component a {
|
|
33
33
|
font-size: 15px;
|
|
34
34
|
color: #28197e;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
nav > component a:hover {
|
|
37
|
+
nav > quick-component a:hover {
|
|
38
38
|
color: #4aa7dd;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
* license document, but changing it is not allowed.
|
|
25
25
|
*/
|
|
26
26
|
/* NAV */
|
|
27
|
-
nav > component {
|
|
27
|
+
nav > quick-component {
|
|
28
28
|
background-color: rgb(228, 119, 119);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
nav > component a {
|
|
31
|
+
nav > quick-component a {
|
|
32
32
|
font-size: 15px;
|
|
33
33
|
color: rgb(228, 119, 119);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
nav > component a:hover {
|
|
36
|
+
nav > quick-component a:hover {
|
|
37
37
|
color: #8d4949;
|
|
38
38
|
}
|
|
39
39
|
|
package/js/init.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* license document, but changing it is not allowed.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
//import "../QCObjects.js"; /* uncomment this line to load QCObjects from backend */
|
|
27
|
+
// import "../QCObjects.js"; /* uncomment this line to load QCObjects from backend */
|
|
28
28
|
import "https://cdnjs.cloudflare.com/ajax/libs/qcobjects/2.4.52/QCObjects.js"; /* uncomment this line to load QCObjects from cdnjs */
|
|
29
29
|
|
|
30
30
|
/*
|
|
@@ -38,21 +38,20 @@ CONFIG.set("componentsBasePath", "templates/components/");
|
|
|
38
38
|
CONFIG.set("delayForReady", 1); // delay to wait before executing the first ready event, it includes imports
|
|
39
39
|
CONFIG.set("preserveComponentBodyTag", false); // don't use <componentBody></componentBody> tag
|
|
40
40
|
CONFIG.set("useConfigService", false); // Load settings from config.json
|
|
41
|
-
CONFIG.set("routingWay","hash"); // routingWay possible values are 'hash','pathname','search'
|
|
42
|
-
CONFIG.set("useLocalSDK",false); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
|
|
43
|
-
CONFIG.set("tplextension","tpl.html"); // this is the file extension to locate the template files (if component.name = 'main' then template name will be main.tpl.html)
|
|
44
|
-
CONFIG.set("asynchronousImportsLoad",true); // it is recommended to load the Import declarations in an asyncronous way
|
|
45
|
-
CONFIG.set("serviceWorkerURI","/sw.js"); //QCObjects will register an launch this service worker automatically to work offline
|
|
41
|
+
CONFIG.set("routingWay", "hash"); // routingWay possible values are 'hash','pathname','search'
|
|
42
|
+
CONFIG.set("useLocalSDK", false); // on the frontend side you can chose whether to load the SDK from sdk.qcobjects.dev or from your local website
|
|
43
|
+
CONFIG.set("tplextension", "tpl.html"); // this is the file extension to locate the template files (if component.name = 'main' then template name will be main.tpl.html)
|
|
44
|
+
CONFIG.set("asynchronousImportsLoad", true); // it is recommended to load the Import declarations in an asyncronous way
|
|
45
|
+
CONFIG.set("serviceWorkerURI", "/sw.js"); // QCObjects will register an launch this service worker automatically to work offline
|
|
46
46
|
|
|
47
47
|
// if Component.cached is true, all the Class('Component') declarations will save the template in a localStorage cache
|
|
48
48
|
// until a cached=false attribute is found in a <component> html declaration
|
|
49
|
-
Component.cached=true;
|
|
49
|
+
Component.cached = true;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Main import sentence.
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
-
|
|
56
55
|
Import("org.quickcorp.custom"); // this will load js/packages/org.quickcorp.custom.js file
|
|
57
56
|
|
|
58
57
|
// eslint-disable-next-line no-undef
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Package("com.qcobjects.installer",[
|
|
2
|
+
Package("com.qcobjects.installer", [
|
|
3
3
|
class Installer extends ClassFactory("InheritClass") {
|
|
4
|
-
constructor ({root}){
|
|
4
|
+
constructor ({ root }) {
|
|
5
5
|
super(...arguments);
|
|
6
6
|
|
|
7
7
|
this.root = root;
|
|
8
|
-
window.addEventListener("beforeinstallprompt", this.beforeinstallprompt.bind(this),false);
|
|
9
|
-
window.addEventListener("appinstalled", this.installed.bind(this),false);
|
|
10
|
-
|
|
8
|
+
window.addEventListener("beforeinstallprompt", this.beforeinstallprompt.bind(this), false);
|
|
9
|
+
window.addEventListener("appinstalled", this.installed.bind(this), false);
|
|
10
|
+
|
|
11
11
|
root.addEventListener("click", this.install.bind(this));
|
|
12
12
|
root.addEventListener("touchend", this.install.bind(this));
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
window.matchMedia("(display-mode: standalone)").addEventListener("change", (evt) => {
|
|
15
15
|
let displayMode = "browser";
|
|
16
16
|
if (evt.matches) {
|
|
@@ -19,10 +19,9 @@ Package("com.qcobjects.installer",[
|
|
|
19
19
|
NotificationComponent.success(`TWA in ${displayMode} Mode`);
|
|
20
20
|
});
|
|
21
21
|
global.set("installer", this);
|
|
22
|
-
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
promptEvent=null;
|
|
24
|
+
promptEvent = null;
|
|
26
25
|
|
|
27
26
|
beforeinstallprompt (e) {
|
|
28
27
|
logger.debug("registering installer event");
|
|
@@ -35,14 +34,14 @@ Package("com.qcobjects.installer",[
|
|
|
35
34
|
installed () {
|
|
36
35
|
logger.debug("app is already installed");
|
|
37
36
|
this.promptEvent = null;
|
|
38
|
-
// This fires after onbeforinstallprompt OR after manual add to homescreen.
|
|
37
|
+
// This fires after onbeforinstallprompt OR after manual add to homescreen.
|
|
39
38
|
this.root.classList.remove("available");
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
install () {
|
|
43
|
-
|
|
42
|
+
const root = this.root;
|
|
44
43
|
logger.debug("installer actioned");
|
|
45
|
-
|
|
44
|
+
let promptEvent = this.promptEvent;
|
|
46
45
|
if (promptEvent) {
|
|
47
46
|
logger.debug("prompt event");
|
|
48
47
|
|
|
@@ -68,7 +67,5 @@ Package("com.qcobjects.installer",[
|
|
|
68
67
|
logger.debug("not asking for install");
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
70
|
}
|
|
74
71
|
]);
|