integrated with nanogallery
parent
0ad1937951
commit
e806c20462
@ -1,4 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.1.0
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.2.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
@ -0,0 +1,92 @@
|
||||
package org.gcube.portlets.user.geoportaldataviewer.client.ui.gallery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
|
||||
|
||||
import com.google.gwt.core.client.JavaScriptObject;
|
||||
import com.google.gwt.json.client.JSONArray;
|
||||
import com.google.gwt.json.client.JSONObject;
|
||||
import com.google.gwt.json.client.JSONString;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
|
||||
public class ImagesGallery {
|
||||
|
||||
HTMLPanel galleryPanel = new HTMLPanel("<div id='nanogallery'></div>");
|
||||
private List<UploadedImageDV> listImages;
|
||||
|
||||
private native void showGallery(JavaScriptObject json_array_images) /*-{
|
||||
|
||||
console.log("showing: " + json_array_images)
|
||||
var waitForJQuery = setInterval(
|
||||
function() {
|
||||
if (typeof $wnd.$ != 'undefined') {
|
||||
|
||||
$wnd
|
||||
.$("#nanogallery")
|
||||
.nanogallery2(
|
||||
{
|
||||
|
||||
thumbnailHeight : '200',
|
||||
thumbnailWidth : 'auto',
|
||||
thumbnailAlignment : 'fillWidth',
|
||||
|
||||
thumbnailDisplayTransition : 'slideDown',
|
||||
thumbnailDisplayTransitionDuration : 500,
|
||||
thumbnailDisplayInterval : 30,
|
||||
|
||||
// THUMBNAIL'S HOVER ANIMATION
|
||||
thumbnailHoverEffect2 : 'imageScaleIn80',
|
||||
touchAnimation : true,
|
||||
touchAutoOpenDelay : 800,
|
||||
viewerToolbar : {
|
||||
display : true,
|
||||
standard : 'minimizeButton, label',
|
||||
minimized : 'minimizeButton, label, fullscreenButton, downloadButton'
|
||||
},
|
||||
viewerTools : {
|
||||
topLeft : 'pageCounter',
|
||||
topRight : 'playPauseButton, zoomButton, fullscreenButton, downloadButton, closeButton'
|
||||
},
|
||||
|
||||
// DEEP LINKING
|
||||
locationHash : false,
|
||||
items : json_array_images
|
||||
})
|
||||
|
||||
clearInterval(waitForJQuery);
|
||||
}
|
||||
}, 200);
|
||||
|
||||
}-*/;
|
||||
|
||||
public ImagesGallery(List<UploadedImageDV> immagini) {
|
||||
|
||||
this.listImages = immagini;
|
||||
}
|
||||
|
||||
public HTMLPanel getGalleryPanel() {
|
||||
return galleryPanel;
|
||||
}
|
||||
|
||||
public void fillGallery() {
|
||||
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
int index = 0;
|
||||
for (UploadedImageDV image : listImages) {
|
||||
for (WorkspaceContentDV imageContent : image.getListWsContent()) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("src", new JSONString(imageContent.getLink()));
|
||||
json.put("srct", new JSONString(imageContent.getLink()));
|
||||
json.put("title", new JSONString(image.getDidascalia()));
|
||||
//json.put("description", new JSONString(image.getDidascalia()));
|
||||
json.put("downloadURL", new JSONString(imageContent.getLink()));
|
||||
jsonArray.set(index, json);
|
||||
index++;
|
||||
}
|
||||
|
||||
}
|
||||
showGallery(jsonArray.getJavaScriptObject());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue