OwlCyberSecurity - MANAGER
Edit File: bjqs-1.3.min.js
!function(e){"use strict";e.fn.bjqs=function(t){var n={width:700,height:300,animtype:"fade",animduration:450,animspeed:4e3,automatic:!0,showcontrols:!0,centercontrols:!0,nexttext:"Next",prevtext:"Prev",showmarkers:!0,centermarkers:!0,keyboardnav:!0,hoverpause:!0,usecaptions:!0,randomstart:!1,responsive:!1},i=e.extend({},n,t),r=this,a=r.find("ul.bjqs"),o=a.children("li"),s=null,l=null,c=null,u=null,d=null,h=null,p=null,f=null,m={slidecount:o.length,animating:!1,paused:!1,currentslide:1,nextslide:0,currentindex:0,nextindex:0,interval:null},g={width:null,height:null,ratio:null},v={fwd:"forward",prev:"previous"},y=function(){o.addClass("bjqs-slide"),i.responsive?b():w(),m.slidecount>1?(i.randomstart&&D(),i.showcontrols&&x(),i.showmarkers&&C(),i.keyboardnav&&T(),i.hoverpause&&i.automatic&&E(),"slide"===i.animtype&&k()):i.automatic=!1,i.usecaptions&&S(),"slide"!==i.animtype||i.randomstart||(m.currentindex=1,m.currentslide=2),a.show(),o.eq(m.currentindex).show(),i.automatic&&(m.interval=setInterval(function(){N(v.fwd,!1)},i.animspeed))},b=function(){g.width=r.outerWidth(),g.ratio=g.width/i.width,g.height=i.height*g.ratio,"fade"===i.animtype&&(o.css({height:i.height,width:"100%"}),o.children("img").css({height:i.height,width:"100%"}),a.css({height:i.height,width:"100%"}),r.css({height:i.height,"max-width":i.width,position:"relative"}),g.width<i.width&&(o.css({height:g.height}),o.children("img").css({height:g.height}),a.css({height:g.height}),r.css({height:g.height})),e(window).resize(function(){g.width=r.outerWidth(),g.ratio=g.width/i.width,g.height=i.height*g.ratio,o.css({height:g.height}),o.children("img").css({height:g.height}),a.css({height:g.height}),r.css({height:g.height})})),"slide"===i.animtype&&(o.css({height:i.height,width:i.width}),o.children("img").css({height:i.height,width:i.width}),a.css({height:i.height,width:i.width*i.slidecount}),r.css({height:i.height,"max-width":i.width,position:"relative"}),g.width<i.width&&(o.css({height:g.height}),o.children("img").css({height:g.height}),a.css({height:g.height}),r.css({height:g.height})),e(window).resize(function(){g.width=r.outerWidth(),g.ratio=g.width/i.width,g.height=i.height*g.ratio,o.css({height:g.height,width:g.width}),o.children("img").css({height:g.height,width:g.width}),a.css({height:g.height,width:g.width*i.slidecount}),r.css({height:g.height}),h.css({height:g.height,width:g.width}),_(function(){N(!1,m.currentslide)},200,"some unique string")}))},_=function(){var e={};return function(t,n,i){i||(i="Don't call this twice without a uniqueId"),e[i]&&clearTimeout(e[i]),e[i]=setTimeout(t,n)}}(),w=function(){o.css({height:i.height,width:i.width}),a.css({height:i.height,width:i.width}),r.css({height:i.height,width:i.width,position:"relative"})},k=function(){p=o.eq(0).clone(),f=o.eq(m.slidecount-1).clone(),p.attr({"data-clone":"last","data-slide":0}).appendTo(a).show(),f.attr({"data-clone":"first","data-slide":0}).prependTo(a).show(),o=a.children("li"),m.slidecount=o.length,h=e('<div class="bjqs-wrapper"></div>'),i.responsive&&g.width<i.width?(h.css({width:g.width,height:g.height,overflow:"hidden",position:"relative"}),a.css({width:g.width*(m.slidecount+2),left:-g.width*m.currentslide})):(h.css({width:i.width,height:i.height,overflow:"hidden",position:"relative"}),a.css({width:i.width*(m.slidecount+2),left:-i.width*m.currentslide})),o.css({"float":"left",position:"relative",display:"list-item"}),h.prependTo(r),a.appendTo(h)},x=function(){if(s=e('<ul class="bjqs-controls"></ul>'),l=e('<li class="bjqs-next"><a href="#" data-direction="'+v.fwd+'">'+i.nexttext+"</a></li>"),c=e('<li class="bjqs-prev"><a href="#" data-direction="'+v.prev+'">'+i.prevtext+"</a></li>"),s.on("click","a",function(t){t.preventDefault();var n=e(this).attr("data-direction");m.animating||(n===v.fwd&&N(v.fwd,!1),n===v.prev&&N(v.prev,!1))}),c.appendTo(s),l.appendTo(s),s.appendTo(r),i.centercontrols){s.addClass("v-centered");var t=(r.height()-l.children("a").outerHeight())/2,n=100*(t/i.height),a=n+"%";l.find("a").css("top",a),c.find("a").css("top",a)}},C=function(){if(u=e('<ol class="bjqs-markers"></ol>'),e.each(o,function(t){var n=t+1,r=t+1;"slide"===i.animtype&&(r=t+2);var a=e('<li><a href="#">'+n+"</a></li>");n===m.currentslide&&a.addClass("active-marker"),a.on("click","a",function(e){e.preventDefault(),m.animating||m.currentslide===r||N(!1,r)}),a.appendTo(u)}),u.appendTo(r),d=u.find("li"),i.centermarkers){u.addClass("h-centered");var t=(i.width-u.width())/2;u.css("left",t)}},T=function(){e(document).keyup(function(e){m.paused||(clearInterval(m.interval),m.paused=!0),m.animating||(39===e.keyCode?(e.preventDefault(),N(v.fwd,!1)):37===e.keyCode&&(e.preventDefault(),N(v.prev,!1))),m.paused&&i.automatic&&(m.interval=setInterval(function(){N(v.fwd)},i.animspeed),m.paused=!1)})},E=function(){r.hover(function(){m.paused||(clearInterval(m.interval),m.paused=!0)},function(){m.paused&&(m.interval=setInterval(function(){N(v.fwd,!1)},i.animspeed),m.paused=!1)})},S=function(){e.each(o,function(t,n){var i=e(n).children("a").find("h4").text(),r=e(n).children("a").find("p").text();i&&(i=e('<h4 class="bjqs-heading">'+i+"</h4>"),i.appendTo(e(n))),r&&(r=e('<p class="bjqs-descript">'+r+"</p>"),r.appendTo(e(n)))})},D=function(){var e=Math.floor(Math.random()*m.slidecount)+1;m.currentslide=e,m.currentindex=e-1},A=function(e){e===v.fwd?o.eq(m.currentindex).next().length?(m.nextindex=m.currentindex+1,m.nextslide=m.currentslide+1):(m.nextindex=0,m.nextslide=1):o.eq(m.currentindex).prev().length?(m.nextindex=m.currentindex-1,m.nextslide=m.currentslide-1):(m.nextindex=m.slidecount-1,m.nextslide=m.slidecount)},N=function(e,t){if(!m.animating&&(m.animating=!0,t?(m.nextslide=t,m.nextindex=t-1):A(e),"fade"===i.animtype&&(i.showmarkers&&(d.removeClass("active-marker"),d.eq(m.nextindex).addClass("active-marker")),o.eq(m.currentindex).fadeOut(i.animduration),o.eq(m.nextindex).fadeIn(i.animduration,function(){m.animating=!1,m.currentslide=m.nextslide,m.currentindex=m.nextindex})),"slide"===i.animtype)){if(i.showmarkers){var n=m.nextindex-1;n===m.slidecount-2?n=0:-1===n&&(n=m.slidecount-3),d.removeClass("active-marker"),d.eq(n).addClass("active-marker")}m.slidewidth=i.responsive&&g.width<i.width?g.width:i.width,a.animate({left:-m.nextindex*m.slidewidth},i.animduration,function(){m.currentslide=m.nextslide,m.currentindex=m.nextindex,"last"===o.eq(m.currentindex).attr("data-clone")?(a.css({left:-m.slidewidth}),m.currentslide=2,m.currentindex=1):"first"===o.eq(m.currentindex).attr("data-clone")&&(a.css({left:-m.slidewidth*(m.slidecount-2)}),m.currentslide=m.slidecount-1,m.currentindex=m.slidecount-2),m.animating=!1})}};y()}}(jQuery);