PageSourceSearch

https://pdasp.net/wp-content/themes/isi-modern23/js/gallery.js?ver=1.1790574253

js pdasp.net collected 2026-09-28 06:53:30 UTC 2,882 bytes, 97 lines download raw bytes

1var jqa = jQuery.noConflict();
2jqa(document).ready(function($)
3{
4
5const photos = document.querySelectorAll("#gallery .photo");
6const zoomBtn = document.querySelectorAll(".zoom-in");
7const downloadBtn = document.querySelectorAll("download");
8const modalImg = document.querySelector("#img");
9const next = document.querySelector("#modal .next");
10const prev = document.querySelector("#modal .prev");
11const close = document.querySelector(".close");
12const modal = document.querySelector("#modal");
13let currentImage = 0;
14
15photos.forEach((photo, index) => {
16  $(photo).children('img').on('click', function() {
17    currentImage = index;
18    showImage(this.parentElement);
19  }); 
20});
21
22function showImage( photo ) {
23  if ($(photo).hasClass("landscape")) {
24    var path = photo.querySelector("img").src.replace(/-\d{1,4}x\d{1,4}\.jpg$/i, '-1024x683.jpg');
25  } else {
26    var path = photo.querySelector("img").src.replace(/-\d{1,4}x\d{1,4}\.jpg$/i, '-683x1024.jpg');
27  }
28  modal.style.display = "block";
29  document.querySelector("#img").src = path; 
30  path = photo.querySelector("img").src.replace(/-\d{1,4}x\d{1,4}\.jpg$/i, '.jpg');
31  document.querySelector("#download-modal").href = path.replace(/https:\/\/www\.isi\.edu/,"");
32}
33
34zoomBtn.forEach((photo, index) => {
35  photo.addEventListener("click", function () {
36    currentImage = index;
37    showImage(this.parentElement.parentElement);
38  }); 
39});
40
41if ( prev != null ) {
42  prev.addEventListener("click", function () {
43    currentImage--;
44    if (currentImage < 0) {
45      currentImage = photos.length - 1;
46    }
47    if ($(photos[currentImage]).hasClass("landscape")) {
48      var path = photos[currentImage].querySelector("img").src.replace(/-\d{1,4}x\d{1,4}\.jpg$/i, '-1024x683.jpg');
49    } else {
50      var path = photos[currentImage].querySelector("img").src.replace(/-\d{1,4}x\d{1,4}\.jpg$/i, '-683x1024.jpg');
51    }
52    modalImg.src = path;
53  });
54}
55
56if ( next != null ) {
57  next.addEventListener("click", function () {
58    currentImage++;
59    if (currentImage >= photos.length) {
60      currentImage = 0;
61    }
62    if ($(photos[currentImage]).hasClass("landscape")) {
63      var path = photos[currentImage].querySelector("img").src.replace(/-\d{1,4}x\d{1,4}\.jpg$/i, '-1024x683.jpg');
64    } else {
65      var path = photos[currentImage].querySelector("img").src.replace(/-\d{1,4}x\d{1,4}\.jpg$/i, '-683x1024.jpg');
66    }
67    modalImg.src = path;
68  });
69}
70
71if ( close != null ) {
72  close.addEventListener("click", function () {
73    modal.style.display = "none";
74  });
75}
76
77if ( modal != null ) {
78  modal.addEventListener("click", function (e) {
79    if (e.target === modal) {
80      modal.style.display = "none";
81    }
82  });
83}
84
85document.addEventListener("keydown", function (e) {
86  if (e.key === "ArrowLeft") {
87    prev.click();
88  }
89  if (e.key === "ArrowRight") {
90    next.click();
91  }
92  if (e.key === "Escape") {
93    close.click();
94  }
95});
96
97});

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.