From b54df0ddd0c6a0372327c5aa3668e5a6458fcd64 Mon Sep 17 00:00:00 2001 From: st782s Date: Thu, 4 May 2017 07:48:42 -0400 Subject: [PORTAL-7] Rebase This rebasing includes common libraries and common overlays projects abstraction of components Change-Id: I9a24a338665c7cd058978e8636bc412d9e2fdce8 Signed-off-by: st782s --- .../event.drop/test/tolerance.js | 189 --------------------- 1 file changed, 189 deletions(-) delete mode 100644 ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/tolerance.js (limited to 'ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/tolerance.js') diff --git a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/tolerance.js b/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/tolerance.js deleted file mode 100644 index 4bdaf6e5..00000000 --- a/ecomp-portal-FE/client/bower_components/jquery.event.drag-new/event.drop/test/tolerance.js +++ /dev/null @@ -1,189 +0,0 @@ -;(function(){ - - module("Tolerance Mode"); - - // re-usable test harness object - var obj = { - init: function( opts ){ - // the drop element - obj.$drop = $('
') - .css({ - position: 'absolute', - top: 200, - left: 200, - height: 100, - width: 100 - }) - .appendTo( document.body ) - .bind("dropinit",function( event ){ - if ( obj.multidrop ) - return $( this ) - .clone( true ) - .addClass('clone') - .appendTo( document.body ) - .add( this ); - }) - .bind("drop",function( event ){ - obj.count += 1; - }); - // the drag element - obj.$drag = $('
') - .css({ - position: 'absolute', - top: 100, - left: 100, - height: 100, - width: 100 - }) - .appendTo( document.body ) - .bind("draginit", function( event ){ - if ( obj.multidrag ) - return $( this ) - .clone( true ) - .addClass('clone') - .appendTo( document.body ) - .add( this ); - }) - .bind("dragstart",function( ev, dd ){ - if ( obj.proxy ) - return $( this ).clone() - .addClass('clone') - .appendTo( document.body ); - }) - .bind("drag",function( ev, dd ){ - if ( obj.move ) - $( dd.proxy ).css({ - top: dd.offsetY, - left: dd.offsetX - }); - }) - .bind("dragend",function( ev, dd ){ - var $div = $( this ).css({ - top: 100, - left: 100 - }); - $( document.body ).find('.clone').remove(); - }); - // reset test vars - obj.count = 0; - obj.move = obj.proxy = obj.multidrag = obj.multidrop = null; - }, - done: function(){ - obj.$drag.remove(); - obj.$drop.remove(); - start(); - } - }; - - // async iterator - function asyncEach( obj, func, after ){ - // local refs - var arr = [], i = 0, len; - // translate into a secondary array - $.each( obj, function( index, value ){ - len = arr.push({ that:this, index:index, value:value }); - }); - function next(){ - var data = arr[ i++ ], ret; - if ( i <= len ){ - if ( data ) - ret = func.call( data.that, data.index, data.value, next ); - if ( ret === false ) - done(); - } - else done(); - }; - function done(){ - if ( after ) - after(); - }; - next(); - } - - // test each mode... - $.each({ - 'mouse':{ - 'overlap':[0,0,0,0,0], - 'middle':[0,0,0,0,0], - 'fit':[0,0,0,0,0], - 'mouse':[1,1,1,2,4], - 'away':[0,0,0,0,0] - }, - 'overlap':{ - 'overlap':[0,1,1,2,4], - 'middle':[0,1,1,2,4], - 'fit':[0,1,1,2,4], - 'mouse':[0,0,0,0,0], - 'away':[0,0,0,0,0] - }, - 'middle':{ - 'overlap':[0,0,0,0,0], - 'middle':[0,1,1,2,4], - 'fit':[0,1,1,2,4], - 'mouse':[0,0,0,0,0], - 'away':[0,0,0,0,0] - }, - 'fit':{ - 'overlap':[0,0,0,0,0], - 'middle':[0,0,0,0,0], - 'fit':[0,1,1,2,4], - 'mouse':[0,0,0,0,0], - 'away':[0,0,0,0,0] - }, - 'intersect':{ - 'overlap':[0,1,1,2,4], - 'middle':[0,1,1,2,4], - 'fit':[0,1,1,2,4], - 'mouse':[1,1,1,2,4], - 'away':[0,0,0,0,0] - } - }, function( mode, expected ){ - - // test each mode - asyncTest('"'+ mode +'"',function(){ - - expect( 25 ); - - // test prep - obj.init(); - $.drop({ - mode:mode, - multi:true - }); - // drag to each position - asyncEach({ - 'overlap':{ pageX:33, pageY:33 }, - 'middle':{ pageX:66, pageY:66 }, - 'fit':{ pageX:100, pageY:100 }, - 'mouse':{ pageX:250, pageY:250 }, - 'away':{ pageX:-1, pageY:-1 } - }, function( where, coord, next ){ - // execute interaction variants - asyncEach([ - 'dropped '+ where +' (no motion)', - 'dropped '+ where +' (drag motion)', - 'dropped '+ where +' (proxy motion)', - 'dropped '+ where +' (multi drag)', - 'dropped '+ where +' (multi drop)' - ], function( i, msg, next ){ - // set-up - obj.count = 0; - obj.move = ( i > 0 ); - obj.proxy = ( i > 1 ); - obj.multidrag = ( i > 2 ); - obj.multidrop = ( i > 3 ); - // simulate a partial drag - obj.$drag - .fire("mousedown",{ pageX:0, pageY:0 }) - .fire("mousemove", coord ) - .fire("mouseup", coord ) - .fire("click", coord ); - equals( obj.count, expected[where][i], msg ); - next(); - }, next ); - }, obj.done ); - }); - - }); - -})(); \ No newline at end of file -- cgit 1.2.3-korg