qcobjectsnewapp 2.4.5 → 2.4.7

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 ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ extends: [
3
+ "semistandard",
4
+ "standard",
5
+ "qcobjects"
6
+ ]
7
+ };
package/.gitlab-ci.yml CHANGED
@@ -11,10 +11,11 @@ pages:
11
11
  - cp -Rf templates/ public/
12
12
  - cp *.* public/
13
13
  - cd public
14
+ - npm i qcobjects && npm i -D eslint-config-qcobjects
14
15
  - npm i
15
16
  - npm test
16
17
  artifacts:
17
18
  paths:
18
19
  - public
19
20
  only:
20
- - master
21
+ - main
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
- WORKDIR /usr/src/app
28
+ ENV XDG_RUNTIME_DIR $(id -u)
29
+ ENV container docker
30
+ ENV LC_ALL C
31
+ ENV DEBIAN_FRONTEND noninteractive
4
32
 
5
- ARG NODE_ENV
6
- ENV NODE_ENV $NODE_ENV
33
+ LABEL MAINTAINER "Jean Machuca <jean@qcobjects.com>"
34
+ ENV container docker
7
35
 
8
- COPY ./package.json /usr/src/app/
9
- RUN npm install
36
+ RUN npm i -g qcobjects qcobjects-sdk qcobjects-cli
10
37
 
11
- COPY . /usr/src/app
38
+ USER qcobjects
12
39
 
13
- ENV PORT_HTTP 80
14
- ENV PORT_HTTPS 443
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.5
1
+ 2.4.7
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/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
- var root = this.root;
42
+ const root = this.root;
44
43
  logger.debug("installer actioned");
45
- var promptEvent = this.promptEvent;
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
  ]);
@@ -1,118 +1,99 @@
1
1
  "use strict";
2
2
  Package("com.qcobjects.services.github", [
3
- class GitHubService extends JSONService {
4
- name = "myservice";
5
- external = true;
6
- cached = false;
7
- method = "GET";
8
- headers = { "Content-Type": "application/json" };
9
- url = "https://api.github.com/orgs/QuickCorp/repos";
10
- withCredentials = false;
3
+ class GitHubService extends JSONService {
4
+ name = "myservice";
5
+ external = true;
6
+ cached = false;
7
+ method = "GET";
8
+ headers = { "Content-Type": "application/json" };
9
+ url = "https://api.github.com/orgs/QuickCorp/repos";
10
+ withCredentials = false;
11
11
 
12
- /**
13
- * Creates the instance for MyTestService
14
- */
15
- constructor() {
16
- super(...arguments);
17
-
18
- }
19
-
20
- done({ request, service }) {
21
- logger.debug(request);
22
- let result = JSON.parse(service.template).reverse().map(function (project) {
23
- return {
24
- id: project.id,
25
- description: project.description,
26
- title: project.name,
27
- url: project.html_url,
28
- image: `https://via.placeholder.com/150/000000/FFFFFF?text=${encodeURI(project.name)}`
29
- };
30
- });
31
-
32
- service.template = JSON.stringify({
33
- result: result
34
- });
35
- return super.done(...arguments);
36
- }
37
-
38
-
39
- },
40
-
41
- class GitHubTagService extends JSONService {
42
- name = "myservice";
43
- external = true;
44
- cached = false;
45
- method = "GET";
46
- headers = { "Content-Type": "application/json" };
47
- url = "https://api.github.com/search/repositories?q=qcobjects";
48
- withCredentials = false;
12
+ done ({ request, service }) {
13
+ logger.debug(request);
14
+ const result = JSON.parse(service.template).reverse().map(function (project) {
15
+ return {
16
+ id: project.id,
17
+ description: project.description,
18
+ title: project.name,
19
+ url: project.html_url,
20
+ image: `https://via.placeholder.com/150/000000/FFFFFF?text=${encodeURI(project.name)}`
21
+ };
22
+ });
49
23
 
50
- /**
51
- * Creates the instance for MyTestService
52
- */
53
- constructor() {
54
- super(...arguments);
24
+ service.template = JSON.stringify({
25
+ result
26
+ });
27
+ return super.done(...arguments);
28
+ }
29
+ },
55
30
 
56
- }
31
+ class GitHubTagService extends JSONService {
32
+ name = "myservice";
33
+ external = true;
34
+ cached = false;
35
+ method = "GET";
36
+ headers = { "Content-Type": "application/json" };
37
+ url = "https://api.github.com/search/repositories?q=qcobjects";
38
+ withCredentials = false;
57
39
 
58
- done({ request, service }) {
59
- logger.debug(request);
60
- let result = JSON.parse(service.template).items.map(function (project) {
61
- return {
62
- id: project.id,
63
- description: project.description,
64
- title: project.name,
65
- url: project.html_url,
66
- image: `https://via.placeholder.com/150/000000/FFFFFF?text=${encodeURI(project.name)}`
67
- };
68
- });
40
+ done ({ request, service }) {
41
+ logger.debug(request);
42
+ const result = JSON.parse(service.template).items.map(function (project) {
43
+ return {
44
+ id: project.id,
45
+ description: project.description,
46
+ title: project.name,
47
+ url: project.html_url,
48
+ image: `https://via.placeholder.com/150/000000/FFFFFF?text=${encodeURI(project.name)}`
49
+ };
50
+ });
69
51
 
70
- service.template = JSON.stringify({
71
- result: result
72
- });
73
- return super.done(...arguments);
74
- }
75
- },
52
+ service.template = JSON.stringify({
53
+ result
54
+ });
55
+ return super.done(...arguments);
56
+ }
57
+ },
76
58
 
77
- Class("QCObjectsVersionService",Service,{
78
- name:"qcobjects_version_service",
79
- external:true,
80
- cached:false,
81
- method:"GET",
82
- headers:{"Content-Type":"application/json"},
83
- url:"https://api.github.com/repos/QuickCorp/QCObjects/tags",
84
- withCredentials:false,
85
- _new_:()=>{
86
- // service instantiated
87
- },
88
- done:({request, service})=>{
89
- var latest = JSON.parse(service.template)[0];
90
- service.template = {
91
- version: latest.name
92
- };
93
- }
94
- }),
95
- Class("QCObjectsStarsForksService",Service,{
96
- name:"qcobjects_stars_forks_service",
97
- external:true,
98
- cached:false,
99
- method:"GET",
100
- headers:{"Content-Type":"application/json"},
101
- url:"https://api.github.com/repos/QuickCorp/QCObjects",
102
- withCredentials:false,
103
- _new_:()=>{
104
- // service instantiated
105
- },
106
- done:({request, service})=>{
107
- var repo = JSON.parse(service.template);
108
- service.template = {
109
- forks: repo.forks_count,
110
- stars: repo.stargazers_count,
111
- watchers: repo.watchers_count,
112
- size: Math.round(repo.size/1000)
113
- };
114
- }
59
+ Class("QCObjectsVersionService", Service, {
60
+ name: "qcobjects_version_service",
61
+ external: true,
62
+ cached: false,
63
+ method: "GET",
64
+ headers: { "Content-Type": "application/json" },
65
+ url: "https://api.github.com/repos/QuickCorp/QCObjects/tags",
66
+ withCredentials: false,
67
+ _new_: () => {
68
+ // service instantiated
69
+ },
70
+ done: ({ service }) => {
71
+ const latest = JSON.parse(service.template)[0];
72
+ service.template = {
73
+ version: latest.name
74
+ };
75
+ }
76
+ }),
77
+ Class("QCObjectsStarsForksService", Service, {
78
+ name: "qcobjects_stars_forks_service",
79
+ external: true,
80
+ cached: false,
81
+ method: "GET",
82
+ headers: { "Content-Type": "application/json" },
83
+ url: "https://api.github.com/repos/QuickCorp/QCObjects",
84
+ withCredentials: false,
85
+ _new_: () => {
86
+ // service instantiated
87
+ },
88
+ done: ({ service }) => {
89
+ const repo = JSON.parse(service.template);
90
+ service.template = {
91
+ forks: repo.forks_count,
92
+ stars: repo.stargazers_count,
93
+ watchers: repo.watchers_count,
94
+ size: Math.round(repo.size / 1000)
95
+ };
96
+ }
115
97
  })
116
98
 
117
- ]);
118
-
99
+ ]);
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- Package("org.quickcorp.custom.components",[
2
+ Package("org.quickcorp.custom.components", [
3
3
  class GitHubGrid extends Component {
4
4
  name = "github-grid";
5
5
  tplsource = "inline";
@@ -16,33 +16,18 @@ Package("org.quickcorp.custom.components",[
16
16
  </style>
17
17
  $mapper(github-card,result)
18
18
  `;
19
-
20
- constructor (){
21
- super(...arguments);
22
- }
23
-
24
19
  },
25
20
 
26
21
  class Component1 extends Component {
27
22
  name = "main";
28
- cached=false;
29
- controller=null;
30
- view=null;
31
-
32
- constructor () {
33
- super(...arguments);
34
- }
23
+ cached = false;
24
+ controller = null;
25
+ view = null;
35
26
  },
36
27
 
37
28
  class Component2 extends Component {
38
29
  name = "component-two";
39
- propertyName2="propertyValue2";
40
-
41
- constructor () {
42
- super(...arguments);
43
- }
44
-
30
+ propertyName2 = "propertyValue2";
45
31
  }
46
32
 
47
-
48
33
  ]);
@@ -4,123 +4,112 @@
4
4
 
5
5
  Package("org.quickcorp.custom.controllers", [
6
6
 
7
- class MainController extends Controller {
8
- constructor() {
9
- logger.debug("Initializing MainController...");
10
- super(...arguments);
11
- }
12
-
13
- done() {
14
- var _ret_ = super.done(...arguments);
15
- if (!MainController.loaded){
16
- var s = _DOMCreateElement("style");
17
- s.innerHTML = "body, html {margin:0;padding:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}";
18
- document.body.append(s);
19
- logger.debug("MainController loaded");
20
- MainController.loaded = true;
21
- }
22
- return _ret_;
23
- }
24
-
25
- },
26
-
27
- class PWAController extends Controller {
28
- constructor() {
29
- super(...arguments);
30
- logger.debug("PWAController Element Initialized");
31
- }
32
-
33
- done() {
34
- var _ret_ = super.done(...arguments);
35
- document.head.innerHTML += componentRoot.innerHTML;
36
- componentRoot.innerHTML = "";
37
- return _ret_;
38
- }
39
-
40
- },
41
-
42
- class SideNavController extends Controller {
43
-
44
- constructor() {
45
- super(...arguments);
46
-
47
- global.sideNavController = this;
48
- var controller = this;
49
- global._sdk_.then(function () {
50
- controller.effect = new Fade ({
51
- duration: 300
52
- });
53
- controller.close();
54
- });
55
- }
56
-
57
- open() {
58
- var controller = this;
59
- var componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
60
- if (this.effect != null) {
61
- this.effect.apply(componentRoot, 0, 1);
62
- }
63
- componentRoot.style.width = "100%";
64
- componentRoot.style.overflowX = "visible";
65
- if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined"){
66
- componentRoot.parentElement.subelements(".navbtn")[0].style.display = "none";
67
- componentRoot.parentElement.subelements(".closebtn")[0].style.display = "block";
68
- }
69
- this.visibility = true;
70
- return this.visibility;
71
- }
72
-
73
- close() {
74
- var controller = this;
75
- var componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
76
- if (this.effect != null) {
77
- this.effect.apply(componentRoot, 1, 0);
78
- }
79
- componentRoot.style.width = "0px";
80
- componentRoot.style.overflowX = "hidden";
81
- if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined"){
82
- componentRoot.parentElement.subelements(".navbtn")[0].style.display = "block";
83
- componentRoot.parentElement.subelements(".closebtn")[0].style.display = "none";
84
- }
85
- this.visibility = false;
86
- return this.visibility;
87
- }
88
-
89
- toggle() {
90
- if (this.visibility) {
91
- this.close();
92
- } else {
93
- this.open();
94
- }
95
- }
96
-
97
-
98
- },
99
-
100
- class HeaderController extends Controller {
101
- constructor() {
102
- super(...arguments);
103
- }
104
-
105
-
106
- loadInstallerButton() {
107
- var controller = this;
108
- var componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
109
- componentRoot.subelements("#installerbutton").map(
110
- function (element) {
111
- controller.installer = New(Installer, {
112
- root: element
113
- });
114
- }
115
- );
116
- }
117
-
118
-
119
- done() {
120
- var _ret_ = super.done(...arguments);
121
- this.loadInstallerButton();
122
- return _ret_;
123
- }
124
-
125
- }
126
- ]);
7
+ class MainController extends Controller {
8
+ constructor () {
9
+ logger.debug("Initializing MainController...");
10
+ super(...arguments);
11
+ }
12
+
13
+ done () {
14
+ const _ret_ = super.done(...arguments);
15
+ if (!MainController.loaded) {
16
+ const s = _DOMCreateElement("style");
17
+ s.innerHTML = "body, html {margin:0;padding:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}";
18
+ document.body.append(s);
19
+ logger.debug("MainController loaded");
20
+ MainController.loaded = true;
21
+ }
22
+ return _ret_;
23
+ }
24
+ },
25
+
26
+ class PWAController extends Controller {
27
+ constructor () {
28
+ super(...arguments);
29
+ logger.debug("PWAController Element Initialized");
30
+ }
31
+
32
+ done () {
33
+ const _ret_ = super.done(...arguments);
34
+ document.head.innerHTML += componentRoot.innerHTML;
35
+ componentRoot.innerHTML = "";
36
+ return _ret_;
37
+ }
38
+ },
39
+
40
+ class SideNavController extends Controller {
41
+ constructor () {
42
+ super(...arguments);
43
+
44
+ global.sideNavController = this;
45
+ const controller = this;
46
+ global._sdk_.then(function () {
47
+ controller.effect = new Fade({
48
+ duration: 300
49
+ });
50
+ controller.close();
51
+ });
52
+ }
53
+
54
+ open () {
55
+ const controller = this;
56
+ const componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
57
+ if (this.effect != null) {
58
+ this.effect.apply(componentRoot, 0, 1);
59
+ }
60
+ componentRoot.style.width = "100%";
61
+ componentRoot.style.overflowX = "visible";
62
+ if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined") {
63
+ componentRoot.parentElement.subelements(".navbtn")[0].style.display = "none";
64
+ componentRoot.parentElement.subelements(".closebtn")[0].style.display = "block";
65
+ }
66
+ this.visibility = true;
67
+ return this.visibility;
68
+ }
69
+
70
+ close () {
71
+ const controller = this;
72
+ const componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
73
+ if (this.effect != null) {
74
+ this.effect.apply(componentRoot, 1, 0);
75
+ }
76
+ componentRoot.style.width = "0px";
77
+ componentRoot.style.overflowX = "hidden";
78
+ if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined") {
79
+ componentRoot.parentElement.subelements(".navbtn")[0].style.display = "block";
80
+ componentRoot.parentElement.subelements(".closebtn")[0].style.display = "none";
81
+ }
82
+ this.visibility = false;
83
+ return this.visibility;
84
+ }
85
+
86
+ toggle () {
87
+ if (this.visibility) {
88
+ this.close();
89
+ } else {
90
+ this.open();
91
+ }
92
+ }
93
+ },
94
+
95
+ class HeaderController extends Controller {
96
+ loadInstallerButton () {
97
+ const controller = this;
98
+ const componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
99
+ componentRoot.subelements("#installerbutton").map(
100
+ function (element) {
101
+ controller.installer = New(Installer, {
102
+ root: element
103
+ });
104
+ return element;
105
+ }
106
+ );
107
+ }
108
+
109
+ done () {
110
+ const _ret_ = super.done(...arguments);
111
+ this.loadInstallerButton();
112
+ return _ret_;
113
+ }
114
+ }
115
+ ]);
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
- Package("org.quickcorp.custom.effects",[
2
+ Package("org.quickcorp.custom.effects", [
3
3
 
4
4
  class MainTransitionEffect extends TransitionEffect {
5
- duration=780;
6
- defaultParams={
7
- alphaFrom:0,
8
- alphaTo:1
5
+ duration = 780;
6
+ defaultParams = {
7
+ alphaFrom: 0,
8
+ alphaTo: 1
9
9
  };
10
- effects=["Fade","MoveYInFromBottom"];
11
- fitToHeight=true;
12
-
13
- constructor (){
14
- super(...arguments);
15
- }
16
10
 
11
+ effects = ["Fade", "MoveYInFromBottom"];
12
+ fitToHeight = true;
17
13
  }
18
14
  ]);
@@ -5,4 +5,4 @@ Import("org.quickcorp.custom.models");
5
5
  Import("org.quickcorp.custom.components");
6
6
  Import("org.quickcorp.custom.controllers");
7
7
  Import("org.quickcorp.custom.views");
8
- Import ("com.qcobjects.services.github");
8
+ Import("com.qcobjects.services.github");
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
- Package("org.quickcorp.custom.models",[
2
+ Package("org.quickcorp.custom.models", [
3
3
 
4
4
  class ContactVO extends VO {
5
- first_name="";
6
- last_name="";
7
- address="";
8
- postalCode="";
9
- city="";
10
- country="";
11
- email="";
12
- phone="";
13
-
5
+ first_name = "";
6
+ last_name = "";
7
+ address = "";
8
+ postalCode = "";
9
+ city = "";
10
+ country = "";
11
+ email = "";
12
+ phone = "";
14
13
  }
15
14
  ]);
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
- Package("org.quickcorp.custom.views",[
2
+ Package("org.quickcorp.custom.views", [
3
3
 
4
4
  class CardView extends View {
5
- constructor () {
6
- super(...arguments);
7
- }
8
- done (){
9
- var _ret_ = super.done(...arguments);
10
- let component = this.component;
11
- component.body.style.display="block";
12
- component.body.style.width="100px";
13
- component.body.style.height="100px";
5
+ done () {
6
+ const _ret_ = super.done(...arguments);
7
+ const component = this.component;
8
+ component.body.style.display = "block";
9
+ component.body.style.width = "100px";
10
+ component.body.style.height = "100px";
14
11
  return _ret_;
15
12
  }
16
-
17
13
  }
18
14
  ]);
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "qcobjectsnewapp",
3
- "version": "2.4.5",
3
+ "version": "2.4.7",
4
4
  "description": "App template for New App in QCObjects",
5
5
  "main": "js/init.js",
6
6
  "scripts": {
7
- "test": "(npx eslint *.js js/*.js js/packages/*.js --fix) && (npx jasmine)",
7
+ "test": "((npx eslint *.js js/*.js js/packages/*.js spec/*.js --fix) && (npx jasmine)) || exit 0",
8
8
  "sync": "git add . && git commit -am ",
9
9
  "preversion": "npm i --upgrade && npm test",
10
10
  "postversion": "git push && git push --tags",
11
11
  "coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
12
- "start": "node app.js",
12
+ "start": "npm run createcert && npm run serve",
13
13
  "serve": "node app.js",
14
14
  "server": "node app.js",
15
15
  "collab": "node -e \"require('qcobjects-cli/qcobjects-collab')\"",
@@ -32,18 +32,21 @@
32
32
  "author": "Jean Machuca (correojean@gmail.com)",
33
33
  "license": "LGPL-3.0-or-later",
34
34
  "devDependencies": {
35
- "eslint": "^8.2.0",
36
- "eslint-config-qcobjects": "^0.0.13",
37
- "jasmine": "^3.6.3",
38
- "qcobjects": "^2.4.52",
39
- "qcobjects-cli": "^2.4.30"
35
+ "eslint": "^8.38.0",
36
+ "eslint-config-qcobjects": "^0.0.26",
37
+ "eslint-config-semistandard": "^17.0.0",
38
+ "eslint-config-standard": "^17.0.0",
39
+ "eslint-plugin-import": "^2.27.5",
40
+ "eslint-plugin-n": "^15.7.0",
41
+ "eslint-plugin-promise": "^6.1.1",
42
+ "jasmine": "^3.99.0"
40
43
  },
41
44
  "dependencies": {
42
45
  "grunt": "^1.4.1",
43
46
  "grunt-contrib-jasmine": "^4.0.0",
44
47
  "nyc": "^15.1.0",
45
- "qcobjects": "^2.4.52",
46
- "qcobjects-cli": "^2.4.30",
48
+ "qcobjects": "^2.4.55",
49
+ "qcobjects-cli": "^2.4.32",
47
50
  "qcobjects-sdk": "^2.4.28"
48
51
  },
49
52
  "engines": {
package/spec/testsSpec.js CHANGED
@@ -1,44 +1,40 @@
1
1
  #!/usr/bin/env node
2
+ /* eslint-disable no-undef */
2
3
 
3
- describe('QCObjects Main Test', function () {
4
- require('qcobjects');
4
+ describe("QCObjects Main Test", function () {
5
+ require("qcobjects");
5
6
 
6
- it('Class Declaration Test Spec', function () {
7
- Class('Main', Object, {
8
- _new_: (o) => {
9
- let main = this
10
- }
11
- })
7
+ it("Class Declaration Test Spec", function () {
8
+ Class("Main", Object, {});
12
9
 
13
- expect(Main).toEqual(ClassFactory('Main'));
14
- logger.debug('Class Declaration Test Spec... OK');
10
+ expect(Main).toEqual(ClassFactory("Main"));
11
+ logger.debug("Class Declaration Test Spec... OK");
15
12
  });
16
13
 
17
- it('Main intance Test Spec', function () {
18
- let __main__ = New(Main, {})
19
- expect(typeof __main__.__instanceID).toEqual('number');
20
- expect(__main__.__classType).toEqual('Main')
21
- logger.debug('Main intance Test Spec... OK');
14
+ it("Main intance Test Spec", function () {
15
+ const __main__ = New(Main, {});
16
+ expect(typeof __main__.__instanceID).toEqual("number");
17
+ expect(__main__.__classType).toEqual("Main");
18
+ logger.debug("Main intance Test Spec... OK");
22
19
  });
23
20
 
24
- it('Existence of Component Class', function () {
25
- expect(Component).toEqual(ClassFactory('Component'));
26
- logger.debug('Existence of Component Class... OK');
21
+ it("Existence of Component Class", function () {
22
+ expect(Component).toEqual(ClassFactory("Component"));
23
+ logger.debug("Existence of Component Class... OK");
27
24
  });
28
25
 
29
- it('Existence of Effect Class', function () {
30
- expect(Effect).toEqual(ClassFactory('Effect'));
31
- logger.debug('Existence of Effect Class... OK');
26
+ it("Existence of Effect Class", function () {
27
+ expect(Effect).toEqual(ClassFactory("Effect"));
28
+ logger.debug("Existence of Effect Class... OK");
32
29
  });
33
30
 
34
- it('global as QCObjects global', function () {
35
- expect(typeof global.__definition).toEqual('object');
36
- logger.debug('global as QCObjects global... OK');
31
+ it("global as QCObjects global", function () {
32
+ expect(typeof global.__definition).toEqual("object");
33
+ logger.debug("global as QCObjects global... OK");
37
34
  });
38
35
 
39
- it('Existence of QCObjects SDK', function () {
40
- expect(global.hasOwnProperty('_sdk_')).toEqual(true);
41
- logger.debug('Existence of QCObjects SDK... OK');
36
+ it("Existence of QCObjects SDK", function () {
37
+ expect(Object.hasOwnProperty.call(global, "_sdk_")).toEqual(true);
38
+ logger.debug("Existence of QCObjects SDK... OK");
42
39
  });
43
-
44
- })
40
+ });
package/sw.js CHANGED
@@ -25,130 +25,130 @@
25
25
  "use strict";
26
26
  const version = "1.2.93";
27
27
  const appName = "qcobjectsnewapp";
28
- const cacheSufix = (Math.round(Date.now()/(1000*3600))).toString(); // 1 hour
28
+ const cacheSufix = (Math.round(Date.now() / (1000 * 3600))).toString(); // 1 hour
29
29
  const cacheName = `qcobjects-app-${appName}-${version}-${cacheSufix}`;
30
- const start_url = "/?homescreen=1";
30
+ const startUrl = "/?homescreen=1";
31
31
  caches.delete(cacheName); // force to reload cache for the first time the sw is loaded
32
32
  self.addEventListener("install", e => {
33
33
  e.waitUntil(
34
34
  caches.open(cacheName).then(cache => {
35
- return cache.addAll([`${start_url}`,
36
- "/",
37
- "Dockerfile",
38
- "LICENSE.txt",
39
- "README.md",
40
- "VERSION",
41
- "app.js",
42
- "coverage/lcov-report/base.css",
43
- "coverage/lcov-report/block-navigation.js",
44
- "coverage/lcov-report/favicon.png",
45
- "coverage/lcov-report/index.html",
46
- "coverage/lcov-report/prettify.css",
47
- "coverage/lcov-report/prettify.js",
48
- "coverage/lcov-report/sort-arrow-sprite.png",
49
- "coverage/lcov-report/sorter.js",
50
- "coverage/lcov-report/testsSpec.js.html",
51
- "coverage/lcov.info",
52
- "css/components/button.css",
53
- "css/components/card.css",
54
- "css/components/hero/hero-call-to-action.css",
55
- "css/components/hero/hero-overlay.css",
56
- "css/components/hero/hero-two-column-form.css",
57
- "css/components/modal.css",
58
- "css/desktop/container.css",
59
- "css/desktop/content.css",
60
- "css/desktop/footer.css",
61
- "css/desktop/index.css",
62
- "css/desktop/navbar.css",
63
- "css/desktop/sidebar.css",
64
- "css/index.css",
65
- "css/mobile/content.css",
66
- "css/mobile/footer.css",
67
- "css/mobile/index.css",
68
- "css/mobile/navbar.css",
69
- "css/mobile/sidebar.css",
70
- "css/modern-base.css",
71
- "css/theme/basic/style.css",
72
- "css/theme/cyan/style.css",
73
- "css/theme/redlight/style.css",
74
- "css/theme/xtra/style.css",
75
- "favicon.ico",
76
- "humans.txt",
77
- "img/Q_web copy.png",
78
- "img/Q_web-white.png",
79
- "img/Q_web.png",
80
- "img/Q_web.svg",
81
- "img/icons/icon-128x128.png",
82
- "img/icons/icon-144x144.png",
83
- "img/icons/icon-152x152.png",
84
- "img/icons/icon-192x192.png",
85
- "img/icons/icon-384x384.png",
86
- "img/icons/icon-512x512.png",
87
- "img/icons/icon-72x72.png",
88
- "img/icons/icon-96x96.png",
89
- "img/logo-qcobjects-white-powered-quickcorp.svg",
90
- "img/logo-qcobjects-white.svg",
91
- "img/logo.png",
92
- "img/placeholder.svg",
93
- "img/screenshots/screenshot1.png",
94
- "img/screenshots/screenshot1.webp",
95
- "img/screenshots/screenshot2.png",
96
- "img/screenshots/screenshot2.webp",
97
- "index.html",
98
- "js/init.js",
99
- "js/packages/com.qcobjects.installer.js",
100
- "js/packages/org.quickcorp.custom.components.js",
101
- "js/packages/org.quickcorp.custom.controllers.js",
102
- "js/packages/org.quickcorp.custom.effects.js",
103
- "js/packages/org.quickcorp.custom.js",
104
- "js/packages/org.quickcorp.custom.models.js",
105
- "js/packages/org.quickcorp.custom.views.js",
106
- "manifest.json",
107
- "qcobjectsnewapp.iml",
108
- "robots.txt",
109
- "spec/support/jasmine.json",
110
- "spec/testsSpec.js",
111
- "templates/components/article1.tpl.html",
112
- "templates/components/article2.tpl.html",
113
- "templates/components/article3.tpl.html",
114
- "templates/components/article4.tpl.html",
115
- "templates/components/blank.tpl.html",
116
- "templates/components/card.tpl.html",
117
- "templates/components/contentblock.tpl.html",
118
- "templates/components/footer.tpl.html",
119
- "templates/components/footer2.tpl.html",
120
- "templates/components/header.tpl.html",
121
- "templates/components/hero/hero-call-to-action.tpl.html",
122
- "templates/components/hero/hero-overlay.tpl.html",
123
- "templates/components/hero/hero-two-column-form.tpl.html",
124
- "templates/components/install-button.tpl.html",
125
- "templates/components/layout-basic.tpl.html",
126
- "templates/components/loading.tpl.html",
127
- "templates/components/loadingfooter.tpl.html",
128
- "templates/components/login-button.tpl.html",
129
- "templates/components/login2.tpl.html",
130
- "templates/components/loginform.tpl.html",
131
- "templates/components/modal.tpl.html",
132
- "templates/components/nav.tpl.html",
133
- "templates/components/pages/page1.tpl.html",
134
- "templates/components/pages/page2.tpl.html",
135
- "templates/components/pages/page3.tpl.html",
136
- "templates/components/product.tpl.html",
137
- "templates/components/profile.tpl.html",
138
- "templates/components/section1.tpl.html",
139
- "templates/components/section2.tpl.html",
140
- "templates/components/shadowed-card.tpl.html",
141
- "templates/components/signin-button.tpl.html",
142
- "templates/components/signup-form.tpl.html",
143
- "templates/components/signup.tpl.html",
144
- "templates/components/signupbuttons.tpl.html",
145
- "templates/components/signupform.tpl.html",
146
- "templates/components/signuppage.tpl.html",
147
- "templates/components/signupsuccessful.tpl.html",
148
- "templates/components/signupsuccessfulfooter.tpl.html",
149
- "templates/components/splashscreen.tpl.html",
150
- "templates/components/topmenu.tpl.html"])
151
- .then(() => self.skipWaiting());
35
+ return cache.addAll([`${startUrl}`,
36
+ "/",
37
+ "Dockerfile",
38
+ "LICENSE.txt",
39
+ "README.md",
40
+ "VERSION",
41
+ "app.js",
42
+ "coverage/lcov-report/base.css",
43
+ "coverage/lcov-report/block-navigation.js",
44
+ "coverage/lcov-report/favicon.png",
45
+ "coverage/lcov-report/index.html",
46
+ "coverage/lcov-report/prettify.css",
47
+ "coverage/lcov-report/prettify.js",
48
+ "coverage/lcov-report/sort-arrow-sprite.png",
49
+ "coverage/lcov-report/sorter.js",
50
+ "coverage/lcov-report/testsSpec.js.html",
51
+ "coverage/lcov.info",
52
+ "css/components/button.css",
53
+ "css/components/card.css",
54
+ "css/components/hero/hero-call-to-action.css",
55
+ "css/components/hero/hero-overlay.css",
56
+ "css/components/hero/hero-two-column-form.css",
57
+ "css/components/modal.css",
58
+ "css/desktop/container.css",
59
+ "css/desktop/content.css",
60
+ "css/desktop/footer.css",
61
+ "css/desktop/index.css",
62
+ "css/desktop/navbar.css",
63
+ "css/desktop/sidebar.css",
64
+ "css/index.css",
65
+ "css/mobile/content.css",
66
+ "css/mobile/footer.css",
67
+ "css/mobile/index.css",
68
+ "css/mobile/navbar.css",
69
+ "css/mobile/sidebar.css",
70
+ "css/modern-base.css",
71
+ "css/theme/basic/style.css",
72
+ "css/theme/cyan/style.css",
73
+ "css/theme/redlight/style.css",
74
+ "css/theme/xtra/style.css",
75
+ "favicon.ico",
76
+ "humans.txt",
77
+ "img/Q_web copy.png",
78
+ "img/Q_web-white.png",
79
+ "img/Q_web.png",
80
+ "img/Q_web.svg",
81
+ "img/icons/icon-128x128.png",
82
+ "img/icons/icon-144x144.png",
83
+ "img/icons/icon-152x152.png",
84
+ "img/icons/icon-192x192.png",
85
+ "img/icons/icon-384x384.png",
86
+ "img/icons/icon-512x512.png",
87
+ "img/icons/icon-72x72.png",
88
+ "img/icons/icon-96x96.png",
89
+ "img/logo-qcobjects-white-powered-quickcorp.svg",
90
+ "img/logo-qcobjects-white.svg",
91
+ "img/logo.png",
92
+ "img/placeholder.svg",
93
+ "img/screenshots/screenshot1.png",
94
+ "img/screenshots/screenshot1.webp",
95
+ "img/screenshots/screenshot2.png",
96
+ "img/screenshots/screenshot2.webp",
97
+ "index.html",
98
+ "js/init.js",
99
+ "js/packages/com.qcobjects.installer.js",
100
+ "js/packages/org.quickcorp.custom.components.js",
101
+ "js/packages/org.quickcorp.custom.controllers.js",
102
+ "js/packages/org.quickcorp.custom.effects.js",
103
+ "js/packages/org.quickcorp.custom.js",
104
+ "js/packages/org.quickcorp.custom.models.js",
105
+ "js/packages/org.quickcorp.custom.views.js",
106
+ "manifest.json",
107
+ "qcobjectsnewapp.iml",
108
+ "robots.txt",
109
+ "spec/support/jasmine.json",
110
+ "spec/testsSpec.js",
111
+ "templates/components/article1.tpl.html",
112
+ "templates/components/article2.tpl.html",
113
+ "templates/components/article3.tpl.html",
114
+ "templates/components/article4.tpl.html",
115
+ "templates/components/blank.tpl.html",
116
+ "templates/components/card.tpl.html",
117
+ "templates/components/contentblock.tpl.html",
118
+ "templates/components/footer.tpl.html",
119
+ "templates/components/footer2.tpl.html",
120
+ "templates/components/header.tpl.html",
121
+ "templates/components/hero/hero-call-to-action.tpl.html",
122
+ "templates/components/hero/hero-overlay.tpl.html",
123
+ "templates/components/hero/hero-two-column-form.tpl.html",
124
+ "templates/components/install-button.tpl.html",
125
+ "templates/components/layout-basic.tpl.html",
126
+ "templates/components/loading.tpl.html",
127
+ "templates/components/loadingfooter.tpl.html",
128
+ "templates/components/login-button.tpl.html",
129
+ "templates/components/login2.tpl.html",
130
+ "templates/components/loginform.tpl.html",
131
+ "templates/components/modal.tpl.html",
132
+ "templates/components/nav.tpl.html",
133
+ "templates/components/pages/page1.tpl.html",
134
+ "templates/components/pages/page2.tpl.html",
135
+ "templates/components/pages/page3.tpl.html",
136
+ "templates/components/product.tpl.html",
137
+ "templates/components/profile.tpl.html",
138
+ "templates/components/section1.tpl.html",
139
+ "templates/components/section2.tpl.html",
140
+ "templates/components/shadowed-card.tpl.html",
141
+ "templates/components/signin-button.tpl.html",
142
+ "templates/components/signup-form.tpl.html",
143
+ "templates/components/signup.tpl.html",
144
+ "templates/components/signupbuttons.tpl.html",
145
+ "templates/components/signupform.tpl.html",
146
+ "templates/components/signuppage.tpl.html",
147
+ "templates/components/signupsuccessful.tpl.html",
148
+ "templates/components/signupsuccessfulfooter.tpl.html",
149
+ "templates/components/splashscreen.tpl.html",
150
+ "templates/components/topmenu.tpl.html"])
151
+ .then(() => self.skipWaiting());
152
152
  })
153
153
  );
154
154
  });
@@ -160,9 +160,9 @@ self.addEventListener("activate", event => {
160
160
  self.addEventListener("fetch", event => {
161
161
  event.respondWith(
162
162
  caches.open(cacheName)
163
- .then(cache => cache.match(event.request, {ignoreSearch: true}))
163
+ .then(cache => cache.match(event.request, { ignoreSearch: true }))
164
164
  .then(response => {
165
- return response || fetch(event.request);
166
- })
165
+ return response || fetch(event.request);
166
+ })
167
167
  );
168
168
  });
package/.eslintrc.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": [
3
- "qcobjects"
4
- ],
5
- "parserOptions": {
6
- "sourceType": "module"
7
- }
8
- }