PageSourceSearch

https://mgz.hr/js/plugins/jScrollPane-master/script/jquery.jscrollpane.min.js

js mgz.hr collected 2026-10-02 11:55:03 UTC 15,981 bytes, 1 lines download raw bytes

vendor: 15,981 bytes, line 1
1!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){e.fn.jScrollPane=function(t){function o(t,o){var s,i,n,r,a,l,c,p,u,d,f,h,g,j,v,m,w,y,b,k,T,C,S,x,D,B,H,P,z,A,W,Y,M,X,L=this,R=!0,E=!0,I=!1,F=!1,V=t.clone(!1,!1).empty(),q=!1,O=e.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp",G=function(){s.resizeSensorDelay>0?setTimeout(function(){N(s)},s.resizeSensorDelay):N(s)};function N(o){var k,R,E,I,F,V,pe,ue,de,fe,he,ge,je,ve,me,we,ye=!1,be=!1;if(s=o,void 0===i)F=t.scrollTop(),V=t.scrollLeft(),t.css({overflow:"hidden",padding:0}),n=t.innerWidth()+M,r=t.innerHeight(),t.width(n),i=e('<div class="jspPane" />').css("padding",Y).append(t.children()),a=e('<div class="jspContainer" />').css({width:n+"px",height:r+"px"}).append(i).appendTo(t);else{if(t.css("width",""),a.css({width:"auto",height:"auto"}),i.css("position","static"),pe=t.innerWidth()+M,ue=t.innerHeight(),i.css("position","absolute"),ye=s.stickToBottom&&((fe=c-r)>20&&fe-le()<10),be=s.stickToRight&&((de=l-n)>20&&de-ae()<10),I=pe!==n||ue!==r,n=pe,r=ue,a.css({width:n,height:r}),!I&&X==l&&i.outerHeight()==c)return void t.width(n);X=l,i.css("width",""),t.width(n),a.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}i.css("overflow","auto"),l=o.contentWidth?o.contentWidth:i[0].scrollWidth,c=i[0].scrollHeight,i.css("overflow",""),p=l/n,d=(u=c/r)>1||s.alwaysShowVScroll,(f=p>1||s.alwaysShowHScroll)||d?(t.addClass("jspScrollable"),(k=s.maintainPosition&&(j||w))&&(R=ae(),E=le()),d&&(a.append(e('<div class="jspVerticalBar" />').append(e('<div class="jspCap jspCapTop" />'),e('<div class="jspTrack" />').append(e('<div class="jspDrag" />').append(e('<div class="jspDragTop" />'),e('<div class="jspDragBottom" />'))),e('<div class="jspCap jspCapBottom" />'))),y=a.find(">.jspVerticalBar"),b=y.find(">.jspTrack"),h=b.find(">.jspDrag"),s.showArrows&&(S=e('<a class="jspArrow jspArrowUp" />').on("mousedown.jsp",J(0,-1)).on("click.jsp",ce),x=e('<a class="jspArrow jspArrowDown" />').on("mousedown.jsp",J(0,1)).on("click.jsp",ce),s.arrowScrollOnHover&&(S.on("mouseover.jsp",J(0,-1,S)),x.on("mouseover.jsp",J(0,1,x))),$(b,s.verticalArrowPositions,S,x)),T=r,a.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){T-=e(this).outerHeight()}),h.on("mouseenter",function(){h.addClass("jspHover")}).on("mouseleave",function(){h.removeClass("jspHover")}).on("mousedown.jsp",function(t){e("html").on("dragstart.jsp selectstart.jsp",ce),h.addClass("jspActive");var o=t.pageY-h.position().top;return e("html").on("mousemove.jsp",function(e){ee(e.pageY-o,!1)}).on("mouseup.jsp mouseleave.jsp",_),!1}),Q()),f&&(a.append(e('<div class="jspHorizontalBar" />').append(e('<div class="jspCap jspCapLeft" />'),e('<div class="jspTrack" />').append(e('<div class="jspDrag" />').append(e('<div class="jspDragLeft" />'),e('<div class="jspDragRight" />'))),e('<div class="jspCap jspCapRight" />'))),D=a.find(">.jspHorizontalBar"),B=D.find(">.jspTrack"),v=B.find(">.jspDrag"),s.showArrows&&(z=e('<a class="jspArrow jspArrowLeft" />').on("mousedown.jsp",J(-1,0)).on("click.jsp",ce),A=e('<a class="jspArrow jspArrowRight" />').on("mousedown.jsp",J(1,0)).on("click.jsp",ce),s.arrowScrollOnHover&&(z.on("mouseover.jsp",J(-1,0,z)),A.on("mouseover.jsp",J(1,0,A))),$(B,s.horizontalArrowPositions,z,A)),v.on("mouseenter",function(){v.addClass("jspHover")}).on("mouseleave",function(){v.removeClass("jspHover")}).on("mousedown.jsp",function(t){e("html").on("dragstart.jsp selectstart.jsp",ce),v.addClass("jspActive");var o=t.pageX-v.position().left;return e("html").on("mousemove.jsp",function(e){oe(e.pageX-o,!1)}).on("mouseup.jsp mouseleave.jsp",_),!1}),H=a.innerWidth(),U()),function(){if(f&&d){var t=B.outerHeight(),o=b.outerWidth();T-=t,e(D).find(">.jspCap:visible,>.jspArrow").each(function(){H+=e(this).outerWidth()}),H-=o,r-=o,n-=t,B.parent().append(e('<div class="jspCorner" />').css("width",t+"px")),Q(),U()}f&&i.width(a.outerWidth()-M+"px");c=i.outerHeight(),u=c/r,f&&((P=Math.ceil(1/p*H))>s.horizontalDragMaxWidth?P=s.horizontalDragMaxWidth:P<s.horizontalDragMinWidth&&(P=s.horizontalDragMinWidth),v.css("width",P+"px"),m=H-P,se(w));d&&((C=Math.ceil(1/u*T))>s.verticalDragMaxHeight?C=s.verticalDragMaxHeight:C<s.verticalDragMinHeight&&(C=s.verticalDragMinHeight),h.css("height",C+"px"),g=T-C,te(j))}(),k&&(ne(be?l-n:R,!1),ie(ye?c-r:E,!1)),i.find(":input,a").off("focus.jsp").on("focus.jsp",function(e){re(e.target,!1)}),a.off(O).on(O,function(e,t,o,i){w||(w=0),j||(j=0);var n=w,r=j,a=e.deltaFactor||s.mouseWheelSpeed;return L.scrollBy(o*a,-i*a,!1),n==w&&r==j}),we=!1,a.off("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").on("touchstart.jsp",function(e){var t=e.originalEvent.touches[0];he=ae(),ge=le(),je=t.pageX,ve=t.pageY,me=!1,we=!0}).on("touchmove.jsp",function(e){if(we){var t=e.originalEvent.touches[0],o=w,s=j;return L.scrollTo(he+je-t.pageX,ge+ve-t.pageY),me=me||Math.abs(je-t.pageX)>5||Math.abs(ve-t.pageY)>5,o==w&&s==j}}).on("touchend.jsp",function(e){we=!1}).on("click.jsp-touchclick",function(e){if(me)return me=!1,!1}),s.enableKeyboardNavigation&&function(){var o,n,l=[];f&&l.push(D[0]);d&&l.push(y[0]);i.on("focus.jsp",function(){t.focus()}),t.attr("tabindex",0).off("keydown.jsp keypress.jsp").on("keydown.jsp",function(t){if(t.target===this||l.length&&e(t.target).closest(l).length){var s=w,i=j;switch(t.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:o=t.keyCode,p();break;case 35:ie(c-r),o=null;break;case 36:ie(0),o=null}return!(n=t.keyCode==o&&s!=w||i!=j)}}).on("keypress.jsp",function(t){if(t.keyCode==o&&p(),t.target===this||l.length&&e(t.target).closest(l).length)return!n}),s.hideFocus?(t.css("outline","none"),"hideFocus"in a[0]&&t.attr("hideFocus",!0)):(t.css("outline",""),"hideFocus"in a[0]&&t.attr("hideFocus",!1));function p(){var e=w,t=j;switch(o){case 40:L.scrollByY(s.keyboardSpeed,!1);break;case 38:L.scrollByY(-s.keyboardSpeed,!1);break;case 34:case 32:L.scrollByY(r*s.scrollPagePercent,!1);break;case 33:L.scrollByY(-r*s.scrollPagePercent,!1);break;case 39:L.scrollByX(s.keyboardSpeed,!1);break;case 37:L.scrollByX(-s.keyboardSpeed,!1)}return n=e!=w||t!=j}}(),s.clickOnTrack&&function(){Z(),d&&b.on("mousedown.jsp",function(t){if(void 0===t.originalTarget||t.originalTarget==t.currentTarget){var o,i=e(this),n=i.offset(),a=t.pageY-n.top-j,l=!0,p=function(){var e=i.offset(),n=t.pageY-e.top-C/2,d=r*s.scrollPagePercent,f=g*d/(c-r);if(a<0)j-f>n?L.scrollByY(-d):ee(n);else{if(!(a>0))return void u();j+f<n?L.scrollByY(d):ee(n)}o=setTimeout(p,l?s.initialDelay:s.trackClickRepeatFreq),l=!1},u=function(){o&&clearTimeout(o),o=null,e(document).off("mouseup.jsp",u)};return p(),e(document).on("mouseup.jsp",u),!1}});f&&B.on("mousedown.jsp",function(t){if(void 0===t.originalTarget||t.originalTarget==t.currentTarget){var o,i=e(this),r=i.offset(),a=t.pageX-r.left-w,c=!0,p=function(){var e=i.offset(),r=t.pageX-e.left-P/2,d=n*s.scrollPagePercent,f=m*d/(l-n);if(a<0)w-f>r?L.scrollByX(-d):oe(r);else{if(!(a>0))return void u();w+f<r?L.scrollByX(d):oe(r)}o=setTimeout(p,c?s.initialDelay:s.trackClickRepeatFreq),c=!1},u=function(){o&&clearTimeout(o),o=null,e(document).off("mouseup.jsp",u)};return p(),e(document).on("mouseup.jsp",u),!1}})}(),function(){if(location.hash&&location.hash.length>1){var t,o,s=escape(location.hash.substr(1));try{t=e("#"+s+', a[name="'+s+'"]')}catch(e){return}t.length&&i.find(s)&&(0===a.scrollTop()?o=setInterval(function(){a.scrollTop()>0&&(re(t,!0),e(document).scrollTop(a.position().top),clearInterval(o))},50):(re(t,!0),e(document).scrollTop(a.position().top)))}}(),s.hijackInternalLinks&&function(){if(e(document.body).data("jspHijack"))return;e(document.body).data("jspHijack",!0),e(document.body).delegate('a[href*="#"]',"click",function(t){var o,s,i,n,r,a=this.href.substr(0,this.href.indexOf("#")),l=location.href;if(-1!==location.href.indexOf("#")&&(l=location.href.substr(0,location.href.indexOf("#"))),a===l){o=escape(this.href.substr(this.href.indexOf("#")+1));try{s=e("#"+o+', a[name="'+o+'"]')}catch(e){return}s.length&&(i=s.closest(".jspScrollable"),i.data("jsp").scrollToElement(s,!0),i[0].scrollIntoView&&(n=e(window).scrollTop(),((r=s.offset().top)<n||r>n+e(window).height())&&i[0].scrollIntoView()),t.preventDefault())}})}()):(t.removeClass("jspScrollable"),i.css({top:0,left:0,width:a.width()-M}),a.off(O),i.find(":input,a").off("focus.jsp"),t.attr("tabindex","-1").removeAttr("tabindex").off("keydown.jsp keypress.jsp"),i.off(".jsp"),Z()),s.resizeSensor||!s.autoReinitialise||W?s.resizeSensor||s.autoReinitialise||!W||clearInterval(W):W=setInterval(function(){N(s)},s.autoReinitialiseDelay),s.resizeSensor&&!q&&(K(i,G),K(t,G),K(t.parent(),G),window.addEventListener("resize",G),q=!0),F&&t.scrollTop(0)&&ie(F,!1),V&&t.scrollLeft(0)&&ne(V,!1),t.trigger("jsp-initialised",[f||d])}function K(e,t){var o,s,i=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div"),a=document.createElement("div"),l=document.createElement("div");i.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;",n.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;",a.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: scroll; z-index: -1; visibility: hidden;",r.style.cssText="position: absolute; left: 0; top: 0;",l.style.cssText="position: absolute; left: 0; top: 0; width: 200%; height: 200%;";var c=function(){r.style.width=n.offsetWidth+10+"px",r.style.height=n.offsetHeight+10+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,a.scrollLeft=a.scrollWidth,a.scrollTop=a.scrollHeight,o=e.width(),s=e.height()};n.addEventListener("scroll",function(){(e.width()>o||e.height()>s)&&t.apply(this,[]),c()}.bind(this)),a.addEventListener("scroll",function(){(e.width()<o||e.height()<s)&&t.apply(this,[]),c()}.bind(this)),n.appendChild(r),a.appendChild(l),i.appendChild(n),i.appendChild(a),e.append(i),"static"===window.getComputedStyle(e[0],null).getPropertyValue("position")&&(e[0].style.position="relative"),c()}function Q(){b.height(T+"px"),j=0,k=s.verticalGutter+b.outerWidth(),i.width(n-k-M);try{0===y.position().left&&i.css("margin-left",k+"px")}catch(e){}}function U(){a.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){H-=e(this).outerWidth()}),B.width(H+"px"),w=0}function $(e,t,o,s){var i,n="before",r="after";"os"==t&&(t=/Mac/.test(navigator.platform)?"after":"split"),t==n?r=t:t==r&&(n=t,i=o,o=s,s=i),e[n](o)[r](s)}function J(t,o,i){return function(){return function(t,o,i,n){i=e(i).addClass("jspActive");var r,a,l=!0,c=function(){0!==t&&L.scrollByX(t*s.arrowButtonSpeed),0!==o&&L.scrollByY(o*s.arrowButtonSpeed),a=setTimeout(c,l?s.initialDelay:s.arrowRepeatFreq),l=!1};c(),r=n?"mouseout.jsp":"mouseup.jsp",(n=n||e("html")).on(r,function(){i.removeClass("jspActive"),a&&clearTimeout(a),a=null,n.off(r)})}(t,o,this,i),this.blur(),!1}}function Z(){B&&B.off("mousedown.jsp"),b&&b.off("mousedown.jsp")}function _(){e("html").off("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"),h&&h.removeClass("jspActive"),v&&v.removeClass("jspActive")}function ee(o,i){if(d){o<0?o=0:o>g&&(o=g);var n=new e.Event("jsp-will-scroll-y");if(t.trigger(n,[o]),!n.isDefaultPrevented()){var a=o||0,l=0===a,p=a==g,u=-(o/g)*(c-r);void 0===i&&(i=s.animateScroll),i?L.animate(h,"top",o,te,function(){t.trigger("jsp-user-scroll-y",[-u,l,p])}):(h.css("top",o),te(o),t.trigger("jsp-user-scroll-y",[-u,l,p]))}}}function te(e){void 0===e&&(e=h.position().top),a.scrollTop(0);var o,n,l=0===(j=e||0),p=j==g,u=-(e/g)*(c-r);R==l&&I==p||(R=l,I=p,t.trigger("jsp-arrow-change",[R,I,E,F])),o=l,n=p,s.showArrows&&(S[o?"addClass":"removeClass"]("jspDisabled"),x[n?"addClass":"removeClass"]("jspDisabled")),i.css("top",u),t.trigger("jsp-scroll-y",[-u,l,p]).trigger("scroll")}function oe(o,i){if(f){o<0?o=0:o>m&&(o=m);var r=new e.Event("jsp-will-scroll-x");if(t.trigger(r,[o]),!r.isDefaultPrevented()){var a=o||0,c=0===a,p=a==m,u=-(o/m)*(l-n);void 0===i&&(i=s.animateScroll),i?L.animate(v,"left",o,se,function(){t.trigger("jsp-user-scroll-x",[-u,c,p])}):(v.css("left",o),se(o),t.trigger("jsp-user-scroll-x",[-u,c,p]))}}}function se(e){void 0===e&&(e=v.position().left),a.scrollTop(0);var o,r,c=0===(w=e||0),p=w==m,u=-(e/m)*(l-n);E==c&&F==p||(E=c,F=p,t.trigger("jsp-arrow-change",[R,I,E,F])),o=c,r=p,s.showArrows&&(z[o?"addClass":"removeClass"]("jspDisabled"),A[r?"addClass":"removeClass"]("jspDisabled")),i.css("left",u),t.trigger("jsp-scroll-x",[-u,c,p]).trigger("scroll")}function ie(e,t){ee(e/(c-r)*g,t)}function ne(e,t){oe(e/(l-n)*m,t)}function re(t,o,i){var l,c,p,u,d,f,h,g,j,v=0,m=0;try{l=e(t)}catch(e){return}for(c=l.outerHeight(),p=l.outerWidth(),a.scrollTop(0),a.scrollLeft(0);!l.is(".jspPane");)if(v+=l.position().top,m+=l.position().left,l=l.offsetParent(),/^body|html$/i.test(l[0].nodeName))return;f=(u=le())+r,v<u||o?g=v-s.horizontalGutter:v+c>f&&(g=v-r+c+s.horizontalGutter),isNaN(g)||ie(g,i),h=(d=ae())+n,m<d||o?j=m-s.horizontalGutter:m+p>h&&(j=m-n+p+s.horizontalGutter),isNaN(j)||ne(j,i)}function ae(){return-i.position().left}function le(){return-i.position().top}function ce(){return!1}"border-box"===t.css("box-sizing")?(Y=0,M=0):(Y=t.css("paddingTop")+" "+t.css("paddingRight")+" "+t.css("paddingBottom")+" "+t.css("paddingLeft"),M=(parseInt(t.css("paddingLeft"),10)||0)+(parseInt(t.css("paddingRight"),10)||0)),e.extend(L,{reinitialise:function(t){N(t=e.extend({},s,t))},scrollToElement:function(e,t,o){re(e,t,o)},scrollTo:function(e,t,o){ne(e,o),ie(t,o)},scrollToX:function(e,t){ne(e,t)},scrollToY:function(e,t){ie(e,t)},scrollToPercentX:function(e,t){ne(e*(l-n),t)},scrollToPercentY:function(e,t){ie(e*(c-r),t)},scrollBy:function(e,t,o){L.scrollByX(e,o),L.scrollByY(t,o)},scrollByX:function(e,t){oe((ae()+Math[e<0?"floor":"ceil"](e))/(l-n)*m,t)},scrollByY:function(e,t){ee((le()+Math[e<0?"floor":"ceil"](e))/(c-r)*g,t)},positionDragX:function(e,t){oe(e,t)},positionDragY:function(e,t){ee(e,t)},animate:function(e,t,o,i,n){var r={};r[t]=o,e.animate(r,{duration:s.animateDuration,easing:s.animateEase,queue:!1,step:i,complete:n})},getContentPositionX:function(){return ae()},getContentPositionY:function(){return le()},getContentWidth:function(){return l},getContentHeight:function(){return c},getPercentScrolledX:function(){return ae()/(l-n)},getPercentScrolledY:function(){return le()/(c-r)},getIsScrollableH:function(){return f},getIsScrollableV:function(){return d},getContentPane:function(){return i},scrollToBottom:function(e){ee(g,e)},hijackInternalLinks:e.noop,destroy:function(){var e,o;e=le(),o=ae(),t.removeClass("jspScrollable").off(".jsp"),i.off(".jsp"),t.replaceWith(V.append(i.children())),V.scrollTop(e),V.scrollLeft(o),W&&clearInterval(W)}}),N(o)}return t=e.extend({},e.fn.jScrollPane.defaults,t),e.each(["arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){t[this]=t[this]||t.speed}),this.each(function(){var s=e(this),i=s.data("jsp");i?i.reinitialise(t):(e("script",s).filter('[type="text/javascript"],:not([type])').remove(),i=new o(s,t),s.data("jsp",i))})},e.fn.jScrollPane.defaults={showArrows:!1,maintainPosition:!0,stickToBottom:!1,stickToRight:!1,clickOnTrack:!0,autoReinitialise:!1,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:void 0,animateScroll:!1,animateDuration:300,animateEase:"linear",hijackInternalLinks:!1,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:3,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:!1,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:!0,hideFocus:!1,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:.8,alwaysShowVScroll:!1,alwaysShowHScroll:!1,resizeSensor:!1,resizeSensorDelay:0}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.