jQuery(document).ready(function($)
{
$.getJSON("data.json", function(data)
{
window.pageSize = 14;
var paintingList = [];
canDisplay = true;
for (i of data)
{
if (i.expo == "yes")
{
paintingList.push(i.number);
if (paintingList.length % (pageSize + 1) == 0)
canDisplay = false;
paintingHtml = '
';
$(".gallery").append(paintingHtml);
}
}
var targetPage = 0;
urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('page') != "")
targetPage = urlParams.get('page');
// pagination configuration
window.currentPage = 0;
window.previousArray = [];
$.getScript("scripts/pagination.js", function() {
paginationInit(data, paintingList, false);
if (targetPage > 0)
$("#pagination").pagination('go', targetPage);
});
// fancybox configuration
$.getScript("scripts/fancybox.js", function() {
fancyboxInit(data, false);
});
});
});