qcobjectsnewapp 2.4.10 → 2.4.11
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/.eslintignore +3 -0
- package/.eslintrc.cjs +22 -0
- package/.gitlab-ci.yml +5 -5
- package/.hintrc +8 -0
- package/.prettierignore +7 -0
- package/README.md +99 -2
- package/VERSION +1 -1
- package/config.json +12 -0
- package/package.json +69 -15
- package/{index.html → src/index.html} +6 -7
- package/src/js/config.ts +24 -0
- package/src/js/init.ts +27 -0
- package/{js/packages/com.qcobjects.installer.js → src/js/packages/com.qcobjects.installer.ts} +45 -17
- package/{js/packages/com.qcobjects.services.github.js → src/js/packages/com.qcobjects.services.github.ts} +71 -6
- package/{js/packages/org.quickcorp.custom.components.js → src/js/packages/org.quickcorp.custom.components.ts} +4 -0
- package/src/js/packages/org.quickcorp.custom.controllers.ts +112 -0
- package/{js/packages/org.quickcorp.custom.effects.js → src/js/packages/org.quickcorp.custom.effects.ts} +4 -0
- package/{js/packages/org.quickcorp.custom.models.js → src/js/packages/org.quickcorp.custom.models.ts} +3 -0
- package/src/js/packages/org.quickcorp.custom.ts +9 -0
- package/src/js/packages/org.quickcorp.custom.views.ts +21 -0
- package/src/js/types/global.d.ts +26 -0
- package/{manifest.json → src/manifest.json} +1 -1
- package/src/templates/components/blank.tpl.html +0 -0
- package/tsconfig.json +23 -0
- package/.eslintrc.js +0 -7
- package/js/init.js +0 -58
- package/js/packages/org.quickcorp.custom.controllers.js +0 -115
- package/js/packages/org.quickcorp.custom.js +0 -8
- package/js/packages/org.quickcorp.custom.views.js +0 -14
- /package/{app.js → backend/app.js} +0 -0
- /package/{css → src/css}/components/button.css +0 -0
- /package/{css → src/css}/components/card.css +0 -0
- /package/{css → src/css}/components/github-grid-landscape.css +0 -0
- /package/{css → src/css}/components/github-grid-portrait.css +0 -0
- /package/{css → src/css}/components/hero/hero-call-to-action.css +0 -0
- /package/{css → src/css}/components/hero/hero-overlay.css +0 -0
- /package/{css → src/css}/components/hero/hero-two-column-form.css +0 -0
- /package/{css → src/css}/components/modal.css +0 -0
- /package/{css → src/css}/desktop/container.css +0 -0
- /package/{css → src/css}/desktop/content.css +0 -0
- /package/{css → src/css}/desktop/footer.css +0 -0
- /package/{css → src/css}/desktop/index.css +0 -0
- /package/{css → src/css}/desktop/navbar.css +0 -0
- /package/{css → src/css}/desktop/sidebar.css +0 -0
- /package/{css → src/css}/index.css +0 -0
- /package/{css → src/css}/mobile/content.css +0 -0
- /package/{css → src/css}/mobile/footer.css +0 -0
- /package/{css → src/css}/mobile/index.css +0 -0
- /package/{css → src/css}/mobile/navbar.css +0 -0
- /package/{css → src/css}/mobile/sidebar.css +0 -0
- /package/{css → src/css}/modern-base.css +0 -0
- /package/{css → src/css}/theme/basic/style.css +0 -0
- /package/{css → src/css}/theme/cyan/style.css +0 -0
- /package/{css → src/css}/theme/redlight/style.css +0 -0
- /package/{css → src/css}/theme/xtra/style.css +0 -0
- /package/{favicon.ico → src/favicon.ico} +0 -0
- /package/{humans.txt → src/humans.txt} +0 -0
- /package/{img → src/img}/Q_web copy.png +0 -0
- /package/{img → src/img}/Q_web-white.png +0 -0
- /package/{img → src/img}/Q_web.png +0 -0
- /package/{img → src/img}/Q_web.svg +0 -0
- /package/{img → src/img}/icons/icon-128x128.png +0 -0
- /package/{img → src/img}/icons/icon-144x144.png +0 -0
- /package/{img → src/img}/icons/icon-152x152.png +0 -0
- /package/{img → src/img}/icons/icon-192x192.png +0 -0
- /package/{img → src/img}/icons/icon-384x384.png +0 -0
- /package/{img → src/img}/icons/icon-512x512.png +0 -0
- /package/{img → src/img}/icons/icon-72x72.png +0 -0
- /package/{img → src/img}/icons/icon-96x96.png +0 -0
- /package/{img → src/img}/logo-qcobjects-version.svg +0 -0
- /package/{img → src/img}/logo-qcobjects-white-powered-quickcorp.svg +0 -0
- /package/{img → src/img}/logo-qcobjects-white.svg +0 -0
- /package/{img → src/img}/logo.png +0 -0
- /package/{img → src/img}/octocat.svg +0 -0
- /package/{img → src/img}/placeholder.svg +0 -0
- /package/{img → src/img}/screenshots/screenshot1.png +0 -0
- /package/{img → src/img}/screenshots/screenshot1.webp +0 -0
- /package/{img → src/img}/screenshots/screenshot2.png +0 -0
- /package/{img → src/img}/screenshots/screenshot2.webp +0 -0
- /package/{templates/components/blank.tpl.html → src/js/types/init.d.ts} +0 -0
- /package/{robots.txt → src/robots.txt} +0 -0
- /package/{sw.js → src/sw.js} +0 -0
- /package/{templates → src/templates}/components/article1.tpl.html +0 -0
- /package/{templates → src/templates}/components/article2.tpl.html +0 -0
- /package/{templates → src/templates}/components/card.tpl.html +0 -0
- /package/{templates → src/templates}/components/contentblock.tpl.html +0 -0
- /package/{templates → src/templates}/components/footer.tpl.html +0 -0
- /package/{templates → src/templates}/components/footer2.tpl.html +0 -0
- /package/{templates → src/templates}/components/github-card.tpl.html +0 -0
- /package/{templates → src/templates}/components/header.tpl.html +0 -0
- /package/{templates → src/templates}/components/hero/hero-call-to-action.tpl.html +0 -0
- /package/{templates → src/templates}/components/hero/hero-overlay.tpl.html +0 -0
- /package/{templates → src/templates}/components/hero/hero-two-column-form.tpl.html +0 -0
- /package/{templates → src/templates}/components/install-button.tpl.html +0 -0
- /package/{templates → src/templates}/components/layout-basic.tpl.html +0 -0
- /package/{templates → src/templates}/components/loading.tpl.html +0 -0
- /package/{templates → src/templates}/components/loadingfooter.tpl.html +0 -0
- /package/{templates → src/templates}/components/login-button.tpl.html +0 -0
- /package/{templates → src/templates}/components/login2.tpl.html +0 -0
- /package/{templates → src/templates}/components/loginform.tpl.html +0 -0
- /package/{templates → src/templates}/components/modal.tpl.html +0 -0
- /package/{templates → src/templates}/components/nav.tpl.html +0 -0
- /package/{templates → src/templates}/components/octocat-icon.tpl.html +0 -0
- /package/{templates → src/templates}/components/pages/about-of.tpl.html +0 -0
- /package/{templates → src/templates}/components/pages/author.tpl.html +0 -0
- /package/{templates → src/templates}/components/pages/page1.tpl.html +0 -0
- /package/{templates → src/templates}/components/pages/page2.tpl.html +0 -0
- /package/{templates → src/templates}/components/pages/page3.tpl.html +0 -0
- /package/{templates → src/templates}/components/pages/qcobjects-forks-stars.tpl.html +0 -0
- /package/{templates → src/templates}/components/product.tpl.html +0 -0
- /package/{templates → src/templates}/components/profile.tpl.html +0 -0
- /package/{templates → src/templates}/components/section1.tpl.html +0 -0
- /package/{templates → src/templates}/components/section2.tpl.html +0 -0
- /package/{templates → src/templates}/components/shadowed-card.tpl.html +0 -0
- /package/{templates → src/templates}/components/signin-button.tpl.html +0 -0
- /package/{templates → src/templates}/components/signup-form.tpl.html +0 -0
- /package/{templates → src/templates}/components/signup.tpl.html +0 -0
- /package/{templates → src/templates}/components/signupbuttons.tpl.html +0 -0
- /package/{templates → src/templates}/components/signupform.tpl.html +0 -0
- /package/{templates → src/templates}/components/signuppage.tpl.html +0 -0
- /package/{templates → src/templates}/components/signupsuccessful.tpl.html +0 -0
- /package/{templates → src/templates}/components/signupsuccessfulfooter.tpl.html +0 -0
- /package/{templates → src/templates}/components/splashscreen.tpl.html +0 -0
- /package/{templates → src/templates}/components/topmenu.tpl.html +0 -0
|
@@ -1,17 +1,81 @@
|
|
|
1
|
+
/* eslint-disable prefer-rest-params */
|
|
1
2
|
"use strict";
|
|
3
|
+
import { Package, JSONService, Service, logger, Class } from "qcobjects";
|
|
4
|
+
|
|
2
5
|
Package("com.qcobjects.services.github", [
|
|
3
6
|
class GitHubService extends JSONService {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Name of the service
|
|
10
|
+
* @date 18/04/2023 - 22:30:07
|
|
11
|
+
*
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
4
14
|
name = "myservice";
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* It specifies if the service has a external url. If true, you can pass absolute urls in url property
|
|
19
|
+
* @date 18/04/2023 - 22:30:37
|
|
20
|
+
*
|
|
21
|
+
* @type {boolean}
|
|
22
|
+
*/
|
|
5
23
|
external = true;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* If it is true, the service call will be cached
|
|
28
|
+
* @date 18/04/2023 - 22:31:41
|
|
29
|
+
*
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
*/
|
|
6
32
|
cached = false;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* It can be GET, POST, PUT
|
|
37
|
+
* @date 18/04/2023 - 22:32:29
|
|
38
|
+
*
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
7
41
|
method = "GET";
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* You can add special headers using this property
|
|
46
|
+
* @date 18/04/2023 - 22:33:20
|
|
47
|
+
*
|
|
48
|
+
* @type {{ "Content-Type": string; }}
|
|
49
|
+
*/
|
|
8
50
|
headers = { "Content-Type": "application/json" };
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* URL for the service call
|
|
55
|
+
* @date 18/04/2023 - 22:34:09
|
|
56
|
+
*
|
|
57
|
+
* @type {string}
|
|
58
|
+
*/
|
|
9
59
|
url = "https://api.github.com/orgs/QuickCorp/repos";
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* This is used internally for XHR requests. Default value is false.
|
|
64
|
+
* @date 18/04/2023 - 22:34:29
|
|
65
|
+
*
|
|
66
|
+
* @type {boolean}
|
|
67
|
+
*/
|
|
10
68
|
withCredentials = false;
|
|
11
69
|
|
|
12
|
-
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* It is called once the service call is done
|
|
73
|
+
* @param param0 this param has two properties, one is the native request call (XHR or Fetch object). The second property is the service object.
|
|
74
|
+
* @returns Promise
|
|
75
|
+
*/
|
|
76
|
+
done({ request, service }: { request: XMLHttpRequest, service: Service }) {
|
|
13
77
|
logger.debug(request);
|
|
14
|
-
const result = JSON.parse(service.template).reverse().map(function (project) {
|
|
78
|
+
const result = JSON.parse(service.template).reverse().map(function (project: { id: string; description: string; name: string; html_url: string; }) {
|
|
15
79
|
return {
|
|
16
80
|
id: project.id,
|
|
17
81
|
description: project.description,
|
|
@@ -37,9 +101,9 @@ Package("com.qcobjects.services.github", [
|
|
|
37
101
|
url = "https://api.github.com/search/repositories?q=qcobjects";
|
|
38
102
|
withCredentials = false;
|
|
39
103
|
|
|
40
|
-
done
|
|
104
|
+
done({ request, service }: { request: XMLHttpRequest, service: Service }) {
|
|
41
105
|
logger.debug(request);
|
|
42
|
-
const result = JSON.parse(service.template).items.map(function (project) {
|
|
106
|
+
const result = JSON.parse(service.template).items.map(function (project: { id: string; description: string; name: string; html_url: string; }) {
|
|
43
107
|
return {
|
|
44
108
|
id: project.id,
|
|
45
109
|
description: project.description,
|
|
@@ -67,13 +131,14 @@ Package("com.qcobjects.services.github", [
|
|
|
67
131
|
_new_: () => {
|
|
68
132
|
// service instantiated
|
|
69
133
|
},
|
|
70
|
-
done: ({ service }) => {
|
|
134
|
+
done: ({ service }: { service: Service }) => {
|
|
71
135
|
const latest = JSON.parse(service.template)[0];
|
|
72
136
|
service.template = {
|
|
73
137
|
version: latest.name
|
|
74
138
|
};
|
|
75
139
|
}
|
|
76
140
|
}),
|
|
141
|
+
|
|
77
142
|
Class("QCObjectsStarsForksService", Service, {
|
|
78
143
|
name: "qcobjects_stars_forks_service",
|
|
79
144
|
external: true,
|
|
@@ -85,7 +150,7 @@ Package("com.qcobjects.services.github", [
|
|
|
85
150
|
_new_: () => {
|
|
86
151
|
// service instantiated
|
|
87
152
|
},
|
|
88
|
-
done: ({ service }) => {
|
|
153
|
+
done: ({ service }: { service: Service }) => {
|
|
89
154
|
const repo = JSON.parse(service.template);
|
|
90
155
|
service.template = {
|
|
91
156
|
forks: repo.forks_count,
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
/* eslint-disable no-unused-vars */
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
import global, { Package, Controller, logger, _DOMCreateElement, Effect, New, ClassFactory, QCObjectsElement, QCObjectsShadowedElement, Component } from "qcobjects";
|
|
7
|
+
|
|
8
|
+
Package("org.quickcorp.custom.controllers", [
|
|
9
|
+
class MainController extends Controller {
|
|
10
|
+
static loaded: boolean;
|
|
11
|
+
constructor ({component}:{component:Component}) {
|
|
12
|
+
logger.debug("Initializing MainController...");
|
|
13
|
+
super({component});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
done (...args:Array<never>) {
|
|
17
|
+
const _ret_ = super.done(args);
|
|
18
|
+
if (!MainController.loaded) {
|
|
19
|
+
const s = _DOMCreateElement("style");
|
|
20
|
+
s.innerHTML = "body, html {margin:0;padding:0;width:100%;height:100%;top:0;bottom:0;left:0;right:0}";
|
|
21
|
+
document.body.append(s);
|
|
22
|
+
logger.debug("MainController loaded");
|
|
23
|
+
MainController.loaded = true;
|
|
24
|
+
}
|
|
25
|
+
return _ret_;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
class SideNavController extends Controller {
|
|
30
|
+
effect!: Effect;
|
|
31
|
+
visibility!: boolean;
|
|
32
|
+
constructor ({component}:{component:Component}) {
|
|
33
|
+
logger.debug("Initializing SideNavController...");
|
|
34
|
+
super({component});
|
|
35
|
+
(global as any).sideNavController = this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
done (...args:Array<any>){
|
|
39
|
+
super.done(args);
|
|
40
|
+
this.effect = New(ClassFactory("Fade"),{
|
|
41
|
+
duration: 300
|
|
42
|
+
});
|
|
43
|
+
this.close();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
open () {
|
|
47
|
+
const componentRoot = (this.component.shadowed) ? (this.component.shadowRoot) : (this.component.body);
|
|
48
|
+
if (this.effect != null) {
|
|
49
|
+
this.effect.apply(componentRoot, 0, 1);
|
|
50
|
+
}
|
|
51
|
+
if (componentRoot !== undefined){
|
|
52
|
+
componentRoot.style.width = "100%";
|
|
53
|
+
componentRoot.style.overflowX = "visible";
|
|
54
|
+
if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined") {
|
|
55
|
+
const parentElement = componentRoot.parentElement as QCObjectsElement;
|
|
56
|
+
if (parentElement !== null){
|
|
57
|
+
parentElement.subelements(".navbtn")[0].style.display = "none";
|
|
58
|
+
parentElement.subelements(".closebtn")[0].style.display = "block";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
this.visibility = true;
|
|
63
|
+
return this.visibility;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
close () {
|
|
67
|
+
const componentRoot = (this.component.shadowed) ? (this.component.shadowRoot) : (this.component.body);
|
|
68
|
+
if (this.effect != null) {
|
|
69
|
+
this.effect.apply(componentRoot, 1, 0);
|
|
70
|
+
}
|
|
71
|
+
if (componentRoot !== undefined){
|
|
72
|
+
componentRoot.style.width = "0px";
|
|
73
|
+
componentRoot.style.overflowX = "hidden";
|
|
74
|
+
if (Object.hasOwnProperty.call(componentRoot, "parentElement") && typeof componentRoot.parentElement !== "undefined") {
|
|
75
|
+
const parentElement = componentRoot.parentElement as QCObjectsElement;
|
|
76
|
+
parentElement.subelements(".navbtn")[0].style.display = "block";
|
|
77
|
+
parentElement.subelements(".closebtn")[0].style.display = "none";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
this.visibility = false;
|
|
81
|
+
return this.visibility;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
toggle () {
|
|
85
|
+
if (this.visibility) {
|
|
86
|
+
this.close();
|
|
87
|
+
} else {
|
|
88
|
+
this.open();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
class HeaderController extends Controller {
|
|
94
|
+
installer:any;
|
|
95
|
+
|
|
96
|
+
loadInstallerButton () {
|
|
97
|
+
const componentRoot = (this.component.shadowed) ? (this.component.shadowRoot as QCObjectsShadowedElement) : (this.component.body as QCObjectsElement);
|
|
98
|
+
componentRoot.subelements("#installerbutton").map(
|
|
99
|
+
(element)=>{
|
|
100
|
+
this.installer = New(ClassFactory("Installer"), element);
|
|
101
|
+
return element;
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
done (...args:Array<never>) {
|
|
107
|
+
const _ret_ = super.done(args);
|
|
108
|
+
this.loadInstallerButton();
|
|
109
|
+
return _ret_;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use script";
|
|
2
|
+
|
|
3
|
+
import "./com.qcobjects.installer";
|
|
4
|
+
import "./org.quickcorp.custom.effects";
|
|
5
|
+
import "./org.quickcorp.custom.models";
|
|
6
|
+
import "./org.quickcorp.custom.components";
|
|
7
|
+
import "./org.quickcorp.custom.controllers";
|
|
8
|
+
import "./org.quickcorp.custom.views";
|
|
9
|
+
import "./com.qcobjects.services.github";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Package, View } from "qcobjects";
|
|
4
|
+
|
|
5
|
+
Package("org.quickcorp.custom.views", [
|
|
6
|
+
|
|
7
|
+
class CardView extends View {
|
|
8
|
+
|
|
9
|
+
done (...args:Array<never>) {
|
|
10
|
+
const _ret_ = super.done(args);
|
|
11
|
+
const component = this.component;
|
|
12
|
+
if (component !== undefined && component.body !== undefined){
|
|
13
|
+
component.body.style.display = "block";
|
|
14
|
+
component.body.style.width = "100px";
|
|
15
|
+
component.body.style.height = "100px";
|
|
16
|
+
}
|
|
17
|
+
return _ret_;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]);
|
|
21
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Effect, Controller } from "qcobjects";
|
|
2
|
+
|
|
3
|
+
declare namespace global {
|
|
4
|
+
class SideNavController extends Controller{
|
|
5
|
+
effect?: Effect;
|
|
6
|
+
visibility?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Installer {
|
|
11
|
+
root: Element;
|
|
12
|
+
promptEvent!: any;
|
|
13
|
+
|
|
14
|
+
constructor(root:any);
|
|
15
|
+
beforeinstallprompt(e:Event);
|
|
16
|
+
installed();
|
|
17
|
+
install();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let sideNavController: SideNavController;
|
|
21
|
+
function set(_, value:any);
|
|
22
|
+
function get(_:string, value:any);
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default global;
|
|
File without changes
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2021", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
4
|
+
"lib": ["ES2021", "DOM"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
5
|
+
"module": "NodeNext", /* Specify what module code is generated. */
|
|
6
|
+
"rootDir": "src", /* Specify the root folder within your source files. */
|
|
7
|
+
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
8
|
+
"outDir": "build", /* Specify an output folder for all emitted files. */
|
|
9
|
+
/*"outFile": "build/init.js",*/
|
|
10
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
11
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
12
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
13
|
+
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
14
|
+
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
15
|
+
"moduleResolution": "nodenext",
|
|
16
|
+
"resolveJsonModule": false,
|
|
17
|
+
"declaration": false,
|
|
18
|
+
"sourceMap": false,
|
|
19
|
+
"isolatedModules": false
|
|
20
|
+
},
|
|
21
|
+
"include": ["src/**/*.ts"],
|
|
22
|
+
"exclude": ["src/**/*.spec.js", "src/*.js"]
|
|
23
|
+
}
|
package/.eslintrc.js
DELETED
package/js/init.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* QCObjects New App PWA Template 1.x
|
|
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
|
-
|
|
27
|
-
// import "../QCObjects.js"; /* uncomment this line to load QCObjects from backend */
|
|
28
|
-
import "https://cdnjs.cloudflare.com/ajax/libs/qcobjects/2.4.52/QCObjects.js"; /* uncomment this line to load QCObjects from cdnjs */
|
|
29
|
-
|
|
30
|
-
/*
|
|
31
|
-
* The next values are the default settings
|
|
32
|
-
* You can change any value in runtime by using CONFIG.set
|
|
33
|
-
* or changing the static initial value in a config.json file
|
|
34
|
-
*/
|
|
35
|
-
CONFIG.set("sourceType", "module");
|
|
36
|
-
CONFIG.set("relativeImportPath", "js/packages/");
|
|
37
|
-
CONFIG.set("componentsBasePath", "templates/components/");
|
|
38
|
-
CONFIG.set("delayForReady", 1); // delay to wait before executing the first ready event, it includes imports
|
|
39
|
-
CONFIG.set("preserveComponentBodyTag", false); // don't use <componentBody></componentBody> tag
|
|
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
|
|
46
|
-
|
|
47
|
-
// if Component.cached is true, all the Class('Component') declarations will save the template in a localStorage cache
|
|
48
|
-
// until a cached=false attribute is found in a <component> html declaration
|
|
49
|
-
Component.cached = true;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Main import sentence.
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
Import("org.quickcorp.custom"); // this will load js/packages/org.quickcorp.custom.js file
|
|
56
|
-
|
|
57
|
-
// eslint-disable-next-line no-undef
|
|
58
|
-
RegisterWidgets("layout-basic", "splash-screen", "github-grid", "octocat-icon", "lib-list");
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
/* eslint-disable no-unused-vars */
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
Package("org.quickcorp.custom.controllers", [
|
|
6
|
-
|
|
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,8 +0,0 @@
|
|
|
1
|
-
"use script";
|
|
2
|
-
Import("com.qcobjects.installer");
|
|
3
|
-
Import("org.quickcorp.custom.effects");
|
|
4
|
-
Import("org.quickcorp.custom.models");
|
|
5
|
-
Import("org.quickcorp.custom.components");
|
|
6
|
-
Import("org.quickcorp.custom.controllers");
|
|
7
|
-
Import("org.quickcorp.custom.views");
|
|
8
|
-
Import("com.qcobjects.services.github");
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Package("org.quickcorp.custom.views", [
|
|
3
|
-
|
|
4
|
-
class CardView extends View {
|
|
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";
|
|
11
|
-
return _ret_;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|