Videography Portfolio

Please see each section to view Vin Mistrys Portfolio covering a wide range of events:

Wedding/Engagement Trailers

" + "
" + "
" + "
" + "" + "" + "" + "
" + "
" + "" + "
" + "
" ); inst.options.positionFixed = inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; inst.$lightbox.css({ position: inst.options.positionFixed ? "fixed" : "absolute" }); inst.$lightbox.appendTo("body"); inst.$lightboxBox = $("#tsvg-fancy-html5-lightbox-box", inst.$lightbox); inst.$elem = $("#tsvg-fancy-html5-elem-box", inst.$lightbox); inst.$elemWrap = $("#tsvg-fancy-html5-elem-wrap", inst.$lightbox); inst.$loading = $("#tsvg-fancy-html5-loading", inst.$lightbox); inst.$error = $("#tsvg-fancy-html5-error", inst.$lightbox); inst.$image = $("#tsvg-fancy-html5-image", inst.$lightbox); var elemText = ""; if (inst.options.titlestyle == "left") { inst.$elem.prepend(elemText); } else { inst.$elem.append(elemText); } inst.$elemData = $("#tsvg-fancy-html5-elem-data-box", inst.$lightbox); inst.$text = $("#tsvg-fancy-html5-text", inst.$lightbox); if (inst.options.borderradius > 0) { inst.$elem.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); if (inst.options.titlestyle == "inside") { inst.$elemWrap.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); } else if (inst.options.titlestyle == "bottom") { inst.$elemWrap.css( { "border-top-left-radius": inst.options.borderradius + "px", "-moz-top-left-border-radius": inst.options.borderradius + "px", "-webkit-top-left-border-radius": inst.options.borderradius + "px", "border-top-right-radius": inst.options.borderradius + "px", "-moz-top-right-border-radius": inst.options.borderradius + "px", "-webkit-top-right-border-radius": inst.options.borderradius + "px", } ); inst.$elemData.css( { "border-bottom-left-radius": inst.options.borderradius + "px", "-moz-top-bottom-border-radius": inst.options.borderradius + "px", "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", "border-bottom-right-radius": inst.options.borderradius + "px", "-moz-bottom-right-border-radius": inst.options.borderradius + "px", "-webkit-bottom-right-border-radius": inst.options.borderradius + "px", } ); } } if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { inst.$lightboxBox.css({ "background-color": inst.options.bgcolor }); if (inst.options.titlestyle == "right") { inst.$elemWrap.css({ position: "relative", float: "left" }); inst.$elemData.css({ position: "relative", overflow: "hidden", padding: inst.options.bordersize + "px" }); } else { inst.$elemWrap.css({ position: "relative", overflow: "hidden" }); inst.$elemData.css({ position: "relative", float: "left", padding: inst.options.bordersize + "px" }); } } else if (inst.options.titlestyle == "inside") { inst.$elemData.css({ position: "absolute", margin: inst.options.bordersize + "px", bottom: 0, left: 0, "background-color": "#333", "background-color": "rgba(51, 51, 51, 0.6)" }); inst.$text.css({ padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" }); } else { inst.$elemData.css( { position: "relative", width: "100%", height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", padding: "0 0 " + inst.options.bordersize + "px" + " 0", "background-color": inst.options.bgcolor, "text-align": "left", } ); inst.$text.css({ margin: "0 " + inst.options.bordersize + "px" }); } if (inst.options.fullscreenmode) { inst.$lightbox.append( "
" + "
" ); inst.$next = $(".tsvg-fancy-html5-next-fullscreen", inst.$lightbox); inst.$prev = $(".tsvg-fancy-html5-prev-fullscreen", inst.$lightbox); inst.$lightboxBox.append( "
" + "
" ); inst.$nextbottom = $(".tsvg-fancy-html5-next-bottom-fullscreen", inst.$lightbox); inst.$prevbottom = $(".tsvg-fancy-html5-prev-bottom-fullscreen", inst.$lightbox); inst.$nextbottom.click( function () { inst.nextArrowClicked(); } ); inst.$prevbottom.click( function () { inst.prevArrowClicked(); } ); inst.$lightbox.append( "
" ); inst.$close = $("#tsvg-fancy-html5-close-fullscreen", inst.$lightbox); } else { inst.$elemWrap.append( "" + "" ); inst.$next = $("#tsvg-fancy-html5-next", inst.$lightbox); inst.$prev = $("#tsvg-fancy-html5-prev", inst.$lightbox); if ((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) { inst.$lightboxBox.append( "
" + "
" ); inst.$nexttouch = $(".tsvg-fancy-html5-next-touch", inst.$lightbox); inst.$prevtouch = $(".tsvg-fancy-html5-prev-touch", inst.$lightbox); inst.$nexttouch.click( function () { inst.nextArrowClicked(); } ); inst.$prevtouch.click( function () { inst.prevArrowClicked(); } ); } inst.$lightboxBox.append( "" ); inst.$close = $("#tsvg-fancy-html5-close", inst.$lightbox); } if (inst.options.showsocial) { var socialCode = '"; inst.$lightboxBox.append(socialCode); $(".tsvg-fancy-html5-social-btn", inst.$lightbox).click( function () { var shareUrl = window.location.href + (0 > window.location.href.indexOf("?") ? "?" : "&") + "html5lightboxshare=" + encodeURIComponent(inst.currentElem[ELEM_HREF]); var shareTitle = inst.currentElem[ELEM_TITLE]; var shareMedia = inst.currentElem[ELEM_HREF]; if (inst.currentElem[ELEM_TYPE] == 0) { shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); } else if (inst.currentElem[ELEM_TYPE] == 3) { shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; } else { var lightboxLink = $('.tsvg-html5lightbox-452410[href="' + inst.currentElem[ELEM_HREF] + '"]'); if (lightboxLink.length > 0) if (lightboxLink.data("shareimage") && lightboxLink.data("shareimage").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); } else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); } else { var lightboxImg = $("img", lightboxLink); if (lightboxImg.length > 0) { shareMedia = inst.absoluteUrl(lightboxImg.attr("src")); } } } var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; if ($(this).hasClass("tsvg-fancy-html5-social-facebook")) { window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-twitter")) { window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-pinterest")) { window.open( "https://pinterest.com/pin/create/bookmarklet/?media=" + encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank" ); } return false; } ); } inst.$watermark = $("#tsvg-fancy-html5-watermark", inst.$lightbox); if (inst.options.stamp) { inst.$watermark.html(""); } else if (inst.options.watermark) { var html = ""; if (inst.options.watermarklink) { html = "" + html + ""; } inst.$watermark.html(html); } if (inst.options.closeonoverlay) { $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).click(inst.finish); } inst.$close.click(inst.finish); inst.$next.click( function () { inst.nextArrowClicked(); } ); inst.$prev.click( function () { inst.prevArrowClicked(); } ); $(window).resize( function () { clearTimeout(inst.options.resizeTimeout); inst.options.resizeTimeout = setTimeout( function () { inst.resizeWindow(); }, 500 ); } ); $(window).scroll( function () { inst.scrollBox(); } ); $(window).bind( "orientationchange", function (e) { if (inst.options.isMobile) { inst.resizeWindow(); } } ); if (inst.options.isIPhone) { inst.options.windowInnerHeight = window.innerHeight; setInterval( function () { if (inst.options.windowInnerHeight != window.innerHeight) { inst.options.windowInnerHeight = window.innerHeight; inst.resizeWindow(); } }, 500 ); } if (inst.options.enabletouchswipe) { inst.enableSwipe(); } }; inst.slideTimer = function (interval, callback, updatecallback) { let timerInstance = this, updateinterval = 50, updateTimerId = null, runningTime = 0, paused = false, started = false, startedandpaused = false; timerInstance.timeout = interval; this.pause = function () { if (started) { paused = true; clearInterval(updateTimerId); } }; this.resume = function (forceresume) { if (startedandpaused && !forceresume) { return; } startedandpaused = false; if (started && paused) { paused = false; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); } }; this.stop = function () { clearInterval(updateTimerId); if (updatecallback) { updatecallback(-1); } runningTime = 0; paused = false; started = false; }; this.start = function () { runningTime = 0; paused = false; started = true; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); }; this.startandpause = function () { runningTime = 0; paused = true; started = true; startedandpaused = true; }; return this; }; inst.updateTimer = function (percent) { var w = Math.round(percent * 100); if (w > 100) { w = 100; } if (0 > w ) { w = 0; } $("#tsvg-fancy-html5-timer", inst.$lightbox).css({ display: "block", width: w + "%" }); }; inst.initSlide = function () { inst.autosliding = false; inst.slideTimeout = inst.slideTimer( inst.options.slideinterval, function () { inst.gotoSlide(-1); }, inst.options.showtimer ? function (percent) { inst.updateTimer(percent); } : null ); if (inst.options.autoslide) { inst.slideTimeout.stop(); inst.autosliding = true; } }; inst.nextArrowClicked = function () { if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") { window[inst.options.onlastarrowclicked](); } } inst.gotoSlide(-1); }; inst.prevArrowClicked = function () { if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && typeof window[inst.options.onfirstarrowclicked] == "function") { window[inst.options.onfirstarrowclicked](); } } inst.gotoSlide(-2); }; inst.calcNextPrevElem = function () { inst.options.nextElem = -1; inst.options.prevElem = -1; inst.options.inGroup = false; inst.options.groupIndex = 0; inst.options.groupCount = 0; var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; for (var i = 0; inst.elemArray.length > i; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (i == inst.options.curElem) { inst.options.groupIndex = inst.options.groupCount; } inst.options.groupCount++; } } var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; if (curGroup != undefined && curGroup != null) { for (j = inst.options.curElem + 1;inst.elemArray.length > j; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } if (0 > inst.options.nextElem) { for (j = 0; inst.options.curElem > j ; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } } if (inst.options.nextElem >= 0) { for (j = inst.options.curElem - 1; j >= 0; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } if (0 > inst.options.prevElem ) { for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } } } } if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) { inst.options.inGroup = true; } }; inst.calcBoxPosition = function (initW, initH) { var boxW = initW + 2 * inst.options.bordersize; var boxH = initH + 2 * inst.options.bordersize; var winH = window.innerHeight ? window.innerHeight : $(window).height(); var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); if (inst.options.titlestyle == "bottom") { boxT -= Math.round(inst.options.barheight / 2); } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; if (topmargin > boxT) { boxT = topmargin; } if (inst.options.insideiframe && window.self != window.top) { if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; var parentscroll = parent.window.document.body.scrollTop; boxT = topmargin; boxT += parentscroll > iframetop ? parentscroll - iframetop : 0; } } return [boxW, boxH, boxT]; }; inst.hideNavArrows = function () { var showPrev = false; var showNext = false; if (inst.options.inGroup) { if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showPrev = true; } if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showNext = true; } } if (showPrev) { inst.$prev.removeClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$prev.addClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.addClass("tsvg-fancy-html5-hide"); } } if (showNext) { inst.$next.removeClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$next.addClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.addClass("tsvg-fancy-html5-hide"); } } }; inst.clickHandler = function (event) { var $this = $(this); var dataoptions = {}; if (jQuery(event.target).prop("tagName") == 'A') { let link = jQuery(event.target).attr('href'); if (jQuery(event.target).attr('target') == '_blank') { window.open(link); } else { window.location.assign(link) } return false; } $.each( $this.data(), function (key, value) { dataoptions[key.toLowerCase()] = value; } ); inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i ; i++) { if (inst.elemArray[i][ELEM_ID] == $this.data("tsvgid")) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; if (inst.options.iequirksmode) { inst.$lightboxBox.css({ top: boxT }); } else { inst.$lightboxBox.css({ "margin-top": boxT }); } if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.loadThumbnail = function (src, index) { let inst_img_elem = document.createElement('img'); inst_img_elem.src = src; inst_img_elem.addEventListener('load', function () { if (inst.options.thumbwidth / inst.options.thumbheight >= inst_img_elem.naturalWidth / inst_img_elem.naturalHeight ) { inst_img_elem.setAttribute("style","width:100%;") } else { inst_img_elem.setAttribute("style","height:100%;") } $(".tsvg-fancy-html5-nav-thumb").eq(index).html(inst_img_elem); }) inst_img_elem.addEventListener('error', function () { console.log('error') }) }; inst.matchGroup = function (curGroup, elemGroup) { if (!curGroup || !elemGroup) { return false; } var curs = curGroup.split(":"); var elems = elemGroup.split(":"); var result = false; for (var i in curs) { if ($.inArray(curs[i], elems) > -1) { result = true; break; } } return result; }; inst.showNavigation = function () { if (!inst.options.shownavigation) { return; } if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) { return; } var i; var showNav = false; var group = inst.currentElem[ELEM_GROUP]; for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { showNav = true; break; } } } if (!showNav) { return; } inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; if ($(".tsvg-fancy-html5-nav").length > 0) { return; } var check_bool = $('.tsvg-fancy-blocks-container').attr('data-tsvg-shn'); if (check_bool === 'false') { return } $("body").append( "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); if (TS_VG_FG_Show_Nav == "true") { var index = 0; } for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { $(".tsvg-fancy-html5-nav-list").append( "
'
" ); this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index) index++; } } } $(".tsvg-fancy-html5-nav-thumb").hover( function () { $(this).css({ opacity: 1 }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor }); }, function () { $(this).css({ opacity: inst.options.thumbopacity }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor }); } ); $(".tsvg-fancy-html5-nav-thumb").click( function () { var index = $(this).data("arrayindex"); if (index >= 0) { inst.gotoSlide(index); } } ); inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); $(".tsvg-fancy-html5-nav-list") .css({ display: "block", position: "relative", "margin-left": 0, width: inst.options.totalwidth + "px" }) .append("
"); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); $navPrev.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; if (marginLeft >= 0) { marginLeft = 0; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (maskWidth - inst.options.totalwidth >= marginLeft ) { $navNext.css({ "background-position": "center left" }); } else { $navNext.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); $navNext.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; if (maskWidth - inst.options.totalwidth >= marginLeft) { marginLeft = maskWidth - inst.options.totalwidth; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (marginLeft >= 0) { $navPrev.css({ "background-position": "center left" }); } else { $navPrev.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.loadElem = function (elem) { inst.currentElem = elem; inst.showing = true; inst.showNavigation(); inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); inst.$loading.show(); if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") { window[inst.options.onshowitem](elem); } switch (elem[ELEM_TYPE]) { case 0: var imgLoader = new Image(); $(imgLoader).load( function () { inst.showImage(elem, imgLoader.width, imgLoader.height); } ); $(imgLoader).error( function () { inst.showError(); } ); imgLoader.src = elem[ELEM_HREF]; break; case 1: inst.showSWF(elem); break; case 2: case 8: inst.showVideo(elem); break; case 3: case 4: case 9: case 11: inst.showYoutubeVimeo(elem); break; case 5: inst.showPDF(elem); break; case 6: inst.showMP3(elem); break; case 7: inst.showWeb(elem); break; case 10: inst.showDiv(elem); break; } if (inst.options.googleanalyticsaccount && window._gaq) { window._gaq.push(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]); } }; inst.loadCurElem = function () { inst.loadElem(inst.elemArray[inst.options.curElem]); }; inst.showError = function () { inst.$loading.hide(); inst.resizeLightbox( inst.options.errorwidth, inst.options.errorheight, true, function () { inst.$error.show(); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); } ); }; inst.calcTextWidth = function (objW) { return objW - 36; }; (inst.showTitle = function (w, t, description) { if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: w + "px" }); } var text = ""; if (inst.options.showtitle) { if (t && t.length > 0) { text += t; } } if (inst.options.inGroup) { if (inst.options.showtitleprefix) { text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", inst.options.groupCount) + " " + text; } jQuery("#tsvg-fancy-html5-elem-data-box").css("display", "none"); if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT != "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (TotalSoft_GV_FG_PD == "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "block"); } if (TotalSoft_GV_FG_PT == "true") { jQuery(".tsvg-fancy-popup-text").css("display", "inline-block"); } if (TotalSoft_GV_FG_PD != "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "none"); } if (TotalSoft_GV_FG_PT != "true") { jQuery(".tsvg-fancy-popup-text").css("display", "none"); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD != "true") { jQuery("#tsvg-fancy-html5-text").css("display", "none"); } } if (inst.options.showdescription && description && description.length > 0) { inst.$text.html(text); } if (inst.options.inGroup && inst.options.showplaybutton) { if (inst.autosliding) { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } else { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); } $("#tsvg-fancy-html5-play", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } ); $("#tsvg-fancy-html5-pause", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.autosliding = false; } } ); } $("#tsvg-fancy-html5-social", inst.$lightbox).show(); }); (inst.showImage = function (elem, imgW, imgH) { var elemW, elemH; if (elem[ELEM_WIDTH]) { elemW = elem[ELEM_WIDTH]; } else { elemW = imgW; elem[ELEM_WIDTH] = imgW; } if (elem[ELEM_HEIGHT]) { elemH = elem[ELEM_HEIGHT]; } else { elemH = imgH; elem[ELEM_HEIGHT] = imgH; } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, inst.options.imagekeepratio); inst.resizeLightbox( sizeObj.w, sizeObj.h, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : ""; inst.$image.show(); inst.$image.html( "
" + timercode + "
" ); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }); inst.showSWF = function (elem) { var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); inst.embedFlash($("#tsvg-html5lightbox-swf"), elem[ELEM_HREF], "window", { width: dataW, height: dataH }); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showVideo = function (elem) { inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var isHTML5 = false; if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || (inst.options.isIE9 && inst.options.useflashonie9) || (inst.options.isIE10 && inst.options.useflashonie10) || (inst.options.isIE11 && inst.options.useflashonie11)) { isHTML5 = false; } else if (inst.options.isMobile) { isHTML5 = true; } else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) { if ((!inst.options.isFirefox && !inst.options.isOpera) || ((inst.options.isFirefox || inst.options.isOpera) && (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM]))) { isHTML5 = true; } } if (isHTML5) { var videoSrc = elem[ELEM_HREF]; if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) { videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; } inst.embedHTML5Video($("#tsvg-html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo); } else { var videoFile = elem[ELEM_HREF]; if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") { videoFile = inst.options.htmlfolder + videoFile; } inst.embedFlash( $("#tsvg-html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { width: dataW, height: dataH, jsobjectname: "html5Lightbox", hidecontrols: inst.options.videohidecontrols ? "1" : "0", hideplaybutton: "0", videofile: videoFile, hdfile: "", ishd: "0", defaultvolume: inst.options.defaultvideovolume, autoplay: inst.options.autoplay ? "1" : "0", loop: inst.options.loopvideo ? "1" : "0", errorcss: ".html5box-error" + inst.options.errorcss, id: 0, } ); } inst.$elem.show(); inst.showData(); } ); }; inst.loadNext = function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } }; inst.getYoutubeParams = function (href) { var result = {}; if (0 > href.indexOf("?") ) { return result; } var params = href.substring(href.indexOf("?") + 1).split("&"); for (var i = 0;params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2 && value[0].toLowerCase() != "v") { result[value[0].toLowerCase()] = value[1]; } } return result; }; inst.getYoutubeId = function (href) { var youtubeId = ""; var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(shorts\/)|(watch\??v?=?))([^#\&\?]*).*/; var match = href.match(regExp); if (match && match[match.length -1].length == 11) { youtubeId = match[match.length -1]; } return youtubeId; }; inst.prepareYoutubeHref = function (href) { let youtubeId = inst.getYoutubeId(href), protocol = "https:", result = protocol + "//www.youtube.com/embed/" + youtubeId, params = this.getYoutubeParams(href), first = true; for (var key in params) { if (first) { result += "?"; first = false; } else { result += "&"; } result += key + "=" + params[key]; } return result; }; inst.prepareDailymotionHref = function (href) { if (href.match(/\:\/\/.*(dai\.ly)/i)) { var protocol = "https:"; var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; href = protocol + "" + id; } return href; }; inst.showYoutubeVimeo = function (elem) { var tsvg_autoplay = jQuery('.tsvg-main-content-' + id).attr('data-tsvg-autoplay'); inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var href = elem[ELEM_HREF]; var youtubeid = ""; if (elem[ELEM_TYPE] == 3) { youtubeid = inst.getYoutubeId(href); href = inst.prepareYoutubeHref(href); if (tsvg_autoplay == "true") { href += "?autoplay=1&mute=1" } else { href += "?autoplay=0&mute=0" } } if (elem[ELEM_TYPE] == 9) { href = inst.prepareDailymotionHref(href); } if (inst.options.autoplay) { if (elem[ELEM_TYPE] == 4) { if (href.indexOf('player.vimeo.com/video/') > -1) { if (tsvg_autoplay == "true") { href += "?autoplay=1&muted=1"; } } } } if (inst.options.loopvideo) { href += 0 > href.indexOf("?") ? "?" : "&"; switch (elem[ELEM_TYPE]) { case 3: href += "loop=1&playlist=" + youtubeid; break; case 4: case 9: href += "loop=1"; break; case 11: href += "endVideoBehavior=loop"; break; } } if (elem[ELEM_TYPE] == 3 && Totalsoft_FG_ShVAutoPl == "true") { if (0 > href.indexOf("?")) { href += "?wmode=transparent&rel=0&iv_load_policy=3"; } else { href += "&wmode=transparent&rel=0&iv_load_policy=3"; } if (inst.options.videohidecontrols) { href += "&controls=0&showinfo=0"; } href += "&mute=1&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname; } if (href.indexOf('.mp4') > -1) { let autoplay_bool = tsvg_autoplay == "true" ? "autoplay muted" : ""; $("#tsvg-html5lightbox-video").html(''); } else { $("#tsvg-html5lightbox-video").html(""); } inst.$elem.show(); inst.showData(); if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") { new YT.Player( "html5boxiframevideo", { events: { onStateChange: function (event) { if (event.data == YT.PlayerState.ENDED) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } }, }, } ); } else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { var vimeoIframe = $("#html5boxiframevideo")[0]; var vimeoPlayer = $f(vimeoIframe); vimeoPlayer.addEvent( "ready", function () { vimeoPlayer.addEvent( "finish", function (id) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); } ); } } ); }; inst.showPDF = function (elem) { }; inst.showMP3 = function (elem) { }; inst.showDiv = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var divID = elem[ELEM_HREF]; if ($(divID).length > 0) { $("#tsvg-html5lightbox-div").html($(divID).html()); } else { $("#tsvg-html5lightbox-div").html("
The specified div ID does not exist.
"); } inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showWeb = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); var tsvgRumbleCheck = elem[ELEM_HREF].indexOf('rumble.com/') > -1 ? 'sandbox="allow-scripts"' : ''; dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); $("#tsvg-html5lightbox-web").html(""); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.scrollBox = function () { }; inst.resizeWindow = function () { if (!inst.currentElem) { return; } if (!inst.options.responsive) { return; } var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); if (inst.options.responsivebarheight) { if (inst.options.smallscreenheight >= winH) { inst.options.barheight = inst.options.barheightonsmallheight; } else { inst.options.barheight = inst.options.barheightoriginal; } if (inst.options.titlestyle == "bottom" && inst.options.barautoheight != "auto") { inst.$elemData.css({ height: inst.options.barheight + "px", "max-height": inst.options.barheight + "px" }); } } var elemW, elemH, keepratio; if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; keepratio = false; } else { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; if (inst.currentElem[ELEM_TYPE] == 0) { keepratio = inst.options.imagekeepratio; } else { keepratio = true; } } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, keepratio); var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: sizeObj.w + "px" }); } if (0 >= $(".tsvg-fancy-html5-nav").length ) { return; } $(".tsvg-fancy-html5-nav-list").css({ "margin-left": 0 }); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.calcElemSize = function (sizeObj, keepratio) { if (!inst.options.responsive) { return sizeObj; } var winWidth = $(window).width(); winWidth = winWidth ? winWidth : $(document).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); winH = winH ? winH : $(document).height(); if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) { sizeObj.w = (sizeObj.w * 100) / inst.options.imagepercentage; } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; if (inst.options.titlestyle == "bottom") { h0 -= inst.options.barheight; } if (((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && inst.options.sidetobottomscreenwidth >= winWidth ) || (inst.options.notkeepratioonsmallheight && inst.options.smallscreenheight >= winH)) { keepratio = false; } if (sizeObj.h > h0) { if (keepratio) { sizeObj.w = Math.round((sizeObj.w * h0) / sizeObj.h); } sizeObj.h = h0; } var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; if ( (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth) || (((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) ) { w0 -= 64; } if (sizeObj.w > w0) { if (keepratio) { sizeObj.h = Math.round((sizeObj.h * w0) / sizeObj.w); } sizeObj.w = w0; } return sizeObj; }; inst.showData = function () { if (inst.$text.text().length > 0) { inst.$elemData.show(); } if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$lightboxBox.css({ height: "auto" }); } if (inst.$text.text().length > 0 && inst.options.titlestyle == "bottom") { inst.$elemData.css({ "max-height": inst.options.barheight + "px" }); } $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).css({ height: Math.max($(window).height(), $(document).height()) }); $(window).trigger("html5lightbox.lightboxopened"); }; inst.resizeLightbox = function (elemW, elemH, bAnimate, onFinish) { inst.hideNavArrows(); var boxPos = inst.calcBoxPosition(elemW, elemH); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$loading.hide(); inst.$watermark.hide(); if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastitem && window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") { window[inst.options.onlastitem](inst.currentElem); } } if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") { window[inst.options.onfirstitem](inst.currentElem); } } if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { inst.$elem.bind( "mouseenter mousemove", function () { if ((inst.options.arrowloop && inst.options.prevElem >= 0) || (!inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.curElem > inst.options.prevElem )) { inst.$prev.fadeIn(); } if ((inst.options.arrowloop && inst.options.nextElem >= 0) || (!inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem)) { inst.$next.fadeIn(); } } ); inst.$elem.bind( "mouseleave", function () { inst.$next.fadeOut(); inst.$prev.fadeOut(); } ); } inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) { speed = 0; } inst.$lightboxBox.animate({ width: boxW }, speed).animate( { height: boxH }, speed, function () { inst.onAnimateFinish(onFinish); } ); } else { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) { speed = 0; } inst.$lightboxBox.css({ width: boxW, height: "auto", "min-width": boxW - 15 }); inst.$elemWrap.animate({ width: boxW, "min-width": boxW - 15 }, speed).animate( { height: boxH, "min-height": boxH - 15 }, speed, function () { inst.onAnimateFinish(onFinish); } ); } }; inst.onAnimateFinish = function (onFinish) { inst.$loading.show(); inst.$watermark.show(); inst.$close.show(); inst.$elem.css({ "background-color": inst.options.bgcolor }); onFinish(); }; inst.reset = function () { if (inst.options.stamp) { inst.$watermark.hide(); } inst.showing = false; inst.$image.empty(); inst.$text.empty(); inst.$error.hide(); inst.$loading.hide(); inst.$image.hide(); if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$elemData.hide(); } if (!inst.options.fullscreenmode) { inst.$close.hide(); } inst.$elem.css({ "background-color": "" }); }; inst.resetNavigation = function () { inst.options.navheight = 0; $(".tsvg-fancy-html5-nav").remove(); }; inst.finish = function () { if ($("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).length) { $("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).attr("src", ""); } $("head") .find("style") .each( function () { if ($(this).data("creator") == "tsvg-fancy-html5box-html5-lightbox") { $(this).remove(); } } ); inst.slideTimeout.stop(); inst.reset(); inst.resetNavigation(); inst.$lightbox.remove(); $("#tsvg-fancy-html5box-html5-lightbox").remove(); inst.showObjects(); if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") { window[inst.options.oncloselightbox](inst.currentElem); } if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") { inst.onLightboxClosed(inst.currentElem); } }; inst.pauseSlide = function () { }; inst.playSlide = function () { }; inst.gotoSlide = function (slide) { if (slide == -1) { if (0 > inst.options.nextElem ) { return; } inst.options.curElem = inst.options.nextElem; } else if (slide == -2) { if (0 > inst.options.prevElem ) { return; } inst.options.curElem = inst.options.prevElem; } else if (slide >= 0) { inst.options.curElem = slide; } if (inst.autosliding) { inst.slideTimeout.stop(); } inst.calcNextPrevElem(); inst.reset(); inst.loadCurElem(); }; inst.enableSwipe = function () { inst.$elem.html5lightboxTouchSwipe452410( { preventWebBrowser: false, swipeLeft: function () { inst.gotoSlide(-1); }, swipeRight: function () { inst.gotoSlide(-2); }, } ); }; inst.hideObjects = function () { $("select, embed, object").css({ visibility: "hidden" }); }; inst.showObjects = function () { $("select, embed, object").css({ visibility: "visible" }); }; inst.embedHTML5Video = function ($container, src, autoplay, loopvideo) { let embedVideoPoster = (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : ""), embedVideoControls = (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : ""); $container.html( "
" ); if (!inst.options.nativehtml5controls) { $("video", $container).data("src", src); $("video", $container).lightboxHTML5VideoControls452410(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume); } $("video", $container) .unbind("ended") .bind( "ended", function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); }; inst.embedFlash = function ($container, src, wmode, flashVars) { if (inst.options.flashInstalled) { var htmlOptions = { pluginspage: "", quality: "high", allowFullScreen: "true", allowScriptAccess: "always", type: "application/x-shockwave-flash" }; htmlOptions.width = "100%"; htmlOptions.height = "100%"; htmlOptions.src = src; htmlOptions.flashVars = $.param(flashVars); htmlOptions.wmode = wmode; var htmlString = ""; for (var key in htmlOptions) { htmlString += key + "=" + htmlOptions[key] + " "; } $container.html(""); } else { $container.html( "
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
" ); } }; inst.checkType = function (href) { if (!href) { return -1; } if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) { return 0; } if (href.match(/[^\.]\.(swf)\s*$/i)) { return 1; } if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) { return 4; } if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) { return 3; } if (href.match(/\:\/\/.*(vimeo\.com)/i)) { return 4; } if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) { return 9; } if (href.match(/[^\.]\.(pdf)\s*$/i)) { return 5; } if (href.match(/[^\.]\.(mp3)\s*$/i)) { return 6; } if (href.match(/[^\.]\.(flv)\s*$/i)) { return 8; } if (href.match(/\#\w+/i)) { return 10; } if (href.match(/\:\/\/.*(wistia)/i)) { return 11; } return 7; }; inst.getURLParams = function () { var result = {}; var params = window.location.search.substring(1).split("&"); for (var i = 0; params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2) { result[value[0].toLowerCase()] = unescape(value[1]); } } return result; }; inst.absoluteUrl = function (href) { var link = document.createElement("a"); link.href = href; return link.protocol + "//" + link.host + link.pathname + link.search + link.hash; }; inst.showLightbox = function (type, href, title, width, height, webm, ogg, thumbnail, description) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)); }; inst.addItem = function (href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { type = mediatype && mediatype >= 0 ? mediatype : inst.checkType(href); inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)); }; inst.showItem = function (href) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i; i++) { if (inst.elemArray[i][ELEM_HREF] == href) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.unbind("click").click(inst.clickHandler); inst.each( function () { var self = $(this); if (self.data("autoopen")) { setTimeout( function () { self.click(); }, self.data("autoopendelay") ? self.data("autoopendelay") : 0 ); return false; } } ); var urlParams = inst.getURLParams(); if ("html5lightboxshare" in urlParams) { var shareUrl = decodeURIComponent(urlParams["html5lightboxshare"]); var shareLink = $('.tsvg-html5lightbox-452410[href="' + shareUrl + '"]'); if (shareLink.length > 0) { shareLink.click(); } } return inst; }; })(jQuery); (function ($) { $.fn.html5lightboxTouchSwipe452410 = function (options) { var defaults = { preventWebBrowser: false, swipeLeft: null, swipeRight: null, swipeTop: null, swipeBottom: null }; if (options) { $.extend(defaults, options); } return this.each( function () { var startX = -1, startY = -1; var curX = -1, curY = -1; function touchStart(event) { var e = event.originalEvent; if (e.targetTouches.length >= 1) { startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchMove(event) { if (defaults.preventWebBrowser) { event.preventDefault(); } var e = event.originalEvent; if (e.targetTouches.length >= 1) { curX = e.targetTouches[0].pageX; curY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchEnd(event) { if (curX > 0 || curY > 0) { triggerHandler(); touchCancel(event); } else { touchCancel(event); } } function touchCancel(event) { startX = -1; startY = -1; curX = -1; curY = -1; } function triggerHandler() { if (Math.abs(curX - startX) > Math.abs(curY - startY)) { if (curX > startX) { if (defaults.swipeRight) { defaults.swipeRight.call(); } } else { if (defaults.swipeLeft) { defaults.swipeLeft.call(); } } } else if (curY > startY) { if (defaults.swipeBottom) { defaults.swipeBottom.call(); } } else if (defaults.swipeTop) { defaults.swipeTop.call(); } } try { $(this).bind("touchstart", touchStart); $(this).bind("touchmove", touchMove); $(this).bind("touchend", touchEnd); $(this).bind("touchcancel", touchCancel); } catch (e) { } } ); }; })(jQuery); (function ($) { $.fn.lightboxHTML5VideoControls452410 = function (skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { var isTouch = "ontouchstart" in window; var eStart = isTouch ? "touchstart" : "mousedown"; var eMove = isTouch ? "touchmove" : "mousemove"; var eCancel = isTouch ? "touchcancel" : "mouseup"; var eClick = "click"; var BUTTON_SIZE = 32; var BAR_HEIGHT = isTouch ? 48 : 36; var hideControlsTimerId = null; var hideVolumeBarTimeoutId = null; var sliderDragging = false; var isFullscreen = false; var userActive = true; var isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; var isHd = $(this).data("ishd"); var hd = $(this).data("hd"); var src = $(this).data("src"); var $videoObj = $(this); $videoObj.get(0).removeAttribute("controls"); if (isIPhone) { var h = $videoObj.height() - BAR_HEIGHT; $videoObj.css({ height: h }); } var $videoPlay = $("
"); if (!isIPhone) { $videoObj.after($videoPlay); $videoPlay .css( { position: "absolute", top: "50%", left: "50%", display: "block", cursor: "pointer", width: 64, height: 64, "margin-left": -32, "margin-top": -32, "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", "background-position": "center center", "background-repeat": "no-repeat", } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); } var $videoFullscreenBg = $("
"); var $videoControls = $( "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); $videoObj.after($videoControls); $videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({ display: "none", position: "fixed", left: 0, top: 0, bottom: 0, right: 0, "z-index": 2147483647 }); $videoControls.css({ display: "block", position: "absolute", width: "100%", height: BAR_HEIGHT, left: 0, bottom: 0, right: 0, "max-width": "640px", margin: "0 auto" }); var userActivate = function () { userActive = true; }; $videoObj .bind( eClick, function () { userActive = true; } ) .hover( function () { userActive = true; }, function () { userActive = false; } ); if (!hidecontrols) { setInterval( function () { if (userActive) { $videoControls.show(); userActive = false; clearTimeout(hideControlsTimerId); hideControlsTimerId = setTimeout( function () { if (!$videoObj.get(0).paused) { $videoControls.fadeOut(); } }, 5e3 ); } }, 250 ); } $(".html5boxVideoControlsBg", $videoControls).css({ display: "block", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)" }); $(".html5boxPlayPause", $videoControls).css({ display: "block", position: "relative", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), float: "left" }); var $videoBtnPlay = $(".html5boxPlay", $videoControls); var $videoBtnPause = $(".html5boxPause", $videoControls); $videoBtnPlay .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top left", } ) .hover( function () { $(this).css({ "background-position": "bottom left" }); }, function () { $(this).css({ "background-position": "top left" }); } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); $videoBtnPause .css( { display: "none", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top right", } ) .hover( function () { $(this).css({ "background-position": "bottom right" }); }, function () { $(this).css({ "background-position": "top right" }); } ) .bind( eClick, function () { $videoObj.get(0).pause(); } ); var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); var $videoSeeker = $(".html5boxSeeker", $videoControls); var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); $videoTimeCurrent.css( { display: "block", position: "relative", float: "left", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoTimeTotal.css( { display: "block", position: "relative", float: "right", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoSeeker .css({ display: "block", cursor: "pointer", overflow: "hidden", position: "relative", height: "10px", "background-color": "#222", margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" }) .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); $videoSeeker.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); } ); } ) .bind( eCancel, function () { $videoSeeker.unbind(eMove); } ); $videoSeekerBuffer.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#444" }); $videoSeekerPlay.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#fcc500" }); if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { var switchScreen = function (fullscreen) { if (fullscreen) { if ($videoObj.get(0).requestFullscreen) { $videoObj.get(0).requestFullscreen(); } else if ($videoObj.get(0).webkitRequestFullScreen) { $videoObj.get(0).webkitRequestFullScreen(); } else if ($videoObj.get(0).mozRequestFullScreen) { $videoObj.get(0).mozRequestFullScreen(); } else if ($videoObj.get(0).webkitEnterFullScreen) { $videoObj.get(0).webkitEnterFullScreen(); } if ($videoObj.get(0).msRequestFullscreen) { $videoObj.get(0).msRequestFullscreen(); } } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }; var switchScreenCSS = function (fullscreen) { $videoControls.css({ position: fullscreen ? "fixed" : "absolute" }); var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); $videoFullscreen.css({ "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY }); $videoFullscreenBg.css({ display: fullscreen ? "block" : "none" }); if (fullscreen) { $(document).bind("mousemove", userActivate); $videoControls.css({ "z-index": 2147483647 }); } else { $(document).unbind("mousemove", userActivate); $videoControls.css({ "z-index": "" }); } }; document.addEventListener( "fullscreenchange", function () { isFullscreen = document.fullscreen; switchScreenCSS(document.fullscreen); }, false ); document.addEventListener( "mozfullscreenchange", function () { isFullscreen = document.mozFullScreen; switchScreenCSS(document.mozFullScreen); }, false ); document.addEventListener( "webkitfullscreenchange", function () { isFullscreen = document.webkitIsFullScreen; switchScreenCSS(document.webkitIsFullScreen); }, false ); $videoObj.get(0).addEventListener( "webkitbeginfullscreen", function () { isFullscreen = true; }, false ); $videoObj.get(0).addEventListener( "webkitendfullscreen", function () { isFullscreen = false; }, false ); $("head").append(""); var $videoFullscreen = $(".html5boxFullscreen", $videoControls); $videoFullscreen .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", "background-position": "left top", } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { isFullscreen = !isFullscreen; switchScreen(isFullscreen); } ); } if (hd) { var $videoHD = $(".html5boxHD", $videoControls); $videoHD .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_hd.png" + "')", "background-position": (isHd ? "right" : "left") + " center", } ) .bind( eClick, function () { isHd = !isHd; $(this).css({ "background-position": (isHd ? "right" : "left") + " center" }); parentInst.isHd = isHd; var isPaused = $videoObj.get(0).isPaused; $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); if (!isPaused) { $videoObj.get(0).play(); } else if (!isIPhone) { $videoObj.get(0).pause(); } } ); } $videoObj.get(0).volume = defaultvolume; var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; var volume = $videoObj.get(0).volume; $videoObj.get(0).volume = volume / 2 + 0.1; if ($videoObj.get(0).volume === volume / 2 + 0.1) { $videoObj.get(0).volume = volume; var $videoVolume = $(".html5boxVolume", $videoControls); var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); $videoVolume.css({ display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) }).hover( function () { clearTimeout(hideVolumeBarTimeoutId); var volume = $videoObj.get(0).volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); $videoVolumeBar.show(); }, function () { clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId = setTimeout( function () { $videoVolumeBar.hide(); }, 1e3 ); } ); $videoVolumeButton .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", "background-position": "top " + (volume > 0 ? "left" : "right"), } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { var volume = $videoObj.get(0).volume; if (volume > 0) { volumeSaved = volume; volume = 0; } else { volume = volumeSaved; } var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); $videoVolumeButton.css({ "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY }); $videoObj.get(0).volume = volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); } ); $videoVolumeBar.css( { display: "none", position: "absolute", left: 4, bottom: "100%", width: 24, height: 80, "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)", } ); $videoVolumeBarBg.css({ display: "block", position: "relative", width: 10, height: 68, margin: 7, cursor: "pointer", "background-color": "#222" }); $videoVolumeBarActive.css({ display: "block", position: "absolute", bottom: 0, left: 0, width: "100%", height: "100%", "background-color": "#fcc500" }); $videoVolumeBarBg .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; $videoVolumeBarBg.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; } ); } ) .bind( eCancel, function () { $videoVolumeBarBg.unbind(eMove); } ); } var calcTimeFormat = function (seconds) { var h0 = Math.floor(seconds / 3600); var h = 10 > h0 ? "0" + h0 : h0; var m0 = Math.floor((seconds - h0 * 3600) / 60); var m = 10 > m0 ? "0" + m0 : m0; var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); var s = 10 > s0 ? "0" + s0 : s0; var r = m + ":" + s; if (h0 > 0) { r = h + ":" + r; } return r; }; if (hideplaybutton) { $videoPlay.hide(); } if (hidecontrols) { $videoControls.hide(); } var onVideoPlay = function () { if (!hideplaybutton) { $videoPlay.hide(); } if (!hidecontrols) { $videoBtnPlay.hide(); $videoBtnPause.show(); } }; var onVideoPause = function () { if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoEnded = function () { $(window).trigger("html5lightbox.videoended"); if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoUpdate = function () { var curTime = $videoObj.get(0).currentTime; if (curTime) { $videoTimeCurrent.text(calcTimeFormat(curTime)); var duration = $videoObj.get(0).duration; if (duration) { $videoTimeTotal.text(calcTimeFormat(duration)); if (!sliderDragging) { var sliderW = $videoSeeker.width(); var pos = Math.round((sliderW * curTime) / duration); $videoSeekerPlay.css({ width: pos }); $videoSeekerHandler.css({ left: pos }); } } } }; var onVideoProgress = function () { if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { var sliderW = $videoSeeker.width(); $videoSeekerBuffer.css({ width: Math.round((sliderW * $videoObj.get(0).buffered.end(0)) / $videoObj.get(0).duration) }); } }; try { $videoObj.bind("play", onVideoPlay); $videoObj.bind("pause", onVideoPause); $videoObj.bind("ended", onVideoEnded); $videoObj.bind("timeupdate", onVideoUpdate); $videoObj.bind("progress", onVideoProgress); } catch (e) { } }; })(jQuery); jQuery(".tsvg-html5lightbox-452410").html5lightbox452410({},'452410'); jQuery(function() { jQuery('.tsvg-section-452410').fadeIn(); var tsvgFancyHoverInverse452410 = 'Default'; tsvgFancyHoverInverse452410 = tsvgFancyHoverInverse452410 == 'Default' ? false : true; jQuery('.tsvg-fancy-blocks-list-452410 > li').each(function() { jQuery(this).hoverdir({hoverDelay: 50, inverse:tsvgFancyHoverInverse452410}); }); }); clearInterval(tsvgFancyInterval452410); } }, tsvgFancyReference452410 = ( function tsvgFancySameCall452410() { tsvgFancyInterval452410 = setInterval(tsvgFancyIntervalFunction452410, 1000); return tsvgFancySameCall452410; }() );
'); }else{ jQuery('.tsvg-section-452410 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } var svg = document.querySelector('.btn-lg svg'), svgPath = new Proxy({ y: null, smoothing: null }, { set(target, key, value) { target[key] = value; if(target.y !== null && target.smoothing !== null) { svg.innerHTML = getPath(target.y, target.smoothing, null); } return true; }, get(target, key) { return target[key]; } }); svgPath.y = 20; svgPath.smoothing = 0; } } jQuery('.tsvg-section-452410 .btn-lg').click(function (e) { let max_heigth =jQuery('.tsvg-main-content-452410').height(); let main_length = jQuery('.tsvg-main-content-452410 figure ul li').length; tsvgPaginationLoad452410 = 'false'; if(jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ tsvgPaginationLoad452410 = 'true'; } jQuery('.tsvg-main-content-452410').css({'max-height': max_heigth+'px','transition':'unset'}); setTimeout(() => { jQuery('.tsvg-main-content-452410').css({'transition':'max-height 3s ease-in-out','max-height':main_length+'000vh'}); }, 100); tsvgPaginationCreate452410(jQuery('.tsvg-main-content-452410 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage); if(jQuery('.tsvg-section-452410 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'){ jQuery('.tsvg-section-452410 .btn-lg').addClass('animate'); setTimeout(function(){ jQuery('.tsvg-section-452410 .btn-lg').removeClass('animate'); },700); } if(!jQuery('.tsvg-section-452410 .btn-lg').hasClass('loading')&&(jQuery('.tsvg-section-452410 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery('.tsvg-section-452410 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5')&&jQuery('.tsvg-section-452410 .tsvg-pagination-pages-wrapper svg').length) { jQuery('.tsvg-section-452410 .btn-lg').addClass('loading'); setTimeout(() => { svg.innerHTML = getPath(0, 0, [ [3, 14], [8, 19], [21, 6] ]); }, 1000 / 2); setTimeout(() => { jQuery('.tsvg-section-452410 .btn-lg').removeClass('loading'); if(jQuery('.tsvg-section-452410 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ jQuery('.tsvg-section-452410 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
  • '+load_text+'
'); }else{ jQuery('.tsvg-section-452410 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } }, 2000 ); } }) tsvgPaginationCreate452410(jQuery('.tsvg-section-452410 .tsvg-main-content-452410 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage) } } function tsvgNewPagination452410(){ var interval_pag_fn_452410 = setInterval(setPagina_452410, 100); function setPagina_452410() { if( typeof(jQuery) != "undefined" && jQuery != null){ if( jQuery('.tsvg-main-content-452410').attr("data-pagination")=='pagination'){ tsvgPaginationGenerate452410(); } if( jQuery('.tsvg-main-content-452410').attr("data-pagination")=='load-more'){ tsvgPaginationGenerate452410(); } clearInterval(interval_pag_fn_452410); } } } tsvgNewPagination452410(); function tsvgPaginationGenerate(){ tsvgPaginationGenerate452410(); } function getPoint(point, i, a, smoothing) { let cp = (current, previous, next, reverse) => { let p = previous || current, n = next || current, o = { length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)), angle: Math.atan2(n[1] - p[1], n[0] - p[0]) }, angle = o.angle + (reverse ? Math.PI : 0), length = o.length * smoothing; return [current[0] + Math.cos(angle) * length, current[1] + Math.sin(angle) * length]; }, cps = cp(a[i - 1], a[i - 2], point, false), cpe = cp(point, a[i - 1], a[i + 1], true); return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`; } function getPath(update, smoothing, pointsNew) { let points = pointsNew ? pointsNew : [ [4, 12], [12, update], [20, 12] ], d = points.reduce((acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${getPoint(point, i, a, smoothing)}`, ''); return ``; }
" + "
" + "
" + "
" + "" + "" + "" + "
" + "
" + "" + "
" + "" ); inst.options.positionFixed = inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; inst.$lightbox.css({ position: inst.options.positionFixed ? "fixed" : "absolute" }); inst.$lightbox.appendTo("body"); inst.$lightboxBox = $("#tsvg-fancy-html5-lightbox-box", inst.$lightbox); inst.$elem = $("#tsvg-fancy-html5-elem-box", inst.$lightbox); inst.$elemWrap = $("#tsvg-fancy-html5-elem-wrap", inst.$lightbox); inst.$loading = $("#tsvg-fancy-html5-loading", inst.$lightbox); inst.$error = $("#tsvg-fancy-html5-error", inst.$lightbox); inst.$image = $("#tsvg-fancy-html5-image", inst.$lightbox); var elemText = ""; if (inst.options.titlestyle == "left") { inst.$elem.prepend(elemText); } else { inst.$elem.append(elemText); } inst.$elemData = $("#tsvg-fancy-html5-elem-data-box", inst.$lightbox); inst.$text = $("#tsvg-fancy-html5-text", inst.$lightbox); if (inst.options.borderradius > 0) { inst.$elem.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); if (inst.options.titlestyle == "inside") { inst.$elemWrap.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); } else if (inst.options.titlestyle == "bottom") { inst.$elemWrap.css( { "border-top-left-radius": inst.options.borderradius + "px", "-moz-top-left-border-radius": inst.options.borderradius + "px", "-webkit-top-left-border-radius": inst.options.borderradius + "px", "border-top-right-radius": inst.options.borderradius + "px", "-moz-top-right-border-radius": inst.options.borderradius + "px", "-webkit-top-right-border-radius": inst.options.borderradius + "px", } ); inst.$elemData.css( { "border-bottom-left-radius": inst.options.borderradius + "px", "-moz-top-bottom-border-radius": inst.options.borderradius + "px", "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", "border-bottom-right-radius": inst.options.borderradius + "px", "-moz-bottom-right-border-radius": inst.options.borderradius + "px", "-webkit-bottom-right-border-radius": inst.options.borderradius + "px", } ); } } if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { inst.$lightboxBox.css({ "background-color": inst.options.bgcolor }); if (inst.options.titlestyle == "right") { inst.$elemWrap.css({ position: "relative", float: "left" }); inst.$elemData.css({ position: "relative", overflow: "hidden", padding: inst.options.bordersize + "px" }); } else { inst.$elemWrap.css({ position: "relative", overflow: "hidden" }); inst.$elemData.css({ position: "relative", float: "left", padding: inst.options.bordersize + "px" }); } } else if (inst.options.titlestyle == "inside") { inst.$elemData.css({ position: "absolute", margin: inst.options.bordersize + "px", bottom: 0, left: 0, "background-color": "#333", "background-color": "rgba(51, 51, 51, 0.6)" }); inst.$text.css({ padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" }); } else { inst.$elemData.css( { position: "relative", width: "100%", height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", padding: "0 0 " + inst.options.bordersize + "px" + " 0", "background-color": inst.options.bgcolor, "text-align": "left", } ); inst.$text.css({ margin: "0 " + inst.options.bordersize + "px" }); } if (inst.options.fullscreenmode) { inst.$lightbox.append( "
" + "
" ); inst.$next = $(".tsvg-fancy-html5-next-fullscreen", inst.$lightbox); inst.$prev = $(".tsvg-fancy-html5-prev-fullscreen", inst.$lightbox); inst.$lightboxBox.append( "
" + "
" ); inst.$nextbottom = $(".tsvg-fancy-html5-next-bottom-fullscreen", inst.$lightbox); inst.$prevbottom = $(".tsvg-fancy-html5-prev-bottom-fullscreen", inst.$lightbox); inst.$nextbottom.click( function () { inst.nextArrowClicked(); } ); inst.$prevbottom.click( function () { inst.prevArrowClicked(); } ); inst.$lightbox.append( "
" ); inst.$close = $("#tsvg-fancy-html5-close-fullscreen", inst.$lightbox); } else { inst.$elemWrap.append( "" + "" ); inst.$next = $("#tsvg-fancy-html5-next", inst.$lightbox); inst.$prev = $("#tsvg-fancy-html5-prev", inst.$lightbox); if ((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) { inst.$lightboxBox.append( "
" + "
" ); inst.$nexttouch = $(".tsvg-fancy-html5-next-touch", inst.$lightbox); inst.$prevtouch = $(".tsvg-fancy-html5-prev-touch", inst.$lightbox); inst.$nexttouch.click( function () { inst.nextArrowClicked(); } ); inst.$prevtouch.click( function () { inst.prevArrowClicked(); } ); } inst.$lightboxBox.append( "" ); inst.$close = $("#tsvg-fancy-html5-close", inst.$lightbox); } if (inst.options.showsocial) { var socialCode = '"; inst.$lightboxBox.append(socialCode); $(".tsvg-fancy-html5-social-btn", inst.$lightbox).click( function () { var shareUrl = window.location.href + (0 > window.location.href.indexOf("?") ? "?" : "&") + "html5lightboxshare=" + encodeURIComponent(inst.currentElem[ELEM_HREF]); var shareTitle = inst.currentElem[ELEM_TITLE]; var shareMedia = inst.currentElem[ELEM_HREF]; if (inst.currentElem[ELEM_TYPE] == 0) { shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); } else if (inst.currentElem[ELEM_TYPE] == 3) { shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; } else { var lightboxLink = $('.tsvg-html5lightbox-931430[href="' + inst.currentElem[ELEM_HREF] + '"]'); if (lightboxLink.length > 0) if (lightboxLink.data("shareimage") && lightboxLink.data("shareimage").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); } else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); } else { var lightboxImg = $("img", lightboxLink); if (lightboxImg.length > 0) { shareMedia = inst.absoluteUrl(lightboxImg.attr("src")); } } } var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; if ($(this).hasClass("tsvg-fancy-html5-social-facebook")) { window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-twitter")) { window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-pinterest")) { window.open( "https://pinterest.com/pin/create/bookmarklet/?media=" + encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank" ); } return false; } ); } inst.$watermark = $("#tsvg-fancy-html5-watermark", inst.$lightbox); if (inst.options.stamp) { inst.$watermark.html(""); } else if (inst.options.watermark) { var html = ""; if (inst.options.watermarklink) { html = "" + html + ""; } inst.$watermark.html(html); } if (inst.options.closeonoverlay) { $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).click(inst.finish); } inst.$close.click(inst.finish); inst.$next.click( function () { inst.nextArrowClicked(); } ); inst.$prev.click( function () { inst.prevArrowClicked(); } ); $(window).resize( function () { clearTimeout(inst.options.resizeTimeout); inst.options.resizeTimeout = setTimeout( function () { inst.resizeWindow(); }, 500 ); } ); $(window).scroll( function () { inst.scrollBox(); } ); $(window).bind( "orientationchange", function (e) { if (inst.options.isMobile) { inst.resizeWindow(); } } ); if (inst.options.isIPhone) { inst.options.windowInnerHeight = window.innerHeight; setInterval( function () { if (inst.options.windowInnerHeight != window.innerHeight) { inst.options.windowInnerHeight = window.innerHeight; inst.resizeWindow(); } }, 500 ); } if (inst.options.enabletouchswipe) { inst.enableSwipe(); } }; inst.slideTimer = function (interval, callback, updatecallback) { let timerInstance = this, updateinterval = 50, updateTimerId = null, runningTime = 0, paused = false, started = false, startedandpaused = false; timerInstance.timeout = interval; this.pause = function () { if (started) { paused = true; clearInterval(updateTimerId); } }; this.resume = function (forceresume) { if (startedandpaused && !forceresume) { return; } startedandpaused = false; if (started && paused) { paused = false; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); } }; this.stop = function () { clearInterval(updateTimerId); if (updatecallback) { updatecallback(-1); } runningTime = 0; paused = false; started = false; }; this.start = function () { runningTime = 0; paused = false; started = true; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); }; this.startandpause = function () { runningTime = 0; paused = true; started = true; startedandpaused = true; }; return this; }; inst.updateTimer = function (percent) { var w = Math.round(percent * 100); if (w > 100) { w = 100; } if (0 > w ) { w = 0; } $("#tsvg-fancy-html5-timer", inst.$lightbox).css({ display: "block", width: w + "%" }); }; inst.initSlide = function () { inst.autosliding = false; inst.slideTimeout = inst.slideTimer( inst.options.slideinterval, function () { inst.gotoSlide(-1); }, inst.options.showtimer ? function (percent) { inst.updateTimer(percent); } : null ); if (inst.options.autoslide) { inst.slideTimeout.stop(); inst.autosliding = true; } }; inst.nextArrowClicked = function () { if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") { window[inst.options.onlastarrowclicked](); } } inst.gotoSlide(-1); }; inst.prevArrowClicked = function () { if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && typeof window[inst.options.onfirstarrowclicked] == "function") { window[inst.options.onfirstarrowclicked](); } } inst.gotoSlide(-2); }; inst.calcNextPrevElem = function () { inst.options.nextElem = -1; inst.options.prevElem = -1; inst.options.inGroup = false; inst.options.groupIndex = 0; inst.options.groupCount = 0; var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; for (var i = 0; inst.elemArray.length > i; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (i == inst.options.curElem) { inst.options.groupIndex = inst.options.groupCount; } inst.options.groupCount++; } } var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; if (curGroup != undefined && curGroup != null) { for (j = inst.options.curElem + 1;inst.elemArray.length > j; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } if (0 > inst.options.nextElem) { for (j = 0; inst.options.curElem > j ; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } } if (inst.options.nextElem >= 0) { for (j = inst.options.curElem - 1; j >= 0; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } if (0 > inst.options.prevElem ) { for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } } } } if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) { inst.options.inGroup = true; } }; inst.calcBoxPosition = function (initW, initH) { var boxW = initW + 2 * inst.options.bordersize; var boxH = initH + 2 * inst.options.bordersize; var winH = window.innerHeight ? window.innerHeight : $(window).height(); var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); if (inst.options.titlestyle == "bottom") { boxT -= Math.round(inst.options.barheight / 2); } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; if (topmargin > boxT) { boxT = topmargin; } if (inst.options.insideiframe && window.self != window.top) { if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; var parentscroll = parent.window.document.body.scrollTop; boxT = topmargin; boxT += parentscroll > iframetop ? parentscroll - iframetop : 0; } } return [boxW, boxH, boxT]; }; inst.hideNavArrows = function () { var showPrev = false; var showNext = false; if (inst.options.inGroup) { if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showPrev = true; } if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showNext = true; } } if (showPrev) { inst.$prev.removeClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$prev.addClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.addClass("tsvg-fancy-html5-hide"); } } if (showNext) { inst.$next.removeClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$next.addClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.addClass("tsvg-fancy-html5-hide"); } } }; inst.clickHandler = function (event) { var $this = $(this); var dataoptions = {}; if (jQuery(event.target).prop("tagName") == 'A') { let link = jQuery(event.target).attr('href'); if (jQuery(event.target).attr('target') == '_blank') { window.open(link); } else { window.location.assign(link) } return false; } $.each( $this.data(), function (key, value) { dataoptions[key.toLowerCase()] = value; } ); inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i ; i++) { if (inst.elemArray[i][ELEM_ID] == $this.data("tsvgid")) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; if (inst.options.iequirksmode) { inst.$lightboxBox.css({ top: boxT }); } else { inst.$lightboxBox.css({ "margin-top": boxT }); } if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.loadThumbnail = function (src, index) { let inst_img_elem = document.createElement('img'); inst_img_elem.src = src; inst_img_elem.addEventListener('load', function () { if (inst.options.thumbwidth / inst.options.thumbheight >= inst_img_elem.naturalWidth / inst_img_elem.naturalHeight ) { inst_img_elem.setAttribute("style","width:100%;") } else { inst_img_elem.setAttribute("style","height:100%;") } $(".tsvg-fancy-html5-nav-thumb").eq(index).html(inst_img_elem); }) inst_img_elem.addEventListener('error', function () { console.log('error') }) }; inst.matchGroup = function (curGroup, elemGroup) { if (!curGroup || !elemGroup) { return false; } var curs = curGroup.split(":"); var elems = elemGroup.split(":"); var result = false; for (var i in curs) { if ($.inArray(curs[i], elems) > -1) { result = true; break; } } return result; }; inst.showNavigation = function () { if (!inst.options.shownavigation) { return; } if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) { return; } var i; var showNav = false; var group = inst.currentElem[ELEM_GROUP]; for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { showNav = true; break; } } } if (!showNav) { return; } inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; if ($(".tsvg-fancy-html5-nav").length > 0) { return; } var check_bool = $('.tsvg-fancy-blocks-container').attr('data-tsvg-shn'); if (check_bool === 'false') { return } $("body").append( "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); if (TS_VG_FG_Show_Nav == "true") { var index = 0; } for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { $(".tsvg-fancy-html5-nav-list").append( "
'
" ); this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index) index++; } } } $(".tsvg-fancy-html5-nav-thumb").hover( function () { $(this).css({ opacity: 1 }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor }); }, function () { $(this).css({ opacity: inst.options.thumbopacity }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor }); } ); $(".tsvg-fancy-html5-nav-thumb").click( function () { var index = $(this).data("arrayindex"); if (index >= 0) { inst.gotoSlide(index); } } ); inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); $(".tsvg-fancy-html5-nav-list") .css({ display: "block", position: "relative", "margin-left": 0, width: inst.options.totalwidth + "px" }) .append("
"); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); $navPrev.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; if (marginLeft >= 0) { marginLeft = 0; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (maskWidth - inst.options.totalwidth >= marginLeft ) { $navNext.css({ "background-position": "center left" }); } else { $navNext.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); $navNext.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; if (maskWidth - inst.options.totalwidth >= marginLeft) { marginLeft = maskWidth - inst.options.totalwidth; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (marginLeft >= 0) { $navPrev.css({ "background-position": "center left" }); } else { $navPrev.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.loadElem = function (elem) { inst.currentElem = elem; inst.showing = true; inst.showNavigation(); inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); inst.$loading.show(); if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") { window[inst.options.onshowitem](elem); } switch (elem[ELEM_TYPE]) { case 0: var imgLoader = new Image(); $(imgLoader).load( function () { inst.showImage(elem, imgLoader.width, imgLoader.height); } ); $(imgLoader).error( function () { inst.showError(); } ); imgLoader.src = elem[ELEM_HREF]; break; case 1: inst.showSWF(elem); break; case 2: case 8: inst.showVideo(elem); break; case 3: case 4: case 9: case 11: inst.showYoutubeVimeo(elem); break; case 5: inst.showPDF(elem); break; case 6: inst.showMP3(elem); break; case 7: inst.showWeb(elem); break; case 10: inst.showDiv(elem); break; } if (inst.options.googleanalyticsaccount && window._gaq) { window._gaq.push(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]); } }; inst.loadCurElem = function () { inst.loadElem(inst.elemArray[inst.options.curElem]); }; inst.showError = function () { inst.$loading.hide(); inst.resizeLightbox( inst.options.errorwidth, inst.options.errorheight, true, function () { inst.$error.show(); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); } ); }; inst.calcTextWidth = function (objW) { return objW - 36; }; (inst.showTitle = function (w, t, description) { if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: w + "px" }); } var text = ""; if (inst.options.showtitle) { if (t && t.length > 0) { text += t; } } if (inst.options.inGroup) { if (inst.options.showtitleprefix) { text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", inst.options.groupCount) + " " + text; } jQuery("#tsvg-fancy-html5-elem-data-box").css("display", "none"); if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT != "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (TotalSoft_GV_FG_PD == "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "block"); } if (TotalSoft_GV_FG_PT == "true") { jQuery(".tsvg-fancy-popup-text").css("display", "inline-block"); } if (TotalSoft_GV_FG_PD != "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "none"); } if (TotalSoft_GV_FG_PT != "true") { jQuery(".tsvg-fancy-popup-text").css("display", "none"); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD != "true") { jQuery("#tsvg-fancy-html5-text").css("display", "none"); } } if (inst.options.showdescription && description && description.length > 0) { inst.$text.html(text); } if (inst.options.inGroup && inst.options.showplaybutton) { if (inst.autosliding) { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } else { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); } $("#tsvg-fancy-html5-play", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } ); $("#tsvg-fancy-html5-pause", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.autosliding = false; } } ); } $("#tsvg-fancy-html5-social", inst.$lightbox).show(); }); (inst.showImage = function (elem, imgW, imgH) { var elemW, elemH; if (elem[ELEM_WIDTH]) { elemW = elem[ELEM_WIDTH]; } else { elemW = imgW; elem[ELEM_WIDTH] = imgW; } if (elem[ELEM_HEIGHT]) { elemH = elem[ELEM_HEIGHT]; } else { elemH = imgH; elem[ELEM_HEIGHT] = imgH; } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, inst.options.imagekeepratio); inst.resizeLightbox( sizeObj.w, sizeObj.h, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : ""; inst.$image.show(); inst.$image.html( "
" + timercode + "
" ); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }); inst.showSWF = function (elem) { var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); inst.embedFlash($("#tsvg-html5lightbox-swf"), elem[ELEM_HREF], "window", { width: dataW, height: dataH }); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showVideo = function (elem) { inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var isHTML5 = false; if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || (inst.options.isIE9 && inst.options.useflashonie9) || (inst.options.isIE10 && inst.options.useflashonie10) || (inst.options.isIE11 && inst.options.useflashonie11)) { isHTML5 = false; } else if (inst.options.isMobile) { isHTML5 = true; } else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) { if ((!inst.options.isFirefox && !inst.options.isOpera) || ((inst.options.isFirefox || inst.options.isOpera) && (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM]))) { isHTML5 = true; } } if (isHTML5) { var videoSrc = elem[ELEM_HREF]; if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) { videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; } inst.embedHTML5Video($("#tsvg-html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo); } else { var videoFile = elem[ELEM_HREF]; if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") { videoFile = inst.options.htmlfolder + videoFile; } inst.embedFlash( $("#tsvg-html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { width: dataW, height: dataH, jsobjectname: "html5Lightbox", hidecontrols: inst.options.videohidecontrols ? "1" : "0", hideplaybutton: "0", videofile: videoFile, hdfile: "", ishd: "0", defaultvolume: inst.options.defaultvideovolume, autoplay: inst.options.autoplay ? "1" : "0", loop: inst.options.loopvideo ? "1" : "0", errorcss: ".html5box-error" + inst.options.errorcss, id: 0, } ); } inst.$elem.show(); inst.showData(); } ); }; inst.loadNext = function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } }; inst.getYoutubeParams = function (href) { var result = {}; if (0 > href.indexOf("?") ) { return result; } var params = href.substring(href.indexOf("?") + 1).split("&"); for (var i = 0;params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2 && value[0].toLowerCase() != "v") { result[value[0].toLowerCase()] = value[1]; } } return result; }; inst.getYoutubeId = function (href) { var youtubeId = ""; var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(shorts\/)|(watch\??v?=?))([^#\&\?]*).*/; var match = href.match(regExp); if (match && match[match.length -1].length == 11) { youtubeId = match[match.length -1]; } return youtubeId; }; inst.prepareYoutubeHref = function (href) { let youtubeId = inst.getYoutubeId(href), protocol = "https:", result = protocol + "//www.youtube.com/embed/" + youtubeId, params = this.getYoutubeParams(href), first = true; for (var key in params) { if (first) { result += "?"; first = false; } else { result += "&"; } result += key + "=" + params[key]; } return result; }; inst.prepareDailymotionHref = function (href) { if (href.match(/\:\/\/.*(dai\.ly)/i)) { var protocol = "https:"; var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; href = protocol + "" + id; } return href; }; inst.showYoutubeVimeo = function (elem) { var tsvg_autoplay = jQuery('.tsvg-main-content-' + id).attr('data-tsvg-autoplay'); inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var href = elem[ELEM_HREF]; var youtubeid = ""; if (elem[ELEM_TYPE] == 3) { youtubeid = inst.getYoutubeId(href); href = inst.prepareYoutubeHref(href); if (tsvg_autoplay == "true") { href += "?autoplay=1&mute=1" } else { href += "?autoplay=0&mute=0" } } if (elem[ELEM_TYPE] == 9) { href = inst.prepareDailymotionHref(href); } if (inst.options.autoplay) { if (elem[ELEM_TYPE] == 4) { if (href.indexOf('player.vimeo.com/video/') > -1) { if (tsvg_autoplay == "true") { href += "?autoplay=1&muted=1"; } } } } if (inst.options.loopvideo) { href += 0 > href.indexOf("?") ? "?" : "&"; switch (elem[ELEM_TYPE]) { case 3: href += "loop=1&playlist=" + youtubeid; break; case 4: case 9: href += "loop=1"; break; case 11: href += "endVideoBehavior=loop"; break; } } if (elem[ELEM_TYPE] == 3 && Totalsoft_FG_ShVAutoPl == "true") { if (0 > href.indexOf("?")) { href += "?wmode=transparent&rel=0&iv_load_policy=3"; } else { href += "&wmode=transparent&rel=0&iv_load_policy=3"; } if (inst.options.videohidecontrols) { href += "&controls=0&showinfo=0"; } href += "&mute=1&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname; } if (href.indexOf('.mp4') > -1) { let autoplay_bool = tsvg_autoplay == "true" ? "autoplay muted" : ""; $("#tsvg-html5lightbox-video").html(''); } else { $("#tsvg-html5lightbox-video").html(""); } inst.$elem.show(); inst.showData(); if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") { new YT.Player( "html5boxiframevideo", { events: { onStateChange: function (event) { if (event.data == YT.PlayerState.ENDED) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } }, }, } ); } else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { var vimeoIframe = $("#html5boxiframevideo")[0]; var vimeoPlayer = $f(vimeoIframe); vimeoPlayer.addEvent( "ready", function () { vimeoPlayer.addEvent( "finish", function (id) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); } ); } } ); }; inst.showPDF = function (elem) { }; inst.showMP3 = function (elem) { }; inst.showDiv = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var divID = elem[ELEM_HREF]; if ($(divID).length > 0) { $("#tsvg-html5lightbox-div").html($(divID).html()); } else { $("#tsvg-html5lightbox-div").html("
The specified div ID does not exist.
"); } inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showWeb = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); var tsvgRumbleCheck = elem[ELEM_HREF].indexOf('rumble.com/') > -1 ? 'sandbox="allow-scripts"' : ''; dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); $("#tsvg-html5lightbox-web").html(""); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.scrollBox = function () { }; inst.resizeWindow = function () { if (!inst.currentElem) { return; } if (!inst.options.responsive) { return; } var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); if (inst.options.responsivebarheight) { if (inst.options.smallscreenheight >= winH) { inst.options.barheight = inst.options.barheightonsmallheight; } else { inst.options.barheight = inst.options.barheightoriginal; } if (inst.options.titlestyle == "bottom" && inst.options.barautoheight != "auto") { inst.$elemData.css({ height: inst.options.barheight + "px", "max-height": inst.options.barheight + "px" }); } } var elemW, elemH, keepratio; if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; keepratio = false; } else { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; if (inst.currentElem[ELEM_TYPE] == 0) { keepratio = inst.options.imagekeepratio; } else { keepratio = true; } } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, keepratio); var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: sizeObj.w + "px" }); } if (0 >= $(".tsvg-fancy-html5-nav").length ) { return; } $(".tsvg-fancy-html5-nav-list").css({ "margin-left": 0 }); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.calcElemSize = function (sizeObj, keepratio) { if (!inst.options.responsive) { return sizeObj; } var winWidth = $(window).width(); winWidth = winWidth ? winWidth : $(document).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); winH = winH ? winH : $(document).height(); if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) { sizeObj.w = (sizeObj.w * 100) / inst.options.imagepercentage; } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; if (inst.options.titlestyle == "bottom") { h0 -= inst.options.barheight; } if (((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && inst.options.sidetobottomscreenwidth >= winWidth ) || (inst.options.notkeepratioonsmallheight && inst.options.smallscreenheight >= winH)) { keepratio = false; } if (sizeObj.h > h0) { if (keepratio) { sizeObj.w = Math.round((sizeObj.w * h0) / sizeObj.h); } sizeObj.h = h0; } var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; if ( (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth) || (((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) ) { w0 -= 64; } if (sizeObj.w > w0) { if (keepratio) { sizeObj.h = Math.round((sizeObj.h * w0) / sizeObj.w); } sizeObj.w = w0; } return sizeObj; }; inst.showData = function () { if (inst.$text.text().length > 0) { inst.$elemData.show(); } if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$lightboxBox.css({ height: "auto" }); } if (inst.$text.text().length > 0 && inst.options.titlestyle == "bottom") { inst.$elemData.css({ "max-height": inst.options.barheight + "px" }); } $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).css({ height: Math.max($(window).height(), $(document).height()) }); $(window).trigger("html5lightbox.lightboxopened"); }; inst.resizeLightbox = function (elemW, elemH, bAnimate, onFinish) { inst.hideNavArrows(); var boxPos = inst.calcBoxPosition(elemW, elemH); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$loading.hide(); inst.$watermark.hide(); if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastitem && window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") { window[inst.options.onlastitem](inst.currentElem); } } if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") { window[inst.options.onfirstitem](inst.currentElem); } } if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { inst.$elem.bind( "mouseenter mousemove", function () { if ((inst.options.arrowloop && inst.options.prevElem >= 0) || (!inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.curElem > inst.options.prevElem )) { inst.$prev.fadeIn(); } if ((inst.options.arrowloop && inst.options.nextElem >= 0) || (!inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem)) { inst.$next.fadeIn(); } } ); inst.$elem.bind( "mouseleave", function () { inst.$next.fadeOut(); inst.$prev.fadeOut(); } ); } inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) { speed = 0; } inst.$lightboxBox.animate({ width: boxW }, speed).animate( { height: boxH }, speed, function () { inst.onAnimateFinish(onFinish); } ); } else { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) { speed = 0; } inst.$lightboxBox.css({ width: boxW, height: "auto", "min-width": boxW - 15 }); inst.$elemWrap.animate({ width: boxW, "min-width": boxW - 15 }, speed).animate( { height: boxH, "min-height": boxH - 15 }, speed, function () { inst.onAnimateFinish(onFinish); } ); } }; inst.onAnimateFinish = function (onFinish) { inst.$loading.show(); inst.$watermark.show(); inst.$close.show(); inst.$elem.css({ "background-color": inst.options.bgcolor }); onFinish(); }; inst.reset = function () { if (inst.options.stamp) { inst.$watermark.hide(); } inst.showing = false; inst.$image.empty(); inst.$text.empty(); inst.$error.hide(); inst.$loading.hide(); inst.$image.hide(); if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$elemData.hide(); } if (!inst.options.fullscreenmode) { inst.$close.hide(); } inst.$elem.css({ "background-color": "" }); }; inst.resetNavigation = function () { inst.options.navheight = 0; $(".tsvg-fancy-html5-nav").remove(); }; inst.finish = function () { if ($("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).length) { $("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).attr("src", ""); } $("head") .find("style") .each( function () { if ($(this).data("creator") == "tsvg-fancy-html5box-html5-lightbox") { $(this).remove(); } } ); inst.slideTimeout.stop(); inst.reset(); inst.resetNavigation(); inst.$lightbox.remove(); $("#tsvg-fancy-html5box-html5-lightbox").remove(); inst.showObjects(); if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") { window[inst.options.oncloselightbox](inst.currentElem); } if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") { inst.onLightboxClosed(inst.currentElem); } }; inst.pauseSlide = function () { }; inst.playSlide = function () { }; inst.gotoSlide = function (slide) { if (slide == -1) { if (0 > inst.options.nextElem ) { return; } inst.options.curElem = inst.options.nextElem; } else if (slide == -2) { if (0 > inst.options.prevElem ) { return; } inst.options.curElem = inst.options.prevElem; } else if (slide >= 0) { inst.options.curElem = slide; } if (inst.autosliding) { inst.slideTimeout.stop(); } inst.calcNextPrevElem(); inst.reset(); inst.loadCurElem(); }; inst.enableSwipe = function () { inst.$elem.html5lightboxTouchSwipe931430( { preventWebBrowser: false, swipeLeft: function () { inst.gotoSlide(-1); }, swipeRight: function () { inst.gotoSlide(-2); }, } ); }; inst.hideObjects = function () { $("select, embed, object").css({ visibility: "hidden" }); }; inst.showObjects = function () { $("select, embed, object").css({ visibility: "visible" }); }; inst.embedHTML5Video = function ($container, src, autoplay, loopvideo) { let embedVideoPoster = (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : ""), embedVideoControls = (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : ""); $container.html( "
" ); if (!inst.options.nativehtml5controls) { $("video", $container).data("src", src); $("video", $container).lightboxHTML5VideoControls931430(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume); } $("video", $container) .unbind("ended") .bind( "ended", function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); }; inst.embedFlash = function ($container, src, wmode, flashVars) { if (inst.options.flashInstalled) { var htmlOptions = { pluginspage: "", quality: "high", allowFullScreen: "true", allowScriptAccess: "always", type: "application/x-shockwave-flash" }; htmlOptions.width = "100%"; htmlOptions.height = "100%"; htmlOptions.src = src; htmlOptions.flashVars = $.param(flashVars); htmlOptions.wmode = wmode; var htmlString = ""; for (var key in htmlOptions) { htmlString += key + "=" + htmlOptions[key] + " "; } $container.html(""); } else { $container.html( "
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
" ); } }; inst.checkType = function (href) { if (!href) { return -1; } if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) { return 0; } if (href.match(/[^\.]\.(swf)\s*$/i)) { return 1; } if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) { return 4; } if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) { return 3; } if (href.match(/\:\/\/.*(vimeo\.com)/i)) { return 4; } if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) { return 9; } if (href.match(/[^\.]\.(pdf)\s*$/i)) { return 5; } if (href.match(/[^\.]\.(mp3)\s*$/i)) { return 6; } if (href.match(/[^\.]\.(flv)\s*$/i)) { return 8; } if (href.match(/\#\w+/i)) { return 10; } if (href.match(/\:\/\/.*(wistia)/i)) { return 11; } return 7; }; inst.getURLParams = function () { var result = {}; var params = window.location.search.substring(1).split("&"); for (var i = 0; params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2) { result[value[0].toLowerCase()] = unescape(value[1]); } } return result; }; inst.absoluteUrl = function (href) { var link = document.createElement("a"); link.href = href; return link.protocol + "//" + link.host + link.pathname + link.search + link.hash; }; inst.showLightbox = function (type, href, title, width, height, webm, ogg, thumbnail, description) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)); }; inst.addItem = function (href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { type = mediatype && mediatype >= 0 ? mediatype : inst.checkType(href); inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)); }; inst.showItem = function (href) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i; i++) { if (inst.elemArray[i][ELEM_HREF] == href) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.unbind("click").click(inst.clickHandler); inst.each( function () { var self = $(this); if (self.data("autoopen")) { setTimeout( function () { self.click(); }, self.data("autoopendelay") ? self.data("autoopendelay") : 0 ); return false; } } ); var urlParams = inst.getURLParams(); if ("html5lightboxshare" in urlParams) { var shareUrl = decodeURIComponent(urlParams["html5lightboxshare"]); var shareLink = $('.tsvg-html5lightbox-931430[href="' + shareUrl + '"]'); if (shareLink.length > 0) { shareLink.click(); } } return inst; }; })(jQuery); (function ($) { $.fn.html5lightboxTouchSwipe931430 = function (options) { var defaults = { preventWebBrowser: false, swipeLeft: null, swipeRight: null, swipeTop: null, swipeBottom: null }; if (options) { $.extend(defaults, options); } return this.each( function () { var startX = -1, startY = -1; var curX = -1, curY = -1; function touchStart(event) { var e = event.originalEvent; if (e.targetTouches.length >= 1) { startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchMove(event) { if (defaults.preventWebBrowser) { event.preventDefault(); } var e = event.originalEvent; if (e.targetTouches.length >= 1) { curX = e.targetTouches[0].pageX; curY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchEnd(event) { if (curX > 0 || curY > 0) { triggerHandler(); touchCancel(event); } else { touchCancel(event); } } function touchCancel(event) { startX = -1; startY = -1; curX = -1; curY = -1; } function triggerHandler() { if (Math.abs(curX - startX) > Math.abs(curY - startY)) { if (curX > startX) { if (defaults.swipeRight) { defaults.swipeRight.call(); } } else { if (defaults.swipeLeft) { defaults.swipeLeft.call(); } } } else if (curY > startY) { if (defaults.swipeBottom) { defaults.swipeBottom.call(); } } else if (defaults.swipeTop) { defaults.swipeTop.call(); } } try { $(this).bind("touchstart", touchStart); $(this).bind("touchmove", touchMove); $(this).bind("touchend", touchEnd); $(this).bind("touchcancel", touchCancel); } catch (e) { } } ); }; })(jQuery); (function ($) { $.fn.lightboxHTML5VideoControls931430 = function (skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { var isTouch = "ontouchstart" in window; var eStart = isTouch ? "touchstart" : "mousedown"; var eMove = isTouch ? "touchmove" : "mousemove"; var eCancel = isTouch ? "touchcancel" : "mouseup"; var eClick = "click"; var BUTTON_SIZE = 32; var BAR_HEIGHT = isTouch ? 48 : 36; var hideControlsTimerId = null; var hideVolumeBarTimeoutId = null; var sliderDragging = false; var isFullscreen = false; var userActive = true; var isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; var isHd = $(this).data("ishd"); var hd = $(this).data("hd"); var src = $(this).data("src"); var $videoObj = $(this); $videoObj.get(0).removeAttribute("controls"); if (isIPhone) { var h = $videoObj.height() - BAR_HEIGHT; $videoObj.css({ height: h }); } var $videoPlay = $("
"); if (!isIPhone) { $videoObj.after($videoPlay); $videoPlay .css( { position: "absolute", top: "50%", left: "50%", display: "block", cursor: "pointer", width: 64, height: 64, "margin-left": -32, "margin-top": -32, "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", "background-position": "center center", "background-repeat": "no-repeat", } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); } var $videoFullscreenBg = $("
"); var $videoControls = $( "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); $videoObj.after($videoControls); $videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({ display: "none", position: "fixed", left: 0, top: 0, bottom: 0, right: 0, "z-index": 2147483647 }); $videoControls.css({ display: "block", position: "absolute", width: "100%", height: BAR_HEIGHT, left: 0, bottom: 0, right: 0, "max-width": "640px", margin: "0 auto" }); var userActivate = function () { userActive = true; }; $videoObj .bind( eClick, function () { userActive = true; } ) .hover( function () { userActive = true; }, function () { userActive = false; } ); if (!hidecontrols) { setInterval( function () { if (userActive) { $videoControls.show(); userActive = false; clearTimeout(hideControlsTimerId); hideControlsTimerId = setTimeout( function () { if (!$videoObj.get(0).paused) { $videoControls.fadeOut(); } }, 5e3 ); } }, 250 ); } $(".html5boxVideoControlsBg", $videoControls).css({ display: "block", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)" }); $(".html5boxPlayPause", $videoControls).css({ display: "block", position: "relative", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), float: "left" }); var $videoBtnPlay = $(".html5boxPlay", $videoControls); var $videoBtnPause = $(".html5boxPause", $videoControls); $videoBtnPlay .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top left", } ) .hover( function () { $(this).css({ "background-position": "bottom left" }); }, function () { $(this).css({ "background-position": "top left" }); } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); $videoBtnPause .css( { display: "none", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top right", } ) .hover( function () { $(this).css({ "background-position": "bottom right" }); }, function () { $(this).css({ "background-position": "top right" }); } ) .bind( eClick, function () { $videoObj.get(0).pause(); } ); var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); var $videoSeeker = $(".html5boxSeeker", $videoControls); var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); $videoTimeCurrent.css( { display: "block", position: "relative", float: "left", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoTimeTotal.css( { display: "block", position: "relative", float: "right", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoSeeker .css({ display: "block", cursor: "pointer", overflow: "hidden", position: "relative", height: "10px", "background-color": "#222", margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" }) .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); $videoSeeker.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); } ); } ) .bind( eCancel, function () { $videoSeeker.unbind(eMove); } ); $videoSeekerBuffer.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#444" }); $videoSeekerPlay.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#fcc500" }); if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { var switchScreen = function (fullscreen) { if (fullscreen) { if ($videoObj.get(0).requestFullscreen) { $videoObj.get(0).requestFullscreen(); } else if ($videoObj.get(0).webkitRequestFullScreen) { $videoObj.get(0).webkitRequestFullScreen(); } else if ($videoObj.get(0).mozRequestFullScreen) { $videoObj.get(0).mozRequestFullScreen(); } else if ($videoObj.get(0).webkitEnterFullScreen) { $videoObj.get(0).webkitEnterFullScreen(); } if ($videoObj.get(0).msRequestFullscreen) { $videoObj.get(0).msRequestFullscreen(); } } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }; var switchScreenCSS = function (fullscreen) { $videoControls.css({ position: fullscreen ? "fixed" : "absolute" }); var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); $videoFullscreen.css({ "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY }); $videoFullscreenBg.css({ display: fullscreen ? "block" : "none" }); if (fullscreen) { $(document).bind("mousemove", userActivate); $videoControls.css({ "z-index": 2147483647 }); } else { $(document).unbind("mousemove", userActivate); $videoControls.css({ "z-index": "" }); } }; document.addEventListener( "fullscreenchange", function () { isFullscreen = document.fullscreen; switchScreenCSS(document.fullscreen); }, false ); document.addEventListener( "mozfullscreenchange", function () { isFullscreen = document.mozFullScreen; switchScreenCSS(document.mozFullScreen); }, false ); document.addEventListener( "webkitfullscreenchange", function () { isFullscreen = document.webkitIsFullScreen; switchScreenCSS(document.webkitIsFullScreen); }, false ); $videoObj.get(0).addEventListener( "webkitbeginfullscreen", function () { isFullscreen = true; }, false ); $videoObj.get(0).addEventListener( "webkitendfullscreen", function () { isFullscreen = false; }, false ); $("head").append(""); var $videoFullscreen = $(".html5boxFullscreen", $videoControls); $videoFullscreen .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", "background-position": "left top", } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { isFullscreen = !isFullscreen; switchScreen(isFullscreen); } ); } if (hd) { var $videoHD = $(".html5boxHD", $videoControls); $videoHD .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_hd.png" + "')", "background-position": (isHd ? "right" : "left") + " center", } ) .bind( eClick, function () { isHd = !isHd; $(this).css({ "background-position": (isHd ? "right" : "left") + " center" }); parentInst.isHd = isHd; var isPaused = $videoObj.get(0).isPaused; $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); if (!isPaused) { $videoObj.get(0).play(); } else if (!isIPhone) { $videoObj.get(0).pause(); } } ); } $videoObj.get(0).volume = defaultvolume; var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; var volume = $videoObj.get(0).volume; $videoObj.get(0).volume = volume / 2 + 0.1; if ($videoObj.get(0).volume === volume / 2 + 0.1) { $videoObj.get(0).volume = volume; var $videoVolume = $(".html5boxVolume", $videoControls); var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); $videoVolume.css({ display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) }).hover( function () { clearTimeout(hideVolumeBarTimeoutId); var volume = $videoObj.get(0).volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); $videoVolumeBar.show(); }, function () { clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId = setTimeout( function () { $videoVolumeBar.hide(); }, 1e3 ); } ); $videoVolumeButton .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", "background-position": "top " + (volume > 0 ? "left" : "right"), } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { var volume = $videoObj.get(0).volume; if (volume > 0) { volumeSaved = volume; volume = 0; } else { volume = volumeSaved; } var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); $videoVolumeButton.css({ "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY }); $videoObj.get(0).volume = volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); } ); $videoVolumeBar.css( { display: "none", position: "absolute", left: 4, bottom: "100%", width: 24, height: 80, "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)", } ); $videoVolumeBarBg.css({ display: "block", position: "relative", width: 10, height: 68, margin: 7, cursor: "pointer", "background-color": "#222" }); $videoVolumeBarActive.css({ display: "block", position: "absolute", bottom: 0, left: 0, width: "100%", height: "100%", "background-color": "#fcc500" }); $videoVolumeBarBg .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; $videoVolumeBarBg.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; } ); } ) .bind( eCancel, function () { $videoVolumeBarBg.unbind(eMove); } ); } var calcTimeFormat = function (seconds) { var h0 = Math.floor(seconds / 3600); var h = 10 > h0 ? "0" + h0 : h0; var m0 = Math.floor((seconds - h0 * 3600) / 60); var m = 10 > m0 ? "0" + m0 : m0; var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); var s = 10 > s0 ? "0" + s0 : s0; var r = m + ":" + s; if (h0 > 0) { r = h + ":" + r; } return r; }; if (hideplaybutton) { $videoPlay.hide(); } if (hidecontrols) { $videoControls.hide(); } var onVideoPlay = function () { if (!hideplaybutton) { $videoPlay.hide(); } if (!hidecontrols) { $videoBtnPlay.hide(); $videoBtnPause.show(); } }; var onVideoPause = function () { if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoEnded = function () { $(window).trigger("html5lightbox.videoended"); if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoUpdate = function () { var curTime = $videoObj.get(0).currentTime; if (curTime) { $videoTimeCurrent.text(calcTimeFormat(curTime)); var duration = $videoObj.get(0).duration; if (duration) { $videoTimeTotal.text(calcTimeFormat(duration)); if (!sliderDragging) { var sliderW = $videoSeeker.width(); var pos = Math.round((sliderW * curTime) / duration); $videoSeekerPlay.css({ width: pos }); $videoSeekerHandler.css({ left: pos }); } } } }; var onVideoProgress = function () { if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { var sliderW = $videoSeeker.width(); $videoSeekerBuffer.css({ width: Math.round((sliderW * $videoObj.get(0).buffered.end(0)) / $videoObj.get(0).duration) }); } }; try { $videoObj.bind("play", onVideoPlay); $videoObj.bind("pause", onVideoPause); $videoObj.bind("ended", onVideoEnded); $videoObj.bind("timeupdate", onVideoUpdate); $videoObj.bind("progress", onVideoProgress); } catch (e) { } }; })(jQuery); jQuery(".tsvg-html5lightbox-931430").html5lightbox931430({},'931430'); jQuery(function() { jQuery('.tsvg-section-931430').fadeIn(); var tsvgFancyHoverInverse931430 = 'Default'; tsvgFancyHoverInverse931430 = tsvgFancyHoverInverse931430 == 'Default' ? false : true; jQuery('.tsvg-fancy-blocks-list-931430 > li').each(function() { jQuery(this).hoverdir({hoverDelay: 50, inverse:tsvgFancyHoverInverse931430}); }); }); clearInterval(tsvgFancyInterval931430); } }, tsvgFancyReference931430 = ( function tsvgFancySameCall931430() { tsvgFancyInterval931430 = setInterval(tsvgFancyIntervalFunction931430, 1000); return tsvgFancySameCall931430; }() );
'); }else{ jQuery('.tsvg-section-931430 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } var svg = document.querySelector('.btn-lg svg'), svgPath = new Proxy({ y: null, smoothing: null }, { set(target, key, value) { target[key] = value; if(target.y !== null && target.smoothing !== null) { svg.innerHTML = getPath(target.y, target.smoothing, null); } return true; }, get(target, key) { return target[key]; } }); svgPath.y = 20; svgPath.smoothing = 0; } } jQuery('.tsvg-section-931430 .btn-lg').click(function (e) { let max_heigth =jQuery('.tsvg-main-content-931430').height(); let main_length = jQuery('.tsvg-main-content-931430 figure ul li').length; tsvgPaginationLoad931430 = 'false'; if(jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ tsvgPaginationLoad931430 = 'true'; } jQuery('.tsvg-main-content-931430').css({'max-height': max_heigth+'px','transition':'unset'}); setTimeout(() => { jQuery('.tsvg-main-content-931430').css({'transition':'max-height 3s ease-in-out','max-height':main_length+'000vh'}); }, 100); tsvgPaginationCreate931430(jQuery('.tsvg-main-content-931430 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage); if(jQuery('.tsvg-section-931430 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'){ jQuery('.tsvg-section-931430 .btn-lg').addClass('animate'); setTimeout(function(){ jQuery('.tsvg-section-931430 .btn-lg').removeClass('animate'); },700); } if(!jQuery('.tsvg-section-931430 .btn-lg').hasClass('loading')&&(jQuery('.tsvg-section-931430 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery('.tsvg-section-931430 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5')&&jQuery('.tsvg-section-931430 .tsvg-pagination-pages-wrapper svg').length) { jQuery('.tsvg-section-931430 .btn-lg').addClass('loading'); setTimeout(() => { svg.innerHTML = getPath(0, 0, [ [3, 14], [8, 19], [21, 6] ]); }, 1000 / 2); setTimeout(() => { jQuery('.tsvg-section-931430 .btn-lg').removeClass('loading'); if(jQuery('.tsvg-section-931430 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ jQuery('.tsvg-section-931430 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
  • '+load_text+'
'); }else{ jQuery('.tsvg-section-931430 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } }, 2000 ); } }) tsvgPaginationCreate931430(jQuery('.tsvg-section-931430 .tsvg-main-content-931430 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage) } } function tsvgNewPagination931430(){ var interval_pag_fn_931430 = setInterval(setPagina_931430, 100); function setPagina_931430() { if( typeof(jQuery) != "undefined" && jQuery != null){ if( jQuery('.tsvg-main-content-931430').attr("data-pagination")=='pagination'){ tsvgPaginationGenerate931430(); } if( jQuery('.tsvg-main-content-931430').attr("data-pagination")=='load-more'){ tsvgPaginationGenerate931430(); } clearInterval(interval_pag_fn_931430); } } } tsvgNewPagination931430(); function tsvgPaginationGenerate(){ tsvgPaginationGenerate931430(); } function getPoint(point, i, a, smoothing) { let cp = (current, previous, next, reverse) => { let p = previous || current, n = next || current, o = { length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)), angle: Math.atan2(n[1] - p[1], n[0] - p[0]) }, angle = o.angle + (reverse ? Math.PI : 0), length = o.length * smoothing; return [current[0] + Math.cos(angle) * length, current[1] + Math.sin(angle) * length]; }, cps = cp(a[i - 1], a[i - 2], point, false), cpe = cp(point, a[i - 1], a[i + 1], true); return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`; } function getPath(update, smoothing, pointsNew) { let points = pointsNew ? pointsNew : [ [4, 12], [12, update], [20, 12] ], d = points.reduce((acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${getPoint(point, i, a, smoothing)}`, ''); return ``; }

Event Trailers

" + "
" + "
" + "
" + "" + "" + "" + "
" + "
" + "" + "
" + "
" ); inst.options.positionFixed = inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; inst.$lightbox.css({ position: inst.options.positionFixed ? "fixed" : "absolute" }); inst.$lightbox.appendTo("body"); inst.$lightboxBox = $("#tsvg-fancy-html5-lightbox-box", inst.$lightbox); inst.$elem = $("#tsvg-fancy-html5-elem-box", inst.$lightbox); inst.$elemWrap = $("#tsvg-fancy-html5-elem-wrap", inst.$lightbox); inst.$loading = $("#tsvg-fancy-html5-loading", inst.$lightbox); inst.$error = $("#tsvg-fancy-html5-error", inst.$lightbox); inst.$image = $("#tsvg-fancy-html5-image", inst.$lightbox); var elemText = ""; if (inst.options.titlestyle == "left") { inst.$elem.prepend(elemText); } else { inst.$elem.append(elemText); } inst.$elemData = $("#tsvg-fancy-html5-elem-data-box", inst.$lightbox); inst.$text = $("#tsvg-fancy-html5-text", inst.$lightbox); if (inst.options.borderradius > 0) { inst.$elem.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); if (inst.options.titlestyle == "inside") { inst.$elemWrap.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); } else if (inst.options.titlestyle == "bottom") { inst.$elemWrap.css( { "border-top-left-radius": inst.options.borderradius + "px", "-moz-top-left-border-radius": inst.options.borderradius + "px", "-webkit-top-left-border-radius": inst.options.borderradius + "px", "border-top-right-radius": inst.options.borderradius + "px", "-moz-top-right-border-radius": inst.options.borderradius + "px", "-webkit-top-right-border-radius": inst.options.borderradius + "px", } ); inst.$elemData.css( { "border-bottom-left-radius": inst.options.borderradius + "px", "-moz-top-bottom-border-radius": inst.options.borderradius + "px", "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", "border-bottom-right-radius": inst.options.borderradius + "px", "-moz-bottom-right-border-radius": inst.options.borderradius + "px", "-webkit-bottom-right-border-radius": inst.options.borderradius + "px", } ); } } if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { inst.$lightboxBox.css({ "background-color": inst.options.bgcolor }); if (inst.options.titlestyle == "right") { inst.$elemWrap.css({ position: "relative", float: "left" }); inst.$elemData.css({ position: "relative", overflow: "hidden", padding: inst.options.bordersize + "px" }); } else { inst.$elemWrap.css({ position: "relative", overflow: "hidden" }); inst.$elemData.css({ position: "relative", float: "left", padding: inst.options.bordersize + "px" }); } } else if (inst.options.titlestyle == "inside") { inst.$elemData.css({ position: "absolute", margin: inst.options.bordersize + "px", bottom: 0, left: 0, "background-color": "#333", "background-color": "rgba(51, 51, 51, 0.6)" }); inst.$text.css({ padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" }); } else { inst.$elemData.css( { position: "relative", width: "100%", height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", padding: "0 0 " + inst.options.bordersize + "px" + " 0", "background-color": inst.options.bgcolor, "text-align": "left", } ); inst.$text.css({ margin: "0 " + inst.options.bordersize + "px" }); } if (inst.options.fullscreenmode) { inst.$lightbox.append( "
" + "
" ); inst.$next = $(".tsvg-fancy-html5-next-fullscreen", inst.$lightbox); inst.$prev = $(".tsvg-fancy-html5-prev-fullscreen", inst.$lightbox); inst.$lightboxBox.append( "
" + "
" ); inst.$nextbottom = $(".tsvg-fancy-html5-next-bottom-fullscreen", inst.$lightbox); inst.$prevbottom = $(".tsvg-fancy-html5-prev-bottom-fullscreen", inst.$lightbox); inst.$nextbottom.click( function () { inst.nextArrowClicked(); } ); inst.$prevbottom.click( function () { inst.prevArrowClicked(); } ); inst.$lightbox.append( "
" ); inst.$close = $("#tsvg-fancy-html5-close-fullscreen", inst.$lightbox); } else { inst.$elemWrap.append( "" + "" ); inst.$next = $("#tsvg-fancy-html5-next", inst.$lightbox); inst.$prev = $("#tsvg-fancy-html5-prev", inst.$lightbox); if ((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) { inst.$lightboxBox.append( "
" + "
" ); inst.$nexttouch = $(".tsvg-fancy-html5-next-touch", inst.$lightbox); inst.$prevtouch = $(".tsvg-fancy-html5-prev-touch", inst.$lightbox); inst.$nexttouch.click( function () { inst.nextArrowClicked(); } ); inst.$prevtouch.click( function () { inst.prevArrowClicked(); } ); } inst.$lightboxBox.append( "" ); inst.$close = $("#tsvg-fancy-html5-close", inst.$lightbox); } if (inst.options.showsocial) { var socialCode = '"; inst.$lightboxBox.append(socialCode); $(".tsvg-fancy-html5-social-btn", inst.$lightbox).click( function () { var shareUrl = window.location.href + (0 > window.location.href.indexOf("?") ? "?" : "&") + "html5lightboxshare=" + encodeURIComponent(inst.currentElem[ELEM_HREF]); var shareTitle = inst.currentElem[ELEM_TITLE]; var shareMedia = inst.currentElem[ELEM_HREF]; if (inst.currentElem[ELEM_TYPE] == 0) { shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); } else if (inst.currentElem[ELEM_TYPE] == 3) { shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; } else { var lightboxLink = $('.tsvg-html5lightbox-744241[href="' + inst.currentElem[ELEM_HREF] + '"]'); if (lightboxLink.length > 0) if (lightboxLink.data("shareimage") && lightboxLink.data("shareimage").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); } else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); } else { var lightboxImg = $("img", lightboxLink); if (lightboxImg.length > 0) { shareMedia = inst.absoluteUrl(lightboxImg.attr("src")); } } } var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; if ($(this).hasClass("tsvg-fancy-html5-social-facebook")) { window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-twitter")) { window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-pinterest")) { window.open( "https://pinterest.com/pin/create/bookmarklet/?media=" + encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank" ); } return false; } ); } inst.$watermark = $("#tsvg-fancy-html5-watermark", inst.$lightbox); if (inst.options.stamp) { inst.$watermark.html(""); } else if (inst.options.watermark) { var html = ""; if (inst.options.watermarklink) { html = "" + html + ""; } inst.$watermark.html(html); } if (inst.options.closeonoverlay) { $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).click(inst.finish); } inst.$close.click(inst.finish); inst.$next.click( function () { inst.nextArrowClicked(); } ); inst.$prev.click( function () { inst.prevArrowClicked(); } ); $(window).resize( function () { clearTimeout(inst.options.resizeTimeout); inst.options.resizeTimeout = setTimeout( function () { inst.resizeWindow(); }, 500 ); } ); $(window).scroll( function () { inst.scrollBox(); } ); $(window).bind( "orientationchange", function (e) { if (inst.options.isMobile) { inst.resizeWindow(); } } ); if (inst.options.isIPhone) { inst.options.windowInnerHeight = window.innerHeight; setInterval( function () { if (inst.options.windowInnerHeight != window.innerHeight) { inst.options.windowInnerHeight = window.innerHeight; inst.resizeWindow(); } }, 500 ); } if (inst.options.enabletouchswipe) { inst.enableSwipe(); } }; inst.slideTimer = function (interval, callback, updatecallback) { let timerInstance = this, updateinterval = 50, updateTimerId = null, runningTime = 0, paused = false, started = false, startedandpaused = false; timerInstance.timeout = interval; this.pause = function () { if (started) { paused = true; clearInterval(updateTimerId); } }; this.resume = function (forceresume) { if (startedandpaused && !forceresume) { return; } startedandpaused = false; if (started && paused) { paused = false; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); } }; this.stop = function () { clearInterval(updateTimerId); if (updatecallback) { updatecallback(-1); } runningTime = 0; paused = false; started = false; }; this.start = function () { runningTime = 0; paused = false; started = true; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); }; this.startandpause = function () { runningTime = 0; paused = true; started = true; startedandpaused = true; }; return this; }; inst.updateTimer = function (percent) { var w = Math.round(percent * 100); if (w > 100) { w = 100; } if (0 > w ) { w = 0; } $("#tsvg-fancy-html5-timer", inst.$lightbox).css({ display: "block", width: w + "%" }); }; inst.initSlide = function () { inst.autosliding = false; inst.slideTimeout = inst.slideTimer( inst.options.slideinterval, function () { inst.gotoSlide(-1); }, inst.options.showtimer ? function (percent) { inst.updateTimer(percent); } : null ); if (inst.options.autoslide) { inst.slideTimeout.stop(); inst.autosliding = true; } }; inst.nextArrowClicked = function () { if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") { window[inst.options.onlastarrowclicked](); } } inst.gotoSlide(-1); }; inst.prevArrowClicked = function () { if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && typeof window[inst.options.onfirstarrowclicked] == "function") { window[inst.options.onfirstarrowclicked](); } } inst.gotoSlide(-2); }; inst.calcNextPrevElem = function () { inst.options.nextElem = -1; inst.options.prevElem = -1; inst.options.inGroup = false; inst.options.groupIndex = 0; inst.options.groupCount = 0; var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; for (var i = 0; inst.elemArray.length > i; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (i == inst.options.curElem) { inst.options.groupIndex = inst.options.groupCount; } inst.options.groupCount++; } } var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; if (curGroup != undefined && curGroup != null) { for (j = inst.options.curElem + 1;inst.elemArray.length > j; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } if (0 > inst.options.nextElem) { for (j = 0; inst.options.curElem > j ; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } } if (inst.options.nextElem >= 0) { for (j = inst.options.curElem - 1; j >= 0; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } if (0 > inst.options.prevElem ) { for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } } } } if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) { inst.options.inGroup = true; } }; inst.calcBoxPosition = function (initW, initH) { var boxW = initW + 2 * inst.options.bordersize; var boxH = initH + 2 * inst.options.bordersize; var winH = window.innerHeight ? window.innerHeight : $(window).height(); var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); if (inst.options.titlestyle == "bottom") { boxT -= Math.round(inst.options.barheight / 2); } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; if (topmargin > boxT) { boxT = topmargin; } if (inst.options.insideiframe && window.self != window.top) { if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; var parentscroll = parent.window.document.body.scrollTop; boxT = topmargin; boxT += parentscroll > iframetop ? parentscroll - iframetop : 0; } } return [boxW, boxH, boxT]; }; inst.hideNavArrows = function () { var showPrev = false; var showNext = false; if (inst.options.inGroup) { if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showPrev = true; } if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showNext = true; } } if (showPrev) { inst.$prev.removeClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$prev.addClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.addClass("tsvg-fancy-html5-hide"); } } if (showNext) { inst.$next.removeClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$next.addClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.addClass("tsvg-fancy-html5-hide"); } } }; inst.clickHandler = function (event) { var $this = $(this); var dataoptions = {}; if (jQuery(event.target).prop("tagName") == 'A') { let link = jQuery(event.target).attr('href'); if (jQuery(event.target).attr('target') == '_blank') { window.open(link); } else { window.location.assign(link) } return false; } $.each( $this.data(), function (key, value) { dataoptions[key.toLowerCase()] = value; } ); inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i ; i++) { if (inst.elemArray[i][ELEM_ID] == $this.data("tsvgid")) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; if (inst.options.iequirksmode) { inst.$lightboxBox.css({ top: boxT }); } else { inst.$lightboxBox.css({ "margin-top": boxT }); } if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.loadThumbnail = function (src, index) { let inst_img_elem = document.createElement('img'); inst_img_elem.src = src; inst_img_elem.addEventListener('load', function () { if (inst.options.thumbwidth / inst.options.thumbheight >= inst_img_elem.naturalWidth / inst_img_elem.naturalHeight ) { inst_img_elem.setAttribute("style","width:100%;") } else { inst_img_elem.setAttribute("style","height:100%;") } $(".tsvg-fancy-html5-nav-thumb").eq(index).html(inst_img_elem); }) inst_img_elem.addEventListener('error', function () { console.log('error') }) }; inst.matchGroup = function (curGroup, elemGroup) { if (!curGroup || !elemGroup) { return false; } var curs = curGroup.split(":"); var elems = elemGroup.split(":"); var result = false; for (var i in curs) { if ($.inArray(curs[i], elems) > -1) { result = true; break; } } return result; }; inst.showNavigation = function () { if (!inst.options.shownavigation) { return; } if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) { return; } var i; var showNav = false; var group = inst.currentElem[ELEM_GROUP]; for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { showNav = true; break; } } } if (!showNav) { return; } inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; if ($(".tsvg-fancy-html5-nav").length > 0) { return; } var check_bool = $('.tsvg-fancy-blocks-container').attr('data-tsvg-shn'); if (check_bool === 'false') { return } $("body").append( "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); if (TS_VG_FG_Show_Nav == "true") { var index = 0; } for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { $(".tsvg-fancy-html5-nav-list").append( "
'
" ); this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index) index++; } } } $(".tsvg-fancy-html5-nav-thumb").hover( function () { $(this).css({ opacity: 1 }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor }); }, function () { $(this).css({ opacity: inst.options.thumbopacity }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor }); } ); $(".tsvg-fancy-html5-nav-thumb").click( function () { var index = $(this).data("arrayindex"); if (index >= 0) { inst.gotoSlide(index); } } ); inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); $(".tsvg-fancy-html5-nav-list") .css({ display: "block", position: "relative", "margin-left": 0, width: inst.options.totalwidth + "px" }) .append("
"); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); $navPrev.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; if (marginLeft >= 0) { marginLeft = 0; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (maskWidth - inst.options.totalwidth >= marginLeft ) { $navNext.css({ "background-position": "center left" }); } else { $navNext.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); $navNext.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; if (maskWidth - inst.options.totalwidth >= marginLeft) { marginLeft = maskWidth - inst.options.totalwidth; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (marginLeft >= 0) { $navPrev.css({ "background-position": "center left" }); } else { $navPrev.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.loadElem = function (elem) { inst.currentElem = elem; inst.showing = true; inst.showNavigation(); inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); inst.$loading.show(); if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") { window[inst.options.onshowitem](elem); } switch (elem[ELEM_TYPE]) { case 0: var imgLoader = new Image(); $(imgLoader).load( function () { inst.showImage(elem, imgLoader.width, imgLoader.height); } ); $(imgLoader).error( function () { inst.showError(); } ); imgLoader.src = elem[ELEM_HREF]; break; case 1: inst.showSWF(elem); break; case 2: case 8: inst.showVideo(elem); break; case 3: case 4: case 9: case 11: inst.showYoutubeVimeo(elem); break; case 5: inst.showPDF(elem); break; case 6: inst.showMP3(elem); break; case 7: inst.showWeb(elem); break; case 10: inst.showDiv(elem); break; } if (inst.options.googleanalyticsaccount && window._gaq) { window._gaq.push(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]); } }; inst.loadCurElem = function () { inst.loadElem(inst.elemArray[inst.options.curElem]); }; inst.showError = function () { inst.$loading.hide(); inst.resizeLightbox( inst.options.errorwidth, inst.options.errorheight, true, function () { inst.$error.show(); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); } ); }; inst.calcTextWidth = function (objW) { return objW - 36; }; (inst.showTitle = function (w, t, description) { if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: w + "px" }); } var text = ""; if (inst.options.showtitle) { if (t && t.length > 0) { text += t; } } if (inst.options.inGroup) { if (inst.options.showtitleprefix) { text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", inst.options.groupCount) + " " + text; } jQuery("#tsvg-fancy-html5-elem-data-box").css("display", "none"); if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT != "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (TotalSoft_GV_FG_PD == "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "block"); } if (TotalSoft_GV_FG_PT == "true") { jQuery(".tsvg-fancy-popup-text").css("display", "inline-block"); } if (TotalSoft_GV_FG_PD != "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "none"); } if (TotalSoft_GV_FG_PT != "true") { jQuery(".tsvg-fancy-popup-text").css("display", "none"); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD != "true") { jQuery("#tsvg-fancy-html5-text").css("display", "none"); } } if (inst.options.showdescription && description && description.length > 0) { inst.$text.html(text); } if (inst.options.inGroup && inst.options.showplaybutton) { if (inst.autosliding) { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } else { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); } $("#tsvg-fancy-html5-play", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } ); $("#tsvg-fancy-html5-pause", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.autosliding = false; } } ); } $("#tsvg-fancy-html5-social", inst.$lightbox).show(); }); (inst.showImage = function (elem, imgW, imgH) { var elemW, elemH; if (elem[ELEM_WIDTH]) { elemW = elem[ELEM_WIDTH]; } else { elemW = imgW; elem[ELEM_WIDTH] = imgW; } if (elem[ELEM_HEIGHT]) { elemH = elem[ELEM_HEIGHT]; } else { elemH = imgH; elem[ELEM_HEIGHT] = imgH; } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, inst.options.imagekeepratio); inst.resizeLightbox( sizeObj.w, sizeObj.h, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : ""; inst.$image.show(); inst.$image.html( "
" + timercode + "
" ); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }); inst.showSWF = function (elem) { var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); inst.embedFlash($("#tsvg-html5lightbox-swf"), elem[ELEM_HREF], "window", { width: dataW, height: dataH }); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showVideo = function (elem) { inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var isHTML5 = false; if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || (inst.options.isIE9 && inst.options.useflashonie9) || (inst.options.isIE10 && inst.options.useflashonie10) || (inst.options.isIE11 && inst.options.useflashonie11)) { isHTML5 = false; } else if (inst.options.isMobile) { isHTML5 = true; } else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) { if ((!inst.options.isFirefox && !inst.options.isOpera) || ((inst.options.isFirefox || inst.options.isOpera) && (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM]))) { isHTML5 = true; } } if (isHTML5) { var videoSrc = elem[ELEM_HREF]; if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) { videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; } inst.embedHTML5Video($("#tsvg-html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo); } else { var videoFile = elem[ELEM_HREF]; if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") { videoFile = inst.options.htmlfolder + videoFile; } inst.embedFlash( $("#tsvg-html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { width: dataW, height: dataH, jsobjectname: "html5Lightbox", hidecontrols: inst.options.videohidecontrols ? "1" : "0", hideplaybutton: "0", videofile: videoFile, hdfile: "", ishd: "0", defaultvolume: inst.options.defaultvideovolume, autoplay: inst.options.autoplay ? "1" : "0", loop: inst.options.loopvideo ? "1" : "0", errorcss: ".html5box-error" + inst.options.errorcss, id: 0, } ); } inst.$elem.show(); inst.showData(); } ); }; inst.loadNext = function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } }; inst.getYoutubeParams = function (href) { var result = {}; if (0 > href.indexOf("?") ) { return result; } var params = href.substring(href.indexOf("?") + 1).split("&"); for (var i = 0;params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2 && value[0].toLowerCase() != "v") { result[value[0].toLowerCase()] = value[1]; } } return result; }; inst.getYoutubeId = function (href) { var youtubeId = ""; var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(shorts\/)|(watch\??v?=?))([^#\&\?]*).*/; var match = href.match(regExp); if (match && match[match.length -1].length == 11) { youtubeId = match[match.length -1]; } return youtubeId; }; inst.prepareYoutubeHref = function (href) { let youtubeId = inst.getYoutubeId(href), protocol = "https:", result = protocol + "//www.youtube.com/embed/" + youtubeId, params = this.getYoutubeParams(href), first = true; for (var key in params) { if (first) { result += "?"; first = false; } else { result += "&"; } result += key + "=" + params[key]; } return result; }; inst.prepareDailymotionHref = function (href) { if (href.match(/\:\/\/.*(dai\.ly)/i)) { var protocol = "https:"; var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; href = protocol + "" + id; } return href; }; inst.showYoutubeVimeo = function (elem) { var tsvg_autoplay = jQuery('.tsvg-main-content-' + id).attr('data-tsvg-autoplay'); inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var href = elem[ELEM_HREF]; var youtubeid = ""; if (elem[ELEM_TYPE] == 3) { youtubeid = inst.getYoutubeId(href); href = inst.prepareYoutubeHref(href); if (tsvg_autoplay == "true") { href += "?autoplay=1&mute=1" } else { href += "?autoplay=0&mute=0" } } if (elem[ELEM_TYPE] == 9) { href = inst.prepareDailymotionHref(href); } if (inst.options.autoplay) { if (elem[ELEM_TYPE] == 4) { if (href.indexOf('player.vimeo.com/video/') > -1) { if (tsvg_autoplay == "true") { href += "?autoplay=1&muted=1"; } } } } if (inst.options.loopvideo) { href += 0 > href.indexOf("?") ? "?" : "&"; switch (elem[ELEM_TYPE]) { case 3: href += "loop=1&playlist=" + youtubeid; break; case 4: case 9: href += "loop=1"; break; case 11: href += "endVideoBehavior=loop"; break; } } if (elem[ELEM_TYPE] == 3 && Totalsoft_FG_ShVAutoPl == "true") { if (0 > href.indexOf("?")) { href += "?wmode=transparent&rel=0&iv_load_policy=3"; } else { href += "&wmode=transparent&rel=0&iv_load_policy=3"; } if (inst.options.videohidecontrols) { href += "&controls=0&showinfo=0"; } href += "&mute=1&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname; } if (href.indexOf('.mp4') > -1) { let autoplay_bool = tsvg_autoplay == "true" ? "autoplay muted" : ""; $("#tsvg-html5lightbox-video").html(''); } else { $("#tsvg-html5lightbox-video").html(""); } inst.$elem.show(); inst.showData(); if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") { new YT.Player( "html5boxiframevideo", { events: { onStateChange: function (event) { if (event.data == YT.PlayerState.ENDED) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } }, }, } ); } else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { var vimeoIframe = $("#html5boxiframevideo")[0]; var vimeoPlayer = $f(vimeoIframe); vimeoPlayer.addEvent( "ready", function () { vimeoPlayer.addEvent( "finish", function (id) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); } ); } } ); }; inst.showPDF = function (elem) { }; inst.showMP3 = function (elem) { }; inst.showDiv = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var divID = elem[ELEM_HREF]; if ($(divID).length > 0) { $("#tsvg-html5lightbox-div").html($(divID).html()); } else { $("#tsvg-html5lightbox-div").html("
The specified div ID does not exist.
"); } inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showWeb = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); var tsvgRumbleCheck = elem[ELEM_HREF].indexOf('rumble.com/') > -1 ? 'sandbox="allow-scripts"' : ''; dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); $("#tsvg-html5lightbox-web").html(""); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.scrollBox = function () { }; inst.resizeWindow = function () { if (!inst.currentElem) { return; } if (!inst.options.responsive) { return; } var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); if (inst.options.responsivebarheight) { if (inst.options.smallscreenheight >= winH) { inst.options.barheight = inst.options.barheightonsmallheight; } else { inst.options.barheight = inst.options.barheightoriginal; } if (inst.options.titlestyle == "bottom" && inst.options.barautoheight != "auto") { inst.$elemData.css({ height: inst.options.barheight + "px", "max-height": inst.options.barheight + "px" }); } } var elemW, elemH, keepratio; if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; keepratio = false; } else { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; if (inst.currentElem[ELEM_TYPE] == 0) { keepratio = inst.options.imagekeepratio; } else { keepratio = true; } } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, keepratio); var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: sizeObj.w + "px" }); } if (0 >= $(".tsvg-fancy-html5-nav").length ) { return; } $(".tsvg-fancy-html5-nav-list").css({ "margin-left": 0 }); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.calcElemSize = function (sizeObj, keepratio) { if (!inst.options.responsive) { return sizeObj; } var winWidth = $(window).width(); winWidth = winWidth ? winWidth : $(document).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); winH = winH ? winH : $(document).height(); if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) { sizeObj.w = (sizeObj.w * 100) / inst.options.imagepercentage; } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; if (inst.options.titlestyle == "bottom") { h0 -= inst.options.barheight; } if (((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && inst.options.sidetobottomscreenwidth >= winWidth ) || (inst.options.notkeepratioonsmallheight && inst.options.smallscreenheight >= winH)) { keepratio = false; } if (sizeObj.h > h0) { if (keepratio) { sizeObj.w = Math.round((sizeObj.w * h0) / sizeObj.h); } sizeObj.h = h0; } var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; if ( (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth) || (((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) ) { w0 -= 64; } if (sizeObj.w > w0) { if (keepratio) { sizeObj.h = Math.round((sizeObj.h * w0) / sizeObj.w); } sizeObj.w = w0; } return sizeObj; }; inst.showData = function () { if (inst.$text.text().length > 0) { inst.$elemData.show(); } if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$lightboxBox.css({ height: "auto" }); } if (inst.$text.text().length > 0 && inst.options.titlestyle == "bottom") { inst.$elemData.css({ "max-height": inst.options.barheight + "px" }); } $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).css({ height: Math.max($(window).height(), $(document).height()) }); $(window).trigger("html5lightbox.lightboxopened"); }; inst.resizeLightbox = function (elemW, elemH, bAnimate, onFinish) { inst.hideNavArrows(); var boxPos = inst.calcBoxPosition(elemW, elemH); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$loading.hide(); inst.$watermark.hide(); if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastitem && window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") { window[inst.options.onlastitem](inst.currentElem); } } if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") { window[inst.options.onfirstitem](inst.currentElem); } } if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { inst.$elem.bind( "mouseenter mousemove", function () { if ((inst.options.arrowloop && inst.options.prevElem >= 0) || (!inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.curElem > inst.options.prevElem )) { inst.$prev.fadeIn(); } if ((inst.options.arrowloop && inst.options.nextElem >= 0) || (!inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem)) { inst.$next.fadeIn(); } } ); inst.$elem.bind( "mouseleave", function () { inst.$next.fadeOut(); inst.$prev.fadeOut(); } ); } inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) { speed = 0; } inst.$lightboxBox.animate({ width: boxW }, speed).animate( { height: boxH }, speed, function () { inst.onAnimateFinish(onFinish); } ); } else { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) { speed = 0; } inst.$lightboxBox.css({ width: boxW, height: "auto", "min-width": boxW - 15 }); inst.$elemWrap.animate({ width: boxW, "min-width": boxW - 15 }, speed).animate( { height: boxH, "min-height": boxH - 15 }, speed, function () { inst.onAnimateFinish(onFinish); } ); } }; inst.onAnimateFinish = function (onFinish) { inst.$loading.show(); inst.$watermark.show(); inst.$close.show(); inst.$elem.css({ "background-color": inst.options.bgcolor }); onFinish(); }; inst.reset = function () { if (inst.options.stamp) { inst.$watermark.hide(); } inst.showing = false; inst.$image.empty(); inst.$text.empty(); inst.$error.hide(); inst.$loading.hide(); inst.$image.hide(); if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$elemData.hide(); } if (!inst.options.fullscreenmode) { inst.$close.hide(); } inst.$elem.css({ "background-color": "" }); }; inst.resetNavigation = function () { inst.options.navheight = 0; $(".tsvg-fancy-html5-nav").remove(); }; inst.finish = function () { if ($("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).length) { $("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).attr("src", ""); } $("head") .find("style") .each( function () { if ($(this).data("creator") == "tsvg-fancy-html5box-html5-lightbox") { $(this).remove(); } } ); inst.slideTimeout.stop(); inst.reset(); inst.resetNavigation(); inst.$lightbox.remove(); $("#tsvg-fancy-html5box-html5-lightbox").remove(); inst.showObjects(); if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") { window[inst.options.oncloselightbox](inst.currentElem); } if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") { inst.onLightboxClosed(inst.currentElem); } }; inst.pauseSlide = function () { }; inst.playSlide = function () { }; inst.gotoSlide = function (slide) { if (slide == -1) { if (0 > inst.options.nextElem ) { return; } inst.options.curElem = inst.options.nextElem; } else if (slide == -2) { if (0 > inst.options.prevElem ) { return; } inst.options.curElem = inst.options.prevElem; } else if (slide >= 0) { inst.options.curElem = slide; } if (inst.autosliding) { inst.slideTimeout.stop(); } inst.calcNextPrevElem(); inst.reset(); inst.loadCurElem(); }; inst.enableSwipe = function () { inst.$elem.html5lightboxTouchSwipe744241( { preventWebBrowser: false, swipeLeft: function () { inst.gotoSlide(-1); }, swipeRight: function () { inst.gotoSlide(-2); }, } ); }; inst.hideObjects = function () { $("select, embed, object").css({ visibility: "hidden" }); }; inst.showObjects = function () { $("select, embed, object").css({ visibility: "visible" }); }; inst.embedHTML5Video = function ($container, src, autoplay, loopvideo) { let embedVideoPoster = (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : ""), embedVideoControls = (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : ""); $container.html( "
" ); if (!inst.options.nativehtml5controls) { $("video", $container).data("src", src); $("video", $container).lightboxHTML5VideoControls744241(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume); } $("video", $container) .unbind("ended") .bind( "ended", function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); }; inst.embedFlash = function ($container, src, wmode, flashVars) { if (inst.options.flashInstalled) { var htmlOptions = { pluginspage: "", quality: "high", allowFullScreen: "true", allowScriptAccess: "always", type: "application/x-shockwave-flash" }; htmlOptions.width = "100%"; htmlOptions.height = "100%"; htmlOptions.src = src; htmlOptions.flashVars = $.param(flashVars); htmlOptions.wmode = wmode; var htmlString = ""; for (var key in htmlOptions) { htmlString += key + "=" + htmlOptions[key] + " "; } $container.html(""); } else { $container.html( "
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
" ); } }; inst.checkType = function (href) { if (!href) { return -1; } if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) { return 0; } if (href.match(/[^\.]\.(swf)\s*$/i)) { return 1; } if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) { return 4; } if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) { return 3; } if (href.match(/\:\/\/.*(vimeo\.com)/i)) { return 4; } if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) { return 9; } if (href.match(/[^\.]\.(pdf)\s*$/i)) { return 5; } if (href.match(/[^\.]\.(mp3)\s*$/i)) { return 6; } if (href.match(/[^\.]\.(flv)\s*$/i)) { return 8; } if (href.match(/\#\w+/i)) { return 10; } if (href.match(/\:\/\/.*(wistia)/i)) { return 11; } return 7; }; inst.getURLParams = function () { var result = {}; var params = window.location.search.substring(1).split("&"); for (var i = 0; params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2) { result[value[0].toLowerCase()] = unescape(value[1]); } } return result; }; inst.absoluteUrl = function (href) { var link = document.createElement("a"); link.href = href; return link.protocol + "//" + link.host + link.pathname + link.search + link.hash; }; inst.showLightbox = function (type, href, title, width, height, webm, ogg, thumbnail, description) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)); }; inst.addItem = function (href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { type = mediatype && mediatype >= 0 ? mediatype : inst.checkType(href); inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)); }; inst.showItem = function (href) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i; i++) { if (inst.elemArray[i][ELEM_HREF] == href) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.unbind("click").click(inst.clickHandler); inst.each( function () { var self = $(this); if (self.data("autoopen")) { setTimeout( function () { self.click(); }, self.data("autoopendelay") ? self.data("autoopendelay") : 0 ); return false; } } ); var urlParams = inst.getURLParams(); if ("html5lightboxshare" in urlParams) { var shareUrl = decodeURIComponent(urlParams["html5lightboxshare"]); var shareLink = $('.tsvg-html5lightbox-744241[href="' + shareUrl + '"]'); if (shareLink.length > 0) { shareLink.click(); } } return inst; }; })(jQuery); (function ($) { $.fn.html5lightboxTouchSwipe744241 = function (options) { var defaults = { preventWebBrowser: false, swipeLeft: null, swipeRight: null, swipeTop: null, swipeBottom: null }; if (options) { $.extend(defaults, options); } return this.each( function () { var startX = -1, startY = -1; var curX = -1, curY = -1; function touchStart(event) { var e = event.originalEvent; if (e.targetTouches.length >= 1) { startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchMove(event) { if (defaults.preventWebBrowser) { event.preventDefault(); } var e = event.originalEvent; if (e.targetTouches.length >= 1) { curX = e.targetTouches[0].pageX; curY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchEnd(event) { if (curX > 0 || curY > 0) { triggerHandler(); touchCancel(event); } else { touchCancel(event); } } function touchCancel(event) { startX = -1; startY = -1; curX = -1; curY = -1; } function triggerHandler() { if (Math.abs(curX - startX) > Math.abs(curY - startY)) { if (curX > startX) { if (defaults.swipeRight) { defaults.swipeRight.call(); } } else { if (defaults.swipeLeft) { defaults.swipeLeft.call(); } } } else if (curY > startY) { if (defaults.swipeBottom) { defaults.swipeBottom.call(); } } else if (defaults.swipeTop) { defaults.swipeTop.call(); } } try { $(this).bind("touchstart", touchStart); $(this).bind("touchmove", touchMove); $(this).bind("touchend", touchEnd); $(this).bind("touchcancel", touchCancel); } catch (e) { } } ); }; })(jQuery); (function ($) { $.fn.lightboxHTML5VideoControls744241 = function (skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { var isTouch = "ontouchstart" in window; var eStart = isTouch ? "touchstart" : "mousedown"; var eMove = isTouch ? "touchmove" : "mousemove"; var eCancel = isTouch ? "touchcancel" : "mouseup"; var eClick = "click"; var BUTTON_SIZE = 32; var BAR_HEIGHT = isTouch ? 48 : 36; var hideControlsTimerId = null; var hideVolumeBarTimeoutId = null; var sliderDragging = false; var isFullscreen = false; var userActive = true; var isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; var isHd = $(this).data("ishd"); var hd = $(this).data("hd"); var src = $(this).data("src"); var $videoObj = $(this); $videoObj.get(0).removeAttribute("controls"); if (isIPhone) { var h = $videoObj.height() - BAR_HEIGHT; $videoObj.css({ height: h }); } var $videoPlay = $("
"); if (!isIPhone) { $videoObj.after($videoPlay); $videoPlay .css( { position: "absolute", top: "50%", left: "50%", display: "block", cursor: "pointer", width: 64, height: 64, "margin-left": -32, "margin-top": -32, "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", "background-position": "center center", "background-repeat": "no-repeat", } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); } var $videoFullscreenBg = $("
"); var $videoControls = $( "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); $videoObj.after($videoControls); $videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({ display: "none", position: "fixed", left: 0, top: 0, bottom: 0, right: 0, "z-index": 2147483647 }); $videoControls.css({ display: "block", position: "absolute", width: "100%", height: BAR_HEIGHT, left: 0, bottom: 0, right: 0, "max-width": "640px", margin: "0 auto" }); var userActivate = function () { userActive = true; }; $videoObj .bind( eClick, function () { userActive = true; } ) .hover( function () { userActive = true; }, function () { userActive = false; } ); if (!hidecontrols) { setInterval( function () { if (userActive) { $videoControls.show(); userActive = false; clearTimeout(hideControlsTimerId); hideControlsTimerId = setTimeout( function () { if (!$videoObj.get(0).paused) { $videoControls.fadeOut(); } }, 5e3 ); } }, 250 ); } $(".html5boxVideoControlsBg", $videoControls).css({ display: "block", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)" }); $(".html5boxPlayPause", $videoControls).css({ display: "block", position: "relative", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), float: "left" }); var $videoBtnPlay = $(".html5boxPlay", $videoControls); var $videoBtnPause = $(".html5boxPause", $videoControls); $videoBtnPlay .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top left", } ) .hover( function () { $(this).css({ "background-position": "bottom left" }); }, function () { $(this).css({ "background-position": "top left" }); } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); $videoBtnPause .css( { display: "none", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top right", } ) .hover( function () { $(this).css({ "background-position": "bottom right" }); }, function () { $(this).css({ "background-position": "top right" }); } ) .bind( eClick, function () { $videoObj.get(0).pause(); } ); var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); var $videoSeeker = $(".html5boxSeeker", $videoControls); var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); $videoTimeCurrent.css( { display: "block", position: "relative", float: "left", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoTimeTotal.css( { display: "block", position: "relative", float: "right", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoSeeker .css({ display: "block", cursor: "pointer", overflow: "hidden", position: "relative", height: "10px", "background-color": "#222", margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" }) .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); $videoSeeker.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); } ); } ) .bind( eCancel, function () { $videoSeeker.unbind(eMove); } ); $videoSeekerBuffer.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#444" }); $videoSeekerPlay.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#fcc500" }); if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { var switchScreen = function (fullscreen) { if (fullscreen) { if ($videoObj.get(0).requestFullscreen) { $videoObj.get(0).requestFullscreen(); } else if ($videoObj.get(0).webkitRequestFullScreen) { $videoObj.get(0).webkitRequestFullScreen(); } else if ($videoObj.get(0).mozRequestFullScreen) { $videoObj.get(0).mozRequestFullScreen(); } else if ($videoObj.get(0).webkitEnterFullScreen) { $videoObj.get(0).webkitEnterFullScreen(); } if ($videoObj.get(0).msRequestFullscreen) { $videoObj.get(0).msRequestFullscreen(); } } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }; var switchScreenCSS = function (fullscreen) { $videoControls.css({ position: fullscreen ? "fixed" : "absolute" }); var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); $videoFullscreen.css({ "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY }); $videoFullscreenBg.css({ display: fullscreen ? "block" : "none" }); if (fullscreen) { $(document).bind("mousemove", userActivate); $videoControls.css({ "z-index": 2147483647 }); } else { $(document).unbind("mousemove", userActivate); $videoControls.css({ "z-index": "" }); } }; document.addEventListener( "fullscreenchange", function () { isFullscreen = document.fullscreen; switchScreenCSS(document.fullscreen); }, false ); document.addEventListener( "mozfullscreenchange", function () { isFullscreen = document.mozFullScreen; switchScreenCSS(document.mozFullScreen); }, false ); document.addEventListener( "webkitfullscreenchange", function () { isFullscreen = document.webkitIsFullScreen; switchScreenCSS(document.webkitIsFullScreen); }, false ); $videoObj.get(0).addEventListener( "webkitbeginfullscreen", function () { isFullscreen = true; }, false ); $videoObj.get(0).addEventListener( "webkitendfullscreen", function () { isFullscreen = false; }, false ); $("head").append(""); var $videoFullscreen = $(".html5boxFullscreen", $videoControls); $videoFullscreen .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", "background-position": "left top", } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { isFullscreen = !isFullscreen; switchScreen(isFullscreen); } ); } if (hd) { var $videoHD = $(".html5boxHD", $videoControls); $videoHD .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_hd.png" + "')", "background-position": (isHd ? "right" : "left") + " center", } ) .bind( eClick, function () { isHd = !isHd; $(this).css({ "background-position": (isHd ? "right" : "left") + " center" }); parentInst.isHd = isHd; var isPaused = $videoObj.get(0).isPaused; $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); if (!isPaused) { $videoObj.get(0).play(); } else if (!isIPhone) { $videoObj.get(0).pause(); } } ); } $videoObj.get(0).volume = defaultvolume; var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; var volume = $videoObj.get(0).volume; $videoObj.get(0).volume = volume / 2 + 0.1; if ($videoObj.get(0).volume === volume / 2 + 0.1) { $videoObj.get(0).volume = volume; var $videoVolume = $(".html5boxVolume", $videoControls); var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); $videoVolume.css({ display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) }).hover( function () { clearTimeout(hideVolumeBarTimeoutId); var volume = $videoObj.get(0).volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); $videoVolumeBar.show(); }, function () { clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId = setTimeout( function () { $videoVolumeBar.hide(); }, 1e3 ); } ); $videoVolumeButton .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", "background-position": "top " + (volume > 0 ? "left" : "right"), } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { var volume = $videoObj.get(0).volume; if (volume > 0) { volumeSaved = volume; volume = 0; } else { volume = volumeSaved; } var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); $videoVolumeButton.css({ "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY }); $videoObj.get(0).volume = volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); } ); $videoVolumeBar.css( { display: "none", position: "absolute", left: 4, bottom: "100%", width: 24, height: 80, "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)", } ); $videoVolumeBarBg.css({ display: "block", position: "relative", width: 10, height: 68, margin: 7, cursor: "pointer", "background-color": "#222" }); $videoVolumeBarActive.css({ display: "block", position: "absolute", bottom: 0, left: 0, width: "100%", height: "100%", "background-color": "#fcc500" }); $videoVolumeBarBg .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; $videoVolumeBarBg.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; } ); } ) .bind( eCancel, function () { $videoVolumeBarBg.unbind(eMove); } ); } var calcTimeFormat = function (seconds) { var h0 = Math.floor(seconds / 3600); var h = 10 > h0 ? "0" + h0 : h0; var m0 = Math.floor((seconds - h0 * 3600) / 60); var m = 10 > m0 ? "0" + m0 : m0; var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); var s = 10 > s0 ? "0" + s0 : s0; var r = m + ":" + s; if (h0 > 0) { r = h + ":" + r; } return r; }; if (hideplaybutton) { $videoPlay.hide(); } if (hidecontrols) { $videoControls.hide(); } var onVideoPlay = function () { if (!hideplaybutton) { $videoPlay.hide(); } if (!hidecontrols) { $videoBtnPlay.hide(); $videoBtnPause.show(); } }; var onVideoPause = function () { if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoEnded = function () { $(window).trigger("html5lightbox.videoended"); if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoUpdate = function () { var curTime = $videoObj.get(0).currentTime; if (curTime) { $videoTimeCurrent.text(calcTimeFormat(curTime)); var duration = $videoObj.get(0).duration; if (duration) { $videoTimeTotal.text(calcTimeFormat(duration)); if (!sliderDragging) { var sliderW = $videoSeeker.width(); var pos = Math.round((sliderW * curTime) / duration); $videoSeekerPlay.css({ width: pos }); $videoSeekerHandler.css({ left: pos }); } } } }; var onVideoProgress = function () { if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { var sliderW = $videoSeeker.width(); $videoSeekerBuffer.css({ width: Math.round((sliderW * $videoObj.get(0).buffered.end(0)) / $videoObj.get(0).duration) }); } }; try { $videoObj.bind("play", onVideoPlay); $videoObj.bind("pause", onVideoPause); $videoObj.bind("ended", onVideoEnded); $videoObj.bind("timeupdate", onVideoUpdate); $videoObj.bind("progress", onVideoProgress); } catch (e) { } }; })(jQuery); jQuery(".tsvg-html5lightbox-744241").html5lightbox744241({},'744241'); jQuery(function() { jQuery('.tsvg-section-744241').fadeIn(); var tsvgFancyHoverInverse744241 = 'Default'; tsvgFancyHoverInverse744241 = tsvgFancyHoverInverse744241 == 'Default' ? false : true; jQuery('.tsvg-fancy-blocks-list-744241 > li').each(function() { jQuery(this).hoverdir({hoverDelay: 50, inverse:tsvgFancyHoverInverse744241}); }); }); clearInterval(tsvgFancyInterval744241); } }, tsvgFancyReference744241 = ( function tsvgFancySameCall744241() { tsvgFancyInterval744241 = setInterval(tsvgFancyIntervalFunction744241, 1000); return tsvgFancySameCall744241; }() );
'); }else{ jQuery('.tsvg-section-744241 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } var svg = document.querySelector('.btn-lg svg'), svgPath = new Proxy({ y: null, smoothing: null }, { set(target, key, value) { target[key] = value; if(target.y !== null && target.smoothing !== null) { svg.innerHTML = getPath(target.y, target.smoothing, null); } return true; }, get(target, key) { return target[key]; } }); svgPath.y = 20; svgPath.smoothing = 0; } } jQuery('.tsvg-section-744241 .btn-lg').click(function (e) { let max_heigth =jQuery('.tsvg-main-content-744241').height(); let main_length = jQuery('.tsvg-main-content-744241 figure ul li').length; tsvgPaginationLoad744241 = 'false'; if(jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ tsvgPaginationLoad744241 = 'true'; } jQuery('.tsvg-main-content-744241').css({'max-height': max_heigth+'px','transition':'unset'}); setTimeout(() => { jQuery('.tsvg-main-content-744241').css({'transition':'max-height 3s ease-in-out','max-height':main_length+'000vh'}); }, 100); tsvgPaginationCreate744241(jQuery('.tsvg-main-content-744241 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage); if(jQuery('.tsvg-section-744241 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'){ jQuery('.tsvg-section-744241 .btn-lg').addClass('animate'); setTimeout(function(){ jQuery('.tsvg-section-744241 .btn-lg').removeClass('animate'); },700); } if(!jQuery('.tsvg-section-744241 .btn-lg').hasClass('loading')&&(jQuery('.tsvg-section-744241 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery('.tsvg-section-744241 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5')&&jQuery('.tsvg-section-744241 .tsvg-pagination-pages-wrapper svg').length) { jQuery('.tsvg-section-744241 .btn-lg').addClass('loading'); setTimeout(() => { svg.innerHTML = getPath(0, 0, [ [3, 14], [8, 19], [21, 6] ]); }, 1000 / 2); setTimeout(() => { jQuery('.tsvg-section-744241 .btn-lg').removeClass('loading'); if(jQuery('.tsvg-section-744241 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ jQuery('.tsvg-section-744241 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
  • '+load_text+'
'); }else{ jQuery('.tsvg-section-744241 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } }, 2000 ); } }) tsvgPaginationCreate744241(jQuery('.tsvg-section-744241 .tsvg-main-content-744241 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage) } } function tsvgNewPagination744241(){ var interval_pag_fn_744241 = setInterval(setPagina_744241, 100); function setPagina_744241() { if( typeof(jQuery) != "undefined" && jQuery != null){ if( jQuery('.tsvg-main-content-744241').attr("data-pagination")=='pagination'){ tsvgPaginationGenerate744241(); } if( jQuery('.tsvg-main-content-744241').attr("data-pagination")=='load-more'){ tsvgPaginationGenerate744241(); } clearInterval(interval_pag_fn_744241); } } } tsvgNewPagination744241(); function tsvgPaginationGenerate(){ tsvgPaginationGenerate744241(); } function getPoint(point, i, a, smoothing) { let cp = (current, previous, next, reverse) => { let p = previous || current, n = next || current, o = { length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)), angle: Math.atan2(n[1] - p[1], n[0] - p[0]) }, angle = o.angle + (reverse ? Math.PI : 0), length = o.length * smoothing; return [current[0] + Math.cos(angle) * length, current[1] + Math.sin(angle) * length]; }, cps = cp(a[i - 1], a[i - 2], point, false), cpe = cp(point, a[i - 1], a[i + 1], true); return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`; } function getPath(update, smoothing, pointsNew) { let points = pointsNew ? pointsNew : [ [4, 12], [12, update], [20, 12] ], d = points.reduce((acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${getPoint(point, i, a, smoothing)}`, ''); return ``; }
" + "
" + "
" + "
" + "" + "" + "" + "
" + "
" + "" + "
" + "" ); inst.options.positionFixed = inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; inst.$lightbox.css({ position: inst.options.positionFixed ? "fixed" : "absolute" }); inst.$lightbox.appendTo("body"); inst.$lightboxBox = $("#tsvg-fancy-html5-lightbox-box", inst.$lightbox); inst.$elem = $("#tsvg-fancy-html5-elem-box", inst.$lightbox); inst.$elemWrap = $("#tsvg-fancy-html5-elem-wrap", inst.$lightbox); inst.$loading = $("#tsvg-fancy-html5-loading", inst.$lightbox); inst.$error = $("#tsvg-fancy-html5-error", inst.$lightbox); inst.$image = $("#tsvg-fancy-html5-image", inst.$lightbox); var elemText = ""; if (inst.options.titlestyle == "left") { inst.$elem.prepend(elemText); } else { inst.$elem.append(elemText); } inst.$elemData = $("#tsvg-fancy-html5-elem-data-box", inst.$lightbox); inst.$text = $("#tsvg-fancy-html5-text", inst.$lightbox); if (inst.options.borderradius > 0) { inst.$elem.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); if (inst.options.titlestyle == "inside") { inst.$elemWrap.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); } else if (inst.options.titlestyle == "bottom") { inst.$elemWrap.css( { "border-top-left-radius": inst.options.borderradius + "px", "-moz-top-left-border-radius": inst.options.borderradius + "px", "-webkit-top-left-border-radius": inst.options.borderradius + "px", "border-top-right-radius": inst.options.borderradius + "px", "-moz-top-right-border-radius": inst.options.borderradius + "px", "-webkit-top-right-border-radius": inst.options.borderradius + "px", } ); inst.$elemData.css( { "border-bottom-left-radius": inst.options.borderradius + "px", "-moz-top-bottom-border-radius": inst.options.borderradius + "px", "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", "border-bottom-right-radius": inst.options.borderradius + "px", "-moz-bottom-right-border-radius": inst.options.borderradius + "px", "-webkit-bottom-right-border-radius": inst.options.borderradius + "px", } ); } } if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { inst.$lightboxBox.css({ "background-color": inst.options.bgcolor }); if (inst.options.titlestyle == "right") { inst.$elemWrap.css({ position: "relative", float: "left" }); inst.$elemData.css({ position: "relative", overflow: "hidden", padding: inst.options.bordersize + "px" }); } else { inst.$elemWrap.css({ position: "relative", overflow: "hidden" }); inst.$elemData.css({ position: "relative", float: "left", padding: inst.options.bordersize + "px" }); } } else if (inst.options.titlestyle == "inside") { inst.$elemData.css({ position: "absolute", margin: inst.options.bordersize + "px", bottom: 0, left: 0, "background-color": "#333", "background-color": "rgba(51, 51, 51, 0.6)" }); inst.$text.css({ padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" }); } else { inst.$elemData.css( { position: "relative", width: "100%", height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", padding: "0 0 " + inst.options.bordersize + "px" + " 0", "background-color": inst.options.bgcolor, "text-align": "left", } ); inst.$text.css({ margin: "0 " + inst.options.bordersize + "px" }); } if (inst.options.fullscreenmode) { inst.$lightbox.append( "
" + "
" ); inst.$next = $(".tsvg-fancy-html5-next-fullscreen", inst.$lightbox); inst.$prev = $(".tsvg-fancy-html5-prev-fullscreen", inst.$lightbox); inst.$lightboxBox.append( "
" + "
" ); inst.$nextbottom = $(".tsvg-fancy-html5-next-bottom-fullscreen", inst.$lightbox); inst.$prevbottom = $(".tsvg-fancy-html5-prev-bottom-fullscreen", inst.$lightbox); inst.$nextbottom.click( function () { inst.nextArrowClicked(); } ); inst.$prevbottom.click( function () { inst.prevArrowClicked(); } ); inst.$lightbox.append( "
" ); inst.$close = $("#tsvg-fancy-html5-close-fullscreen", inst.$lightbox); } else { inst.$elemWrap.append( "" + "" ); inst.$next = $("#tsvg-fancy-html5-next", inst.$lightbox); inst.$prev = $("#tsvg-fancy-html5-prev", inst.$lightbox); if ((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) { inst.$lightboxBox.append( "
" + "
" ); inst.$nexttouch = $(".tsvg-fancy-html5-next-touch", inst.$lightbox); inst.$prevtouch = $(".tsvg-fancy-html5-prev-touch", inst.$lightbox); inst.$nexttouch.click( function () { inst.nextArrowClicked(); } ); inst.$prevtouch.click( function () { inst.prevArrowClicked(); } ); } inst.$lightboxBox.append( "" ); inst.$close = $("#tsvg-fancy-html5-close", inst.$lightbox); } if (inst.options.showsocial) { var socialCode = '"; inst.$lightboxBox.append(socialCode); $(".tsvg-fancy-html5-social-btn", inst.$lightbox).click( function () { var shareUrl = window.location.href + (0 > window.location.href.indexOf("?") ? "?" : "&") + "html5lightboxshare=" + encodeURIComponent(inst.currentElem[ELEM_HREF]); var shareTitle = inst.currentElem[ELEM_TITLE]; var shareMedia = inst.currentElem[ELEM_HREF]; if (inst.currentElem[ELEM_TYPE] == 0) { shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); } else if (inst.currentElem[ELEM_TYPE] == 3) { shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; } else { var lightboxLink = $('.tsvg-html5lightbox-610795[href="' + inst.currentElem[ELEM_HREF] + '"]'); if (lightboxLink.length > 0) if (lightboxLink.data("shareimage") && lightboxLink.data("shareimage").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); } else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); } else { var lightboxImg = $("img", lightboxLink); if (lightboxImg.length > 0) { shareMedia = inst.absoluteUrl(lightboxImg.attr("src")); } } } var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; if ($(this).hasClass("tsvg-fancy-html5-social-facebook")) { window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-twitter")) { window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-pinterest")) { window.open( "https://pinterest.com/pin/create/bookmarklet/?media=" + encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank" ); } return false; } ); } inst.$watermark = $("#tsvg-fancy-html5-watermark", inst.$lightbox); if (inst.options.stamp) { inst.$watermark.html(""); } else if (inst.options.watermark) { var html = ""; if (inst.options.watermarklink) { html = "" + html + ""; } inst.$watermark.html(html); } if (inst.options.closeonoverlay) { $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).click(inst.finish); } inst.$close.click(inst.finish); inst.$next.click( function () { inst.nextArrowClicked(); } ); inst.$prev.click( function () { inst.prevArrowClicked(); } ); $(window).resize( function () { clearTimeout(inst.options.resizeTimeout); inst.options.resizeTimeout = setTimeout( function () { inst.resizeWindow(); }, 500 ); } ); $(window).scroll( function () { inst.scrollBox(); } ); $(window).bind( "orientationchange", function (e) { if (inst.options.isMobile) { inst.resizeWindow(); } } ); if (inst.options.isIPhone) { inst.options.windowInnerHeight = window.innerHeight; setInterval( function () { if (inst.options.windowInnerHeight != window.innerHeight) { inst.options.windowInnerHeight = window.innerHeight; inst.resizeWindow(); } }, 500 ); } if (inst.options.enabletouchswipe) { inst.enableSwipe(); } }; inst.slideTimer = function (interval, callback, updatecallback) { let timerInstance = this, updateinterval = 50, updateTimerId = null, runningTime = 0, paused = false, started = false, startedandpaused = false; timerInstance.timeout = interval; this.pause = function () { if (started) { paused = true; clearInterval(updateTimerId); } }; this.resume = function (forceresume) { if (startedandpaused && !forceresume) { return; } startedandpaused = false; if (started && paused) { paused = false; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); } }; this.stop = function () { clearInterval(updateTimerId); if (updatecallback) { updatecallback(-1); } runningTime = 0; paused = false; started = false; }; this.start = function () { runningTime = 0; paused = false; started = true; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); }; this.startandpause = function () { runningTime = 0; paused = true; started = true; startedandpaused = true; }; return this; }; inst.updateTimer = function (percent) { var w = Math.round(percent * 100); if (w > 100) { w = 100; } if (0 > w ) { w = 0; } $("#tsvg-fancy-html5-timer", inst.$lightbox).css({ display: "block", width: w + "%" }); }; inst.initSlide = function () { inst.autosliding = false; inst.slideTimeout = inst.slideTimer( inst.options.slideinterval, function () { inst.gotoSlide(-1); }, inst.options.showtimer ? function (percent) { inst.updateTimer(percent); } : null ); if (inst.options.autoslide) { inst.slideTimeout.stop(); inst.autosliding = true; } }; inst.nextArrowClicked = function () { if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") { window[inst.options.onlastarrowclicked](); } } inst.gotoSlide(-1); }; inst.prevArrowClicked = function () { if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && typeof window[inst.options.onfirstarrowclicked] == "function") { window[inst.options.onfirstarrowclicked](); } } inst.gotoSlide(-2); }; inst.calcNextPrevElem = function () { inst.options.nextElem = -1; inst.options.prevElem = -1; inst.options.inGroup = false; inst.options.groupIndex = 0; inst.options.groupCount = 0; var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; for (var i = 0; inst.elemArray.length > i; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (i == inst.options.curElem) { inst.options.groupIndex = inst.options.groupCount; } inst.options.groupCount++; } } var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; if (curGroup != undefined && curGroup != null) { for (j = inst.options.curElem + 1;inst.elemArray.length > j; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } if (0 > inst.options.nextElem) { for (j = 0; inst.options.curElem > j ; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } } if (inst.options.nextElem >= 0) { for (j = inst.options.curElem - 1; j >= 0; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } if (0 > inst.options.prevElem ) { for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } } } } if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) { inst.options.inGroup = true; } }; inst.calcBoxPosition = function (initW, initH) { var boxW = initW + 2 * inst.options.bordersize; var boxH = initH + 2 * inst.options.bordersize; var winH = window.innerHeight ? window.innerHeight : $(window).height(); var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); if (inst.options.titlestyle == "bottom") { boxT -= Math.round(inst.options.barheight / 2); } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; if (topmargin > boxT) { boxT = topmargin; } if (inst.options.insideiframe && window.self != window.top) { if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; var parentscroll = parent.window.document.body.scrollTop; boxT = topmargin; boxT += parentscroll > iframetop ? parentscroll - iframetop : 0; } } return [boxW, boxH, boxT]; }; inst.hideNavArrows = function () { var showPrev = false; var showNext = false; if (inst.options.inGroup) { if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showPrev = true; } if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showNext = true; } } if (showPrev) { inst.$prev.removeClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$prev.addClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.addClass("tsvg-fancy-html5-hide"); } } if (showNext) { inst.$next.removeClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$next.addClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.addClass("tsvg-fancy-html5-hide"); } } }; inst.clickHandler = function (event) { var $this = $(this); var dataoptions = {}; if (jQuery(event.target).prop("tagName") == 'A') { let link = jQuery(event.target).attr('href'); if (jQuery(event.target).attr('target') == '_blank') { window.open(link); } else { window.location.assign(link) } return false; } $.each( $this.data(), function (key, value) { dataoptions[key.toLowerCase()] = value; } ); inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i ; i++) { if (inst.elemArray[i][ELEM_ID] == $this.data("tsvgid")) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; if (inst.options.iequirksmode) { inst.$lightboxBox.css({ top: boxT }); } else { inst.$lightboxBox.css({ "margin-top": boxT }); } if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.loadThumbnail = function (src, index) { let inst_img_elem = document.createElement('img'); inst_img_elem.src = src; inst_img_elem.addEventListener('load', function () { if (inst.options.thumbwidth / inst.options.thumbheight >= inst_img_elem.naturalWidth / inst_img_elem.naturalHeight ) { inst_img_elem.setAttribute("style","width:100%;") } else { inst_img_elem.setAttribute("style","height:100%;") } $(".tsvg-fancy-html5-nav-thumb").eq(index).html(inst_img_elem); }) inst_img_elem.addEventListener('error', function () { console.log('error') }) }; inst.matchGroup = function (curGroup, elemGroup) { if (!curGroup || !elemGroup) { return false; } var curs = curGroup.split(":"); var elems = elemGroup.split(":"); var result = false; for (var i in curs) { if ($.inArray(curs[i], elems) > -1) { result = true; break; } } return result; }; inst.showNavigation = function () { if (!inst.options.shownavigation) { return; } if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) { return; } var i; var showNav = false; var group = inst.currentElem[ELEM_GROUP]; for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { showNav = true; break; } } } if (!showNav) { return; } inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; if ($(".tsvg-fancy-html5-nav").length > 0) { return; } var check_bool = $('.tsvg-fancy-blocks-container').attr('data-tsvg-shn'); if (check_bool === 'false') { return } $("body").append( "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); if (TS_VG_FG_Show_Nav == "true") { var index = 0; } for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { $(".tsvg-fancy-html5-nav-list").append( "
'
" ); this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index) index++; } } } $(".tsvg-fancy-html5-nav-thumb").hover( function () { $(this).css({ opacity: 1 }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor }); }, function () { $(this).css({ opacity: inst.options.thumbopacity }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor }); } ); $(".tsvg-fancy-html5-nav-thumb").click( function () { var index = $(this).data("arrayindex"); if (index >= 0) { inst.gotoSlide(index); } } ); inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); $(".tsvg-fancy-html5-nav-list") .css({ display: "block", position: "relative", "margin-left": 0, width: inst.options.totalwidth + "px" }) .append("
"); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); $navPrev.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; if (marginLeft >= 0) { marginLeft = 0; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (maskWidth - inst.options.totalwidth >= marginLeft ) { $navNext.css({ "background-position": "center left" }); } else { $navNext.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); $navNext.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; if (maskWidth - inst.options.totalwidth >= marginLeft) { marginLeft = maskWidth - inst.options.totalwidth; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (marginLeft >= 0) { $navPrev.css({ "background-position": "center left" }); } else { $navPrev.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.loadElem = function (elem) { inst.currentElem = elem; inst.showing = true; inst.showNavigation(); inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); inst.$loading.show(); if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") { window[inst.options.onshowitem](elem); } switch (elem[ELEM_TYPE]) { case 0: var imgLoader = new Image(); $(imgLoader).load( function () { inst.showImage(elem, imgLoader.width, imgLoader.height); } ); $(imgLoader).error( function () { inst.showError(); } ); imgLoader.src = elem[ELEM_HREF]; break; case 1: inst.showSWF(elem); break; case 2: case 8: inst.showVideo(elem); break; case 3: case 4: case 9: case 11: inst.showYoutubeVimeo(elem); break; case 5: inst.showPDF(elem); break; case 6: inst.showMP3(elem); break; case 7: inst.showWeb(elem); break; case 10: inst.showDiv(elem); break; } if (inst.options.googleanalyticsaccount && window._gaq) { window._gaq.push(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]); } }; inst.loadCurElem = function () { inst.loadElem(inst.elemArray[inst.options.curElem]); }; inst.showError = function () { inst.$loading.hide(); inst.resizeLightbox( inst.options.errorwidth, inst.options.errorheight, true, function () { inst.$error.show(); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); } ); }; inst.calcTextWidth = function (objW) { return objW - 36; }; (inst.showTitle = function (w, t, description) { if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: w + "px" }); } var text = ""; if (inst.options.showtitle) { if (t && t.length > 0) { text += t; } } if (inst.options.inGroup) { if (inst.options.showtitleprefix) { text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", inst.options.groupCount) + " " + text; } jQuery("#tsvg-fancy-html5-elem-data-box").css("display", "none"); if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT != "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (TotalSoft_GV_FG_PD == "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "block"); } if (TotalSoft_GV_FG_PT == "true") { jQuery(".tsvg-fancy-popup-text").css("display", "inline-block"); } if (TotalSoft_GV_FG_PD != "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "none"); } if (TotalSoft_GV_FG_PT != "true") { jQuery(".tsvg-fancy-popup-text").css("display", "none"); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD != "true") { jQuery("#tsvg-fancy-html5-text").css("display", "none"); } } if (inst.options.showdescription && description && description.length > 0) { inst.$text.html(text); } if (inst.options.inGroup && inst.options.showplaybutton) { if (inst.autosliding) { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } else { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); } $("#tsvg-fancy-html5-play", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } ); $("#tsvg-fancy-html5-pause", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.autosliding = false; } } ); } $("#tsvg-fancy-html5-social", inst.$lightbox).show(); }); (inst.showImage = function (elem, imgW, imgH) { var elemW, elemH; if (elem[ELEM_WIDTH]) { elemW = elem[ELEM_WIDTH]; } else { elemW = imgW; elem[ELEM_WIDTH] = imgW; } if (elem[ELEM_HEIGHT]) { elemH = elem[ELEM_HEIGHT]; } else { elemH = imgH; elem[ELEM_HEIGHT] = imgH; } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, inst.options.imagekeepratio); inst.resizeLightbox( sizeObj.w, sizeObj.h, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : ""; inst.$image.show(); inst.$image.html( "
" + timercode + "
" ); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }); inst.showSWF = function (elem) { var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); inst.embedFlash($("#tsvg-html5lightbox-swf"), elem[ELEM_HREF], "window", { width: dataW, height: dataH }); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showVideo = function (elem) { inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var isHTML5 = false; if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || (inst.options.isIE9 && inst.options.useflashonie9) || (inst.options.isIE10 && inst.options.useflashonie10) || (inst.options.isIE11 && inst.options.useflashonie11)) { isHTML5 = false; } else if (inst.options.isMobile) { isHTML5 = true; } else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) { if ((!inst.options.isFirefox && !inst.options.isOpera) || ((inst.options.isFirefox || inst.options.isOpera) && (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM]))) { isHTML5 = true; } } if (isHTML5) { var videoSrc = elem[ELEM_HREF]; if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) { videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; } inst.embedHTML5Video($("#tsvg-html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo); } else { var videoFile = elem[ELEM_HREF]; if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") { videoFile = inst.options.htmlfolder + videoFile; } inst.embedFlash( $("#tsvg-html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { width: dataW, height: dataH, jsobjectname: "html5Lightbox", hidecontrols: inst.options.videohidecontrols ? "1" : "0", hideplaybutton: "0", videofile: videoFile, hdfile: "", ishd: "0", defaultvolume: inst.options.defaultvideovolume, autoplay: inst.options.autoplay ? "1" : "0", loop: inst.options.loopvideo ? "1" : "0", errorcss: ".html5box-error" + inst.options.errorcss, id: 0, } ); } inst.$elem.show(); inst.showData(); } ); }; inst.loadNext = function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } }; inst.getYoutubeParams = function (href) { var result = {}; if (0 > href.indexOf("?") ) { return result; } var params = href.substring(href.indexOf("?") + 1).split("&"); for (var i = 0;params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2 && value[0].toLowerCase() != "v") { result[value[0].toLowerCase()] = value[1]; } } return result; }; inst.getYoutubeId = function (href) { var youtubeId = ""; var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(shorts\/)|(watch\??v?=?))([^#\&\?]*).*/; var match = href.match(regExp); if (match && match[match.length -1].length == 11) { youtubeId = match[match.length -1]; } return youtubeId; }; inst.prepareYoutubeHref = function (href) { let youtubeId = inst.getYoutubeId(href), protocol = "https:", result = protocol + "//www.youtube.com/embed/" + youtubeId, params = this.getYoutubeParams(href), first = true; for (var key in params) { if (first) { result += "?"; first = false; } else { result += "&"; } result += key + "=" + params[key]; } return result; }; inst.prepareDailymotionHref = function (href) { if (href.match(/\:\/\/.*(dai\.ly)/i)) { var protocol = "https:"; var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; href = protocol + "" + id; } return href; }; inst.showYoutubeVimeo = function (elem) { var tsvg_autoplay = jQuery('.tsvg-main-content-' + id).attr('data-tsvg-autoplay'); inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var href = elem[ELEM_HREF]; var youtubeid = ""; if (elem[ELEM_TYPE] == 3) { youtubeid = inst.getYoutubeId(href); href = inst.prepareYoutubeHref(href); if (tsvg_autoplay == "true") { href += "?autoplay=1&mute=1" } else { href += "?autoplay=0&mute=0" } } if (elem[ELEM_TYPE] == 9) { href = inst.prepareDailymotionHref(href); } if (inst.options.autoplay) { if (elem[ELEM_TYPE] == 4) { if (href.indexOf('player.vimeo.com/video/') > -1) { if (tsvg_autoplay == "true") { href += "?autoplay=1&muted=1"; } } } } if (inst.options.loopvideo) { href += 0 > href.indexOf("?") ? "?" : "&"; switch (elem[ELEM_TYPE]) { case 3: href += "loop=1&playlist=" + youtubeid; break; case 4: case 9: href += "loop=1"; break; case 11: href += "endVideoBehavior=loop"; break; } } if (elem[ELEM_TYPE] == 3 && Totalsoft_FG_ShVAutoPl == "true") { if (0 > href.indexOf("?")) { href += "?wmode=transparent&rel=0&iv_load_policy=3"; } else { href += "&wmode=transparent&rel=0&iv_load_policy=3"; } if (inst.options.videohidecontrols) { href += "&controls=0&showinfo=0"; } href += "&mute=1&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname; } if (href.indexOf('.mp4') > -1) { let autoplay_bool = tsvg_autoplay == "true" ? "autoplay muted" : ""; $("#tsvg-html5lightbox-video").html(''); } else { $("#tsvg-html5lightbox-video").html(""); } inst.$elem.show(); inst.showData(); if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") { new YT.Player( "html5boxiframevideo", { events: { onStateChange: function (event) { if (event.data == YT.PlayerState.ENDED) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } }, }, } ); } else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { var vimeoIframe = $("#html5boxiframevideo")[0]; var vimeoPlayer = $f(vimeoIframe); vimeoPlayer.addEvent( "ready", function () { vimeoPlayer.addEvent( "finish", function (id) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); } ); } } ); }; inst.showPDF = function (elem) { }; inst.showMP3 = function (elem) { }; inst.showDiv = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var divID = elem[ELEM_HREF]; if ($(divID).length > 0) { $("#tsvg-html5lightbox-div").html($(divID).html()); } else { $("#tsvg-html5lightbox-div").html("
The specified div ID does not exist.
"); } inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showWeb = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); var tsvgRumbleCheck = elem[ELEM_HREF].indexOf('rumble.com/') > -1 ? 'sandbox="allow-scripts"' : ''; dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); $("#tsvg-html5lightbox-web").html(""); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.scrollBox = function () { }; inst.resizeWindow = function () { if (!inst.currentElem) { return; } if (!inst.options.responsive) { return; } var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); if (inst.options.responsivebarheight) { if (inst.options.smallscreenheight >= winH) { inst.options.barheight = inst.options.barheightonsmallheight; } else { inst.options.barheight = inst.options.barheightoriginal; } if (inst.options.titlestyle == "bottom" && inst.options.barautoheight != "auto") { inst.$elemData.css({ height: inst.options.barheight + "px", "max-height": inst.options.barheight + "px" }); } } var elemW, elemH, keepratio; if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; keepratio = false; } else { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; if (inst.currentElem[ELEM_TYPE] == 0) { keepratio = inst.options.imagekeepratio; } else { keepratio = true; } } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, keepratio); var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: sizeObj.w + "px" }); } if (0 >= $(".tsvg-fancy-html5-nav").length ) { return; } $(".tsvg-fancy-html5-nav-list").css({ "margin-left": 0 }); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.calcElemSize = function (sizeObj, keepratio) { if (!inst.options.responsive) { return sizeObj; } var winWidth = $(window).width(); winWidth = winWidth ? winWidth : $(document).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); winH = winH ? winH : $(document).height(); if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) { sizeObj.w = (sizeObj.w * 100) / inst.options.imagepercentage; } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; if (inst.options.titlestyle == "bottom") { h0 -= inst.options.barheight; } if (((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && inst.options.sidetobottomscreenwidth >= winWidth ) || (inst.options.notkeepratioonsmallheight && inst.options.smallscreenheight >= winH)) { keepratio = false; } if (sizeObj.h > h0) { if (keepratio) { sizeObj.w = Math.round((sizeObj.w * h0) / sizeObj.h); } sizeObj.h = h0; } var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; if ( (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth) || (((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) ) { w0 -= 64; } if (sizeObj.w > w0) { if (keepratio) { sizeObj.h = Math.round((sizeObj.h * w0) / sizeObj.w); } sizeObj.w = w0; } return sizeObj; }; inst.showData = function () { if (inst.$text.text().length > 0) { inst.$elemData.show(); } if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$lightboxBox.css({ height: "auto" }); } if (inst.$text.text().length > 0 && inst.options.titlestyle == "bottom") { inst.$elemData.css({ "max-height": inst.options.barheight + "px" }); } $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).css({ height: Math.max($(window).height(), $(document).height()) }); $(window).trigger("html5lightbox.lightboxopened"); }; inst.resizeLightbox = function (elemW, elemH, bAnimate, onFinish) { inst.hideNavArrows(); var boxPos = inst.calcBoxPosition(elemW, elemH); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$loading.hide(); inst.$watermark.hide(); if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastitem && window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") { window[inst.options.onlastitem](inst.currentElem); } } if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") { window[inst.options.onfirstitem](inst.currentElem); } } if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { inst.$elem.bind( "mouseenter mousemove", function () { if ((inst.options.arrowloop && inst.options.prevElem >= 0) || (!inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.curElem > inst.options.prevElem )) { inst.$prev.fadeIn(); } if ((inst.options.arrowloop && inst.options.nextElem >= 0) || (!inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem)) { inst.$next.fadeIn(); } } ); inst.$elem.bind( "mouseleave", function () { inst.$next.fadeOut(); inst.$prev.fadeOut(); } ); } inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) { speed = 0; } inst.$lightboxBox.animate({ width: boxW }, speed).animate( { height: boxH }, speed, function () { inst.onAnimateFinish(onFinish); } ); } else { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) { speed = 0; } inst.$lightboxBox.css({ width: boxW, height: "auto", "min-width": boxW - 15 }); inst.$elemWrap.animate({ width: boxW, "min-width": boxW - 15 }, speed).animate( { height: boxH, "min-height": boxH - 15 }, speed, function () { inst.onAnimateFinish(onFinish); } ); } }; inst.onAnimateFinish = function (onFinish) { inst.$loading.show(); inst.$watermark.show(); inst.$close.show(); inst.$elem.css({ "background-color": inst.options.bgcolor }); onFinish(); }; inst.reset = function () { if (inst.options.stamp) { inst.$watermark.hide(); } inst.showing = false; inst.$image.empty(); inst.$text.empty(); inst.$error.hide(); inst.$loading.hide(); inst.$image.hide(); if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$elemData.hide(); } if (!inst.options.fullscreenmode) { inst.$close.hide(); } inst.$elem.css({ "background-color": "" }); }; inst.resetNavigation = function () { inst.options.navheight = 0; $(".tsvg-fancy-html5-nav").remove(); }; inst.finish = function () { if ($("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).length) { $("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).attr("src", ""); } $("head") .find("style") .each( function () { if ($(this).data("creator") == "tsvg-fancy-html5box-html5-lightbox") { $(this).remove(); } } ); inst.slideTimeout.stop(); inst.reset(); inst.resetNavigation(); inst.$lightbox.remove(); $("#tsvg-fancy-html5box-html5-lightbox").remove(); inst.showObjects(); if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") { window[inst.options.oncloselightbox](inst.currentElem); } if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") { inst.onLightboxClosed(inst.currentElem); } }; inst.pauseSlide = function () { }; inst.playSlide = function () { }; inst.gotoSlide = function (slide) { if (slide == -1) { if (0 > inst.options.nextElem ) { return; } inst.options.curElem = inst.options.nextElem; } else if (slide == -2) { if (0 > inst.options.prevElem ) { return; } inst.options.curElem = inst.options.prevElem; } else if (slide >= 0) { inst.options.curElem = slide; } if (inst.autosliding) { inst.slideTimeout.stop(); } inst.calcNextPrevElem(); inst.reset(); inst.loadCurElem(); }; inst.enableSwipe = function () { inst.$elem.html5lightboxTouchSwipe610795( { preventWebBrowser: false, swipeLeft: function () { inst.gotoSlide(-1); }, swipeRight: function () { inst.gotoSlide(-2); }, } ); }; inst.hideObjects = function () { $("select, embed, object").css({ visibility: "hidden" }); }; inst.showObjects = function () { $("select, embed, object").css({ visibility: "visible" }); }; inst.embedHTML5Video = function ($container, src, autoplay, loopvideo) { let embedVideoPoster = (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : ""), embedVideoControls = (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : ""); $container.html( "
" ); if (!inst.options.nativehtml5controls) { $("video", $container).data("src", src); $("video", $container).lightboxHTML5VideoControls610795(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume); } $("video", $container) .unbind("ended") .bind( "ended", function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); }; inst.embedFlash = function ($container, src, wmode, flashVars) { if (inst.options.flashInstalled) { var htmlOptions = { pluginspage: "", quality: "high", allowFullScreen: "true", allowScriptAccess: "always", type: "application/x-shockwave-flash" }; htmlOptions.width = "100%"; htmlOptions.height = "100%"; htmlOptions.src = src; htmlOptions.flashVars = $.param(flashVars); htmlOptions.wmode = wmode; var htmlString = ""; for (var key in htmlOptions) { htmlString += key + "=" + htmlOptions[key] + " "; } $container.html(""); } else { $container.html( "
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
" ); } }; inst.checkType = function (href) { if (!href) { return -1; } if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) { return 0; } if (href.match(/[^\.]\.(swf)\s*$/i)) { return 1; } if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) { return 4; } if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) { return 3; } if (href.match(/\:\/\/.*(vimeo\.com)/i)) { return 4; } if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) { return 9; } if (href.match(/[^\.]\.(pdf)\s*$/i)) { return 5; } if (href.match(/[^\.]\.(mp3)\s*$/i)) { return 6; } if (href.match(/[^\.]\.(flv)\s*$/i)) { return 8; } if (href.match(/\#\w+/i)) { return 10; } if (href.match(/\:\/\/.*(wistia)/i)) { return 11; } return 7; }; inst.getURLParams = function () { var result = {}; var params = window.location.search.substring(1).split("&"); for (var i = 0; params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2) { result[value[0].toLowerCase()] = unescape(value[1]); } } return result; }; inst.absoluteUrl = function (href) { var link = document.createElement("a"); link.href = href; return link.protocol + "//" + link.host + link.pathname + link.search + link.hash; }; inst.showLightbox = function (type, href, title, width, height, webm, ogg, thumbnail, description) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)); }; inst.addItem = function (href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { type = mediatype && mediatype >= 0 ? mediatype : inst.checkType(href); inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)); }; inst.showItem = function (href) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i; i++) { if (inst.elemArray[i][ELEM_HREF] == href) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.unbind("click").click(inst.clickHandler); inst.each( function () { var self = $(this); if (self.data("autoopen")) { setTimeout( function () { self.click(); }, self.data("autoopendelay") ? self.data("autoopendelay") : 0 ); return false; } } ); var urlParams = inst.getURLParams(); if ("html5lightboxshare" in urlParams) { var shareUrl = decodeURIComponent(urlParams["html5lightboxshare"]); var shareLink = $('.tsvg-html5lightbox-610795[href="' + shareUrl + '"]'); if (shareLink.length > 0) { shareLink.click(); } } return inst; }; })(jQuery); (function ($) { $.fn.html5lightboxTouchSwipe610795 = function (options) { var defaults = { preventWebBrowser: false, swipeLeft: null, swipeRight: null, swipeTop: null, swipeBottom: null }; if (options) { $.extend(defaults, options); } return this.each( function () { var startX = -1, startY = -1; var curX = -1, curY = -1; function touchStart(event) { var e = event.originalEvent; if (e.targetTouches.length >= 1) { startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchMove(event) { if (defaults.preventWebBrowser) { event.preventDefault(); } var e = event.originalEvent; if (e.targetTouches.length >= 1) { curX = e.targetTouches[0].pageX; curY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchEnd(event) { if (curX > 0 || curY > 0) { triggerHandler(); touchCancel(event); } else { touchCancel(event); } } function touchCancel(event) { startX = -1; startY = -1; curX = -1; curY = -1; } function triggerHandler() { if (Math.abs(curX - startX) > Math.abs(curY - startY)) { if (curX > startX) { if (defaults.swipeRight) { defaults.swipeRight.call(); } } else { if (defaults.swipeLeft) { defaults.swipeLeft.call(); } } } else if (curY > startY) { if (defaults.swipeBottom) { defaults.swipeBottom.call(); } } else if (defaults.swipeTop) { defaults.swipeTop.call(); } } try { $(this).bind("touchstart", touchStart); $(this).bind("touchmove", touchMove); $(this).bind("touchend", touchEnd); $(this).bind("touchcancel", touchCancel); } catch (e) { } } ); }; })(jQuery); (function ($) { $.fn.lightboxHTML5VideoControls610795 = function (skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { var isTouch = "ontouchstart" in window; var eStart = isTouch ? "touchstart" : "mousedown"; var eMove = isTouch ? "touchmove" : "mousemove"; var eCancel = isTouch ? "touchcancel" : "mouseup"; var eClick = "click"; var BUTTON_SIZE = 32; var BAR_HEIGHT = isTouch ? 48 : 36; var hideControlsTimerId = null; var hideVolumeBarTimeoutId = null; var sliderDragging = false; var isFullscreen = false; var userActive = true; var isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; var isHd = $(this).data("ishd"); var hd = $(this).data("hd"); var src = $(this).data("src"); var $videoObj = $(this); $videoObj.get(0).removeAttribute("controls"); if (isIPhone) { var h = $videoObj.height() - BAR_HEIGHT; $videoObj.css({ height: h }); } var $videoPlay = $("
"); if (!isIPhone) { $videoObj.after($videoPlay); $videoPlay .css( { position: "absolute", top: "50%", left: "50%", display: "block", cursor: "pointer", width: 64, height: 64, "margin-left": -32, "margin-top": -32, "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", "background-position": "center center", "background-repeat": "no-repeat", } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); } var $videoFullscreenBg = $("
"); var $videoControls = $( "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); $videoObj.after($videoControls); $videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({ display: "none", position: "fixed", left: 0, top: 0, bottom: 0, right: 0, "z-index": 2147483647 }); $videoControls.css({ display: "block", position: "absolute", width: "100%", height: BAR_HEIGHT, left: 0, bottom: 0, right: 0, "max-width": "640px", margin: "0 auto" }); var userActivate = function () { userActive = true; }; $videoObj .bind( eClick, function () { userActive = true; } ) .hover( function () { userActive = true; }, function () { userActive = false; } ); if (!hidecontrols) { setInterval( function () { if (userActive) { $videoControls.show(); userActive = false; clearTimeout(hideControlsTimerId); hideControlsTimerId = setTimeout( function () { if (!$videoObj.get(0).paused) { $videoControls.fadeOut(); } }, 5e3 ); } }, 250 ); } $(".html5boxVideoControlsBg", $videoControls).css({ display: "block", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)" }); $(".html5boxPlayPause", $videoControls).css({ display: "block", position: "relative", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), float: "left" }); var $videoBtnPlay = $(".html5boxPlay", $videoControls); var $videoBtnPause = $(".html5boxPause", $videoControls); $videoBtnPlay .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top left", } ) .hover( function () { $(this).css({ "background-position": "bottom left" }); }, function () { $(this).css({ "background-position": "top left" }); } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); $videoBtnPause .css( { display: "none", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top right", } ) .hover( function () { $(this).css({ "background-position": "bottom right" }); }, function () { $(this).css({ "background-position": "top right" }); } ) .bind( eClick, function () { $videoObj.get(0).pause(); } ); var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); var $videoSeeker = $(".html5boxSeeker", $videoControls); var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); $videoTimeCurrent.css( { display: "block", position: "relative", float: "left", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoTimeTotal.css( { display: "block", position: "relative", float: "right", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoSeeker .css({ display: "block", cursor: "pointer", overflow: "hidden", position: "relative", height: "10px", "background-color": "#222", margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" }) .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); $videoSeeker.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); } ); } ) .bind( eCancel, function () { $videoSeeker.unbind(eMove); } ); $videoSeekerBuffer.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#444" }); $videoSeekerPlay.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#fcc500" }); if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { var switchScreen = function (fullscreen) { if (fullscreen) { if ($videoObj.get(0).requestFullscreen) { $videoObj.get(0).requestFullscreen(); } else if ($videoObj.get(0).webkitRequestFullScreen) { $videoObj.get(0).webkitRequestFullScreen(); } else if ($videoObj.get(0).mozRequestFullScreen) { $videoObj.get(0).mozRequestFullScreen(); } else if ($videoObj.get(0).webkitEnterFullScreen) { $videoObj.get(0).webkitEnterFullScreen(); } if ($videoObj.get(0).msRequestFullscreen) { $videoObj.get(0).msRequestFullscreen(); } } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }; var switchScreenCSS = function (fullscreen) { $videoControls.css({ position: fullscreen ? "fixed" : "absolute" }); var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); $videoFullscreen.css({ "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY }); $videoFullscreenBg.css({ display: fullscreen ? "block" : "none" }); if (fullscreen) { $(document).bind("mousemove", userActivate); $videoControls.css({ "z-index": 2147483647 }); } else { $(document).unbind("mousemove", userActivate); $videoControls.css({ "z-index": "" }); } }; document.addEventListener( "fullscreenchange", function () { isFullscreen = document.fullscreen; switchScreenCSS(document.fullscreen); }, false ); document.addEventListener( "mozfullscreenchange", function () { isFullscreen = document.mozFullScreen; switchScreenCSS(document.mozFullScreen); }, false ); document.addEventListener( "webkitfullscreenchange", function () { isFullscreen = document.webkitIsFullScreen; switchScreenCSS(document.webkitIsFullScreen); }, false ); $videoObj.get(0).addEventListener( "webkitbeginfullscreen", function () { isFullscreen = true; }, false ); $videoObj.get(0).addEventListener( "webkitendfullscreen", function () { isFullscreen = false; }, false ); $("head").append(""); var $videoFullscreen = $(".html5boxFullscreen", $videoControls); $videoFullscreen .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", "background-position": "left top", } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { isFullscreen = !isFullscreen; switchScreen(isFullscreen); } ); } if (hd) { var $videoHD = $(".html5boxHD", $videoControls); $videoHD .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_hd.png" + "')", "background-position": (isHd ? "right" : "left") + " center", } ) .bind( eClick, function () { isHd = !isHd; $(this).css({ "background-position": (isHd ? "right" : "left") + " center" }); parentInst.isHd = isHd; var isPaused = $videoObj.get(0).isPaused; $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); if (!isPaused) { $videoObj.get(0).play(); } else if (!isIPhone) { $videoObj.get(0).pause(); } } ); } $videoObj.get(0).volume = defaultvolume; var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; var volume = $videoObj.get(0).volume; $videoObj.get(0).volume = volume / 2 + 0.1; if ($videoObj.get(0).volume === volume / 2 + 0.1) { $videoObj.get(0).volume = volume; var $videoVolume = $(".html5boxVolume", $videoControls); var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); $videoVolume.css({ display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) }).hover( function () { clearTimeout(hideVolumeBarTimeoutId); var volume = $videoObj.get(0).volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); $videoVolumeBar.show(); }, function () { clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId = setTimeout( function () { $videoVolumeBar.hide(); }, 1e3 ); } ); $videoVolumeButton .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", "background-position": "top " + (volume > 0 ? "left" : "right"), } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { var volume = $videoObj.get(0).volume; if (volume > 0) { volumeSaved = volume; volume = 0; } else { volume = volumeSaved; } var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); $videoVolumeButton.css({ "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY }); $videoObj.get(0).volume = volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); } ); $videoVolumeBar.css( { display: "none", position: "absolute", left: 4, bottom: "100%", width: 24, height: 80, "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)", } ); $videoVolumeBarBg.css({ display: "block", position: "relative", width: 10, height: 68, margin: 7, cursor: "pointer", "background-color": "#222" }); $videoVolumeBarActive.css({ display: "block", position: "absolute", bottom: 0, left: 0, width: "100%", height: "100%", "background-color": "#fcc500" }); $videoVolumeBarBg .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; $videoVolumeBarBg.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; } ); } ) .bind( eCancel, function () { $videoVolumeBarBg.unbind(eMove); } ); } var calcTimeFormat = function (seconds) { var h0 = Math.floor(seconds / 3600); var h = 10 > h0 ? "0" + h0 : h0; var m0 = Math.floor((seconds - h0 * 3600) / 60); var m = 10 > m0 ? "0" + m0 : m0; var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); var s = 10 > s0 ? "0" + s0 : s0; var r = m + ":" + s; if (h0 > 0) { r = h + ":" + r; } return r; }; if (hideplaybutton) { $videoPlay.hide(); } if (hidecontrols) { $videoControls.hide(); } var onVideoPlay = function () { if (!hideplaybutton) { $videoPlay.hide(); } if (!hidecontrols) { $videoBtnPlay.hide(); $videoBtnPause.show(); } }; var onVideoPause = function () { if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoEnded = function () { $(window).trigger("html5lightbox.videoended"); if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoUpdate = function () { var curTime = $videoObj.get(0).currentTime; if (curTime) { $videoTimeCurrent.text(calcTimeFormat(curTime)); var duration = $videoObj.get(0).duration; if (duration) { $videoTimeTotal.text(calcTimeFormat(duration)); if (!sliderDragging) { var sliderW = $videoSeeker.width(); var pos = Math.round((sliderW * curTime) / duration); $videoSeekerPlay.css({ width: pos }); $videoSeekerHandler.css({ left: pos }); } } } }; var onVideoProgress = function () { if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { var sliderW = $videoSeeker.width(); $videoSeekerBuffer.css({ width: Math.round((sliderW * $videoObj.get(0).buffered.end(0)) / $videoObj.get(0).duration) }); } }; try { $videoObj.bind("play", onVideoPlay); $videoObj.bind("pause", onVideoPause); $videoObj.bind("ended", onVideoEnded); $videoObj.bind("timeupdate", onVideoUpdate); $videoObj.bind("progress", onVideoProgress); } catch (e) { } }; })(jQuery); jQuery(".tsvg-html5lightbox-610795").html5lightbox610795({},'610795'); jQuery(function() { jQuery('.tsvg-section-610795').fadeIn(); var tsvgFancyHoverInverse610795 = 'Default'; tsvgFancyHoverInverse610795 = tsvgFancyHoverInverse610795 == 'Default' ? false : true; jQuery('.tsvg-fancy-blocks-list-610795 > li').each(function() { jQuery(this).hoverdir({hoverDelay: 50, inverse:tsvgFancyHoverInverse610795}); }); }); clearInterval(tsvgFancyInterval610795); } }, tsvgFancyReference610795 = ( function tsvgFancySameCall610795() { tsvgFancyInterval610795 = setInterval(tsvgFancyIntervalFunction610795, 1000); return tsvgFancySameCall610795; }() );

Workshop Trailers

" + "
" + "
" + "
" + "" + "" + "" + "
" + "
" + "" + "
" + "
" ); inst.options.positionFixed = inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; inst.$lightbox.css({ position: inst.options.positionFixed ? "fixed" : "absolute" }); inst.$lightbox.appendTo("body"); inst.$lightboxBox = $("#tsvg-fancy-html5-lightbox-box", inst.$lightbox); inst.$elem = $("#tsvg-fancy-html5-elem-box", inst.$lightbox); inst.$elemWrap = $("#tsvg-fancy-html5-elem-wrap", inst.$lightbox); inst.$loading = $("#tsvg-fancy-html5-loading", inst.$lightbox); inst.$error = $("#tsvg-fancy-html5-error", inst.$lightbox); inst.$image = $("#tsvg-fancy-html5-image", inst.$lightbox); var elemText = ""; if (inst.options.titlestyle == "left") { inst.$elem.prepend(elemText); } else { inst.$elem.append(elemText); } inst.$elemData = $("#tsvg-fancy-html5-elem-data-box", inst.$lightbox); inst.$text = $("#tsvg-fancy-html5-text", inst.$lightbox); if (inst.options.borderradius > 0) { inst.$elem.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); if (inst.options.titlestyle == "inside") { inst.$elemWrap.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); } else if (inst.options.titlestyle == "bottom") { inst.$elemWrap.css( { "border-top-left-radius": inst.options.borderradius + "px", "-moz-top-left-border-radius": inst.options.borderradius + "px", "-webkit-top-left-border-radius": inst.options.borderradius + "px", "border-top-right-radius": inst.options.borderradius + "px", "-moz-top-right-border-radius": inst.options.borderradius + "px", "-webkit-top-right-border-radius": inst.options.borderradius + "px", } ); inst.$elemData.css( { "border-bottom-left-radius": inst.options.borderradius + "px", "-moz-top-bottom-border-radius": inst.options.borderradius + "px", "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", "border-bottom-right-radius": inst.options.borderradius + "px", "-moz-bottom-right-border-radius": inst.options.borderradius + "px", "-webkit-bottom-right-border-radius": inst.options.borderradius + "px", } ); } } if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { inst.$lightboxBox.css({ "background-color": inst.options.bgcolor }); if (inst.options.titlestyle == "right") { inst.$elemWrap.css({ position: "relative", float: "left" }); inst.$elemData.css({ position: "relative", overflow: "hidden", padding: inst.options.bordersize + "px" }); } else { inst.$elemWrap.css({ position: "relative", overflow: "hidden" }); inst.$elemData.css({ position: "relative", float: "left", padding: inst.options.bordersize + "px" }); } } else if (inst.options.titlestyle == "inside") { inst.$elemData.css({ position: "absolute", margin: inst.options.bordersize + "px", bottom: 0, left: 0, "background-color": "#333", "background-color": "rgba(51, 51, 51, 0.6)" }); inst.$text.css({ padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" }); } else { inst.$elemData.css( { position: "relative", width: "100%", height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", padding: "0 0 " + inst.options.bordersize + "px" + " 0", "background-color": inst.options.bgcolor, "text-align": "left", } ); inst.$text.css({ margin: "0 " + inst.options.bordersize + "px" }); } if (inst.options.fullscreenmode) { inst.$lightbox.append( "
" + "
" ); inst.$next = $(".tsvg-fancy-html5-next-fullscreen", inst.$lightbox); inst.$prev = $(".tsvg-fancy-html5-prev-fullscreen", inst.$lightbox); inst.$lightboxBox.append( "
" + "
" ); inst.$nextbottom = $(".tsvg-fancy-html5-next-bottom-fullscreen", inst.$lightbox); inst.$prevbottom = $(".tsvg-fancy-html5-prev-bottom-fullscreen", inst.$lightbox); inst.$nextbottom.click( function () { inst.nextArrowClicked(); } ); inst.$prevbottom.click( function () { inst.prevArrowClicked(); } ); inst.$lightbox.append( "
" ); inst.$close = $("#tsvg-fancy-html5-close-fullscreen", inst.$lightbox); } else { inst.$elemWrap.append( "" + "" ); inst.$next = $("#tsvg-fancy-html5-next", inst.$lightbox); inst.$prev = $("#tsvg-fancy-html5-prev", inst.$lightbox); if ((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) { inst.$lightboxBox.append( "
" + "
" ); inst.$nexttouch = $(".tsvg-fancy-html5-next-touch", inst.$lightbox); inst.$prevtouch = $(".tsvg-fancy-html5-prev-touch", inst.$lightbox); inst.$nexttouch.click( function () { inst.nextArrowClicked(); } ); inst.$prevtouch.click( function () { inst.prevArrowClicked(); } ); } inst.$lightboxBox.append( "" ); inst.$close = $("#tsvg-fancy-html5-close", inst.$lightbox); } if (inst.options.showsocial) { var socialCode = '"; inst.$lightboxBox.append(socialCode); $(".tsvg-fancy-html5-social-btn", inst.$lightbox).click( function () { var shareUrl = window.location.href + (0 > window.location.href.indexOf("?") ? "?" : "&") + "html5lightboxshare=" + encodeURIComponent(inst.currentElem[ELEM_HREF]); var shareTitle = inst.currentElem[ELEM_TITLE]; var shareMedia = inst.currentElem[ELEM_HREF]; if (inst.currentElem[ELEM_TYPE] == 0) { shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); } else if (inst.currentElem[ELEM_TYPE] == 3) { shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; } else { var lightboxLink = $('.tsvg-html5lightbox-997063[href="' + inst.currentElem[ELEM_HREF] + '"]'); if (lightboxLink.length > 0) if (lightboxLink.data("shareimage") && lightboxLink.data("shareimage").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); } else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); } else { var lightboxImg = $("img", lightboxLink); if (lightboxImg.length > 0) { shareMedia = inst.absoluteUrl(lightboxImg.attr("src")); } } } var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; if ($(this).hasClass("tsvg-fancy-html5-social-facebook")) { window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-twitter")) { window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-pinterest")) { window.open( "https://pinterest.com/pin/create/bookmarklet/?media=" + encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank" ); } return false; } ); } inst.$watermark = $("#tsvg-fancy-html5-watermark", inst.$lightbox); if (inst.options.stamp) { inst.$watermark.html(""); } else if (inst.options.watermark) { var html = ""; if (inst.options.watermarklink) { html = "" + html + ""; } inst.$watermark.html(html); } if (inst.options.closeonoverlay) { $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).click(inst.finish); } inst.$close.click(inst.finish); inst.$next.click( function () { inst.nextArrowClicked(); } ); inst.$prev.click( function () { inst.prevArrowClicked(); } ); $(window).resize( function () { clearTimeout(inst.options.resizeTimeout); inst.options.resizeTimeout = setTimeout( function () { inst.resizeWindow(); }, 500 ); } ); $(window).scroll( function () { inst.scrollBox(); } ); $(window).bind( "orientationchange", function (e) { if (inst.options.isMobile) { inst.resizeWindow(); } } ); if (inst.options.isIPhone) { inst.options.windowInnerHeight = window.innerHeight; setInterval( function () { if (inst.options.windowInnerHeight != window.innerHeight) { inst.options.windowInnerHeight = window.innerHeight; inst.resizeWindow(); } }, 500 ); } if (inst.options.enabletouchswipe) { inst.enableSwipe(); } }; inst.slideTimer = function (interval, callback, updatecallback) { let timerInstance = this, updateinterval = 50, updateTimerId = null, runningTime = 0, paused = false, started = false, startedandpaused = false; timerInstance.timeout = interval; this.pause = function () { if (started) { paused = true; clearInterval(updateTimerId); } }; this.resume = function (forceresume) { if (startedandpaused && !forceresume) { return; } startedandpaused = false; if (started && paused) { paused = false; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); } }; this.stop = function () { clearInterval(updateTimerId); if (updatecallback) { updatecallback(-1); } runningTime = 0; paused = false; started = false; }; this.start = function () { runningTime = 0; paused = false; started = true; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); }; this.startandpause = function () { runningTime = 0; paused = true; started = true; startedandpaused = true; }; return this; }; inst.updateTimer = function (percent) { var w = Math.round(percent * 100); if (w > 100) { w = 100; } if (0 > w ) { w = 0; } $("#tsvg-fancy-html5-timer", inst.$lightbox).css({ display: "block", width: w + "%" }); }; inst.initSlide = function () { inst.autosliding = false; inst.slideTimeout = inst.slideTimer( inst.options.slideinterval, function () { inst.gotoSlide(-1); }, inst.options.showtimer ? function (percent) { inst.updateTimer(percent); } : null ); if (inst.options.autoslide) { inst.slideTimeout.stop(); inst.autosliding = true; } }; inst.nextArrowClicked = function () { if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") { window[inst.options.onlastarrowclicked](); } } inst.gotoSlide(-1); }; inst.prevArrowClicked = function () { if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && typeof window[inst.options.onfirstarrowclicked] == "function") { window[inst.options.onfirstarrowclicked](); } } inst.gotoSlide(-2); }; inst.calcNextPrevElem = function () { inst.options.nextElem = -1; inst.options.prevElem = -1; inst.options.inGroup = false; inst.options.groupIndex = 0; inst.options.groupCount = 0; var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; for (var i = 0; inst.elemArray.length > i; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (i == inst.options.curElem) { inst.options.groupIndex = inst.options.groupCount; } inst.options.groupCount++; } } var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; if (curGroup != undefined && curGroup != null) { for (j = inst.options.curElem + 1;inst.elemArray.length > j; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } if (0 > inst.options.nextElem) { for (j = 0; inst.options.curElem > j ; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } } if (inst.options.nextElem >= 0) { for (j = inst.options.curElem - 1; j >= 0; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } if (0 > inst.options.prevElem ) { for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } } } } if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) { inst.options.inGroup = true; } }; inst.calcBoxPosition = function (initW, initH) { var boxW = initW + 2 * inst.options.bordersize; var boxH = initH + 2 * inst.options.bordersize; var winH = window.innerHeight ? window.innerHeight : $(window).height(); var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); if (inst.options.titlestyle == "bottom") { boxT -= Math.round(inst.options.barheight / 2); } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; if (topmargin > boxT) { boxT = topmargin; } if (inst.options.insideiframe && window.self != window.top) { if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; var parentscroll = parent.window.document.body.scrollTop; boxT = topmargin; boxT += parentscroll > iframetop ? parentscroll - iframetop : 0; } } return [boxW, boxH, boxT]; }; inst.hideNavArrows = function () { var showPrev = false; var showNext = false; if (inst.options.inGroup) { if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showPrev = true; } if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showNext = true; } } if (showPrev) { inst.$prev.removeClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$prev.addClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.addClass("tsvg-fancy-html5-hide"); } } if (showNext) { inst.$next.removeClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$next.addClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.addClass("tsvg-fancy-html5-hide"); } } }; inst.clickHandler = function (event) { var $this = $(this); var dataoptions = {}; if (jQuery(event.target).prop("tagName") == 'A') { let link = jQuery(event.target).attr('href'); if (jQuery(event.target).attr('target') == '_blank') { window.open(link); } else { window.location.assign(link) } return false; } $.each( $this.data(), function (key, value) { dataoptions[key.toLowerCase()] = value; } ); inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i ; i++) { if (inst.elemArray[i][ELEM_ID] == $this.data("tsvgid")) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; if (inst.options.iequirksmode) { inst.$lightboxBox.css({ top: boxT }); } else { inst.$lightboxBox.css({ "margin-top": boxT }); } if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.loadThumbnail = function (src, index) { let inst_img_elem = document.createElement('img'); inst_img_elem.src = src; inst_img_elem.addEventListener('load', function () { if (inst.options.thumbwidth / inst.options.thumbheight >= inst_img_elem.naturalWidth / inst_img_elem.naturalHeight ) { inst_img_elem.setAttribute("style","width:100%;") } else { inst_img_elem.setAttribute("style","height:100%;") } $(".tsvg-fancy-html5-nav-thumb").eq(index).html(inst_img_elem); }) inst_img_elem.addEventListener('error', function () { console.log('error') }) }; inst.matchGroup = function (curGroup, elemGroup) { if (!curGroup || !elemGroup) { return false; } var curs = curGroup.split(":"); var elems = elemGroup.split(":"); var result = false; for (var i in curs) { if ($.inArray(curs[i], elems) > -1) { result = true; break; } } return result; }; inst.showNavigation = function () { if (!inst.options.shownavigation) { return; } if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) { return; } var i; var showNav = false; var group = inst.currentElem[ELEM_GROUP]; for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { showNav = true; break; } } } if (!showNav) { return; } inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; if ($(".tsvg-fancy-html5-nav").length > 0) { return; } var check_bool = $('.tsvg-fancy-blocks-container').attr('data-tsvg-shn'); if (check_bool === 'false') { return } $("body").append( "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); if (TS_VG_FG_Show_Nav == "true") { var index = 0; } for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { $(".tsvg-fancy-html5-nav-list").append( "
'
" ); this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index) index++; } } } $(".tsvg-fancy-html5-nav-thumb").hover( function () { $(this).css({ opacity: 1 }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor }); }, function () { $(this).css({ opacity: inst.options.thumbopacity }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor }); } ); $(".tsvg-fancy-html5-nav-thumb").click( function () { var index = $(this).data("arrayindex"); if (index >= 0) { inst.gotoSlide(index); } } ); inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); $(".tsvg-fancy-html5-nav-list") .css({ display: "block", position: "relative", "margin-left": 0, width: inst.options.totalwidth + "px" }) .append("
"); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); $navPrev.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; if (marginLeft >= 0) { marginLeft = 0; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (maskWidth - inst.options.totalwidth >= marginLeft ) { $navNext.css({ "background-position": "center left" }); } else { $navNext.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); $navNext.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; if (maskWidth - inst.options.totalwidth >= marginLeft) { marginLeft = maskWidth - inst.options.totalwidth; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (marginLeft >= 0) { $navPrev.css({ "background-position": "center left" }); } else { $navPrev.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.loadElem = function (elem) { inst.currentElem = elem; inst.showing = true; inst.showNavigation(); inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); inst.$loading.show(); if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") { window[inst.options.onshowitem](elem); } switch (elem[ELEM_TYPE]) { case 0: var imgLoader = new Image(); $(imgLoader).load( function () { inst.showImage(elem, imgLoader.width, imgLoader.height); } ); $(imgLoader).error( function () { inst.showError(); } ); imgLoader.src = elem[ELEM_HREF]; break; case 1: inst.showSWF(elem); break; case 2: case 8: inst.showVideo(elem); break; case 3: case 4: case 9: case 11: inst.showYoutubeVimeo(elem); break; case 5: inst.showPDF(elem); break; case 6: inst.showMP3(elem); break; case 7: inst.showWeb(elem); break; case 10: inst.showDiv(elem); break; } if (inst.options.googleanalyticsaccount && window._gaq) { window._gaq.push(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]); } }; inst.loadCurElem = function () { inst.loadElem(inst.elemArray[inst.options.curElem]); }; inst.showError = function () { inst.$loading.hide(); inst.resizeLightbox( inst.options.errorwidth, inst.options.errorheight, true, function () { inst.$error.show(); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); } ); }; inst.calcTextWidth = function (objW) { return objW - 36; }; (inst.showTitle = function (w, t, description) { if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: w + "px" }); } var text = ""; if (inst.options.showtitle) { if (t && t.length > 0) { text += t; } } if (inst.options.inGroup) { if (inst.options.showtitleprefix) { text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", inst.options.groupCount) + " " + text; } jQuery("#tsvg-fancy-html5-elem-data-box").css("display", "none"); if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT != "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (TotalSoft_GV_FG_PD == "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "block"); } if (TotalSoft_GV_FG_PT == "true") { jQuery(".tsvg-fancy-popup-text").css("display", "inline-block"); } if (TotalSoft_GV_FG_PD != "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "none"); } if (TotalSoft_GV_FG_PT != "true") { jQuery(".tsvg-fancy-popup-text").css("display", "none"); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD != "true") { jQuery("#tsvg-fancy-html5-text").css("display", "none"); } } if (inst.options.showdescription && description && description.length > 0) { inst.$text.html(text); } if (inst.options.inGroup && inst.options.showplaybutton) { if (inst.autosliding) { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } else { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); } $("#tsvg-fancy-html5-play", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } ); $("#tsvg-fancy-html5-pause", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.autosliding = false; } } ); } $("#tsvg-fancy-html5-social", inst.$lightbox).show(); }); (inst.showImage = function (elem, imgW, imgH) { var elemW, elemH; if (elem[ELEM_WIDTH]) { elemW = elem[ELEM_WIDTH]; } else { elemW = imgW; elem[ELEM_WIDTH] = imgW; } if (elem[ELEM_HEIGHT]) { elemH = elem[ELEM_HEIGHT]; } else { elemH = imgH; elem[ELEM_HEIGHT] = imgH; } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, inst.options.imagekeepratio); inst.resizeLightbox( sizeObj.w, sizeObj.h, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : ""; inst.$image.show(); inst.$image.html( "
" + timercode + "
" ); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }); inst.showSWF = function (elem) { var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); inst.embedFlash($("#tsvg-html5lightbox-swf"), elem[ELEM_HREF], "window", { width: dataW, height: dataH }); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showVideo = function (elem) { inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var isHTML5 = false; if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || (inst.options.isIE9 && inst.options.useflashonie9) || (inst.options.isIE10 && inst.options.useflashonie10) || (inst.options.isIE11 && inst.options.useflashonie11)) { isHTML5 = false; } else if (inst.options.isMobile) { isHTML5 = true; } else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) { if ((!inst.options.isFirefox && !inst.options.isOpera) || ((inst.options.isFirefox || inst.options.isOpera) && (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM]))) { isHTML5 = true; } } if (isHTML5) { var videoSrc = elem[ELEM_HREF]; if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) { videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; } inst.embedHTML5Video($("#tsvg-html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo); } else { var videoFile = elem[ELEM_HREF]; if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") { videoFile = inst.options.htmlfolder + videoFile; } inst.embedFlash( $("#tsvg-html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { width: dataW, height: dataH, jsobjectname: "html5Lightbox", hidecontrols: inst.options.videohidecontrols ? "1" : "0", hideplaybutton: "0", videofile: videoFile, hdfile: "", ishd: "0", defaultvolume: inst.options.defaultvideovolume, autoplay: inst.options.autoplay ? "1" : "0", loop: inst.options.loopvideo ? "1" : "0", errorcss: ".html5box-error" + inst.options.errorcss, id: 0, } ); } inst.$elem.show(); inst.showData(); } ); }; inst.loadNext = function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } }; inst.getYoutubeParams = function (href) { var result = {}; if (0 > href.indexOf("?") ) { return result; } var params = href.substring(href.indexOf("?") + 1).split("&"); for (var i = 0;params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2 && value[0].toLowerCase() != "v") { result[value[0].toLowerCase()] = value[1]; } } return result; }; inst.getYoutubeId = function (href) { var youtubeId = ""; var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(shorts\/)|(watch\??v?=?))([^#\&\?]*).*/; var match = href.match(regExp); if (match && match[match.length -1].length == 11) { youtubeId = match[match.length -1]; } return youtubeId; }; inst.prepareYoutubeHref = function (href) { let youtubeId = inst.getYoutubeId(href), protocol = "https:", result = protocol + "//www.youtube.com/embed/" + youtubeId, params = this.getYoutubeParams(href), first = true; for (var key in params) { if (first) { result += "?"; first = false; } else { result += "&"; } result += key + "=" + params[key]; } return result; }; inst.prepareDailymotionHref = function (href) { if (href.match(/\:\/\/.*(dai\.ly)/i)) { var protocol = "https:"; var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; href = protocol + "" + id; } return href; }; inst.showYoutubeVimeo = function (elem) { var tsvg_autoplay = jQuery('.tsvg-main-content-' + id).attr('data-tsvg-autoplay'); inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var href = elem[ELEM_HREF]; var youtubeid = ""; if (elem[ELEM_TYPE] == 3) { youtubeid = inst.getYoutubeId(href); href = inst.prepareYoutubeHref(href); if (tsvg_autoplay == "true") { href += "?autoplay=1&mute=1" } else { href += "?autoplay=0&mute=0" } } if (elem[ELEM_TYPE] == 9) { href = inst.prepareDailymotionHref(href); } if (inst.options.autoplay) { if (elem[ELEM_TYPE] == 4) { if (href.indexOf('player.vimeo.com/video/') > -1) { if (tsvg_autoplay == "true") { href += "?autoplay=1&muted=1"; } } } } if (inst.options.loopvideo) { href += 0 > href.indexOf("?") ? "?" : "&"; switch (elem[ELEM_TYPE]) { case 3: href += "loop=1&playlist=" + youtubeid; break; case 4: case 9: href += "loop=1"; break; case 11: href += "endVideoBehavior=loop"; break; } } if (elem[ELEM_TYPE] == 3 && Totalsoft_FG_ShVAutoPl == "true") { if (0 > href.indexOf("?")) { href += "?wmode=transparent&rel=0&iv_load_policy=3"; } else { href += "&wmode=transparent&rel=0&iv_load_policy=3"; } if (inst.options.videohidecontrols) { href += "&controls=0&showinfo=0"; } href += "&mute=1&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname; } if (href.indexOf('.mp4') > -1) { let autoplay_bool = tsvg_autoplay == "true" ? "autoplay muted" : ""; $("#tsvg-html5lightbox-video").html(''); } else { $("#tsvg-html5lightbox-video").html(""); } inst.$elem.show(); inst.showData(); if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") { new YT.Player( "html5boxiframevideo", { events: { onStateChange: function (event) { if (event.data == YT.PlayerState.ENDED) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } }, }, } ); } else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { var vimeoIframe = $("#html5boxiframevideo")[0]; var vimeoPlayer = $f(vimeoIframe); vimeoPlayer.addEvent( "ready", function () { vimeoPlayer.addEvent( "finish", function (id) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); } ); } } ); }; inst.showPDF = function (elem) { }; inst.showMP3 = function (elem) { }; inst.showDiv = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var divID = elem[ELEM_HREF]; if ($(divID).length > 0) { $("#tsvg-html5lightbox-div").html($(divID).html()); } else { $("#tsvg-html5lightbox-div").html("
The specified div ID does not exist.
"); } inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showWeb = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); var tsvgRumbleCheck = elem[ELEM_HREF].indexOf('rumble.com/') > -1 ? 'sandbox="allow-scripts"' : ''; dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); $("#tsvg-html5lightbox-web").html(""); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.scrollBox = function () { }; inst.resizeWindow = function () { if (!inst.currentElem) { return; } if (!inst.options.responsive) { return; } var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); if (inst.options.responsivebarheight) { if (inst.options.smallscreenheight >= winH) { inst.options.barheight = inst.options.barheightonsmallheight; } else { inst.options.barheight = inst.options.barheightoriginal; } if (inst.options.titlestyle == "bottom" && inst.options.barautoheight != "auto") { inst.$elemData.css({ height: inst.options.barheight + "px", "max-height": inst.options.barheight + "px" }); } } var elemW, elemH, keepratio; if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; keepratio = false; } else { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; if (inst.currentElem[ELEM_TYPE] == 0) { keepratio = inst.options.imagekeepratio; } else { keepratio = true; } } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, keepratio); var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: sizeObj.w + "px" }); } if (0 >= $(".tsvg-fancy-html5-nav").length ) { return; } $(".tsvg-fancy-html5-nav-list").css({ "margin-left": 0 }); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.calcElemSize = function (sizeObj, keepratio) { if (!inst.options.responsive) { return sizeObj; } var winWidth = $(window).width(); winWidth = winWidth ? winWidth : $(document).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); winH = winH ? winH : $(document).height(); if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) { sizeObj.w = (sizeObj.w * 100) / inst.options.imagepercentage; } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; if (inst.options.titlestyle == "bottom") { h0 -= inst.options.barheight; } if (((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && inst.options.sidetobottomscreenwidth >= winWidth ) || (inst.options.notkeepratioonsmallheight && inst.options.smallscreenheight >= winH)) { keepratio = false; } if (sizeObj.h > h0) { if (keepratio) { sizeObj.w = Math.round((sizeObj.w * h0) / sizeObj.h); } sizeObj.h = h0; } var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; if ( (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth) || (((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) ) { w0 -= 64; } if (sizeObj.w > w0) { if (keepratio) { sizeObj.h = Math.round((sizeObj.h * w0) / sizeObj.w); } sizeObj.w = w0; } return sizeObj; }; inst.showData = function () { if (inst.$text.text().length > 0) { inst.$elemData.show(); } if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$lightboxBox.css({ height: "auto" }); } if (inst.$text.text().length > 0 && inst.options.titlestyle == "bottom") { inst.$elemData.css({ "max-height": inst.options.barheight + "px" }); } $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).css({ height: Math.max($(window).height(), $(document).height()) }); $(window).trigger("html5lightbox.lightboxopened"); }; inst.resizeLightbox = function (elemW, elemH, bAnimate, onFinish) { inst.hideNavArrows(); var boxPos = inst.calcBoxPosition(elemW, elemH); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$loading.hide(); inst.$watermark.hide(); if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastitem && window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") { window[inst.options.onlastitem](inst.currentElem); } } if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") { window[inst.options.onfirstitem](inst.currentElem); } } if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { inst.$elem.bind( "mouseenter mousemove", function () { if ((inst.options.arrowloop && inst.options.prevElem >= 0) || (!inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.curElem > inst.options.prevElem )) { inst.$prev.fadeIn(); } if ((inst.options.arrowloop && inst.options.nextElem >= 0) || (!inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem)) { inst.$next.fadeIn(); } } ); inst.$elem.bind( "mouseleave", function () { inst.$next.fadeOut(); inst.$prev.fadeOut(); } ); } inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) { speed = 0; } inst.$lightboxBox.animate({ width: boxW }, speed).animate( { height: boxH }, speed, function () { inst.onAnimateFinish(onFinish); } ); } else { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) { speed = 0; } inst.$lightboxBox.css({ width: boxW, height: "auto", "min-width": boxW - 15 }); inst.$elemWrap.animate({ width: boxW, "min-width": boxW - 15 }, speed).animate( { height: boxH, "min-height": boxH - 15 }, speed, function () { inst.onAnimateFinish(onFinish); } ); } }; inst.onAnimateFinish = function (onFinish) { inst.$loading.show(); inst.$watermark.show(); inst.$close.show(); inst.$elem.css({ "background-color": inst.options.bgcolor }); onFinish(); }; inst.reset = function () { if (inst.options.stamp) { inst.$watermark.hide(); } inst.showing = false; inst.$image.empty(); inst.$text.empty(); inst.$error.hide(); inst.$loading.hide(); inst.$image.hide(); if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$elemData.hide(); } if (!inst.options.fullscreenmode) { inst.$close.hide(); } inst.$elem.css({ "background-color": "" }); }; inst.resetNavigation = function () { inst.options.navheight = 0; $(".tsvg-fancy-html5-nav").remove(); }; inst.finish = function () { if ($("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).length) { $("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).attr("src", ""); } $("head") .find("style") .each( function () { if ($(this).data("creator") == "tsvg-fancy-html5box-html5-lightbox") { $(this).remove(); } } ); inst.slideTimeout.stop(); inst.reset(); inst.resetNavigation(); inst.$lightbox.remove(); $("#tsvg-fancy-html5box-html5-lightbox").remove(); inst.showObjects(); if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") { window[inst.options.oncloselightbox](inst.currentElem); } if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") { inst.onLightboxClosed(inst.currentElem); } }; inst.pauseSlide = function () { }; inst.playSlide = function () { }; inst.gotoSlide = function (slide) { if (slide == -1) { if (0 > inst.options.nextElem ) { return; } inst.options.curElem = inst.options.nextElem; } else if (slide == -2) { if (0 > inst.options.prevElem ) { return; } inst.options.curElem = inst.options.prevElem; } else if (slide >= 0) { inst.options.curElem = slide; } if (inst.autosliding) { inst.slideTimeout.stop(); } inst.calcNextPrevElem(); inst.reset(); inst.loadCurElem(); }; inst.enableSwipe = function () { inst.$elem.html5lightboxTouchSwipe997063( { preventWebBrowser: false, swipeLeft: function () { inst.gotoSlide(-1); }, swipeRight: function () { inst.gotoSlide(-2); }, } ); }; inst.hideObjects = function () { $("select, embed, object").css({ visibility: "hidden" }); }; inst.showObjects = function () { $("select, embed, object").css({ visibility: "visible" }); }; inst.embedHTML5Video = function ($container, src, autoplay, loopvideo) { let embedVideoPoster = (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : ""), embedVideoControls = (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : ""); $container.html( "
" ); if (!inst.options.nativehtml5controls) { $("video", $container).data("src", src); $("video", $container).lightboxHTML5VideoControls997063(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume); } $("video", $container) .unbind("ended") .bind( "ended", function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); }; inst.embedFlash = function ($container, src, wmode, flashVars) { if (inst.options.flashInstalled) { var htmlOptions = { pluginspage: "", quality: "high", allowFullScreen: "true", allowScriptAccess: "always", type: "application/x-shockwave-flash" }; htmlOptions.width = "100%"; htmlOptions.height = "100%"; htmlOptions.src = src; htmlOptions.flashVars = $.param(flashVars); htmlOptions.wmode = wmode; var htmlString = ""; for (var key in htmlOptions) { htmlString += key + "=" + htmlOptions[key] + " "; } $container.html(""); } else { $container.html( "
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
" ); } }; inst.checkType = function (href) { if (!href) { return -1; } if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) { return 0; } if (href.match(/[^\.]\.(swf)\s*$/i)) { return 1; } if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) { return 4; } if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) { return 3; } if (href.match(/\:\/\/.*(vimeo\.com)/i)) { return 4; } if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) { return 9; } if (href.match(/[^\.]\.(pdf)\s*$/i)) { return 5; } if (href.match(/[^\.]\.(mp3)\s*$/i)) { return 6; } if (href.match(/[^\.]\.(flv)\s*$/i)) { return 8; } if (href.match(/\#\w+/i)) { return 10; } if (href.match(/\:\/\/.*(wistia)/i)) { return 11; } return 7; }; inst.getURLParams = function () { var result = {}; var params = window.location.search.substring(1).split("&"); for (var i = 0; params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2) { result[value[0].toLowerCase()] = unescape(value[1]); } } return result; }; inst.absoluteUrl = function (href) { var link = document.createElement("a"); link.href = href; return link.protocol + "//" + link.host + link.pathname + link.search + link.hash; }; inst.showLightbox = function (type, href, title, width, height, webm, ogg, thumbnail, description) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)); }; inst.addItem = function (href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { type = mediatype && mediatype >= 0 ? mediatype : inst.checkType(href); inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)); }; inst.showItem = function (href) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i; i++) { if (inst.elemArray[i][ELEM_HREF] == href) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.unbind("click").click(inst.clickHandler); inst.each( function () { var self = $(this); if (self.data("autoopen")) { setTimeout( function () { self.click(); }, self.data("autoopendelay") ? self.data("autoopendelay") : 0 ); return false; } } ); var urlParams = inst.getURLParams(); if ("html5lightboxshare" in urlParams) { var shareUrl = decodeURIComponent(urlParams["html5lightboxshare"]); var shareLink = $('.tsvg-html5lightbox-997063[href="' + shareUrl + '"]'); if (shareLink.length > 0) { shareLink.click(); } } return inst; }; })(jQuery); (function ($) { $.fn.html5lightboxTouchSwipe997063 = function (options) { var defaults = { preventWebBrowser: false, swipeLeft: null, swipeRight: null, swipeTop: null, swipeBottom: null }; if (options) { $.extend(defaults, options); } return this.each( function () { var startX = -1, startY = -1; var curX = -1, curY = -1; function touchStart(event) { var e = event.originalEvent; if (e.targetTouches.length >= 1) { startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchMove(event) { if (defaults.preventWebBrowser) { event.preventDefault(); } var e = event.originalEvent; if (e.targetTouches.length >= 1) { curX = e.targetTouches[0].pageX; curY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchEnd(event) { if (curX > 0 || curY > 0) { triggerHandler(); touchCancel(event); } else { touchCancel(event); } } function touchCancel(event) { startX = -1; startY = -1; curX = -1; curY = -1; } function triggerHandler() { if (Math.abs(curX - startX) > Math.abs(curY - startY)) { if (curX > startX) { if (defaults.swipeRight) { defaults.swipeRight.call(); } } else { if (defaults.swipeLeft) { defaults.swipeLeft.call(); } } } else if (curY > startY) { if (defaults.swipeBottom) { defaults.swipeBottom.call(); } } else if (defaults.swipeTop) { defaults.swipeTop.call(); } } try { $(this).bind("touchstart", touchStart); $(this).bind("touchmove", touchMove); $(this).bind("touchend", touchEnd); $(this).bind("touchcancel", touchCancel); } catch (e) { } } ); }; })(jQuery); (function ($) { $.fn.lightboxHTML5VideoControls997063 = function (skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { var isTouch = "ontouchstart" in window; var eStart = isTouch ? "touchstart" : "mousedown"; var eMove = isTouch ? "touchmove" : "mousemove"; var eCancel = isTouch ? "touchcancel" : "mouseup"; var eClick = "click"; var BUTTON_SIZE = 32; var BAR_HEIGHT = isTouch ? 48 : 36; var hideControlsTimerId = null; var hideVolumeBarTimeoutId = null; var sliderDragging = false; var isFullscreen = false; var userActive = true; var isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; var isHd = $(this).data("ishd"); var hd = $(this).data("hd"); var src = $(this).data("src"); var $videoObj = $(this); $videoObj.get(0).removeAttribute("controls"); if (isIPhone) { var h = $videoObj.height() - BAR_HEIGHT; $videoObj.css({ height: h }); } var $videoPlay = $("
"); if (!isIPhone) { $videoObj.after($videoPlay); $videoPlay .css( { position: "absolute", top: "50%", left: "50%", display: "block", cursor: "pointer", width: 64, height: 64, "margin-left": -32, "margin-top": -32, "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", "background-position": "center center", "background-repeat": "no-repeat", } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); } var $videoFullscreenBg = $("
"); var $videoControls = $( "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); $videoObj.after($videoControls); $videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({ display: "none", position: "fixed", left: 0, top: 0, bottom: 0, right: 0, "z-index": 2147483647 }); $videoControls.css({ display: "block", position: "absolute", width: "100%", height: BAR_HEIGHT, left: 0, bottom: 0, right: 0, "max-width": "640px", margin: "0 auto" }); var userActivate = function () { userActive = true; }; $videoObj .bind( eClick, function () { userActive = true; } ) .hover( function () { userActive = true; }, function () { userActive = false; } ); if (!hidecontrols) { setInterval( function () { if (userActive) { $videoControls.show(); userActive = false; clearTimeout(hideControlsTimerId); hideControlsTimerId = setTimeout( function () { if (!$videoObj.get(0).paused) { $videoControls.fadeOut(); } }, 5e3 ); } }, 250 ); } $(".html5boxVideoControlsBg", $videoControls).css({ display: "block", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)" }); $(".html5boxPlayPause", $videoControls).css({ display: "block", position: "relative", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), float: "left" }); var $videoBtnPlay = $(".html5boxPlay", $videoControls); var $videoBtnPause = $(".html5boxPause", $videoControls); $videoBtnPlay .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top left", } ) .hover( function () { $(this).css({ "background-position": "bottom left" }); }, function () { $(this).css({ "background-position": "top left" }); } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); $videoBtnPause .css( { display: "none", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top right", } ) .hover( function () { $(this).css({ "background-position": "bottom right" }); }, function () { $(this).css({ "background-position": "top right" }); } ) .bind( eClick, function () { $videoObj.get(0).pause(); } ); var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); var $videoSeeker = $(".html5boxSeeker", $videoControls); var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); $videoTimeCurrent.css( { display: "block", position: "relative", float: "left", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoTimeTotal.css( { display: "block", position: "relative", float: "right", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoSeeker .css({ display: "block", cursor: "pointer", overflow: "hidden", position: "relative", height: "10px", "background-color": "#222", margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" }) .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); $videoSeeker.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); } ); } ) .bind( eCancel, function () { $videoSeeker.unbind(eMove); } ); $videoSeekerBuffer.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#444" }); $videoSeekerPlay.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#fcc500" }); if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { var switchScreen = function (fullscreen) { if (fullscreen) { if ($videoObj.get(0).requestFullscreen) { $videoObj.get(0).requestFullscreen(); } else if ($videoObj.get(0).webkitRequestFullScreen) { $videoObj.get(0).webkitRequestFullScreen(); } else if ($videoObj.get(0).mozRequestFullScreen) { $videoObj.get(0).mozRequestFullScreen(); } else if ($videoObj.get(0).webkitEnterFullScreen) { $videoObj.get(0).webkitEnterFullScreen(); } if ($videoObj.get(0).msRequestFullscreen) { $videoObj.get(0).msRequestFullscreen(); } } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }; var switchScreenCSS = function (fullscreen) { $videoControls.css({ position: fullscreen ? "fixed" : "absolute" }); var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); $videoFullscreen.css({ "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY }); $videoFullscreenBg.css({ display: fullscreen ? "block" : "none" }); if (fullscreen) { $(document).bind("mousemove", userActivate); $videoControls.css({ "z-index": 2147483647 }); } else { $(document).unbind("mousemove", userActivate); $videoControls.css({ "z-index": "" }); } }; document.addEventListener( "fullscreenchange", function () { isFullscreen = document.fullscreen; switchScreenCSS(document.fullscreen); }, false ); document.addEventListener( "mozfullscreenchange", function () { isFullscreen = document.mozFullScreen; switchScreenCSS(document.mozFullScreen); }, false ); document.addEventListener( "webkitfullscreenchange", function () { isFullscreen = document.webkitIsFullScreen; switchScreenCSS(document.webkitIsFullScreen); }, false ); $videoObj.get(0).addEventListener( "webkitbeginfullscreen", function () { isFullscreen = true; }, false ); $videoObj.get(0).addEventListener( "webkitendfullscreen", function () { isFullscreen = false; }, false ); $("head").append(""); var $videoFullscreen = $(".html5boxFullscreen", $videoControls); $videoFullscreen .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", "background-position": "left top", } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { isFullscreen = !isFullscreen; switchScreen(isFullscreen); } ); } if (hd) { var $videoHD = $(".html5boxHD", $videoControls); $videoHD .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_hd.png" + "')", "background-position": (isHd ? "right" : "left") + " center", } ) .bind( eClick, function () { isHd = !isHd; $(this).css({ "background-position": (isHd ? "right" : "left") + " center" }); parentInst.isHd = isHd; var isPaused = $videoObj.get(0).isPaused; $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); if (!isPaused) { $videoObj.get(0).play(); } else if (!isIPhone) { $videoObj.get(0).pause(); } } ); } $videoObj.get(0).volume = defaultvolume; var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; var volume = $videoObj.get(0).volume; $videoObj.get(0).volume = volume / 2 + 0.1; if ($videoObj.get(0).volume === volume / 2 + 0.1) { $videoObj.get(0).volume = volume; var $videoVolume = $(".html5boxVolume", $videoControls); var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); $videoVolume.css({ display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) }).hover( function () { clearTimeout(hideVolumeBarTimeoutId); var volume = $videoObj.get(0).volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); $videoVolumeBar.show(); }, function () { clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId = setTimeout( function () { $videoVolumeBar.hide(); }, 1e3 ); } ); $videoVolumeButton .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", "background-position": "top " + (volume > 0 ? "left" : "right"), } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { var volume = $videoObj.get(0).volume; if (volume > 0) { volumeSaved = volume; volume = 0; } else { volume = volumeSaved; } var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); $videoVolumeButton.css({ "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY }); $videoObj.get(0).volume = volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); } ); $videoVolumeBar.css( { display: "none", position: "absolute", left: 4, bottom: "100%", width: 24, height: 80, "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)", } ); $videoVolumeBarBg.css({ display: "block", position: "relative", width: 10, height: 68, margin: 7, cursor: "pointer", "background-color": "#222" }); $videoVolumeBarActive.css({ display: "block", position: "absolute", bottom: 0, left: 0, width: "100%", height: "100%", "background-color": "#fcc500" }); $videoVolumeBarBg .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; $videoVolumeBarBg.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; } ); } ) .bind( eCancel, function () { $videoVolumeBarBg.unbind(eMove); } ); } var calcTimeFormat = function (seconds) { var h0 = Math.floor(seconds / 3600); var h = 10 > h0 ? "0" + h0 : h0; var m0 = Math.floor((seconds - h0 * 3600) / 60); var m = 10 > m0 ? "0" + m0 : m0; var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); var s = 10 > s0 ? "0" + s0 : s0; var r = m + ":" + s; if (h0 > 0) { r = h + ":" + r; } return r; }; if (hideplaybutton) { $videoPlay.hide(); } if (hidecontrols) { $videoControls.hide(); } var onVideoPlay = function () { if (!hideplaybutton) { $videoPlay.hide(); } if (!hidecontrols) { $videoBtnPlay.hide(); $videoBtnPause.show(); } }; var onVideoPause = function () { if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoEnded = function () { $(window).trigger("html5lightbox.videoended"); if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoUpdate = function () { var curTime = $videoObj.get(0).currentTime; if (curTime) { $videoTimeCurrent.text(calcTimeFormat(curTime)); var duration = $videoObj.get(0).duration; if (duration) { $videoTimeTotal.text(calcTimeFormat(duration)); if (!sliderDragging) { var sliderW = $videoSeeker.width(); var pos = Math.round((sliderW * curTime) / duration); $videoSeekerPlay.css({ width: pos }); $videoSeekerHandler.css({ left: pos }); } } } }; var onVideoProgress = function () { if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { var sliderW = $videoSeeker.width(); $videoSeekerBuffer.css({ width: Math.round((sliderW * $videoObj.get(0).buffered.end(0)) / $videoObj.get(0).duration) }); } }; try { $videoObj.bind("play", onVideoPlay); $videoObj.bind("pause", onVideoPause); $videoObj.bind("ended", onVideoEnded); $videoObj.bind("timeupdate", onVideoUpdate); $videoObj.bind("progress", onVideoProgress); } catch (e) { } }; })(jQuery); jQuery(".tsvg-html5lightbox-997063").html5lightbox997063({},'997063'); jQuery(function() { jQuery('.tsvg-section-997063').fadeIn(); var tsvgFancyHoverInverse997063 = 'Default'; tsvgFancyHoverInverse997063 = tsvgFancyHoverInverse997063 == 'Default' ? false : true; jQuery('.tsvg-fancy-blocks-list-997063 > li').each(function() { jQuery(this).hoverdir({hoverDelay: 50, inverse:tsvgFancyHoverInverse997063}); }); }); clearInterval(tsvgFancyInterval997063); } }, tsvgFancyReference997063 = ( function tsvgFancySameCall997063() { tsvgFancyInterval997063 = setInterval(tsvgFancyIntervalFunction997063, 1000); return tsvgFancySameCall997063; }() );
'); }else{ jQuery('.tsvg-section-997063 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } var svg = document.querySelector('.btn-lg svg'), svgPath = new Proxy({ y: null, smoothing: null }, { set(target, key, value) { target[key] = value; if(target.y !== null && target.smoothing !== null) { svg.innerHTML = getPath(target.y, target.smoothing, null); } return true; }, get(target, key) { return target[key]; } }); svgPath.y = 20; svgPath.smoothing = 0; } } jQuery('.tsvg-section-997063 .btn-lg').click(function (e) { let max_heigth =jQuery('.tsvg-main-content-997063').height(); let main_length = jQuery('.tsvg-main-content-997063 figure ul li').length; tsvgPaginationLoad997063 = 'false'; if(jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ tsvgPaginationLoad997063 = 'true'; } jQuery('.tsvg-main-content-997063').css({'max-height': max_heigth+'px','transition':'unset'}); setTimeout(() => { jQuery('.tsvg-main-content-997063').css({'transition':'max-height 3s ease-in-out','max-height':main_length+'000vh'}); }, 100); tsvgPaginationCreate997063(jQuery('.tsvg-main-content-997063 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage); if(jQuery('.tsvg-section-997063 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'){ jQuery('.tsvg-section-997063 .btn-lg').addClass('animate'); setTimeout(function(){ jQuery('.tsvg-section-997063 .btn-lg').removeClass('animate'); },700); } if(!jQuery('.tsvg-section-997063 .btn-lg').hasClass('loading')&&(jQuery('.tsvg-section-997063 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery('.tsvg-section-997063 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5')&&jQuery('.tsvg-section-997063 .tsvg-pagination-pages-wrapper svg').length) { jQuery('.tsvg-section-997063 .btn-lg').addClass('loading'); setTimeout(() => { svg.innerHTML = getPath(0, 0, [ [3, 14], [8, 19], [21, 6] ]); }, 1000 / 2); setTimeout(() => { jQuery('.tsvg-section-997063 .btn-lg').removeClass('loading'); if(jQuery('.tsvg-section-997063 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ jQuery('.tsvg-section-997063 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
  • '+load_text+'
'); }else{ jQuery('.tsvg-section-997063 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } }, 2000 ); } }) tsvgPaginationCreate997063(jQuery('.tsvg-section-997063 .tsvg-main-content-997063 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage) } } function tsvgNewPagination997063(){ var interval_pag_fn_997063 = setInterval(setPagina_997063, 100); function setPagina_997063() { if( typeof(jQuery) != "undefined" && jQuery != null){ if( jQuery('.tsvg-main-content-997063').attr("data-pagination")=='pagination'){ tsvgPaginationGenerate997063(); } if( jQuery('.tsvg-main-content-997063').attr("data-pagination")=='load-more'){ tsvgPaginationGenerate997063(); } clearInterval(interval_pag_fn_997063); } } } tsvgNewPagination997063(); function tsvgPaginationGenerate(){ tsvgPaginationGenerate997063(); } function getPoint(point, i, a, smoothing) { let cp = (current, previous, next, reverse) => { let p = previous || current, n = next || current, o = { length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)), angle: Math.atan2(n[1] - p[1], n[0] - p[0]) }, angle = o.angle + (reverse ? Math.PI : 0), length = o.length * smoothing; return [current[0] + Math.cos(angle) * length, current[1] + Math.sin(angle) * length]; }, cps = cp(a[i - 1], a[i - 2], point, false), cpe = cp(point, a[i - 1], a[i + 1], true); return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`; } function getPath(update, smoothing, pointsNew) { let points = pointsNew ? pointsNew : [ [4, 12], [12, update], [20, 12] ], d = points.reduce((acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${getPoint(point, i, a, smoothing)}`, ''); return ``; }
" + "
" + "
" + "
" + "" + "" + "" + "
" + "
" + "" + "
" + "" ); inst.options.positionFixed = inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; inst.$lightbox.css({ position: inst.options.positionFixed ? "fixed" : "absolute" }); inst.$lightbox.appendTo("body"); inst.$lightboxBox = $("#tsvg-fancy-html5-lightbox-box", inst.$lightbox); inst.$elem = $("#tsvg-fancy-html5-elem-box", inst.$lightbox); inst.$elemWrap = $("#tsvg-fancy-html5-elem-wrap", inst.$lightbox); inst.$loading = $("#tsvg-fancy-html5-loading", inst.$lightbox); inst.$error = $("#tsvg-fancy-html5-error", inst.$lightbox); inst.$image = $("#tsvg-fancy-html5-image", inst.$lightbox); var elemText = ""; if (inst.options.titlestyle == "left") { inst.$elem.prepend(elemText); } else { inst.$elem.append(elemText); } inst.$elemData = $("#tsvg-fancy-html5-elem-data-box", inst.$lightbox); inst.$text = $("#tsvg-fancy-html5-text", inst.$lightbox); if (inst.options.borderradius > 0) { inst.$elem.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); if (inst.options.titlestyle == "inside") { inst.$elemWrap.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); } else if (inst.options.titlestyle == "bottom") { inst.$elemWrap.css( { "border-top-left-radius": inst.options.borderradius + "px", "-moz-top-left-border-radius": inst.options.borderradius + "px", "-webkit-top-left-border-radius": inst.options.borderradius + "px", "border-top-right-radius": inst.options.borderradius + "px", "-moz-top-right-border-radius": inst.options.borderradius + "px", "-webkit-top-right-border-radius": inst.options.borderradius + "px", } ); inst.$elemData.css( { "border-bottom-left-radius": inst.options.borderradius + "px", "-moz-top-bottom-border-radius": inst.options.borderradius + "px", "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", "border-bottom-right-radius": inst.options.borderradius + "px", "-moz-bottom-right-border-radius": inst.options.borderradius + "px", "-webkit-bottom-right-border-radius": inst.options.borderradius + "px", } ); } } if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { inst.$lightboxBox.css({ "background-color": inst.options.bgcolor }); if (inst.options.titlestyle == "right") { inst.$elemWrap.css({ position: "relative", float: "left" }); inst.$elemData.css({ position: "relative", overflow: "hidden", padding: inst.options.bordersize + "px" }); } else { inst.$elemWrap.css({ position: "relative", overflow: "hidden" }); inst.$elemData.css({ position: "relative", float: "left", padding: inst.options.bordersize + "px" }); } } else if (inst.options.titlestyle == "inside") { inst.$elemData.css({ position: "absolute", margin: inst.options.bordersize + "px", bottom: 0, left: 0, "background-color": "#333", "background-color": "rgba(51, 51, 51, 0.6)" }); inst.$text.css({ padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" }); } else { inst.$elemData.css( { position: "relative", width: "100%", height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", padding: "0 0 " + inst.options.bordersize + "px" + " 0", "background-color": inst.options.bgcolor, "text-align": "left", } ); inst.$text.css({ margin: "0 " + inst.options.bordersize + "px" }); } if (inst.options.fullscreenmode) { inst.$lightbox.append( "
" + "
" ); inst.$next = $(".tsvg-fancy-html5-next-fullscreen", inst.$lightbox); inst.$prev = $(".tsvg-fancy-html5-prev-fullscreen", inst.$lightbox); inst.$lightboxBox.append( "
" + "
" ); inst.$nextbottom = $(".tsvg-fancy-html5-next-bottom-fullscreen", inst.$lightbox); inst.$prevbottom = $(".tsvg-fancy-html5-prev-bottom-fullscreen", inst.$lightbox); inst.$nextbottom.click( function () { inst.nextArrowClicked(); } ); inst.$prevbottom.click( function () { inst.prevArrowClicked(); } ); inst.$lightbox.append( "
" ); inst.$close = $("#tsvg-fancy-html5-close-fullscreen", inst.$lightbox); } else { inst.$elemWrap.append( "" + "" ); inst.$next = $("#tsvg-fancy-html5-next", inst.$lightbox); inst.$prev = $("#tsvg-fancy-html5-prev", inst.$lightbox); if ((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) { inst.$lightboxBox.append( "
" + "
" ); inst.$nexttouch = $(".tsvg-fancy-html5-next-touch", inst.$lightbox); inst.$prevtouch = $(".tsvg-fancy-html5-prev-touch", inst.$lightbox); inst.$nexttouch.click( function () { inst.nextArrowClicked(); } ); inst.$prevtouch.click( function () { inst.prevArrowClicked(); } ); } inst.$lightboxBox.append( "" ); inst.$close = $("#tsvg-fancy-html5-close", inst.$lightbox); } if (inst.options.showsocial) { var socialCode = '"; inst.$lightboxBox.append(socialCode); $(".tsvg-fancy-html5-social-btn", inst.$lightbox).click( function () { var shareUrl = window.location.href + (0 > window.location.href.indexOf("?") ? "?" : "&") + "html5lightboxshare=" + encodeURIComponent(inst.currentElem[ELEM_HREF]); var shareTitle = inst.currentElem[ELEM_TITLE]; var shareMedia = inst.currentElem[ELEM_HREF]; if (inst.currentElem[ELEM_TYPE] == 0) { shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); } else if (inst.currentElem[ELEM_TYPE] == 3) { shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; } else { var lightboxLink = $('.tsvg-html5lightbox-166264[href="' + inst.currentElem[ELEM_HREF] + '"]'); if (lightboxLink.length > 0) if (lightboxLink.data("shareimage") && lightboxLink.data("shareimage").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); } else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); } else { var lightboxImg = $("img", lightboxLink); if (lightboxImg.length > 0) { shareMedia = inst.absoluteUrl(lightboxImg.attr("src")); } } } var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; if ($(this).hasClass("tsvg-fancy-html5-social-facebook")) { window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-twitter")) { window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-pinterest")) { window.open( "https://pinterest.com/pin/create/bookmarklet/?media=" + encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank" ); } return false; } ); } inst.$watermark = $("#tsvg-fancy-html5-watermark", inst.$lightbox); if (inst.options.stamp) { inst.$watermark.html(""); } else if (inst.options.watermark) { var html = ""; if (inst.options.watermarklink) { html = "" + html + ""; } inst.$watermark.html(html); } if (inst.options.closeonoverlay) { $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).click(inst.finish); } inst.$close.click(inst.finish); inst.$next.click( function () { inst.nextArrowClicked(); } ); inst.$prev.click( function () { inst.prevArrowClicked(); } ); $(window).resize( function () { clearTimeout(inst.options.resizeTimeout); inst.options.resizeTimeout = setTimeout( function () { inst.resizeWindow(); }, 500 ); } ); $(window).scroll( function () { inst.scrollBox(); } ); $(window).bind( "orientationchange", function (e) { if (inst.options.isMobile) { inst.resizeWindow(); } } ); if (inst.options.isIPhone) { inst.options.windowInnerHeight = window.innerHeight; setInterval( function () { if (inst.options.windowInnerHeight != window.innerHeight) { inst.options.windowInnerHeight = window.innerHeight; inst.resizeWindow(); } }, 500 ); } if (inst.options.enabletouchswipe) { inst.enableSwipe(); } }; inst.slideTimer = function (interval, callback, updatecallback) { let timerInstance = this, updateinterval = 50, updateTimerId = null, runningTime = 0, paused = false, started = false, startedandpaused = false; timerInstance.timeout = interval; this.pause = function () { if (started) { paused = true; clearInterval(updateTimerId); } }; this.resume = function (forceresume) { if (startedandpaused && !forceresume) { return; } startedandpaused = false; if (started && paused) { paused = false; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); } }; this.stop = function () { clearInterval(updateTimerId); if (updatecallback) { updatecallback(-1); } runningTime = 0; paused = false; started = false; }; this.start = function () { runningTime = 0; paused = false; started = true; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); }; this.startandpause = function () { runningTime = 0; paused = true; started = true; startedandpaused = true; }; return this; }; inst.updateTimer = function (percent) { var w = Math.round(percent * 100); if (w > 100) { w = 100; } if (0 > w ) { w = 0; } $("#tsvg-fancy-html5-timer", inst.$lightbox).css({ display: "block", width: w + "%" }); }; inst.initSlide = function () { inst.autosliding = false; inst.slideTimeout = inst.slideTimer( inst.options.slideinterval, function () { inst.gotoSlide(-1); }, inst.options.showtimer ? function (percent) { inst.updateTimer(percent); } : null ); if (inst.options.autoslide) { inst.slideTimeout.stop(); inst.autosliding = true; } }; inst.nextArrowClicked = function () { if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") { window[inst.options.onlastarrowclicked](); } } inst.gotoSlide(-1); }; inst.prevArrowClicked = function () { if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && typeof window[inst.options.onfirstarrowclicked] == "function") { window[inst.options.onfirstarrowclicked](); } } inst.gotoSlide(-2); }; inst.calcNextPrevElem = function () { inst.options.nextElem = -1; inst.options.prevElem = -1; inst.options.inGroup = false; inst.options.groupIndex = 0; inst.options.groupCount = 0; var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; for (var i = 0; inst.elemArray.length > i; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (i == inst.options.curElem) { inst.options.groupIndex = inst.options.groupCount; } inst.options.groupCount++; } } var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; if (curGroup != undefined && curGroup != null) { for (j = inst.options.curElem + 1;inst.elemArray.length > j; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } if (0 > inst.options.nextElem) { for (j = 0; inst.options.curElem > j ; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } } if (inst.options.nextElem >= 0) { for (j = inst.options.curElem - 1; j >= 0; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } if (0 > inst.options.prevElem ) { for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } } } } if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) { inst.options.inGroup = true; } }; inst.calcBoxPosition = function (initW, initH) { var boxW = initW + 2 * inst.options.bordersize; var boxH = initH + 2 * inst.options.bordersize; var winH = window.innerHeight ? window.innerHeight : $(window).height(); var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); if (inst.options.titlestyle == "bottom") { boxT -= Math.round(inst.options.barheight / 2); } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; if (topmargin > boxT) { boxT = topmargin; } if (inst.options.insideiframe && window.self != window.top) { if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; var parentscroll = parent.window.document.body.scrollTop; boxT = topmargin; boxT += parentscroll > iframetop ? parentscroll - iframetop : 0; } } return [boxW, boxH, boxT]; }; inst.hideNavArrows = function () { var showPrev = false; var showNext = false; if (inst.options.inGroup) { if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showPrev = true; } if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showNext = true; } } if (showPrev) { inst.$prev.removeClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$prev.addClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.addClass("tsvg-fancy-html5-hide"); } } if (showNext) { inst.$next.removeClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$next.addClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.addClass("tsvg-fancy-html5-hide"); } } }; inst.clickHandler = function (event) { var $this = $(this); var dataoptions = {}; if (jQuery(event.target).prop("tagName") == 'A') { let link = jQuery(event.target).attr('href'); if (jQuery(event.target).attr('target') == '_blank') { window.open(link); } else { window.location.assign(link) } return false; } $.each( $this.data(), function (key, value) { dataoptions[key.toLowerCase()] = value; } ); inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i ; i++) { if (inst.elemArray[i][ELEM_ID] == $this.data("tsvgid")) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; if (inst.options.iequirksmode) { inst.$lightboxBox.css({ top: boxT }); } else { inst.$lightboxBox.css({ "margin-top": boxT }); } if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.loadThumbnail = function (src, index) { let inst_img_elem = document.createElement('img'); inst_img_elem.src = src; inst_img_elem.addEventListener('load', function () { if (inst.options.thumbwidth / inst.options.thumbheight >= inst_img_elem.naturalWidth / inst_img_elem.naturalHeight ) { inst_img_elem.setAttribute("style","width:100%;") } else { inst_img_elem.setAttribute("style","height:100%;") } $(".tsvg-fancy-html5-nav-thumb").eq(index).html(inst_img_elem); }) inst_img_elem.addEventListener('error', function () { console.log('error') }) }; inst.matchGroup = function (curGroup, elemGroup) { if (!curGroup || !elemGroup) { return false; } var curs = curGroup.split(":"); var elems = elemGroup.split(":"); var result = false; for (var i in curs) { if ($.inArray(curs[i], elems) > -1) { result = true; break; } } return result; }; inst.showNavigation = function () { if (!inst.options.shownavigation) { return; } if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) { return; } var i; var showNav = false; var group = inst.currentElem[ELEM_GROUP]; for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { showNav = true; break; } } } if (!showNav) { return; } inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; if ($(".tsvg-fancy-html5-nav").length > 0) { return; } var check_bool = $('.tsvg-fancy-blocks-container').attr('data-tsvg-shn'); if (check_bool === 'false') { return } $("body").append( "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); if (TS_VG_FG_Show_Nav == "true") { var index = 0; } for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { $(".tsvg-fancy-html5-nav-list").append( "
'
" ); this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index) index++; } } } $(".tsvg-fancy-html5-nav-thumb").hover( function () { $(this).css({ opacity: 1 }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor }); }, function () { $(this).css({ opacity: inst.options.thumbopacity }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor }); } ); $(".tsvg-fancy-html5-nav-thumb").click( function () { var index = $(this).data("arrayindex"); if (index >= 0) { inst.gotoSlide(index); } } ); inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); $(".tsvg-fancy-html5-nav-list") .css({ display: "block", position: "relative", "margin-left": 0, width: inst.options.totalwidth + "px" }) .append("
"); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); $navPrev.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; if (marginLeft >= 0) { marginLeft = 0; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (maskWidth - inst.options.totalwidth >= marginLeft ) { $navNext.css({ "background-position": "center left" }); } else { $navNext.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); $navNext.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; if (maskWidth - inst.options.totalwidth >= marginLeft) { marginLeft = maskWidth - inst.options.totalwidth; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (marginLeft >= 0) { $navPrev.css({ "background-position": "center left" }); } else { $navPrev.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.loadElem = function (elem) { inst.currentElem = elem; inst.showing = true; inst.showNavigation(); inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); inst.$loading.show(); if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") { window[inst.options.onshowitem](elem); } switch (elem[ELEM_TYPE]) { case 0: var imgLoader = new Image(); $(imgLoader).load( function () { inst.showImage(elem, imgLoader.width, imgLoader.height); } ); $(imgLoader).error( function () { inst.showError(); } ); imgLoader.src = elem[ELEM_HREF]; break; case 1: inst.showSWF(elem); break; case 2: case 8: inst.showVideo(elem); break; case 3: case 4: case 9: case 11: inst.showYoutubeVimeo(elem); break; case 5: inst.showPDF(elem); break; case 6: inst.showMP3(elem); break; case 7: inst.showWeb(elem); break; case 10: inst.showDiv(elem); break; } if (inst.options.googleanalyticsaccount && window._gaq) { window._gaq.push(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]); } }; inst.loadCurElem = function () { inst.loadElem(inst.elemArray[inst.options.curElem]); }; inst.showError = function () { inst.$loading.hide(); inst.resizeLightbox( inst.options.errorwidth, inst.options.errorheight, true, function () { inst.$error.show(); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); } ); }; inst.calcTextWidth = function (objW) { return objW - 36; }; (inst.showTitle = function (w, t, description) { if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: w + "px" }); } var text = ""; if (inst.options.showtitle) { if (t && t.length > 0) { text += t; } } if (inst.options.inGroup) { if (inst.options.showtitleprefix) { text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", inst.options.groupCount) + " " + text; } jQuery("#tsvg-fancy-html5-elem-data-box").css("display", "none"); if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT != "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (TotalSoft_GV_FG_PD == "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "block"); } if (TotalSoft_GV_FG_PT == "true") { jQuery(".tsvg-fancy-popup-text").css("display", "inline-block"); } if (TotalSoft_GV_FG_PD != "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "none"); } if (TotalSoft_GV_FG_PT != "true") { jQuery(".tsvg-fancy-popup-text").css("display", "none"); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD != "true") { jQuery("#tsvg-fancy-html5-text").css("display", "none"); } } if (inst.options.showdescription && description && description.length > 0) { inst.$text.html(text); } if (inst.options.inGroup && inst.options.showplaybutton) { if (inst.autosliding) { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } else { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); } $("#tsvg-fancy-html5-play", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } ); $("#tsvg-fancy-html5-pause", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.autosliding = false; } } ); } $("#tsvg-fancy-html5-social", inst.$lightbox).show(); }); (inst.showImage = function (elem, imgW, imgH) { var elemW, elemH; if (elem[ELEM_WIDTH]) { elemW = elem[ELEM_WIDTH]; } else { elemW = imgW; elem[ELEM_WIDTH] = imgW; } if (elem[ELEM_HEIGHT]) { elemH = elem[ELEM_HEIGHT]; } else { elemH = imgH; elem[ELEM_HEIGHT] = imgH; } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, inst.options.imagekeepratio); inst.resizeLightbox( sizeObj.w, sizeObj.h, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : ""; inst.$image.show(); inst.$image.html( "
" + timercode + "
" ); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }); inst.showSWF = function (elem) { var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); inst.embedFlash($("#tsvg-html5lightbox-swf"), elem[ELEM_HREF], "window", { width: dataW, height: dataH }); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showVideo = function (elem) { inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var isHTML5 = false; if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || (inst.options.isIE9 && inst.options.useflashonie9) || (inst.options.isIE10 && inst.options.useflashonie10) || (inst.options.isIE11 && inst.options.useflashonie11)) { isHTML5 = false; } else if (inst.options.isMobile) { isHTML5 = true; } else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) { if ((!inst.options.isFirefox && !inst.options.isOpera) || ((inst.options.isFirefox || inst.options.isOpera) && (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM]))) { isHTML5 = true; } } if (isHTML5) { var videoSrc = elem[ELEM_HREF]; if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) { videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; } inst.embedHTML5Video($("#tsvg-html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo); } else { var videoFile = elem[ELEM_HREF]; if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") { videoFile = inst.options.htmlfolder + videoFile; } inst.embedFlash( $("#tsvg-html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { width: dataW, height: dataH, jsobjectname: "html5Lightbox", hidecontrols: inst.options.videohidecontrols ? "1" : "0", hideplaybutton: "0", videofile: videoFile, hdfile: "", ishd: "0", defaultvolume: inst.options.defaultvideovolume, autoplay: inst.options.autoplay ? "1" : "0", loop: inst.options.loopvideo ? "1" : "0", errorcss: ".html5box-error" + inst.options.errorcss, id: 0, } ); } inst.$elem.show(); inst.showData(); } ); }; inst.loadNext = function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } }; inst.getYoutubeParams = function (href) { var result = {}; if (0 > href.indexOf("?") ) { return result; } var params = href.substring(href.indexOf("?") + 1).split("&"); for (var i = 0;params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2 && value[0].toLowerCase() != "v") { result[value[0].toLowerCase()] = value[1]; } } return result; }; inst.getYoutubeId = function (href) { var youtubeId = ""; var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(shorts\/)|(watch\??v?=?))([^#\&\?]*).*/; var match = href.match(regExp); if (match && match[match.length -1].length == 11) { youtubeId = match[match.length -1]; } return youtubeId; }; inst.prepareYoutubeHref = function (href) { let youtubeId = inst.getYoutubeId(href), protocol = "https:", result = protocol + "//www.youtube.com/embed/" + youtubeId, params = this.getYoutubeParams(href), first = true; for (var key in params) { if (first) { result += "?"; first = false; } else { result += "&"; } result += key + "=" + params[key]; } return result; }; inst.prepareDailymotionHref = function (href) { if (href.match(/\:\/\/.*(dai\.ly)/i)) { var protocol = "https:"; var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; href = protocol + "" + id; } return href; }; inst.showYoutubeVimeo = function (elem) { var tsvg_autoplay = jQuery('.tsvg-main-content-' + id).attr('data-tsvg-autoplay'); inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var href = elem[ELEM_HREF]; var youtubeid = ""; if (elem[ELEM_TYPE] == 3) { youtubeid = inst.getYoutubeId(href); href = inst.prepareYoutubeHref(href); if (tsvg_autoplay == "true") { href += "?autoplay=1&mute=1" } else { href += "?autoplay=0&mute=0" } } if (elem[ELEM_TYPE] == 9) { href = inst.prepareDailymotionHref(href); } if (inst.options.autoplay) { if (elem[ELEM_TYPE] == 4) { if (href.indexOf('player.vimeo.com/video/') > -1) { if (tsvg_autoplay == "true") { href += "?autoplay=1&muted=1"; } } } } if (inst.options.loopvideo) { href += 0 > href.indexOf("?") ? "?" : "&"; switch (elem[ELEM_TYPE]) { case 3: href += "loop=1&playlist=" + youtubeid; break; case 4: case 9: href += "loop=1"; break; case 11: href += "endVideoBehavior=loop"; break; } } if (elem[ELEM_TYPE] == 3 && Totalsoft_FG_ShVAutoPl == "true") { if (0 > href.indexOf("?")) { href += "?wmode=transparent&rel=0&iv_load_policy=3"; } else { href += "&wmode=transparent&rel=0&iv_load_policy=3"; } if (inst.options.videohidecontrols) { href += "&controls=0&showinfo=0"; } href += "&mute=1&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname; } if (href.indexOf('.mp4') > -1) { let autoplay_bool = tsvg_autoplay == "true" ? "autoplay muted" : ""; $("#tsvg-html5lightbox-video").html(''); } else { $("#tsvg-html5lightbox-video").html(""); } inst.$elem.show(); inst.showData(); if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") { new YT.Player( "html5boxiframevideo", { events: { onStateChange: function (event) { if (event.data == YT.PlayerState.ENDED) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } }, }, } ); } else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { var vimeoIframe = $("#html5boxiframevideo")[0]; var vimeoPlayer = $f(vimeoIframe); vimeoPlayer.addEvent( "ready", function () { vimeoPlayer.addEvent( "finish", function (id) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); } ); } } ); }; inst.showPDF = function (elem) { }; inst.showMP3 = function (elem) { }; inst.showDiv = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var divID = elem[ELEM_HREF]; if ($(divID).length > 0) { $("#tsvg-html5lightbox-div").html($(divID).html()); } else { $("#tsvg-html5lightbox-div").html("
The specified div ID does not exist.
"); } inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showWeb = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); var tsvgRumbleCheck = elem[ELEM_HREF].indexOf('rumble.com/') > -1 ? 'sandbox="allow-scripts"' : ''; dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); $("#tsvg-html5lightbox-web").html(""); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.scrollBox = function () { }; inst.resizeWindow = function () { if (!inst.currentElem) { return; } if (!inst.options.responsive) { return; } var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); if (inst.options.responsivebarheight) { if (inst.options.smallscreenheight >= winH) { inst.options.barheight = inst.options.barheightonsmallheight; } else { inst.options.barheight = inst.options.barheightoriginal; } if (inst.options.titlestyle == "bottom" && inst.options.barautoheight != "auto") { inst.$elemData.css({ height: inst.options.barheight + "px", "max-height": inst.options.barheight + "px" }); } } var elemW, elemH, keepratio; if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; keepratio = false; } else { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; if (inst.currentElem[ELEM_TYPE] == 0) { keepratio = inst.options.imagekeepratio; } else { keepratio = true; } } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, keepratio); var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: sizeObj.w + "px" }); } if (0 >= $(".tsvg-fancy-html5-nav").length ) { return; } $(".tsvg-fancy-html5-nav-list").css({ "margin-left": 0 }); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.calcElemSize = function (sizeObj, keepratio) { if (!inst.options.responsive) { return sizeObj; } var winWidth = $(window).width(); winWidth = winWidth ? winWidth : $(document).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); winH = winH ? winH : $(document).height(); if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) { sizeObj.w = (sizeObj.w * 100) / inst.options.imagepercentage; } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; if (inst.options.titlestyle == "bottom") { h0 -= inst.options.barheight; } if (((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && inst.options.sidetobottomscreenwidth >= winWidth ) || (inst.options.notkeepratioonsmallheight && inst.options.smallscreenheight >= winH)) { keepratio = false; } if (sizeObj.h > h0) { if (keepratio) { sizeObj.w = Math.round((sizeObj.w * h0) / sizeObj.h); } sizeObj.h = h0; } var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; if ( (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth) || (((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) ) { w0 -= 64; } if (sizeObj.w > w0) { if (keepratio) { sizeObj.h = Math.round((sizeObj.h * w0) / sizeObj.w); } sizeObj.w = w0; } return sizeObj; }; inst.showData = function () { if (inst.$text.text().length > 0) { inst.$elemData.show(); } if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$lightboxBox.css({ height: "auto" }); } if (inst.$text.text().length > 0 && inst.options.titlestyle == "bottom") { inst.$elemData.css({ "max-height": inst.options.barheight + "px" }); } $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).css({ height: Math.max($(window).height(), $(document).height()) }); $(window).trigger("html5lightbox.lightboxopened"); }; inst.resizeLightbox = function (elemW, elemH, bAnimate, onFinish) { inst.hideNavArrows(); var boxPos = inst.calcBoxPosition(elemW, elemH); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$loading.hide(); inst.$watermark.hide(); if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastitem && window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") { window[inst.options.onlastitem](inst.currentElem); } } if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") { window[inst.options.onfirstitem](inst.currentElem); } } if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { inst.$elem.bind( "mouseenter mousemove", function () { if ((inst.options.arrowloop && inst.options.prevElem >= 0) || (!inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.curElem > inst.options.prevElem )) { inst.$prev.fadeIn(); } if ((inst.options.arrowloop && inst.options.nextElem >= 0) || (!inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem)) { inst.$next.fadeIn(); } } ); inst.$elem.bind( "mouseleave", function () { inst.$next.fadeOut(); inst.$prev.fadeOut(); } ); } inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) { speed = 0; } inst.$lightboxBox.animate({ width: boxW }, speed).animate( { height: boxH }, speed, function () { inst.onAnimateFinish(onFinish); } ); } else { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) { speed = 0; } inst.$lightboxBox.css({ width: boxW, height: "auto", "min-width": boxW - 15 }); inst.$elemWrap.animate({ width: boxW, "min-width": boxW - 15 }, speed).animate( { height: boxH, "min-height": boxH - 15 }, speed, function () { inst.onAnimateFinish(onFinish); } ); } }; inst.onAnimateFinish = function (onFinish) { inst.$loading.show(); inst.$watermark.show(); inst.$close.show(); inst.$elem.css({ "background-color": inst.options.bgcolor }); onFinish(); }; inst.reset = function () { if (inst.options.stamp) { inst.$watermark.hide(); } inst.showing = false; inst.$image.empty(); inst.$text.empty(); inst.$error.hide(); inst.$loading.hide(); inst.$image.hide(); if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$elemData.hide(); } if (!inst.options.fullscreenmode) { inst.$close.hide(); } inst.$elem.css({ "background-color": "" }); }; inst.resetNavigation = function () { inst.options.navheight = 0; $(".tsvg-fancy-html5-nav").remove(); }; inst.finish = function () { if ($("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).length) { $("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).attr("src", ""); } $("head") .find("style") .each( function () { if ($(this).data("creator") == "tsvg-fancy-html5box-html5-lightbox") { $(this).remove(); } } ); inst.slideTimeout.stop(); inst.reset(); inst.resetNavigation(); inst.$lightbox.remove(); $("#tsvg-fancy-html5box-html5-lightbox").remove(); inst.showObjects(); if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") { window[inst.options.oncloselightbox](inst.currentElem); } if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") { inst.onLightboxClosed(inst.currentElem); } }; inst.pauseSlide = function () { }; inst.playSlide = function () { }; inst.gotoSlide = function (slide) { if (slide == -1) { if (0 > inst.options.nextElem ) { return; } inst.options.curElem = inst.options.nextElem; } else if (slide == -2) { if (0 > inst.options.prevElem ) { return; } inst.options.curElem = inst.options.prevElem; } else if (slide >= 0) { inst.options.curElem = slide; } if (inst.autosliding) { inst.slideTimeout.stop(); } inst.calcNextPrevElem(); inst.reset(); inst.loadCurElem(); }; inst.enableSwipe = function () { inst.$elem.html5lightboxTouchSwipe166264( { preventWebBrowser: false, swipeLeft: function () { inst.gotoSlide(-1); }, swipeRight: function () { inst.gotoSlide(-2); }, } ); }; inst.hideObjects = function () { $("select, embed, object").css({ visibility: "hidden" }); }; inst.showObjects = function () { $("select, embed, object").css({ visibility: "visible" }); }; inst.embedHTML5Video = function ($container, src, autoplay, loopvideo) { let embedVideoPoster = (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : ""), embedVideoControls = (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : ""); $container.html( "
" ); if (!inst.options.nativehtml5controls) { $("video", $container).data("src", src); $("video", $container).lightboxHTML5VideoControls166264(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume); } $("video", $container) .unbind("ended") .bind( "ended", function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); }; inst.embedFlash = function ($container, src, wmode, flashVars) { if (inst.options.flashInstalled) { var htmlOptions = { pluginspage: "", quality: "high", allowFullScreen: "true", allowScriptAccess: "always", type: "application/x-shockwave-flash" }; htmlOptions.width = "100%"; htmlOptions.height = "100%"; htmlOptions.src = src; htmlOptions.flashVars = $.param(flashVars); htmlOptions.wmode = wmode; var htmlString = ""; for (var key in htmlOptions) { htmlString += key + "=" + htmlOptions[key] + " "; } $container.html(""); } else { $container.html( "
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
" ); } }; inst.checkType = function (href) { if (!href) { return -1; } if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) { return 0; } if (href.match(/[^\.]\.(swf)\s*$/i)) { return 1; } if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) { return 4; } if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) { return 3; } if (href.match(/\:\/\/.*(vimeo\.com)/i)) { return 4; } if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) { return 9; } if (href.match(/[^\.]\.(pdf)\s*$/i)) { return 5; } if (href.match(/[^\.]\.(mp3)\s*$/i)) { return 6; } if (href.match(/[^\.]\.(flv)\s*$/i)) { return 8; } if (href.match(/\#\w+/i)) { return 10; } if (href.match(/\:\/\/.*(wistia)/i)) { return 11; } return 7; }; inst.getURLParams = function () { var result = {}; var params = window.location.search.substring(1).split("&"); for (var i = 0; params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2) { result[value[0].toLowerCase()] = unescape(value[1]); } } return result; }; inst.absoluteUrl = function (href) { var link = document.createElement("a"); link.href = href; return link.protocol + "//" + link.host + link.pathname + link.search + link.hash; }; inst.showLightbox = function (type, href, title, width, height, webm, ogg, thumbnail, description) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)); }; inst.addItem = function (href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { type = mediatype && mediatype >= 0 ? mediatype : inst.checkType(href); inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)); }; inst.showItem = function (href) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i; i++) { if (inst.elemArray[i][ELEM_HREF] == href) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.unbind("click").click(inst.clickHandler); inst.each( function () { var self = $(this); if (self.data("autoopen")) { setTimeout( function () { self.click(); }, self.data("autoopendelay") ? self.data("autoopendelay") : 0 ); return false; } } ); var urlParams = inst.getURLParams(); if ("html5lightboxshare" in urlParams) { var shareUrl = decodeURIComponent(urlParams["html5lightboxshare"]); var shareLink = $('.tsvg-html5lightbox-166264[href="' + shareUrl + '"]'); if (shareLink.length > 0) { shareLink.click(); } } return inst; }; })(jQuery); (function ($) { $.fn.html5lightboxTouchSwipe166264 = function (options) { var defaults = { preventWebBrowser: false, swipeLeft: null, swipeRight: null, swipeTop: null, swipeBottom: null }; if (options) { $.extend(defaults, options); } return this.each( function () { var startX = -1, startY = -1; var curX = -1, curY = -1; function touchStart(event) { var e = event.originalEvent; if (e.targetTouches.length >= 1) { startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchMove(event) { if (defaults.preventWebBrowser) { event.preventDefault(); } var e = event.originalEvent; if (e.targetTouches.length >= 1) { curX = e.targetTouches[0].pageX; curY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchEnd(event) { if (curX > 0 || curY > 0) { triggerHandler(); touchCancel(event); } else { touchCancel(event); } } function touchCancel(event) { startX = -1; startY = -1; curX = -1; curY = -1; } function triggerHandler() { if (Math.abs(curX - startX) > Math.abs(curY - startY)) { if (curX > startX) { if (defaults.swipeRight) { defaults.swipeRight.call(); } } else { if (defaults.swipeLeft) { defaults.swipeLeft.call(); } } } else if (curY > startY) { if (defaults.swipeBottom) { defaults.swipeBottom.call(); } } else if (defaults.swipeTop) { defaults.swipeTop.call(); } } try { $(this).bind("touchstart", touchStart); $(this).bind("touchmove", touchMove); $(this).bind("touchend", touchEnd); $(this).bind("touchcancel", touchCancel); } catch (e) { } } ); }; })(jQuery); (function ($) { $.fn.lightboxHTML5VideoControls166264 = function (skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { var isTouch = "ontouchstart" in window; var eStart = isTouch ? "touchstart" : "mousedown"; var eMove = isTouch ? "touchmove" : "mousemove"; var eCancel = isTouch ? "touchcancel" : "mouseup"; var eClick = "click"; var BUTTON_SIZE = 32; var BAR_HEIGHT = isTouch ? 48 : 36; var hideControlsTimerId = null; var hideVolumeBarTimeoutId = null; var sliderDragging = false; var isFullscreen = false; var userActive = true; var isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; var isHd = $(this).data("ishd"); var hd = $(this).data("hd"); var src = $(this).data("src"); var $videoObj = $(this); $videoObj.get(0).removeAttribute("controls"); if (isIPhone) { var h = $videoObj.height() - BAR_HEIGHT; $videoObj.css({ height: h }); } var $videoPlay = $("
"); if (!isIPhone) { $videoObj.after($videoPlay); $videoPlay .css( { position: "absolute", top: "50%", left: "50%", display: "block", cursor: "pointer", width: 64, height: 64, "margin-left": -32, "margin-top": -32, "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", "background-position": "center center", "background-repeat": "no-repeat", } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); } var $videoFullscreenBg = $("
"); var $videoControls = $( "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); $videoObj.after($videoControls); $videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({ display: "none", position: "fixed", left: 0, top: 0, bottom: 0, right: 0, "z-index": 2147483647 }); $videoControls.css({ display: "block", position: "absolute", width: "100%", height: BAR_HEIGHT, left: 0, bottom: 0, right: 0, "max-width": "640px", margin: "0 auto" }); var userActivate = function () { userActive = true; }; $videoObj .bind( eClick, function () { userActive = true; } ) .hover( function () { userActive = true; }, function () { userActive = false; } ); if (!hidecontrols) { setInterval( function () { if (userActive) { $videoControls.show(); userActive = false; clearTimeout(hideControlsTimerId); hideControlsTimerId = setTimeout( function () { if (!$videoObj.get(0).paused) { $videoControls.fadeOut(); } }, 5e3 ); } }, 250 ); } $(".html5boxVideoControlsBg", $videoControls).css({ display: "block", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)" }); $(".html5boxPlayPause", $videoControls).css({ display: "block", position: "relative", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), float: "left" }); var $videoBtnPlay = $(".html5boxPlay", $videoControls); var $videoBtnPause = $(".html5boxPause", $videoControls); $videoBtnPlay .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top left", } ) .hover( function () { $(this).css({ "background-position": "bottom left" }); }, function () { $(this).css({ "background-position": "top left" }); } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); $videoBtnPause .css( { display: "none", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top right", } ) .hover( function () { $(this).css({ "background-position": "bottom right" }); }, function () { $(this).css({ "background-position": "top right" }); } ) .bind( eClick, function () { $videoObj.get(0).pause(); } ); var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); var $videoSeeker = $(".html5boxSeeker", $videoControls); var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); $videoTimeCurrent.css( { display: "block", position: "relative", float: "left", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoTimeTotal.css( { display: "block", position: "relative", float: "right", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoSeeker .css({ display: "block", cursor: "pointer", overflow: "hidden", position: "relative", height: "10px", "background-color": "#222", margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" }) .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); $videoSeeker.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); } ); } ) .bind( eCancel, function () { $videoSeeker.unbind(eMove); } ); $videoSeekerBuffer.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#444" }); $videoSeekerPlay.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#fcc500" }); if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { var switchScreen = function (fullscreen) { if (fullscreen) { if ($videoObj.get(0).requestFullscreen) { $videoObj.get(0).requestFullscreen(); } else if ($videoObj.get(0).webkitRequestFullScreen) { $videoObj.get(0).webkitRequestFullScreen(); } else if ($videoObj.get(0).mozRequestFullScreen) { $videoObj.get(0).mozRequestFullScreen(); } else if ($videoObj.get(0).webkitEnterFullScreen) { $videoObj.get(0).webkitEnterFullScreen(); } if ($videoObj.get(0).msRequestFullscreen) { $videoObj.get(0).msRequestFullscreen(); } } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }; var switchScreenCSS = function (fullscreen) { $videoControls.css({ position: fullscreen ? "fixed" : "absolute" }); var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); $videoFullscreen.css({ "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY }); $videoFullscreenBg.css({ display: fullscreen ? "block" : "none" }); if (fullscreen) { $(document).bind("mousemove", userActivate); $videoControls.css({ "z-index": 2147483647 }); } else { $(document).unbind("mousemove", userActivate); $videoControls.css({ "z-index": "" }); } }; document.addEventListener( "fullscreenchange", function () { isFullscreen = document.fullscreen; switchScreenCSS(document.fullscreen); }, false ); document.addEventListener( "mozfullscreenchange", function () { isFullscreen = document.mozFullScreen; switchScreenCSS(document.mozFullScreen); }, false ); document.addEventListener( "webkitfullscreenchange", function () { isFullscreen = document.webkitIsFullScreen; switchScreenCSS(document.webkitIsFullScreen); }, false ); $videoObj.get(0).addEventListener( "webkitbeginfullscreen", function () { isFullscreen = true; }, false ); $videoObj.get(0).addEventListener( "webkitendfullscreen", function () { isFullscreen = false; }, false ); $("head").append(""); var $videoFullscreen = $(".html5boxFullscreen", $videoControls); $videoFullscreen .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", "background-position": "left top", } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { isFullscreen = !isFullscreen; switchScreen(isFullscreen); } ); } if (hd) { var $videoHD = $(".html5boxHD", $videoControls); $videoHD .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_hd.png" + "')", "background-position": (isHd ? "right" : "left") + " center", } ) .bind( eClick, function () { isHd = !isHd; $(this).css({ "background-position": (isHd ? "right" : "left") + " center" }); parentInst.isHd = isHd; var isPaused = $videoObj.get(0).isPaused; $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); if (!isPaused) { $videoObj.get(0).play(); } else if (!isIPhone) { $videoObj.get(0).pause(); } } ); } $videoObj.get(0).volume = defaultvolume; var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; var volume = $videoObj.get(0).volume; $videoObj.get(0).volume = volume / 2 + 0.1; if ($videoObj.get(0).volume === volume / 2 + 0.1) { $videoObj.get(0).volume = volume; var $videoVolume = $(".html5boxVolume", $videoControls); var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); $videoVolume.css({ display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) }).hover( function () { clearTimeout(hideVolumeBarTimeoutId); var volume = $videoObj.get(0).volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); $videoVolumeBar.show(); }, function () { clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId = setTimeout( function () { $videoVolumeBar.hide(); }, 1e3 ); } ); $videoVolumeButton .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", "background-position": "top " + (volume > 0 ? "left" : "right"), } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { var volume = $videoObj.get(0).volume; if (volume > 0) { volumeSaved = volume; volume = 0; } else { volume = volumeSaved; } var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); $videoVolumeButton.css({ "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY }); $videoObj.get(0).volume = volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); } ); $videoVolumeBar.css( { display: "none", position: "absolute", left: 4, bottom: "100%", width: 24, height: 80, "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)", } ); $videoVolumeBarBg.css({ display: "block", position: "relative", width: 10, height: 68, margin: 7, cursor: "pointer", "background-color": "#222" }); $videoVolumeBarActive.css({ display: "block", position: "absolute", bottom: 0, left: 0, width: "100%", height: "100%", "background-color": "#fcc500" }); $videoVolumeBarBg .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; $videoVolumeBarBg.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; } ); } ) .bind( eCancel, function () { $videoVolumeBarBg.unbind(eMove); } ); } var calcTimeFormat = function (seconds) { var h0 = Math.floor(seconds / 3600); var h = 10 > h0 ? "0" + h0 : h0; var m0 = Math.floor((seconds - h0 * 3600) / 60); var m = 10 > m0 ? "0" + m0 : m0; var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); var s = 10 > s0 ? "0" + s0 : s0; var r = m + ":" + s; if (h0 > 0) { r = h + ":" + r; } return r; }; if (hideplaybutton) { $videoPlay.hide(); } if (hidecontrols) { $videoControls.hide(); } var onVideoPlay = function () { if (!hideplaybutton) { $videoPlay.hide(); } if (!hidecontrols) { $videoBtnPlay.hide(); $videoBtnPause.show(); } }; var onVideoPause = function () { if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoEnded = function () { $(window).trigger("html5lightbox.videoended"); if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoUpdate = function () { var curTime = $videoObj.get(0).currentTime; if (curTime) { $videoTimeCurrent.text(calcTimeFormat(curTime)); var duration = $videoObj.get(0).duration; if (duration) { $videoTimeTotal.text(calcTimeFormat(duration)); if (!sliderDragging) { var sliderW = $videoSeeker.width(); var pos = Math.round((sliderW * curTime) / duration); $videoSeekerPlay.css({ width: pos }); $videoSeekerHandler.css({ left: pos }); } } } }; var onVideoProgress = function () { if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { var sliderW = $videoSeeker.width(); $videoSeekerBuffer.css({ width: Math.round((sliderW * $videoObj.get(0).buffered.end(0)) / $videoObj.get(0).duration) }); } }; try { $videoObj.bind("play", onVideoPlay); $videoObj.bind("pause", onVideoPause); $videoObj.bind("ended", onVideoEnded); $videoObj.bind("timeupdate", onVideoUpdate); $videoObj.bind("progress", onVideoProgress); } catch (e) { } }; })(jQuery); jQuery(".tsvg-html5lightbox-166264").html5lightbox166264({},'166264'); jQuery(function() { jQuery('.tsvg-section-166264').fadeIn(); var tsvgFancyHoverInverse166264 = 'Default'; tsvgFancyHoverInverse166264 = tsvgFancyHoverInverse166264 == 'Default' ? false : true; jQuery('.tsvg-fancy-blocks-list-166264 > li').each(function() { jQuery(this).hoverdir({hoverDelay: 50, inverse:tsvgFancyHoverInverse166264}); }); }); clearInterval(tsvgFancyInterval166264); } }, tsvgFancyReference166264 = ( function tsvgFancySameCall166264() { tsvgFancyInterval166264 = setInterval(tsvgFancyIntervalFunction166264, 1000); return tsvgFancySameCall166264; }() );
'); }else{ jQuery('.tsvg-section-166264 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } var svg = document.querySelector('.btn-lg svg'), svgPath = new Proxy({ y: null, smoothing: null }, { set(target, key, value) { target[key] = value; if(target.y !== null && target.smoothing !== null) { svg.innerHTML = getPath(target.y, target.smoothing, null); } return true; }, get(target, key) { return target[key]; } }); svgPath.y = 20; svgPath.smoothing = 0; } } jQuery('.tsvg-section-166264 .btn-lg').click(function (e) { let max_heigth =jQuery('.tsvg-main-content-166264').height(); let main_length = jQuery('.tsvg-main-content-166264 figure ul li').length; tsvgPaginationLoad166264 = 'false'; if(jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ tsvgPaginationLoad166264 = 'true'; } jQuery('.tsvg-main-content-166264').css({'max-height': max_heigth+'px','transition':'unset'}); setTimeout(() => { jQuery('.tsvg-main-content-166264').css({'transition':'max-height 3s ease-in-out','max-height':main_length+'000vh'}); }, 100); tsvgPaginationCreate166264(jQuery('.tsvg-main-content-166264 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage); if(jQuery('.tsvg-section-166264 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'){ jQuery('.tsvg-section-166264 .btn-lg').addClass('animate'); setTimeout(function(){ jQuery('.tsvg-section-166264 .btn-lg').removeClass('animate'); },700); } if(!jQuery('.tsvg-section-166264 .btn-lg').hasClass('loading')&&(jQuery('.tsvg-section-166264 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery('.tsvg-section-166264 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5')&&jQuery('.tsvg-section-166264 .tsvg-pagination-pages-wrapper svg').length) { jQuery('.tsvg-section-166264 .btn-lg').addClass('loading'); setTimeout(() => { svg.innerHTML = getPath(0, 0, [ [3, 14], [8, 19], [21, 6] ]); }, 1000 / 2); setTimeout(() => { jQuery('.tsvg-section-166264 .btn-lg').removeClass('loading'); if(jQuery('.tsvg-section-166264 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ jQuery('.tsvg-section-166264 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
  • '+load_text+'
'); }else{ jQuery('.tsvg-section-166264 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } }, 2000 ); } }) tsvgPaginationCreate166264(jQuery('.tsvg-section-166264 .tsvg-main-content-166264 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage) } } function tsvgNewPagination166264(){ var interval_pag_fn_166264 = setInterval(setPagina_166264, 100); function setPagina_166264() { if( typeof(jQuery) != "undefined" && jQuery != null){ if( jQuery('.tsvg-main-content-166264').attr("data-pagination")=='pagination'){ tsvgPaginationGenerate166264(); } if( jQuery('.tsvg-main-content-166264').attr("data-pagination")=='load-more'){ tsvgPaginationGenerate166264(); } clearInterval(interval_pag_fn_166264); } } } tsvgNewPagination166264(); function tsvgPaginationGenerate(){ tsvgPaginationGenerate166264(); } function getPoint(point, i, a, smoothing) { let cp = (current, previous, next, reverse) => { let p = previous || current, n = next || current, o = { length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)), angle: Math.atan2(n[1] - p[1], n[0] - p[0]) }, angle = o.angle + (reverse ? Math.PI : 0), length = o.length * smoothing; return [current[0] + Math.cos(angle) * length, current[1] + Math.sin(angle) * length]; }, cps = cp(a[i - 1], a[i - 2], point, false), cpe = cp(point, a[i - 1], a[i + 1], true); return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`; } function getPath(update, smoothing, pointsNew) { let points = pointsNew ? pointsNew : [ [4, 12], [12, update], [20, 12] ], d = points.reduce((acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${getPoint(point, i, a, smoothing)}`, ''); return ``; }
" + "
" + "
" + "
" + "" + "" + "" + "
" + "
" + "" + "
" + "
" ); inst.options.positionFixed = inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; inst.$lightbox.css({ position: inst.options.positionFixed ? "fixed" : "absolute" }); inst.$lightbox.appendTo("body"); inst.$lightboxBox = $("#tsvg-fancy-html5-lightbox-box", inst.$lightbox); inst.$elem = $("#tsvg-fancy-html5-elem-box", inst.$lightbox); inst.$elemWrap = $("#tsvg-fancy-html5-elem-wrap", inst.$lightbox); inst.$loading = $("#tsvg-fancy-html5-loading", inst.$lightbox); inst.$error = $("#tsvg-fancy-html5-error", inst.$lightbox); inst.$image = $("#tsvg-fancy-html5-image", inst.$lightbox); var elemText = ""; if (inst.options.titlestyle == "left") { inst.$elem.prepend(elemText); } else { inst.$elem.append(elemText); } inst.$elemData = $("#tsvg-fancy-html5-elem-data-box", inst.$lightbox); inst.$text = $("#tsvg-fancy-html5-text", inst.$lightbox); if (inst.options.borderradius > 0) { inst.$elem.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); if (inst.options.titlestyle == "inside") { inst.$elemWrap.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); } else if (inst.options.titlestyle == "bottom") { inst.$elemWrap.css( { "border-top-left-radius": inst.options.borderradius + "px", "-moz-top-left-border-radius": inst.options.borderradius + "px", "-webkit-top-left-border-radius": inst.options.borderradius + "px", "border-top-right-radius": inst.options.borderradius + "px", "-moz-top-right-border-radius": inst.options.borderradius + "px", "-webkit-top-right-border-radius": inst.options.borderradius + "px", } ); inst.$elemData.css( { "border-bottom-left-radius": inst.options.borderradius + "px", "-moz-top-bottom-border-radius": inst.options.borderradius + "px", "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", "border-bottom-right-radius": inst.options.borderradius + "px", "-moz-bottom-right-border-radius": inst.options.borderradius + "px", "-webkit-bottom-right-border-radius": inst.options.borderradius + "px", } ); } } if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { inst.$lightboxBox.css({ "background-color": inst.options.bgcolor }); if (inst.options.titlestyle == "right") { inst.$elemWrap.css({ position: "relative", float: "left" }); inst.$elemData.css({ position: "relative", overflow: "hidden", padding: inst.options.bordersize + "px" }); } else { inst.$elemWrap.css({ position: "relative", overflow: "hidden" }); inst.$elemData.css({ position: "relative", float: "left", padding: inst.options.bordersize + "px" }); } } else if (inst.options.titlestyle == "inside") { inst.$elemData.css({ position: "absolute", margin: inst.options.bordersize + "px", bottom: 0, left: 0, "background-color": "#333", "background-color": "rgba(51, 51, 51, 0.6)" }); inst.$text.css({ padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" }); } else { inst.$elemData.css( { position: "relative", width: "100%", height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", padding: "0 0 " + inst.options.bordersize + "px" + " 0", "background-color": inst.options.bgcolor, "text-align": "left", } ); inst.$text.css({ margin: "0 " + inst.options.bordersize + "px" }); } if (inst.options.fullscreenmode) { inst.$lightbox.append( "
" + "
" ); inst.$next = $(".tsvg-fancy-html5-next-fullscreen", inst.$lightbox); inst.$prev = $(".tsvg-fancy-html5-prev-fullscreen", inst.$lightbox); inst.$lightboxBox.append( "
" + "
" ); inst.$nextbottom = $(".tsvg-fancy-html5-next-bottom-fullscreen", inst.$lightbox); inst.$prevbottom = $(".tsvg-fancy-html5-prev-bottom-fullscreen", inst.$lightbox); inst.$nextbottom.click( function () { inst.nextArrowClicked(); } ); inst.$prevbottom.click( function () { inst.prevArrowClicked(); } ); inst.$lightbox.append( "
" ); inst.$close = $("#tsvg-fancy-html5-close-fullscreen", inst.$lightbox); } else { inst.$elemWrap.append( "" + "" ); inst.$next = $("#tsvg-fancy-html5-next", inst.$lightbox); inst.$prev = $("#tsvg-fancy-html5-prev", inst.$lightbox); if ((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) { inst.$lightboxBox.append( "
" + "
" ); inst.$nexttouch = $(".tsvg-fancy-html5-next-touch", inst.$lightbox); inst.$prevtouch = $(".tsvg-fancy-html5-prev-touch", inst.$lightbox); inst.$nexttouch.click( function () { inst.nextArrowClicked(); } ); inst.$prevtouch.click( function () { inst.prevArrowClicked(); } ); } inst.$lightboxBox.append( "" ); inst.$close = $("#tsvg-fancy-html5-close", inst.$lightbox); } if (inst.options.showsocial) { var socialCode = '"; inst.$lightboxBox.append(socialCode); $(".tsvg-fancy-html5-social-btn", inst.$lightbox).click( function () { var shareUrl = window.location.href + (0 > window.location.href.indexOf("?") ? "?" : "&") + "html5lightboxshare=" + encodeURIComponent(inst.currentElem[ELEM_HREF]); var shareTitle = inst.currentElem[ELEM_TITLE]; var shareMedia = inst.currentElem[ELEM_HREF]; if (inst.currentElem[ELEM_TYPE] == 0) { shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); } else if (inst.currentElem[ELEM_TYPE] == 3) { shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; } else { var lightboxLink = $('.tsvg-html5lightbox-248095[href="' + inst.currentElem[ELEM_HREF] + '"]'); if (lightboxLink.length > 0) if (lightboxLink.data("shareimage") && lightboxLink.data("shareimage").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); } else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); } else { var lightboxImg = $("img", lightboxLink); if (lightboxImg.length > 0) { shareMedia = inst.absoluteUrl(lightboxImg.attr("src")); } } } var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; if ($(this).hasClass("tsvg-fancy-html5-social-facebook")) { window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-twitter")) { window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-pinterest")) { window.open( "https://pinterest.com/pin/create/bookmarklet/?media=" + encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank" ); } return false; } ); } inst.$watermark = $("#tsvg-fancy-html5-watermark", inst.$lightbox); if (inst.options.stamp) { inst.$watermark.html(""); } else if (inst.options.watermark) { var html = ""; if (inst.options.watermarklink) { html = "" + html + ""; } inst.$watermark.html(html); } if (inst.options.closeonoverlay) { $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).click(inst.finish); } inst.$close.click(inst.finish); inst.$next.click( function () { inst.nextArrowClicked(); } ); inst.$prev.click( function () { inst.prevArrowClicked(); } ); $(window).resize( function () { clearTimeout(inst.options.resizeTimeout); inst.options.resizeTimeout = setTimeout( function () { inst.resizeWindow(); }, 500 ); } ); $(window).scroll( function () { inst.scrollBox(); } ); $(window).bind( "orientationchange", function (e) { if (inst.options.isMobile) { inst.resizeWindow(); } } ); if (inst.options.isIPhone) { inst.options.windowInnerHeight = window.innerHeight; setInterval( function () { if (inst.options.windowInnerHeight != window.innerHeight) { inst.options.windowInnerHeight = window.innerHeight; inst.resizeWindow(); } }, 500 ); } if (inst.options.enabletouchswipe) { inst.enableSwipe(); } }; inst.slideTimer = function (interval, callback, updatecallback) { let timerInstance = this, updateinterval = 50, updateTimerId = null, runningTime = 0, paused = false, started = false, startedandpaused = false; timerInstance.timeout = interval; this.pause = function () { if (started) { paused = true; clearInterval(updateTimerId); } }; this.resume = function (forceresume) { if (startedandpaused && !forceresume) { return; } startedandpaused = false; if (started && paused) { paused = false; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); } }; this.stop = function () { clearInterval(updateTimerId); if (updatecallback) { updatecallback(-1); } runningTime = 0; paused = false; started = false; }; this.start = function () { runningTime = 0; paused = false; started = true; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); }; this.startandpause = function () { runningTime = 0; paused = true; started = true; startedandpaused = true; }; return this; }; inst.updateTimer = function (percent) { var w = Math.round(percent * 100); if (w > 100) { w = 100; } if (0 > w ) { w = 0; } $("#tsvg-fancy-html5-timer", inst.$lightbox).css({ display: "block", width: w + "%" }); }; inst.initSlide = function () { inst.autosliding = false; inst.slideTimeout = inst.slideTimer( inst.options.slideinterval, function () { inst.gotoSlide(-1); }, inst.options.showtimer ? function (percent) { inst.updateTimer(percent); } : null ); if (inst.options.autoslide) { inst.slideTimeout.stop(); inst.autosliding = true; } }; inst.nextArrowClicked = function () { if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") { window[inst.options.onlastarrowclicked](); } } inst.gotoSlide(-1); }; inst.prevArrowClicked = function () { if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && typeof window[inst.options.onfirstarrowclicked] == "function") { window[inst.options.onfirstarrowclicked](); } } inst.gotoSlide(-2); }; inst.calcNextPrevElem = function () { inst.options.nextElem = -1; inst.options.prevElem = -1; inst.options.inGroup = false; inst.options.groupIndex = 0; inst.options.groupCount = 0; var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; for (var i = 0; inst.elemArray.length > i; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (i == inst.options.curElem) { inst.options.groupIndex = inst.options.groupCount; } inst.options.groupCount++; } } var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; if (curGroup != undefined && curGroup != null) { for (j = inst.options.curElem + 1;inst.elemArray.length > j; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } if (0 > inst.options.nextElem) { for (j = 0; inst.options.curElem > j ; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } } if (inst.options.nextElem >= 0) { for (j = inst.options.curElem - 1; j >= 0; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } if (0 > inst.options.prevElem ) { for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } } } } if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) { inst.options.inGroup = true; } }; inst.calcBoxPosition = function (initW, initH) { var boxW = initW + 2 * inst.options.bordersize; var boxH = initH + 2 * inst.options.bordersize; var winH = window.innerHeight ? window.innerHeight : $(window).height(); var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); if (inst.options.titlestyle == "bottom") { boxT -= Math.round(inst.options.barheight / 2); } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; if (topmargin > boxT) { boxT = topmargin; } if (inst.options.insideiframe && window.self != window.top) { if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; var parentscroll = parent.window.document.body.scrollTop; boxT = topmargin; boxT += parentscroll > iframetop ? parentscroll - iframetop : 0; } } return [boxW, boxH, boxT]; }; inst.hideNavArrows = function () { var showPrev = false; var showNext = false; if (inst.options.inGroup) { if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showPrev = true; } if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showNext = true; } } if (showPrev) { inst.$prev.removeClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$prev.addClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.addClass("tsvg-fancy-html5-hide"); } } if (showNext) { inst.$next.removeClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$next.addClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.addClass("tsvg-fancy-html5-hide"); } } }; inst.clickHandler = function (event) { var $this = $(this); var dataoptions = {}; if (jQuery(event.target).prop("tagName") == 'A') { let link = jQuery(event.target).attr('href'); if (jQuery(event.target).attr('target') == '_blank') { window.open(link); } else { window.location.assign(link) } return false; } $.each( $this.data(), function (key, value) { dataoptions[key.toLowerCase()] = value; } ); inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i ; i++) { if (inst.elemArray[i][ELEM_ID] == $this.data("tsvgid")) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; if (inst.options.iequirksmode) { inst.$lightboxBox.css({ top: boxT }); } else { inst.$lightboxBox.css({ "margin-top": boxT }); } if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.loadThumbnail = function (src, index) { let inst_img_elem = document.createElement('img'); inst_img_elem.src = src; inst_img_elem.addEventListener('load', function () { if (inst.options.thumbwidth / inst.options.thumbheight >= inst_img_elem.naturalWidth / inst_img_elem.naturalHeight ) { inst_img_elem.setAttribute("style","width:100%;") } else { inst_img_elem.setAttribute("style","height:100%;") } $(".tsvg-fancy-html5-nav-thumb").eq(index).html(inst_img_elem); }) inst_img_elem.addEventListener('error', function () { console.log('error') }) }; inst.matchGroup = function (curGroup, elemGroup) { if (!curGroup || !elemGroup) { return false; } var curs = curGroup.split(":"); var elems = elemGroup.split(":"); var result = false; for (var i in curs) { if ($.inArray(curs[i], elems) > -1) { result = true; break; } } return result; }; inst.showNavigation = function () { if (!inst.options.shownavigation) { return; } if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) { return; } var i; var showNav = false; var group = inst.currentElem[ELEM_GROUP]; for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { showNav = true; break; } } } if (!showNav) { return; } inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; if ($(".tsvg-fancy-html5-nav").length > 0) { return; } var check_bool = $('.tsvg-fancy-blocks-container').attr('data-tsvg-shn'); if (check_bool === 'false') { return } $("body").append( "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); if (TS_VG_FG_Show_Nav == "true") { var index = 0; } for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { $(".tsvg-fancy-html5-nav-list").append( "
'
" ); this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index) index++; } } } $(".tsvg-fancy-html5-nav-thumb").hover( function () { $(this).css({ opacity: 1 }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor }); }, function () { $(this).css({ opacity: inst.options.thumbopacity }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor }); } ); $(".tsvg-fancy-html5-nav-thumb").click( function () { var index = $(this).data("arrayindex"); if (index >= 0) { inst.gotoSlide(index); } } ); inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); $(".tsvg-fancy-html5-nav-list") .css({ display: "block", position: "relative", "margin-left": 0, width: inst.options.totalwidth + "px" }) .append("
"); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); $navPrev.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; if (marginLeft >= 0) { marginLeft = 0; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (maskWidth - inst.options.totalwidth >= marginLeft ) { $navNext.css({ "background-position": "center left" }); } else { $navNext.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); $navNext.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; if (maskWidth - inst.options.totalwidth >= marginLeft) { marginLeft = maskWidth - inst.options.totalwidth; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (marginLeft >= 0) { $navPrev.css({ "background-position": "center left" }); } else { $navPrev.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.loadElem = function (elem) { inst.currentElem = elem; inst.showing = true; inst.showNavigation(); inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); inst.$loading.show(); if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") { window[inst.options.onshowitem](elem); } switch (elem[ELEM_TYPE]) { case 0: var imgLoader = new Image(); $(imgLoader).load( function () { inst.showImage(elem, imgLoader.width, imgLoader.height); } ); $(imgLoader).error( function () { inst.showError(); } ); imgLoader.src = elem[ELEM_HREF]; break; case 1: inst.showSWF(elem); break; case 2: case 8: inst.showVideo(elem); break; case 3: case 4: case 9: case 11: inst.showYoutubeVimeo(elem); break; case 5: inst.showPDF(elem); break; case 6: inst.showMP3(elem); break; case 7: inst.showWeb(elem); break; case 10: inst.showDiv(elem); break; } if (inst.options.googleanalyticsaccount && window._gaq) { window._gaq.push(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]); } }; inst.loadCurElem = function () { inst.loadElem(inst.elemArray[inst.options.curElem]); }; inst.showError = function () { inst.$loading.hide(); inst.resizeLightbox( inst.options.errorwidth, inst.options.errorheight, true, function () { inst.$error.show(); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); } ); }; inst.calcTextWidth = function (objW) { return objW - 36; }; (inst.showTitle = function (w, t, description) { if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: w + "px" }); } var text = ""; if (inst.options.showtitle) { if (t && t.length > 0) { text += t; } } if (inst.options.inGroup) { if (inst.options.showtitleprefix) { text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", inst.options.groupCount) + " " + text; } jQuery("#tsvg-fancy-html5-elem-data-box").css("display", "none"); if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT != "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (TotalSoft_GV_FG_PD == "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "block"); } if (TotalSoft_GV_FG_PT == "true") { jQuery(".tsvg-fancy-popup-text").css("display", "inline-block"); } if (TotalSoft_GV_FG_PD != "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "none"); } if (TotalSoft_GV_FG_PT != "true") { jQuery(".tsvg-fancy-popup-text").css("display", "none"); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD != "true") { jQuery("#tsvg-fancy-html5-text").css("display", "none"); } } if (inst.options.showdescription && description && description.length > 0) { inst.$text.html(text); } if (inst.options.inGroup && inst.options.showplaybutton) { if (inst.autosliding) { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } else { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); } $("#tsvg-fancy-html5-play", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } ); $("#tsvg-fancy-html5-pause", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.autosliding = false; } } ); } $("#tsvg-fancy-html5-social", inst.$lightbox).show(); }); (inst.showImage = function (elem, imgW, imgH) { var elemW, elemH; if (elem[ELEM_WIDTH]) { elemW = elem[ELEM_WIDTH]; } else { elemW = imgW; elem[ELEM_WIDTH] = imgW; } if (elem[ELEM_HEIGHT]) { elemH = elem[ELEM_HEIGHT]; } else { elemH = imgH; elem[ELEM_HEIGHT] = imgH; } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, inst.options.imagekeepratio); inst.resizeLightbox( sizeObj.w, sizeObj.h, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : ""; inst.$image.show(); inst.$image.html( "
" + timercode + "
" ); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }); inst.showSWF = function (elem) { var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); inst.embedFlash($("#tsvg-html5lightbox-swf"), elem[ELEM_HREF], "window", { width: dataW, height: dataH }); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showVideo = function (elem) { inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var isHTML5 = false; if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || (inst.options.isIE9 && inst.options.useflashonie9) || (inst.options.isIE10 && inst.options.useflashonie10) || (inst.options.isIE11 && inst.options.useflashonie11)) { isHTML5 = false; } else if (inst.options.isMobile) { isHTML5 = true; } else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) { if ((!inst.options.isFirefox && !inst.options.isOpera) || ((inst.options.isFirefox || inst.options.isOpera) && (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM]))) { isHTML5 = true; } } if (isHTML5) { var videoSrc = elem[ELEM_HREF]; if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) { videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; } inst.embedHTML5Video($("#tsvg-html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo); } else { var videoFile = elem[ELEM_HREF]; if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") { videoFile = inst.options.htmlfolder + videoFile; } inst.embedFlash( $("#tsvg-html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { width: dataW, height: dataH, jsobjectname: "html5Lightbox", hidecontrols: inst.options.videohidecontrols ? "1" : "0", hideplaybutton: "0", videofile: videoFile, hdfile: "", ishd: "0", defaultvolume: inst.options.defaultvideovolume, autoplay: inst.options.autoplay ? "1" : "0", loop: inst.options.loopvideo ? "1" : "0", errorcss: ".html5box-error" + inst.options.errorcss, id: 0, } ); } inst.$elem.show(); inst.showData(); } ); }; inst.loadNext = function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } }; inst.getYoutubeParams = function (href) { var result = {}; if (0 > href.indexOf("?") ) { return result; } var params = href.substring(href.indexOf("?") + 1).split("&"); for (var i = 0;params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2 && value[0].toLowerCase() != "v") { result[value[0].toLowerCase()] = value[1]; } } return result; }; inst.getYoutubeId = function (href) { var youtubeId = ""; var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(shorts\/)|(watch\??v?=?))([^#\&\?]*).*/; var match = href.match(regExp); if (match && match[match.length -1].length == 11) { youtubeId = match[match.length -1]; } return youtubeId; }; inst.prepareYoutubeHref = function (href) { let youtubeId = inst.getYoutubeId(href), protocol = "https:", result = protocol + "//www.youtube.com/embed/" + youtubeId, params = this.getYoutubeParams(href), first = true; for (var key in params) { if (first) { result += "?"; first = false; } else { result += "&"; } result += key + "=" + params[key]; } return result; }; inst.prepareDailymotionHref = function (href) { if (href.match(/\:\/\/.*(dai\.ly)/i)) { var protocol = "https:"; var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; href = protocol + "" + id; } return href; }; inst.showYoutubeVimeo = function (elem) { var tsvg_autoplay = jQuery('.tsvg-main-content-' + id).attr('data-tsvg-autoplay'); inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var href = elem[ELEM_HREF]; var youtubeid = ""; if (elem[ELEM_TYPE] == 3) { youtubeid = inst.getYoutubeId(href); href = inst.prepareYoutubeHref(href); if (tsvg_autoplay == "true") { href += "?autoplay=1&mute=1" } else { href += "?autoplay=0&mute=0" } } if (elem[ELEM_TYPE] == 9) { href = inst.prepareDailymotionHref(href); } if (inst.options.autoplay) { if (elem[ELEM_TYPE] == 4) { if (href.indexOf('player.vimeo.com/video/') > -1) { if (tsvg_autoplay == "true") { href += "?autoplay=1&muted=1"; } } } } if (inst.options.loopvideo) { href += 0 > href.indexOf("?") ? "?" : "&"; switch (elem[ELEM_TYPE]) { case 3: href += "loop=1&playlist=" + youtubeid; break; case 4: case 9: href += "loop=1"; break; case 11: href += "endVideoBehavior=loop"; break; } } if (elem[ELEM_TYPE] == 3 && Totalsoft_FG_ShVAutoPl == "true") { if (0 > href.indexOf("?")) { href += "?wmode=transparent&rel=0&iv_load_policy=3"; } else { href += "&wmode=transparent&rel=0&iv_load_policy=3"; } if (inst.options.videohidecontrols) { href += "&controls=0&showinfo=0"; } href += "&mute=1&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname; } if (href.indexOf('.mp4') > -1) { let autoplay_bool = tsvg_autoplay == "true" ? "autoplay muted" : ""; $("#tsvg-html5lightbox-video").html(''); } else { $("#tsvg-html5lightbox-video").html(""); } inst.$elem.show(); inst.showData(); if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") { new YT.Player( "html5boxiframevideo", { events: { onStateChange: function (event) { if (event.data == YT.PlayerState.ENDED) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } }, }, } ); } else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { var vimeoIframe = $("#html5boxiframevideo")[0]; var vimeoPlayer = $f(vimeoIframe); vimeoPlayer.addEvent( "ready", function () { vimeoPlayer.addEvent( "finish", function (id) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); } ); } } ); }; inst.showPDF = function (elem) { }; inst.showMP3 = function (elem) { }; inst.showDiv = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var divID = elem[ELEM_HREF]; if ($(divID).length > 0) { $("#tsvg-html5lightbox-div").html($(divID).html()); } else { $("#tsvg-html5lightbox-div").html("
The specified div ID does not exist.
"); } inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showWeb = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); var tsvgRumbleCheck = elem[ELEM_HREF].indexOf('rumble.com/') > -1 ? 'sandbox="allow-scripts"' : ''; dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); $("#tsvg-html5lightbox-web").html(""); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.scrollBox = function () { }; inst.resizeWindow = function () { if (!inst.currentElem) { return; } if (!inst.options.responsive) { return; } var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); if (inst.options.responsivebarheight) { if (inst.options.smallscreenheight >= winH) { inst.options.barheight = inst.options.barheightonsmallheight; } else { inst.options.barheight = inst.options.barheightoriginal; } if (inst.options.titlestyle == "bottom" && inst.options.barautoheight != "auto") { inst.$elemData.css({ height: inst.options.barheight + "px", "max-height": inst.options.barheight + "px" }); } } var elemW, elemH, keepratio; if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; keepratio = false; } else { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; if (inst.currentElem[ELEM_TYPE] == 0) { keepratio = inst.options.imagekeepratio; } else { keepratio = true; } } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, keepratio); var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: sizeObj.w + "px" }); } if (0 >= $(".tsvg-fancy-html5-nav").length ) { return; } $(".tsvg-fancy-html5-nav-list").css({ "margin-left": 0 }); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.calcElemSize = function (sizeObj, keepratio) { if (!inst.options.responsive) { return sizeObj; } var winWidth = $(window).width(); winWidth = winWidth ? winWidth : $(document).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); winH = winH ? winH : $(document).height(); if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) { sizeObj.w = (sizeObj.w * 100) / inst.options.imagepercentage; } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; if (inst.options.titlestyle == "bottom") { h0 -= inst.options.barheight; } if (((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && inst.options.sidetobottomscreenwidth >= winWidth ) || (inst.options.notkeepratioonsmallheight && inst.options.smallscreenheight >= winH)) { keepratio = false; } if (sizeObj.h > h0) { if (keepratio) { sizeObj.w = Math.round((sizeObj.w * h0) / sizeObj.h); } sizeObj.h = h0; } var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; if ( (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth) || (((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) ) { w0 -= 64; } if (sizeObj.w > w0) { if (keepratio) { sizeObj.h = Math.round((sizeObj.h * w0) / sizeObj.w); } sizeObj.w = w0; } return sizeObj; }; inst.showData = function () { if (inst.$text.text().length > 0) { inst.$elemData.show(); } if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$lightboxBox.css({ height: "auto" }); } if (inst.$text.text().length > 0 && inst.options.titlestyle == "bottom") { inst.$elemData.css({ "max-height": inst.options.barheight + "px" }); } $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).css({ height: Math.max($(window).height(), $(document).height()) }); $(window).trigger("html5lightbox.lightboxopened"); }; inst.resizeLightbox = function (elemW, elemH, bAnimate, onFinish) { inst.hideNavArrows(); var boxPos = inst.calcBoxPosition(elemW, elemH); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$loading.hide(); inst.$watermark.hide(); if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastitem && window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") { window[inst.options.onlastitem](inst.currentElem); } } if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") { window[inst.options.onfirstitem](inst.currentElem); } } if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { inst.$elem.bind( "mouseenter mousemove", function () { if ((inst.options.arrowloop && inst.options.prevElem >= 0) || (!inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.curElem > inst.options.prevElem )) { inst.$prev.fadeIn(); } if ((inst.options.arrowloop && inst.options.nextElem >= 0) || (!inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem)) { inst.$next.fadeIn(); } } ); inst.$elem.bind( "mouseleave", function () { inst.$next.fadeOut(); inst.$prev.fadeOut(); } ); } inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) { speed = 0; } inst.$lightboxBox.animate({ width: boxW }, speed).animate( { height: boxH }, speed, function () { inst.onAnimateFinish(onFinish); } ); } else { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) { speed = 0; } inst.$lightboxBox.css({ width: boxW, height: "auto", "min-width": boxW - 15 }); inst.$elemWrap.animate({ width: boxW, "min-width": boxW - 15 }, speed).animate( { height: boxH, "min-height": boxH - 15 }, speed, function () { inst.onAnimateFinish(onFinish); } ); } }; inst.onAnimateFinish = function (onFinish) { inst.$loading.show(); inst.$watermark.show(); inst.$close.show(); inst.$elem.css({ "background-color": inst.options.bgcolor }); onFinish(); }; inst.reset = function () { if (inst.options.stamp) { inst.$watermark.hide(); } inst.showing = false; inst.$image.empty(); inst.$text.empty(); inst.$error.hide(); inst.$loading.hide(); inst.$image.hide(); if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$elemData.hide(); } if (!inst.options.fullscreenmode) { inst.$close.hide(); } inst.$elem.css({ "background-color": "" }); }; inst.resetNavigation = function () { inst.options.navheight = 0; $(".tsvg-fancy-html5-nav").remove(); }; inst.finish = function () { if ($("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).length) { $("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).attr("src", ""); } $("head") .find("style") .each( function () { if ($(this).data("creator") == "tsvg-fancy-html5box-html5-lightbox") { $(this).remove(); } } ); inst.slideTimeout.stop(); inst.reset(); inst.resetNavigation(); inst.$lightbox.remove(); $("#tsvg-fancy-html5box-html5-lightbox").remove(); inst.showObjects(); if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") { window[inst.options.oncloselightbox](inst.currentElem); } if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") { inst.onLightboxClosed(inst.currentElem); } }; inst.pauseSlide = function () { }; inst.playSlide = function () { }; inst.gotoSlide = function (slide) { if (slide == -1) { if (0 > inst.options.nextElem ) { return; } inst.options.curElem = inst.options.nextElem; } else if (slide == -2) { if (0 > inst.options.prevElem ) { return; } inst.options.curElem = inst.options.prevElem; } else if (slide >= 0) { inst.options.curElem = slide; } if (inst.autosliding) { inst.slideTimeout.stop(); } inst.calcNextPrevElem(); inst.reset(); inst.loadCurElem(); }; inst.enableSwipe = function () { inst.$elem.html5lightboxTouchSwipe248095( { preventWebBrowser: false, swipeLeft: function () { inst.gotoSlide(-1); }, swipeRight: function () { inst.gotoSlide(-2); }, } ); }; inst.hideObjects = function () { $("select, embed, object").css({ visibility: "hidden" }); }; inst.showObjects = function () { $("select, embed, object").css({ visibility: "visible" }); }; inst.embedHTML5Video = function ($container, src, autoplay, loopvideo) { let embedVideoPoster = (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : ""), embedVideoControls = (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : ""); $container.html( "
" ); if (!inst.options.nativehtml5controls) { $("video", $container).data("src", src); $("video", $container).lightboxHTML5VideoControls248095(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume); } $("video", $container) .unbind("ended") .bind( "ended", function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); }; inst.embedFlash = function ($container, src, wmode, flashVars) { if (inst.options.flashInstalled) { var htmlOptions = { pluginspage: "", quality: "high", allowFullScreen: "true", allowScriptAccess: "always", type: "application/x-shockwave-flash" }; htmlOptions.width = "100%"; htmlOptions.height = "100%"; htmlOptions.src = src; htmlOptions.flashVars = $.param(flashVars); htmlOptions.wmode = wmode; var htmlString = ""; for (var key in htmlOptions) { htmlString += key + "=" + htmlOptions[key] + " "; } $container.html(""); } else { $container.html( "
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
" ); } }; inst.checkType = function (href) { if (!href) { return -1; } if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) { return 0; } if (href.match(/[^\.]\.(swf)\s*$/i)) { return 1; } if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) { return 4; } if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) { return 3; } if (href.match(/\:\/\/.*(vimeo\.com)/i)) { return 4; } if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) { return 9; } if (href.match(/[^\.]\.(pdf)\s*$/i)) { return 5; } if (href.match(/[^\.]\.(mp3)\s*$/i)) { return 6; } if (href.match(/[^\.]\.(flv)\s*$/i)) { return 8; } if (href.match(/\#\w+/i)) { return 10; } if (href.match(/\:\/\/.*(wistia)/i)) { return 11; } return 7; }; inst.getURLParams = function () { var result = {}; var params = window.location.search.substring(1).split("&"); for (var i = 0; params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2) { result[value[0].toLowerCase()] = unescape(value[1]); } } return result; }; inst.absoluteUrl = function (href) { var link = document.createElement("a"); link.href = href; return link.protocol + "//" + link.host + link.pathname + link.search + link.hash; }; inst.showLightbox = function (type, href, title, width, height, webm, ogg, thumbnail, description) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)); }; inst.addItem = function (href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { type = mediatype && mediatype >= 0 ? mediatype : inst.checkType(href); inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)); }; inst.showItem = function (href) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i; i++) { if (inst.elemArray[i][ELEM_HREF] == href) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.unbind("click").click(inst.clickHandler); inst.each( function () { var self = $(this); if (self.data("autoopen")) { setTimeout( function () { self.click(); }, self.data("autoopendelay") ? self.data("autoopendelay") : 0 ); return false; } } ); var urlParams = inst.getURLParams(); if ("html5lightboxshare" in urlParams) { var shareUrl = decodeURIComponent(urlParams["html5lightboxshare"]); var shareLink = $('.tsvg-html5lightbox-248095[href="' + shareUrl + '"]'); if (shareLink.length > 0) { shareLink.click(); } } return inst; }; })(jQuery); (function ($) { $.fn.html5lightboxTouchSwipe248095 = function (options) { var defaults = { preventWebBrowser: false, swipeLeft: null, swipeRight: null, swipeTop: null, swipeBottom: null }; if (options) { $.extend(defaults, options); } return this.each( function () { var startX = -1, startY = -1; var curX = -1, curY = -1; function touchStart(event) { var e = event.originalEvent; if (e.targetTouches.length >= 1) { startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchMove(event) { if (defaults.preventWebBrowser) { event.preventDefault(); } var e = event.originalEvent; if (e.targetTouches.length >= 1) { curX = e.targetTouches[0].pageX; curY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchEnd(event) { if (curX > 0 || curY > 0) { triggerHandler(); touchCancel(event); } else { touchCancel(event); } } function touchCancel(event) { startX = -1; startY = -1; curX = -1; curY = -1; } function triggerHandler() { if (Math.abs(curX - startX) > Math.abs(curY - startY)) { if (curX > startX) { if (defaults.swipeRight) { defaults.swipeRight.call(); } } else { if (defaults.swipeLeft) { defaults.swipeLeft.call(); } } } else if (curY > startY) { if (defaults.swipeBottom) { defaults.swipeBottom.call(); } } else if (defaults.swipeTop) { defaults.swipeTop.call(); } } try { $(this).bind("touchstart", touchStart); $(this).bind("touchmove", touchMove); $(this).bind("touchend", touchEnd); $(this).bind("touchcancel", touchCancel); } catch (e) { } } ); }; })(jQuery); (function ($) { $.fn.lightboxHTML5VideoControls248095 = function (skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { var isTouch = "ontouchstart" in window; var eStart = isTouch ? "touchstart" : "mousedown"; var eMove = isTouch ? "touchmove" : "mousemove"; var eCancel = isTouch ? "touchcancel" : "mouseup"; var eClick = "click"; var BUTTON_SIZE = 32; var BAR_HEIGHT = isTouch ? 48 : 36; var hideControlsTimerId = null; var hideVolumeBarTimeoutId = null; var sliderDragging = false; var isFullscreen = false; var userActive = true; var isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; var isHd = $(this).data("ishd"); var hd = $(this).data("hd"); var src = $(this).data("src"); var $videoObj = $(this); $videoObj.get(0).removeAttribute("controls"); if (isIPhone) { var h = $videoObj.height() - BAR_HEIGHT; $videoObj.css({ height: h }); } var $videoPlay = $("
"); if (!isIPhone) { $videoObj.after($videoPlay); $videoPlay .css( { position: "absolute", top: "50%", left: "50%", display: "block", cursor: "pointer", width: 64, height: 64, "margin-left": -32, "margin-top": -32, "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", "background-position": "center center", "background-repeat": "no-repeat", } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); } var $videoFullscreenBg = $("
"); var $videoControls = $( "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); $videoObj.after($videoControls); $videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({ display: "none", position: "fixed", left: 0, top: 0, bottom: 0, right: 0, "z-index": 2147483647 }); $videoControls.css({ display: "block", position: "absolute", width: "100%", height: BAR_HEIGHT, left: 0, bottom: 0, right: 0, "max-width": "640px", margin: "0 auto" }); var userActivate = function () { userActive = true; }; $videoObj .bind( eClick, function () { userActive = true; } ) .hover( function () { userActive = true; }, function () { userActive = false; } ); if (!hidecontrols) { setInterval( function () { if (userActive) { $videoControls.show(); userActive = false; clearTimeout(hideControlsTimerId); hideControlsTimerId = setTimeout( function () { if (!$videoObj.get(0).paused) { $videoControls.fadeOut(); } }, 5e3 ); } }, 250 ); } $(".html5boxVideoControlsBg", $videoControls).css({ display: "block", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)" }); $(".html5boxPlayPause", $videoControls).css({ display: "block", position: "relative", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), float: "left" }); var $videoBtnPlay = $(".html5boxPlay", $videoControls); var $videoBtnPause = $(".html5boxPause", $videoControls); $videoBtnPlay .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top left", } ) .hover( function () { $(this).css({ "background-position": "bottom left" }); }, function () { $(this).css({ "background-position": "top left" }); } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); $videoBtnPause .css( { display: "none", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top right", } ) .hover( function () { $(this).css({ "background-position": "bottom right" }); }, function () { $(this).css({ "background-position": "top right" }); } ) .bind( eClick, function () { $videoObj.get(0).pause(); } ); var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); var $videoSeeker = $(".html5boxSeeker", $videoControls); var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); $videoTimeCurrent.css( { display: "block", position: "relative", float: "left", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoTimeTotal.css( { display: "block", position: "relative", float: "right", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoSeeker .css({ display: "block", cursor: "pointer", overflow: "hidden", position: "relative", height: "10px", "background-color": "#222", margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" }) .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); $videoSeeker.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); } ); } ) .bind( eCancel, function () { $videoSeeker.unbind(eMove); } ); $videoSeekerBuffer.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#444" }); $videoSeekerPlay.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#fcc500" }); if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { var switchScreen = function (fullscreen) { if (fullscreen) { if ($videoObj.get(0).requestFullscreen) { $videoObj.get(0).requestFullscreen(); } else if ($videoObj.get(0).webkitRequestFullScreen) { $videoObj.get(0).webkitRequestFullScreen(); } else if ($videoObj.get(0).mozRequestFullScreen) { $videoObj.get(0).mozRequestFullScreen(); } else if ($videoObj.get(0).webkitEnterFullScreen) { $videoObj.get(0).webkitEnterFullScreen(); } if ($videoObj.get(0).msRequestFullscreen) { $videoObj.get(0).msRequestFullscreen(); } } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }; var switchScreenCSS = function (fullscreen) { $videoControls.css({ position: fullscreen ? "fixed" : "absolute" }); var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); $videoFullscreen.css({ "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY }); $videoFullscreenBg.css({ display: fullscreen ? "block" : "none" }); if (fullscreen) { $(document).bind("mousemove", userActivate); $videoControls.css({ "z-index": 2147483647 }); } else { $(document).unbind("mousemove", userActivate); $videoControls.css({ "z-index": "" }); } }; document.addEventListener( "fullscreenchange", function () { isFullscreen = document.fullscreen; switchScreenCSS(document.fullscreen); }, false ); document.addEventListener( "mozfullscreenchange", function () { isFullscreen = document.mozFullScreen; switchScreenCSS(document.mozFullScreen); }, false ); document.addEventListener( "webkitfullscreenchange", function () { isFullscreen = document.webkitIsFullScreen; switchScreenCSS(document.webkitIsFullScreen); }, false ); $videoObj.get(0).addEventListener( "webkitbeginfullscreen", function () { isFullscreen = true; }, false ); $videoObj.get(0).addEventListener( "webkitendfullscreen", function () { isFullscreen = false; }, false ); $("head").append(""); var $videoFullscreen = $(".html5boxFullscreen", $videoControls); $videoFullscreen .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", "background-position": "left top", } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { isFullscreen = !isFullscreen; switchScreen(isFullscreen); } ); } if (hd) { var $videoHD = $(".html5boxHD", $videoControls); $videoHD .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_hd.png" + "')", "background-position": (isHd ? "right" : "left") + " center", } ) .bind( eClick, function () { isHd = !isHd; $(this).css({ "background-position": (isHd ? "right" : "left") + " center" }); parentInst.isHd = isHd; var isPaused = $videoObj.get(0).isPaused; $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); if (!isPaused) { $videoObj.get(0).play(); } else if (!isIPhone) { $videoObj.get(0).pause(); } } ); } $videoObj.get(0).volume = defaultvolume; var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; var volume = $videoObj.get(0).volume; $videoObj.get(0).volume = volume / 2 + 0.1; if ($videoObj.get(0).volume === volume / 2 + 0.1) { $videoObj.get(0).volume = volume; var $videoVolume = $(".html5boxVolume", $videoControls); var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); $videoVolume.css({ display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) }).hover( function () { clearTimeout(hideVolumeBarTimeoutId); var volume = $videoObj.get(0).volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); $videoVolumeBar.show(); }, function () { clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId = setTimeout( function () { $videoVolumeBar.hide(); }, 1e3 ); } ); $videoVolumeButton .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", "background-position": "top " + (volume > 0 ? "left" : "right"), } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { var volume = $videoObj.get(0).volume; if (volume > 0) { volumeSaved = volume; volume = 0; } else { volume = volumeSaved; } var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); $videoVolumeButton.css({ "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY }); $videoObj.get(0).volume = volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); } ); $videoVolumeBar.css( { display: "none", position: "absolute", left: 4, bottom: "100%", width: 24, height: 80, "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)", } ); $videoVolumeBarBg.css({ display: "block", position: "relative", width: 10, height: 68, margin: 7, cursor: "pointer", "background-color": "#222" }); $videoVolumeBarActive.css({ display: "block", position: "absolute", bottom: 0, left: 0, width: "100%", height: "100%", "background-color": "#fcc500" }); $videoVolumeBarBg .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; $videoVolumeBarBg.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; } ); } ) .bind( eCancel, function () { $videoVolumeBarBg.unbind(eMove); } ); } var calcTimeFormat = function (seconds) { var h0 = Math.floor(seconds / 3600); var h = 10 > h0 ? "0" + h0 : h0; var m0 = Math.floor((seconds - h0 * 3600) / 60); var m = 10 > m0 ? "0" + m0 : m0; var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); var s = 10 > s0 ? "0" + s0 : s0; var r = m + ":" + s; if (h0 > 0) { r = h + ":" + r; } return r; }; if (hideplaybutton) { $videoPlay.hide(); } if (hidecontrols) { $videoControls.hide(); } var onVideoPlay = function () { if (!hideplaybutton) { $videoPlay.hide(); } if (!hidecontrols) { $videoBtnPlay.hide(); $videoBtnPause.show(); } }; var onVideoPause = function () { if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoEnded = function () { $(window).trigger("html5lightbox.videoended"); if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoUpdate = function () { var curTime = $videoObj.get(0).currentTime; if (curTime) { $videoTimeCurrent.text(calcTimeFormat(curTime)); var duration = $videoObj.get(0).duration; if (duration) { $videoTimeTotal.text(calcTimeFormat(duration)); if (!sliderDragging) { var sliderW = $videoSeeker.width(); var pos = Math.round((sliderW * curTime) / duration); $videoSeekerPlay.css({ width: pos }); $videoSeekerHandler.css({ left: pos }); } } } }; var onVideoProgress = function () { if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { var sliderW = $videoSeeker.width(); $videoSeekerBuffer.css({ width: Math.round((sliderW * $videoObj.get(0).buffered.end(0)) / $videoObj.get(0).duration) }); } }; try { $videoObj.bind("play", onVideoPlay); $videoObj.bind("pause", onVideoPause); $videoObj.bind("ended", onVideoEnded); $videoObj.bind("timeupdate", onVideoUpdate); $videoObj.bind("progress", onVideoProgress); } catch (e) { } }; })(jQuery); jQuery(".tsvg-html5lightbox-248095").html5lightbox248095({},'248095'); jQuery(function() { jQuery('.tsvg-section-248095').fadeIn(); var tsvgFancyHoverInverse248095 = 'Default'; tsvgFancyHoverInverse248095 = tsvgFancyHoverInverse248095 == 'Default' ? false : true; jQuery('.tsvg-fancy-blocks-list-248095 > li').each(function() { jQuery(this).hoverdir({hoverDelay: 50, inverse:tsvgFancyHoverInverse248095}); }); }); clearInterval(tsvgFancyInterval248095); } }, tsvgFancyReference248095 = ( function tsvgFancySameCall248095() { tsvgFancyInterval248095 = setInterval(tsvgFancyIntervalFunction248095, 1000); return tsvgFancySameCall248095; }() );
'); }else{ jQuery('.tsvg-section-248095 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } var svg = document.querySelector('.btn-lg svg'), svgPath = new Proxy({ y: null, smoothing: null }, { set(target, key, value) { target[key] = value; if(target.y !== null && target.smoothing !== null) { svg.innerHTML = getPath(target.y, target.smoothing, null); } return true; }, get(target, key) { return target[key]; } }); svgPath.y = 20; svgPath.smoothing = 0; } } jQuery('.tsvg-section-248095 .btn-lg').click(function (e) { let max_heigth =jQuery('.tsvg-main-content-248095').height(); let main_length = jQuery('.tsvg-main-content-248095 figure ul li').length; tsvgPaginationLoad248095 = 'false'; if(jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ tsvgPaginationLoad248095 = 'true'; } jQuery('.tsvg-main-content-248095').css({'max-height': max_heigth+'px','transition':'unset'}); setTimeout(() => { jQuery('.tsvg-main-content-248095').css({'transition':'max-height 3s ease-in-out','max-height':main_length+'000vh'}); }, 100); tsvgPaginationCreate248095(jQuery('.tsvg-main-content-248095 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage); if(jQuery('.tsvg-section-248095 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'){ jQuery('.tsvg-section-248095 .btn-lg').addClass('animate'); setTimeout(function(){ jQuery('.tsvg-section-248095 .btn-lg').removeClass('animate'); },700); } if(!jQuery('.tsvg-section-248095 .btn-lg').hasClass('loading')&&(jQuery('.tsvg-section-248095 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery('.tsvg-section-248095 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5')&&jQuery('.tsvg-section-248095 .tsvg-pagination-pages-wrapper svg').length) { jQuery('.tsvg-section-248095 .btn-lg').addClass('loading'); setTimeout(() => { svg.innerHTML = getPath(0, 0, [ [3, 14], [8, 19], [21, 6] ]); }, 1000 / 2); setTimeout(() => { jQuery('.tsvg-section-248095 .btn-lg').removeClass('loading'); if(jQuery('.tsvg-section-248095 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ jQuery('.tsvg-section-248095 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
  • '+load_text+'
'); }else{ jQuery('.tsvg-section-248095 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } }, 2000 ); } }) tsvgPaginationCreate248095(jQuery('.tsvg-section-248095 .tsvg-main-content-248095 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage) } } function tsvgNewPagination248095(){ var interval_pag_fn_248095 = setInterval(setPagina_248095, 100); function setPagina_248095() { if( typeof(jQuery) != "undefined" && jQuery != null){ if( jQuery('.tsvg-main-content-248095').attr("data-pagination")=='pagination'){ tsvgPaginationGenerate248095(); } if( jQuery('.tsvg-main-content-248095').attr("data-pagination")=='load-more'){ tsvgPaginationGenerate248095(); } clearInterval(interval_pag_fn_248095); } } } tsvgNewPagination248095(); function tsvgPaginationGenerate(){ tsvgPaginationGenerate248095(); } function getPoint(point, i, a, smoothing) { let cp = (current, previous, next, reverse) => { let p = previous || current, n = next || current, o = { length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)), angle: Math.atan2(n[1] - p[1], n[0] - p[0]) }, angle = o.angle + (reverse ? Math.PI : 0), length = o.length * smoothing; return [current[0] + Math.cos(angle) * length, current[1] + Math.sin(angle) * length]; }, cps = cp(a[i - 1], a[i - 2], point, false), cpe = cp(point, a[i - 1], a[i + 1], true); return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`; } function getPath(update, smoothing, pointsNew) { let points = pointsNew ? pointsNew : [ [4, 12], [12, update], [20, 12] ], d = points.reduce((acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${getPoint(point, i, a, smoothing)}`, ''); return ``; }
" + "
" + "
" + "
" + "" + "" + "" + "
" + "
" + "" + "
" + "" ); inst.options.positionFixed = inst.options.supportCSSPositionFixed && inst.options.responsive && !inst.options.iequirksmode; inst.$lightbox.css({ position: inst.options.positionFixed ? "fixed" : "absolute" }); inst.$lightbox.appendTo("body"); inst.$lightboxBox = $("#tsvg-fancy-html5-lightbox-box", inst.$lightbox); inst.$elem = $("#tsvg-fancy-html5-elem-box", inst.$lightbox); inst.$elemWrap = $("#tsvg-fancy-html5-elem-wrap", inst.$lightbox); inst.$loading = $("#tsvg-fancy-html5-loading", inst.$lightbox); inst.$error = $("#tsvg-fancy-html5-error", inst.$lightbox); inst.$image = $("#tsvg-fancy-html5-image", inst.$lightbox); var elemText = ""; if (inst.options.titlestyle == "left") { inst.$elem.prepend(elemText); } else { inst.$elem.append(elemText); } inst.$elemData = $("#tsvg-fancy-html5-elem-data-box", inst.$lightbox); inst.$text = $("#tsvg-fancy-html5-text", inst.$lightbox); if (inst.options.borderradius > 0) { inst.$elem.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); if (inst.options.titlestyle == "inside") { inst.$elemWrap.css({ "border-radius": inst.options.borderradius + "px", "-moz-border-radius": inst.options.borderradius + "px", "-webkit-border-radius": inst.options.borderradius + "px" }); } else if (inst.options.titlestyle == "bottom") { inst.$elemWrap.css( { "border-top-left-radius": inst.options.borderradius + "px", "-moz-top-left-border-radius": inst.options.borderradius + "px", "-webkit-top-left-border-radius": inst.options.borderradius + "px", "border-top-right-radius": inst.options.borderradius + "px", "-moz-top-right-border-radius": inst.options.borderradius + "px", "-webkit-top-right-border-radius": inst.options.borderradius + "px", } ); inst.$elemData.css( { "border-bottom-left-radius": inst.options.borderradius + "px", "-moz-top-bottom-border-radius": inst.options.borderradius + "px", "-webkit-bottom-left-border-radius": inst.options.borderradius + "px", "border-bottom-right-radius": inst.options.borderradius + "px", "-moz-bottom-right-border-radius": inst.options.borderradius + "px", "-webkit-bottom-right-border-radius": inst.options.borderradius + "px", } ); } } if (inst.options.titlestyle == "right" || inst.options.titlestyle == "left") { inst.$lightboxBox.css({ "background-color": inst.options.bgcolor }); if (inst.options.titlestyle == "right") { inst.$elemWrap.css({ position: "relative", float: "left" }); inst.$elemData.css({ position: "relative", overflow: "hidden", padding: inst.options.bordersize + "px" }); } else { inst.$elemWrap.css({ position: "relative", overflow: "hidden" }); inst.$elemData.css({ position: "relative", float: "left", padding: inst.options.bordersize + "px" }); } } else if (inst.options.titlestyle == "inside") { inst.$elemData.css({ position: "absolute", margin: inst.options.bordersize + "px", bottom: 0, left: 0, "background-color": "#333", "background-color": "rgba(51, 51, 51, 0.6)" }); inst.$text.css({ padding: inst.options.bordersize + "px " + 2 * inst.options.bordersize + "px" }); } else { inst.$elemData.css( { position: "relative", width: "100%", height: inst.options.barautoheight ? "auto" : inst.options.barheight + "px", padding: "0 0 " + inst.options.bordersize + "px" + " 0", "background-color": inst.options.bgcolor, "text-align": "left", } ); inst.$text.css({ margin: "0 " + inst.options.bordersize + "px" }); } if (inst.options.fullscreenmode) { inst.$lightbox.append( "
" + "
" ); inst.$next = $(".tsvg-fancy-html5-next-fullscreen", inst.$lightbox); inst.$prev = $(".tsvg-fancy-html5-prev-fullscreen", inst.$lightbox); inst.$lightboxBox.append( "
" + "
" ); inst.$nextbottom = $(".tsvg-fancy-html5-next-bottom-fullscreen", inst.$lightbox); inst.$prevbottom = $(".tsvg-fancy-html5-prev-bottom-fullscreen", inst.$lightbox); inst.$nextbottom.click( function () { inst.nextArrowClicked(); } ); inst.$prevbottom.click( function () { inst.prevArrowClicked(); } ); inst.$lightbox.append( "
" ); inst.$close = $("#tsvg-fancy-html5-close-fullscreen", inst.$lightbox); } else { inst.$elemWrap.append( "" + "" ); inst.$next = $("#tsvg-fancy-html5-next", inst.$lightbox); inst.$prev = $("#tsvg-fancy-html5-prev", inst.$lightbox); if ((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) { inst.$lightboxBox.append( "
" + "
" ); inst.$nexttouch = $(".tsvg-fancy-html5-next-touch", inst.$lightbox); inst.$prevtouch = $(".tsvg-fancy-html5-prev-touch", inst.$lightbox); inst.$nexttouch.click( function () { inst.nextArrowClicked(); } ); inst.$prevtouch.click( function () { inst.prevArrowClicked(); } ); } inst.$lightboxBox.append( "" ); inst.$close = $("#tsvg-fancy-html5-close", inst.$lightbox); } if (inst.options.showsocial) { var socialCode = '"; inst.$lightboxBox.append(socialCode); $(".tsvg-fancy-html5-social-btn", inst.$lightbox).click( function () { var shareUrl = window.location.href + (0 > window.location.href.indexOf("?") ? "?" : "&") + "html5lightboxshare=" + encodeURIComponent(inst.currentElem[ELEM_HREF]); var shareTitle = inst.currentElem[ELEM_TITLE]; var shareMedia = inst.currentElem[ELEM_HREF]; if (inst.currentElem[ELEM_TYPE] == 0) { shareMedia = inst.absoluteUrl(inst.currentElem[ELEM_HREF]); } else if (inst.currentElem[ELEM_TYPE] == 3) { shareMedia = "https://img.youtube.com/vi/" + inst.getYoutubeId(inst.currentElem[ELEM_HREF]) + "/0.jpg"; } else { var lightboxLink = $('.tsvg-html5lightbox-491211[href="' + inst.currentElem[ELEM_HREF] + '"]'); if (lightboxLink.length > 0) if (lightboxLink.data("shareimage") && lightboxLink.data("shareimage").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("shareimage")); } else if (lightboxLink.data("thumbnail") && lightboxLink.data("thumbnail").length > 0) { shareMedia = inst.absoluteUrl(lightboxLink.data("thumbnail")); } else { var lightboxImg = $("img", lightboxLink); if (lightboxImg.length > 0) { shareMedia = inst.absoluteUrl(lightboxImg.attr("src")); } } } var isVideo = inst.currentElem[ELEM_TYPE] == 2 || inst.currentElem[ELEM_TYPE] == 3 || inst.currentElem[ELEM_TYPE] == 4 || inst.currentElem[ELEM_TYPE] == 8 || inst.currentElem[ELEM_TYPE] == 9 || inst.currentElem[ELEM_TYPE] == 11; if ($(this).hasClass("tsvg-fancy-html5-social-facebook")) { window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(shareUrl) + "&t=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-twitter")) { window.open("https://twitter.com/share?url=" + encodeURIComponent(shareUrl) + "&text=" + encodeURIComponent(shareTitle), "_blank"); } else if ($(this).hasClass("tsvg-fancy-html5-social-pinterest")) { window.open( "https://pinterest.com/pin/create/bookmarklet/?media=" + encodeURIComponent(shareMedia) + "&url=" + encodeURIComponent(shareUrl) + "&description=" + encodeURIComponent(shareTitle) + "&is_video=" + (isVideo ? "true" : "false"), "_blank" ); } return false; } ); } inst.$watermark = $("#tsvg-fancy-html5-watermark", inst.$lightbox); if (inst.options.stamp) { inst.$watermark.html(""); } else if (inst.options.watermark) { var html = ""; if (inst.options.watermarklink) { html = "" + html + ""; } inst.$watermark.html(html); } if (inst.options.closeonoverlay) { $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).click(inst.finish); } inst.$close.click(inst.finish); inst.$next.click( function () { inst.nextArrowClicked(); } ); inst.$prev.click( function () { inst.prevArrowClicked(); } ); $(window).resize( function () { clearTimeout(inst.options.resizeTimeout); inst.options.resizeTimeout = setTimeout( function () { inst.resizeWindow(); }, 500 ); } ); $(window).scroll( function () { inst.scrollBox(); } ); $(window).bind( "orientationchange", function (e) { if (inst.options.isMobile) { inst.resizeWindow(); } } ); if (inst.options.isIPhone) { inst.options.windowInnerHeight = window.innerHeight; setInterval( function () { if (inst.options.windowInnerHeight != window.innerHeight) { inst.options.windowInnerHeight = window.innerHeight; inst.resizeWindow(); } }, 500 ); } if (inst.options.enabletouchswipe) { inst.enableSwipe(); } }; inst.slideTimer = function (interval, callback, updatecallback) { let timerInstance = this, updateinterval = 50, updateTimerId = null, runningTime = 0, paused = false, started = false, startedandpaused = false; timerInstance.timeout = interval; this.pause = function () { if (started) { paused = true; clearInterval(updateTimerId); } }; this.resume = function (forceresume) { if (startedandpaused && !forceresume) { return; } startedandpaused = false; if (started && paused) { paused = false; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); } }; this.stop = function () { clearInterval(updateTimerId); if (updatecallback) { updatecallback(-1); } runningTime = 0; paused = false; started = false; }; this.start = function () { runningTime = 0; paused = false; started = true; updateTimerId = setInterval( function () { runningTime += updateinterval; if (runningTime > timerInstance.timeout) { clearInterval(updateTimerId); if (callback) { callback(); } } if (updatecallback) { updatecallback(runningTime / timerInstance.timeout); } }, updateinterval ); }; this.startandpause = function () { runningTime = 0; paused = true; started = true; startedandpaused = true; }; return this; }; inst.updateTimer = function (percent) { var w = Math.round(percent * 100); if (w > 100) { w = 100; } if (0 > w ) { w = 0; } $("#tsvg-fancy-html5-timer", inst.$lightbox).css({ display: "block", width: w + "%" }); }; inst.initSlide = function () { inst.autosliding = false; inst.slideTimeout = inst.slideTimer( inst.options.slideinterval, function () { inst.gotoSlide(-1); }, inst.options.showtimer ? function (percent) { inst.updateTimer(percent); } : null ); if (inst.options.autoslide) { inst.slideTimeout.stop(); inst.autosliding = true; } }; inst.nextArrowClicked = function () { if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastarrowclicked && window[inst.options.onlastarrowclicked] && typeof window[inst.options.onlastarrowclicked] == "function") { window[inst.options.onlastarrowclicked](); } } inst.gotoSlide(-1); }; inst.prevArrowClicked = function () { if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstarrowclicked && window[inst.options.onfirstarrowclicked] && typeof window[inst.options.onfirstarrowclicked] == "function") { window[inst.options.onfirstarrowclicked](); } } inst.gotoSlide(-2); }; inst.calcNextPrevElem = function () { inst.options.nextElem = -1; inst.options.prevElem = -1; inst.options.inGroup = false; inst.options.groupIndex = 0; inst.options.groupCount = 0; var group = inst.elemArray[inst.options.curElem][ELEM_GROUP]; for (var i = 0; inst.elemArray.length > i; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (i == inst.options.curElem) { inst.options.groupIndex = inst.options.groupCount; } inst.options.groupCount++; } } var j, curGroup = inst.elemArray[inst.options.curElem][ELEM_GROUP]; if (curGroup != undefined && curGroup != null) { for (j = inst.options.curElem + 1;inst.elemArray.length > j; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } if (0 > inst.options.nextElem) { for (j = 0; inst.options.curElem > j ; j++) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.nextElem = j; break; } } } if (inst.options.nextElem >= 0) { for (j = inst.options.curElem - 1; j >= 0; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } if (0 > inst.options.prevElem ) { for (j = inst.elemArray.length - 1; j > inst.options.curElem; j--) { if (inst.matchGroup(curGroup, inst.elemArray[j][ELEM_GROUP])) { inst.options.prevElem = j; break; } } } } } if (inst.options.nextElem >= 0 || inst.options.prevElem >= 0) { inst.options.inGroup = true; } }; inst.calcBoxPosition = function (initW, initH) { var boxW = initW + 2 * inst.options.bordersize; var boxH = initH + 2 * inst.options.bordersize; var winH = window.innerHeight ? window.innerHeight : $(window).height(); var boxT = Math.round((winH - inst.options.navheight) / 2 - boxH / 2); if (inst.options.titlestyle == "bottom") { boxT -= Math.round(inst.options.barheight / 2); } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; if (topmargin > boxT) { boxT = topmargin; } if (inst.options.insideiframe && window.self != window.top) { if (parent.window.jQuery && parent.window.jQuery("#" + inst.options.iframeid).length) { var iframetop = parent.window.jQuery("#" + inst.options.iframeid).offset().top; var parentscroll = parent.window.document.body.scrollTop; boxT = topmargin; boxT += parentscroll > iframetop ? parentscroll - iframetop : 0; } } return [boxW, boxH, boxT]; }; inst.hideNavArrows = function () { var showPrev = false; var showNext = false; if (inst.options.inGroup) { if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showPrev = true; } if (inst.options.arrowloop || (!inst.options.arrowloop && inst.options.curElem > inst.options.prevElem )) { showNext = true; } } if (showPrev) { inst.$prev.removeClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$prev.addClass("tsvg-fancy-html5-hide"); if (inst.$prevbottom) { inst.$prevbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$prevtouch) { inst.$prevtouch.addClass("tsvg-fancy-html5-hide"); } } if (showNext) { inst.$next.removeClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.removeClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.removeClass("tsvg-fancy-html5-hide"); } } else { inst.$next.addClass("tsvg-fancy-html5-hide"); if (inst.$nextbottom) { inst.$nextbottom.addClass("tsvg-fancy-html5-hide"); } if (inst.$nexttouch) { inst.$nexttouch.addClass("tsvg-fancy-html5-hide"); } } }; inst.clickHandler = function (event) { var $this = $(this); var dataoptions = {}; if (jQuery(event.target).prop("tagName") == 'A') { let link = jQuery(event.target).attr('href'); if (jQuery(event.target).attr('target') == '_blank') { window.open(link); } else { window.location.assign(link) } return false; } $.each( $this.data(), function (key, value) { dataoptions[key.toLowerCase()] = value; } ); inst.options = $.extend(inst.options, inst.defaultoptions, dataoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i ; i++) { if (inst.elemArray[i][ELEM_ID] == $this.data("tsvgid")) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; if (inst.options.iequirksmode) { inst.$lightboxBox.css({ top: boxT }); } else { inst.$lightboxBox.css({ "margin-top": boxT }); } if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.loadThumbnail = function (src, index) { let inst_img_elem = document.createElement('img'); inst_img_elem.src = src; inst_img_elem.addEventListener('load', function () { if (inst.options.thumbwidth / inst.options.thumbheight >= inst_img_elem.naturalWidth / inst_img_elem.naturalHeight ) { inst_img_elem.setAttribute("style","width:100%;") } else { inst_img_elem.setAttribute("style","height:100%;") } $(".tsvg-fancy-html5-nav-thumb").eq(index).html(inst_img_elem); }) inst_img_elem.addEventListener('error', function () { console.log('error') }) }; inst.matchGroup = function (curGroup, elemGroup) { if (!curGroup || !elemGroup) { return false; } var curs = curGroup.split(":"); var elems = elemGroup.split(":"); var result = false; for (var i in curs) { if ($.inArray(curs[i], elems) > -1) { result = true; break; } } return result; }; inst.showNavigation = function () { if (!inst.options.shownavigation) { return; } if (!inst.currentElem || !inst.currentElem[ELEM_GROUP]) { return; } var i; var showNav = false; var group = inst.currentElem[ELEM_GROUP]; for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { showNav = true; break; } } } if (!showNav) { return; } inst.options.navheight = inst.options.thumbheight + inst.options.thumbtopmargin + inst.options.thumbbottommargin; if ($(".tsvg-fancy-html5-nav").length > 0) { return; } var check_bool = $('.tsvg-fancy-blocks-container').attr('data-tsvg-shn'); if (check_bool === 'false') { return } $("body").append( "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); if (TS_VG_FG_Show_Nav == "true") { var index = 0; } for (i = 0; inst.elemArray.length > i ; i++) { if (inst.matchGroup(group, inst.elemArray[i][ELEM_GROUP])) { if (inst.elemArray[i][ELEM_THUMBNAIL] && inst.elemArray[i][ELEM_THUMBNAIL].length > 0) { $(".tsvg-fancy-html5-nav-list").append( "
'
" ); this.loadThumbnail(inst.elemArray[i][ELEM_THUMBNAIL], index) index++; } } } $(".tsvg-fancy-html5-nav-thumb").hover( function () { $(this).css({ opacity: 1 }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbhighlightbordercolor }); }, function () { $(this).css({ opacity: inst.options.thumbopacity }); $(this).css({ border: inst.options.thumbborder + "px solid " + inst.options.thumbbordercolor }); } ); $(".tsvg-fancy-html5-nav-thumb").click( function () { var index = $(this).data("arrayindex"); if (index >= 0) { inst.gotoSlide(index); } } ); inst.options.totalwidth = index * (inst.options.thumbgap + inst.options.thumbwidth + 2 * inst.options.thumbborder); $(".tsvg-fancy-html5-nav-list") .css({ display: "block", position: "relative", "margin-left": 0, width: inst.options.totalwidth + "px" }) .append("
"); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); $navPrev.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) + maskWidth; if (marginLeft >= 0) { marginLeft = 0; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (maskWidth - inst.options.totalwidth >= marginLeft ) { $navNext.css({ "background-position": "center left" }); } else { $navNext.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); $navNext.click( function () { var $navList = $(".tsvg-fancy-html5-nav-list"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var winWidth = $(window).width(); var maskWidth = winWidth - 2 * inst.options.navbuttonwidth; var marginLeft = parseInt($navList.css("margin-left")) - maskWidth; if (maskWidth - inst.options.totalwidth >= marginLeft) { marginLeft = maskWidth - inst.options.totalwidth; $(this).css({ "background-position": "center left" }); } else { $(this).css({ "background-position": "center right" }); } if (marginLeft >= 0) { $navPrev.css({ "background-position": "center left" }); } else { $navPrev.css({ "background-position": "center right" }); } $navList.animate({ "margin-left": marginLeft }); } ); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.loadElem = function (elem) { inst.currentElem = elem; inst.showing = true; inst.showNavigation(); inst.$elem.unbind("mouseenter").unbind("mouseleave").unbind("mousemove"); inst.$loading.show(); if (inst.options.onshowitem && window[inst.options.onshowitem] && typeof window[inst.options.onshowitem] == "function") { window[inst.options.onshowitem](elem); } switch (elem[ELEM_TYPE]) { case 0: var imgLoader = new Image(); $(imgLoader).load( function () { inst.showImage(elem, imgLoader.width, imgLoader.height); } ); $(imgLoader).error( function () { inst.showError(); } ); imgLoader.src = elem[ELEM_HREF]; break; case 1: inst.showSWF(elem); break; case 2: case 8: inst.showVideo(elem); break; case 3: case 4: case 9: case 11: inst.showYoutubeVimeo(elem); break; case 5: inst.showPDF(elem); break; case 6: inst.showMP3(elem); break; case 7: inst.showWeb(elem); break; case 10: inst.showDiv(elem); break; } if (inst.options.googleanalyticsaccount && window._gaq) { window._gaq.push(["_trackEvent", "Lightbox", "Open", elem[ELEM_HREF]]); } }; inst.loadCurElem = function () { inst.loadElem(inst.elemArray[inst.options.curElem]); }; inst.showError = function () { inst.$loading.hide(); inst.resizeLightbox( inst.options.errorwidth, inst.options.errorheight, true, function () { inst.$error.show(); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); } ); }; inst.calcTextWidth = function (objW) { return objW - 36; }; (inst.showTitle = function (w, t, description) { if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: w + "px" }); } var text = ""; if (inst.options.showtitle) { if (t && t.length > 0) { text += t; } } if (inst.options.inGroup) { if (inst.options.showtitleprefix) { text = inst.options.titleprefix.replace("%NUM", inst.options.groupIndex + 1).replace("%TOTAL", inst.options.groupCount) + " " + text; } jQuery("#tsvg-fancy-html5-elem-data-box").css("display", "none"); if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT != "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (inst.options.showplaybutton && TotalSoft_VG_FG_ShSlPlIc == "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + text + "
" + description + "
" ); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD == "true") { jQuery("#tsvg-fancy-html5-elem-data-box") .css("display", "inline-block") .html( "
" + description + "
" ); } if (TotalSoft_GV_FG_PD == "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "block"); } if (TotalSoft_GV_FG_PT == "true") { jQuery(".tsvg-fancy-popup-text").css("display", "inline-block"); } if (TotalSoft_GV_FG_PD != "true") { jQuery(".tsvg-fancy-popup-desc").css("display", "none"); } if (TotalSoft_GV_FG_PT != "true") { jQuery(".tsvg-fancy-popup-text").css("display", "none"); } if (TotalSoft_VG_FG_ShSlPlIc != "true" && TotalSoft_GV_FG_PT != "true" && TotalSoft_GV_FG_PD != "true") { jQuery("#tsvg-fancy-html5-text").css("display", "none"); } } if (inst.options.showdescription && description && description.length > 0) { inst.$text.html(text); } if (inst.options.inGroup && inst.options.showplaybutton) { if (inst.autosliding) { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } else { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); } $("#tsvg-fancy-html5-play", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).hide(); $("#tsvg-fancy-html5-pause", inst.$lightbox).show(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.slideTimeout.start(); inst.autosliding = true; } } ); $("#tsvg-fancy-html5-pause", inst.$lightbox).click( function () { $("#tsvg-fancy-html5-play", inst.$lightbox).show(); $("#tsvg-fancy-html5-pause", inst.$lightbox).hide(); if (inst.slideTimeout) { inst.slideTimeout.stop(); inst.autosliding = false; } } ); } $("#tsvg-fancy-html5-social", inst.$lightbox).show(); }); (inst.showImage = function (elem, imgW, imgH) { var elemW, elemH; if (elem[ELEM_WIDTH]) { elemW = elem[ELEM_WIDTH]; } else { elemW = imgW; elem[ELEM_WIDTH] = imgW; } if (elem[ELEM_HEIGHT]) { elemH = elem[ELEM_HEIGHT]; } else { elemH = imgH; elem[ELEM_HEIGHT] = imgH; } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, inst.options.imagekeepratio); inst.resizeLightbox( sizeObj.w, sizeObj.h, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); var timercode = !inst.options.showtimer || !inst.options.inGroup ? "" : ""; inst.$image.show(); inst.$image.html( "
" + timercode + "
" ); inst.$elem.fadeIn( inst.options.fadespeed, function () { inst.showData(); } ); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }); inst.showSWF = function (elem) { var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); inst.embedFlash($("#tsvg-html5lightbox-swf"), elem[ELEM_HREF], "window", { width: dataW, height: dataH }); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showVideo = function (elem) { inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var isHTML5 = false; if (inst.options.isIE678 || elem[ELEM_TYPE] == 8 || (inst.options.isIE9 && inst.options.useflashonie9) || (inst.options.isIE10 && inst.options.useflashonie10) || (inst.options.isIE11 && inst.options.useflashonie11)) { isHTML5 = false; } else if (inst.options.isMobile) { isHTML5 = true; } else if ((inst.options.html5player || !inst.options.flashInstalled) && inst.options.html5VideoSupported) { if ((!inst.options.isFirefox && !inst.options.isOpera) || ((inst.options.isFirefox || inst.options.isOpera) && (elem[ELEM_HREF_OGG] || elem[ELEM_HREF_WEBM]))) { isHTML5 = true; } } if (isHTML5) { var videoSrc = elem[ELEM_HREF]; if (inst.options.isFirefox || inst.options.isOpera || !videoSrc) { videoSrc = elem[ELEM_HREF_WEBM] ? elem[ELEM_HREF_WEBM] : elem[ELEM_HREF_OGG]; } inst.embedHTML5Video($("#tsvg-html5lightbox-video"), videoSrc, inst.options.autoplay, inst.options.loopvideo); } else { var videoFile = elem[ELEM_HREF]; if (videoFile.charAt(0) != "/" && videoFile.substring(0, 5) != "http:" && videoFile.substring(0, 6) != "https:") { videoFile = inst.options.htmlfolder + videoFile; } inst.embedFlash( $("#tsvg-html5lightbox-video"), inst.options.jsfolder + "html5boxplayer.swf", "transparent", { width: dataW, height: dataH, jsobjectname: "html5Lightbox", hidecontrols: inst.options.videohidecontrols ? "1" : "0", hideplaybutton: "0", videofile: videoFile, hdfile: "", ishd: "0", defaultvolume: inst.options.defaultvideovolume, autoplay: inst.options.autoplay ? "1" : "0", loop: inst.options.loopvideo ? "1" : "0", errorcss: ".html5box-error" + inst.options.errorcss, id: 0, } ); } inst.$elem.show(); inst.showData(); } ); }; inst.loadNext = function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } }; inst.getYoutubeParams = function (href) { var result = {}; if (0 > href.indexOf("?") ) { return result; } var params = href.substring(href.indexOf("?") + 1).split("&"); for (var i = 0;params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2 && value[0].toLowerCase() != "v") { result[value[0].toLowerCase()] = value[1]; } } return result; }; inst.getYoutubeId = function (href) { var youtubeId = ""; var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(shorts\/)|(watch\??v?=?))([^#\&\?]*).*/; var match = href.match(regExp); if (match && match[match.length -1].length == 11) { youtubeId = match[match.length -1]; } return youtubeId; }; inst.prepareYoutubeHref = function (href) { let youtubeId = inst.getYoutubeId(href), protocol = "https:", result = protocol + "//www.youtube.com/embed/" + youtubeId, params = this.getYoutubeParams(href), first = true; for (var key in params) { if (first) { result += "?"; first = false; } else { result += "&"; } result += key + "=" + params[key]; } return result; }; inst.prepareDailymotionHref = function (href) { if (href.match(/\:\/\/.*(dai\.ly)/i)) { var protocol = "https:"; var id = href.match(/(dai\.ly\/)([a-zA-Z0-9\-\_]+)/)[2]; href = protocol + "" + id; } return href; }; inst.showYoutubeVimeo = function (elem) { var tsvg_autoplay = jQuery('.tsvg-main-content-' + id).attr('data-tsvg-autoplay'); inst.slideTimeout.stop(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : DEFAULT_WIDTH; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : DEFAULT_HEIGHT; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, true); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var href = elem[ELEM_HREF]; var youtubeid = ""; if (elem[ELEM_TYPE] == 3) { youtubeid = inst.getYoutubeId(href); href = inst.prepareYoutubeHref(href); if (tsvg_autoplay == "true") { href += "?autoplay=1&mute=1" } else { href += "?autoplay=0&mute=0" } } if (elem[ELEM_TYPE] == 9) { href = inst.prepareDailymotionHref(href); } if (inst.options.autoplay) { if (elem[ELEM_TYPE] == 4) { if (href.indexOf('player.vimeo.com/video/') > -1) { if (tsvg_autoplay == "true") { href += "?autoplay=1&muted=1"; } } } } if (inst.options.loopvideo) { href += 0 > href.indexOf("?") ? "?" : "&"; switch (elem[ELEM_TYPE]) { case 3: href += "loop=1&playlist=" + youtubeid; break; case 4: case 9: href += "loop=1"; break; case 11: href += "endVideoBehavior=loop"; break; } } if (elem[ELEM_TYPE] == 3 && Totalsoft_FG_ShVAutoPl == "true") { if (0 > href.indexOf("?")) { href += "?wmode=transparent&rel=0&iv_load_policy=3"; } else { href += "&wmode=transparent&rel=0&iv_load_policy=3"; } if (inst.options.videohidecontrols) { href += "&controls=0&showinfo=0"; } href += "&mute=1&enablejsapi=1&origin=" + document.location.protocol + "//" + document.location.hostname; } if (href.indexOf('.mp4') > -1) { let autoplay_bool = tsvg_autoplay == "true" ? "autoplay muted" : ""; $("#tsvg-html5lightbox-video").html(''); } else { $("#tsvg-html5lightbox-video").html(""); } inst.$elem.show(); inst.showData(); if (elem[ELEM_TYPE] == 3 && typeof YT === "object" && typeof YT.Player === "function") { new YT.Player( "html5boxiframevideo", { events: { onStateChange: function (event) { if (event.data == YT.PlayerState.ENDED) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } }, }, } ); } else if (elem[ELEM_TYPE] == 4 && typeof $f === "function") { var vimeoIframe = $("#html5boxiframevideo")[0]; var vimeoPlayer = $f(vimeoIframe); vimeoPlayer.addEvent( "ready", function () { vimeoPlayer.addEvent( "finish", function (id) { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); } ); } } ); }; inst.showPDF = function (elem) { }; inst.showMP3 = function (elem) { }; inst.showDiv = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); var divID = elem[ELEM_HREF]; if ($(divID).length > 0) { $("#tsvg-html5lightbox-div").html($(divID).html()); } else { $("#tsvg-html5lightbox-div").html("
The specified div ID does not exist.
"); } inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.showWeb = function (elem) { var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); var dataW = elem[ELEM_WIDTH] ? elem[ELEM_WIDTH] : winWidth; var dataH = elem[ELEM_HEIGHT] ? elem[ELEM_HEIGHT] : winH - inst.options.navheight; var sizeObj = inst.calcElemSize({ w: dataW, h: dataH }, false); var tsvgRumbleCheck = elem[ELEM_HREF].indexOf('rumble.com/') > -1 ? 'sandbox="allow-scripts"' : ''; dataW = sizeObj.w; dataH = sizeObj.h; inst.resizeLightbox( dataW, dataH, true, function () { inst.$loading.hide(); inst.showTitle(sizeObj.w, elem[ELEM_TITLE], elem[ELEM_DESCRIPTION]); inst.$image.html("
").show(); $("#tsvg-html5lightbox-web").html(""); inst.$elem.show(); inst.showData(); if (inst.autosliding) { inst.slideTimeout.stop(); inst.slideTimeout.start(); } } ); }; inst.scrollBox = function () { }; inst.resizeWindow = function () { if (!inst.currentElem) { return; } if (!inst.options.responsive) { return; } var winWidth = $(window).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); if (inst.options.responsivebarheight) { if (inst.options.smallscreenheight >= winH) { inst.options.barheight = inst.options.barheightonsmallheight; } else { inst.options.barheight = inst.options.barheightoriginal; } if (inst.options.titlestyle == "bottom" && inst.options.barautoheight != "auto") { inst.$elemData.css({ height: inst.options.barheight + "px", "max-height": inst.options.barheight + "px" }); } } var elemW, elemH, keepratio; if (inst.currentElem[ELEM_TYPE] == 7 || inst.currentElem[ELEM_TYPE] == 10) { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : winWidth; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : winH - inst.options.navheight; keepratio = false; } else { elemW = inst.currentElem[ELEM_WIDTH] ? inst.currentElem[ELEM_WIDTH] : DEFAULT_WIDTH; elemH = inst.currentElem[ELEM_HEIGHT] ? inst.currentElem[ELEM_HEIGHT] : DEFAULT_HEIGHT; if (inst.currentElem[ELEM_TYPE] == 0) { keepratio = inst.options.imagekeepratio; } else { keepratio = true; } } var sizeObj = inst.calcElemSize({ w: elemW, h: elemH }, keepratio); var boxPos = inst.calcBoxPosition(sizeObj.w, sizeObj.h); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } if (inst.options.titlestyle == "inside") { inst.$elemData.css({ width: sizeObj.w + "px" }); } if (0 >= $(".tsvg-fancy-html5-nav").length ) { return; } $(".tsvg-fancy-html5-nav-list").css({ "margin-left": 0 }); var $navMask = $(".tsvg-fancy-html5-nav-mask"); var $navPrev = $(".tsvg-fancy-html5-nav-prev"); var $navNext = $(".tsvg-fancy-html5-nav-next"); var winWidth = $(window).width(); if (winWidth >= inst.options.totalwidth ) { $navMask.css({ width: inst.options.totalwidth + "px" }); $navPrev.hide(); $navNext.hide(); } else { $navMask.css({ width: winWidth - 2 * inst.options.navbuttonwidth + "px" }); $navPrev.show(); $navNext.show(); } }; inst.calcElemSize = function (sizeObj, keepratio) { if (!inst.options.responsive) { return sizeObj; } var winWidth = $(window).width(); winWidth = winWidth ? winWidth : $(document).width(); var winH = window.innerHeight ? window.innerHeight : $(window).height(); winH = winH ? winH : $(document).height(); if ((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && winWidth > inst.options.sidetobottomscreenwidth) { sizeObj.w = (sizeObj.w * 100) / inst.options.imagepercentage; } var topmargin = inst.options.navarrowsbottomscreenwidth > $(window).width() ? inst.options.bordertopmarginsmall : inst.options.bordertopmargin; var h0 = winH - inst.options.navheight - 2 * inst.options.bordersize - 2 * topmargin; if (inst.options.titlestyle == "bottom") { h0 -= inst.options.barheight; } if (((inst.options.titlestyle == "left" || inst.options.titlestyle == "right") && inst.options.sidetobottomscreenwidth >= winWidth ) || (inst.options.notkeepratioonsmallheight && inst.options.smallscreenheight >= winH)) { keepratio = false; } if (sizeObj.h > h0) { if (keepratio) { sizeObj.w = Math.round((sizeObj.w * h0) / sizeObj.h); } sizeObj.h = h0; } var w0 = winWidth - 2 * inst.options.bordersize - 2 * inst.options.bordermargin; if ( (inst.options.fullscreenmode && winWidth > inst.options.navarrowsbottomscreenwidth) || (((inst.options.isTouch && inst.options.navarrowsalwaysshowontouch) || inst.options.alwaysshownavarrows) && winWidth > inst.options.navarrowsbottomscreenwidth) ) { w0 -= 64; } if (sizeObj.w > w0) { if (keepratio) { sizeObj.h = Math.round((sizeObj.h * w0) / sizeObj.w); } sizeObj.w = w0; } return sizeObj; }; inst.showData = function () { if (inst.$text.text().length > 0) { inst.$elemData.show(); } if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$lightboxBox.css({ height: "auto" }); } if (inst.$text.text().length > 0 && inst.options.titlestyle == "bottom") { inst.$elemData.css({ "max-height": inst.options.barheight + "px" }); } $("#tsvg-fancy-html5-lightbox-overlay", inst.$lightbox).css({ height: Math.max($(window).height(), $(document).height()) }); $(window).trigger("html5lightbox.lightboxopened"); }; inst.resizeLightbox = function (elemW, elemH, bAnimate, onFinish) { inst.hideNavArrows(); var boxPos = inst.calcBoxPosition(elemW, elemH); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$loading.hide(); inst.$watermark.hide(); if (inst.options.curElem >= inst.options.nextElem) { if (inst.options.onlastitem && window[inst.options.onlastitem] && typeof window[inst.options.onlastitem] == "function") { window[inst.options.onlastitem](inst.currentElem); } } if (inst.options.prevElem >= inst.options.curElem) { if (inst.options.onfirstitem && window[inst.options.onfirstitem] && typeof window[inst.options.onfirstitem] == "function") { window[inst.options.onfirstitem](inst.currentElem); } } if (!inst.options.fullscreenmode && (!inst.options.isTouch || !inst.options.navarrowsalwaysshowontouch) && !inst.options.alwaysshownavarrows) { inst.$elem.bind( "mouseenter mousemove", function () { if ((inst.options.arrowloop && inst.options.prevElem >= 0) || (!inst.options.arrowloop && inst.options.prevElem >= 0 && inst.options.curElem > inst.options.prevElem )) { inst.$prev.fadeIn(); } if ((inst.options.arrowloop && inst.options.nextElem >= 0) || (!inst.options.arrowloop && inst.options.nextElem >= 0 && inst.options.nextElem > inst.options.curElem)) { inst.$next.fadeIn(); } } ); inst.$elem.bind( "mouseleave", function () { inst.$next.fadeOut(); inst.$prev.fadeOut(); } ); } inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$lightboxBox.width() && boxH == inst.$lightboxBox.height()) { speed = 0; } inst.$lightboxBox.animate({ width: boxW }, speed).animate( { height: boxH }, speed, function () { inst.onAnimateFinish(onFinish); } ); } else { var speed = bAnimate ? inst.options.resizespeed : 0; if (boxW == inst.$elemWrap.width() && boxH == inst.$elemWrap.height()) { speed = 0; } inst.$lightboxBox.css({ width: boxW, height: "auto", "min-width": boxW - 15 }); inst.$elemWrap.animate({ width: boxW, "min-width": boxW - 15 }, speed).animate( { height: boxH, "min-height": boxH - 15 }, speed, function () { inst.onAnimateFinish(onFinish); } ); } }; inst.onAnimateFinish = function (onFinish) { inst.$loading.show(); inst.$watermark.show(); inst.$close.show(); inst.$elem.css({ "background-color": inst.options.bgcolor }); onFinish(); }; inst.reset = function () { if (inst.options.stamp) { inst.$watermark.hide(); } inst.showing = false; inst.$image.empty(); inst.$text.empty(); inst.$error.hide(); inst.$loading.hide(); inst.$image.hide(); if (inst.options.titlestyle == "bottom" || inst.options.titlestyle == "inside") { inst.$elemData.hide(); } if (!inst.options.fullscreenmode) { inst.$close.hide(); } inst.$elem.css({ "background-color": "" }); }; inst.resetNavigation = function () { inst.options.navheight = 0; $(".tsvg-fancy-html5-nav").remove(); }; inst.finish = function () { if ($("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).length) { $("#tsvg-fancy-html5-lightbox-video", inst.$lightbox).attr("src", ""); } $("head") .find("style") .each( function () { if ($(this).data("creator") == "tsvg-fancy-html5box-html5-lightbox") { $(this).remove(); } } ); inst.slideTimeout.stop(); inst.reset(); inst.resetNavigation(); inst.$lightbox.remove(); $("#tsvg-fancy-html5box-html5-lightbox").remove(); inst.showObjects(); if (inst.options.oncloselightbox && window[inst.options.oncloselightbox] && typeof window[inst.options.oncloselightbox] == "function") { window[inst.options.oncloselightbox](inst.currentElem); } if (inst.onLightboxClosed && typeof inst.onLightboxClosed == "function") { inst.onLightboxClosed(inst.currentElem); } }; inst.pauseSlide = function () { }; inst.playSlide = function () { }; inst.gotoSlide = function (slide) { if (slide == -1) { if (0 > inst.options.nextElem ) { return; } inst.options.curElem = inst.options.nextElem; } else if (slide == -2) { if (0 > inst.options.prevElem ) { return; } inst.options.curElem = inst.options.prevElem; } else if (slide >= 0) { inst.options.curElem = slide; } if (inst.autosliding) { inst.slideTimeout.stop(); } inst.calcNextPrevElem(); inst.reset(); inst.loadCurElem(); }; inst.enableSwipe = function () { inst.$elem.html5lightboxTouchSwipe491211( { preventWebBrowser: false, swipeLeft: function () { inst.gotoSlide(-1); }, swipeRight: function () { inst.gotoSlide(-2); }, } ); }; inst.hideObjects = function () { $("select, embed, object").css({ visibility: "hidden" }); }; inst.showObjects = function () { $("select, embed, object").css({ visibility: "visible" }); }; inst.embedHTML5Video = function ($container, src, autoplay, loopvideo) { let embedVideoPoster = (inst.options.html5videoposter && inst.options.html5videoposter.length > 0 ? "poster='" + inst.options.html5videoposter + "'" : ""), embedVideoControls = (inst.options.nativehtml5controls && !inst.options.videohidecontrols ? " controls='controls'" : ""); $container.html( "
" ); if (!inst.options.nativehtml5controls) { $("video", $container).data("src", src); $("video", $container).lightboxHTML5VideoControls491211(inst.options.skinsfolder, inst, inst.options.videohidecontrols, false, inst.options.defaultvideovolume); } $("video", $container) .unbind("ended") .bind( "ended", function () { $(window).trigger("html5lightbox.videofinished"); if (inst.autosliding) { inst.gotoSlide(-1); } else if (inst.options.autoclose) { inst.finish(); } } ); }; inst.embedFlash = function ($container, src, wmode, flashVars) { if (inst.options.flashInstalled) { var htmlOptions = { pluginspage: "", quality: "high", allowFullScreen: "true", allowScriptAccess: "always", type: "application/x-shockwave-flash" }; htmlOptions.width = "100%"; htmlOptions.height = "100%"; htmlOptions.src = src; htmlOptions.flashVars = $.param(flashVars); htmlOptions.wmode = wmode; var htmlString = ""; for (var key in htmlOptions) { htmlString += key + "=" + htmlOptions[key] + " "; } $container.html(""); } else { $container.html( "
The required Adobe Flash Player plugin is not installed

Get Adobe Flash player
" ); } }; inst.checkType = function (href) { if (!href) { return -1; } if (href.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) { return 0; } if (href.match(/[^\.]\.(swf)\s*$/i)) { return 1; } if (href.match(/\.(mp4|m4v|ogv|ogg|webm)(.*)?$/i)) { return 4; } if (href.match(/\:\/\/.*(youtube\.com)/i) || href.match(/\:\/\/.*(youtu\.be)/i)) { return 3; } if (href.match(/\:\/\/.*(vimeo\.com)/i)) { return 4; } if (href.match(/\:\/\/.*(dailymotion\.com)/i) || href.match(/\:\/\/.*(dai\.ly)/i)) { return 9; } if (href.match(/[^\.]\.(pdf)\s*$/i)) { return 5; } if (href.match(/[^\.]\.(mp3)\s*$/i)) { return 6; } if (href.match(/[^\.]\.(flv)\s*$/i)) { return 8; } if (href.match(/\#\w+/i)) { return 10; } if (href.match(/\:\/\/.*(wistia)/i)) { return 11; } return 7; }; inst.getURLParams = function () { var result = {}; var params = window.location.search.substring(1).split("&"); for (var i = 0; params.length > i ; i++) { var value = params[i].split("="); if (value && value.length == 2) { result[value[0].toLowerCase()] = unescape(value[1]); } } return result; }; inst.absoluteUrl = function (href) { var link = document.createElement("a"); link.href = href; return link.protocol + "//" + link.host + link.pathname + link.search + link.hash; }; inst.showLightbox = function (type, href, title, width, height, webm, ogg, thumbnail, description) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadElem(new Array(type, href, title, null, width, height, webm, ogg, thumbnail, description)); }; inst.addItem = function (href, title, group, width, height, webm, ogg, thumbnail, description, mediatype) { type = mediatype && mediatype >= 0 ? mediatype : inst.checkType(href); inst.elemArray.push(new Array(type, href, title, group, width, height, webm, ogg, thumbnail, description)); }; inst.showItem = function (href) { inst.options = $.extend(inst.options, inst.defaultoptions); $(window).trigger("html5lightbox.lightboxshow"); inst.init(); if (0 >= inst.elemArray.length) { return true; } inst.hideObjects(); for (var i = 0; inst.elemArray.length > i; i++) { if (inst.elemArray[i][ELEM_HREF] == href) { break; } } if (i == inst.elemArray.length) { return true; } inst.options.curElem = i; inst.calcNextPrevElem(); inst.reset(); inst.$lightbox.show(); var boxPos = inst.calcBoxPosition(inst.options.loadingwidth, inst.options.loadingheight); var boxW = boxPos[0]; var boxH = boxPos[1]; var boxT = boxPos[2]; inst.$lightboxBox.css({ "margin-top": boxT }); if (!inst.options.positionFixed) { inst.$lightboxBox.css("margin-top", $(window).scrollTop() + inst.options.bordertopmargin); } if (inst.options.titlestyle == "left" || inst.options.titlestyle == "right") { inst.$lightboxBox.css({ width: boxW, height: boxH }); } else { inst.$lightboxBox.css({ width: boxW, height: "auto" }); inst.$elemWrap.css({ width: boxW, height: boxH }); } inst.loadCurElem(); return false; }; inst.unbind("click").click(inst.clickHandler); inst.each( function () { var self = $(this); if (self.data("autoopen")) { setTimeout( function () { self.click(); }, self.data("autoopendelay") ? self.data("autoopendelay") : 0 ); return false; } } ); var urlParams = inst.getURLParams(); if ("html5lightboxshare" in urlParams) { var shareUrl = decodeURIComponent(urlParams["html5lightboxshare"]); var shareLink = $('.tsvg-html5lightbox-491211[href="' + shareUrl + '"]'); if (shareLink.length > 0) { shareLink.click(); } } return inst; }; })(jQuery); (function ($) { $.fn.html5lightboxTouchSwipe491211 = function (options) { var defaults = { preventWebBrowser: false, swipeLeft: null, swipeRight: null, swipeTop: null, swipeBottom: null }; if (options) { $.extend(defaults, options); } return this.each( function () { var startX = -1, startY = -1; var curX = -1, curY = -1; function touchStart(event) { var e = event.originalEvent; if (e.targetTouches.length >= 1) { startX = e.targetTouches[0].pageX; startY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchMove(event) { if (defaults.preventWebBrowser) { event.preventDefault(); } var e = event.originalEvent; if (e.targetTouches.length >= 1) { curX = e.targetTouches[0].pageX; curY = e.targetTouches[0].pageY; } else { touchCancel(event); } } function touchEnd(event) { if (curX > 0 || curY > 0) { triggerHandler(); touchCancel(event); } else { touchCancel(event); } } function touchCancel(event) { startX = -1; startY = -1; curX = -1; curY = -1; } function triggerHandler() { if (Math.abs(curX - startX) > Math.abs(curY - startY)) { if (curX > startX) { if (defaults.swipeRight) { defaults.swipeRight.call(); } } else { if (defaults.swipeLeft) { defaults.swipeLeft.call(); } } } else if (curY > startY) { if (defaults.swipeBottom) { defaults.swipeBottom.call(); } } else if (defaults.swipeTop) { defaults.swipeTop.call(); } } try { $(this).bind("touchstart", touchStart); $(this).bind("touchmove", touchMove); $(this).bind("touchend", touchEnd); $(this).bind("touchcancel", touchCancel); } catch (e) { } } ); }; })(jQuery); (function ($) { $.fn.lightboxHTML5VideoControls491211 = function (skinFolder, parentInst, hidecontrols, hideplaybutton, defaultvolume) { var isTouch = "ontouchstart" in window; var eStart = isTouch ? "touchstart" : "mousedown"; var eMove = isTouch ? "touchmove" : "mousemove"; var eCancel = isTouch ? "touchcancel" : "mouseup"; var eClick = "click"; var BUTTON_SIZE = 32; var BAR_HEIGHT = isTouch ? 48 : 36; var hideControlsTimerId = null; var hideVolumeBarTimeoutId = null; var sliderDragging = false; var isFullscreen = false; var userActive = true; var isIPhone = navigator.userAgent.match(/iPod/i) != null || navigator.userAgent.match(/iPhone/i) != null; var isHd = $(this).data("ishd"); var hd = $(this).data("hd"); var src = $(this).data("src"); var $videoObj = $(this); $videoObj.get(0).removeAttribute("controls"); if (isIPhone) { var h = $videoObj.height() - BAR_HEIGHT; $videoObj.css({ height: h }); } var $videoPlay = $("
"); if (!isIPhone) { $videoObj.after($videoPlay); $videoPlay .css( { position: "absolute", top: "50%", left: "50%", display: "block", cursor: "pointer", width: 64, height: 64, "margin-left": -32, "margin-top": -32, "background-image": "url('" + skinFolder + "html5boxplayer_playvideo.png" + "')", "background-position": "center center", "background-repeat": "no-repeat", } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); } var $videoFullscreenBg = $("
"); var $videoControls = $( "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" + "
--:--
" + "
" + "
" + "
" + "
" + "
" + "
" + "
" ); $videoObj.after($videoControls); $videoObj.after($videoFullscreenBg); $videoFullscreenBg.css({ display: "none", position: "fixed", left: 0, top: 0, bottom: 0, right: 0, "z-index": 2147483647 }); $videoControls.css({ display: "block", position: "absolute", width: "100%", height: BAR_HEIGHT, left: 0, bottom: 0, right: 0, "max-width": "640px", margin: "0 auto" }); var userActivate = function () { userActive = true; }; $videoObj .bind( eClick, function () { userActive = true; } ) .hover( function () { userActive = true; }, function () { userActive = false; } ); if (!hidecontrols) { setInterval( function () { if (userActive) { $videoControls.show(); userActive = false; clearTimeout(hideControlsTimerId); hideControlsTimerId = setTimeout( function () { if (!$videoObj.get(0).paused) { $videoControls.fadeOut(); } }, 5e3 ); } }, 250 ); } $(".html5boxVideoControlsBg", $videoControls).css({ display: "block", position: "absolute", width: "100%", height: "100%", left: 0, top: 0, "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)" }); $(".html5boxPlayPause", $videoControls).css({ display: "block", position: "relative", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), float: "left" }); var $videoBtnPlay = $(".html5boxPlay", $videoControls); var $videoBtnPause = $(".html5boxPause", $videoControls); $videoBtnPlay .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top left", } ) .hover( function () { $(this).css({ "background-position": "bottom left" }); }, function () { $(this).css({ "background-position": "top left" }); } ) .bind( eClick, function () { $videoObj.get(0).play(); } ); $videoBtnPause .css( { display: "none", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_playpause.png" + "')", "background-position": "top right", } ) .hover( function () { $(this).css({ "background-position": "bottom right" }); }, function () { $(this).css({ "background-position": "top right" }); } ) .bind( eClick, function () { $videoObj.get(0).pause(); } ); var $videoTimeCurrent = $(".html5boxTimeCurrent", $videoControls); var $videoTimeTotal = $(".html5boxTimeTotal", $videoControls); var $videoSeeker = $(".html5boxSeeker", $videoControls); var $videoSeekerPlay = $(".html5boxSeekerPlay", $videoControls); var $videoSeekerBuffer = $(".html5boxSeekerBuffer", $videoControls); var $videoSeekerHandler = $(".html5boxSeekerHandler", $videoControls); $videoTimeCurrent.css( { display: "block", position: "relative", float: "left", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoTimeTotal.css( { display: "block", position: "relative", float: "right", "line-height": BAR_HEIGHT + "px", "font-weight": "normal", "font-size": "12px", margin: "0 8px", "font-family": "Arial, Helvetica, sans-serif", color: "#fff", } ); $videoSeeker .css({ display: "block", cursor: "pointer", overflow: "hidden", position: "relative", height: "10px", "background-color": "#222", margin: Math.floor((BAR_HEIGHT - 10) / 2) + "px 4px" }) .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); $videoSeeker.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var pos = e0.pageX - $videoSeeker.offset().left; $videoSeekerPlay.css({ width: pos }); $videoObj.get(0).currentTime = (pos * $videoObj.get(0).duration) / $videoSeeker.width(); } ); } ) .bind( eCancel, function () { $videoSeeker.unbind(eMove); } ); $videoSeekerBuffer.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#444" }); $videoSeekerPlay.css({ display: "block", position: "absolute", left: 0, top: 0, height: "100%", "background-color": "#fcc500" }); if (!isIPhone && ($videoObj.get(0).requestFullscreen || $videoObj.get(0).webkitRequestFullScreen || $videoObj.get(0).mozRequestFullScreen || $videoObj.get(0).webkitEnterFullScreen || $videoObj.get(0).msRequestFullscreen)) { var switchScreen = function (fullscreen) { if (fullscreen) { if ($videoObj.get(0).requestFullscreen) { $videoObj.get(0).requestFullscreen(); } else if ($videoObj.get(0).webkitRequestFullScreen) { $videoObj.get(0).webkitRequestFullScreen(); } else if ($videoObj.get(0).mozRequestFullScreen) { $videoObj.get(0).mozRequestFullScreen(); } else if ($videoObj.get(0).webkitEnterFullScreen) { $videoObj.get(0).webkitEnterFullScreen(); } if ($videoObj.get(0).msRequestFullscreen) { $videoObj.get(0).msRequestFullscreen(); } } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }; var switchScreenCSS = function (fullscreen) { $videoControls.css({ position: fullscreen ? "fixed" : "absolute" }); var backgroundPosY = $videoFullscreen.css("background-position") ? $videoFullscreen.css("background-position").split(" ")[1] : $videoFullscreen.css("background-position-y"); $videoFullscreen.css({ "background-position": (fullscreen ? "right" : "left") + " " + backgroundPosY }); $videoFullscreenBg.css({ display: fullscreen ? "block" : "none" }); if (fullscreen) { $(document).bind("mousemove", userActivate); $videoControls.css({ "z-index": 2147483647 }); } else { $(document).unbind("mousemove", userActivate); $videoControls.css({ "z-index": "" }); } }; document.addEventListener( "fullscreenchange", function () { isFullscreen = document.fullscreen; switchScreenCSS(document.fullscreen); }, false ); document.addEventListener( "mozfullscreenchange", function () { isFullscreen = document.mozFullScreen; switchScreenCSS(document.mozFullScreen); }, false ); document.addEventListener( "webkitfullscreenchange", function () { isFullscreen = document.webkitIsFullScreen; switchScreenCSS(document.webkitIsFullScreen); }, false ); $videoObj.get(0).addEventListener( "webkitbeginfullscreen", function () { isFullscreen = true; }, false ); $videoObj.get(0).addEventListener( "webkitendfullscreen", function () { isFullscreen = false; }, false ); $("head").append(""); var $videoFullscreen = $(".html5boxFullscreen", $videoControls); $videoFullscreen .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_fullscreen.png" + "')", "background-position": "left top", } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { isFullscreen = !isFullscreen; switchScreen(isFullscreen); } ); } if (hd) { var $videoHD = $(".html5boxHD", $videoControls); $videoHD .css( { display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_hd.png" + "')", "background-position": (isHd ? "right" : "left") + " center", } ) .bind( eClick, function () { isHd = !isHd; $(this).css({ "background-position": (isHd ? "right" : "left") + " center" }); parentInst.isHd = isHd; var isPaused = $videoObj.get(0).isPaused; $videoObj.get(0).setAttribute("src", (isHd ? hd : src) + "#t=" + $videoObj.get(0).currentTime); if (!isPaused) { $videoObj.get(0).play(); } else if (!isIPhone) { $videoObj.get(0).pause(); } } ); } $videoObj.get(0).volume = defaultvolume; var volumeSaved = defaultvolume == 0 ? 1 : defaultvolume; var volume = $videoObj.get(0).volume; $videoObj.get(0).volume = volume / 2 + 0.1; if ($videoObj.get(0).volume === volume / 2 + 0.1) { $videoObj.get(0).volume = volume; var $videoVolume = $(".html5boxVolume", $videoControls); var $videoVolumeButton = $(".html5boxVolumeButton", $videoControls); var $videoVolumeBar = $(".html5boxVolumeBar", $videoControls); var $videoVolumeBarBg = $(".html5boxVolumeBarBg", $videoControls); var $videoVolumeBarActive = $(".html5boxVolumeBarActive", $videoControls); $videoVolume.css({ display: "block", position: "relative", float: "right", width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", margin: Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2) }).hover( function () { clearTimeout(hideVolumeBarTimeoutId); var volume = $videoObj.get(0).volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); $videoVolumeBar.show(); }, function () { clearTimeout(hideVolumeBarTimeoutId); hideVolumeBarTimeoutId = setTimeout( function () { $videoVolumeBar.hide(); }, 1e3 ); } ); $videoVolumeButton .css( { display: "block", position: "absolute", top: 0, left: 0, width: BUTTON_SIZE + "px", height: BUTTON_SIZE + "px", cursor: "pointer", "background-image": "url('" + skinFolder + "html5boxplayer_volume.png" + "')", "background-position": "top " + (volume > 0 ? "left" : "right"), } ) .hover( function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " bottom" }); }, function () { var backgroundPosX = $(this).css("background-position") ? $(this).css("background-position").split(" ")[0] : $(this).css("background-position-x"); $(this).css({ "background-position": backgroundPosX + " top" }); } ) .bind( eClick, function () { var volume = $videoObj.get(0).volume; if (volume > 0) { volumeSaved = volume; volume = 0; } else { volume = volumeSaved; } var backgroundPosY = $(this).css("background-position") ? $(this).css("background-position").split(" ")[1] : $(this).css("background-position-y"); $videoVolumeButton.css({ "background-position": (volume > 0 ? "left" : "right") + " " + backgroundPosY }); $videoObj.get(0).volume = volume; $videoVolumeBarActive.css({ height: Math.round(volume * 100) + "%" }); } ); $videoVolumeBar.css( { display: "none", position: "absolute", left: 4, bottom: "100%", width: 24, height: 80, "margin-bottom": Math.floor((BAR_HEIGHT - BUTTON_SIZE) / 2), "background-color": "#000000", opacity: 0.7, filter: "alpha(opacity=70)", } ); $videoVolumeBarBg.css({ display: "block", position: "relative", width: 10, height: 68, margin: 7, cursor: "pointer", "background-color": "#222" }); $videoVolumeBarActive.css({ display: "block", position: "absolute", bottom: 0, left: 0, width: "100%", height: "100%", "background-color": "#fcc500" }); $videoVolumeBarBg .bind( eStart, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; $videoVolumeBarBg.bind( eMove, function (e) { var e0 = isTouch ? e.originalEvent.touches[0] : e; var vol = 1 - (e0.pageY - $videoVolumeBarBg.offset().top) / $videoVolumeBarBg.height(); vol = vol > 1 ? 1 : 0 > vol ? 0 : vol; $videoVolumeBarActive.css({ height: Math.round(vol * 100) + "%" }); $videoVolumeButton.css({ "background-position": "left " + (vol > 0 ? "top" : "bottom") }); $videoObj.get(0).volume = vol; } ); } ) .bind( eCancel, function () { $videoVolumeBarBg.unbind(eMove); } ); } var calcTimeFormat = function (seconds) { var h0 = Math.floor(seconds / 3600); var h = 10 > h0 ? "0" + h0 : h0; var m0 = Math.floor((seconds - h0 * 3600) / 60); var m = 10 > m0 ? "0" + m0 : m0; var s0 = Math.floor(seconds - (h0 * 3600 + m0 * 60)); var s = 10 > s0 ? "0" + s0 : s0; var r = m + ":" + s; if (h0 > 0) { r = h + ":" + r; } return r; }; if (hideplaybutton) { $videoPlay.hide(); } if (hidecontrols) { $videoControls.hide(); } var onVideoPlay = function () { if (!hideplaybutton) { $videoPlay.hide(); } if (!hidecontrols) { $videoBtnPlay.hide(); $videoBtnPause.show(); } }; var onVideoPause = function () { if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoEnded = function () { $(window).trigger("html5lightbox.videoended"); if (!hideplaybutton) { $videoPlay.show(); } if (!hidecontrols) { $videoControls.show(); clearTimeout(hideControlsTimerId); $videoBtnPlay.show(); $videoBtnPause.hide(); } }; var onVideoUpdate = function () { var curTime = $videoObj.get(0).currentTime; if (curTime) { $videoTimeCurrent.text(calcTimeFormat(curTime)); var duration = $videoObj.get(0).duration; if (duration) { $videoTimeTotal.text(calcTimeFormat(duration)); if (!sliderDragging) { var sliderW = $videoSeeker.width(); var pos = Math.round((sliderW * curTime) / duration); $videoSeekerPlay.css({ width: pos }); $videoSeekerHandler.css({ left: pos }); } } } }; var onVideoProgress = function () { if ($videoObj.get(0).buffered && $videoObj.get(0).buffered.length > 0 && !isNaN($videoObj.get(0).buffered.end(0)) && !isNaN($videoObj.get(0).duration)) { var sliderW = $videoSeeker.width(); $videoSeekerBuffer.css({ width: Math.round((sliderW * $videoObj.get(0).buffered.end(0)) / $videoObj.get(0).duration) }); } }; try { $videoObj.bind("play", onVideoPlay); $videoObj.bind("pause", onVideoPause); $videoObj.bind("ended", onVideoEnded); $videoObj.bind("timeupdate", onVideoUpdate); $videoObj.bind("progress", onVideoProgress); } catch (e) { } }; })(jQuery); jQuery(".tsvg-html5lightbox-491211").html5lightbox491211({},'491211'); jQuery(function() { jQuery('.tsvg-section-491211').fadeIn(); var tsvgFancyHoverInverse491211 = 'Default'; tsvgFancyHoverInverse491211 = tsvgFancyHoverInverse491211 == 'Default' ? false : true; jQuery('.tsvg-fancy-blocks-list-491211 > li').each(function() { jQuery(this).hoverdir({hoverDelay: 50, inverse:tsvgFancyHoverInverse491211}); }); }); clearInterval(tsvgFancyInterval491211); } }, tsvgFancyReference491211 = ( function tsvgFancySameCall491211() { tsvgFancyInterval491211 = setInterval(tsvgFancyIntervalFunction491211, 1000); return tsvgFancySameCall491211; }() );
'); }else{ jQuery('.tsvg-section-491211 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } var svg = document.querySelector('.btn-lg svg'), svgPath = new Proxy({ y: null, smoothing: null }, { set(target, key, value) { target[key] = value; if(target.y !== null && target.smoothing !== null) { svg.innerHTML = getPath(target.y, target.smoothing, null); } return true; }, get(target, key) { return target[key]; } }); svgPath.y = 20; svgPath.smoothing = 0; } } jQuery('.tsvg-section-491211 .btn-lg').click(function (e) { let max_heigth =jQuery('.tsvg-main-content-491211').height(); let main_length = jQuery('.tsvg-main-content-491211 figure ul li').length; tsvgPaginationLoad491211 = 'false'; if(jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery(this).closest('.tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ tsvgPaginationLoad491211 = 'true'; } jQuery('.tsvg-main-content-491211').css({'max-height': max_heigth+'px','transition':'unset'}); setTimeout(() => { jQuery('.tsvg-main-content-491211').css({'transition':'max-height 3s ease-in-out','max-height':main_length+'000vh'}); }, 100); tsvgPaginationCreate491211(jQuery('.tsvg-main-content-491211 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage); if(jQuery('.tsvg-section-491211 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-3'){ jQuery('.tsvg-section-491211 .btn-lg').addClass('animate'); setTimeout(function(){ jQuery('.tsvg-section-491211 .btn-lg').removeClass('animate'); },700); } if(!jQuery('.tsvg-section-491211 .btn-lg').hasClass('loading')&&(jQuery('.tsvg-section-491211 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-4'||jQuery('.tsvg-section-491211 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5')&&jQuery('.tsvg-section-491211 .tsvg-pagination-pages-wrapper svg').length) { jQuery('.tsvg-section-491211 .btn-lg').addClass('loading'); setTimeout(() => { svg.innerHTML = getPath(0, 0, [ [3, 14], [8, 19], [21, 6] ]); }, 1000 / 2); setTimeout(() => { jQuery('.tsvg-section-491211 .btn-lg').removeClass('loading'); if(jQuery('.tsvg-section-491211 .tsvg-pagination-pages-wrapper').attr("data-load-vw")=='ef-5'){ jQuery('.tsvg-section-491211 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
  • '+load_text+'
'); }else{ jQuery('.tsvg-section-491211 .tsvg-pagination-pages-wrapper').find('.btn-lg').html('
'); } }, 2000 ); } }) tsvgPaginationCreate491211(jQuery('.tsvg-section-491211 .tsvg-main-content-491211 figure ul li').not('.tsvg-layout-item-show'),0, numberItemsPerPage) } } function tsvgNewPagination491211(){ var interval_pag_fn_491211 = setInterval(setPagina_491211, 100); function setPagina_491211() { if( typeof(jQuery) != "undefined" && jQuery != null){ if( jQuery('.tsvg-main-content-491211').attr("data-pagination")=='pagination'){ tsvgPaginationGenerate491211(); } if( jQuery('.tsvg-main-content-491211').attr("data-pagination")=='load-more'){ tsvgPaginationGenerate491211(); } clearInterval(interval_pag_fn_491211); } } } tsvgNewPagination491211(); function tsvgPaginationGenerate(){ tsvgPaginationGenerate491211(); } function getPoint(point, i, a, smoothing) { let cp = (current, previous, next, reverse) => { let p = previous || current, n = next || current, o = { length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)), angle: Math.atan2(n[1] - p[1], n[0] - p[0]) }, angle = o.angle + (reverse ? Math.PI : 0), length = o.length * smoothing; return [current[0] + Math.cos(angle) * length, current[1] + Math.sin(angle) * length]; }, cps = cp(a[i - 1], a[i - 2], point, false), cpe = cp(point, a[i - 1], a[i + 1], true); return `C ${cps[0]},${cps[1]} ${cpe[0]},${cpe[1]} ${point[0]},${point[1]}`; } function getPath(update, smoothing, pointsNew) { let points = pointsNew ? pointsNew : [ [4, 12], [12, update], [20, 12] ], d = points.reduce((acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${getPoint(point, i, a, smoothing)}`, ''); return ``; }

To subscribe to Vin Mistrys Youtube Channel, please see here.

To see more of Vins work with Vaani, please see the full Vaani channel here.