Draft Forbes Group Website (Build by Nikola). The official site is hosted at:
License: GPL3
ubuntu2004
function renderGallery(jsonContent, thumbnailSize) {1var container = document.getElementById("gallery_container");2container.innerHTML = '';3var layoutGeometry = require('justified-layout')(jsonContent, {4"containerWidth": container.offsetWidth,5"targetRowHeight": thumbnailSize * 0.6,6"boxSpacing": 5});7container.style.height = layoutGeometry.containerHeight + 'px';8var boxes = layoutGeometry.boxes;9for (var i = 0; i < boxes.length; i++) {10var img = document.createElement("img");11img.setAttribute('src', jsonContent[i].url_thumb);12img.setAttribute('alt', jsonContent[i].title);13img.style.width = boxes[i].width + 'px';14img.style.height = boxes[i].height + 'px';15link = document.createElement("a");16link.setAttribute('href', jsonContent[i].url);17link.setAttribute('class', 'image-reference');18div = document.createElement("div");19div.setAttribute('class', 'image-block');20div.setAttribute('title', jsonContent[i].title);21div.setAttribute('data-toggle', "tooltip")22div.style.width = boxes[i].width + 'px';23div.style.height = boxes[i].height + 'px';24div.style.top = boxes[i].top + 'px';25div.style.left = boxes[i].left + 'px';26link.appendChild(img);27div.appendChild(link);28container.appendChild(div);29}30}31323334