mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-06-07 00:47:00 +03:00
Remove broken jquery-ui
This commit is contained in:
parent
39aa35f2aa
commit
d3488a963e
718 changed files with 10 additions and 518340 deletions
|
@ -1,26 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery UI Droppable Test Suite</title>
|
||||
|
||||
<script src="../../../external/jquery/jquery.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="../../../external/qunit/qunit.css">
|
||||
<link rel="stylesheet" href="../../../external/qunit-composite/qunit-composite.css">
|
||||
<script src="../../../external/qunit/qunit.js"></script>
|
||||
<script src="../../../external/qunit-composite/qunit-composite.js"></script>
|
||||
<script src="../subsuite.js"></script>
|
||||
|
||||
<script>
|
||||
testAllVersions( "droppable" );
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,28 +0,0 @@
|
|||
define( [
|
||||
"lib/common",
|
||||
"ui/widgets/droppable"
|
||||
], function( common ) {
|
||||
|
||||
common.testWidget( "droppable", {
|
||||
defaults: {
|
||||
accept: "*",
|
||||
activeClass: false,
|
||||
addClasses: true,
|
||||
classes: {},
|
||||
disabled: false,
|
||||
greedy: false,
|
||||
hoverClass: false,
|
||||
scope: "default",
|
||||
tolerance: "intersect",
|
||||
|
||||
// Callbacks
|
||||
activate: null,
|
||||
create: null,
|
||||
deactivate: null,
|
||||
drop: null,
|
||||
out: null,
|
||||
over: null
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
26
jquery-ui/tests/unit/droppable/common.js
vendored
26
jquery-ui/tests/unit/droppable/common.js
vendored
|
@ -1,26 +0,0 @@
|
|||
define( [
|
||||
"lib/common",
|
||||
"ui/widgets/droppable"
|
||||
], function( common ) {
|
||||
|
||||
common.testWidget( "droppable", {
|
||||
defaults: {
|
||||
accept: "*",
|
||||
addClasses: true,
|
||||
classes: {},
|
||||
disabled: false,
|
||||
greedy: false,
|
||||
scope: "default",
|
||||
tolerance: "intersect",
|
||||
|
||||
// Callbacks
|
||||
activate: null,
|
||||
create: null,
|
||||
deactivate: null,
|
||||
drop: null,
|
||||
out: null,
|
||||
over: null
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
30
jquery-ui/tests/unit/droppable/core.js
vendored
30
jquery-ui/tests/unit/droppable/core.js
vendored
|
@ -1,30 +0,0 @@
|
|||
define( [
|
||||
"qunit",
|
||||
"jquery",
|
||||
"./helper",
|
||||
"ui/widgets/droppable"
|
||||
], function( QUnit, $, testHelper ) {
|
||||
|
||||
QUnit.module( "droppable: core" );
|
||||
|
||||
QUnit.test( "element types", function( assert ) {
|
||||
var typeNames = ( "p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form" +
|
||||
",table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr" +
|
||||
",acronym,code,samp,kbd,var,img,hr" +
|
||||
",input,button,label,select,iframe" ).split( "," );
|
||||
|
||||
assert.expect( typeNames.length );
|
||||
|
||||
$.each( typeNames, function( i ) {
|
||||
var typeName = typeNames[ i ],
|
||||
el = $( document.createElement( typeName ) ).appendTo( "body" );
|
||||
|
||||
( typeName === "table" && el.append( "<tr><td>content</td></tr>" ) );
|
||||
el.droppable();
|
||||
testHelper.shouldDrop( assert );
|
||||
el.droppable( "destroy" );
|
||||
el.remove();
|
||||
} );
|
||||
} );
|
||||
|
||||
} );
|
|
@ -1,23 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery UI Droppable Test Suite</title>
|
||||
|
||||
<script src="../../../external/requirejs/require.js"></script>
|
||||
<script src="../../lib/css.js" data-modules="core"></script>
|
||||
<script src="../../lib/bootstrap.js" data-widget="droppable" data-deprecated="true"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture">
|
||||
|
||||
<div id="draggable1" style="width: 25px; height: 25px;">Draggable</div>
|
||||
<div id="droppable1" style="width: 100px; height: 100px;">Droppable</div>
|
||||
<div id="droppable2" style="width: 100px; height: 100px;">Droppable</div>
|
||||
<div style='width:1000px;height:1000px;'> </div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
jquery-ui/tests/unit/droppable/deprecated.js
vendored
1
jquery-ui/tests/unit/droppable/deprecated.js
vendored
|
@ -1 +0,0 @@
|
|||
define( function() {} );
|
|
@ -1,24 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery UI Droppable Test Suite</title>
|
||||
|
||||
<script src="../../../external/requirejs/require.js"></script>
|
||||
<script src="../../lib/css.js" data-modules="core"></script>
|
||||
<script src="../../lib/bootstrap.js" data-widget="droppable"
|
||||
data-no-back-compat="true"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture">
|
||||
|
||||
<div id="draggable1" style="width: 25px; height: 25px;">Draggable</div>
|
||||
<div id="droppable1" style="width: 100px; height: 100px;">Droppable</div>
|
||||
<div id="droppable2" style="width: 100px; height: 100px;">Droppable</div>
|
||||
<div style='width:1000px;height:1000px;'> </div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
65
jquery-ui/tests/unit/droppable/events.js
vendored
65
jquery-ui/tests/unit/droppable/events.js
vendored
|
@ -1,65 +0,0 @@
|
|||
define( [
|
||||
"qunit",
|
||||
"jquery",
|
||||
"ui/widgets/droppable"
|
||||
], function( QUnit, $ ) {
|
||||
|
||||
QUnit.module( "droppable: events" );
|
||||
|
||||
QUnit.test( "droppable destruction/recreation on drop event", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var config = {
|
||||
activeClass: "active",
|
||||
drop: function() {
|
||||
var element = $( this ),
|
||||
newDroppable = $( "<div>" )
|
||||
.css( { width: 100, height: 100 } )
|
||||
.text( "Droppable" );
|
||||
element.after( newDroppable );
|
||||
element.remove();
|
||||
newDroppable.droppable( config );
|
||||
}
|
||||
},
|
||||
|
||||
draggable = $( "#draggable1" ).draggable(),
|
||||
droppable1 = $( "#droppable1" ).droppable( config ),
|
||||
droppable2 = $( "#droppable2" ).droppable( config ),
|
||||
|
||||
droppableOffset = droppable1.offset(),
|
||||
draggableOffset = draggable.offset(),
|
||||
dx = droppableOffset.left - draggableOffset.left,
|
||||
dy = droppableOffset.top - draggableOffset.top;
|
||||
|
||||
draggable.simulate( "drag", {
|
||||
dx: dx,
|
||||
dy: dy
|
||||
} );
|
||||
|
||||
assert.lacksClasses( droppable2, "active", "subsequent droppable no longer active" );
|
||||
} );
|
||||
|
||||
// Todo: comment the following in when ready to actually test
|
||||
/*
|
||||
Test("activate", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test("deactivate", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test("over", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test("out", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test("drop", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
*/
|
||||
|
||||
} );
|
21
jquery-ui/tests/unit/droppable/helper.js
vendored
21
jquery-ui/tests/unit/droppable/helper.js
vendored
|
@ -1,21 +0,0 @@
|
|||
define( [
|
||||
"qunit",
|
||||
"jquery",
|
||||
"lib/helper"
|
||||
], function( QUnit, $, helper ) {
|
||||
|
||||
return $.extend( helper, {
|
||||
shouldDrop: function( assert ) {
|
||||
|
||||
// Todo: actually implement this
|
||||
assert.ok( true, "missing test - untested code is broken code" );
|
||||
},
|
||||
|
||||
shouldNotDrop: function( assert ) {
|
||||
|
||||
// Todo: actually implement this
|
||||
assert.ok( true, "missing test - untested code is broken code" );
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
93
jquery-ui/tests/unit/droppable/methods.js
vendored
93
jquery-ui/tests/unit/droppable/methods.js
vendored
|
@ -1,93 +0,0 @@
|
|||
define( [
|
||||
"qunit",
|
||||
"jquery",
|
||||
"./helper",
|
||||
"ui/widgets/droppable"
|
||||
], function( QUnit, $, testHelper ) {
|
||||
|
||||
QUnit.module( "droppable: methods" );
|
||||
|
||||
QUnit.test( "init", function( assert ) {
|
||||
assert.expect( 5 );
|
||||
|
||||
$( "<div></div>" ).appendTo( "body" ).droppable().remove();
|
||||
assert.ok( true, ".droppable() called on element" );
|
||||
|
||||
$( [] ).droppable();
|
||||
assert.ok( true, ".droppable() called on empty collection" );
|
||||
|
||||
$( "<div></div>" ).droppable();
|
||||
assert.ok( true, ".droppable() called on disconnected DOMElement" );
|
||||
|
||||
$( "<div></div>" ).droppable().droppable( "option", "foo" );
|
||||
assert.ok( true, "arbitrary option getter after init" );
|
||||
|
||||
$( "<div></div>" ).droppable().droppable( "option", "foo", "bar" );
|
||||
assert.ok( true, "arbitrary option setter after init" );
|
||||
} );
|
||||
|
||||
QUnit.test( "destroy", function( assert ) {
|
||||
assert.expect( 4 );
|
||||
|
||||
$( "<div></div>" ).appendTo( "body" ).droppable().droppable( "destroy" ).remove();
|
||||
assert.ok( true, ".droppable('destroy') called on element" );
|
||||
|
||||
$( [] ).droppable().droppable( "destroy" );
|
||||
assert.ok( true, ".droppable('destroy') called on empty collection" );
|
||||
|
||||
$( "<div></div>" ).droppable().droppable( "destroy" );
|
||||
assert.ok( true, ".droppable('destroy') called on disconnected DOMElement" );
|
||||
|
||||
var expected = $( "<div></div>" ).droppable(),
|
||||
actual = expected.droppable( "destroy" );
|
||||
assert.equal( actual, expected, "destroy is chainable" );
|
||||
} );
|
||||
|
||||
QUnit.test( "enable", function( assert ) {
|
||||
assert.expect( 7 );
|
||||
|
||||
var el, expected, actual;
|
||||
|
||||
el = $( "#droppable1" ).droppable( { disabled: true } );
|
||||
testHelper.shouldNotDrop( assert );
|
||||
el.droppable( "enable" );
|
||||
testHelper.shouldDrop( assert );
|
||||
assert.equal( el.droppable( "option", "disabled" ), false, "disabled option getter" );
|
||||
el.droppable( "destroy" );
|
||||
el.droppable( { disabled: true } );
|
||||
testHelper.shouldNotDrop( assert );
|
||||
el.droppable( "option", "disabled", false );
|
||||
assert.equal( el.droppable( "option", "disabled" ), false, "disabled option setter" );
|
||||
testHelper.shouldDrop( assert );
|
||||
|
||||
expected = $( "<div></div>" ).droppable(),
|
||||
actual = expected.droppable( "enable" );
|
||||
assert.equal( actual, expected, "enable is chainable" );
|
||||
} );
|
||||
|
||||
QUnit.test( "disable", function( assert ) {
|
||||
assert.expect( 10 );
|
||||
|
||||
var actual, expected,
|
||||
element = $( "#droppable1" ).droppable( { disabled: false } );
|
||||
|
||||
testHelper.shouldDrop( assert );
|
||||
element.droppable( "disable" );
|
||||
testHelper.shouldNotDrop( assert );
|
||||
assert.equal( element.droppable( "option", "disabled" ), true, "disabled option getter" );
|
||||
element.droppable( "destroy" );
|
||||
element.droppable( { disabled: false } );
|
||||
testHelper.shouldDrop( assert );
|
||||
element.droppable( "option", "disabled", true );
|
||||
assert.lacksClasses( element.droppable( "widget" ), "ui-state-disabled" );
|
||||
assert.ok( !element.droppable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" );
|
||||
assert.hasClasses( element.droppable( "widget" ), "ui-droppable-disabled" );
|
||||
assert.equal( element.droppable( "option", "disabled" ), true, "disabled option setter" );
|
||||
testHelper.shouldNotDrop( assert );
|
||||
|
||||
expected = $( "<div></div>" ).droppable();
|
||||
actual = expected.droppable( "disable" );
|
||||
assert.equal( actual, expected, "disable is chainable" );
|
||||
} );
|
||||
|
||||
} );
|
206
jquery-ui/tests/unit/droppable/options.js
vendored
206
jquery-ui/tests/unit/droppable/options.js
vendored
|
@ -1,206 +0,0 @@
|
|||
define( [
|
||||
"qunit",
|
||||
"jquery",
|
||||
"ui/widgets/droppable"
|
||||
], function( QUnit, $ ) {
|
||||
|
||||
QUnit.module( "droppable: options" );
|
||||
|
||||
/*
|
||||
Test( "{ accept '*' }, default ", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test( "{ accept: Selector }", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test( "{ accept: function(draggable) }", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test( "activeClass", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
*/
|
||||
QUnit.test( "{ addClasses: true }, default", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
var el = $( "<div />" ).droppable( { addClasses: true } );
|
||||
assert.hasClasses( el, "ui-droppable" );
|
||||
el.droppable( "destroy" );
|
||||
} );
|
||||
|
||||
QUnit.test( "{ addClasses: false }", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
var el = $( "<div />" ).droppable( { addClasses: false } );
|
||||
|
||||
assert.lacksClasses( el, "ui-droppable" );
|
||||
el.droppable( "destroy" );
|
||||
} );
|
||||
|
||||
QUnit.test( "scope", function( assert ) {
|
||||
assert.expect( 4 );
|
||||
var droppableOffset, draggableOffset, oldDraggableOffset, dx, dy,
|
||||
draggable1 = $( "<div />" ).appendTo( "#qunit-fixture" ).draggable( { revert: "invalid" } ),
|
||||
draggable2 = $( "<div />" ).appendTo( "#qunit-fixture" ).droppable(),
|
||||
droppable = $( "<div />" ).appendTo( "#qunit-fixture" ).droppable(),
|
||||
newScope = "test";
|
||||
|
||||
draggable1.draggable( "option", "scope", newScope );
|
||||
droppable.droppable( "option", "scope", newScope );
|
||||
|
||||
// Test that droppable accepts draggable with new scope.
|
||||
droppableOffset = droppable.offset();
|
||||
draggableOffset = draggable1.offset();
|
||||
dx = droppableOffset.left - draggableOffset.left;
|
||||
dy = droppableOffset.top - draggableOffset.top;
|
||||
|
||||
draggable1.simulate( "drag", {
|
||||
dx: dx,
|
||||
dy: dy
|
||||
} );
|
||||
|
||||
draggableOffset = draggable1.offset();
|
||||
assert.equal( draggableOffset.left, droppableOffset.left );
|
||||
assert.equal( draggableOffset.top, droppableOffset.top );
|
||||
|
||||
// Test that droppable doesn't accept draggable with old scope.
|
||||
draggableOffset = draggable2.offset();
|
||||
dx = droppableOffset.left - draggableOffset.left;
|
||||
dy = droppableOffset.top - draggableOffset.top;
|
||||
oldDraggableOffset = draggableOffset;
|
||||
|
||||
draggable2.simulate( "drag", {
|
||||
dx: dx,
|
||||
dy: dy
|
||||
} );
|
||||
|
||||
draggableOffset = draggable2.offset();
|
||||
assert.equal( draggableOffset.left, oldDraggableOffset.left );
|
||||
assert.equal( draggableOffset.top, oldDraggableOffset.top );
|
||||
} );
|
||||
/*
|
||||
Test( "greedy", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test( "hoverClass", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
|
||||
test( "tolerance, fit", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
*/
|
||||
|
||||
QUnit.test( "tolerance, intersect", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var draggable, droppable,
|
||||
dataset = [
|
||||
[ 0, 0, false, "too far up and left" ],
|
||||
[ 6, 0, false, "too far up" ],
|
||||
[ 0, 6, false, "too far left" ],
|
||||
[ 6, 6, true, "top left corner" ],
|
||||
[ 14, 14, true, "bottom right corner" ],
|
||||
[ 15, 6, false, "too far right" ],
|
||||
[ 6, 15, false, "too far down" ],
|
||||
[ 15, 15, false, "too far down and right" ]
|
||||
];
|
||||
|
||||
draggable = $( "<div />" )
|
||||
.appendTo( "#qunit-fixture" )
|
||||
.css( {
|
||||
width: 10,
|
||||
height: 10,
|
||||
position: "absolute",
|
||||
|
||||
// Http://bugs.jqueryui.com/ticket/6876
|
||||
// Droppable: droppable region is offset by draggables margin
|
||||
marginTop: 3,
|
||||
marginLeft: 3
|
||||
} )
|
||||
.draggable();
|
||||
|
||||
droppable = $( "<div />" )
|
||||
.appendTo( "#qunit-fixture" )
|
||||
.css( { width: 10, height: 10, position: "absolute", top: 13, left: 13 } )
|
||||
.droppable( { tolerance: "intersect" } );
|
||||
|
||||
$.each( dataset, function() {
|
||||
var data = this;
|
||||
|
||||
draggable.css( {
|
||||
top: 0,
|
||||
left: 0
|
||||
} );
|
||||
|
||||
droppable.off( "drop" ).on( "drop", function() {
|
||||
assert.equal( true, data[ 2 ], data[ 3 ] );
|
||||
} );
|
||||
|
||||
$( draggable ).simulate( "drag", {
|
||||
dx: data[ 0 ],
|
||||
dy: data[ 1 ]
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
QUnit.test( "tolerance, pointer", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var draggable, droppable,
|
||||
dataset = [
|
||||
[ -1, -1, false, "too far up and left" ],
|
||||
[ -1, 0, false, "too far left" ],
|
||||
[ 0, -1, false, "too far up" ],
|
||||
[ 0, 0, true, "top left corner" ],
|
||||
[ 9, 9, true, "bottom right corner" ],
|
||||
[ 10, 9, false, "too far right" ],
|
||||
[ 9, 10, false, "too far down" ],
|
||||
[ 10, 10, false, "too far down and right" ]
|
||||
];
|
||||
|
||||
draggable = $( "<div />" )
|
||||
.appendTo( "#qunit-fixture" )
|
||||
.css( { width: 10, height: 10, position: "absolute" } )
|
||||
.draggable();
|
||||
|
||||
droppable = $( "<div />" )
|
||||
.appendTo( "#qunit-fixture" )
|
||||
.css( { width: 10, height: 10, position: "absolute", top: 5, left: 5 } )
|
||||
.droppable( { tolerance: "pointer" } );
|
||||
|
||||
$.each( dataset, function() {
|
||||
var data = this;
|
||||
|
||||
droppable.off( "drop" ).on( "drop", function() {
|
||||
assert.equal( true, data[ 2 ], data[ 3 ] );
|
||||
} );
|
||||
|
||||
$( draggable ).simulate( "drag", {
|
||||
dx: ( data[ 0 ] - $( draggable ).position().left ),
|
||||
dy: ( data[ 1 ] - $( draggable ).position().top )
|
||||
} );
|
||||
} );
|
||||
|
||||
// Http://bugs.jqueryui.com/ticket/4977 - tolerance, pointer - bug when pointer outside draggable
|
||||
draggable.css( { top: 0, left: 0 } ).draggable( "option", "axis", "x" );
|
||||
droppable.css( { top: 15, left: 15 } );
|
||||
|
||||
droppable.off( "drop" ).on( "drop", function() {
|
||||
assert.ok( true, "drop fires as long as pointer is within droppable" );
|
||||
} );
|
||||
|
||||
$( draggable ).simulate( "drag", {
|
||||
dx: 10,
|
||||
dy: 10
|
||||
} );
|
||||
} );
|
||||
|
||||
/*
|
||||
Test( "tolerance, touch", function() {
|
||||
ok(false, 'missing test - untested code is broken code');
|
||||
});
|
||||
*/
|
||||
} );
|
Loading…
Add table
Add a link
Reference in a new issue