|
|
|
|
@ -87,7 +87,7 @@ can set the default in the options.
|
|
|
|
|
jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
|
|
|
|
|
Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt
|
|
|
|
|
*/
|
|
|
|
|
(function(a){function e(h){var k,j=this,l=h.data||{};if(l.elem)j=h.dragTarget=l.elem,h.dragProxy=d.proxy||j,h.cursorOffsetX=l.pageX-l.left,h.cursorOffsetY=l.pageY-l.top,h.offsetX=h.pageX-h.cursorOffsetX,h.offsetY=h.pageY-h.cursorOffsetY;else if(d.dragging||l.which>0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY)<l.distance)break;h.target=l.target,k=f(h,"dragstart",j),k!==!1&&(d.dragging=j,d.proxy=h.dragProxy=a(k||j)[0]);case"mousemove":if(d.dragging){if(k=f(h,"drag",j),c.drop&&(c.drop.allowed=k!==!1,c.drop.handler(h)),k!==!1)break;h.type="mouseup"}case"mouseup":b.remove(document,"mousemove mouseup",e),d.dragging&&(c.drop&&c.drop.handler(h),f(h,"dragend",j)),i(j,!0),d.dragging=d.proxy=l.elem=!1}return!0}function f(b,c,d){b.type=c;var e=a.event.dispatch.call(d,b);return e===!1?!1:e||b.result}function g(a){return Math.pow(a,2)}function h(){return d.dragging===!1}function i(a,b){a&&(a.unselectable=b?"off":"on",a.onselectstart=function(){return b},a.style&&(a.style.MozUserSelect=b?"":"none"))}a.fn.drag=function(a,b,c){return b&&this.bind("dragstart",a),c&&this.bind("dragend",c),a?this.bind("drag",b?b:a):this.trigger("drag")};var b=a.event,c=b.special,d=c.drag={not:":input",distance:0,which:1,dragging:!1,setup:function(c){c=a.extend({distance:d.distance,which:d.which,not:d.not},c||{}),c.distance=g(c.distance),b.add(this,"mousedown",e,c),this.attachEvent&&this.attachEvent("ondragstart",h)},teardown:function(){b.remove(this,"mousedown",e),this===d.dragging&&(d.dragging=d.proxy=!1),i(this,!0),this.detachEvent&&this.detachEvent("ondragstart",h)}};c.dragstart=c.dragend={setup:function(){},teardown:function(){}}})(jQuery);
|
|
|
|
|
//(function(a){function e(h){var k,j=this,l=h.data||{};if(l.elem)j=h.dragTarget=l.elem,h.dragProxy=d.proxy||j,h.cursorOffsetX=l.pageX-l.left,h.cursorOffsetY=l.pageY-l.top,h.offsetX=h.pageX-h.cursorOffsetX,h.offsetY=h.pageY-h.cursorOffsetY;else if(d.dragging||l.which>0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY)<l.distance)break;h.target=l.target,k=f(h,"dragstart",j),k!==!1&&(d.dragging=j,d.proxy=h.dragProxy=a(k||j)[0]);case"mousemove":if(d.dragging){if(k=f(h,"drag",j),c.drop&&(c.drop.allowed=k!==!1,c.drop.handler(h)),k!==!1)break;h.type="mouseup"}case"mouseup":b.remove(document,"mousemove mouseup",e),d.dragging&&(c.drop&&c.drop.handler(h),f(h,"dragend",j)),i(j,!0),d.dragging=d.proxy=l.elem=!1}return!0}function f(b,c,d){b.type=c;var e=a.event.dispatch.call(d,b);return e===!1?!1:e||b.result}function g(a){return Math.pow(a,2)}function h(){return d.dragging===!1}function i(a,b){a&&(a.unselectable=b?"off":"on",a.onselectstart=function(){return b},a.style&&(a.style.MozUserSelect=b?"":"none"))}a.fn.drag=function(a,b,c){return b&&this.bind("dragstart",a),c&&this.bind("dragend",c),a?this.bind("drag",b?b:a):this.trigger("drag")};var b=a.event,c=b.special,d=c.drag={not:":input",distance:0,which:1,dragging:!1,setup:function(c){c=a.extend({distance:d.distance,which:d.which,not:d.not},c||{}),c.distance=g(c.distance),b.add(this,"mousedown",e,c),this.attachEvent&&this.attachEvent("ondragstart",h)},teardown:function(){b.remove(this,"mousedown",e),this===d.dragging&&(d.dragging=d.proxy=!1),i(this,!0),this.detachEvent&&this.detachEvent("ondragstart",h)}};c.dragstart=c.dragend={setup:function(){},teardown:function(){}}})(jQuery);
|
|
|
|
|
|
|
|
|
|
/* jquery.mousewheel.min.js
|
|
|
|
|
* Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
|
|
|
|
|
@ -100,7 +100,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
*
|
|
|
|
|
* Requires: 1.2.2+
|
|
|
|
|
*/
|
|
|
|
|
(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;void 0!==b.axis&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);void 0!==b.wheelDeltaY&&(g=b.wheelDeltaY/120);void 0!==b.wheelDeltaX&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
|
|
|
|
//(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;void 0!==b.axis&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);void 0!==b.wheelDeltaY&&(g=b.wheelDeltaY/120);void 0!==b.wheelDeltaX&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -139,7 +139,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
onZoomClick(e, delta < 0);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var prevCursor = 'default', prevPageX = 0, prevPageY = 0,
|
|
|
|
|
panTimeout = null;
|
|
|
|
|
|
|
|
|
|
@ -164,7 +164,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
top: prevPageY - e.pageY });
|
|
|
|
|
prevPageX = e.pageX;
|
|
|
|
|
prevPageY = e.pageY;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
panTimeout = null;
|
|
|
|
|
}, 1 / frameRate * 1000);
|
|
|
|
|
}
|
|
|
|
|
@ -174,12 +174,12 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
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) {
|
|
|
|
|
@ -197,25 +197,25 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
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 = {
|
|
|
|
|
@ -238,7 +238,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
|
|
|
|
|
if (zr === false) // no zooming on this axis
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
min = axis.c2p(min);
|
|
|
|
|
max = axis.c2p(max);
|
|
|
|
|
if (min > max) {
|
|
|
|
|
@ -263,14 +263,14 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
((zr[0] != null && range < zr[0]) ||
|
|
|
|
|
(zr[1] != null && range > zr[1])))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
opts.min = min;
|
|
|
|
|
opts.max = max;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot.setupGrid();
|
|
|
|
|
plot.draw();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!args.preventEvent)
|
|
|
|
|
plot.getPlaceholder().trigger("plotzoom", [ plot, args ]);
|
|
|
|
|
};
|
|
|
|
|
@ -296,7 +296,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
var pr = opts.panRange;
|
|
|
|
|
if (pr === false) // no panning on this axis
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pr) {
|
|
|
|
|
// check whether we hit the wall
|
|
|
|
|
if (pr[0] != null && pr[0] > min) {
|
|
|
|
|
@ -304,21 +304,21 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
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 ]);
|
|
|
|
|
};
|
|
|
|
|
@ -332,11 +332,11 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
|
|
|
|
|
if (panTimeout)
|
|
|
|
|
clearTimeout(panTimeout);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plot.hooks.bindEvents.push(bindEvents);
|
|
|
|
|
plot.hooks.shutdown.push(shutdown);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.plot.plugins.push({
|
|
|
|
|
init: init,
|
|
|
|
|
options: options,
|
|
|
|
|
|