File "jquery.scrollbar.min.js"

Full Path: /home/vantageo/public_html/cache/cache/cache/cache/cache/cache/.wp-cli/wp-content/plugins/woo-bulk-editor/assets/js/jquery.scrollbar.min.js
File size: 12.64 KB
MIME-type: text/plain
Charset: utf-8

"use strict";

/**
 * jQuery CSS Customizable Scrollbar
 *
 * Copyright, Yuriy Khabarov
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * If you found bug, please contact me via email <13real008@gmail.com>
 *
 * Compressed by http://jscompress.com/
 *
 * @author Yuriy Khabarov aka Gromo
 * @version 0.2.10
 * @url https://github.com/gromo/jquery.scrollbar/
 *
 */
(function(a,b){'use strict';"function"==typeof define&&define.amd?define(["jquery"],b):"undefined"==typeof exports?b(jQuery):module.exports=b(require("jquery"))})(this,function(a){'use strict';function b(b){if(f.webkit&&!b)return{height:0,width:0};if(!f.data.outer){var c={border:"none","box-sizing":"content-box",height:"200px",margin:"0",padding:"0",width:"200px"};f.data.inner=a("<div>").css(a.extend({},c)),f.data.outer=a("<div>").css(a.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},c)).append(f.data.inner).appendTo("body")}return f.data.outer.scrollLeft(1e3).scrollTop(1e3),{height:Math.ceil(f.data.outer.offset().top-f.data.inner.offset().top||0),width:Math.ceil(f.data.outer.offset().left-f.data.inner.offset().left||0)}}function c(){var a=b(!0);return!(a.height||a.width)}function e(a){var b=a.originalEvent;return!(b.axis&&b.axis===b.HORIZONTAL_AXIS)&&!b.wheelDeltaX}var f={data:{index:0,name:"scrollbar"},firefox:/firefox/i.test(navigator.userAgent),macosx:/mac/i.test(navigator.platform),msedge:/edge\/\d+/i.test(navigator.userAgent),msie:/(msie|trident)/i.test(navigator.userAgent),mobile:/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent),overlay:null,scroll:null,scrolls:[],webkit:/webkit/i.test(navigator.userAgent)&&!/edge\/\d+/i.test(navigator.userAgent)};f.scrolls.add=function(a){this.remove(a).push(a)},f.scrolls.remove=function(b){for(;0<=a.inArray(b,this);)this.splice(a.inArray(b,this),1);return this};var g={autoScrollSize:!0,autoUpdate:!0,debug:!1,disableBodyScroll:!1,duration:200,ignoreMobile:!1,ignoreOverlay:!1,isRtl:!1,scrollStep:30,showArrows:!1,stepScrolling:!0,scrollx:null,scrolly:null,onDestroy:null,onFallback:null,onInit:null,onScroll:null,onUpdate:null},h=function(d){f.scroll||(f.overlay=c(),f.scroll=b(),j(),a(window).resize(function(){var a=!1;if(f.scroll&&(f.scroll.height||f.scroll.width)){var c=b();(c.height!==f.scroll.height||c.width!==f.scroll.width)&&(f.scroll=c,a=!0)}j(a)})),this.container=d,this.namespace=".scrollbar_"+f.data.index++,this.options=a.extend({},g,window.jQueryScrollbarOptions||{}),this.scrollTo=null,this.scrollx={},this.scrolly={},d.data(f.data.name,this),f.scrolls.add(this)};h.prototype={destroy:function(){if(this.wrapper){this.container.removeData(f.data.name),f.scrolls.remove(this);var b=this.container.scrollLeft(),c=this.container.scrollTop();this.container.insertBefore(this.wrapper).css({height:"",margin:"","max-height":""}).removeClass("scroll-content scroll-scrollx_visible scroll-scrolly_visible").off(this.namespace).scrollLeft(b).scrollTop(c),this.scrollx.scroll.removeClass("scroll-scrollx_visible").find("div").addBack().off(this.namespace),this.scrolly.scroll.removeClass("scroll-scrolly_visible").find("div").addBack().off(this.namespace),this.wrapper.remove(),a(document).add("body").off(this.namespace),"function"==typeof this.options.onDestroy&&this.options.onDestroy.apply(this,[this.container])}},init:function(b){var g=this,h=this.container,c=this.containerWrapper||h,i=this.namespace,j=a.extend(this.options,b||{}),k={x:this.scrollx,y:this.scrolly},l=this.wrapper,d={},m={scrollLeft:h.scrollLeft(),scrollTop:h.scrollTop()};if(f.mobile&&j.ignoreMobile||f.overlay&&j.ignoreOverlay||f.macosx&&!f.webkit)return"function"==typeof j.onFallback&&j.onFallback.apply(this,[h]),!1;if(!l){if(this.wrapper=l=a("<div>").addClass("scroll-wrapper").addClass(h.attr("class")).css("position","absolute"===h.css("position")?"absolute":"relative").insertBefore(h).append(h),j.isRtl&&l.addClass("scroll--rtl"),h.is("textarea")&&(this.containerWrapper=c=a("<div>").insertBefore(h).append(h),l.addClass("scroll-textarea")),d={height:"auto","margin-bottom":-1*f.scroll.height+"px","max-height":""},d[j.isRtl?"margin-left":"margin-right"]=-1*f.scroll.width+"px",c.addClass("scroll-content").css(d),h.on("scroll"+i,function(){var a=h.scrollLeft(),b=h.scrollTop();if(j.isRtl)switch(!0){case f.firefox:a=Math.abs(a);case f.msedge||f.msie:a=h[0].scrollWidth-h[0].clientWidth-a;}"function"==typeof j.onScroll&&j.onScroll.call(g,{maxScroll:k.y.maxScrollOffset,scroll:b,size:k.y.size,visible:k.y.visible},{maxScroll:k.x.maxScrollOffset,scroll:a,size:k.x.size,visible:k.x.visible}),k.x.isVisible&&k.x.scroll.bar.css("left",a*k.x.kx+"px"),k.y.isVisible&&k.y.scroll.bar.css("top",b*k.y.kx+"px")}),l.on("scroll"+i,function(){l.scrollTop(0).scrollLeft(0)}),j.disableBodyScroll){var n=function(a){e(a)?k.y.isVisible&&k.y.mousewheel(a):k.x.isVisible&&k.x.mousewheel(a)};l.on("MozMousePixelScroll"+i,n),l.on("mousewheel"+i,n),f.mobile&&l.on("touchstart"+i,function(b){var c=b.originalEvent.touches&&b.originalEvent.touches[0]||b,d={pageX:c.pageX,pageY:c.pageY},e={left:h.scrollLeft(),top:h.scrollTop()};a(document).on("touchmove"+i,function(a){var b=a.originalEvent.targetTouches&&a.originalEvent.targetTouches[0]||a;h.scrollLeft(e.left+d.pageX-b.pageX),h.scrollTop(e.top+d.pageY-b.pageY),a.preventDefault()}),a(document).on("touchend"+i,function(){a(document).off(i)})})}"function"==typeof j.onInit&&j.onInit.apply(this,[h])}else d={height:"auto","margin-bottom":-1*f.scroll.height+"px","max-height":""},d[j.isRtl?"margin-left":"margin-right"]=-1*f.scroll.width+"px",c.css(d);a.each(k,function(b,c){var d=null,l=1,m="x"===b?"scrollLeft":"scrollTop",n=j.scrollStep,o=function(){var a=h[m]();h[m](a+n),1==l&&a+n>=p&&(a=h[m]()),-1==l&&a+n<=p&&(a=h[m]()),h[m]()==a&&d&&d()},p=0;c.scroll||(c.scroll=g._getScroll(j["scroll"+b]).addClass("scroll-"+b),j.showArrows&&c.scroll.addClass("scroll-element_arrows_visible"),c.mousewheel=function(a){if(!c.isVisible||"x"===b&&e(a))return!0;if("y"===b&&!e(a))return k.x.mousewheel(a),!0;var d=-1*a.originalEvent.wheelDelta||a.originalEvent.detail,f=c.size-c.visible-c.offset;return d||("x"===b&&a.originalEvent.deltaX?d=40*a.originalEvent.deltaX:"y"===b&&!!a.originalEvent.deltaY&&(d=40*a.originalEvent.deltaY)),(0<d&&p<f||0>d&&0<p)&&(p+=d,0>p&&(p=0),p>f&&(p=f),g.scrollTo=g.scrollTo||{},g.scrollTo[m]=p,setTimeout(function(){g.scrollTo&&(h.stop().animate(g.scrollTo,240,"linear",function(){p=h[m]()}),g.scrollTo=null)},1)),a.preventDefault(),!1},c.scroll.on("MozMousePixelScroll"+i,c.mousewheel).on("mousewheel"+i,c.mousewheel).on("mouseenter"+i,function(){p=h[m]()}),c.scroll.find(".scroll-arrow, .scroll-element_track").on("mousedown"+i,function(e){if(1!=e.which)return!0;l=1;var i={eventOffset:e["x"===b?"pageX":"pageY"],maxScrollValue:c.size-c.visible-c.offset,scrollbarOffset:c.scroll.bar.offset()["x"===b?"left":"top"],scrollbarSize:c.scroll.bar["x"===b?"outerWidth":"outerHeight"]()},k=0,q=0;if(!a(this).hasClass("scroll-arrow"))l=i.eventOffset>i.scrollbarOffset+i.scrollbarSize?1:i.eventOffset<i.scrollbarOffset?-1:0,"x"===b&&j.isRtl&&(f.msie||f.msedge)&&(l*=-1),n=Math.round(.75*c.visible)*l,p=i.eventOffset-i.scrollbarOffset-(j.stepScrolling?1==l?i.scrollbarSize:0:Math.round(i.scrollbarSize/2)),p=h[m]()+p/c.kx;else if(l=a(this).hasClass("scroll-arrow_more")?1:-1,n=j.scrollStep*l,p=0<l?i.maxScrollValue:0,j.isRtl)switch(!0){case f.firefox:p=0<l?0:-1*i.maxScrollValue;break;case f.msie||f.msedge:}return g.scrollTo=g.scrollTo||{},g.scrollTo[m]=j.stepScrolling?h[m]()+n:p,j.stepScrolling&&(d=function(){p=h[m](),clearInterval(q),clearTimeout(k),k=0,q=0},k=setTimeout(function(){q=setInterval(o,40)},j.duration+100)),setTimeout(function(){g.scrollTo&&(h.animate(g.scrollTo,j.duration),g.scrollTo=null)},1),g._handleMouseDown(d,e)}),c.scroll.bar.on("mousedown"+i,function(d){if(1!=d.which)return!0;var e=d["x"===b?"pageX":"pageY"],k=h[m]();return c.scroll.addClass("scroll-draggable"),a(document).on("mousemove"+i,function(a){var d=parseInt((a["x"===b?"pageX":"pageY"]-e)/c.kx,10);"x"===b&&j.isRtl&&(f.msie||f.msedge)&&(d*=-1),h[m](k+d)}),g._handleMouseDown(function(){c.scroll.removeClass("scroll-draggable"),p=h[m]()},d)}))}),a.each(k,function(a,b){var d="scroll-scroll"+a+"_visible",e="x"==a?k.y:k.x;b.scroll.removeClass(d),e.scroll.removeClass(d),c.removeClass(d)}),a.each(k,function(b,c){a.extend(c,"x"==b?{offset:parseInt(h.css("left"),10)||0,size:h.prop("scrollWidth"),visible:l.width()}:{offset:parseInt(h.css("top"),10)||0,size:h.prop("scrollHeight"),visible:l.height()})}),this._updateScroll("x",this.scrollx),this._updateScroll("y",this.scrolly),"function"==typeof j.onUpdate&&j.onUpdate.apply(this,[h]),a.each(k,function(a,b){var c="x"===a?"left":"top",d="x"===a?"outerWidth":"outerHeight",e="x"===a?"width":"height",f=parseInt(h.css(c),10)||0,g=b.size,i=b.visible+f,k=b.scroll.size[d]()+(parseInt(b.scroll.size.css(c),10)||0);j.autoScrollSize&&(b.scrollbarSize=parseInt(k*i/g,10),b.scroll.bar.css(e,b.scrollbarSize+"px")),b.scrollbarSize=b.scroll.bar[d](),b.kx=(k-b.scrollbarSize)/(g-i)||1,b.maxScrollOffset=g-i}),h.scrollLeft(m.scrollLeft).scrollTop(m.scrollTop).trigger("scroll")},_getScroll:function(b){var c={advanced:"<div class=\"scroll-element\"><div class=\"scroll-element_corner\"></div><div class=\"scroll-arrow scroll-arrow_less\"></div><div class=\"scroll-arrow scroll-arrow_more\"></div><div class=\"scroll-element_outer\"><div class=\"scroll-element_size\"></div><div class=\"scroll-element_inner-wrapper\"><div class=\"scroll-element_inner scroll-element_track\"><div class=\"scroll-element_inner-bottom\"></div></div></div><div class=\"scroll-bar\"><div class=\"scroll-bar_body\"><div class=\"scroll-bar_body-inner\"></div></div><div class=\"scroll-bar_bottom\"></div><div class=\"scroll-bar_center\"></div></div></div></div>",simple:"<div class=\"scroll-element\"><div class=\"scroll-element_outer\"><div class=\"scroll-element_size\"></div><div class=\"scroll-element_track\"></div><div class=\"scroll-bar\"></div></div></div>"};return c[b]&&(b=c[b]),b||(b=c.simple),b="string"==typeof b?a(b).appendTo(this.wrapper):a(b),a.extend(b,{bar:b.find(".scroll-bar"),size:b.find(".scroll-element_size"),track:b.find(".scroll-element_track")}),b},_handleMouseDown:function(b,c){var d=this.namespace;return a(document).on("blur"+d,function(){a(document).add("body").off(d),b&&b()}),a(document).on("dragstart"+d,function(a){return a.preventDefault(),!1}),a(document).on("mouseup"+d,function(){a(document).add("body").off(d),b&&b()}),a("body").on("selectstart"+d,function(a){return a.preventDefault(),!1}),c&&c.preventDefault(),!1},_updateScroll:function(b,c){var d=this.container,e=this.containerWrapper||d,g="scroll-scroll"+b+"_visible",h="x"===b?this.scrolly:this.scrollx,i=parseInt(this.container.css("x"===b?"left":"top"),10)||0,j=this.wrapper,k=c.size,l=c.visible+i;c.isVisible=1<k-l,c.isVisible?(c.scroll.addClass(g),h.scroll.addClass(g),e.addClass(g)):(c.scroll.removeClass(g),h.scroll.removeClass(g),e.removeClass(g)),"y"===b&&(d.is("textarea")||k<l?e.css({height:l+f.scroll.height+"px","max-height":"none"}):e.css({"max-height":l+f.scroll.height+"px"})),(c.size!=d.prop("scrollWidth")||h.size!=d.prop("scrollHeight")||c.visible!=j.width()||h.visible!=j.height()||c.offset!=(parseInt(d.css("left"),10)||0)||h.offset!=(parseInt(d.css("top"),10)||0))&&(a.extend(this.scrollx,{offset:parseInt(d.css("left"),10)||0,size:d.prop("scrollWidth"),visible:j.width()}),a.extend(this.scrolly,{offset:parseInt(d.css("top"),10)||0,size:this.container.prop("scrollHeight"),visible:j.height()}),this._updateScroll("x"===b?"y":"x",h))}};a.fn.scrollbar=function(b,c){return"string"!=typeof b&&(c=b,b="init"),"undefined"==typeof c&&(c=[]),a.isArray(c)||(c=[c]),this.not("body, .scroll-wrapper").each(function(){var d=a(this),e=d.data(f.data.name);(e||"init"===b)&&(!e&&(e=new h(d)),e[b]&&e[b].apply(e,c))}),this},a.fn.scrollbar.options=g;var j=function(){var a=0,b=0;return function(c){var d,e,g,h,k,l,m;for(d=0;d<f.scrolls.length;d++)h=f.scrolls[d],e=h.container,g=h.options,k=h.wrapper,l=h.scrollx,m=h.scrolly,(c||g.autoUpdate&&k&&k.is(":visible")&&(e.prop("scrollWidth")!=l.size||e.prop("scrollHeight")!=m.size||k.width()!=l.visible||k.height()!=m.visible))&&(h.init(),g.debug&&(window.console&&console.log({scrollHeight:e.prop("scrollHeight")+":"+h.scrolly.size,scrollWidth:e.prop("scrollWidth")+":"+h.scrollx.size,visibleHeight:k.height()+":"+h.scrolly.visible,visibleWidth:k.width()+":"+h.scrollx.visible},!0),b++));clearTimeout(a),a=setTimeout(j,300)}}();window.angular&&function(a){a.module("jQueryScrollbar",[]).provider("jQueryScrollbar",function(){var b=g;return{setOptions:function(c){a.extend(b,c)},$get:function(){return{options:a.copy(b)}}}}).directive("jqueryScrollbar",["jQueryScrollbar","$parse",function(a,b){return{restrict:"AC",link:function(c,d,e){var f=b(e.jqueryScrollbar),g=f(c);d.scrollbar(g||a.options).on("$destroy",function(){d.scrollbar("destroy")})}}}])}(window.angular)});