qbittorrent-webui-cjratliff.../private/scripts/lib/MooTools-More-1.6.0-compat-compressed.js

6 lines
60 KiB
JavaScript
Raw Normal View History

2022-10-18 22:39:32 -04:00
/* MooTools: the javascript framework. license: MIT-style license. copyright: Copyright (c) 2006-2021 [Valerio Proietti](https://mootools.net/).*/
/*!
Web Build: https://mootools.net/more/builder/4a942dd7b101673d08324410b2404571
*/
MooTools.More={version:"1.6.0",build:"45b71db70f879781a7e0b0d3fb3bb1307c2521eb"},Class.Mutators.Binds=function(t){return this.prototype.initialize||this.implement("initialize",function(){}),Array.convert(t).concat(this.prototype.Binds||[])},Class.Mutators.initialize=function(t){return function(){return Array.convert(this.Binds).each(function(t){var e=this[t];e&&(this[t]=e.bind(this))},this),t.apply(this,arguments)}},Class.Occlude=new Class({occlude:function(t,e){e=document.id(e||this.element);var i=e.retrieve(t||this.property);return i&&!this.occluded?this.occluded=i:(this.occluded=!1,e.store(t||this.property,this),this.occluded)}}),function(){var t=this.Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:!1,style:!0,limit:!1,handle:!1,invert:!1,unDraggableTags:["button","input","a","textarea","select","option"],preventDefault:!1,stopPropagation:!1,compensateScroll:!1,modifiers:{x:"left",y:"top"}},initialize:function(){var e=Array.link(arguments,{options:Type.isObject,element:function(t){return null!=t}});this.element=document.id(e.element),this.document=this.element.getDocument(),this.setOptions(e.options||{});var i=typeOf(this.options.handle);this.handles=("array"==i||"collection"==i?$$(this.options.handle):document.id(this.options.handle))||this.element,this.mouse={now:{},pos:{}},this.value={start:{},now:{}},this.offsetParent=function(t){var e=t.getOffsetParent();return!e||/^(?:body|html)$/i.test(e.tagName)?window:document.id(e)}(this.element),this.selection="selectstart"in document?"selectstart":"mousedown",this.compensateScroll={start:{},diff:{},last:{}},!("ondragstart"in document)||"FileReader"in window||t.ondragstartFixed||(document.ondragstart=Function.convert(!1),t.ondragstartFixed=!0),this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.convert(!1),scrollListener:this.scrollListener.bind(this)},this.attach()},attach:function(){return this.handles.addEvent("mousedown",this.bound.start),this.handles.addEvent("touchstart",this.bound.start),this.options.compensateScroll&&this.offsetParent.addEvent("scroll",this.bound.scrollListener),this},detach:function(){return this.handles.removeEvent("mousedown",this.bound.start),this.handles.removeEvent("touchstart",this.bound.start),this.options.compensateScroll&&this.offsetParent.removeEvent("scroll",this.bound.scrollListener),this},scrollListener:function(){if(this.mouse.start){var t=this.offsetParent.getScroll();if("absolute"==this.element.getStyle("position")){var e=this.sumValues(t,this.compensateScroll.last,-1);this.mouse.now=this.sumValues(this.mouse.now,e,1)}else this.compensateScroll.diff=this.sumValues(t,this.compensateScroll.start,-1);this.offsetParent!=window&&(this.compensateScroll.diff=this.sumValues(this.compensateScroll.start,t,-1)),this.compensateScroll.last=t,this.render(this.options)}},sumValues:function(t,e,i){var n={},s=this.options;for(var o in s.modifiers)s.modifiers[o]&&(n[o]=t[o]+e[o]*i);return n},start:function(t){if(!this.options.unDraggableTags.contains(t.target.get("tag"))){var e=this.options;if(!t.rightClick){e.preventDefault&&t.preventDefault(),e.stopPropagation&&t.stopPropagation(),this.compensateScroll.start=this.compensateScroll.last=this.offsetParent.getScroll(),this.compensateScroll.diff={x:0,y:0},this.mouse.start=t.page,this.fireEvent("beforeStart",this.element);var i=e.limit;this.limit={x:[],y:[]};var n,s,o=this.offsetParent==window?null:this.offsetParent;for(n in e.modifiers)if(e.modifiers[n]){var r=this.element.getStyle(e.modifiers[n]);if(r&&!r.match(/px$/)&&(s||(s=this.element.getCoordinates(o)),r=s[e.modifiers[n]]),e.style?this.value.now[n]=(r||0).toInt():this.value.now[n]=this.element[e.modifiers[n]],e.invert&&(this.value.now[n]*=-1),this.mouse.pos[n]=t.page[n]-this.value.now[n],i&&i[n])for(var h=2;h--;){var a=i[n][h];(a||0===a)&&(this.limit[n][h]="function"==typeof a?a():a)}}"number"==typeOf(this.options.grid)&&(this.options.grid={x:this.options.grid,y:this.options.grid});var l={mousemove:this.b
var i=e.getCoordinateFromValue(t.edge);t.edge=i||("center"==t.position.x&&"center"==t.position.y?{x:"center",y:"center"}:{x:"left",y:"top"})},setOffsetOption:function(t,e){var i={x:0,y:0},n={x:0,y:0},s=t.measure(function(){return document.id(this.getOffsetParent())});s&&s!=t.getDocument().body&&(n=s.getScroll(),i=s.measure(function(){var t=this.getPosition();if("fixed"==this.getStyle("position")){var e=window.getScroll();t.x+=e.x,t.y+=e.y}return t}),e.offset={parentPositioned:s!=document.id(e.relativeTo),x:e.offset.x-i.x+n.x,y:e.offset.y-i.y+n.y})},setDimensionsOption:function(t,e){e.dimensions=t.getDimensions({computeSize:!0,styles:["padding","border","margin"]})},getPosition:function(t,i){var n={};i=e.getOptions(t,i);var s=document.id(i.relativeTo)||document.body;e.setPositionCoordinates(i,n,s),i.edge&&e.toEdge(n,i);var o=i.offset;return n.left=(n.x>=0||o.parentPositioned||i.allowNegative?n.x:0).toInt(),n.top=(n.y>=0||o.parentPositioned||i.allowNegative?n.y:0).toInt(),e.toMinMax(n,i),(i.relFixedPosition||"fixed"==s.getStyle("position"))&&e.toRelFixedPosition(s,n),i.ignoreScroll&&e.toIgnoreScroll(s,n),i.ignoreMargins&&e.toIgnoreMargins(n,i),n.left=Math.ceil(n.left),n.top=Math.ceil(n.top),delete n.x,delete n.y,n},setPositionCoordinates:function(t,e,i){var n=t.offset.y,s=t.offset.x,o=i==document.body?window.getScroll():i.getPosition(),r=o.y,h=o.x,a=window.getSize();switch(t.position.x){case"left":e.x=h+s;break;case"right":e.x=h+s+i.offsetWidth;break;default:e.x=h+(i==document.body?a.x:i.offsetWidth)/2+s}switch(t.position.y){case"top":e.y=r+n;break;case"bottom":e.y=r+n+i.offsetHeight;break;default:e.y=r+(i==document.body?a.y:i.offsetHeight)/2+n}},toMinMax:function(t,e){var i,n={left:"x",top:"y"};["minimum","maximum"].each(function(s){["left","top"].each(function(o){null!=(i=e[s]?e[s][n[o]]:null)&&("minimum"==s?t[o]<i:t[o]>i)&&(t[o]=i)})})},toRelFixedPosition:function(t,e){var i=window.getScroll();e.top+=i.y,e.left+=i.x},toIgnoreScroll:function(t,e){var i=t.getScroll();e.top-=i.y,e.left-=i.x},toIgnoreMargins:function(t,e){t.left+="right"==e.edge.x?e.dimensions["margin-right"]:"center"!=e.edge.x?-e.dimensions["margin-left"]:-e.dimensions["margin-left"]+(e.dimensions["margin-right"]+e.dimensions["margin-left"])/2,t.top+="bottom"==e.edge.y?e.dimensions["margin-bottom"]:"center"!=e.edge.y?-e.dimensions["margin-top"]:-e.dimensions["margin-top"]+(e.dimensions["margin-bottom"]+e.dimensions["margin-top"])/2},toEdge:function(t,e){var i={},n=e.dimensions,s=e.edge;switch(s.x){case"left":i.x=0;break;case"right":i.x=-n.x-n.computedRight-n.computedLeft;break;default:i.x=-Math.round(n.totalWidth/2)}switch(s.y){case"top":i.y=0;break;case"bottom":i.y=-n.y-n.computedTop-n.computedBottom;break;default:i.y=-Math.round(n.totalHeight/2)}t.x+=i.x,t.y+=i.y},getCoordinateFromValue:function(t){return"string"!=typeOf(t)?t:(t=t.toLowerCase(),{x:t.test("left")?"left":t.test("right")?"right":"center",y:t.test(/upper|top/)?"top":t.test("bottom")?"bottom":"center"})}};Element.implement({position:function(e){if(e&&(null!=e.x||null!=e.y))return t?t.apply(this,arguments):this;var i=this.setStyle("position","absolute").calculatePosition(e);return e&&e.returnPos?i:this.setStyles(i)},calculatePosition:function(t){return e.getPosition(this,t)}})}(Element.prototype.position),Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:!1,offset:{x:0,y:0}},start:function(t){var e=this.element,i=e.getStyles("top","left");return"auto"!=i.top&&"auto"!=i.left||e.setPosition(e.getPosition(e.getOffsetParent())),this.parent(e.position(Object.merge({},this.options,t,{returnPos:!0})))}}),Element.Properties.move={set:function(t){return this.get("move").cancel().setOptions(t),this},get:function(){var t=this.retrieve("move");return t||(t=new Fx.Move(this,{link:"cancel"}),this.store("move",t)),t}},Element.implement({move:function(t){return this.get("move").start(t),this}}),function(){function t(t){return/^(?:body|html)$/i.test(t.tagName)}Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:!0},initialize:function(t,e){if(this.el