qcobjects-sdk 2.4.26 → 2.4.28

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/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.26
1
+ 2.4.28
@@ -27,43 +27,40 @@
27
27
  Package("org.qcobjects.components.grid", [
28
28
 
29
29
  class GridItemComponent extends Component {
30
-
31
- constructor (){
32
- super(...arguments);
33
- this.name = "grid-item";
34
- this.shadowed= true;
35
- this.tplsource= "inline";
36
- this.template= `
30
+ name = "grid-item";
31
+ shadowed= true;
32
+ tplsource= "inline";
33
+ template= `
37
34
  <img src="{{image}}" />
38
35
  <p>{{description}}</p>
39
36
  `;
40
- this.cached= false;
37
+ cached= false;
38
+
39
+ constructor (){
40
+ super(...arguments);
41
41
  }
42
42
  },
43
43
 
44
44
  class GridComponent extends Component {
45
+ name= "grid";
46
+ cached= false;
47
+ view= null;
48
+ shadowed= true;
49
+ rows= 3;
50
+ cols= 3;
51
+ templateURI= "";
52
+ data= {};
53
+ tplsource= "inline";
54
+ template= "<p>Loading...</p>";
55
+
45
56
  constructor (){
46
57
  super(...arguments);
47
- this.name= "grid";
48
- this.cached= false;
49
- this.view= null;
50
- this.shadowed= true;
51
- this.rows= 3;
52
- this.cols= 3;
53
- this.templateURI= "";
54
- this.data= {};
55
- this.tplsource= "inline";
56
- this.template= "<p>Loading...</p>";
58
+ this.body.setAttribute("controllerClass", "DataGridController");
59
+ var subcomponentClass = (this.body.getAttribute("subcomponentClass") !== null) ? (this.body.getAttribute("subcomponentClass")) : ("GridItemComponent");
60
+ this.body.setAttribute("subcomponentClass", subcomponentClass);
57
61
 
58
62
  }
59
63
 
60
- _new_(o) {
61
- super._new_(o);
62
- o.body.setAttribute("controllerClass", "DataGridController");
63
- var subcomponentClass = (o.body.getAttribute("subcomponentClass") !== null) ? (o.body.getAttribute("subcomponentClass")) : ("GridItemComponent");
64
- o.body.setAttribute("subcomponentClass", subcomponentClass);
65
- }
66
-
67
64
 
68
65
  }
69
66
  ]);
@@ -26,10 +26,10 @@
26
26
  (function () {
27
27
  Package("org.qcobjects.base.components", [
28
28
  class FormField extends Component {
29
+ cached = false;
30
+ reload = true;
29
31
  constructor() {
30
32
  super(...arguments);
31
- this.cached = false;
32
- this.reload = true;
33
33
 
34
34
  }
35
35
 
@@ -95,15 +95,16 @@
95
95
  Package("org.qcobjects.form.components", [
96
96
 
97
97
  class ShadowedComponent extends Component {
98
+ container = null;
99
+ body = null;
100
+ shadowed = true;
101
+ cached = false;
102
+ controller = null;
103
+ view = null;
104
+ data = {};
105
+
98
106
  constructor() {
99
107
  super(...arguments);
100
- this.container = null;
101
- this.body = null;
102
- this.shadowed = true;
103
- this.cached = false;
104
- this.controller = null;
105
- this.view = null;
106
- this.data = {};
107
108
  this.body = _DOMCreateElement("div");
108
109
  }
109
110
 
@@ -147,28 +148,29 @@
147
148
  },
148
149
 
149
150
  class ModalEnclosureComponent extends Component {
150
- constructor() {
151
- super(...arguments);
152
- this.name = "modal";
153
- this.tplsource = "inline";
154
- this.cached = false;
155
- this.basePath = CONFIG.get("modalBasePath", CONFIG.get("remoteSDKPath"));
156
- this.data = {};
157
- this.template = `
151
+ tplsource = "inline";
152
+ cached = false;
153
+ basePath = CONFIG.get("modalBasePath", CONFIG.get("remoteSDKPath"));
154
+ template = `
158
155
  <!-- The Modal -->
159
156
  <style>
160
- @import url('https://sdk.qcobjects.dev/css/modal.css');
157
+ @import url('https://sdk.qcobjects.dev/css/modal.css');
161
158
  </style>
162
159
  <div id="modalInstance_{{modalId}}" class="modal">
163
160
 
164
161
  <!-- Modal content -->
165
162
  <div class="modal-content">
166
- <span class="close">&times;</span>
167
- {{content}}
163
+ <span class="close">&times;</span>
164
+ {{content}}
168
165
  </div>
169
166
 
170
167
  </div>
171
168
  `;
169
+
170
+ data = {};
171
+ constructor() {
172
+ super(...arguments);
173
+ this.name = "modal";
172
174
  this.body = _DOMCreateElement("div");
173
175
  }
174
176
 
@@ -261,12 +263,13 @@
261
263
  },
262
264
 
263
265
  class SwaggerUIComponent extends Component {
266
+ cached = false;
267
+ basePath = CONFIG.get("remoteSDKPath");
268
+ tplextension = "tpl.html";
269
+
264
270
  constructor() {
265
271
  super(...arguments);
266
272
  this.name = "swagger-ui";
267
- this.cached = false;
268
- this.basePath = CONFIG.get("remoteSDKPath");
269
- this.tplextension = "tpl.html";
270
273
 
271
274
  }
272
275
 
@@ -27,27 +27,29 @@
27
27
  Package("org.qcobjects.components.list",[
28
28
 
29
29
  class ListItemComponent extends Component {
30
+ name="list-item";
31
+ shadowed= false;
32
+ tplsource= "inline";
33
+ template="<a href=\"{{value}}\">{{label}}</a>";
34
+ cached= false;
35
+
30
36
  constructor (){
31
37
  super(...arguments);
32
- this.name="list-item";
33
- this.shadowed= false;
34
- this.tplsource= "inline";
35
- this.template="<a href=\"{{value}}\">{{label}}</a>";
36
- this.cached= false;
37
-
38
38
  }
39
39
 
40
40
  },
41
41
 
42
42
  class ListComponent extends Component {
43
+ name="list";
44
+ shadowed= true;
45
+ tplsource= "inline";
46
+ template= "<p>Loading...</p>";
47
+
43
48
  constructor () {
44
49
  super(...arguments);
45
- this.name="list";
46
- this.shadowed= true;
47
- this.tplsource= "inline";
48
- this.template= "<p>Loading...</p>";
49
50
  this.body.setAttribute("controllerClass","ListController");
50
51
  this.body.setAttribute("subcomponentClass","ListItemComponent");
52
+
51
53
  }
52
54
 
53
55
  },
@@ -27,34 +27,31 @@
27
27
  Package("org.qcobjects.components.slider",[
28
28
 
29
29
  class SlideListComponent extends Component {
30
+ tplsource="inline";
31
+ template="<p>Loading...</p>";
30
32
 
31
33
  constructor (){
32
34
  super(...arguments);
33
35
  this.name="slidelist";
34
- this.tplsource="inline";
35
- this.template="<p>Loading...</p>";
36
-
37
- }
38
-
39
- _new_ (o){
40
- super._new_(o);
41
- o.body.setAttribute("controllerClass","DataGridController");
42
- var subcomponentClass = (o.body.getAttribute("subcomponentClass") !== null)?(o.body.getAttribute("subcomponentClass")):("GridItemComponent");
43
- o.body.setAttribute("subcomponentClass",subcomponentClass);
36
+ this.body.setAttribute("controllerClass","DataGridController");
37
+ var subcomponentClass = (this.body.getAttribute("subcomponentClass") !== null)?(this.body.getAttribute("subcomponentClass")):("GridItemComponent");
38
+ this.body.setAttribute("subcomponentClass",subcomponentClass);
44
39
  }
45
40
 
46
41
 
47
42
  },
48
43
 
49
44
  class SlideItemComponent extends Component {
45
+ effectClass = "Fade";
46
+ name = "slider_item";
50
47
 
51
- constructor () {
48
+ constructor ({data}) {
52
49
  super(...arguments);
53
- this.name="slider_item";
50
+ this.data.slideNumber = data.__dataIndex+1;
54
51
  this.template= `
55
52
  <div class="qcoSlides" style="display:none">
56
53
  <div class="qco-slider__numbertext">{{slideNumber}} / {{__dataLength}}</div>
57
- <img src="{{image}}" alt="{{name}}"/>
54
+ <img src="{{image}}" alt="{{title}}"/>
58
55
  <div class="qco-slider__text">
59
56
  <p>{{label}} <a href="{{link}}">{{category}}</a></p>
60
57
  </div>
@@ -64,19 +61,13 @@ Package("org.qcobjects.components.slider",[
64
61
 
65
62
  }
66
63
 
67
- _new_ (o){
68
- super._new_(o);
69
- this.data.slideNumber = o.data.__dataIndex + 1;
70
- }
71
-
72
-
73
64
  },
74
65
 
75
66
  class SliderComponent extends Component {
67
+ name = "slider";
76
68
 
77
69
  constructor () {
78
70
  super(...arguments);
79
- this.name="slider";
80
71
  this.template= `
81
72
  <style>
82
73
  /* Slideshow container */
@@ -200,14 +191,10 @@ Package("org.qcobjects.components.slider",[
200
191
  `;
201
192
  this.tplsource= "inline";
202
193
  this.shadowed= true;
203
-
204
- }
205
-
206
- _new_(){
207
- super._new_();
208
194
  this.data.SERVICE_CLASS = this.body.getAttribute("serviceClass");
209
195
  this.data.sliderHandler = "slider_"+this.__instanceID.toString();
210
196
  this.body.setAttribute("controllerClass","SliderController");
197
+
211
198
  }
212
199
 
213
200
  }
@@ -42,17 +42,17 @@ Package("org.qcobjects.controllers.form",[
42
42
  },
43
43
 
44
44
  class FormController extends Controller {
45
+ dependencies=[];
46
+ component=null;
47
+ serviceClass="";
48
+ formSettings={
49
+ backRouting:"#",
50
+ loadingRouting:"#loading",
51
+ nextRouting:"#signupsuccessful"
52
+ };
45
53
 
46
54
  constructor (){
47
55
  super(...arguments);
48
- this.dependencies=[];
49
- this.component=null;
50
- this.serviceClass="";
51
- this.formSettings={
52
- backRouting:"#",
53
- loadingRouting:"#loading",
54
- nextRouting:"#signupsuccessful"
55
- };
56
56
 
57
57
  }
58
58
 
@@ -27,21 +27,17 @@
27
27
  Package("org.qcobjects.controllers.grid",[
28
28
 
29
29
  class GridComponent extends Controller {
30
+ dependencies=[];
31
+ component=null;
30
32
 
31
33
  constructor (){
32
34
  super(...arguments);
33
- this.dependencies=[];
34
- this.component=null;
35
-
36
- }
37
-
38
- _new_ (o){
39
- super.__new__(o);
40
35
  var controller=this;
41
36
  controller.rows=controller.component.body.getAttribute("rows");
42
37
  controller.rows=(controller.rows !== null)?(controller.rows):(controller.component.rows);
43
38
  controller.cols=controller.component.body.getAttribute("cols");
44
39
  controller.cols=(controller.cols !== null)?(controller.cols):(controller.component.cols);
40
+
45
41
  }
46
42
 
47
43
  cssGrid (){
@@ -79,23 +75,20 @@ Package("org.qcobjects.controllers.grid",[
79
75
  },
80
76
 
81
77
  class DataGridController extends Controller {
82
- constructor (){
83
- super(...arguments);
84
- this.dependencies=[];
85
- this.component=null;
86
-
87
- }
78
+ dependencies=[];
79
+ component=null;
88
80
 
89
- _new_ (o){
90
- super.__new__(o);
81
+ constructor ({component}){
82
+ super(...arguments);
91
83
  var controller=this;
92
- var component = controller.component;
84
+ controller.component = component;
93
85
  controller._componentRoot = (component.shadowed)?(component.shadowRoot):(component.body);
94
86
  controller.rows=controller.component.body.getAttribute("rows");
95
87
  controller.rows=(controller.rows !== null)?(controller.rows):(controller.component.rows);
96
88
  controller.cols=controller.component.body.getAttribute("cols");
97
89
  controller.cols=(controller.cols !== null)?(controller.cols):(controller.component.cols);
98
90
  logger.debug("DataGridController INIT");
91
+
99
92
  }
100
93
 
101
94
  getPageIndex (page, totalPage, totalElements) {
@@ -156,6 +149,7 @@ Package("org.qcobjects.controllers.grid",[
156
149
  __offset: offset
157
150
  });
158
151
  var subcomponent = New(ClassFactory(subcomponentClass),{
152
+ name:"item",
159
153
  data:record,
160
154
  templateURI:ComponentURI({
161
155
  "COMPONENTS_BASE_PATH":CONFIG.get("componentsBasePath"),
@@ -27,16 +27,16 @@
27
27
  Package("org.qcobjects.controllers.list", [
28
28
 
29
29
  class ListController extends Controller {
30
- constructor() {
31
- super(...arguments);
32
- this.dependencies = [];
33
- this.component = null;
34
-
35
- }
30
+ dependencies = [];
31
+ component = null;
32
+ valueField = undefined;
33
+ labelField = undefined;
36
34
 
37
- _new_(o) {
38
- super.__new__(o);
35
+ constructor({component}) {
36
+ super(...arguments);
37
+ this.component = component;
39
38
  var controller = this;
39
+ controller.component = component;
40
40
  controller._componentRoot = (controller.component.shadowed) ? (controller.component.shadowRoot) : (controller.component.body);
41
41
 
42
42
  controller.labelField = controller.component.body.getAttribute("label-field");
@@ -45,6 +45,7 @@
45
45
  controller.rows = (controller.rows !== null) ? (controller.rows) : (controller.component.rows);
46
46
  controller.cols = 1;
47
47
  logger.debug("ListController INIT");
48
+
48
49
  }
49
50
 
50
51
  getPageIndex(page, totalPage, totalElements) {
@@ -61,6 +62,9 @@
61
62
  var layout = controller.component.body.getAttribute("layout");
62
63
  var basePath = CONFIG.get("listBasePath", CONFIG.get("remoteSDKPath"));
63
64
  var cssLayout = "";
65
+ controller.labelField = controller.component.body.getAttribute("label-field");
66
+ controller.valueField = controller.component.body.getAttribute("value-field");
67
+
64
68
  if (layout === "horizontal") {
65
69
  cssLayout = `@import url("${basePath}css/components/horizontal-list.css");`;
66
70
  } else {
@@ -103,6 +107,7 @@
103
107
  record.label = record[controller.labelField];
104
108
  record.value = record[controller.valueField];
105
109
  var subcomponent = New(ClassFactory(subcomponentClass), {
110
+ name:"list-item",
106
111
  data: {
107
112
  label: record[controller.labelField],
108
113
  value: record[controller.valueField],
@@ -27,28 +27,25 @@
27
27
  Package("org.qcobjects.controllers.slider", [
28
28
 
29
29
  class SliderController extends Controller {
30
-
31
- constructor() {
30
+ dependencies = [];
31
+ component = null;
32
+ slideIndex = 0;
33
+ duration = 7100;
34
+ interval = null;
35
+ sliderHandlerName = null;
36
+
37
+ constructor({component}) {
32
38
  super(...arguments);
33
- this.dependencies = [];
34
- this.component = null;
35
- this.slideIndex = 0;
36
- this.duration = 7100;
37
- this.interval = null;
38
- this.sliderHandlerName = null;
39
-
40
- }
41
-
42
- _new_(o) {
43
- super.__new__(o);
44
39
  var controller = this;
45
- var component = controller.component;
40
+ controller.component = component;
46
41
  controller._componentRoot = (component.shadowed) ? (component.shadowRoot) : (component.body);
47
42
  //TODO: Implement
48
43
  controller.sliderHandlerName = "slider_" + controller.component.__instanceID.toString();
49
44
  global.set(controller.sliderHandlerName, this);
45
+
50
46
  }
51
47
 
48
+
52
49
  stop() {
53
50
  if (this.interval != null) {
54
51
  clearInterval(this.interval);
@@ -87,29 +84,27 @@
87
84
  if (n < 0) {
88
85
  controller.slideIndex = 0;
89
86
  }
90
- slides.map((slide) => {
91
- Fade.apply(slide, 1, 0);
87
+ slides.filter((slide, index)=> {return index!== controller.slideIndex;}).map((slide) => {
88
+ (New(ClassFactory("Fade"))).apply(slide, 1, 0);
92
89
  });
93
- dots.map((dot) => {
90
+ dots.filter((dot, index)=> {return index!== controller.slideIndex;}).map((dot) => {
94
91
  dot.classList.remove("active");
95
92
  });
96
93
  try {
97
94
  dots[controller.slideIndex].classList.add("active");
98
95
  } catch (e) {
99
- logger.debug("Something went wrong when trying to activate a slide");
100
- logger.debug(e.message);
96
+ logger.debug(`Something went wrong when trying to activate a slide: ${controller.slideIndex} - ${e.message}`);
101
97
  }
102
98
  setTimeout(function () {
103
- slides.map((slide) => {
99
+ slides.filter((slide, index)=> {return index!== controller.slideIndex;}).map((slide) => {
104
100
  slide.style.display = "none";
105
101
  });
106
102
  try {
107
103
  slides[controller.slideIndex].style.display = "block";
108
- Fade.apply(slides[controller.slideIndex], 0, 1);
104
+ (New(ClassFactory("Fade"))).apply(slides[controller.slideIndex], 0, 1);
109
105
 
110
106
  } catch (e) {
111
- logger.debug("Something went wrong when trying to show a slide");
112
- logger.debug(e.message);
107
+ logger.debug(`Something went wrong when trying to show a slide: ${controller.slideIndex} - ${e.message}`);
113
108
  }
114
109
  }, 700);
115
110
  }
@@ -129,7 +124,7 @@
129
124
  done() {
130
125
  var controller = this;
131
126
  var slides = controller._componentRoot.subelements(".qcoSlides");
132
- slides.map((slide) => {
127
+ slides.filter((slide, index)=> {return index!== controller.slideIndex;}).map((slide) => {
133
128
  slide.style.display = "none";
134
129
  });
135
130
  setTimeout(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qcobjects-sdk",
3
- "version": "2.4.26",
3
+ "version": "2.4.28",
4
4
  "description": "QCObjects SDK is a set of Controllers, Views and Components that are elementary and useful to assist developers to build applications under MVC patterns using QCObjects, Cross Browser Javascript Framework for MVC Patterns",
5
5
  "main": "QCObjects-SDK.js",
6
6
  "scripts": {
@@ -1,63 +0,0 @@
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>
@@ -1,53 +0,0 @@
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>
@@ -1,49 +0,0 @@
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>
@@ -1,68 +0,0 @@
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>