Skip to content

Commit 5143a5c

Browse files
committed
SVY-20350 create a servoy-extra sample servoy application in the
servoy-extra repo add lightboxGalerry testing
1 parent 5c93426 commit 5143a5c

5 files changed

Lines changed: 264 additions & 57 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"columns":{
3+
"columns":[
4+
{
5+
"allowNull":false,
6+
"creationOrderIndex":-1,
7+
"dataType":12,
8+
"flags":5,
9+
"length":36,
10+
"name":"id"
11+
},
12+
{
13+
"allowNull":true,
14+
"creationOrderIndex":-1,
15+
"dataType":12,
16+
"length":50,
17+
"name":"name"
18+
},
19+
{
20+
"allowNull":true,
21+
"creationOrderIndex":-1,
22+
"dataType":-4,
23+
"name":"picture"
24+
},
25+
{
26+
"allowNull":true,
27+
"creationOrderIndex":-1,
28+
"dataType":4,
29+
"name":"sort"
30+
},
31+
{
32+
"allowNull":true,
33+
"creationOrderIndex":-1,
34+
"dataType":-4,
35+
"name":"thumbnail"
36+
}
37+
],
38+
"name":"pictures",
39+
"tableType":0
40+
},
41+
"dataSource":"mem:pictures",
42+
"typeid":39,
43+
"uuid":"600B823A-302A-4F96-8157-E2C8A143970A"
44+
}

servoyExtraComponentExample/forms/lightboxgalleryForm.frm

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,50 @@
33
"formComponent":false,
44
"useCssPosition":true
55
},
6+
"dataSource":"mem:pictures",
67
"encapsulation":108,
78
"items":[
9+
{
10+
"cssPosition":"504,-1,-1,33,238,30",
11+
"json":{
12+
"cssPosition":{
13+
"bottom":"-1",
14+
"height":"30",
15+
"left":"33",
16+
"right":"-1",
17+
"top":"504",
18+
"width":"238"
19+
},
20+
"onActionMethodID":"0BFFC76E-217A-44B4-AFDB-F0E913876B92",
21+
"text":"Refresh",
22+
"toolTipText":"Refresh",
23+
"variant":"BtnPrimary"
24+
},
25+
"name":"button_refresh",
26+
"typeName":"bootstrapcomponents-button",
27+
"typeid":47,
28+
"uuid":"167471BC-1312-47C6-9B22-8FCFF867F4F4"
29+
},
30+
{
31+
"cssPosition":"469,-1,-1,33,238,30",
32+
"json":{
33+
"cssPosition":{
34+
"bottom":"-1",
35+
"height":"30",
36+
"left":"33",
37+
"right":"-1",
38+
"top":"469",
39+
"width":"238"
40+
},
41+
"onActionMethodID":"EDF7A059-75A7-40E3-9C5E-967A1DA5D3B6",
42+
"text":"Show Lightbox",
43+
"variant":"BtnPrimary"
44+
},
45+
"name":"button_showLightbox",
46+
"typeName":"bootstrapcomponents-button",
47+
"typeid":47,
48+
"uuid":"1EFB9011-195C-4467-8852-1EE6D5B3361B"
49+
},
850
{
951
"cssPosition":"411,-1,-1,31,579,30",
1052
"json":{
@@ -31,21 +73,27 @@
3173
"uuid":"EB61DF27-B72A-4D3B-8E8D-50D416ADDE0D"
3274
},
3375
{
34-
"cssPosition":"27,-1,-1,30,580,334",
76+
"cssPosition":"27,-1,-1,30,580,348",
3577
"json":{
3678
"cssPosition":{
3779
"bottom":"-1",
38-
"height":"334",
80+
"height":"348",
3981
"left":"30",
4082
"right":"-1",
4183
"top":"27",
4284
"width":"580"
4385
},
44-
"imagesDataset":[
45-
{
46-
"svyUUID":"898AD1BC-7FF0-40F5-BE74-BA67C6B1ABD2"
47-
}
48-
],
86+
"imagesDataset":[],
87+
"imagesFoundset":{
88+
"dataproviders":{
89+
"caption":"name",
90+
"image":"picture",
91+
"imageId":"id",
92+
"thumbnail":"picture"
93+
},
94+
"foundsetSelector":"mem:pictures",
95+
"loadAllRecords":true
96+
},
4997
"onHoverButtonClicked":"0B0E8A61-2FC5-4FC4-95F0-C7357C3F927D"
5098
},
5199
"name":"lightboxgallery_17",
@@ -56,6 +104,7 @@
56104
],
57105
"name":"lightboxgalleryForm",
58106
"navigatorID":"-1",
107+
"onShowMethodID":"EE3765D4-8B40-496D-AF30-1EC8608E85BB",
59108
"showInMenu":true,
60109
"size":"640,1000",
61110
"typeid":3,

servoyExtraComponentExample/forms/lightboxgalleryForm.js

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,87 @@
1+
/**
2+
* @properties={typeid:35,uuid:"B8FE0830-9BAB-4053-B2B4-73B818678760",variableType:-4}
3+
*/
4+
var dataHorizontal = plugins.http.getMediaData("media:///i98rzu.jpg");
5+
/**
6+
* @properties={typeid:35,uuid:"CBE89003-F812-48DB-9D39-388406C82C12",variableType:-4}
7+
*/
8+
var dataVertical = plugins.http.getMediaData("media:///wallpaperPortrait.jpg");
9+
10+
11+
/**
12+
* @type {Number}
13+
*
14+
* @properties={typeid:35,uuid:"FA3DA4B0-3126-4D0E-903F-FF812A972756",variableType:4}
15+
*/
16+
var fadeDuration = 100;
17+
/**
18+
* @type {Number}
19+
*
20+
* @properties={typeid:35,uuid:"B55F4B3F-30BB-4422-A55E-DF8179F555D2",variableType:4}
21+
*/
22+
var imageFadeDuration = 100;
23+
/**
24+
* @type {Number}
25+
*
26+
* @properties={typeid:35,uuid:"29855D78-C330-453C-A4EC-181C9E1F536C",variableType:4}
27+
*/
28+
var resizeDuration = 100;
29+
/**
30+
* @type {Number}
31+
*
32+
* @properties={typeid:35,uuid:"6AACF11A-379C-4189-AF29-548508682B5D",variableType:4}
33+
*/
34+
var batchSize = 5;
35+
36+
37+
/**
38+
* @properties={typeid:24,uuid:"F757184F-B9AA-4E53-80C8-D508394540A4"}
39+
*/
40+
function createData() {
41+
var record;
42+
var imageHorizontal = plugins.images.getImage(dataHorizontal)
43+
var thumbHorizontal = imageHorizontal.resize(400, 400)
44+
var imageVertical = plugins.images.getImage(dataVertical)
45+
var thumbVertical = imageVertical.resize(400, 400)
46+
var fsPics = datasources.mem.pictures.getFoundSet();
47+
fsPics.loadAllRecords();
48+
fsPics.deleteAllRecords();
49+
for (var i = 0; i < 5; i++) {
50+
record = fsPics.getRecord(fsPics.newRecord());
51+
record.picture = dataHorizontal;
52+
record.name = 'horizontal ' + i.toString();
53+
record.sort = (i + 1) * 10 + 1
54+
record.id = application.getUUID();
55+
record.thumbnail = thumbHorizontal;
56+
57+
record = fsPics.getRecord(fsPics.newRecord());
58+
record.picture = dataVertical;
59+
record.name = 'vertical ' + i.toString();
60+
record.sort = (i + 1) * 10 + 2
61+
record.id = application.getUUID();
62+
record.thumbnail = thumbVertical;
63+
64+
}
65+
databaseManager.saveData(fsPics)
66+
}
67+
68+
/**
69+
* @properties={typeid:24,uuid:"06AB2BCA-0BCF-4B77-A97F-FDB189A43FB3"}
70+
*/
71+
function initDurations() {
72+
elements.lightboxgallery_17.imageFadeDuration = imageFadeDuration;
73+
elements.lightboxgallery_17.fadeDuration = fadeDuration;
74+
elements.lightboxgallery_17.resizeDuration = resizeDuration;
75+
elements.lightboxgallery_17.imageBatchSize = batchSize;
76+
}
77+
78+
/**
79+
* @properties={typeid:24,uuid:"EE3765D4-8B40-496D-AF30-1EC8608E85BB"}
80+
*/
81+
function onShow() {
82+
createData();
83+
}
84+
185
/**
286
* @param {JSEvent} event
387
* @param {String} imageId
@@ -7,3 +91,26 @@
791
function onHoverButtonClicked(event, imageId) {
892
elements.label_1.text = 'Hover button clicked! ';
993
}
94+
95+
/**
96+
* Fired when the button is clicked.
97+
*
98+
* @param {JSEvent} event
99+
*
100+
* @properties={typeid:24,uuid:"EDF7A059-75A7-40E3-9C5E-967A1DA5D3B6"}
101+
*/
102+
function onShowLightbox(event) {
103+
elements.lightboxgallery_17.showLightbox();
104+
}
105+
106+
/**
107+
* Fired when the button is clicked.
108+
*
109+
* @param {JSEvent} event
110+
*
111+
* @properties={typeid:24,uuid:"0BFFC76E-217A-44B4-AFDB-F0E913876B92"}
112+
*/
113+
function onRefresh(event) {
114+
elements.lightboxgallery_17.refresh();
115+
}
116+
Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,79 @@
11
[
22
{
3-
"encapsulation":0,
4-
"mimeType":"text/css",
5-
"name":"custom_servoy_theme_properties.less",
6-
"typeid":37,
7-
"uuid":"3E02D832-7853-4B60-BA87-384E175BF2BC"
3+
"encapsulation":0,
4+
"mimeType":"text/css",
5+
"name":"custom_servoy_theme_properties.less",
6+
"typeid":37,
7+
"uuid":"3E02D832-7853-4B60-BA87-384E175BF2BC"
88
},
99
{
10-
"encapsulation":0,
11-
"mimeType":"image/png",
12-
"name":"group.png",
13-
"typeid":37,
14-
"uuid":"3D47FB17-68D6-4A82-B558-6143AADC89F1"
10+
"encapsulation":0,
11+
"mimeType":"image/png",
12+
"name":"group.png",
13+
"typeid":37,
14+
"uuid":"3D47FB17-68D6-4A82-B558-6143AADC89F1"
1515
},
1616
{
17-
"encapsulation":0,
18-
"mimeType":"image/jpeg",
19-
"name":"i98rzu.jpg",
20-
"typeid":37,
21-
"uuid":"6AB29C1B-D9BB-40AB-92B9-E0B682D51A2B"
17+
"encapsulation":0,
18+
"mimeType":"image/jpeg",
19+
"name":"i98rzu.jpg",
20+
"typeid":37,
21+
"uuid":"6AB29C1B-D9BB-40AB-92B9-E0B682D51A2B"
2222
},
2323
{
24-
"encapsulation":0,
25-
"mimeType":"text/css",
26-
"name":"manifest.json",
27-
"typeid":37,
28-
"uuid":"81506222-6584-4F7B-83E3-7E216091DBB0"
24+
"encapsulation":0,
25+
"mimeType":"text/css",
26+
"name":"manifest.json",
27+
"typeid":37,
28+
"uuid":"81506222-6584-4F7B-83E3-7E216091DBB0"
2929
},
3030
{
31-
"encapsulation":0,
32-
"mimeType":"image/png",
33-
"name":"Servoy.png",
34-
"typeid":37,
35-
"uuid":"C29D9675-ED97-4D2C-B139-07A92068362B"
31+
"encapsulation":0,
32+
"mimeType":"image/png",
33+
"name":"Servoy.png",
34+
"typeid":37,
35+
"uuid":"C29D9675-ED97-4D2C-B139-07A92068362B"
3636
},
3737
{
38-
"encapsulation":0,
39-
"mimeType":"text/css",
40-
"name":"servoyExtraComponentExample.less",
41-
"typeid":37,
42-
"uuid":"75C9F3BA-1704-43BC-B966-ABFB4CAFA243"
38+
"encapsulation":0,
39+
"mimeType":"text/css",
40+
"name":"servoyExtraComponentExample.less",
41+
"typeid":37,
42+
"uuid":"75C9F3BA-1704-43BC-B966-ABFB4CAFA243"
4343
},
4444
{
45-
"encapsulation":0,
46-
"mimeType":"image/jpeg",
47-
"name":"SP241Z.jpg",
48-
"typeid":37,
49-
"uuid":"B4C5E9B5-D750-482F-AA33-EE336920EDCC"
45+
"encapsulation":0,
46+
"mimeType":"image/jpeg",
47+
"name":"SP241Z.jpg",
48+
"typeid":37,
49+
"uuid":"B4C5E9B5-D750-482F-AA33-EE336920EDCC"
5050
},
5151
{
52-
"encapsulation":0,
53-
"mimeType":"image/png",
54-
"name":"user.png",
55-
"typeid":37,
56-
"uuid":"E209DF72-943C-443D-8C10-8887E36BFEA7"
52+
"encapsulation":0,
53+
"mimeType":"image/png",
54+
"name":"user.png",
55+
"typeid":37,
56+
"uuid":"E209DF72-943C-443D-8C10-8887E36BFEA7"
5757
},
5858
{
59-
"encapsulation":0,
60-
"mimeType":"text/css",
61-
"name":"variants.json",
62-
"typeid":37,
63-
"uuid":"4E90AEA4-D1B2-4D88-A9AF-5B54744CB55D"
59+
"encapsulation":0,
60+
"mimeType":"text/css",
61+
"name":"variants.json",
62+
"typeid":37,
63+
"uuid":"4E90AEA4-D1B2-4D88-A9AF-5B54744CB55D"
6464
},
6565
{
66-
"encapsulation":0,
67-
"mimeType":"text/css",
68-
"name":"webapp144.png",
69-
"typeid":37,
70-
"uuid":"B4ACBBE0-5FF6-4F22-9F8A-11A93B6AB1AD"
66+
"encapsulation":0,
67+
"mimeType":"image/jpeg",
68+
"name":"wallpaperPortrait.jpg",
69+
"typeid":37,
70+
"uuid":"CF56545E-FA88-49B3-BC83-C0752B3BE6EB"
71+
},
72+
{
73+
"encapsulation":0,
74+
"mimeType":"text/css",
75+
"name":"webapp144.png",
76+
"typeid":37,
77+
"uuid":"B4ACBBE0-5FF6-4F22-9F8A-11A93B6AB1AD"
7178
}
7279
]
38.3 KB
Loading

0 commit comments

Comments
 (0)