<!DOCTYPE html>\r
<html lang="en">\r
<head>\r
- <title>Draggable - Automated Test Page</title>\r
+ <title>jQuery UI - Automated Tests</title>\r
<script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script>\r
<script type="text/javascript" src="../../ui/source/ui.core.js"></script>\r
<script type="text/javascript" src="../../ui/source/ui.draggable.js"></script>\r
+ <script type="text/javascript" src="../../ui/source/ui.selectable.js"></script>\r
\r
<script type="text/javascript" src="ui.testmouse.js"></script>\r
\r
html, body { height: 100%; }\r
#main { height: 100%; }\r
\r
-#foo { position: relative; margin: 10px; padding: 10px; border: 3px solid gray; cursor: move; width: 200px; height: 100px; background: #eef; text-align: center; }\r
+#foo { position: relative; margin: 10px; padding: 10px; border: 3px solid gray; width: 200px; height: 200px; background: #eef; text-align: center; }\r
+#foo * { margin: 4px; }\r
.ui-draggable .msg-missing-class { display: none !important; background: red; color: white; font-weight: bold; }\r
.ui-draggable .msg-enabled { display: block; }\r
.ui-draggable .msg-disabled { display: none; }\r
.ui-draggable-disabled .msg-enabled { display: none !important; }\r
.ui-draggable-disabled .msg-disabled { display: block !important; }\r
+.ui-selectable .msg-missing-class { display: none !important; background: red; color: white; font-weight: bold; }\r
+.ui-selectable .msg-enabled { display: block; }\r
+.ui-selectable .msg-disabled { display: none; }\r
+.ui-selectable-disabled .msg-enabled { display: none !important; }\r
+.ui-selectable-disabled .msg-disabled { display: block !important; }\r
+//.ui-selectee { border: 1px solid white; }\r
+.ui-selecting { background: Highlight; color: HighlightText; outline: 1px dotted white; }\r
+.ui-selected { background: Highlight; color: HighlightText; outline: 1px dotted black; }\r
\r
</style>\r
\r
-<script type="text/javascript">\r
-\r
-\r
-</script>\r
-\r
<script type="text/javascript">\r
$(function() {\r
\r
- var speed = "slow"\r
+ var speed = "fast";\r
\r
var queue;\r
var start = function() {\r
\r
var setupAndRun = function(nTest) {\r
$('#testnum').text(nTest.num);\r
- $('#sandbox').hide().append('<div id="foo">' + \r
- '<div class="msg-missing-class">THIS TEXT SHOULD NOT BE VISIBLE</div>' +\r
- '<div class="msg-enabled">enabled</div>' +\r
- '<div class="msg-disabled">disabled</div>' +\r
- '</div>');\r
+ $('#sandbox').hide()\r
+ .append('<ul id="foo">' + \r
+ '<li class="msg-missing-class">THIS TEXT SHOULD NOT BE VISIBLE</li>' +\r
+ '<li class="msg-enabled">enabled</li>' +\r
+ '<li class="msg-disabled">disabled</li>' +\r
+ '<li>Item 2</li>' +\r
+ '<li>Item 3</li>' +\r
+ '<li>Item 4</li>' +\r
+ '<li>Item 5</li>' +\r
+ '<li>Item 6</li>' +\r
+ '<li>Item 7</li>' +\r
+ '<li>Item 8</li>' +\r
+ '</ul>')\r
$('#foo').testMouse({\r
speed: speed,\r
complete: nextTest\r
$('#foo').remove();\r
if ($.isFunction(fn)) fn.apply();\r
}\r
+ var plugin = "draggable";\r
+ plugin = "selectable"\r
+ var testFn = "testMouse";\r
+ var testArgs = ["drag", 40, 50];\r
//1\r
- addTest(function() { $("#foo").draggable().testMouse("drag", 100, 100); });\r
+ addTest(function() { $("#foo")[plugin]()[testFn].apply($("#foo"), testArgs); });\r
//2\r
- addTest(function() { $("#foo").draggable({ disabled: true }).testMouse("drag", 100, 100); });\r
- addTest(function() { $("#foo").draggable({ disabled: false }).testMouse("drag", 100, 100); });\r
+ addTest(function() { $("#foo")[plugin]({ disabled: true })[testFn].apply($("#foo"), testArgs); });\r
+ addTest(function() { $("#foo")[plugin]({ disabled: false })[testFn].apply($("#foo"), testArgs); });\r
//4\r
- addTest(function() { $("#foo").draggable().draggable('disable').testMouse("drag", 100, 100); });\r
- addTest(function() { $("#foo").draggable().draggable('enable').testMouse("drag", 100, 100); });\r
+ addTest(function() { $("#foo")[plugin]()[plugin]('disable')[testFn].apply($("#foo"), testArgs); });\r
+ addTest(function() { $("#foo")[plugin]()[plugin]('enable')[testFn].apply($("#foo"), testArgs); });\r
//6\r
- addTest(function() { $("#foo").draggable().draggable('enable').draggable('disable').testMouse("drag", 100, 100); });\r
- addTest(function() { $("#foo").draggable().draggable('disable').draggable('enable').testMouse("drag", 100, 100); });\r
+ addTest(function() { $("#foo")[plugin]()[plugin]('enable')[plugin]('disable')[testFn].apply($("#foo"), testArgs); });\r
+ addTest(function() { $("#foo")[plugin]()[plugin]('disable')[plugin]('enable')[testFn].apply($("#foo"), testArgs); });\r
//8\r
- addTest(function() { $("#foo").draggable({ disabled: false }).draggable('disable').testMouse("drag", 100, 100); });\r
- addTest(function() { $("#foo").draggable({ disabled: true }).draggable('enable').testMouse("drag", 100, 100); });\r
+ addTest(function() { $("#foo")[plugin]({ disabled: false })[plugin]('disable')[testFn].apply($("#foo"), testArgs); });\r
+ addTest(function() { $("#foo")[plugin]({ disabled: true })[plugin]('enable')[testFn].apply($("#foo"), testArgs); });\r
+ //10\r
+ addTest(function() { $("#foo")[plugin]({ disabled: false }).data('disabled.' + plugin, true)[testFn].apply($("#foo"), testArgs); });\r
+ addTest(function() { $("#foo")[plugin]({ disabled: true }).data('disabled.' + plugin, false)[testFn].apply($("#foo"), testArgs); });\r
\r
$('#begin').click(function() {\r
start();\r
\r
<div id="main">\r
\r
- <h1>jQuery UI Draggable - Automated Test</h1>\r
+ <h1>jQuery UI - Automated Tests</h1>\r
\r
<div>\r
Status: <span id="status">Ready</span>\r