qcobjects-sdk 0.0.1 → 0.0.3
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.json +28 -0
- package/.github/FUNDING.yml +12 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/ISSUE_TEMPLATE/issue-template.md +33 -0
- package/.github/workflows/codeql-analysis.yml +71 -0
- package/.github/workflows/npmpublish-beta.yml +38 -0
- package/.github/workflows/npmpublish-lts.yml +38 -0
- package/.github/workflows/npmpublish-main.yml +38 -0
- package/CHANGELOG.md +47 -0
- package/QCObjects-SDK.js +108 -232
- package/README.md +951 -6
- package/VERSION +1 -0
- package/css/base-modal.css +43 -0
- package/css/basic-layout-embedded-nav.css +14 -0
- package/css/basic-layout.css +76 -0
- package/css/components/horizontal-list.css +64 -0
- package/css/components/list.css +57 -0
- package/css/components/splashscreen.css +111 -0
- package/css/modal.css +46 -0
- package/demo-tests/test-component-grid.html +63 -0
- package/demo-tests/test-component-list.html +53 -0
- package/demo-tests/test-component-notifications.html +49 -0
- package/demo-tests/test-component-slider.html +68 -0
- package/favicon.ico +0 -0
- package/js/org.qcobjects.cloud.auth.session.data.js +136 -0
- package/js/org.qcobjects.cloud.auth.session.usertoken.js +107 -0
- package/js/org.qcobjects.components.grid.js +71 -0
- package/js/org.qcobjects.components.js +277 -0
- package/js/org.qcobjects.components.list.js +57 -0
- package/js/org.qcobjects.components.notifications.js +190 -0
- package/js/org.qcobjects.components.slider.js +217 -0
- package/js/org.qcobjects.components.splashscreen.js +622 -0
- package/js/org.qcobjects.controllers.form.js +214 -0
- package/js/org.qcobjects.controllers.grid.js +289 -0
- package/js/org.qcobjects.controllers.js +42 -0
- package/js/org.qcobjects.controllers.list.js +241 -0
- package/js/org.qcobjects.controllers.slider.js +148 -0
- package/js/org.qcobjects.controllers.swagger.js +86 -0
- package/js/org.qcobjects.effects.js +388 -0
- package/js/org.qcobjects.i18n_messages.js +58 -0
- package/js/org.qcobjects.modal.controllers.js +47 -0
- package/js/org.qcobjects.modal.effects.js +57 -0
- package/js/org.qcobjects.models.js +48 -0
- package/js/org.qcobjects.tools.canvas.js +59 -0
- package/js/org.qcobjects.tools.js +68 -0
- package/js/org.qcobjects.tools.layouts.js +82 -0
- package/js/org.qcobjects.views.js +42 -0
- package/package.json +17 -4
- package/spec/support/jasmine.json +16 -0
- package/spec/testsSpec.js +9 -0
- package/templates/components/modalyoulose.tpl.html +3 -0
- package/templates/components/modalyouwin.tpl.html +4 -0
- package/templates/components/splashscreen.tpl.html +128 -0
- package/templates/components/swagger-ui.tpl.html +22 -0
- package/v2.4 version +1 -0
package/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.4.24
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* The Modal (background) */
|
|
2
|
+
.modal {
|
|
3
|
+
display: none; /* Hidden by default */
|
|
4
|
+
position: fixed; /* Stay in place */
|
|
5
|
+
z-index: 1; /* Sit on top */
|
|
6
|
+
padding-top: 100px; /* Location of the box */
|
|
7
|
+
left: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
width: 100%; /* Full width */
|
|
10
|
+
height: 100%; /* Full height */
|
|
11
|
+
overflow: auto; /* Enable scroll if needed */
|
|
12
|
+
background-color: rgb(0,0,0); /* Fallback color */
|
|
13
|
+
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
|
|
14
|
+
border-radius: 12px !important;
|
|
15
|
+
border: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Modal Content */
|
|
19
|
+
.modal-content {
|
|
20
|
+
background-color: #111;
|
|
21
|
+
background-image: radial-gradient( #edeeef,#dee3de,#fcfcfc);
|
|
22
|
+
margin: auto;
|
|
23
|
+
padding: 20px;
|
|
24
|
+
border-radius: 12px !important;
|
|
25
|
+
border: 1px solid #909090;
|
|
26
|
+
width: 80%;
|
|
27
|
+
height:auto;
|
|
28
|
+
}
|
|
29
|
+
/* The Close Button */
|
|
30
|
+
.close {
|
|
31
|
+
color: #aaaaaa;
|
|
32
|
+
float: right;
|
|
33
|
+
font-size: 28px;
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.close:hover,
|
|
38
|
+
.close:focus {
|
|
39
|
+
color: #000;
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
}
|
|
43
|
+
.modal * {color:black}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to each other, on small screens */
|
|
2
|
+
@media (max-width: 600px),
|
|
3
|
+
@media (max-width:460px),
|
|
4
|
+
@media (aspect-ratio: 9/16),
|
|
5
|
+
@media (aspect-ratio: 10/16),
|
|
6
|
+
@media (aspect-ratio: 5/8),
|
|
7
|
+
@media (aspect-ratio: 3/4),
|
|
8
|
+
@media (aspect-ratio: 2/3){
|
|
9
|
+
nav, article {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: auto;
|
|
12
|
+
position: relative;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QCObjects SDK 1.0
|
|
3
|
+
* ________________
|
|
4
|
+
*
|
|
5
|
+
* Author: Jean Machuca <correojean@gmail.com>
|
|
6
|
+
*
|
|
7
|
+
* Cross Browser Javascript Framework for MVC Patterns
|
|
8
|
+
* QuickCorp/QCObjects is licensed under the
|
|
9
|
+
* GNU Lesser General Public License v3.0
|
|
10
|
+
* [LICENSE] (https://github.com/QuickCorp/QCObjects/blob/master/LICENSE.txt)
|
|
11
|
+
*
|
|
12
|
+
* Permissions of this copyleft license are conditioned on making available
|
|
13
|
+
* complete source code of licensed works and modifications under the same
|
|
14
|
+
* license or the GNU GPLv3. Copyright and license notices must be preserved.
|
|
15
|
+
* Contributors provide an express grant of patent rights. However, a larger
|
|
16
|
+
* work using the licensed work through interfaces provided by the licensed
|
|
17
|
+
* work may be distributed under different terms and without source code for
|
|
18
|
+
* the larger work.
|
|
19
|
+
*
|
|
20
|
+
* Copyright (C) 2015 Jean Machuca,<correojean@gmail.com>
|
|
21
|
+
*
|
|
22
|
+
* Everyone is permitted to copy and distribute verbatim copies of this
|
|
23
|
+
* license document, but changing it is not allowed.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
@charset "UTF-8";
|
|
27
|
+
/* CSS Document */
|
|
28
|
+
|
|
29
|
+
* {
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
body {
|
|
34
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Style the header */
|
|
38
|
+
header {
|
|
39
|
+
padding: 30px;
|
|
40
|
+
text-align: center;
|
|
41
|
+
font-size: 20px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Create two columns/boxes that floats next to each other */
|
|
45
|
+
nav {
|
|
46
|
+
float: left;
|
|
47
|
+
width: 30%;
|
|
48
|
+
height: 1080px;
|
|
49
|
+
padding: 20px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Style the list inside the menu */
|
|
53
|
+
nav ul {
|
|
54
|
+
list-style-type: none;
|
|
55
|
+
padding: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
article {
|
|
59
|
+
float: left;
|
|
60
|
+
padding: 20px;
|
|
61
|
+
width: 70%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Clear floats after the columns */
|
|
65
|
+
section:after {
|
|
66
|
+
content: "";
|
|
67
|
+
display: table;
|
|
68
|
+
clear: both;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/* Style the footer */
|
|
73
|
+
footer {
|
|
74
|
+
padding: 10px;
|
|
75
|
+
text-align: center;
|
|
76
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
ul {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
li {
|
|
6
|
+
display: inline;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
ul {
|
|
10
|
+
padding: 15px 0 15px 0;
|
|
11
|
+
background-color: #f7f6f6 !important;
|
|
12
|
+
border-radius: 13px;
|
|
13
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 2px 0px !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
ul li {
|
|
17
|
+
list-style: none;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
padding-top: 7px;
|
|
21
|
+
padding-bottom: 7px;
|
|
22
|
+
padding-left: 10px;
|
|
23
|
+
border-bottom: 1px solid white;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ul {
|
|
27
|
+
list-style-type: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
li:hover {
|
|
32
|
+
background: white;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ul li ul {
|
|
37
|
+
background: white;
|
|
38
|
+
visibility: hidden;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
min-width: 5rem;
|
|
41
|
+
position: relative;
|
|
42
|
+
transition: all 0.5s ease;
|
|
43
|
+
margin-top: 1rem;
|
|
44
|
+
left: 0;
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
ul li:hover > ul,
|
|
49
|
+
ul li ul:hover {
|
|
50
|
+
visibility: visible;
|
|
51
|
+
opacity: 1;
|
|
52
|
+
display: inline-block;
|
|
53
|
+
margin: 0 auto;
|
|
54
|
+
width: 95%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ul li ul li {
|
|
58
|
+
clear: both;
|
|
59
|
+
width: 100%;
|
|
60
|
+
padding: 1%;
|
|
61
|
+
}
|
|
62
|
+
ul li {
|
|
63
|
+
overflow-x: hidden;
|
|
64
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
ul {
|
|
2
|
+
padding: 15px 0 15px 0;
|
|
3
|
+
background-color: #f7f6f6 !important;
|
|
4
|
+
border-radius: 13px;
|
|
5
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 2px 0px !important;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
ul li {
|
|
9
|
+
list-style: none;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
padding-top: 7px;
|
|
13
|
+
padding-bottom: 7px;
|
|
14
|
+
padding-left: 10px;
|
|
15
|
+
border-bottom: 1px solid white;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
ul {
|
|
19
|
+
list-style-type: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
ul, li {display: block;}
|
|
24
|
+
li:hover {
|
|
25
|
+
background: white;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
ul li ul {
|
|
30
|
+
background: white;
|
|
31
|
+
visibility: hidden;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
min-width: 5rem;
|
|
34
|
+
position: relative;
|
|
35
|
+
transition: all 0.5s ease;
|
|
36
|
+
margin-top: 1rem;
|
|
37
|
+
left: 0;
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
ul li:hover > ul,
|
|
42
|
+
ul li ul:hover {
|
|
43
|
+
visibility: visible;
|
|
44
|
+
opacity: 1;
|
|
45
|
+
display: inline-block;
|
|
46
|
+
margin: 0 auto;
|
|
47
|
+
width: 95%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ul li ul li {
|
|
51
|
+
clear: both;
|
|
52
|
+
width: 100%;
|
|
53
|
+
padding: 1%;
|
|
54
|
+
}
|
|
55
|
+
ul li {
|
|
56
|
+
overflow-x: hidden;
|
|
57
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
:host * {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
zoom: 1.0;
|
|
7
|
+
width: device-width;
|
|
8
|
+
margin: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
position: absolute;
|
|
14
|
+
padding: 0;
|
|
15
|
+
min-width: 100vw;
|
|
16
|
+
min-height: 100vh;
|
|
17
|
+
width: 100vw;
|
|
18
|
+
height: 100vh;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
background-color: black;
|
|
21
|
+
}
|
|
22
|
+
#slot-logo::slotted(img) {
|
|
23
|
+
vertical-align: middle;
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100vw;
|
|
26
|
+
left: 0;
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
top: 20vh;
|
|
30
|
+
bottom: 20vh;
|
|
31
|
+
position: absolute;
|
|
32
|
+
z-index: 9999999999;
|
|
33
|
+
transform-origin: center;
|
|
34
|
+
transform-style: preserve-3d;
|
|
35
|
+
filter: blur(0em);
|
|
36
|
+
transition: filter 0.5s;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host * {
|
|
40
|
+
-webkit-user-select: none;
|
|
41
|
+
-moz-user-select: none;
|
|
42
|
+
-ms-user-select: none;
|
|
43
|
+
user-select: none;
|
|
44
|
+
-webkit-touch-callout: none;
|
|
45
|
+
/* prevent callout to copy image, etc when tap to hold */
|
|
46
|
+
-webkit-text-size-adjust: none;
|
|
47
|
+
/* prevent webkit from resizing text to fit */
|
|
48
|
+
-webkit-user-select: none;
|
|
49
|
+
/* prevent copy paste, to allow, change 'none' to 'text' */
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* FOCUS */
|
|
53
|
+
:host summary:focus,
|
|
54
|
+
:host a:focus,
|
|
55
|
+
:host button:focus {
|
|
56
|
+
outline: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.splashscreen,
|
|
60
|
+
.fullscreen-bg {
|
|
61
|
+
padding: 0;
|
|
62
|
+
margin: 0;
|
|
63
|
+
top: 0;
|
|
64
|
+
left: 0;
|
|
65
|
+
right: 0;
|
|
66
|
+
bottom: 0;
|
|
67
|
+
padding: 0;
|
|
68
|
+
background-attachment: fixed;
|
|
69
|
+
background-position: center;
|
|
70
|
+
background-clip: content-box;
|
|
71
|
+
background-size: cover;
|
|
72
|
+
position: absolute;
|
|
73
|
+
min-width: 100vw;
|
|
74
|
+
min-height: 100vh;
|
|
75
|
+
width: 100vw;
|
|
76
|
+
height: 100vh;
|
|
77
|
+
z-index: 0;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.splashscreen .splashcontent {
|
|
82
|
+
top: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
right: 0;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
margin: 0 auto;
|
|
87
|
+
width: 100vw;
|
|
88
|
+
height: 100vh;
|
|
89
|
+
padding: 0;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
z-index: 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.splashscreen .splashcontent p {
|
|
95
|
+
color: white;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
video.fullscreen-bg__video {
|
|
99
|
+
top: 0;
|
|
100
|
+
left: 0;
|
|
101
|
+
bottom: 0;
|
|
102
|
+
right: 0;
|
|
103
|
+
margin: 0;
|
|
104
|
+
padding: 0;
|
|
105
|
+
position: absolute;
|
|
106
|
+
min-width: 100vw;
|
|
107
|
+
min-height: 100vh;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
z-index: 0;
|
|
110
|
+
object-fit: cover;
|
|
111
|
+
}
|
package/css/modal.css
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@import url("./base-modal.css");
|
|
2
|
+
|
|
3
|
+
.modal details {
|
|
4
|
+
border: 1px 0 0 1px solid #aaa;
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
padding: .5em .5em 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.modal summary {
|
|
10
|
+
font-weight: bold;
|
|
11
|
+
margin: -.5em -.5em 0;
|
|
12
|
+
padding: .5em;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.modal details[open] {
|
|
16
|
+
padding: .5em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.modal details[open] summary {
|
|
20
|
+
border-bottom: 1px solid #aaa;
|
|
21
|
+
margin-bottom: .5em;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.modal summary::-webkit-details-marker {
|
|
25
|
+
display: none
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.modal summary:after {
|
|
29
|
+
border-radius: 5px;
|
|
30
|
+
content: "+";
|
|
31
|
+
color: #111111;
|
|
32
|
+
float: left;
|
|
33
|
+
font-size: 1.5em;
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
margin: -5px 10px 0 0;
|
|
36
|
+
padding: 0;
|
|
37
|
+
text-align: center;
|
|
38
|
+
width: 20px;
|
|
39
|
+
}
|
|
40
|
+
.modal details[open] summary:after {
|
|
41
|
+
content: "-";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.modal ul {
|
|
45
|
+
list-style-type: none;
|
|
46
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
|
|
7
|
+
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
|
|
8
|
+
<meta http-equiv="Content-Security-Policy"
|
|
9
|
+
content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
|
|
10
|
+
<title>QCObjects Demo</title>
|
|
11
|
+
<script type="text/javascript"
|
|
12
|
+
src="https://cdnjs.cloudflare.com/ajax/libs/qcobjects/2.4.20/QCObjects.js"></script>
|
|
13
|
+
</head>
|
|
14
|
+
|
|
15
|
+
<body>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<my-grid cols=4 componentClass="org.qcobjects.components.grid.GridComponent" serviceClass="MyTestService">
|
|
19
|
+
</my-grid>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
logger.debugEnabled = true;
|
|
23
|
+
|
|
24
|
+
class MyTestService extends Service {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Creates the instance for MyTestService
|
|
28
|
+
*/
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.name = 'myservice';
|
|
32
|
+
this.external = true;
|
|
33
|
+
this.cached = false;
|
|
34
|
+
this.method = 'GET';
|
|
35
|
+
this.headers = { 'Content-Type': 'application/json' };
|
|
36
|
+
this.url = 'https://api.github.com/orgs/QuickCorp/repos';
|
|
37
|
+
this.withCredentials = false;
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
done({ request, service }) {
|
|
42
|
+
logger.debug(request);
|
|
43
|
+
service.template = JSON.stringify({
|
|
44
|
+
result: JSON.parse(service.template).reverse().map(function (project) {
|
|
45
|
+
return {
|
|
46
|
+
id: project.id,
|
|
47
|
+
description: project.description,
|
|
48
|
+
title: project.name,
|
|
49
|
+
url: project.html_url,
|
|
50
|
+
image: `https://via.placeholder.com/150/FFFF00/000000?text=${encodeURI(project.name)}`
|
|
51
|
+
};
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
RegisterWidgets ("my-grid")
|
|
60
|
+
</script>
|
|
61
|
+
</body>
|
|
62
|
+
|
|
63
|
+
</html>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
|
|
7
|
+
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
|
|
8
|
+
<meta http-equiv="Content-Security-Policy"
|
|
9
|
+
content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
|
|
10
|
+
<title>QCObjects Demo</title>
|
|
11
|
+
<script type="text/javascript"
|
|
12
|
+
src="https://raw.githubusercontent.com/QuickCorp/QCObjects/v2.4-beta/QCObjects.js"></script>
|
|
13
|
+
</head>
|
|
14
|
+
|
|
15
|
+
<body>
|
|
16
|
+
|
|
17
|
+
<my-list componentClass="ListComponent" serviceClass="MyTestService" label-field="name" value-field="html_url">
|
|
18
|
+
|
|
19
|
+
</my-list>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
logger.debugEnabled = true;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class MyTestService extends Service {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates the instance for MyTestService
|
|
29
|
+
*/
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
|
|
33
|
+
this.name = 'myservice';
|
|
34
|
+
this.external = true;
|
|
35
|
+
this.cached = false;
|
|
36
|
+
this.method = 'GET';
|
|
37
|
+
this.headers = { 'Content-Type': 'application/json' };
|
|
38
|
+
this.url = 'https://api.github.com/orgs/QuickCorp/repos';
|
|
39
|
+
this.withCredentials = false;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
done (standardResponse){
|
|
44
|
+
console.log(standardResponse);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
RegisterWidgets("my-list");
|
|
49
|
+
|
|
50
|
+
</script>
|
|
51
|
+
</body>
|
|
52
|
+
|
|
53
|
+
</html>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
|
|
8
|
+
<meta http-equiv="Content-Security-Policy"
|
|
9
|
+
content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
|
|
10
|
+
<title>QCObjects Demo</title>
|
|
11
|
+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/qcobjects/2.4.20/QCObjects.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<custom-notification template-source="inline" componentClass="CustomNotificationComponent"></custom-notification>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
|
|
21
|
+
class CustomNotificationComponent extends Component {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Creates the instance for CustomNotificationComponent
|
|
25
|
+
*/
|
|
26
|
+
constructor () {
|
|
27
|
+
this.message= "Page was loaded successfully!";
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* What is inside this function is executed after the component loading is done
|
|
33
|
+
*
|
|
34
|
+
* @param {*} standardResponse it brings all information of the component
|
|
35
|
+
*/
|
|
36
|
+
done(standardResponse) {
|
|
37
|
+
super.done(standardResponse);
|
|
38
|
+
|
|
39
|
+
/* in this case we will call a notification after the component is loaded*/
|
|
40
|
+
NotificationComponent.success(this.message);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
RegisterWidgets ("custom-notification")
|
|
46
|
+
</script>
|
|
47
|
+
</body>
|
|
48
|
+
|
|
49
|
+
</html>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
|
|
8
|
+
<meta http-equiv="Content-Security-Policy"
|
|
9
|
+
content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com; img-src * 'self' data:; child-src *; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src * 'self' 'unsafe-inline' 'unsafe-eval';media-src *">
|
|
10
|
+
<title>QCObjects Demo</title>
|
|
11
|
+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/qcobjects/2.4.20/QCObjects.js"></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<my-slider componentClass="org.qcobjects.components.slider.SliderComponent" serviceClass="MyTestService"></my-slider>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
logger.debugEnabled = true;
|
|
21
|
+
|
|
22
|
+
class MyTestService extends Service {
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates the instance for MyTestService
|
|
26
|
+
*/
|
|
27
|
+
constructor() {
|
|
28
|
+
this.name = 'myservice';
|
|
29
|
+
this.external = true;
|
|
30
|
+
this.cached = false;
|
|
31
|
+
this.method = 'GET';
|
|
32
|
+
this.headers = { 'Content-Type': 'application/json' };
|
|
33
|
+
this.url = 'https://api.github.com/orgs/QuickCorp/repos';
|
|
34
|
+
this.withCredentials = false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* What is inside this function is executed after the component loading is done
|
|
39
|
+
*
|
|
40
|
+
* @param {*} standardResponse it brings all information of the component
|
|
41
|
+
*/
|
|
42
|
+
done({ request, service }) {
|
|
43
|
+
logger.debug(request);
|
|
44
|
+
|
|
45
|
+
/* in this case we will parse response and use only the fields we need */
|
|
46
|
+
service.template = JSON.stringify({
|
|
47
|
+
result: JSON.parse(service.template).reverse().map(function (project) {
|
|
48
|
+
return {
|
|
49
|
+
id: project.id,
|
|
50
|
+
description: project.description,
|
|
51
|
+
title: project.name,
|
|
52
|
+
link: project.html_url,
|
|
53
|
+
image: `https://via.placeholder.com/150/FFFF00/000000?text=${encodeURI(project.name)}`,
|
|
54
|
+
label: "Go to repo",
|
|
55
|
+
category: project.name
|
|
56
|
+
};
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
RegisterWidgets("my-slider")
|
|
65
|
+
</script>
|
|
66
|
+
</body>
|
|
67
|
+
|
|
68
|
+
</html>
|
package/favicon.ico
ADDED
|
Binary file
|