PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.37
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.37
3.37 3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 All 142 releases
photonic / include / js / front-end / src / Lightboxes / Fancybox4.js

Fancybox4.js in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.37, at include/js/front-end/src/Lightboxes/Fancybox4.js

64 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {Lightbox} from "./Lightbox";
2 import * as Util from "../Util";
3
4 export class PhotonicFancybox4 extends Lightbox {
5 constructor() {
6 super();
7 }
8
9 soloImages() {
10 const solos = super.soloImages();
11 let idIndex = 1;
12 solos.forEach(solo => {
13 if (solo.getAttribute('id') == null) {
14 solo.setAttribute('id', 'photonic-fancybox4-' + idIndex);
15 idIndex++;
16 }
17 if (solo.getAttribute('data-fancybox') == null) {
18 solo.setAttribute('data-fancybox', 'photonic-solo-gallery');
19 }
20 });
21 };
22
23 hostedVideo(a) {
24 const html5 = a.getAttribute('href').match(new RegExp(/(\.mp4|\.webm|\.ogg)/i)),
25 css = a.classList.contains('photonic-lb');
26
27 if (html5 !== null && !css) {
28 a.classList.add(Photonic_JS.lightbox_library + "-html5-video");
29 this.videoIndex++;
30 }
31 };
32
33 initialize(selector, group) {
34 this.handleSolos();
35 const self = this;
36
37 let selection;
38 if (selector == null) {
39 selection = document.querySelectorAll('.photonic-level-1-container');
40 }
41 else if (selector instanceof NodeList) {
42 selection = selector;
43 }
44 else if (selector instanceof Element) {
45 selection = [selector];
46 }
47 else {
48 selection = document.querySelectorAll(selector);
49 }
50
51 selection.forEach((current) => {
52 const galleryId = current.getAttribute('id');
53 Fancybox.bind('#' + galleryId + ' a.photonic-lb', {
54 groupAll: true,
55 });
56 });
57 };
58
59 initializeForNewContainer(containerId) {
60 this.initialize(containerId);
61 };
62
63 }
64