/usr/share/javascript/jquery-flot/jquery.flot.navigate.min.js is in libjs-jquery-flot 0.8.3+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 | (function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);(function(e){e.fn.drag=function(l,k,j){if(k){this.bind("dragstart",l)}if(j){this.bind("dragend",j)}return!l?this.trigger("drag"):this.bind("drag",k?k:l)};var a=e.event,b=a.special,f=b.drag={not:":input",distance:0,which:1,dragging:false,setup:function(j){j=e.extend({distance:f.distance,which:f.which,not:f.not},j||{});j.distance=i(j.distance);a.add(this,"mousedown",h,j);if(this.attachEvent){this.attachEvent("ondragstart",d)}},teardown:function(){a.remove(this,"mousedown",h);if(this===f.dragging){f.dragging=f.proxy=false}g(this,true);if(this.detachEvent){this.detachEvent("ondragstart",d)}}};b.dragstart=b.dragend={setup:function(){},teardown:function(){}};function h(l){var k=this,j,m=l.data||{};if(m.elem){k=l.dragTarget=m.elem;l.dragProxy=f.proxy||k;l.cursorOffsetX=m.pageX-m.left;l.cursorOffsetY=m.pageY-m.top;l.offsetX=l.pageX-l.cursorOffsetX;l.offsetY=l.pageY-l.cursorOffsetY}else{if(f.dragging||m.which>0&&l.which!=m.which||e(l.target).is(m.not)){return}}switch(l.type){case"mousedown":e.extend(m,e(k).offset(),{elem:k,target:l.target,pageX:l.pageX,pageY:l.pageY});a.add(document,"mousemove mouseup",h,m);g(k,false);f.dragging=null;return false;case!f.dragging&&"mousemove":if(i(l.pageX-m.pageX)+i(l.pageY-m.pageY)<m.distance){break}l.target=m.target;j=c(l,"dragstart",k);if(j!==false){f.dragging=k;f.proxy=l.dragProxy=e(j||k)[0]}case"mousemove":if(f.dragging){j=c(l,"drag",k);if(b.drop){b.drop.allowed=j!==false;b.drop.handler(l)}if(j!==false){break}l.type="mouseup"}case"mouseup":a.remove(document,"mousemove mouseup",h);if(f.dragging){if(b.drop){b.drop.handler(l)}c(l,"dragend",k)}g(k,true);f.dragging=f.proxy=m.elem=false;break}return true}function c(m,k,l){m.type=k;var j=e.event.handle.call(l,m);return j===false?false:j||m.result}function i(j){return Math.pow(j,2)}function d(){return f.dragging===false}function g(k,j){if(!k){return}k.unselectable=j?"off":"on";k.onselectstart=function(){return j};if(k.style){k.style.MozUserSelect=j?"":"none"}}})(jQuery);(function($){var options={xaxis:{zoomRange:null,panRange:null},zoom:{interactive:false,trigger:"dblclick",amount:1.5},pan:{interactive:false,cursor:"move",frameRate:20}};function init(plot){function onZoomClick(e,zoomOut){var c=plot.offset();c.left=e.pageX-c.left;c.top=e.pageY-c.top;if(zoomOut)plot.zoomOut({center:c});else plot.zoom({center:c})}function onMouseWheel(e,delta){e.preventDefault();onZoomClick(e,delta<0);return false}var prevCursor="default",prevPageX=0,prevPageY=0,panTimeout=null;function onDragStart(e){if(e.which!=1)return false;var c=plot.getPlaceholder().css("cursor");if(c)prevCursor=c;plot.getPlaceholder().css("cursor",plot.getOptions().pan.cursor);prevPageX=e.pageX;prevPageY=e.pageY}function onDrag(e){var frameRate=plot.getOptions().pan.frameRate;if(panTimeout||!frameRate)return;panTimeout=setTimeout(function(){plot.pan({left:prevPageX-e.pageX,top:prevPageY-e.pageY});prevPageX=e.pageX;prevPageY=e.pageY;panTimeout=null},1/frameRate*1e3)}function onDragEnd(e){if(panTimeout){clearTimeout(panTimeout);panTimeout=null}plot.getPlaceholder().css("cursor",prevCursor);plot.pan({left:prevPageX-e.pageX,top:prevPageY-e.pageY})}function bindEvents(plot,eventHolder){var o=plot.getOptions();if(o.zoom.interactive){eventHolder[o.zoom.trigger](onZoomClick);eventHolder.mousewheel(onMouseWheel)}if(o.pan.interactive){eventHolder.bind("dragstart",{distance:10},onDragStart);eventHolder.bind("drag",onDrag);eventHolder.bind("dragend",onDragEnd)}}plot.zoomOut=function(args){if(!args)args={};if(!args.amount)args.amount=plot.getOptions().zoom.amount;args.amount=1/args.amount;plot.zoom(args)};plot.zoom=function(args){if(!args)args={};var c=args.center,amount=args.amount||plot.getOptions().zoom.amount,w=plot.width(),h=plot.height();if(!c)c={left:w/2,top:h/2};var xf=c.left/w,yf=c.top/h,minmax={x:{min:c.left-xf*w/amount,max:c.left+(1-xf)*w/amount},y:{min:c.top-yf*h/amount,max:c.top+(1-yf)*h/amount}};$.each(plot.getAxes(),function(_,axis){var opts=axis.options,min=minmax[axis.direction].min,max=minmax[axis.direction].max,zr=opts.zoomRange,pr=opts.panRange;if(zr===false)return;min=axis.c2p(min);max=axis.c2p(max);if(min>max){var tmp=min;min=max;max=tmp}if(pr){if(pr[0]!=null&&min<pr[0]){min=pr[0]}if(pr[1]!=null&&max>pr[1]){max=pr[1]}}var range=max-min;if(zr&&(zr[0]!=null&&range<zr[0]&&amount>1||zr[1]!=null&&range>zr[1]&&amount<1))return;opts.min=min;opts.max=max});plot.setupGrid();plot.draw();if(!args.preventEvent)plot.getPlaceholder().trigger("plotzoom",[plot,args])};plot.pan=function(args){var delta={x:+args.left,y:+args.top};if(isNaN(delta.x))delta.x=0;if(isNaN(delta.y))delta.y=0;$.each(plot.getAxes(),function(_,axis){var opts=axis.options,min,max,d=delta[axis.direction];min=axis.c2p(axis.p2c(axis.min)+d),max=axis.c2p(axis.p2c(axis.max)+d);var pr=opts.panRange;if(pr===false)return;if(pr){if(pr[0]!=null&&pr[0]>min){d=pr[0]-min;min+=d;max+=d}if(pr[1]!=null&&pr[1]<max){d=pr[1]-max;min+=d;max+=d}}opts.min=min;opts.max=max});plot.setupGrid();plot.draw();if(!args.preventEvent)plot.getPlaceholder().trigger("plotpan",[plot,args])};function shutdown(plot,eventHolder){eventHolder.unbind(plot.getOptions().zoom.trigger,onZoomClick);eventHolder.unbind("mousewheel",onMouseWheel);eventHolder.unbind("dragstart",onDragStart);eventHolder.unbind("drag",onDrag);eventHolder.unbind("dragend",onDragEnd);if(panTimeout)clearTimeout(panTimeout)}plot.hooks.bindEvents.push(bindEvents);plot.hooks.shutdown.push(shutdown)}$.plot.plugins.push({init:init,options:options,name:"navigate",version:"1.3"})})(jQuery);
|