Landform Photo Galleries

Photo Gallery

'); if (end > results_length) { end = results_length; } for (var i = start; i 30) { asset_title = asset_title.substring(0, 30) + "..."; } $tile.find('a.PhotoGallery__TitleLink').text(asset_title); if (asset.Description.length > 2) { $tile.find('p.PhotoGallery__Description').html(asset_description); } $target.append($tile); $tile.find('div.PhotoGallery__Count').html('' + asset_count + ' Images'); delete asset; } } } else { $('#PhotoGallery-Container' + controlID).html( 'The photo gallery you have chosen does not exist.'); } function draw_paging(current_page) { var pages = Math.ceil(results_length / max_display); var current = parseInt(current_page); paging_target = $('#paginationWrapper' + controlID + ' .pagination-old'); paging_html = ''; paging_target.empty(); if (pages > 1) { if (current == 1) { paging_html += 'Prev'; } else { paging_html += ''; } paging_html += '
    '; for (i = 1; i ' + i + ''; } else { paging_html += '
  • ' + i + '
  • '; } } paging_html += '
'; if (current == pages) { paging_html += 'Next'; } else { paging_html += ''; } paging_target.append(paging_html); } $('a.paging, a.prev, a.next').on('click', function (event) { event.preventDefault(); var page_num = $(this).text(); draw_paging(page_num); display_galleries(page_num); $('body').scrollTop(0); }); } }).error(function (jqXHR, exception) { var msg = ''; if (jqXHR.status === 0) { msg = 'Not connect.\n Verify Network.'; } else if (jqXHR.status == 404) { msg = 'Requested page not found. [404]'; } else if (jqXHR.status == 500) { msg = 'Internal Server Error [500].'; } else if (exception === 'parsererror') { msg = 'Requested JSON parse failed.'; } else if (exception === 'timeout') { msg = 'Time out error.'; } else if (exception === 'abort') { msg = 'Ajax request aborted.'; } else { msg = 'Uncaught Error.\n' + jqXHR.responseText; } }); }); })(jQuery);