|
| 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 | + |
1 | 85 | /** |
2 | 86 | * @param {JSEvent} event |
3 | 87 | * @param {String} imageId |
|
7 | 91 | function onHoverButtonClicked(event, imageId) { |
8 | 92 | elements.label_1.text = 'Hover button clicked! '; |
9 | 93 | } |
| 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 | + |
0 commit comments