aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/accordion.html8
-rw-r--r--tests/accordion.js2
-rw-r--r--tests/all.html6
-rw-r--r--tests/all_2.html6
-rw-r--r--tests/core.html8
-rw-r--r--tests/core.js20
-rw-r--r--tests/datepicker.html4
-rw-r--r--tests/dialog.html8
-rw-r--r--tests/dialog.js138
-rw-r--r--tests/draggable.html8
-rw-r--r--tests/draggable.js110
-rw-r--r--tests/droppable.html4
-rw-r--r--tests/droppable.js2
-rw-r--r--tests/progressbar.html8
-rw-r--r--tests/progressbar.js2
-rw-r--r--tests/resizable.html6
-rw-r--r--tests/resizable.js62
-rw-r--r--tests/selectable.html8
-rw-r--r--tests/simulate/jquery.simulate.js14
-rw-r--r--tests/slider.html8
-rw-r--r--tests/slider.js18
-rw-r--r--tests/sortable.html8
-rw-r--r--tests/sortable.js8
-rw-r--r--tests/spinner.html8
-rw-r--r--tests/spinner.js14
-rw-r--r--tests/tabs.html4
-rw-r--r--tests/tabs.js74
-rw-r--r--tests/ui.html8
-rw-r--r--tests/visual/effects.all.html46
-rw-r--r--tests/visual/effects.all.js40
-rw-r--r--tests/visual/sortable_massive_scale.html4
-rw-r--r--tests/visual/spinner.html6
-rw-r--r--tests/visual/tree.html2
33 files changed, 336 insertions, 336 deletions
diff --git a/tests/accordion.html b/tests/accordion.html
index 2f9d2ca17..569a5d6d3 100644
--- a/tests/accordion.html
+++ b/tests/accordion.html
@@ -2,13 +2,13 @@
<html lang="en">
<head>
<title>jQuery UI Accordion Test Suite</title>
-
+
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.accordion.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
@@ -109,7 +109,7 @@
Cool kids are blue.
</dd>
</dl>
-
+
<div id="list3">
<div>
<div class="title">Tennis</div>
@@ -134,7 +134,7 @@
</div>
</div>
</div>
-
+
</div>
</body>
diff --git a/tests/accordion.js b/tests/accordion.js
index 6ede9bc06..5ac24fd9d 100644
--- a/tests/accordion.js
+++ b/tests/accordion.js
@@ -133,7 +133,7 @@ test("accessibility", function () {
expect(9);
var ac = $('#list1').accordion().accordion("activate", 1);
var headers = $(".ui-accordion-header");
-
+
equals( headers.eq(1).attr("tabindex"), "0", "active header should have tabindex=0");
equals( headers.eq(0).attr("tabindex"), "-1", "inactive header should have tabindex=-1");
equals( ac.attr("role"), "tablist", "main role");
diff --git a/tests/all.html b/tests/all.html
index f12089682..fb80ad8c1 100644
--- a/tests/all.html
+++ b/tests/all.html
@@ -18,7 +18,7 @@
<script type="text/javascript" src="../ui/ui.sortable.js"></script>
<script type="text/javascript" src="../ui/ui.spinner.js"></script>
<script type="text/javascript" src="../ui/ui.tabs.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
<script type="text/javascript" src="plugins/cookie/jquery.cookie.js"></script>
@@ -152,7 +152,7 @@
Cool kids are blue.
</dd>
</dl>
-
+
<div id="list3">
<div>
<div class="title">Tennis</div>
@@ -222,7 +222,7 @@
<div id="colon:test"></div>
<div style="height: 300px;" id="inline-style"></div>
</div>
-
+
</div>
</body>
</html> \ No newline at end of file
diff --git a/tests/all_2.html b/tests/all_2.html
index 5a55a324c..2c2a24adf 100644
--- a/tests/all_2.html
+++ b/tests/all_2.html
@@ -33,10 +33,10 @@
}
}
-
+
});
-
+
</script>
<script type="text/javascript" src="../ui/ui.accordion.js"></script>
@@ -51,7 +51,7 @@
<script type="text/javascript" src="../ui/ui.sortable.js"></script>
<script type="text/javascript" src="../ui/ui.spinner.js"></script>
<script type="text/javascript" src="../ui/ui.tabs.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
<script type="text/javascript" src="plugins/cookie/jquery.cookie.js"></script>
diff --git a/tests/core.html b/tests/core.html
index 5da16011a..edb61fda1 100644
--- a/tests/core.html
+++ b/tests/core.html
@@ -2,16 +2,16 @@
<html lang="en">
<head>
<title>jQuery UI Core Test Suite</title>
-
+
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
<!--link rel="stylesheet" href="../themes/flora/flora.dialog.css" type="text/css" media="screen"-->
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="core.js"></script>
-
+
<style type="text/css">
html { border: 0; }
</style>
diff --git a/tests/core.js b/tests/core.js
index 0836fb588..4be475486 100644
--- a/tests/core.js
+++ b/tests/core.js
@@ -7,7 +7,7 @@ module("selectors");
test("tabbable - enabled elements", function() {
expect(10);
-
+
ok( $('#input1-1').is(':tabbable'), 'input, no type');
ok( $('#input1-2').is(':tabbable'), 'input, type text');
ok( $('#input1-3').is(':tabbable'), 'input, type checkbox');
@@ -22,7 +22,7 @@ test("tabbable - enabled elements", function() {
test("tabbable - disabled elements", function() {
expect(8);
-
+
ok(!$('#input2-1').is(':tabbable'), 'input, no type');
ok(!$('#input2-2').is(':tabbable'), 'input, type text');
ok(!$('#input2-3').is(':tabbable'), 'input, type checkbox');
@@ -35,7 +35,7 @@ test("tabbable - disabled elements", function() {
test("tabbable - hidden styles", function() {
expect(6);
-
+
ok(!$('#input3-1').is(':tabbable'), 'input, hidden wrapper - display: none');
ok(!$('#anchor3-1').is(':tabbable'), 'anchor, hidden wrapper - display: none');
ok(!$('#input3-2').is(':tabbable'), 'input, hidden wrapper - visibility: hidden');
@@ -46,7 +46,7 @@ test("tabbable - hidden styles", function() {
test("tabbable - tabindex", function() {
expect(4);
-
+
ok( $('#input4-1').is(':tabbable'), 'input, tabindex 0');
ok( $('#input4-2').is(':tabbable'), 'input, tabindex 10');
ok(!$('#input4-3').is(':tabbable'), 'input, tabindex -1');
@@ -57,20 +57,20 @@ module('jQuery extensions');
test("attr - aria", function() {
expect(6);
-
+
var el = $('#aria');
-
+
ok(!el.attr('role'), 'role is empty via attr');
equals(el.attr('role', 'tablist').attr('role'), 'tablist', 'role is tablist');
-
+
equals(el.attr('aria-expanded'), undefined, 'aria expanded is undefined');
-
+
el.attr('aria-expanded', true);
equals(el.attr('aria-expanded'), 'true', 'aria expanded is true');
-
+
el.removeAttr('aria-expanded');
equals(el.attr('aria-expanded'), undefined, 'aria expanded is undefined after removing');
-
+
el.attr('aria-expanded', false);
equals(el.attr('aria-expanded'), 'false', 'aria expanded is false');
});
diff --git a/tests/datepicker.html b/tests/datepicker.html
index 4ace4ad17..8d927147e 100644
--- a/tests/datepicker.html
+++ b/tests/datepicker.html
@@ -2,7 +2,7 @@
<html lang="en">
<head>
<title>jQuery UI Datepicker Test Suite</title>
-
+
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
@@ -10,7 +10,7 @@
<script type="text/javascript" src="../ui/ui.datepicker.js"></script>
<script type="text/javascript" src="../ui/i18n/ui.datepicker-fr.js"></script>
<script type="text/javascript" src="../ui/i18n/ui.datepicker-he.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
diff --git a/tests/dialog.html b/tests/dialog.html
index 503485038..8d3ac1935 100644
--- a/tests/dialog.html
+++ b/tests/dialog.html
@@ -5,18 +5,18 @@
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
<!--link rel="stylesheet" href="../themes/flora/flora.dialog.css" type="text/css" media="screen"-->
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.dialog.js"></script>
<script type="text/javascript" src="../ui/ui.draggable.js"></script>
<script type="text/javascript" src="../ui/ui.resizable.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="dialog.js"></script>
-
+
<style type="text/css">
html { border: 0; }
</style>
diff --git a/tests/dialog.js b/tests/dialog.js
index 8c68ae6e2..c12266781 100644
--- a/tests/dialog.js
+++ b/tests/dialog.js
@@ -114,24 +114,24 @@ module("dialog");
test("init", function() {
expect(6);
-
+
$("<div></div>").appendTo('body').dialog().remove();
ok(true, '.dialog() called on element');
-
+
$([]).dialog().remove();
ok(true, '.dialog() called on empty collection');
-
+
$('<div></div>').dialog().remove();
ok(true, '.dialog() called on disconnected DOMElement');
-
+
$('<div></div>').dialog().dialog("foo").remove();
ok(true, 'arbitrary method called after init');
-
+
el = $('<div></div>').dialog();
var foo = el.data("foo.dialog");
el.remove();
ok(true, 'arbitrary option getter after init');
-
+
$('<div></div>').dialog().data("foo.dialog", "bar").remove();
ok(true, 'arbitrary option setter after init');
});
@@ -193,22 +193,22 @@ test("defaults", function() {
test("title id", function() {
expect(3);
-
+
var titleId;
-
+
// reset the uuid so we know what values to expect
$.ui.dialog.uuid = 0;
-
+
el = $('<div></div>').dialog();
titleId = dlg().find('.ui-dialog-title').attr('id');
equals(titleId, 'ui-dialog-title-1', 'auto-numbered title id');
el.remove();
-
+
el = $('<div></div>').dialog();
titleId = dlg().find('.ui-dialog-title').attr('id');
equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id');
el.remove();
-
+
el = $('<div id="foo"/>').dialog();
titleId = dlg().find('.ui-dialog-title').attr('id');
equals(titleId, 'ui-dialog-title-foo', 'carried over title id');
@@ -219,11 +219,11 @@ module("dialog: Options");
test("autoOpen", function() {
expect(2);
-
+
el = $('<div></div>').dialog({ autoOpen: false });
isNotOpen('.dialog({ autoOpen: false })');
el.remove();
-
+
el = $('<div></div>').dialog({ autoOpen: true });
isOpen('.dialog({ autoOpen: true })');
el.remove();
@@ -231,12 +231,12 @@ test("autoOpen", function() {
test("autoResize", function() {
expect(2);
-
+
var actual,
before,
expected,
handle;
-
+
el = $('<div>content<br>content<br>content<br>content<br>content</div>').dialog({ autoResize: false });
expected = { height: el.height() };
handle = $(".ui-resizable-se", dlg());
@@ -256,7 +256,7 @@ test("autoResize", function() {
test("buttons", function() {
expect(17);
-
+
var buttons = {
"Ok": function(ev, ui) {
ok(true, "button click fires callback");
@@ -269,20 +269,20 @@ test("buttons", function() {
equals(ev.target, btn[1], "event target");
}
};
-
+
el = $('<div></div>').dialog({ buttons: buttons });
var btn = $("button", dlg());
equals(btn.length, 2, "number of buttons");
-
+
var i = 0;
$.each(buttons, function(key, val) {
equals(btn.eq(i).text(), key, "text of button " + (i+1));
i++;
});
-
+
equals(btn.parent().attr('className'), 'ui-dialog-buttonpane', "buttons in container");
btn.trigger("click");
-
+
var newButtons = {
"Close": function(ev, ui) {
ok(true, "button click fires callback");
@@ -290,35 +290,35 @@ test("buttons", function() {
equals(ev.target, btn[0], "event target");
}
};
-
+
equals(el.data("buttons.dialog"), buttons, '.data("buttons.dialog") getter');
el.data("buttons.dialog", newButtons);
equals(el.data("buttons.dialog"), newButtons, '.data("buttons.dialog", ...) setter');
-
+
btn = $("button", dlg());
equals(btn.length, 1, "number of buttons after setter");
btn.trigger('click');
-
+
i = 0;
$.each(newButtons, function(key, val) {
equals(btn.eq(i).text(), key, "text of button " + (i+1));
i += 1;
});
-
+
el.remove();
});
test("dialogClass", function() {
expect(4);
-
+
el = $('<div></div>').dialog();
equals(dlg().is(".foo"), false, 'dialogClass not specified. foo class added');
el.remove();
-
+
el = $('<div></div>').dialog({ dialogClass: "foo" });
equals(dlg().is(".foo"), true, 'dialogClass in init. foo class added');
el.remove();
-
+
el = $('<div></div>').dialog({ dialogClass: "foo bar" });
equals(dlg().is(".foo"), true, 'dialogClass in init, two classes. foo class added');
equals(dlg().is(".bar"), true, 'dialogClass in init, two classes. bar class added');
@@ -327,13 +327,13 @@ test("dialogClass", function() {
test("draggable", function() {
expect(4);
-
+
el = $('<div></div>').dialog({ draggable: false });
shouldnotmove();
el.data('draggable.dialog', true);
shouldmove();
el.remove();
-
+
el = $('<div></div>').dialog({ draggable: true });
shouldmove();
el.data('draggable.dialog', false);
@@ -343,15 +343,15 @@ test("draggable", function() {
test("height", function() {
expect(3);
-
+
el = $('<div></div>').dialog();
equals(dlg().height(), defaults.height, "default height");
el.remove();
-
+
el = $('<div></div>').dialog({ height: 437 });
equals(dlg().height(), 437, "explicit height");
el.remove();
-
+
el = $('<div></div>').dialog();
el.data('height.dialog', 438);
equals(dlg().height(), 438, "explicit height set after init");
@@ -360,17 +360,17 @@ test("height", function() {
test("maxHeight", function() {
expect(3);
-
+
el = $('<div></div>').dialog({ maxHeight: 400 });
drag('.ui-resizable-s', 1000, 1000);
equals(heightAfter, 400, "maxHeight");
el.remove();
-
+
el = $('<div></div>').dialog({ maxHeight: 400 });
drag('.ui-resizable-n', -1000, -1000);
equals(heightAfter, 400, "maxHeight");
el.remove();
-
+
el = $('<div></div>').dialog({ maxHeight: 400 }).data('maxHeight.dialog', 600);
drag('.ui-resizable-n', -1000, -1000);
equals(heightAfter, 600, "maxHeight");
@@ -379,17 +379,17 @@ test("maxHeight", function() {
test("maxWidth", function() {
expect(3);
-
+
el = $('<div></div>').dialog({ maxWidth: 400 });
drag('.ui-resizable-e', 1000, 1000);
equals(widthAfter, 400, "maxWidth");
el.remove();
-
+
el = $('<div></div>').dialog({ maxWidth: 400 });
drag('.ui-resizable-w', -1000, -1000);
equals(widthAfter, 400, "maxWidth");
el.remove();
-
+
el = $('<div></div>').dialog({ maxWidth: 400 }).data('maxWidth.dialog', 600);
drag('.ui-resizable-w', -1000, -1000);
equals(widthAfter, 600, "maxWidth");
@@ -398,17 +398,17 @@ test("maxWidth", function() {
test("minHeight", function() {
expect(3);
-
+
el = $('<div></div>').dialog({ minHeight: 10 });
drag('.ui-resizable-s', -1000, -1000);
equals(heightAfter, 10, "minHeight");
el.remove();
-
+
el = $('<div></div>').dialog({ minHeight: 10 });
drag('.ui-resizable-n', 1000, 1000);
equals(heightAfter, 10, "minHeight");
el.remove();
-
+
el = $('<div></div>').dialog({ minHeight: 10 }).data('minHeight.dialog', 30);
drag('.ui-resizable-n', 1000, 1000);
equals(heightAfter, 30, "minHeight");
@@ -417,17 +417,17 @@ test("minHeight", function() {
test("minWidth", function() {
expect(3);
-
+
el = $('<div></div>').dialog({ minWidth: 10 });
drag('.ui-resizable-e', -1000, -1000);
equals(widthAfter, 10, "minWidth");
el.remove();
-
+
el = $('<div></div>').dialog({ minWidth: 10 });
drag('.ui-resizable-w', 1000, 1000);
equals(widthAfter, 10, "minWidth");
el.remove();
-
+
el = $('<div></div>').dialog({ minWidth: 30 }).data('minWidth.dialog', 30);
drag('.ui-resizable-w', 1000, 1000);
equals(widthAfter, 30, "minWidth");
@@ -448,13 +448,13 @@ test("position", function() {
test("resizable", function() {
expect(4);
-
+
el = $('<div></div>').dialog();
shouldresize("[default]");
el.data('resizable.dialog', false);
shouldnotresize('disabled after init');
el.remove();
-
+
el = $('<div></div>').dialog({ resizable: false });
shouldnotresize("disabled in init options");
el.data('resizable.dialog', true);
@@ -468,27 +468,27 @@ test("stack", function() {
test("title", function() {
expect(5);
-
+
function titleText() {
return dlg().find(".ui-dialog-title").html();
}
-
+
el = $('<div></div>').dialog();
equals(titleText(), "&nbsp;", "[default]");
el.remove();
-
+
el = $('<div title="foo"/>').dialog();
equals(titleText(), "foo", "title in element attribute");
el.remove();
-
+
el = $('<div></div>').dialog({ title: 'foo' });
equals(titleText(), "foo", "title in init options");
el.remove();
-
+
el = $('<div title="foo"/>').dialog({ title: 'bar' });
equals(titleText(), "bar", "title in init options should override title in element attribute");
el.remove();
-
+
el = $('<div></div>').dialog().data('title.dialog', 'foo');
equals(titleText(), 'foo', 'title after init');
el.remove();
@@ -496,11 +496,11 @@ test("title", function() {
test("width", function() {
expect(3);
-
+
el = $('<div></div>').dialog();
equals(dlg().width(), defaults.width, "default width");
el.remove();
-
+
el = $('<div></div>').dialog({width: 437 });
equals(dlg().width(), 437, "explicit width");
el.data('width.dialog', 438);
@@ -512,13 +512,13 @@ module("dialog: Methods");
test("isOpen", function() {
expect(4);
-
+
el = $('<div></div>').dialog();
equals(el.dialog('isOpen'), true, "dialog is open after init");
el.dialog('close');
equals(el.dialog('isOpen'), false, "dialog is closed");
el.remove();
-
+
el = $('<div></div>').dialog({autoOpen: false});
equals(el.dialog('isOpen'), false, "dialog is closed after init");
el.dialog('open');
@@ -530,7 +530,7 @@ module("dialog: Callbacks");
test("open", function() {
expect(6);
-
+
el = $("<div></div>");
el.dialog({
open: function(ev, ui) {
@@ -539,7 +539,7 @@ test("open", function() {
}
});
el.remove();
-
+
el = $("<div></div>");
el.dialog({
autoOpen: false,
@@ -550,7 +550,7 @@ test("open", function() {
});
el.dialog("open");
el.remove();
-
+
el = $('<div></div>').dialog({
autoOpen: false
});
@@ -564,7 +564,7 @@ test("open", function() {
test("dragStart", function() {
expect(2);
-
+
el = $("<div></div>");
el.dialog({
dragStart: function(ev, ui) {
@@ -579,7 +579,7 @@ test("dragStart", function() {
test("drag", function() {
var fired = false;
-
+
el = $("<div></div>");
el.dialog({
drag: function(ev, ui) {
@@ -595,7 +595,7 @@ test("drag", function() {
test("dragStop", function() {
expect(2);
-
+
el = $("<div></div>");
el.dialog({
dragStop: function(ev, ui) {
@@ -610,7 +610,7 @@ test("dragStop", function() {
test("resizeStart", function() {
expect(2);
-
+
el = $("<div></div>");
el.dialog({
resizeStart: function(ev, ui) {
@@ -625,7 +625,7 @@ test("resizeStart", function() {
test("resize", function() {
var fired = false;
-
+
el = $("<div></div>");
el.dialog({
resize: function(ev, ui) {
@@ -641,7 +641,7 @@ test("resize", function() {
test("resizeStop", function() {
expect(2);
-
+
el = $("<div></div>");
el.dialog({
resizeStop: function(ev, ui) {
@@ -656,7 +656,7 @@ test("resizeStop", function() {
test("close", function() {
expect(4);
-
+
el = $('<div></div>').dialog({
close: function(ev, ui) {
ok(true, '.dialog("close") fires close callback');
@@ -665,7 +665,7 @@ test("close", function() {
});
el.dialog("close");
el.remove();
-
+
el = $('<div></div>').dialog().bind('dialogclose', function(ev, ui) {
ok(true, '.dialog("close") firse dialogclose event');
equals(this, el[0], 'context of event');
@@ -676,7 +676,7 @@ test("close", function() {
test("beforeclose", function() {
expect(6);
-
+
el = $('<div></div>').dialog({
beforeclose: function(ev, ui) {
ok(true, '.dialog("close") fires beforeclose callback');
@@ -687,7 +687,7 @@ test("beforeclose", function() {
el.dialog('close');
isOpen('beforeclose callback should prevent dialog from closing');
el.remove();
-
+
el = $('<div></div>').dialog().bind('dialogbeforeclose', function(ev, ui) {
ok(true, '.dialog("close") triggers dialogbeforeclose event');
equals(this, el[0], "context of event");
diff --git a/tests/draggable.html b/tests/draggable.html
index 0c17d6d84..2c936f757 100644
--- a/tests/draggable.html
+++ b/tests/draggable.html
@@ -4,16 +4,16 @@
<title>jQuery UI Draggable Test Suite</title>
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.draggable.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="draggable.js"></script>
-
+
<style type="text/css">
html { border: 0; }
#main {
diff --git a/tests/draggable.js b/tests/draggable.js
index c9cd45678..31a820613 100644
--- a/tests/draggable.js
+++ b/tests/draggable.js
@@ -98,7 +98,7 @@ test("init", function() {
test("destroy", function() {
expect(6);
- $("<div></div>").appendTo('body').draggable().draggable("destroy").remove();
+ $("<div></div>").appendTo('body').draggable().draggable("destroy").remove();
ok(true, '.draggable("destroy") called on element');
$([]).draggable().draggable("destroy");
@@ -186,7 +186,7 @@ test("No options, relative", function() {
test("No options, absolute", function() {
el = $("#draggable2").draggable();
drag(el, 50, 50);
- moved(50, 50);
+ moved(50, 50);
});
module("draggable: Options");
@@ -230,7 +230,7 @@ test("{ cancel: 'span' }", function() {
el = $("#draggable2").draggable();
drag("#draggable2 span", 50, 50);
moved(50, 50);
-
+
el.draggable("destroy");
el = $("#draggable2").draggable({ cancel: 'span' });
@@ -282,37 +282,37 @@ test("{ containment: 'parent' }, absolute", function() {
});
test("{ cursor: 'move' }", function() {
-
+
function getCursor() { return $("body").css("cursor"); }
-
+
expect(2);
-
+
var expected = "move", actual, before, after;
-
+
el = $("#draggable2").draggable({
cursor: expected,
start: function(event, ui) {
actual = getCursor();
}
});
-
+
before = getCursor();
drag("#draggable2", -1, -1);
after = getCursor();
-
+
equals(actual, expected, "start callback: cursor '" + expected + "'");
equals(after, before, "after drag: cursor restored");
-
+
});
test("{ cursorAt: { left: -5, top: -5 } }", function() {
-
+
expect(4);
-
+
var dx = -3, dy = -3;
var ox = 5, oy = 5;
var cax = -5, cay = -5;
-
+
var actual = null;
$("#draggable2").draggable({
cursorAt: { left: cax, top: cay },
@@ -321,7 +321,7 @@ test("{ cursorAt: { left: -5, top: -5 } }", function() {
}
});
var el = $("#draggable2").data("draggable").element;
-
+
var before = el.offset();
var pos = { clientX: before.left + ox, clientY: before.top + oy };
$("#draggable2").simulate("mousedown", pos);
@@ -333,10 +333,10 @@ test("{ cursorAt: { left: -5, top: -5 } }", function() {
left: before.left + ox - cax + dx,
top: before.top + oy - cay + dy
};
-
+
equals(actual.left, expected.left, "Absolute: -1px left");
equals(actual.top, expected.top, "Absolute: -1px top");
-
+
var actual = null;
$("#draggable1").draggable({
cursorAt: { left: cax, top: cay },
@@ -345,7 +345,7 @@ test("{ cursorAt: { left: -5, top: -5 } }", function() {
}
});
var el = $("#draggable2").data("draggable").element;
-
+
var before = el.offset();
var pos = { clientX: before.left + ox, clientY: before.top + oy };
$("#draggable2").simulate("mousedown", pos);
@@ -357,10 +357,10 @@ test("{ cursorAt: { left: -5, top: -5 } }", function() {
left: before.left + ox - cax + dx,
top: before.top + oy - cay + dy
};
-
+
equals(actual.left, expected.left, "Relative: -1px left");
equals(actual.top, expected.top, "Relative: -1px top");
-
+
});
test("{ distance: 10 }", function() {
@@ -374,7 +374,7 @@ test("{ distance: 10 }", function() {
drag(el, 9, 9);
moved(0, 0, 'distance not met');
-
+
});
test("{ grid: [50, 50] }, relative", function() {
@@ -412,13 +412,13 @@ test("{ helper: 'clone' }, relative", function() {
test("{ helper: 'clone' }, absolute", function() {
el = $("#draggable2").draggable({ helper: "clone" });
drag(el, 50, 50);
- moved(0, 0);
+ moved(0, 0);
});
test("{ opacity: 0.5 }", function() {
-
+
expect(1);
-
+
var opacity = null;
el = $("#draggable2").draggable({
opacity: 0.5,
@@ -426,19 +426,19 @@ test("{ opacity: 0.5 }", function() {
opacity = $(this).css("opacity");
}
});
-
+
drag("#draggable2", -1, -1);
-
+
equals(opacity, 0.5, "start callback: opacity is");
-
+
});
test("{ zIndex: 10 }", function() {
-
+
expect(1);
var expected = 10, actual;
-
+
var zIndex = null;
el = $("#draggable2").draggable({
zIndex: expected,
@@ -446,32 +446,32 @@ test("{ zIndex: 10 }", function() {
actual = $(this).css("zIndex");
}
});
-
+
drag("#draggable2", -1, -1);
-
+
equals(actual, expected, "start callback: zIndex is");
-
+
});
module("draggable: Callbacks");
test("callbacks occurance count", function() {
-
+
expect(3);
-
+
var start = 0, stop = 0, dragc = 0;
el = $("#draggable2").draggable({
start: function() { start++; },
drag: function() { dragc++; },
stop: function() { stop++; }
});
-
+
drag(el, 10, 10);
-
+
equals(start, 1, "start callback should happen exactly once");
equals(dragc, 3 + 1, "drag callback should happen exactly once per mousemove + 1");
equals(stop, 1, "stop callback should happen exactly once");
-
+
});
module("draggable: Scroll offsets");
@@ -538,7 +538,7 @@ if(!($.browser.msie && $.browser.version < 7)) {
moved(50, 50);
$("#main")[0].scrollTop = 0;
});
-
+
test("{ helper: 'original' }, fixed, with scroll offset on root", function() {
el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
$(document).scrollTop(100);
@@ -546,7 +546,7 @@ if(!($.browser.msie && $.browser.version < 7)) {
moved(50, 50);
$(document).scrollTop(0);
});
-
+
test("{ helper: 'original' }, fixed, with scroll offset on root and parent", function() {
el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
$(document).scrollTop(100);
@@ -562,67 +562,67 @@ if(!($.browser.msie && $.browser.version < 7)) {
test("{ helper: 'clone' }, absolute", function() {
-
+
var helperOffset = null;
var origOffset = $("#draggable1").offset();
-
+
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
helperOffset = ui.helper.offset();
} });
drag(el, 1, 1);
-
+
same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
});
test("{ helper: 'clone' }, absolute with scroll offset on parent", function() {
-
+
$("#main")[0].scrollTop = 100;
var helperOffset = null;
var origOffset = $("#draggable1").offset();
-
+
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
helperOffset = ui.helper.offset();
} });
drag(el, 1, 1);
-
+
same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
$("#main")[0].scrollTop = 0;
});
test("{ helper: 'clone' }, absolute with scroll offset on root", function() {
-
+
$(document).scrollTop(100);
var helperOffset = null;
var origOffset = $("#draggable1").offset();
-
+
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
helperOffset = ui.helper.offset();
} });
drag(el, 1, 1);
-
+
same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
$(document).scrollTop(0);
});
test("{ helper: 'clone' }, absolute with scroll offset on root and parent", function() {
-
+
$(document).scrollTop(100);
$("#main")[0].scrollTop = 100;
var helperOffset = null;
var origOffset = $("#draggable1").offset();
-
+
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
helperOffset = ui.helper.offset();
} });
drag(el, 1, 1);
-
+
same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
$(document).scrollTop(0);
$("#main")[0].scrollTop = 0;
@@ -641,9 +641,9 @@ module("draggable: Tickets");
/* This needs to be rewritten
test("#2965 cursorAt with margin", function() {
-
+
expect(2);
-
+
var ox = 0, oy = 0;
var actual, expected;
@@ -654,7 +654,7 @@ test("#2965 cursorAt with margin", function() {
}
});
var el = $("#draggable2").data("draggable").element;
-
+
$("#draggable2").css('margin', '0px !important');
var before = el.offset();
@@ -675,10 +675,10 @@ test("#2965 cursorAt with margin", function() {
$(document).simulate("mousemove", { clientX: pos.clientX + 1, clientY: pos.clientY + 1});
$(document).simulate("mousemove", pos);
$("#draggable2").simulate("mouseup", pos);
-
+
equals(actual.left, expected.left, "10px margin. left");
equals(actual.top, expected.top, "10px margin. top");
-
+
});
*/
diff --git a/tests/droppable.html b/tests/droppable.html
index d32d92e72..177010446 100644
--- a/tests/droppable.html
+++ b/tests/droppable.html
@@ -4,7 +4,7 @@
<title>jQuery UI Droppable Test Suite</title>
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.draggable.js"></script>
@@ -12,7 +12,7 @@
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="droppable.js"></script>
<style type="text/css">
diff --git a/tests/droppable.js b/tests/droppable.js
index 2c08d45cb..35d34f699 100644
--- a/tests/droppable.js
+++ b/tests/droppable.js
@@ -55,7 +55,7 @@ test("init", function() {
test("destroy", function() {
expect(6);
- $("<div></div>").appendTo('body').droppable().droppable("destroy").remove();
+ $("<div></div>").appendTo('body').droppable().droppable("destroy").remove();
ok(true, '.droppable("destroy") called on element');
$([]).droppable().droppable("destroy");
diff --git a/tests/progressbar.html b/tests/progressbar.html
index 1d082681c..854d0c8e5 100644
--- a/tests/progressbar.html
+++ b/tests/progressbar.html
@@ -4,14 +4,14 @@
<title>jQuery UI Progressbar Test Suite</title>
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.progressbar.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="progressbar.js"></script>
<style type="text/css">
@@ -34,6 +34,6 @@
<div id="main" style="position:absolute;top:-20000px">
<div id="progressbar"></div>
</div>
-
+
</body>
</html>
diff --git a/tests/progressbar.js b/tests/progressbar.js
index d58aaacc4..77b69943e 100644
--- a/tests/progressbar.js
+++ b/tests/progressbar.js
@@ -31,7 +31,7 @@ test("init", function() {
test("destroy", function() {
expect(1);
- $("<div></div>").appendTo('body').progressbar().progressbar("destroy").remove();
+ $("<div></div>").appendTo('body').progressbar().progressbar("destroy").remove();
ok(true, '.progressbar("destroy") called on element');
});
diff --git a/tests/resizable.html b/tests/resizable.html
index 3a5f0846a..7e45de93d 100644
--- a/tests/resizable.html
+++ b/tests/resizable.html
@@ -4,14 +4,14 @@
<title>jQuery UI Resizable Test Suite</title>
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.resizable.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="resizable.js"></script>
<style type="text/css">
diff --git a/tests/resizable.js b/tests/resizable.js
index 7daa97c69..98a69de5b 100644
--- a/tests/resizable.js
+++ b/tests/resizable.js
@@ -35,10 +35,10 @@ var defaults = {
};
var drag = function(el, dx, dy, complete) {
-
+
// speed = sync -> Drag syncrhonously.
// speed = fast|slow -> Drag asyncrhonously - animated.
-
+
//this mouseover is to work around a limitation in resizable
//TODO: fix resizable so handle doesn't require mouseover in order to be used
$(el).simulate("mouseover");
@@ -127,7 +127,7 @@ test("defaults", function() {
test("n", function() {
expect(2);
-
+
var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, 0, -50);
@@ -139,7 +139,7 @@ test("n", function() {
test("s", function() {
expect(2);
-
+
var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, 0, 50);
@@ -151,7 +151,7 @@ test("s", function() {
test("e", function() {
expect(2);
-
+
var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, 50);
@@ -163,7 +163,7 @@ test("e", function() {
test("w", function() {
expect(2);
-
+
var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, -50);
@@ -175,7 +175,7 @@ test("w", function() {
test("ne", function() {
expect(4);
-
+
var handle = '.ui-resizable-ne', target = $('#resizable1').css({ overflow: 'hidden' }).resizable({ handles: 'all' });
drag(handle, -50, -50);
@@ -189,7 +189,7 @@ test("ne", function() {
test("se", function() {
expect(4);
-
+
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, 50, 50);
@@ -203,7 +203,7 @@ test("se", function() {
test("sw", function() {
expect(4);
-
+
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, -50, -50);
@@ -217,7 +217,7 @@ test("sw", function() {
test("nw", function() {
expect(4);
-
+
var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all' });
drag(handle, -50, -50);
@@ -233,7 +233,7 @@ module("resizable: Options");
test("aspectRatio: 'preserve' (e)", function() {
expect(4);
-
+
var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
drag(handle, 80);
@@ -247,7 +247,7 @@ test("aspectRatio: 'preserve' (e)", function() {
test("aspectRatio: 'preserve' (w)", function() {
expect(4);
-
+
var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
drag(handle, -80);
@@ -261,7 +261,7 @@ test("aspectRatio: 'preserve' (w)", function() {
test("aspectRatio: 'preserve' (n)", function() {
expect(4);
-
+
var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
drag(handle, 0, -80);
@@ -275,7 +275,7 @@ test("aspectRatio: 'preserve' (n)", function() {
test("aspectRatio: 'preserve' (s)", function() {
expect(4);
-
+
var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
drag(handle, 0, 80);
@@ -289,7 +289,7 @@ test("aspectRatio: 'preserve' (s)", function() {
test("aspectRatio: 'preserve' (se)", function() {
expect(4);
-
+
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
drag(handle, 80, 80);
@@ -303,7 +303,7 @@ test("aspectRatio: 'preserve' (se)", function() {
test("aspectRatio: 'preserve' (sw)", function() {
expect(4);
-
+
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
drag(handle, -80, 80);
@@ -317,7 +317,7 @@ test("aspectRatio: 'preserve' (sw)", function() {
test("aspectRatio: 'preserve' (ne)", function() {
expect(4);
-
+
var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
drag(handle, 80, -80);
@@ -331,7 +331,7 @@ test("aspectRatio: 'preserve' (ne)", function() {
test("grid", function() {
expect(4);
-
+
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', grid: [0, 20] });
drag(handle, 3, 9);
@@ -345,13 +345,13 @@ test("grid", function() {
test("grid (wrapped)", function() {
expect(4);
-
+
var handle = '.ui-resizable-se', target = $('#resizable2').resizable({ handles: 'all', grid: [0, 20] });
drag(handle, 3, 9);
equals( target.width(), 103, "compare width");
equals( target.height(), 100, "compare height");
-
+
drag(handle, 15, 11);
equals( target.width(), 118, "compare width");
equals( target.height(), 120, "compare height");
@@ -361,11 +361,11 @@ test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
expect(4);
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
-
+
drag(handle, -50, -50);
equals( target.width(), 60, "compare minWidth" );
equals( target.height(), 60, "compare minHeight" );
-
+
drag(handle, 70, 70);
equals( target.width(), 100, "compare maxWidth" );
equals( target.height(), 100, "compare maxHeight" );
@@ -373,13 +373,13 @@ test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
expect(4);
-
+
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
-
+
drag(handle, 50, -50);
equals( target.width(), 60, "compare minWidth" );
equals( target.height(), 60, "compare minHeight" );
-
+
drag(handle, -70, 70);
equals( target.width(), 100, "compare maxWidth" );
equals( target.height(), 100, "compare maxHeight" );
@@ -387,13 +387,13 @@ test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
expect(4);
-
+
var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
-
+
drag(handle, -50, 50);
equals( target.width(), 60, "compare minWidth" );
equals( target.height(), 60, "compare minHeight" );
-
+
drag(handle, 70, -70);
equals( target.width(), 100, "compare maxWidth" );
equals( target.height(), 100, "compare maxHeight" );
@@ -401,13 +401,13 @@ test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() {
expect(4);
-
+
var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
-
+
drag(handle, 70, 70);
equals( target.width(), 60, "compare minWidth" );
equals( target.height(), 60, "compare minHeight" );
-
+
drag(handle, -70, -70);
equals( target.width(), 100, "compare maxWidth" );
equals( target.height(), 100, "compare maxHeight" );
diff --git a/tests/selectable.html b/tests/selectable.html
index b92ec5c1c..e6efbde7c 100644
--- a/tests/selectable.html
+++ b/tests/selectable.html
@@ -5,16 +5,16 @@
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
<!--link rel="stylesheet" href="../themes/flora/flora.selectable.css" type="text/css" media="screen"-->
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.selectable.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="selectable.js"></script>
-
+
<style type="text/css">
html { border: 0; }
</style>
diff --git a/tests/simulate/jquery.simulate.js b/tests/simulate/jquery.simulate.js
index 85deb23f9..11face36e 100644
--- a/tests/simulate/jquery.simulate.js
+++ b/tests/simulate/jquery.simulate.js
@@ -23,7 +23,7 @@ $.fn.extend({
$.simulate = function(el, type, options) {
this.target = el;
this.options = options;
-
+
if (/^drag$/.test(type)) {
this[type].apply(this, [this.target, options]);
} else {
@@ -52,9 +52,9 @@ $.extend($.simulate.prototype, {
ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
button: 0, relatedTarget: undefined
}, options);
-
+
var relatedTarget = $(e.relatedTarget)[0];
-
+
if ($.isFunction(document.createEvent)) {
evt = document.createEvent("MouseEvents");
evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail,
@@ -70,12 +70,12 @@ $.extend($.simulate.prototype, {
},
keyboardEvent: function(type, options) {
var evt;
-
+
var e = $.extend({ bubbles: true, cancelable: true, view: window,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
keyCode: 0, charCode: 0
}, options);
-
+
if ($.isFunction(document.createEvent)) {
try {
evt = document.createEvent("KeyEvents");
@@ -100,7 +100,7 @@ $.extend($.simulate.prototype, {
}
return evt;
},
-
+
dispatchEvent: function(el, type, evt) {
if (el.dispatchEvent) {
el.dispatchEvent(evt);
@@ -109,7 +109,7 @@ $.extend($.simulate.prototype, {
}
return evt;
},
-
+
drag: function(el) {
var self = this, center = this.findCenter(this.target),
options = this.options, x = Math.floor(center.x), y = Math.floor(center.y),
diff --git a/tests/slider.html b/tests/slider.html
index 55355ac28..fd352ef87 100644
--- a/tests/slider.html
+++ b/tests/slider.html
@@ -4,14 +4,14 @@
<title>jQuery UI Slider Test Suite</title>
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.slider.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="slider.js"></script>
<style type="text/css">
@@ -37,6 +37,6 @@
<div class="ui-slider-handle" style="position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px;"></div>
</div>
</div>
-
+
</body>
</html>
diff --git a/tests/slider.js b/tests/slider.js
index fa20f0339..78d09e28d 100644
--- a/tests/slider.js
+++ b/tests/slider.js
@@ -54,24 +54,24 @@ module("slider");
test("init", function() {
expect(6);
-
+
$("<div></div>").appendTo('body').slider().remove();
ok(true, '.slider() called on element');
-
+
$([]).slider().remove();
ok(true, '.slider() called on empty collection');
-
+
$('<div></div>').slider().remove();
ok(true, '.slider() called on disconnected DOMElement');
-
+
$('<div></div>').slider().slider("foo").remove();
ok(true, 'arbitrary method called after init');
-
+
el = $('<div></div>').slider();
var foo = el.data("foo.slider");
el.remove();
ok(true, 'arbitrary option getter after init');
-
+
$('<div></div>').slider().data("foo.slider", "bar").remove();
ok(true, 'arbitrary option setter after init');
});
@@ -166,12 +166,12 @@ test("destroy and recreate", function() {
slider.slider("moveTo", "+=20");
equals(slider.slider("value"), 20);
slider.slider("destroy");
-
+
slider.slider("moveTo", "+=30");
ok(true, "nothing happens after slider is destroyed");
-
+
slider.slider().slider("moveTo", "30");
-
+
equals(Math.round(slider.slider("value")), 30);
})
diff --git a/tests/sortable.html b/tests/sortable.html
index 0e48adf09..4fa00cb76 100644
--- a/tests/sortable.html
+++ b/tests/sortable.html
@@ -4,16 +4,16 @@
<title>jQuery UI Sortable Test Suite</title>
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.sortable.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="sortable.js"></script>
-
+
<style type="text/css">
html { border: 0; }
#main {
diff --git a/tests/sortable.js b/tests/sortable.js
index 64b0b6833..c913ed86d 100644
--- a/tests/sortable.js
+++ b/tests/sortable.js
@@ -94,7 +94,7 @@ test("enable", function() {
el = $("#sortable").sortable({ disabled: true });
sort($("li", el)[0], 0, 40, 0, '.sortable({ disabled: true })');
-
+
el.sortable("enable");
equals(el.data("disabled.sortable"), false, "disabled.sortable getter");
@@ -102,7 +102,7 @@ test("enable", function() {
el.sortable({ disabled: true });
el.data("disabled.sortable", false);
equals(el.data("disabled.sortable"), false, "disabled.sortable setter");
-
+
sort($("li", el)[0], 0, 40, 2, '.data("disabled.sortable", false)');
});
@@ -133,12 +133,12 @@ test("defaults", function() {
});
test("#3019: Stop fires too early", function() {
-
+
var helper = null;
el = $("#sortable").sortable({ stop: function(event, ui) {
helper = ui.helper;
}});
-
+
sort($("li", el)[0], 0, 40, 2, 'Dragging the sortable');
equals(helper, null, "helper should be false");
diff --git a/tests/spinner.html b/tests/spinner.html
index e9b2f0058..061a4debd 100644
--- a/tests/spinner.html
+++ b/tests/spinner.html
@@ -4,14 +4,14 @@
<title>jQuery UI Spinner Test Suite</title>
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.spinner.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
+
<script type="text/javascript" src="spinner.js"></script>
<style type="text/css">
@@ -34,6 +34,6 @@
<div id="main" style="position:absolute;top:-20000px">
<input type="text" id="spin" />
</div>
-
+
</body>
</html>
diff --git a/tests/spinner.js b/tests/spinner.js
index ea7fe1809..e248ac970 100644
--- a/tests/spinner.js
+++ b/tests/spinner.js
@@ -226,7 +226,7 @@ test("decimal options", function() {
el.simulate("keyup",{keyCode:$.simulate.VK_UP});
equals(el.val(), "7.0", "keydown 11 times");
-
+
});
test("spin without auto-incremental stepping", function() {
@@ -344,7 +344,7 @@ test("currency formats", function() {
expect(8);
// default
-
+
el = $("#spin").spinner({ currency: 'HK$', stepping: 1500.50, start: 1000 });
equals(el.val(), "HK$1,000.00", "Hong Kong Dollar");
@@ -355,7 +355,7 @@ test("currency formats", function() {
equals(el.val(), "HK$2,500.50", "Hong Kong Dollar step-up once");
// space and comma
-
+
el.spinner('destroy').val('').spinner({ currency: '$', group: ' ', point: '.', stepping: 1500.50, start: 1000 });
equals(el.val(), "$1 000.00", "Australian Dollar");
@@ -366,7 +366,7 @@ test("currency formats", function() {
equals(el.val(), "$2 500.50", "Australian Dollar step-up once");
// apos and point
-
+
el.spinner('destroy').val('').spinner({ currency: 'Fr ', group: "'", point: '.', stepping: 1500.50, start: 1000 });
equals(el.val(), "Fr 1'000.00", "Swiss Franc");
@@ -375,9 +375,9 @@ test("currency formats", function() {
.simulate("keyup",{keyCode:$.simulate.VK_UP});
equals(el.val(), "Fr 2'500.50", "Swiss Franc step-up once");
-
+
// point and comma
-
+
el.spinner('destroy').val('').spinner({ currency: 'RUB', group: ".", point: ',', stepping: 1.5, start: 1000 });
equals(el.val(), "RUB1.000,00", "Russian Ruble");
@@ -386,7 +386,7 @@ test("currency formats", function() {
.simulate("keyup",{keyCode:$.simulate.VK_UP});
equals(el.val(), "RUB1.001,50", "Russian Ruble step-up once");
-
+
});
diff --git a/tests/tabs.html b/tests/tabs.html
index ad9b6847d..78459b878 100644
--- a/tests/tabs.html
+++ b/tests/tabs.html
@@ -33,7 +33,7 @@
<ol id="tests"></ol>
<div id="main" style="position:absolute;top:-20000px">
-
+
<div id="tabs1">
<ul>
<li><a href="#fragment-1">1</a></li>
@@ -52,7 +52,7 @@
<div id="colon:test"></div>
<div style="height: 300px;" id="inline-style"></div>
</div>
-
+
</div>
</body>
diff --git a/tests/tabs.js b/tests/tabs.js
index c00026549..c11b2887d 100644
--- a/tests/tabs.js
+++ b/tests/tabs.js
@@ -37,7 +37,7 @@ function defer(defered, ms) {
setTimeout(function() {
queue.shift()();
if (!queue.length) start();
- }, ms || 100);
+ }, ms || 100);
}
module('tabs');
@@ -47,17 +47,17 @@ module('tabs');
var el = $('#tabs1 > ul').tabs();
ok(true, '.tabs() called on element');
-
+
el.tabs('destroy').tabs({ selected: 1 });
equals( el.data('selected.tabs'), 1, 'selected.tabs set' );
equals( $('li', el).index( $('li.ui-tabs-selected', el) ), 1, 'second tab active');
equals( $('div', '#tabs1').index( $('div.ui-tabs-hide', '#tabs1') ), 0, 'first panel should be hidden' );
-
+
});
test('destroy', function() {
expect(0);
-
+
});
test("defaults", function() {
@@ -71,37 +71,37 @@ module('tabs');
test('add', function() {
expect(0);
-
+
});
test('remove', function() {
expect(0);
-
+
});
test('enable', function() {
expect(0);
-
+
});
test('disable', function() {
expect(0);
-
+
});
test('select', function() {
expect(0);
-
+
});
test('load', function() {
expect(0);
-
+
});
test('url', function() {
expect(0);
-
+
});
@@ -109,33 +109,33 @@ module('tabs: Options');
test('select: null', function() {
expect(3);
-
+
var el = $('#tabs1 > ul');
-
+
el.tabs({ selected: null });
equals( el.data('selected.tabs'), null, 'option set' );
equals( $('li.ui-tabs-selected', el).length, 0, 'all tabs should be deselected' );
equals( $('div.ui-tabs-hide', '#tabs1').length, 3, 'all panels should be hidden' );
-
+
// TODO select == null with cookie
// TODO select == null with select method
-
+
});
test('deselectable: true', function() {
expect(7);
-
+
var el = $('#tabs1 > ul');
-
+
el.tabs({ deselectable: true });
equals( el.data('deselectable.tabs'), true, 'option set' );
equals( $('li.ui-tabs-deselectable', el).length, 1, 'class "ui-tabs-deselectable" attached once');
equals( $('li', el).index( $('li.ui-tabs-deselectable', el) ), 0, 'class "ui-tabs-deselectable" attached to first tab');
-
+
el.tabs('select', 1);
equals( $('li.ui-tabs-deselectable', el).length, 1, 'class "ui-tabs-deselectable" attached once');
equals( $('li', el).index( $('li.ui-tabs-deselectable', el) ), 1, 'class "ui-tabs-deselectable" attached to second tab');
-
+
el.tabs('select', 1);
equals( $('li.ui-tabs-deselectable', el).length, 0, 'class "ui-tabs-deselectable" not attached');
defer(function() {
@@ -146,32 +146,32 @@ module('tabs: Options');
test('cookie', function() {
expect(5);
-
+
var el = $('#tabs1 > ul');
var cookieName = 'ui-tabs-' + $.data(el[0]);
$.cookie(cookieName, null); // blank state
var cookie = function() {
return parseInt($.cookie(cookieName), 10);
};
-
+
el.tabs({ cookie: {} });
equals(cookie(), 0, 'initial cookie value, no cookie given');
-
+
el.tabs('destroy');
el.tabs({ selected: 1, cookie: {} });
equals(cookie(), 1, 'initial cookie value, given selected');
el.tabs('select', 2);
equals(cookie(), 2, 'cookie value after tabs select');
-
+
el.tabs('destroy');
$.cookie(cookieName, 1);
el.tabs({ cookie: {} });
equals(cookie(), 1, 'initial cookie value, from existing cookie');
-
+
el.tabs('destroy');
ok($.cookie(cookieName) === null, 'erase cookie after destroy');
-
+
});
@@ -183,42 +183,42 @@ module('tabs: Tickets');
var el = $('#tabs2 > ul').tabs();
ok( $('div.ui-tabs-panel:eq(0)', '#tabs2').is(':visible'), 'first panel should be visible' );
ok( $('div.ui-tabs-panel:eq(1)', '#tabs2').is(':hidden'), 'second panel should be hidden' );
-
+
el.tabs('select', 1).tabs('select', 0);
defer(function() {
ok( $('div.ui-tabs-panel:eq(0)', '#tabs2').is(':visible'), 'first panel should be visible' );
- ok( $('div.ui-tabs-panel:eq(1)', '#tabs2').is(':hidden'), 'second panel should be hidden' );
+ ok( $('div.ui-tabs-panel:eq(1)', '#tabs2').is(':hidden'), 'second panel should be hidden' );
});
-
+
});
-
+
test('panel containing inline style, #????', function() {
expect(3);
-
+
var inlineStyle = function(property) {
return $('#inline-style')[0].style[property];
};
var expected = inlineStyle('height');
-
+
var el = $('#tabs2 > ul').tabs();
equals(inlineStyle('height'), expected, 'init should not remove inline style');
-
+
el.tabs('select', 1);
defer(function() {
equals(inlineStyle('height'), expected, 'show tab should not remove inline style');
-
+
el.tabs('select', 0);
defer(function() {
equals(inlineStyle('height'), expected, 'hide tab should not remove inline style');
});
-
+
});
-
+
});
-
+
// test('', function() {
// expect(0);
-//
+//
// });
})(jQuery);
diff --git a/tests/ui.html b/tests/ui.html
index d3fff2e6b..7bb3c7b61 100644
--- a/tests/ui.html
+++ b/tests/ui.html
@@ -2,9 +2,9 @@
<html lang="en">
<head>
<title>jQuery UI Test Suite</title>
-
+
<link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
+
<script type="text/javascript" src="../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../ui/ui.core.js"></script>
<script type="text/javascript" src="../ui/ui.accordion.js"></script>
@@ -19,10 +19,10 @@
<script type="text/javascript" src="../ui/ui.sortable.js"></script>
<script type="text/javascript" src="../ui/ui.spinner.js"></script>
<script type="text/javascript" src="../ui/ui.tabs.js"></script>
-
+
<script type="text/javascript" src="qunit/testrunner.js"></script>
<script type="text/javascript" src="ui.js"></script>
-
+
</head>
<body class="flora">
diff --git a/tests/visual/effects.all.html b/tests/visual/effects.all.html
index d89dbecd8..a2f095c43 100644
--- a/tests/visual/effects.all.html
+++ b/tests/visual/effects.all.html
@@ -4,10 +4,10 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Effects Test Suite</title>
<link rel="stylesheet" href="effects.all.css" type="text/css" media="screen" title="no title" charset="utf-8" />
-
+
<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../ui/effects.core.js"></script>
-
+
<script type="text/javascript" src="../../ui/effects.blind.js"></script>
<script type="text/javascript" src="../../ui/effects.bounce.js"></script>
<script type="text/javascript" src="../../ui/effects.clip.js"></script>
@@ -20,7 +20,7 @@
<script type="text/javascript" src="../../ui/effects.shake.js"></script>
<script type="text/javascript" src="../../ui/effects.slide.js"></script>
<script type="text/javascript" src="../../ui/effects.transfer.js"></script>
-
+
<script type="text/javascript" src="effects.all.js"></script>
</head>
<body>
@@ -38,121 +38,121 @@
<p>Blind vertically</p>
</div>
</li>
-
+
<li>
<div class="effect" id="bounce3times">
<p>Bounce 3 times</p>
</div>
</li>
-
+
<li>
<div class="effect" id="clipHorizontally">
<p>Clip horizontally</p>
</div>
</li>
-
+
<li>
<div class="effect" id="clipVertically">
<p>Clip vertically</p>
</div>
</li>
-
+
<li>
<div class="effect" id="dropDown">
<p>Drop down</p>
</div>
</li>
-
+
<li>
<div class="effect" id="dropUp">
<p>Drop up</p>
</div>
</li>
-
+
<li>
<div class="effect" id="dropLeft">
<p>Drop left</p>
</div>
</li>
-
+
<li>
<div class="effect" id="dropRight">
<p>Drop right</p>
</div>
</li>
-
+
<li>
<div class="effect" id="explode9">
<p>Explode in 9 pieces</p>
</div>
</li>
-
+
<li>
<div class="effect" id="explode36">
<p>Explode in 36 pieces</p>
</div>
</li>
-
+
<li>
<div class="effect" id="fold">
<p>Fold</p>
</div>
</li>
-
+
<li>
<div class="effect" id="highlight">
<p>Highlight</p>
</div>
</li>
-
+
<li>
<div class="effect" id="pulsate">
<p>Pulsate 2 times</p>
</div>
</li>
-
+
<li>
<div class="effect" id="puff">
<p>Puff</p>
</div>
</li>
-
+
<li>
<div class="effect" id="scale">
<p>Scale</p>
</div>
</li>
-
+
<li>
<div class="effect" id="shake">
<p>Shake</p>
</div>
</li>
-
+
<li>
<div class="effect" id="slideDown">
<p>Slide down</p>
</div>
</li>
-
+
<li>
<div class="effect" id="slideUp">
<p>Slide up</p>
</div>
</li>
-
+
<li>
<div class="effect" id="slideLeft">
<p>Slide left</p>
</div>
</li>
-
+
<li>
<div class="effect" id="slideRight">
<p>Slide right</p>
</div>
</li>
-
+
<li>
<div class="effect" id="transfer">
<p>Transfer to first element</p>
diff --git a/tests/visual/effects.all.js b/tests/visual/effects.all.js
index b52b23726..f383199c2 100644
--- a/tests/visual/effects.all.js
+++ b/tests/visual/effects.all.js
@@ -1,5 +1,5 @@
$(document).ready(function() {
-
+
$("div.effect")
.hover(function() {
$(this).addClass("hover");
@@ -7,16 +7,16 @@ $(document).ready(function() {
$(this).removeClass("hover");
})
;
-
-
+
+
var effect = function(el, n, o) {
-
+
$.extend(o, {
easing: "easeOutQuint"
});
-
+
$(el).bind("click", function() {
-
+
$(this).addClass("current").hide(n, o, 1000, function() {
var self = this;
window.setTimeout(function() {
@@ -24,42 +24,42 @@ $(document).ready(function() {
},500);
});
});
-
+
};
-
+
effect("#blindHorizontally", "blind", { direction: "horizontal" });
effect("#blindVertically", "blind", { direction: "vertical" });
-
+
effect("#bounce3times", "bounce", { times: 3 });
-
+
effect("#clipHorizontally", "clip", { direction: "horizontal" });
effect("#clipVertically", "clip", { direction: "vertical" });
-
+
effect("#dropDown", "drop", { direction: "down" });
effect("#dropUp", "drop", { direction: "up" });
effect("#dropLeft", "drop", { direction: "left" });
effect("#dropRight", "drop", { direction: "right" });
-
+
effect("#explode9", "explode", { });
effect("#explode36", "explode", { pieces: 36 });
-
+
effect("#fold", "fold", { size: 50 });
-
+
effect("#highlight", "highlight", { });
-
+
effect("#pulsate", "pulsate", { times: 2 });
-
+
effect("#puff", "puff", { times: 2 });
effect("#scale", "scale", { });
-
+
$("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); });
-
+
effect("#slideDown", "slide", { direction: "down" });
effect("#slideUp", "slide", { direction: "up" });
effect("#slideLeft", "slide", { direction: "left" });
effect("#slideRight", "slide", { direction: "right" });
-
+
$("#transfer").bind("click", function() { $(this).addClass("current").effect("transfer", { to: "div:eq(0)" }, 1000, function() { $(this).removeClass("current"); }); });
-
+
}); \ No newline at end of file
diff --git a/tests/visual/sortable_massive_scale.html b/tests/visual/sortable_massive_scale.html
index 591341ad2..a21485415 100644
--- a/tests/visual/sortable_massive_scale.html
+++ b/tests/visual/sortable_massive_scale.html
@@ -6,11 +6,11 @@
<script type="text/javascript" src="../../ui/ui.core.js"></script>
<script type="text/javascript" src="../../ui/ui.sortable.js"></script>
<script type="text/javascript" src="../../ui/ui.draggable.js"></script>
-
+
<script type="text/javascript">
-
+
$(document).ready( function() {
$('ul').not(".draggable").sortable({ items: "li" });
$("ul.draggable li").draggable({ helper: "clone", connectToSortable: "ul" });
diff --git a/tests/visual/spinner.html b/tests/visual/spinner.html
index b9151f9ad..60b8b1279 100644
--- a/tests/visual/spinner.html
+++ b/tests/visual/spinner.html
@@ -20,7 +20,7 @@ $(function(){
}
};
}
-
+
var itemList = [
{url: "http://ejohn.org", title: "John Resig"},
{url: "http://bassistance.de/", title: "J&ouml;rn Zaefferer"},
@@ -36,7 +36,7 @@ $(function(){
{url: "http://www.codylindley.com/", title: "Cody Lindley"},
{url: "http://malsup.com/jquery/", title: "Mike Alsup"}
];
-
+
var opts = {
's1': {},
's2': {stepping: 0.25},
@@ -52,7 +52,7 @@ $(function(){
ui.add('<a href="'+ itemList[i].url +'" target="_blank">'+ itemList[i].title +'</a>');
}
},
-
+
// method 2: use the format and items options in combination
format: '%(title) <a href="%(url)" target="_blank">&raquo;</a>',
items: itemList
diff --git a/tests/visual/tree.html b/tests/visual/tree.html
index 988e7d132..07b12a13e 100644
--- a/tests/visual/tree.html
+++ b/tests/visual/tree.html
@@ -23,7 +23,7 @@ $("ul.sortable").tree({
});
-
+
});
</script>