PageSourceSearch

https://beauforthousingnc.com/Portals/_default/Skins/obvio/resourc…/minilightbox/minilightbox.min.js?cdv=2058

js beauforthousingnc.com collected 2026-10-04 13:29:54 UTC 8,871 bytes, 205 lines download raw bytes

1function miniLightbox(e) {
2    e = $(e);
3
4    const type = e.data("ilightbox") ? e.data("ilightbox") : "image",
5        url = e.attr("href"),
6        title = e.attr("title") || e.data("title");
7
8    let holder = $(".minilightbox-holder"),
9        pr = window.innerWidth - $(window).width(),
10        groupImg = false,
11        currImg = false,
12        AnimeEnd = true,
13        startX = 0,
14        drop = 0,
15        isdown = false;
16
17    if (e.find("img").hasClass("elm-active")) return false;
18
19    if (!holder.length) {
20        $('body').append('<div class="minilightbox-holder" role="dialog" aria-modal="true"><span tabindex="0" class="focus-before"></span><div class="minilightbox-mask"></div><div class="minilightbox-content"></div><button class="minilightbox-prev" type="button" aria-label="'+GlobalAriaLabel["Previous"]+'"><span></span></button><button class="minilightbox-next" type="button" aria-label="'+GlobalAriaLabel["Next"]+'"><span></span></button><button type="button" class="minilightbox-close" aria-label="'+GlobalAriaLabel["Close"]+'"></button><span tabindex="0" class="focus-after"></span></div>');
21        holder = $(".minilightbox-holder");
22        one = true;
23    } 
24
25    $('.minilightbox-prev,.minilightbox-next').hide().addClass("disabled");
26
27    let lightbox = $('.minilightbox-holder'),
28        content = lightbox.find('.minilightbox-content');
29    
30    function lightContBox(type, url, title) {
31        var html = "";
32        switch (type) {
33            case "image":
34                html = '<div class="box lightbox-image"><img src="' + url + '" alt="' + (title ? title : "") + '">' + (title ? '<div class="minilight-title">' + title + '</div>' : '') + '</div>';
35                content.addClass("loading");
36                break;
37            case "youtube":
38                html = '<div class="box lightbox-youtube"><div class="box-responsive"><iframe src="' + url + '" frameborder="0" hspace="0" vspace="0" scrolling="scroll" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe></div>' + (title ? '<div class="minilight-title">' + title + '</div>' : '') + '</div>';
39                break;
40            case "vimeo":
41                html = '<div class="box lightbox-vimeo"><div class="box-responsive"><iframe src="' + url + '" frameborder="0" hspace="0" vspace="0" scrolling="scroll" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe></div>' + (title ? '<div class="minilight-title">' + title + '</div>' : '') + '</div>';
42                break;
43            case "html5":
44                html = '<div class="box lightbox-html5"><div class="box-responsive"><video preload="metadata" controls="controls" src="' + url + '">';
45                html += '<source src="' + url + '" type="video/mp4">';
46                html += '</video></div>' + (title ? '<div class="minilight-title">' + title + '</div>' : '') + '</div>';
47                break;
48            case "content":
49                html ='<div class="box lightbox-htmlcont d-wrapper"></div>';  
50            break;   
51            case "map":
52                html = '<div class="box lightbox-map"><div class="box-responsive"><iframe src="' + url + '" frameborder="0" hspace="0" vspace="0" scrolling="scroll" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe></div>' + (title ? '<div class="minilight-title">' + title + '</div>' : '') + '</div>';
53                break;
54        }
55        return html;
56    }
57
58    function hideNextPrev() {
59        lightbox.find(".minilightbox-prev,.minilightbox-next").show();
60        lightbox.find(".minilightbox-prev,.minilightbox-next").removeClass("disabled");
61        if (currImg == 0) {
62            lightbox.find(".minilightbox-prev").addClass("disabled");
63        } else if (currImg == groupImg.length - 1) {
64            lightbox.find(".minilightbox-next").addClass("disabled");
65        }
66
67    }
68
69    if (e.attr("data-group") && $('.is-lightbox[data-group="' + e.attr("data-group") + '"]').length > 1) {
70        groupImg = $('.is-lightbox[data-group="' + e.attr("data-group") + '"]');
71        currImg = groupImg.index(e);
72        hideNextPrev();
73    }
74
75    if(!content.html()){
76        content.html(lightContBox(type, url, title));
77    };
78    if(type =="content"){content.find(".lightbox-htmlcont").append($(url).show()).after('<div id=""></div>');}
79    $("html").css({
80        "overflow": "hidden",
81        "padding-right": pr
82    });
83
84    content.find("img,iframe").on("load", function () {
85        content.removeClass("loading");
86    })
87
88    lightbox.fadeIn(function(){
89        lightbox.find("button:not(.disabled),a:not(.disabled)").eq(0).trigger("focus");
90    }).addClass("active");
91
92
93    function closeLightbox(){
94        if(Math.abs(drop) < 50){
95            lightbox.fadeOut(function () {
96                lightbox.removeClass("active");
97                if(type =="content"){$("body").append($(url).hide())};
98                content.html("");
99                e.trigger("focus");
100            });
101            $("html").css({
102                "overflow": "",
103                "padding-right": ''
104            });
105        }
106    }
107
108    if (e.data("autoplay") && type == "html5") {
109        content.find("video")[0].play();
110    }
111    lightbox.find(".minilightbox-prev,.minilightbox-next").off().on("click", function () {
112        if ($(this).hasClass("disabled") || !AnimeEnd) return;
113        if (groupImg) {
114            AnimeEnd = false;
115
116            content.find("video").length && groupImg.eq(currImg).data("currentTime", content.find("video")[0].currentTime);
117
118            $(this).hasClass("minilightbox-next") ? currImg++ : currImg--;
119
120            let img = groupImg.eq(currImg);
121
122            hideNextPrev();
123            content.removeClass("loading");
124
125            const url2 = img.attr("href"),
126                title2 = img.attr("title") || img.data("title"),
127                type2 = img.data("ilightbox") ? img.data("ilightbox") : "image";
128
129            const clonebox = $('<div class="minilightbox-content"></div>').html(lightContBox(type2, url2, title2));
130
131            $(this).hasClass("minilightbox-prev") ? content.addClass("next-cont").after(clonebox.addClass("prev-cont")) : content.addClass("prev-cont").before(clonebox.addClass("next-cont"));
132
133            setTimeout(function () {
134                clonebox.removeClass("slder-cont prev-cont next-cont");
135            }, 16);
136            setTimeout(function () {
137                content.remove();
138                content = clonebox;
139                AnimeEnd = true;
140                if (img.data("autoplay") && type2 == "html5") {
141                    if (groupImg.eq(currImg).data("currentTime")) {
142                        content.find("video")[0].currentTime = groupImg.eq(currImg).data("currentTime");
143                    }
144                    content.find("video")[0].play();
145                }
146            }, 500)
147
148        }
149    })
150
151
152 
153    lightbox.off().on("keydown",function(event){
154        if((event.key && event.key =="Escape") || ( event.keyCode && event.keyCode==27)){   
155            closeLightbox();
156        } 
157    });
158
159    lightbox.find(".focus-before").off().on("focus",function(){
160        lightbox.find("button:not(.disabled),a:not(.disabled)").eq(lightbox.find("button:not(.disabled),a:not(.disabled)").length-1).trigger("focus"); 
161    })
162    lightbox.find(".focus-after").off().on("focus",function(){
163        lightbox.find("button:not(.disabled),a:not(.disabled)").eq(0).trigger("focus"); 
164    })
165
166    lightbox.off().on("touchstart mousedown",function(event){ 
167        events = event.type == "mousedown" ? event : event.touches[0];
168        isdown = true;
169        startX = events.clientX;  
170        drop = 0;
171    }).on("touchend mouseup mouseleave",function(event){
172        if (isdown && drop) {
173            event.preventDefault();
174            events = event.type != "touchend" ? event : event.changedTouches[0];
175            isdown = false;
176            if(drop >= 50){
177                lightbox.find(".minilightbox-prev").trigger("click");
178            }else if(drop <= -50){
179                lightbox.find(".minilightbox-next").trigger("click");
180            };
181        }
182    }).on("touchmove mousemove",function(event){
183        if (isdown) {
184            event.preventDefault();
185            events = event.type != "touchmove" ? event : event.touches[0];
186            drop = events.clientX - startX;
187        }
188    });
189 
190    $(".minilightbox-close,.minilightbox-mask").off().on("click", closeLightbox);
191
192}
193
194$(function(){
195    $('.is-lightbox').on("click", function (event) {
196        event.preventDefault();
197        if (typeof DNNapplyTypography == "undefined") {
198            miniLightbox(this);
199        }
200    });
201
202})
203 
204
205

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.