-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgallery.js
More file actions
41 lines (34 loc) · 1.03 KB
/
gallery.js
File metadata and controls
41 lines (34 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
///
// PhotoViewer launcher for EZ Gallery by netfriend - https://netfriend.neocities.org/ez-gallery/
// Released under the Unlicense - https://unlicense.org/
// Requires PhotoViewer - https://nzbin.github.io/photoviewer/
///
///
// CODE
///
// Don't edit below this line unless you know what you're doing!
///
(function () {
const defaultOptions = {
draggable: false,
resizable: false,
initMaximized: true,
headerToolbar: ['close'],
footerToolbar: ['prev', 'zoomOut', 'actualSize', 'zoomIn', 'next'],
title: false,
multiInstances: true,
};
const galleries = document.getElementsByClassName("ezgallery");
for (let i = 0; i < galleries.length; i++) {
let links = [...galleries[i].getElementsByTagName("a")];
for (let j = 0; j < links.length; j++) {
let items = [];
let itemOptions = {...defaultOptions, index: j};
links.map((link) => items.push({src: link.href}));
links[j].addEventListener('click', (event) => {
event.preventDefault();
new PhotoViewer(items, itemOptions);
}, false);
}
}
}());