PageSourceSearch

https://jacobsfoundation.org/wp-content/themes/Jacobs-Theme/assets/js/publications-image.js?ver=1.0.17

js jacobsfoundation.org collected 2026-10-01 10:27:41 UTC 868 bytes, 24 lines download raw bytes

1/**
2 * Tag publication cover images as landscape so the grid can style them
3 * differently. The publications grid is built for portrait covers (capped at
4 * a portrait size); landscape covers would otherwise shrink to a sliver.
5 */
6(function () {
7  function markOrientation(img) {
8    if (!img.naturalWidth || !img.naturalHeight) return;
9    var wrap = img.closest('.image') || img.parentElement;
10    if (!wrap) return;
11    wrap.classList.toggle('is-landscape', img.naturalWidth > img.naturalHeight);
12  }
13
14  document.addEventListener('DOMContentLoaded', function () {
15    var imgs = document.querySelectorAll('.publications_card_list_grid_view .image img');
16    imgs.forEach(function (img) {
17      if (img.complete) {
18        markOrientation(img);
19      } else {
20        img.addEventListener('load', function () { markOrientation(img); });
21      }
22    });
23  });
24})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.