diff options
Diffstat (limited to 'ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag')
11 files changed, 0 insertions, 1345 deletions
diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/jquery.event.drag.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/jquery.event.drag.js deleted file mode 100644 index 1cda0e21..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/jquery.event.drag.js +++ /dev/null @@ -1,402 +0,0 @@ -/*! - * jquery.event.drag - v 2.2 - * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com - * Open Source MIT License - http://threedubmedia.com/code/license - */ -// Created: 2008-06-04 -// Updated: 2012-05-21 -// REQUIRES: jquery 1.7.x - -;(function( $ ){ - -// add the jquery instance method -$.fn.drag = function( str, arg, opts ){ - // figure out the event type - var type = typeof str == "string" ? str : "", - // figure out the event handler... - fn = $.isFunction( str ) ? str : $.isFunction( arg ) ? arg : null; - // fix the event type - if ( type.indexOf("drag") !== 0 ) - type = "drag"+ type; - // were options passed - opts = ( str == fn ? arg : opts ) || {}; - // trigger or bind event handler - return fn ? this.bind( type, opts, fn ) : this.trigger( type ); -}; - -// local refs (increase compression) -var $event = $.event, -$special = $event.special, -// configure the drag special event -drag = $special.drag = { - - // these are the default settings - defaults: { - which: 1, // mouse button pressed to start drag sequence - distance: 0, // distance dragged before dragstart - not: ':input', // selector to suppress dragging on target elements - handle: null, // selector to match handle target elements - relative: false, // true to use "position", false to use "offset" - drop: true, // false to suppress drop events, true or selector to allow - click: false // false to suppress click events after dragend (no proxy) - }, - - // the key name for stored drag data - datakey: "dragdata", - - // prevent bubbling for better performance - noBubble: true, - - // count bound related events - add: function( obj ){ - // read the interaction data - var data = $.data( this, drag.datakey ), - // read any passed options - opts = obj.data || {}; - // count another realted event - data.related += 1; - // extend data options bound with this event - // don't iterate "opts" in case it is a node - $.each( drag.defaults, function( key, def ){ - if ( opts[ key ] !== undefined ) - data[ key ] = opts[ key ]; - }); - }, - - // forget unbound related events - remove: function(){ - $.data( this, drag.datakey ).related -= 1; - }, - - // configure interaction, capture settings - setup: function(){ - // check for related events - if ( $.data( this, drag.datakey ) ) - return; - // initialize the drag data with copied defaults - var data = $.extend({ related:0 }, drag.defaults ); - // store the interaction data - $.data( this, drag.datakey, data ); - // bind the mousedown event, which starts drag interactions - $event.add( this, "touchstart mousedown", drag.init, data ); - // prevent image dragging in IE... - if ( this.attachEvent ) - this.attachEvent("ondragstart", drag.dontstart ); - }, - - // destroy configured interaction - teardown: function(){ - var data = $.data( this, drag.datakey ) || {}; - // check for related events - if ( data.related ) - return; - // remove the stored data - $.removeData( this, drag.datakey ); - // remove the mousedown event - $event.remove( this, "touchstart mousedown", drag.init ); - // enable text selection - drag.textselect( true ); - // un-prevent image dragging in IE... - if ( this.detachEvent ) - this.detachEvent("ondragstart", drag.dontstart ); - }, - - // initialize the interaction - init: function( event ){ - // sorry, only one touch at a time - if ( drag.touched ) - return; - // the drag/drop interaction data - var dd = event.data, results; - // check the which directive - if ( event.which != 0 && dd.which > 0 && event.which != dd.which ) - return; - // check for suppressed selector - if ( $( event.target ).is( dd.not ) ) - return; - // check for handle selector - if ( dd.handle && !$( event.target ).closest( dd.handle, event.currentTarget ).length ) - return; - - drag.touched = event.type == 'touchstart' ? this : null; - dd.propagates = 1; - dd.mousedown = this; - dd.interactions = [ drag.interaction( this, dd ) ]; - dd.target = event.target; - dd.pageX = event.pageX; - dd.pageY = event.pageY; - dd.dragging = null; - // handle draginit event... - results = drag.hijack( event, "draginit", dd ); - // early cancel - if ( !dd.propagates ) - return; - // flatten the result set - results = drag.flatten( results ); - // insert new interaction elements - if ( results && results.length ){ - dd.interactions = []; - $.each( results, function(){ - dd.interactions.push( drag.interaction( this, dd ) ); - }); - } - // remember how many interactions are propagating - dd.propagates = dd.interactions.length; - // locate and init the drop targets - if ( dd.drop !== false && $special.drop ) - $special.drop.handler( event, dd ); - // disable text selection - drag.textselect( false ); - // bind additional events... - if ( drag.touched ) - $event.add( drag.touched, "touchmove touchend", drag.handler, dd ); - else - $event.add( document, "mousemove mouseup", drag.handler, dd ); - // helps prevent text selection or scrolling - if ( !drag.touched || dd.live ) - return false; - }, - - // returns an interaction object - interaction: function( elem, dd ){ - var offset = $( elem )[ dd.relative ? "position" : "offset" ]() || { top:0, left:0 }; - return { - drag: elem, - callback: new drag.callback(), - droppable: [], - offset: offset - }; - }, - - // handle drag-releatd DOM events - handler: function( event ){ - // read the data before hijacking anything - var dd = event.data; - // handle various events - switch ( event.type ){ - // mousemove, check distance, start dragging - case !dd.dragging && 'touchmove': - event.preventDefault(); - case !dd.dragging && 'mousemove': - // drag tolerance, x² + y² = distance² - if ( Math.pow( event.pageX-dd.pageX, 2 ) + Math.pow( event.pageY-dd.pageY, 2 ) < Math.pow( dd.distance, 2 ) ) - break; // distance tolerance not reached - event.target = dd.target; // force target from "mousedown" event (fix distance issue) - drag.hijack( event, "dragstart", dd ); // trigger "dragstart" - if ( dd.propagates ) // "dragstart" not rejected - dd.dragging = true; // activate interaction - // mousemove, dragging - case 'touchmove': - event.preventDefault(); - case 'mousemove': - if ( dd.dragging ){ - // trigger "drag" - drag.hijack( event, "drag", dd ); - if ( dd.propagates ){ - // manage drop events - if ( dd.drop !== false && $special.drop ) - $special.drop.handler( event, dd ); // "dropstart", "dropend" - break; // "drag" not rejected, stop - } - event.type = "mouseup"; // helps "drop" handler behave - } - // mouseup, stop dragging - case 'touchend': - case 'mouseup': - default: - if ( drag.touched ) - $event.remove( drag.touched, "touchmove touchend", drag.handler ); // remove touch events - else - $event.remove( document, "mousemove mouseup", drag.handler ); // remove page events - if ( dd.dragging ){ - if ( dd.drop !== false && $special.drop ) - $special.drop.handler( event, dd ); // "drop" - drag.hijack( event, "dragend", dd ); // trigger "dragend" - } - drag.textselect( true ); // enable text selection - // if suppressing click events... - if ( dd.click === false && dd.dragging ) - $.data( dd.mousedown, "suppress.click", new Date().getTime() + 5 ); - dd.dragging = drag.touched = false; // deactivate element - break; - } - }, - - // re-use event object for custom events - hijack: function( event, type, dd, x, elem ){ - // not configured - if ( !dd ) - return; - // remember the original event and type - var orig = { event:event.originalEvent, type:event.type }, - // is the event drag related or drog related? - mode = type.indexOf("drop") ? "drag" : "drop", - // iteration vars - result, i = x || 0, ia, $elems, callback, - len = !isNaN( x ) ? x : dd.interactions.length; - // modify the event type - event.type = type; - // remove the original event - event.originalEvent = null; - // initialize the results - dd.results = []; - // handle each interacted element - do if ( ia = dd.interactions[ i ] ){ - // validate the interaction - if ( type !== "dragend" && ia.cancelled ) - continue; - // set the dragdrop properties on the event object - callback = drag.properties( event, dd, ia ); - // prepare for more results - ia.results = []; - // handle each element - $( elem || ia[ mode ] || dd.droppable ).each(function( p, subject ){ - // identify drag or drop targets individually - callback.target = subject; - // force propagtion of the custom event - event.isPropagationStopped = function(){ return false; }; - // handle the event - result = subject ? $event.dispatch.call( subject, event, callback ) : null; - // stop the drag interaction for this element - if ( result === false ){ - if ( mode == "drag" ){ - ia.cancelled = true; - dd.propagates -= 1; - } - if ( type == "drop" ){ - ia[ mode ][p] = null; - } - } - // assign any dropinit elements - else if ( type == "dropinit" ) - ia.droppable.push( drag.element( result ) || subject ); - // accept a returned proxy element - if ( type == "dragstart" ) - ia.proxy = $( drag.element( result ) || ia.drag )[0]; - // remember this result - ia.results.push( result ); - // forget the event result, for recycling - delete event.result; - // break on cancelled handler - if ( type !== "dropinit" ) - return result; - }); - // flatten the results - dd.results[ i ] = drag.flatten( ia.results ); - // accept a set of valid drop targets - if ( type == "dropinit" ) - ia.droppable = drag.flatten( ia.droppable ); - // locate drop targets - if ( type == "dragstart" && !ia.cancelled ) - callback.update(); - } - while ( ++i < len ) - // restore the original event & type - event.type = orig.type; - event.originalEvent = orig.event; - // return all handler results - return drag.flatten( dd.results ); - }, - - // extend the callback object with drag/drop properties... - properties: function( event, dd, ia ){ - var obj = ia.callback; - // elements - obj.drag = ia.drag; - obj.proxy = ia.proxy || ia.drag; - // starting mouse position - obj.startX = dd.pageX; - obj.startY = dd.pageY; - // current distance dragged - obj.deltaX = event.pageX - dd.pageX; - obj.deltaY = event.pageY - dd.pageY; - // original element position - obj.originalX = ia.offset.left; - obj.originalY = ia.offset.top; - // adjusted element position - obj.offsetX = obj.originalX + obj.deltaX; - obj.offsetY = obj.originalY + obj.deltaY; - // assign the drop targets information - obj.drop = drag.flatten( ( ia.drop || [] ).slice() ); - obj.available = drag.flatten( ( ia.droppable || [] ).slice() ); - return obj; - }, - - // determine is the argument is an element or jquery instance - element: function( arg ){ - if ( arg && ( arg.jquery || arg.nodeType == 1 ) ) - return arg; - }, - - // flatten nested jquery objects and arrays into a single dimension array - flatten: function( arr ){ - return $.map( arr, function( member ){ - return member && member.jquery ? $.makeArray( member ) : - member && member.length ? drag.flatten( member ) : member; - }); - }, - - // toggles text selection attributes ON (true) or OFF (false) - textselect: function( bool ){ - $( document )[ bool ? "unbind" : "bind" ]("selectstart", drag.dontstart ) - .css("MozUserSelect", bool ? "" : "none" ); - // .attr("unselectable", bool ? "off" : "on" ) - document.unselectable = bool ? "off" : "on"; - }, - - // suppress "selectstart" and "ondragstart" events - dontstart: function(){ - return false; - }, - - // a callback instance contructor - callback: function(){} - -}; - -// callback methods -drag.callback.prototype = { - update: function(){ - if ( $special.drop && this.available.length ) - $.each( this.available, function( i ){ - $special.drop.locate( this, i ); - }); - } -}; - -// patch $.event.$dispatch to allow suppressing clicks -var $dispatch = $event.dispatch; -$event.dispatch = function( event ){ - if ( $.data( this, "suppress."+ event.type ) - new Date().getTime() > 0 ){ - $.removeData( this, "suppress."+ event.type ); - return; - } - return $dispatch.apply( this, arguments ); -}; - -// event fix hooks for touch events... -var touchHooks = -$event.fixHooks.touchstart = -$event.fixHooks.touchmove = -$event.fixHooks.touchend = -$event.fixHooks.touchcancel = { - props: "clientX clientY pageX pageY screenX screenY".split( " " ), - filter: function( event, orig ) { - if ( orig ){ - var touched = ( orig.touches && orig.touches[0] ) - || ( orig.changedTouches && orig.changedTouches[0] ) - || null; - // iOS webkit: touchstart, touchmove, touchend - if ( touched ) - $.each( touchHooks.props, function( i, prop ){ - event[ prop ] = touched[ prop ]; - }); - } - return event; - } -}; - -// share the same special event configuration with related events... -$special.draginit = $special.dragstart = $special.dragend = drag; - -})( jQuery );
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/jquery.event.drag.live.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/jquery.event.drag.live.js deleted file mode 100644 index 77452716..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/jquery.event.drag.live.js +++ /dev/null @@ -1,87 +0,0 @@ -/*! - * jquery.event.drag.live - v 2.2 - * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com - * Open Source MIT License - http://threedubmedia.com/code/license - */ -// Created: 2010-06-07 -// Updated: 2012-05-21 -// REQUIRES: jquery 1.7.x, event.drag 2.2 - -;(function( $ ){ - -// local refs (increase compression) -var $event = $.event, -// ref the special event config -drag = $event.special.drag, -// old drag event add method -origadd = drag.add, -// old drag event teradown method -origteardown = drag.teardown; - -// allow events to bubble for delegation -drag.noBubble = false; - -// the namespace for internal live events -drag.livekey = "livedrag"; - -// new drop event add method -drag.add = function( obj ){ - // call the old method - origadd.apply( this, arguments ); - // read the data - var data = $.data( this, drag.datakey ); - // bind the live "draginit" delegator - if ( !data.live && obj.selector ){ - data.live = true; - $event.add( this, "draginit."+ drag.livekey, drag.delegate ); - } -}; - -// new drop event teardown method -drag.teardown = function(){ - // call the old method - origteardown.apply( this, arguments ); - // read the data - var data = $.data( this, drag.datakey ) || {}; - // bind the live "draginit" delegator - if ( data.live ){ - // remove the "live" delegation - $event.remove( this, "draginit."+ drag.livekey, drag.delegate ); - data.live = false; - } -}; - -// identify potential delegate elements -drag.delegate = function( event ){ - // local refs - var elems = [], target, - // element event structure - events = $.data( this, "events" ) || {}; - // query live events - $.each( events || [], function( key, arr ){ - // no event type matches - if ( key.indexOf("drag") !== 0 ) - return; - $.each( arr || [], function( i, obj ){ - // locate the element to delegate - target = $( event.target ).closest( obj.selector, event.currentTarget )[0]; - // no element found - if ( !target ) - return; - // add an event handler - $event.add( target, obj.origType+'.'+drag.livekey, obj.origHandler || obj.handler, obj.data ); - // remember new elements - if ( $.inArray( target, elems ) < 0 ) - elems.push( target ); - }); - }); - // if there are no elements, break - if ( !elems.length ) - return false; - // return the matched results, and clenup when complete - return $( elems ).bind("dragend."+ drag.livekey, function(){ - $event.remove( this, "."+ drag.livekey ); // cleanup delegation - }); -}; - -})( jQuery );
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/binding.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/binding.js deleted file mode 100644 index 01c9609f..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/binding.js +++ /dev/null @@ -1,64 +0,0 @@ -module("Event Binding"); - -$.each(['draginit','dragstart','drag','dragend'],function( i, type ){ - - test('"'+ type +'"',function(){ - - expect( 27 ); - - // make sure the event handler gets bound to the element - var $elem = $('<div />'), - elem = $elem[0], - count = 0, - fn = function(){ - count += 1; - }, - opts = { - which: 99, - distance: 88, - not: 77, - handle: 66, - relative: 55, - drop: 44, - click: 33 - }, - def = $.event.special[ type ].defaults, - data; - - ok( $elem.bind( type, fn )[0] == elem, '.bind("'+ type +'", fn )' ); - ok( data = $.data( elem, $.event.special.drag.datakey ), "drag data exists" ); - ok( $.data( elem, "events" ), "event data exists" ); - ok( $.data( elem, "events" )[ type ][0], '"'+ type +'" event handler added' ); - - ok( data.which == def.which, '"which" default stored' ); - ok( data.distance == def.distance, '"distance" default stored' ); - ok( data.not == def.not, '"not" default stored' ); - ok( data.handle == def.handle, '"handle" default stored' ); - ok( data.relative == def.relative, '"relative" default stored' ); - ok( data.drop == def.drop, '"drop" default stored' ); - ok( data.click == def.click, '"click" default stored' ); - - ok( $elem.trigger( type )[0] == elem, '.trigger("'+ type +'")' ); - ok( count == 1, "handler was triggered"); - - ok( $elem.unbind( type )[0] == elem, '.unbind("'+ type +'")' ); - ok( !$.data( elem, "events" ), "event data removed" ); - ok( !$.data( elem, $.event.special.drag.datakey ), "drag data removed" ); - - ok( $elem.bind( type, opts, fn )[0] == elem, '.bind("'+ type +'", data, fn )' ); - ok( data = $.data( elem, $.event.special.drag.datakey ), "drag data exists" ); - ok( $.data( elem, "events" ), "event data exists" ); - ok( $.data( elem, "events" )[ type ][0], '"drag'+ type +'" event handler added' ); - - ok( data.which == opts.which, '"which" option stored' ); - ok( data.distance == opts.distance, '"distance" option stored' ); - ok( data.not == opts.not, '"not" option stored' ); - ok( data.handle == opts.handle, '"handle" option stored' ); - ok( data.relative == opts.relative, '"relative" option stored' ); - ok( data.drop == opts.drop, '"drop" option stored' ); - ok( data.click == opts.click, '"click" option stored' ); - - $elem.remove(); - - }); -});
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/handlers.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/handlers.js deleted file mode 100644 index 799051ad..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/handlers.js +++ /dev/null @@ -1,160 +0,0 @@ -;(function(){ - - module("Event Handlers"); - - // a simple re-usable test harness object - var obj = { - init: function( opts ){ - obj.$div = $('<div />') - .css({ - position: 'absolute', - top: 0, - left: 0, - height: 100, - width: 100 - }) - .appendTo( document.body ) - .bind("draginit dragstart drag dragend click", opts || {}, function( event ){ - obj[ event.type ] += 1; - if ( obj.extra[ event.type ] ) - obj.extra[ event.type ].apply( this, arguments ); - return obj.returned[ event.type ]; - }); - - $.extend( obj, { draginit:0, dragstart:0, drag:0, dragend:0, click:0 }); - obj.extra = {}; - obj.returned = {}; - }, - mouse: function(){ - var start = { - pageX: Math.round( Math.random() * 90 ) + 5, - pageY: Math.round( Math.random() * 90 ) + 5 - }, - end = { - pageX: Math.round( Math.random() * 90 ) + start.pageX, - pageY: Math.round( Math.random() * 90 ) + start.pageY - }; - // simulate a complete mouse drag - obj.$div - .fire("mousedown", start ) - .fire("mousemove", end ) - .fire("mouseup", end ) - .fire("click", end ); - }, - done: function( ms ){ - obj.$div.remove(); - start(); - } - }; - - // test DRAGINIT FALSE - asyncTest('"draginit" return false',function(){ - expect( 5 ); - // test prep - obj.init(); - obj.returned['draginit'] = false; - // simulate a mouse drag - obj.mouse(); - // check counts - equals( obj.draginit, 1, "draginit fired"); - equals( obj.dragstart, 0, "dragstart did not fire"); - equals( obj.drag, 0, "drag did not fire"); - equals( obj.dragend, 0, "dragend did not fire"); - equals( obj.click, 1, "click fired"); - // continue - obj.done(); - }); - - asyncTest('"dragstart" return false',function(){ - expect( 5 ); - // test prep - obj.init(); - obj.returned['dragstart'] = false; - // simulate a mouse drag - obj.mouse(); - // check counts - equals( obj.draginit, 1, "draginit fired"); - equals( obj.dragstart, 1, "dragstart fired"); - equals( obj.drag, 0, "drag did not fire"); - equals( obj.dragend, 0, "dragend did not fire"); - equals( obj.click, 1, "click fired"); - // continue - obj.done(); - }); - - asyncTest('"drag" return false',function(){ - expect( 5 ); - // test prep - obj.init(); - obj.returned['drag'] = false; - // simulate a mouse drag - obj.mouse(); - // check ocunts - equals( obj.draginit, 1, "draginit fired"); - equals( obj.dragstart, 1, "dragstart fired"); - equals( obj.drag, 1, "drag fired"); - equals( obj.dragend, 1, "dragend fired"); - equals( obj.click, 0, "click did not fire"); - // continue - obj.done(); - }); - - asyncTest('"draginit" return new element',function(){ - expect( 8 ); - // test prep - obj.init(); - var $clone = obj.returned['draginit'] = obj.$div.clone( true ); - obj.extra['dragstart'] = obj.extra['drag'] = obj.extra['dragend'] = function( ev, dd ){ - ok( dd.drag === $clone[0], ev.type +' target element' ); - }; - // simulate a mouse drag - obj.mouse(); - // check counts - equals( obj.draginit, 1, "draginit fired"); - equals( obj.dragstart, 1, "dragstart fired"); - equals( obj.drag, 1, "drag fired"); - equals( obj.dragend, 1, "dragend fired"); - equals( obj.click, 0, "click did not fire"); - // continue - obj.done(); - }); - - asyncTest('"draginit" return multiple elements',function(){ - expect( 5 ); - // test prep - obj.init(); - obj.returned['draginit'] = obj.$div.clone( true ).add( obj.$div ); - // simulate a mouse drag - obj.mouse(); - // check counts - equals( obj.draginit, 1, "draginit fired once"); - equals( obj.dragstart, 2, "dragstart fired twice"); - equals( obj.drag, 2, "drag fired twice"); - equals( obj.dragend, 2, "dragend fired twice"); - equals( obj.click, 0, "click did not fire"); - // continue - obj.done(); - }); - - - asyncTest('"dragstart" return proxy element',function(){ - expect( 7 ); - // test prep - obj.init(); - var $proxy = obj.returned['dragstart'] = obj.$div.clone().addClass('proxy'); - obj.extra['drag'] = obj.extra['dragend'] = function( ev, dd ){ - ok( dd.proxy === $proxy[0], ev.type +' proxy element' ); - }; - // simulate a mouse drag - obj.mouse(); - // check counts - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 0, "click did not fire"); - // continue - obj.done(); - }); - -})();
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/index.html b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/index.html deleted file mode 100644 index 45991889..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/index.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<link href="../../img/favicon.ico" rel="shortcut icon" /> -<link href="../../jquery/qunit.css" rel="stylesheet" /> -<script src="../../jquery/jquery.js"></script> -<script src="../../jquery/qunit.js"></script> -<script src="../../fire/jquery.fire.js"></script> -<script src="../jquery.event.drag.js"></script> -<script src="../jquery.event.drag.live.js"></script> -<script src="./requirements.js"></script> -<script src="./binding.js"></script> -<script src="./method.js"></script> -<script src="./interaction.js"></script> -<script src="./touch.js"></script> -<script src="./properties.js"></script> -<script src="./handlers.js"></script> -<script src="./live.js"></script> -<title>ThreeDubMedia · jQuery.event.drag.js</title> -</head> -<body> -<h1 id="qunit-header">jQuery.event.drag.js Unit Tests</h1> -<h2 id="qunit-banner"></h2> -<h2 id="qunit-userAgent"></h2> -<ol id="qunit-tests"></ol> -</body> -</html>
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/interaction.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/interaction.js deleted file mode 100644 index 3464627b..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/interaction.js +++ /dev/null @@ -1,198 +0,0 @@ -;(function(){ - - module("Mouse Interaction"); - - // a simple re-usable test harness object - var obj = { - init: function( opts ){ - obj.$div = $('<div />') - .css({ - position: 'absolute', - top: 0, - left: 0, - height: 100, - width: 100 - }) - .append('<div class="child" />') - .appendTo( document.body ) - .bind("draginit dragstart drag dragend click", opts || {}, function( event ){ - obj[ event.type ] += 1; - }); - $.extend( obj, { draginit:0, dragstart:0, drag:0, dragend:0, click:0 }); - }, - done: function(){ - obj.$div.remove(); - start(); - } - }; - - asyncTest("default",function(){ - expect( 5 ); - // prep DEFAULT interaction - obj.init(); - // simulate DEFAULT interaction - obj.$div - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 0, "click"); - // clean-up interaction - obj.done(); - }); - - asyncTest('"not" option',function(){ - expect( 10 ); - // prep interaction - obj.init({ not:'.child' }); - // simulate NOT interaction - obj.$div.children() - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 0, "draginit"); - equals( obj.dragstart, 0, "dragstart"); - equals( obj.drag, 0, "drag"); - equals( obj.dragend, 0, "dragend"); - equals( obj.click, 1, "click"); - // simlate NON NOT interaction - obj.$div - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - - asyncTest('"handle" option',function(){ - expect( 10 ); - // prep interaction - obj.init({ handle:'.child' }); - // simulate HANDLE interaction - obj.$div.children() - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 0, "click"); - // simulate NON HANDLE interaction - obj.$div - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - - asyncTest('"which" option',function(){ - expect( 10 ); - // prep interaction - obj.init({ which:3 }); - // simulate WHICH interaction - obj.$div - .fire("mousedown",{ pageX:50, pageY:50, button:2 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 0, "click"); - // simulate NON WHICH interaction - obj.$div - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - - asyncTest('"distance" option',function(){ - expect( 10 ); - // prep interaction - obj.init({ distance:5 }); - // simulate NON DISTANCE interaction - obj.$div - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 0, "dragstart"); - equals( obj.drag, 0, "drag"); - equals( obj.dragend, 0, "dragend"); - equals( obj.click, 1, "click"); - // simulate DISTANCE interaction - obj.$div - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:53, pageY:54 }) - .fire("mouseup",{ pageX:53, pageY:54 }) - .fire("click"); - // inspect results - equals( obj.draginit, 2, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - - - asyncTest('"click" option',function(){ - expect( 5 ); - // prep interaction - obj.init({ click:true }); - // simulate CLICK interaction - obj.$div - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - -})();
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/live.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/live.js deleted file mode 100644 index cf1898a7..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/live.js +++ /dev/null @@ -1,41 +0,0 @@ -module("Live Delegation"); - -$.each(["draginit","dragstart","drag","dragend"],function( i, type ){ - - test('"'+ type+'"',function(){ - - expect( i ? 5 : 1 ); - - if ( !i ){ - ok( true, 'Not supported for this event type.'); - return; - } - - // set up the delegation - $('.drag').live( type, function( event ){ - count += 1; - equals( this, $drag[0], event.type+" target" ); - }); - // local refs - var count = 0, - // add a div to test the delegation - $drag = $('<div class="drag" />').appendTo( document.body ); - - // manual triggering - ok( $drag.trigger( type ), '.trigger("'+ type +'")'); - equals( count, 1, "event was triggered"); - - // simulate a complete drag - $drag - .fire("mousedown",{ pageX:50, pageY:50 }) - .fire("mousemove",{ pageX:51, pageY:51 }) - .fire("mouseup",{ pageX:51, pageY:51 }) - .fire("click",{ pageX:51, pageY:51 }); - - equals( count, 2, "event was delegated"); - - // remove delegation - $('.drag').die( type ); - $drag.remove(); - }); -});
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/method.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/method.js deleted file mode 100644 index d6b4a514..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/method.js +++ /dev/null @@ -1,64 +0,0 @@ -module("Drag Method"); - -$.each(['init','start','','end'],function( i, type ){ - - test('"drag'+ type +'"',function(){ - - expect( 27 ); - - // make sure the event handler gets bound to the element - var $elem = $('<div />'), - elem = $elem[0], - count = 0, - fn = function(){ - count += 1; - }, - opts = { - which: 99, - distance: 88, - not: 77, - handle: 66, - relative: 55, - drop: 44, - click: 33 - }, - def = $.event.special[ 'drag'+ type ].defaults, - data; - - ok( $elem.drag( type, fn )[0] == elem, '.drag('+( type ? '"'+ type +'",' : '' )+' fn )' ); - ok( data = $.data( elem, $.event.special.drag.datakey ), "drag data exists" ); - ok( $.data( elem, "events" ), "event data exists" ); - ok( $.data( elem, "events" )[ 'drag'+type ][0], '"drag'+ type +'" event handler added' ); - - ok( data.which == def.which, '"which" default stored' ); - ok( data.distance == def.distance, '"distance" default stored' ); - ok( data.not == def.not, '"not" default stored' ); - ok( data.handle == def.handle, '"handle" default stored' ); - ok( data.relative == def.relative, '"relative" default stored' ); - ok( data.drop == def.drop, '"drop" default stored' ); - ok( data.click == def.click, '"click" default stored' ); - - ok( $elem.drag( type )[0] == elem, '.drag('+( type ? '"'+ type +'"' : '' )+')' ); - ok( count == 1, "handler was triggered"); - - ok( $elem.unbind( "drag"+ type )[0] == elem, '.unbind("drag'+ type +'")' ); - ok( !$.data( elem, "events" ), "event data removed" ); - ok( !$.data( elem, $.event.special.drag.datakey ), "drag data removed" ); - - ok( $elem.drag( type, fn, opts )[0] == elem, '.drag('+( type ? '"'+ type +'",' : '' )+' fn, opts )' ); - ok( data = $.data( elem, $.event.special.drag.datakey ), "drag data exists" ); - ok( $.data( elem, "events" ), "event data exists" ); - ok( $.data( elem, "events" )[ 'drag'+type ][0], '"drag'+ type +'" event handler added' ); - - ok( data.which == opts.which, '"which" option stored' ); - ok( data.distance == opts.distance, '"distance" option stored' ); - ok( data.not == opts.not, '"not" option stored' ); - ok( data.handle == opts.handle, '"handle" option stored' ); - ok( data.relative == opts.relative, '"relative" option stored' ); - ok( data.drop == opts.drop, '"drop" option stored' ); - ok( data.click == opts.click, '"click" option stored' ); - - $elem.remove(); - - }); -});
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/properties.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/properties.js deleted file mode 100644 index aef28244..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/properties.js +++ /dev/null @@ -1,71 +0,0 @@ -module("Callback Properties"); - -$.each(["init","start","","end"],function( i, type ){ - - test('"drag'+ type +'" callback',function(){ - - expect( 13 ); - - // create the markup for the test - var $div = $('<div />') - .appendTo( document.body ), - // starting position - sx = Math.round( Math.random() * 90 ) + 5, - sy = Math.round( Math.random() * 90 ) + 5, - // mouse offset position - mx = Math.round( Math.random() * 90 ) + 5, - my = Math.round( Math.random() * 90 ) + 5, - // distance dragged - dx = Math.round( Math.random() * 90 ) + 5, - dy = Math.round( Math.random() * 90 ) + 5; - - $div - .drag( type, function( event, dd ){ - - ok( dd.target == $div[0], "target: [drag target]" ); - ok( dd.drag == $div[0], "drag: [drag target]" ); - ok( dd.proxy == $div[0], "proxy: [drag target]" ); - - equals( dd.startX, sx + mx, "startX" ); - equals( dd.startY, sy + my, "startY" ); - - equals( dd.deltaX, i ? dx : 0, "deltaX" ); - equals( dd.deltaY, i ? dy : 0, "deltaY" ); - - equals( dd.originalX, sx, "originalX" ); - equals( dd.originalY, sy, "originalY" ); - - equals( dd.offsetX, i ? sx + dx : sx, "offsetX" ); - equals( dd.offsetY, i ? sy + dy : sy, "offsetY" ); - - ok( dd.drop.constructor == Array && !dd.drop.length, "drop: []" ); - ok( dd.available.constructor == Array && !dd.available.length, "available: []" ); - - }) - .css({ - position: 'absolute', - top: sy, - left: sx, - height: 100, - width: 100 - }) - // simulate a drag - .fire("mousedown",{ - pageX: sx + mx, - pageY: sy + my - }) - .fire("mousemove",{ - pageX: sx + mx + dx, - pageY: sy + my + dy - }) - .fire("mouseup",{ - pageX: sx + mx + dx, - pageY: sy + my + dy - }) - .fire("click",{ - pageX: sx + mx + dx, - pageY: sy + my + dy - }); - $div.remove(); - }); -});
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/requirements.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/requirements.js deleted file mode 100644 index d9cf4172..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/requirements.js +++ /dev/null @@ -1,24 +0,0 @@ -module("Requirements"); - -test("jQuery",function(){ - - expect( 2 ); - - // make sure the right jquery is included - ok( window.jQuery, "jQuery exists" ); - ok( parseFloat( jQuery([]).jquery ) >= 1.4, "jQuery version is 1.4 or greater" ); - -}); - -test("Installation",function(){ - - expect( 5 ); - - // make sure the event interface is complete - ok( jQuery.event.special.draginit, '"draginit" special event is defined' ); - ok( jQuery.event.special.dragstart, '"dragstart" special event is defined' ); - ok( jQuery.event.special.drag, '"drag" special event is defined' ); - ok( jQuery.event.special.dragend, '"dragend" special event is defined' ); - ok( jQuery([]).drag, "$.fn.drag method is defined" ); - -});
\ No newline at end of file diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/touch.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/touch.js deleted file mode 100644 index 78279081..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drag/test/touch.js +++ /dev/null @@ -1,206 +0,0 @@ -;(function(){ - - module("Touch Interaction"); - - if ( !document.createEvent ){ - test("Touch Simulation Not Supported",function(){ - ok( true, 'This browser does not support "document.createEvent" and cannot simulate touch events.'); - }); - return; - } - - // a simple re-usable test harness object - var obj = { - init: function( opts ){ - obj.$div = $('<div />') - .css({ - position: 'absolute', - top: 0, - left: 0, - height: 100, - width: 100 - }) - .append('<div class="child" />') - .appendTo( document.body ) - .bind("draginit dragstart drag dragend click", opts || {}, function( event ){ - obj[ event.type ] += 1; - }); - $.extend( obj, { draginit:0, dragstart:0, drag:0, dragend:0, click:0 }); - }, - done: function(){ - obj.$div.remove(); - start(); - } - }; - - asyncTest("default",function(){ - expect( 5 ); - // prep DEFAULT interaction - obj.init(); - // simulate DEFAULT interaction - obj.$div - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 0, "click"); - // clean-up interaction - obj.done(); - }); - - asyncTest('"not" option',function(){ - expect( 10 ); - // prep interaction - obj.init({ not:'.child' }); - // simulate NOT interaction - obj.$div.children() - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 0, "draginit"); - equals( obj.dragstart, 0, "dragstart"); - equals( obj.drag, 0, "drag"); - equals( obj.dragend, 0, "dragend"); - equals( obj.click, 1, "click"); - // simlate NON NOT interaction - obj.$div - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - - asyncTest('"handle" option',function(){ - expect( 10 ); - // prep interaction - obj.init({ handle:'.child' }); - // simulate HANDLE interaction - obj.$div.children() - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 0, "click"); - // simulate NON HANDLE interaction - obj.$div - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - - asyncTest('"which" option',function(){ - expect( 11 ); - // prep interaction - obj.init({ which:0 }); - // simulate WHICH interaction - obj.$div - .fire("touchstart",{ pageX:50, pageY:50, button:5 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 0, "click"); - ok( true, '"which" not supported with touch events...'); - // simulate NON WHICH interaction - obj.$div - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 2, "draginit"); - equals( obj.dragstart, 2, "dragstart"); - equals( obj.drag, 2, "drag"); - equals( obj.dragend, 2, "dragend"); - equals( obj.click, 0, "click"); - // clean-up interaction - obj.done(); - }); - - asyncTest('"distance" option',function(){ - expect( 10 ); - // prep interaction - obj.init({ distance:5 }); - // simulate NON DISTANCE interaction - obj.$div - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 0, "dragstart"); - equals( obj.drag, 0, "drag"); - equals( obj.dragend, 0, "dragend"); - equals( obj.click, 1, "click"); - // simulate DISTANCE interaction - obj.$div - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:53, pageY:54 }) - .fire("touchend",{ pageX:53, pageY:54 }) - .fire("click"); - // inspect results - equals( obj.draginit, 2, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - - - asyncTest('"click" option',function(){ - expect( 5 ); - // prep interaction - obj.init({ click:true }); - // simulate CLICK interaction - obj.$div - .fire("touchstart",{ pageX:50, pageY:50 }) - .fire("touchmove",{ pageX:51, pageY:51 }) - .fire("touchend",{ pageX:51, pageY:51 }) - .fire("click"); - // inspect results - equals( obj.draginit, 1, "draginit"); - equals( obj.dragstart, 1, "dragstart"); - equals( obj.drag, 1, "drag"); - equals( obj.dragend, 1, "dragend"); - equals( obj.click, 1, "click"); - // clean-up interaction - obj.done(); - }); - -})();
\ No newline at end of file |