diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-04-23 16:33:34 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-04-23 16:33:34 -0400 |
commit | 0f575e03bb9af0b09d18a9207d9f589e05f44d50 (patch) | |
tree | 18251a2d3e7c51adb8f265158ca0361f5cca73d1 /tests | |
parent | af1576280a807dcc166ddf619abab1fc24cac664 (diff) | |
parent | 9df981d268b4029065247cf230a4e988946b7799 (diff) | |
download | jquery-ui-0f575e03bb9af0b09d18a9207d9f589e05f44d50.tar.gz jquery-ui-0f575e03bb9af0b09d18a9207d9f589e05f44d50.zip |
Merge branch 'master' into position-notification
Conflicts:
tests/unit/position/position_core_within.js
Diffstat (limited to 'tests')
89 files changed, 892 insertions, 1455 deletions
diff --git a/tests/.jshintrc b/tests/.jshintrc new file mode 100644 index 000000000..783237218 --- /dev/null +++ b/tests/.jshintrc @@ -0,0 +1,59 @@ +{ + "browser": true, + "curly": true, + "eqnull": true, + "eqeqeq": true, + "expr": true, + "evil": true, + "jquery": true, + "latedef": true, + "noarg": true, + "onevar": true, + "smarttabs": true, + "trailing": true, + "undef": true, + "predef": [ + "addMonths", + "asyncTest", + "container", + "deepEqual", + "d1", + "d2", + "dlg", + "domEqual", + "drag", + "dragged", + "el", + "equal", + "equalsDate", + "expect", + "Globalize", + "heightAfter", + "init", + "isNotOpen", + "isOpen", + "modal", + "module", + "moved", + "notEqual", + "offsetAfter", + "offsetBefore", + "ok", + "PROP_NAME", + "QUnit", + "restoreScroll", + "shouldBeDroppable", + "shouldmove", + "shouldNotBeDroppable", + "shouldnotmove", + "shouldnotresize", + "shouldresize", + "start", + "strictEqual", + "stop", + "test", + "TestHelpers", + "widthAfter", + "JSHINT" + ] +}
\ No newline at end of file diff --git a/tests/resource_loader.js b/tests/resource_loader.js deleted file mode 100644 index c8dec4881..000000000 --- a/tests/resource_loader.js +++ /dev/null @@ -1,39 +0,0 @@ -(function( $ ) { - -var parts = document.location.search.slice( 1 ).split( "&" ), - length = parts.length, - i = 0, - current, - min; - -for ( ; i < length; i++ ) { - current = parts[ i ].split( "=" ); - if ( current[ 0 ] === "min" ) { - min = current[ 1 ]; - break; - } -} - -function includeStyle( url ) { - document.write( "<link rel='stylesheet' href='../../../" + url + "'>" ); -} - -function includeScript( url ) { - document.write( "<script src='../../../" + url + "'></script>" ); -} - -window.loadResources = min ? - function() { - includeStyle( "build/dist/theme/jquery-ui.min.css" ); - includeScript( "build/dist/jquery-ui.min.js" ); - } : - function( resources ) { - $.each( resources.css || [], function( i, resource ) { - includeStyle( "themes/base/jquery." + resource + ".css" ); - }); - $.each( resources.js || [], function( i, resource ) { - includeScript( resource ); - }); - }; - -})( jQuery ); diff --git a/tests/static/datepicker/datepicker.html b/tests/static/datepicker/datepicker.html index 89be6b1eb..857677cfd 100644 --- a/tests/static/datepicker/datepicker.html +++ b/tests/static/datepicker/datepicker.html @@ -90,7 +90,7 @@ </tbody> </table> </div> - + <!-- Datepicker with 1 combined select --> <div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"> <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all"> @@ -98,7 +98,7 @@ <a title="Next" class="ui-datepicker-next ui-corner-all" href="#"><span class="ui-icon ui-icon-circle-triangle-e">Next</span></a> <div class="ui-datepicker-title"> <select class="ui-datepicker-month-year"> - <optgroup name="2007"> + <optgroup label="2007"> <option value="2007_0">January 2007</option> <option value="2007_1">February 2007</option> <option value="2007_2">March 2007</option> @@ -112,7 +112,7 @@ <option value="2007_10">November 2007</option> <option value="2007_11">December 2007</option> </optgroup> - <optgroup name="2008"> + <optgroup label="2008"> <option value="2008_0">January 2008</option> <option value="2008_1">February 2008</option> <option value="2008_2">March 2008</option> @@ -126,7 +126,7 @@ <option value="2008_10">November 2008</option> <option selected="selected" value="2008_11">December 2008</option> </optgroup> - <optgroup name="2009"> + <optgroup label="2009"> <option value="2009_0">January 2009</option> <option value="2009_1">February 2009</option> <option value="2009_2">March 2009</option> @@ -140,7 +140,7 @@ <option value="2009_10">November 2009</option> <option value="2009_11">December 2009</option> </optgroup> - <optgroup name="2010"> + <optgroup label="2010"> <option value="2010_0">January 2010</option> <option value="2010_1">February 2010</option> <option value="2010_2">March 2010</option> @@ -430,11 +430,11 @@ <td class="ui-datepicker-week-end ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td> </tr> </tbody> - </table> + </table> <div class="ui-datepicker-buttonpane ui-widget-content"> <button class="ui-state-default ui-priority-primary ui-corner-all">Done</button> <button class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all">Today</button> - </div> + </div> </div> <!-- Multiple Datepickers with read only month/year --> @@ -649,7 +649,7 @@ </td></tr> </tbody> </table> - </div> + </div> <div class="ui-datepicker-group ui-datepicker-group-middle"> <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix"> <div class="ui-datepicker-title"> @@ -863,7 +863,7 @@ </td></tr> </tbody> </table> - </div> + </div> <div class="ui-datepicker-group ui-datepicker-group-middle"> <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix"> <div class="ui-datepicker-title"> @@ -924,7 +924,7 @@ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">23</a></td> <td class=""><a href="#" class="ui-state-default">24</a></td> <td class=""><a href="#" class="ui-state-default">25</a></td> - <td class=""><a href="#" class="ui-state-default">26</a></td> + <td class=""><a href="#" class="ui-state-default">26</a></td> <td class=""><a href="#" class="ui-state-default">27</a></td> <td class=""><a href="#" class="ui-state-default">28</a></td> <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">29</a></td> @@ -1077,8 +1077,8 @@ </td></tr> </tbody> </table> - </div> - + </div> + <div class="ui-datepicker-row-break"></div> <div class="ui-datepicker-group ui-datepicker-group-first"> <div class="ui-datepicker-header ui-widget-header ui-helper-clearfix"> @@ -1344,7 +1344,7 @@ <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">23</a></td> <td class=""><a href="#" class="ui-state-default">24</a></td> <td class=""><a href="#" class="ui-state-default">25</a></td> - <td class=""><a href="#" class="ui-state-default">26</a></td> + <td class=""><a href="#" class="ui-state-default">26</a></td> <td class=""><a href="#" class="ui-state-default">27</a></td> <td class=""><a href="#" class="ui-state-default">28</a></td> <td class="ui-datepicker-week-end"><a href="#" class="ui-state-default">29</a></td> diff --git a/tests/static/icons.html b/tests/static/icons.html index af2833442..adaf5f1cd 100644 --- a/tests/static/icons.html +++ b/tests/static/icons.html @@ -16,12 +16,13 @@ ul {margin: 0; padding: 0;} td div {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none;} span.ui-icon { float: left; margin: 0 4px;} + .icon-collection { border-spacing: 0; border-collapse: collapse; } </style> <script type="text/javascript"> $(function(){ $('.ui-state-default').hover( - function(){ $(this).addClass('ui-state-hover'); }, + function(){ $(this).addClass('ui-state-hover'); }, function(){ $(this).removeClass('ui-state-hover'); } ); @@ -36,7 +37,7 @@ <p class="icons"></p> -<table class="ui-widget icon-collection" cellpaddding="0" cellspacing="0"> +<table class="ui-widget icon-collection"> <tr> <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-carat-1-n"></span></div></td> <td><div class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-ne"><span class="ui-icon ui-icon-carat-1-ne"></span></div></td> @@ -238,7 +239,7 @@ <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-vertical"><span class="ui-icon ui-icon-grip-solid-vertical"></span></div></td> <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-horizontal"><span class="ui-icon ui-icon-grip-solid-horizontal"></span></div></td> <td><div class="ui-state-default ui-corner-all" title=".ui-icon-gripsmall-diagonal-se"><span class="ui-icon ui-icon-gripsmall-diagonal-se"></span></div></td> - <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></div></td></ul> + <td><div class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></div></td> </tr> </table> diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html index 5c9169ea3..b3b7caeae 100644 --- a/tests/unit/accordion/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -8,9 +8,12 @@ <script> $.uiBackCompat = false; </script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.accordion" ], js: [ "ui/jquery.ui.core.js", @@ -20,13 +23,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="accordion_test_helpers.js"></script> - <script src="accordion_defaults.js"></script> + <script src="accordion_common.js"></script> <script src="accordion_core.js"></script> <script src="accordion_events.js"></script> <script src="accordion_methods.js"></script> @@ -93,7 +91,7 @@ <li><a href="?p=1.1.1.3">Amps</a></li> <li><a href="?p=1.1.1.4">Effects</a></li> <li><a href="?p=1.1.1.5">Accessories</a></li> - </ul> + </ul> </li> <li> <h2><a href="?p=1.1.2"><span>Bass</span></a></h2> @@ -105,7 +103,7 @@ <li><a href="?p=1.1.2.5">Accessories</a></li> <li><a href="?p=1.1.2.5">Accessories</a></li> <li><a href="?p=1.1.2.5">Accessories</a></li> - </ul> + </ul> </li> <li> <h2><a href="?p=1.1.3">Drums</a></h2> @@ -113,7 +111,7 @@ <li><a href="?p=1.1.3.2">Acoustic</a></li> <li><a href="?p=1.1.3.3">Electronic</a></li> <li><a href="?p=1.1.3.6">Accessories</a></li> - </ul> + </ul> </li> </ul> </div> diff --git a/tests/unit/accordion/accordion_defaults.js b/tests/unit/accordion/accordion_common.js index ef24cf25e..ef24cf25e 100644 --- a/tests/unit/accordion/accordion_defaults.js +++ b/tests/unit/accordion/accordion_common.js diff --git a/tests/unit/accordion/accordion_defaults_deprecated.js b/tests/unit/accordion/accordion_common_deprecated.js index 22d5e1289..22d5e1289 100644 --- a/tests/unit/accordion/accordion_defaults_deprecated.js +++ b/tests/unit/accordion/accordion_common_deprecated.js diff --git a/tests/unit/accordion/accordion_deprecated.html b/tests/unit/accordion/accordion_deprecated.html index 116eb43b5..dfb9fa90e 100644 --- a/tests/unit/accordion/accordion_deprecated.html +++ b/tests/unit/accordion/accordion_deprecated.html @@ -5,9 +5,12 @@ <title>jQuery UI Accordion Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.accordion" ], js: [ "ui/jquery.ui.core.js", @@ -17,13 +20,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="accordion_test_helpers.js"></script> - <script src="accordion_defaults_deprecated.js"></script> + <script src="accordion_common_deprecated.js"></script> <script src="accordion_core.js"></script> <script src="accordion_events.js"></script> <script src="accordion_methods.js"></script> @@ -91,7 +89,7 @@ <li><a href="?p=1.1.1.3">Amps</a></li> <li><a href="?p=1.1.1.4">Effects</a></li> <li><a href="?p=1.1.1.5">Accessories</a></li> - </ul> + </ul> </li> <li> <h2><a href="?p=1.1.2"><span>Bass</span></a></h2> @@ -103,7 +101,7 @@ <li><a href="?p=1.1.2.5">Accessories</a></li> <li><a href="?p=1.1.2.5">Accessories</a></li> <li><a href="?p=1.1.2.5">Accessories</a></li> - </ul> + </ul> </li> <li> <h2><a href="?p=1.1.3">Drums</a></h2> @@ -111,7 +109,7 @@ <li><a href="?p=1.1.3.2">Acoustic</a></li> <li><a href="?p=1.1.3.3">Electronic</a></li> <li><a href="?p=1.1.3.6">Accessories</a></li> - </ul> + </ul> </li> </ul> </div> diff --git a/tests/unit/accordion/all.html b/tests/unit/accordion/all.html index ec9c003d9..2fb783c1c 100644 --- a/tests/unit/accordion/all.html +++ b/tests/unit/accordion/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/all-active.html b/tests/unit/all-active.html index 89c10441d..b3e2fbcba 100644 --- a/tests/unit/all-active.html +++ b/tests/unit/all-active.html @@ -7,9 +7,9 @@ <script src="../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../external/qunit.css"> - <link rel="stylesheet" href="subsuiteRunner.css"> + <link rel="stylesheet" href="qunit-composite.css"> <script src="../../external/qunit.js"></script> - <script src="subsuiteRunner.js"></script> + <script src="qunit-composite.js"></script> <script> (function() { diff --git a/tests/unit/all.html b/tests/unit/all.html index e48b1ac0e..6d98df0f9 100644 --- a/tests/unit/all.html +++ b/tests/unit/all.html @@ -7,9 +7,9 @@ <script src="../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../external/qunit.css"> - <link rel="stylesheet" href="subsuiteRunner.css"> + <link rel="stylesheet" href="qunit-composite.css"> <script src="../../external/qunit.js"></script> - <script src="subsuiteRunner.js"></script> + <script src="qunit-composite.js"></script> <script> (function() { diff --git a/tests/unit/autocomplete/all.html b/tests/unit/autocomplete/all.html index 87cde75fb..e35777f65 100644 --- a/tests/unit/autocomplete/all.html +++ b/tests/unit/autocomplete/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/autocomplete/autocomplete.html b/tests/unit/autocomplete/autocomplete.html index 70d2ecfd1..571c62033 100644 --- a/tests/unit/autocomplete/autocomplete.html +++ b/tests/unit/autocomplete/autocomplete.html @@ -5,9 +5,12 @@ <title>jQuery UI Autocomplete Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.menu", "ui.autocomplete" ], js: [ "ui/jquery.ui.core.js", @@ -19,12 +22,7 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - - <script src="autocomplete_defaults.js"></script> + <script src="autocomplete_common.js"></script> <script src="autocomplete_core.js"></script> <script src="autocomplete_events.js"></script> <script src="autocomplete_methods.js"></script> diff --git a/tests/unit/autocomplete/autocomplete_defaults.js b/tests/unit/autocomplete/autocomplete_common.js index c090ce4df..c090ce4df 100644 --- a/tests/unit/autocomplete/autocomplete_defaults.js +++ b/tests/unit/autocomplete/autocomplete_common.js diff --git a/tests/unit/button/all.html b/tests/unit/button/all.html index 115743e94..6c46c9650 100644 --- a/tests/unit/button/all.html +++ b/tests/unit/button/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/button/button.html b/tests/unit/button/button.html index 5ec7e316a..b79ca1dc6 100644 --- a/tests/unit/button/button.html +++ b/tests/unit/button/button.html @@ -5,9 +5,12 @@ <title>jQuery UI Button Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.button" ], js: [ "ui/jquery.ui.core.js", @@ -17,13 +20,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="button_common.js"></script> <script src="button_core.js"></script> - <script src="button_defaults.js"></script> <script src="button_events.js"></script> <script src="button_methods.js"></script> <script src="button_options.js"></script> diff --git a/tests/unit/button/button_defaults.js b/tests/unit/button/button_common.js index ef22d3011..ef22d3011 100644 --- a/tests/unit/button/button_defaults.js +++ b/tests/unit/button/button_common.js diff --git a/tests/unit/core/all.html b/tests/unit/core/all.html index 78bbe9aef..e31d6905c 100644 --- a/tests/unit/core/all.html +++ b/tests/unit/core/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/core/core.html b/tests/unit/core/core.html index 3b1dc1fc8..272b15d2c 100644 --- a/tests/unit/core/core.html +++ b/tests/unit/core/core.html @@ -5,17 +5,15 @@ <title>jQuery UI Core Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> - <script> - loadResources({ - js: [ "ui/jquery.ui.core.js" ] - }); - </script> - <link rel="stylesheet" href="../../../external/qunit.css"> <script src="../../../external/qunit.js"></script> <script src="../../jquery.simulate.js"></script> <script src="../testsuite.js"></script> + <script> + TestHelpers.loadResources({ + js: [ "ui/jquery.ui.core.js" ] + }); + </script> <script src="core.js"></script> <script src="selector.js"></script> @@ -39,15 +37,13 @@ <ol id="qunit-tests"></ol> <div id="qunit-fixture"> -<img src="../images/jqueryui_32x32.png" usemap="#mymap" width="10", height="10"> +<img src="../images/jqueryui_32x32.png" usemap="#mymap" width="10" height="10" alt=""> <map name="mymap"> - <area shape="rect" coords="0,0,1,1" id="areaCoordsNoHref"> - <area shape="rect" coords="1,1,2,2" href="foo.html" id="areaCoordsHref"> - <area shape="rect" coords="0,0,0,0" href="foo.html" id="areaCoordsNoSizeHref"> - <area href="foo.html" id="areaNoCoordsHref"> + <area shape="rect" coords="1,1,2,2" href="foo.html" id="areaCoordsHref" alt=""> + <area href="foo.html" id="areaNoCoordsHref" alt=""> </map> <map name="mymap2"> - <area shape="rect" coords="1,1,2,2" href="foo.html" id="areaNoImg"> + <area shape="rect" coords="1,1,2,2" href="foo.html" id="areaNoImg" alt=""> </map> <form id="formNoTabindex"></form> diff --git a/tests/unit/core/selector.js b/tests/unit/core/selector.js index 2fb78025c..4309289c9 100644 --- a/tests/unit/core/selector.js +++ b/tests/unit/core/selector.js @@ -6,24 +6,24 @@ module("core - selectors"); function isFocusable(selector, msg) { - ok($(selector).is(':focusable'), msg + " - selector " + selector + " is focusable"); + QUnit.push($(selector).is(':focusable'), null, null, msg + " - selector " + selector + " is focusable"); } function isNotFocusable(selector, msg) { - ok($(selector).length && !$(selector).is(':focusable'), msg + " - selector " + selector + " is not focusable"); + QUnit.push($(selector).length && !$(selector).is(':focusable'), null, null, msg + " - selector " + selector + " is not focusable"); } function isTabbable(selector, msg) { - ok($(selector).is(':tabbable'), msg + " - selector " + selector + " is tabbable"); + QUnit.push($(selector).is(':tabbable'), null, null, msg + " - selector " + selector + " is tabbable"); } function isNotTabbable(selector, msg) { - ok($(selector).length && !$(selector).is(':tabbable'), msg + " - selector " + selector + " is not tabbable"); + QUnit.push($(selector).length && !$(selector).is(':tabbable'), null, null, msg + " - selector " + selector + " is not tabbable"); } test("data", function() { expect(15); - + var el; function shouldHaveData(msg) { ok(el.is(':data(test)'), msg); @@ -31,56 +31,56 @@ test("data", function() { function shouldNotHaveData(msg) { ok(!el.is(':data(test)'), msg); } - + el = $('<div>'); shouldNotHaveData('data never set'); - + el = $('<div>').data('test', null); shouldNotHaveData('data is null'); - + el = $('<div>').data('test', true); shouldHaveData('data set to true'); - + el = $('<div>').data('test', false); shouldNotHaveData('data set to false'); - + el = $('<div>').data('test', 0); shouldNotHaveData('data set to 0'); - + el = $('<div>').data('test', 1); shouldHaveData('data set to 1'); - + el = $('<div>').data('test', ''); shouldNotHaveData('data set to empty string'); - + el = $('<div>').data('test', 'foo'); shouldHaveData('data set to string'); - + el = $('<div>').data('test', []); shouldHaveData('data set to empty array'); - + el = $('<div>').data('test', [1]); shouldHaveData('data set to array'); - + el = $('<div>').data('test', {}); shouldHaveData('data set to empty object'); - + el = $('<div>').data('test', {foo: 'bar'}); shouldHaveData('data set to object'); - + el = $('<div>').data('test', new Date()); shouldHaveData('data set to date'); - + el = $('<div>').data('test', /test/); shouldHaveData('data set to regexp'); - + el = $('<div>').data('test', function() {}); shouldHaveData('data set to function'); }); test("focusable - visible, enabled elements", function() { expect(18); - + isNotFocusable('#formNoTabindex', 'form'); isFocusable('#formTabindex', 'form with tabindex'); isFocusable('#visibleAncestor-inputTypeNone', 'input, no type'); @@ -103,7 +103,7 @@ test("focusable - visible, enabled elements", function() { test("focusable - disabled elements", function() { expect(9); - + isNotFocusable('#disabledElement-inputTypeNone', 'input, no type'); isNotFocusable('#disabledElement-inputTypeText', 'input, type text'); isNotFocusable('#disabledElement-inputTypeCheckbox', 'input, type checkbox'); @@ -117,23 +117,23 @@ test("focusable - disabled elements", function() { test("focusable - hidden styles", function() { expect(8); - + isNotFocusable('#displayNoneAncestor-input', 'input, display: none parent'); isNotFocusable('#displayNoneAncestor-span', 'span with tabindex, display: none parent'); - + isNotFocusable('#visibilityHiddenAncestor-input', 'input, visibility: hidden parent'); isNotFocusable('#visibilityHiddenAncestor-span', 'span with tabindex, visibility: hidden parent'); - + isNotFocusable('#displayNone-input', 'input, display: none'); isNotFocusable('#visibilityHidden-input', 'input, visibility: hidden'); - + isNotFocusable('#displayNone-span', 'span with tabindex, display: none'); isNotFocusable('#visibilityHidden-span', 'span with tabindex, visibility: hidden'); }); test("focusable - natively focusable with various tabindex", function() { expect(4); - + isFocusable('#inputTabindex0', 'input, tabindex 0'); isFocusable('#inputTabindex10', 'input, tabindex 10'); isFocusable('#inputTabindex-1', 'input, tabindex -1'); @@ -142,7 +142,7 @@ test("focusable - natively focusable with various tabindex", function() { test("focusable - not natively focusable with various tabindex", function() { expect(4); - + isFocusable('#spanTabindex0', 'span, tabindex 0'); isFocusable('#spanTabindex10', 'span, tabindex 10'); isFocusable('#spanTabindex-1', 'span, tabindex -1'); @@ -150,16 +150,14 @@ test("focusable - not natively focusable with various tabindex", function() { }); test("focusable - area elements", function() { - isNotFocusable('#areaCoordsNoHref', 'coords but no href'); isFocusable('#areaCoordsHref', 'coords and href'); - isFocusable('#areaCoordsNoSizeHref', 'coords of zero px and href'); isFocusable('#areaNoCoordsHref', 'href but no coords'); isNotFocusable('#areaNoImg', 'not associated with an image'); }); test("tabbable - visible, enabled elements", function() { expect(18); - + isNotTabbable('#formNoTabindex', 'form'); isTabbable('#formTabindex', 'form with tabindex'); isTabbable('#visibleAncestor-inputTypeNone', 'input, no type'); @@ -182,7 +180,7 @@ test("tabbable - visible, enabled elements", function() { test("tabbable - disabled elements", function() { expect(9); - + isNotTabbable('#disabledElement-inputTypeNone', 'input, no type'); isNotTabbable('#disabledElement-inputTypeText', 'input, type text'); isNotTabbable('#disabledElement-inputTypeCheckbox', 'input, type checkbox'); @@ -196,23 +194,23 @@ test("tabbable - disabled elements", function() { test("tabbable - hidden styles", function() { expect(8); - + isNotTabbable('#displayNoneAncestor-input', 'input, display: none parent'); isNotTabbable('#displayNoneAncestor-span', 'span with tabindex, display: none parent'); - + isNotTabbable('#visibilityHiddenAncestor-input', 'input, visibility: hidden parent'); isNotTabbable('#visibilityHiddenAncestor-span', 'span with tabindex, visibility: hidden parent'); - + isNotTabbable('#displayNone-input', 'input, display: none'); isNotTabbable('#visibilityHidden-input', 'input, visibility: hidden'); - + isNotTabbable('#displayNone-span', 'span with tabindex, display: none'); isNotTabbable('#visibilityHidden-span', 'span with tabindex, visibility: hidden'); }); test("tabbable - natively tabbable with various tabindex", function() { expect(4); - + isTabbable('#inputTabindex0', 'input, tabindex 0'); isTabbable('#inputTabindex10', 'input, tabindex 10'); isNotTabbable('#inputTabindex-1', 'input, tabindex -1'); @@ -221,7 +219,7 @@ test("tabbable - natively tabbable with various tabindex", function() { test("tabbable - not natively tabbable with various tabindex", function() { expect(4); - + isTabbable('#spanTabindex0', 'span, tabindex 0'); isTabbable('#spanTabindex10', 'span, tabindex 10'); isNotTabbable('#spanTabindex-1', 'span, tabindex -1'); @@ -229,9 +227,7 @@ test("tabbable - not natively tabbable with various tabindex", function() { }); test("tabbable - area elements", function() { - isNotTabbable('#areaCoordsNoHref', 'coords but no href'); isTabbable('#areaCoordsHref', 'coords and href'); - isTabbable('#areaCoordsNoSizeHref', 'coords of zero px and href'); isTabbable('#areaNoCoordsHref', 'href but no coords'); isNotTabbable('#areaNoImg', 'not associated with an image'); }); diff --git a/tests/unit/datepicker/all.html b/tests/unit/datepicker/all.html index 1540705f8..c62c7c07d 100644 --- a/tests/unit/datepicker/all.html +++ b/tests/unit/datepicker/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/datepicker/datepicker.html b/tests/unit/datepicker/datepicker.html index 592db53cc..bfff32d32 100644 --- a/tests/unit/datepicker/datepicker.html +++ b/tests/unit/datepicker/datepicker.html @@ -5,9 +5,12 @@ <title>jQuery UI Datepicker Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.datepicker" ], js: [ "ui/jquery.ui.core.js", @@ -19,11 +22,6 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="datepicker_core.js"></script> <script src="datepicker_defaults.js"></script> <script src="datepicker_events.js"></script> diff --git a/tests/unit/dialog/all.html b/tests/unit/dialog/all.html index 973119c08..b1c69c6c9 100644 --- a/tests/unit/dialog/all.html +++ b/tests/unit/dialog/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/dialog/dialog.html b/tests/unit/dialog/dialog.html index 94b20a225..d804807f2 100644 --- a/tests/unit/dialog/dialog.html +++ b/tests/unit/dialog/dialog.html @@ -6,9 +6,12 @@ <script src="../../jquery.js"></script> <script src="../../../external/jquery.bgiframe-2.1.2.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.dialog" ], js: [ "ui/jquery.ui.core.js", @@ -22,13 +25,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="dialog_common.js"></script> <script src="dialog_core.js"></script> - <script src="dialog_defaults.js"></script> <script src="dialog_events.js"></script> <script src="dialog_methods.js"></script> <script src="dialog_options.js"></script> diff --git a/tests/unit/dialog/dialog_defaults.js b/tests/unit/dialog/dialog_common.js index 623908da7..623908da7 100644 --- a/tests/unit/dialog/dialog_defaults.js +++ b/tests/unit/dialog/dialog_common.js diff --git a/tests/unit/draggable/all.html b/tests/unit/draggable/all.html index 1b2a511a5..75df351ad 100644 --- a/tests/unit/draggable/all.html +++ b/tests/unit/draggable/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/draggable/draggable.html b/tests/unit/draggable/draggable.html index 5be71f460..09bc191c9 100644 --- a/tests/unit/draggable/draggable.html +++ b/tests/unit/draggable/draggable.html @@ -5,9 +5,12 @@ <title>jQuery UI Draggable Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core" ], js: [ "ui/jquery.ui.core.js", @@ -18,13 +21,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="draggable_common.js"></script> <script src="draggable_core.js"></script> - <script src="draggable_defaults.js"></script> <script src="draggable_events.js"></script> <script src="draggable_methods.js"></script> <script src="draggable_options.js"></script> diff --git a/tests/unit/draggable/draggable_defaults.js b/tests/unit/draggable/draggable_common.js index b47b139cd..b47b139cd 100644 --- a/tests/unit/draggable/draggable_defaults.js +++ b/tests/unit/draggable/draggable_common.js diff --git a/tests/unit/droppable/all.html b/tests/unit/droppable/all.html index 535f41521..aa24ed7e1 100644 --- a/tests/unit/droppable/all.html +++ b/tests/unit/droppable/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/droppable/droppable.html b/tests/unit/droppable/droppable.html index abf94f0c7..49ebf6beb 100644 --- a/tests/unit/droppable/droppable.html +++ b/tests/unit/droppable/droppable.html @@ -5,9 +5,12 @@ <title>jQuery UI Droppable Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core" ], js: [ "ui/jquery.ui.core.js", @@ -19,13 +22,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="droppable_common.js"></script> <script src="droppable_core.js"></script> - <script src="droppable_defaults.js"></script> <script src="droppable_events.js"></script> <script src="droppable_methods.js"></script> <script src="droppable_options.js"></script> diff --git a/tests/unit/droppable/droppable_defaults.js b/tests/unit/droppable/droppable_common.js index 985dba06d..985dba06d 100644 --- a/tests/unit/droppable/droppable_defaults.js +++ b/tests/unit/droppable/droppable_common.js diff --git a/tests/unit/effects/all.html b/tests/unit/effects/all.html index 0ef901292..59500588c 100644 --- a/tests/unit/effects/all.html +++ b/tests/unit/effects/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html index 06023c55d..1fd94182d 100644 --- a/tests/unit/effects/effects.html +++ b/tests/unit/effects/effects.html @@ -8,9 +8,12 @@ <script> $.uiBackCompat = false; </script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ js: [ "ui/jquery.effects.core.js", "ui/jquery.effects.blind.js", @@ -30,10 +33,6 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> <script src="effects_core.js"></script> <script src="effects_scale.js"></script> diff --git a/tests/unit/menu/all.html b/tests/unit/menu/all.html index a58e15299..475c1b717 100644 --- a/tests/unit/menu/all.html +++ b/tests/unit/menu/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/menu/menu.html b/tests/unit/menu/menu.html index 9a598ec8d..fca45697f 100644 --- a/tests/unit/menu/menu.html +++ b/tests/unit/menu/menu.html @@ -5,9 +5,12 @@ <title>jQuery UI Menu Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.menu" ], js: [ "ui/jquery.ui.core.js", @@ -17,14 +20,9 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="menu_test_helpers.js"></script> + <script src="menu_common.js"></script> <script src="menu_core.js"></script> - <script src="menu_defaults.js"></script> <script src="menu_events.js"></script> <script src="menu_methods.js"></script> <script src="menu_options.js"></script> diff --git a/tests/unit/menu/menu_defaults.js b/tests/unit/menu/menu_common.js index ddcdbebf2..ddcdbebf2 100644 --- a/tests/unit/menu/menu_defaults.js +++ b/tests/unit/menu/menu_common.js diff --git a/tests/unit/position/all.html b/tests/unit/position/all.html index fa3ecf23d..d76f9bbd8 100644 --- a/tests/unit/position/all.html +++ b/tests/unit/position/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/position/position.html b/tests/unit/position/position.html index 115adc3e9..518e1f960 100644 --- a/tests/unit/position/position.html +++ b/tests/unit/position/position.html @@ -8,20 +8,17 @@ <script> $.uiBackCompat = false; </script> - <script src="../../resource_loader.js"></script> - <script> - loadResources({ - js: [ "ui/jquery.ui.position.js" ] - }); - </script> - <link rel="stylesheet" href="../../../external/qunit.css"> <script src="../../../external/qunit.js"></script> <script src="../../jquery.simulate.js"></script> <script src="../testsuite.js"></script> + <script> + TestHelpers.loadResources({ + js: [ "ui/jquery.ui.position.js" ] + }); + </script> <script src="position_core.js"></script> - <script src="position_core_within.js"></script> <script src="../swarminject.js"></script> </head> @@ -41,29 +38,20 @@ elements smaller than 10px have a line-height set on them to avoid a bug in IE6 --> <div id="qunit-fixture" style="top: 0; left: 0; z-index:1"> - <div id="within-container"> - <div id="el1" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div> - <div id="el2" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div> - <div id="parent" style="position: absolute; width: 6px; height: 6px; top: 4px; left: 4px; line-height: 6px;"></div> - - <div style="position: absolute; top: 0px; left: 0px"> - <div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div> - <div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div> - </div> - - <div style="position: absolute; top: 200px; left: 100px;"> - <div id="el-offset-100-200" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div> - <div style="position: absolute; top: 100px; left: 50px;"> - <div id="el-two-offset-150-300" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div> - <div id="el-fixed" style="position: fixed; top: 200px; left: 200px;"></div> - </div> - </div> + <div id="el1" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div> + <div id="el2" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div> + <div id="parent" style="position: absolute; width: 6px; height: 6px; top: 4px; left: 4px; line-height: 6px;"></div> + <div id="within" style="position: absolute; width: 12px; height: 12px; top: 2px; left: 0px;"></div> + + <div style="position: absolute; top: 0px; left: 0px"> + <div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div> + <div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div> + </div> - <div style="position: absolute; height: 5000px; width: 5000px;"></div> + <div style="position: absolute; height: 5000px; width: 5000px;"></div> - <div id="fractions-parent" style="position: absolute; left: 10.7432222px; top: 10.532325px; height: 30px; width: 201px;"> - <div id="fractions-element"></div> - </div> + <div id="fractions-parent" style="position: absolute; left: 10.7432222px; top: 10.532325px; height: 30px; width: 201px;"> + <div id="fractions-element"></div> </div> <div id="bug-5280" style="height: 30px; width: 201px;"> diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js index 5c86e7887..0ebcabef3 100644 --- a/tests/unit/position/position_core.js +++ b/tests/unit/position/position_core.js @@ -1,13 +1,24 @@ (function( $ ) { -function scrollTopSupport() { - $( window ).scrollTop( 1 ); - return $( window ).scrollTop() === 1; -} - -module( "position" ); +var win = $( window ), + scrollTopSupport = function() { + var support = win.scrollTop( 1 ).scrollTop() === 1; + win.scrollTop( 0 ); + scrollTopSupport = function() { + return support; + }; + return support; + }; + +module( "position", { + setup: function() { + win.scrollTop( 0 ).scrollLeft( 0 ); + } +}); test( "my, at, of", function() { + expect( 4 ); + $( "#elx" ).position({ my: "left top", at: "left top", @@ -42,6 +53,8 @@ test( "my, at, of", function() { }); test( "multiple elements", function() { + expect( 3 ); + var elements = $( "#el1, #el2" ), result = elements.position({ my: "left top", @@ -58,8 +71,9 @@ test( "multiple elements", function() { }); test( "positions", function() { - var definitions = [], - offsets = { + expect( 18 ); + + var offsets = { left: 0, center: 3, right: 6, @@ -68,33 +82,32 @@ test( "positions", function() { }, start = { left: 4, top: 4 }, el = $( "#el1" ); + $.each( [ 0, 1 ], function( my ) { $.each( [ "top", "center", "bottom" ], function( vindex, vertical ) { $.each( [ "left", "center", "right" ], function( hindex, horizontal ) { - definitions.push({ - my: my ? horizontal + " " + vertical : "left top", - at: !my ? horizontal + " " + vertical : "left top", - result: { - top: my ? start.top - offsets[ vertical ] : start.top + offsets[ vertical ], - left: my ? start.left - offsets[ horizontal ] : start.left + offsets[ horizontal ] - } + var _my = my ? horizontal + " " + vertical : "left top", + _at = !my ? horizontal + " " + vertical : "left top"; + el.position({ + my: _my, + at: _at, + of: "#parent", + collision: "none" }); + deepEqual( el.offset(), { + top: start.top + offsets[ vertical ] * (my ? -1 : 1), + left: start.left + offsets[ horizontal ] * (my ? -1 : 1) + }, "Position via " + QUnit.jsDump.parse({ my: _my, at: _at }) ); }); }); }); - $.each( definitions, function( index, definition ) { - el.position({ - my: definition.my, - at: definition.at, - of: "#parent", - collision: "none" - }); - deepEqual( el.offset(), definition.result, - "Position via " + QUnit.jsDump.parse({ my:definition.my, at:definition.at }) ); - }); }); test( "of", function() { + expect( 9 + (scrollTopSupport() ? 1 : 0) ); + + var event; + $( "#elx" ).position({ my: "left top", at: "left top", @@ -141,7 +154,7 @@ test( "of", function() { left: $( document ).width() - 10 }, "document as jQuery object" ); - $( window ).scrollTop( 0 ); + win.scrollTop( 0 ); $( "#elx" ).position({ my: "right bottom", @@ -150,23 +163,23 @@ test( "of", function() { collision: "none" }); deepEqual( $( "#elx" ).offset(), { - top: $( window ).height() - 10, - left: $( window ).width() - 10 + top: win.height() - 10, + left: win.width() - 10 }, "window" ); $( "#elx" ).position({ my: "right bottom", at: "right bottom", - of: $( window ), + of: win, collision: "none" }); deepEqual( $( "#elx" ).offset(), { - top: $( window ).height() - 10, - left: $( window ).width() - 10 + top: win.height() - 10, + left: win.width() - 10 }, "window as jQuery object" ); if ( scrollTopSupport() ) { - $( window ).scrollTop( 500 ).scrollLeft( 200 ); + win.scrollTop( 500 ).scrollLeft( 200 ); $( "#elx" ).position({ my: "right bottom", at: "right bottom", @@ -174,13 +187,13 @@ test( "of", function() { collision: "none" }); deepEqual( $( "#elx" ).offset(), { - top: $( window ).height() + 500 - 10, - left: $( window ).width() + 200 - 10 + top: win.height() + 500 - 10, + left: win.width() + 200 - 10 }, "window, scrolled" ); - $( window ).scrollTop( 0 ).scrollLeft( 0 ); + win.scrollTop( 0 ).scrollLeft( 0 ); } - var event = $.extend( $.Event( "someEvent" ), { pageX: 200, pageY: 300 } ); + event = $.extend( $.Event( "someEvent" ), { pageX: 200, pageY: 300 } ); $( "#elx" ).position({ my: "left top", at: "left top", @@ -206,6 +219,8 @@ test( "of", function() { }); test( "offsets", function() { + expect( 4 ); + $( "#elx" ).position({ my: "left top", at: "left+10 bottom+10", @@ -272,7 +287,7 @@ function collisionTest( config, result, msg ) { var elem = $( "#elx" ).position( $.extend({ my: "left top", at: "right bottom", - of: window + of: "#parent" }, config ) ); deepEqual( elem.offset(), result, msg ); } @@ -284,239 +299,279 @@ function collisionTest2( config, result, msg ) { }, config ), result, msg ); } -test( "collision: fit, no offset", function() { - collisionTest({ - collision: "fit" - }, { top: $( window ).height() - 10, left: $( window ).width() - 10 }, "right bottom" ); +test( "collision: fit, no collision", function() { + expect( 2 ); - collisionTest2({ + collisionTest({ collision: "fit" - }, { top: 0, left: 0 }, "left top" ); -}); + }, { + top: 10, + left: 10 + }, "no offset" ); -test( "collision: fit, with offset", function() { collisionTest({ - collision: "fit", + collition: "fit", at: "right+2 bottom+3" - }, { top: $(window).height() - 10, left: $(window).width() - 10 }, "right bottom"); + }, { + top: 13, + left: 12 + }, "with offset" ); +}); + +test( "collision: fit, collision", function() { + expect( 2 + (scrollTopSupport() ? 1 : 0) ); collisionTest2({ - collision: "fit", - at: "left+2 top+3" - }, { top: 0, left: 0 }, "left top, positive offset" ); + collision: "fit" + }, { + top: 0, + left: 0 + }, "no offset" ); collisionTest2({ collision: "fit", - at: "left-2 top-3" - }, { top: 0, left: 0 }, "left top, negative offset" ); -}); + at: "left+2 top+3" + }, { + top: 0, + left: 0 + }, "with offset" ); -test( "collision: fit, window scrolled", function() { if ( scrollTopSupport() ) { - var win = $( window ); win.scrollTop( 300 ).scrollLeft( 200 ); - collisionTest({ - collision: "fit", - at: "left-100 top-100" - }, { top: 300, left: 200 }, "top left" ); - collisionTest2({ - collision: "fit", - at: "right+100 bottom+100" - }, { top: 300 + win.height() - 10, left: 200 + win.width() - 10 }, "right bottom" ); + collision: "fit" + }, { + top: 300, + left: 200 + }, "window scrolled" ); win.scrollTop( 0 ).scrollLeft( 0 ); } }); -test( "collision: flip, no offset", function() { - collisionTest({ - collision: "flip" - }, { top: $( window ).height(), left: $( window ).width() }, "left top" ); +test( "collision: flip, no collision", function() { + expect( 2 ); - collisionTest2({ + collisionTest({ collision: "flip" - }, { top: -10, left: -10 }, "right bottom" ); -}); + }, { + top: 10, + left: 10 + }, "no offset" ); -test( "collision: flip, with offset", function() { collisionTest({ collision: "flip", at: "right+2 bottom+3" - }, { top: $( window ).height() + 3, left: $( window ).width() + 2 }, "left top, with offset added" ); + }, { + top: 13, + left: 12 + }, "with offset" ); +}); + +test( "collision: flip, collision", function() { + expect( 2 ); collisionTest2({ - collision: "flip", - at: "left+2 top+3" - }, { top: -7, left: -8 }, "bottom, positive offset" ); + collision: "flip" + }, { + top: 10, + left: 10 + }, "no offset" ); collisionTest2({ collision: "flip", - at: "left-2 top-3" - }, { top: -13, left: -12 }, "right bottom, negative offset" ); + at: "left+2 top+3" + }, { + top: 7, + left: 8 + }, "with offset" ); }); -test( "collision: none, no offset", function() { - collisionTest({ - collision: "none" - }, { top: $( window ).height(), left: $( window ).width() }, "left top" ); +test( "collision: flipfit, no collision", function() { + expect( 2 ); - collisionTest2({ - collision: "none" - }, { top: -10, left: -10 }, "moved to the right bottom" ); -}); + collisionTest({ + collision: "flipfit" + }, { + top: 10, + left: 10 + }, "no offset" ); -test( "collision: none, with offset", function() { collisionTest({ - collision: "none", + collision: "flipfit", at: "right+2 bottom+3" - }, { top: $( window ).height() + 3, left: $( window ).width() + 2 }, "right bottom, with offset added" ); + }, { + top: 13, + left: 12 + }, "with offset" ); +}); + +test( "collision: flipfit, collision", function() { + expect( 2 ); collisionTest2({ - collision: "none", - at: "left+2 top+3" - }, { top: -7, left: -8 }, "left top, positive offset" ); + collision: "flipfit" + }, { + top: 10, + left: 10 + }, "no offset" ); collisionTest2({ - collision: "none", - at: "left-2 top-3" - }, { top: -13, left: -12 }, "left top, negative offset" ); + collision: "flipfit", + at: "left+2 top+3" + }, { + top: 7, + left: 8 + }, "with offset" ); }); -test( "collision: fit, with margin", function() { - $( "#elx" ).css( "margin", 10 ); +test( "collision: none, no collision", function() { + expect( 2 ); collisionTest({ - collision: "fit" - }, { top: $( window ).height() - 20, left: $( window ).width() - 20 }, "right bottom" ); + collision: "none" + }, { + top: 10, + left: 10 + }, "no offset" ); - collisionTest2({ - collision: "fit" - }, { top: 10, left: 10 }, "left top" ); + collisionTest({ + collision: "none", + at: "right+2 bottom+3" + }, { + top: 13, + left: 12 + }, "with offset" ); +}); - $( "#elx" ).css({ - "margin-left": 5, - "margin-top": 5 - }); +test( "collision: none, collision", function() { + expect( 2 ); - collisionTest({ - collision: "fit" - }, { top: $( window ).height() - 20, left: $( window ).width() - 20 }, "right bottom" ); + collisionTest2({ + collision: "none" + }, { + top: -6, + left: -6 + }, "no offset" ); collisionTest2({ - collision: "fit" - }, { top: 5, left: 5 }, "left top" ); + collision: "none", + at: "left+2 top+3" + }, { + top: -3, + left: -4 + }, "with offset" ); +}); + +test( "collision: fit, with margin", function() { + expect( 2 ); $( "#elx" ).css({ - "margin-right": 15, - "margin-bottom": 15 + marginTop: 6, + marginLeft: 4 }); collisionTest({ collision: "fit" - }, { top: $( window ).height() - 25, left: $( window ).width() - 25 }, "right bottom" ); + }, { + top: 10, + left: 10 + }, "right bottom" ); collisionTest2({ collision: "fit" - }, { top: 5, left: 5 }, "left top" ); + }, { + top: 6, + left: 4 + }, "left top" ); }); test( "collision: flip, with margin", function() { - $( "#elx" ).css( "margin", 10 ); - - collisionTest({ - collision: "flip", - at: "left top" - }, { top: 0, left: 0 }, "left top" ); - - collisionTest2({ - collision: "flip", - at: "right bottom" - }, { top: $( window ).height() - 10, left: $( window ).width() - 10 }, "right bottom" ); -}); - -test( "addClass: flipped left", function() { - var elem = $( "#elx" ).position( { - my: "left center", - of: window, - collision: "flip", - at: "right center" - }); + expect( 3 ); - deepEqual( elem.hasClass( 'ui-flipped-left' ), false, 'Has ui-flipped-left class' ); - - elem.position({ - my: "right center", - of: window, - collision: "flip", - at: "left center" + $( "#elx" ).css({ + marginTop: 6, + marginLeft: 4 }); - deepEqual( elem.hasClass( 'ui-flipped-left' ), false, 'Removed ui-flipped-left class' ); -}); - -test( "addClass: flipped top", function() { - var elem = $( "#elx" ).position( { - my: "left top", - of: window, - collision: "flip", - at: "right bottom" - }); + collisionTest({ + collision: "flip" + }, { + top: 10, + left: 10 + }, "left top" ); - deepEqual( elem.hasClass( 'ui-flipped-top' ), false, 'Has ui-flipped-top class' ); + collisionTest2({ + collision: "flip" + }, { + top: 10, + left: 10 + }, "right bottom" ); - elem.position( { - my: "left bottom", - of: window, + collisionTest2({ collision: "flip", - at: "right top" - }); - - deepEqual( elem.hasClass( 'ui-flipped-top' ), false, 'Removed ui-flipped-top class' ); + my: "left top" + }, { + top: 0, + left: 4 + }, "right bottom" ); }); -test( "addClass: flipped right", function() { - var elem = $( "#elx" ).position( { - my: "right center", - of: window, - collision: "flip", - at: "left center" - }); - - deepEqual( elem.hasClass( 'ui-flipped-right' ), false, 'Has ui-flipped-right class' ); - - elem.position( { - my: "left center", - of: window, - collision: "flip", - at: "right center" - }); +test( "within", function() { + expect( 6 ); - deepEqual( elem.hasClass( 'ui-flipped-right' ), false, 'Removed ui-flipped-right class' ); + collisionTest({ + within: "#within", + collision: "fit" + }, { + top: 4, + left: 2 + }, "fit - right bottom" ); -}); + collisionTest2({ + within: "#within", + collision: "fit" + }, { + top: 2, + left: 0 + }, "fit - left top" ); -test( "addClass: flipped bottom", function() { - var elem = $( "#elx" ).position( { - my: "left bottom", - of: window, - collision: "flip", - at: "right top" - }); + collisionTest({ + within: "#within", + collision: "flip" + }, { + top: 10, + left: -6 + }, "flip - right bottom" ); - deepEqual( elem.hasClass( 'ui-flipped-bottom' ), false, 'Has ui-flipped-bottom class' ); + collisionTest2({ + within: "#within", + collision: "flip" + }, { + top: 10, + left: -6 + }, "flip - left top" ); - elem.position( { - my: "left top", - of: window, - collision: "flip", - at: "right bottom" - }); + collisionTest({ + within: "#within", + collision: "flipfit" + }, { + top: 4, + left: 0 + }, "flipfit - right bottom" ); - deepEqual( elem.hasClass( 'ui-flipped-bottom' ), false, 'Removed ui-flipped-bottom class' ); + collisionTest2({ + within: "#within", + collision: "flipfit" + }, { + top: 4, + left: 0 + }, "flipfit - left top" ); }); test( "fractions", function() { + expect( 1 ); + $( "#fractions-element" ).position({ my: "left top", at: "left top", @@ -527,6 +582,8 @@ test( "fractions", function() { }); test( "bug #5280: consistent results (avoid fractional values)", function() { + expect( 1 ); + var wrapper = $( "#bug-5280" ), elem = wrapper.children(), offset1 = elem.position({ diff --git a/tests/unit/position/position_core_within.js b/tests/unit/position/position_core_within.js deleted file mode 100644 index 042e881eb..000000000 --- a/tests/unit/position/position_core_within.js +++ /dev/null @@ -1,540 +0,0 @@ -(function( $ ) { - -function scrollTopSupport() { - $( window ).scrollTop( 1 ); - return $( window ).scrollTop() === 1; -} - -module( "position - within", { - setup: function(){ - $("#within-container").css({"width": "70px", "height": "70px", "top": "20px", "left": "20px", "position": "relative"}).show(); - } -}); - -var addTop = -20, - addLeft = -20; - -$.fn.addOffsets = function() { - var elOffset = this.offset(), - offset = $("#within-container").offset(); - - elOffset.top -= offset.top; - elOffset.left -= offset.left; - - return {top: elOffset.top - offset.top, left: elOffset.left - offset.left }; -}; - -test( "my, at, of", function() { - var within = $("#within-container"); - - $( "#elx" ).position({ - my: "left top", - at: "left top", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 40, left: addLeft + 40 }, "left top, left top" ); - - $( "#elx" ).position({ - my: "left top", - at: "left bottom", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 60, left: addLeft + 40 }, "left top, left bottom" ); - - $( "#elx" ).position({ - my: "left", - at: "bottom", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 55, left: addLeft + 50 }, "left, bottom" ); - - $( "#elx" ).position({ - my: "left foo", - at: "bar baz", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 45, left: addLeft +50 }, "left foo, bar baz" ); -}); - -test( "multiple elements", function() { - var elements = $( "#el1, #el2" ), - result = elements.position({ - my: "left top", - at: "left bottom", - of: "#parent", - collision: "none", - within: $("#within-container") - }), - expected = { top: addTop + 10, left: addLeft + 4 }; - - deepEqual( result, elements ); - elements.each(function() { - deepEqual( $( this ).addOffsets(), expected ); - }); -}); - -test( "positions", function() { - var definitions = [], - offsets = { - left: 0, - center: 3, - right: 6, - top: 0, - bottom: 6 - }, - start = { left: 4, top: 4 }, - el = $( "#el1" ); - $.each( [ 0, 1 ], function( my ) { - $.each( [ "top", "center", "bottom" ], function( vindex, vertical ) { - $.each( [ "left", "center", "right" ], function( hindex, horizontal ) { - definitions.push({ - my: my ? horizontal + " " + vertical : "left top", - at: !my ? horizontal + " " + vertical : "left top", - result: { - top: addTop + (my ? start.top - offsets[ vertical ] : start.top + offsets[ vertical ]), - left: addLeft + (my ? start.left - offsets[ horizontal ] : start.left + offsets[ horizontal ]) - } - }); - }); - }); - }); - $.each( definitions, function( index, definition ) { - el.position({ - my: definition.my, - at: definition.at, - of: "#parent", - collision: "none", - within: $("#within-container") - }); - deepEqual( el.addOffsets(), definition.result, - "Position via " + QUnit.jsDump.parse({ my:definition.my, at:definition.at }) ); - }); -}); - -test( "of", function() { - var event, - within = $( "#within-container" ); - - $( "#elx" ).position({ - my: "left top", - at: "left top", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 40, left: addLeft + 40 }, "selector" ); - - $( "#elx" ).position({ - my: "left top", - at: "left bottom", - of: $( "#parentx"), - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 60, left: addLeft + 40 }, "jQuery object" ); - - $( "#elx" ).position({ - my: "left top", - at: "left top", - of: $( "#parentx" )[ 0 ], - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 40, left: addLeft + 40 }, "DOM element" ); - - event = $.extend( $.Event( "someEvent" ), { pageX: 200, pageY: 300 } ); - $( "#elx" ).position({ - my: "left top", - at: "left top", - of: event, - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).offset(), { - top: 300, - left: 200 - }, "event - left top, left top" ); - - event = $.extend( $.Event( "someEvent" ), { pageX: 400, pageY: 600 } ); - $( "#elx" ).position({ - my: "left top", - at: "right bottom", - of: event, - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).offset(), { - top: 600, - left: 400 - }, "event - left top, right bottom" ); -}); - -test( "within:offsets", function() { - var within = $("#within-container"); - - $( "#elx" ).position({ - my: "left top", - at: "left+10 bottom+10", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 70, left: addLeft + 50 }, "offsets in at" ); - - $( "#elx" ).position({ - my: "left+10 top-10", - at: "left bottom", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 50, left: addLeft + 50 }, "offsets in my" ); - - $( "#elx" ).position({ - my: "left top", - at: "left+50% bottom-10%", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 58, left: addLeft + 50 }, "percentage offsets in at" ); - - $( "#elx" ).position({ - my: "left-30% top+50%", - at: "left bottom", - of: "#parentx", - collision: "none", - within: within - }); - deepEqual( $( "#elx" ).addOffsets(), { top: addTop + 65, left: addLeft + 37 }, "percentage offsets in my" ); -}); - -test( "using", function() { - expect( 6 ); - - var within = $( "#within-container" ), - count = 0, - elems = $( "#el1, #el2" ), - expectedPosition = { top: addTop + 40, left: addLeft + 40 }, - originalPosition = elems.position({ - my: "right bottom", - at: "right bottom", - of: "#parentx", - collision: "none", - within: within - }).addOffsets(); - - elems.position({ - my: "left top", - at: "left top", - of: "#parentx", - using: function( position ) { - position.top -= within.offset().top; - position.left -= within.offset().left; - deepEqual( this, elems[ count ], "correct context for call #" + count ); - deepEqual( position, expectedPosition, "correct position for call #" + count ); - count++; - }, - within: within - }); - - elems.each(function() { - deepEqual( $( this ).addOffsets(), originalPosition, "elements not moved" ); - }); -}); - -function collisionTest( config, result, msg ) { - var within = $( "#within-container" ), - elem = $( "#elx" ).position( $.extend({ - my: "left top", - at: "right bottom", - of: "#parentx", - within: within - }, config ) ); - - deepEqual( elem.addOffsets(), result, msg ); -} - -function collisionTest2( config, result, msg ) { - collisionTest( $.extend({ - my: "right bottom", - at: "left top" - }, config ), result, msg ); -} - -test( "collision: fit, no offset", function() { - var within = $("#within-container"), - of = $("#parentx"); - - collisionTest({ - collision: "fit" - }, { top: addTop + of.position().top + of.height() - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).height, left: addLeft + of.position().left + of.width() - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).width }, "right bottom" ); - - collisionTest2({ - collision: "fit" - }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" ); -}); - - -test( "collision: fit, with offset", function() { - var within = $("#within-container"), - of = $("#parentx"); - - collisionTest({ - collision: "fit", - at: "right+2 bottom+3" - }, { top: addTop + of.position().top + of.height() - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).height, left: addLeft + of.position().left + of.width() - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).width }, "right bottom"); - - collisionTest2({ - collision: "fit", - at: "left+2 top+3" - }, { top: addTop + of.position().top - 7, left: addLeft + of.position().left - 8 }, "left top, positive offset" ); - - collisionTest2({ - collision: "fit", - at: "left-2 top-3" - }, { top: addTop + of.position().top - 13, left: addLeft + of.position().left - 12 }, "left top, negative offset" ); -}); - -test( "collision: none, within scrolled", function() { - if ( scrollTopSupport() ) { - var within = $("#within-container").css({"width": "1000px", "height": "800px", "overflow": "auto"}), - of = $("#parentx"); - within.scrollTop( 300 ).scrollLeft( 150 ); - - collisionTest({ - collision: "none", - at: "left-100 top-100" - }, { top: of.offset().top + addTop - 100 - of.height(), left: of.offset().left + addLeft - 100 - of.width() }, "top left" ); - collisionTest2({ - collision: "none", - at: "right+100 bottom+100" - }, { top: of.offset().top + addTop + 100 - 10, left: of.offset().left + addLeft + 100 - 10 }, "right bottom" ); - within.scrollTop( 0 ).scrollLeft( 0 ); - } -}); - -test( "collision: flip, no offset", function() { - var within = $("#within-container"), - of = $("#parentx"); - - collisionTest({ - collision: "flip" - }, { top: addTop + of.position().top + of.height(), left: addLeft + of.position().left + of.width() }, "left top" ); - - collisionTest2({ - collision: "flip" - }, { top: addTop + of.position().top - 10, left: addTop + of.position().top - 10 }, "right bottom" ); -}); - -test( "collision: flip, with offset", function() { - var within = $("#within-container"), - of = $("#parentx"); - - collisionTest({ - collision: "flip", - at: "right+2 bottom+3" - }, { top: addTop + of.position().top - 13, left: addLeft + of.position().left - 12 }, "left top, with offset added" ); - - collisionTest2({ - collision: "flip", - at: "left+2 top+3" - }, { top: addTop + of.position().top - 10 + 3, left: addLeft + of.position().left - 10 + 2 }, "right bottom, positive offset" ); - - collisionTest2({ - collision: "flip", - at: "left-2 top-3" - }, { top: addTop + of.position().top - 13, left: addLeft + of.position().left - 12 }, "right bottom, negative offset" ); -}); - -test( "collision: none, no offset", function() { - var within = $("#within-container"), - of = $("#parentx"); - - collisionTest({ - collision: "none" - }, { top: addTop + of.position().top + of.height(), left: addLeft + of.position().left + of.width() }, "left top" ); - - collisionTest2({ - collision: "none" - }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "right bottom" ); -}); - -test( "collision: none, with offset", function() { - var within = $("#within-container"), - of = $("#parentx"); - - collisionTest({ - collision: "none", - at: "right+2 bottom+3" - }, { top: addTop + of.position().top + of.height() + 3, left: addLeft + of.position().left + of.width() + 2 }, "right bottom, with offset added" ); - - collisionTest2({ - collision: "none", - at: "left+2 top+3" - }, { top: addTop + of.position().top - 7, left: addTop + of.position().top - 8 }, "left top, positive offset" ); - - collisionTest2({ - collision: "none", - at: "left-2 top-3" - }, { top: addTop + of.position().top - 13, left: addTop + of.position().top - 12 }, "left top, negative offset" ); -}); - -test( "collision: fit, with margin", function() { - var within = $("#within-container"), - of = $("#parentx"); - - $( "#elx" ).css( "margin", 10 ); - - collisionTest({ - collision: "fit" - }, { top: addTop + of.position().top + of.height() - 10 - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).height, left: addLeft + of.position().left + of.width() - 10 - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).width }, "right bottom" ); - - collisionTest2({ - collision: "fit" - }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" ); - - $( "#elx" ).css({ - "margin-left": 5, - "margin-top": 5 - }); - - collisionTest({ - collision: "fit" - }, { top: addTop + of.position().top + of.height() - 10 - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).height, left: addLeft + of.position().left + of.width() - 10 - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).width }, "right bottom" ); - - collisionTest2({ - collision: "fit" - }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" ); - - $( "#elx" ).css({ - "margin-right": 15, - "margin-bottom": 15 - }); - - collisionTest({ - collision: "fit" - }, { top: addTop + of.position().top + of.height() - 15 - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).height, left: addLeft + of.position().left + of.width() - 15 - $.position.getScrollInfo( $.position.getWithinInfo( within ) ).width }, "right bottom" ); - - collisionTest2({ - collision: "fit" - }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" ); -}); - -test( "collision: flip, with margin", function() { - var within = $("#within-container"), - of = $("#parentx"); - - $( "#elx" ).css( "margin", 10 ); - - collisionTest({ - collision: "flip" - }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "left top" ); - - collisionTest2({ - collision: "flip" - }, { top: addTop + of.position().top - 10, left: addLeft + of.position().left - 10 }, "right bottom" ); - - $( "#elx" ).css( "margin", 0 ); -}); - -test( "addClass: flipped left", function() { - var within = $("#within-container"), - elem = $( "#elx" ).position( { - my: "left center", - of: within[0], - within: within, - collision: "flip", - at: "right center" - }); - - deepEqual( elem.hasClass( 'ui-flipped-left' ), false, 'Has ui-flipped-left class' ); - - elem.position({ - my: "right center", - of: within[0], - within: within, - collision: "flip", - at: "left center" - }); - - deepEqual( elem.hasClass( 'ui-flipped-left' ), false, 'Removed ui-flipped-left class' ); -}); - -test( "addClass: flipped top", function() { - var within = $("#within-container"), - elem = $( "#elx" ).position( { - my: "left top", - of: within[0], - within: within, - collision: "flip", - at: "right bottom" - }); - - deepEqual( elem.hasClass( 'ui-flipped-top' ), false, 'Has ui-flipped-top class' ); - - elem.position( { - my: "left bottom", - of: within[0], - within: within, - collision: "flip", - at: "right top" - }); - - deepEqual( elem.hasClass( 'ui-flipped-top' ), false, 'Removed ui-flipped-top class' ); -}); - -test( "addClass: flipped right", function() { - var within = $("#within-container"), - elem = $( "#elx" ).position( { - my: "right center", - of: within[0], - within: within, - collision: "flip", - at: "left center" - }); - - deepEqual( elem.hasClass( 'ui-flipped-right' ), false, 'Has ui-flipped-right class' ); - - elem.position( { - my: "left center", - of: within[0], - within: within, - collision: "flip", - at: "right center" - }); - - deepEqual( elem.hasClass( 'ui-flipped-right' ), false, 'Removed ui-flipped-right class' ); - -}); - -test( "addClass: flipped bottom", function() { - var within = $("#within-container"), - elem = $( "#elx" ).position( { - my: "left bottom", - of: window, - collision: "flip", - at: "right top" - }); - - deepEqual( elem.hasClass( 'ui-flipped-bottom' ), false, 'Has ui-flipped-bottom class' ); - - elem.position( { - my: "left top", - of: window, - collision: "flip", - at: "right bottom" - }); - - deepEqual( elem.hasClass( 'ui-flipped-bottom' ), false, 'Removed ui-flipped-bottom class' ); -}); - -}( jQuery ) ); diff --git a/tests/unit/position/position_deprecated.html b/tests/unit/position/position_deprecated.html index ee9be189d..8794812a8 100644 --- a/tests/unit/position/position_deprecated.html +++ b/tests/unit/position/position_deprecated.html @@ -5,17 +5,15 @@ <title>jQuery UI Position Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> - <script> - loadResources({ - js: [ "ui/jquery.ui.position.js" ] - }); - </script> - <link rel="stylesheet" href="../../../external/qunit.css"> <script src="../../../external/qunit.js"></script> <script src="../../jquery.simulate.js"></script> <script src="../testsuite.js"></script> + <script> + TestHelpers.loadResources({ + js: [ "ui/jquery.ui.position.js" ] + }); + </script> <script src="position_core.js"></script> <script src="position_deprecated.js"></script> @@ -35,33 +33,26 @@ elements smaller than 10px have a line-height set on them to avoid a bug in IE6 .height() returns the greater of the height and line-height --> -<div id="qunit-fixture" style="top: 0; left: 0;"> +<div id="qunit-fixture" style="top: 0; left: 0; z-index:1"> <div id="el1" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div> <div id="el2" style="position: absolute; width: 6px; height: 6px; line-height: 6px;"></div> <div id="parent" style="position: absolute; width: 6px; height: 6px; top: 4px; left: 4px; line-height: 6px;"></div> -</div> - -<div style="position: absolute; top: 0px; left: 0px"> - <div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div> - <div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div> -</div> + <div id="within" style="position: absolute; width: 12px; height: 12px; top: 2px; left: 0px;"></div> -<div style="position: absolute; top: 200px; left: 100px;"> - <div id="el-offset-100-200" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div> - <div style="position: absolute; top: 100px; left: 50px;"> - <div id="el-two-offset-150-300" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div> - <div id="el-fixed" style="position: fixed; top: 200px; left: 200px;"></div> + <div style="position: absolute; top: 0px; left: 0px"> + <div id="elx" style="position: absolute; width: 10px; height: 10px; line-height: 10px;"></div> + <div id="parentx" style="position: absolute; width: 20px; height: 20px; top: 40px; left: 40px;"></div> </div> -</div> -<div style="position: absolute; height: 5000px; width: 5000px;"></div> + <div style="position: absolute; height: 5000px; width: 5000px;"></div> -<div id="bug-5280" style="height: 30px; width: 201px;"> - <div style="width: 50px; height: 10px;"></div> -</div> + <div id="fractions-parent" style="position: absolute; left: 10.7432222px; top: 10.532325px; height: 30px; width: 201px;"> + <div id="fractions-element"></div> + </div> -<div id="fractions-parent" style="position: absolute; left: 10.7432222px; top: 10.532325px; height: 30px; width: 201px;"> - <div id="fractions-element"></div> + <div id="bug-5280" style="height: 30px; width: 201px;"> + <div style="width: 50px; height: 10px;"></div> + </div> </div> </body> diff --git a/tests/unit/progressbar/all.html b/tests/unit/progressbar/all.html index eefb9c135..16b9e0ace 100644 --- a/tests/unit/progressbar/all.html +++ b/tests/unit/progressbar/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/progressbar/progressbar.html b/tests/unit/progressbar/progressbar.html index 8b55f5a89..70a4abe56 100644 --- a/tests/unit/progressbar/progressbar.html +++ b/tests/unit/progressbar/progressbar.html @@ -5,9 +5,12 @@ <title>jQuery UI Progressbar Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.progressbar" ], js: [ "ui/jquery.ui.core.js", @@ -17,13 +20,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="progressbar_common.js"></script> <script src="progressbar_core.js"></script> - <script src="progressbar_defaults.js"></script> <script src="progressbar_events.js"></script> <script src="progressbar_methods.js"></script> <script src="progressbar_options.js"></script> diff --git a/tests/unit/progressbar/progressbar_defaults.js b/tests/unit/progressbar/progressbar_common.js index 2f97a78bb..2f97a78bb 100644 --- a/tests/unit/progressbar/progressbar_defaults.js +++ b/tests/unit/progressbar/progressbar_common.js diff --git a/tests/unit/qunit-composite.css b/tests/unit/qunit-composite.css new file mode 100644 index 000000000..df47362db --- /dev/null +++ b/tests/unit/qunit-composite.css @@ -0,0 +1,13 @@ +iframe.qunit-subsuite{ + position: fixed; + bottom: 0; + left: 0; + + margin: 0; + padding: 0; + border-width: 1px 0 0; + height: 45%; + width: 100%; + + background: #fff; +}
\ No newline at end of file diff --git a/tests/unit/qunit-composite.js b/tests/unit/qunit-composite.js new file mode 100644 index 000000000..89c47eb29 --- /dev/null +++ b/tests/unit/qunit-composite.js @@ -0,0 +1,102 @@ +(function( QUnit ) { + +QUnit.extend( QUnit, { + testSuites: function( suites ) { + QUnit.begin(function() { + QUnit.initIframe(); + }); + + for ( var i = 0; i < suites.length; i++ ) { + QUnit.runSuite( suites[i] ); + } + + QUnit.done(function() { + this.iframe.style.display = "none"; + }); + }, + + runSuite: function( suite ) { + asyncTest( suite, function() { + QUnit.iframe.setAttribute( "src", suite ); + }); + }, + + initIframe: function() { + var body = document.body, + iframe = this.iframe = document.createElement( "iframe" ), + iframeWin; + + iframe.className = "qunit-subsuite"; + body.appendChild( iframe ); + + function onIframeLoad() { + var module, test, + count = 0; + + + iframeWin.QUnit.moduleStart(function( data ) { + // capture module name for messages + module = data.name; + }); + + iframeWin.QUnit.testStart(function( data ) { + // capture test name for messages + test = data.name; + }); + iframeWin.QUnit.testDone(function() { + test = null; + }); + + iframeWin.QUnit.log(function( data ) { + if (test === null) { + return; + } + // pass all test details through to the main page + var message = module + ": " + test + ": " + data.message; + expect( ++count ); + QUnit.push( data.result, data.actual, data.expected, message ); + }); + + iframeWin.QUnit.done(function() { + // start the wrapper test from the main page + start(); + }); + } + QUnit.addEvent( iframe, "load", onIframeLoad ); + + iframeWin = iframe.contentWindow; + } +}); + +QUnit.testStart(function( data ) { + // update the test status to show which test suite is running + QUnit.id( "qunit-testresult" ).innerHTML = "Running " + data.name + "...<br> "; +}); + +QUnit.testDone(function() { + var i, + current = QUnit.id( this.config.current.id ), + children = current.children, + src = this.iframe.src; + + // undo the auto-expansion of failed tests + for ( i = 0; i < children.length; i++ ) { + if ( children[i].nodeName === "OL" ) { + children[i].style.display = "none"; + } + } + + QUnit.addEvent(current, "dblclick", function( e ) { + var target = e && e.target ? e.target : window.event.srcElement; + if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) { + target = target.parentNode; + } + if ( window.location && target.nodeName.toLowerCase() === "strong" ) { + window.location = src; + } + }); + + current.getElementsByTagName('a')[0].href = src; +}); + +}( QUnit ) ); diff --git a/tests/unit/resizable/all.html b/tests/unit/resizable/all.html index 1c6811282..bef29ff6e 100644 --- a/tests/unit/resizable/all.html +++ b/tests/unit/resizable/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/resizable/resizable.html b/tests/unit/resizable/resizable.html index 4e886d2fd..9baa67493 100644 --- a/tests/unit/resizable/resizable.html +++ b/tests/unit/resizable/resizable.html @@ -5,9 +5,12 @@ <title>jQuery UI Resizable Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.resizable" ], js: [ "ui/jquery.ui.core.js", @@ -18,13 +21,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="resizable_common.js"></script> <script src="resizable_core.js"></script> - <script src="resizable_defaults.js"></script> <script src="resizable_events.js"></script> <script src="resizable_methods.js"></script> <script src="resizable_options.js"></script> diff --git a/tests/unit/resizable/resizable_defaults.js b/tests/unit/resizable/resizable_common.js index c46e10781..617cdd2ad 100644 --- a/tests/unit/resizable/resizable_defaults.js +++ b/tests/unit/resizable/resizable_common.js @@ -19,6 +19,9 @@ TestHelpers.commonWidgetTests('resizable', { maxWidth: null, minHeight: 10, minWidth: 10, - zIndex: 1000 + zIndex: 1000, + + // callbacks + create: null } }); diff --git a/tests/unit/resizable/resizable_events.js b/tests/unit/resizable/resizable_events.js index e8041f064..52d55731c 100644 --- a/tests/unit/resizable/resizable_events.js +++ b/tests/unit/resizable/resizable_events.js @@ -5,16 +5,4 @@ module("resizable: events"); -test("start", function() { - ok(false, "missing test - untested code is broken code."); -}); - -test("resize", function() { - ok(false, "missing test - untested code is broken code."); -}); - -test("stop", function() { - ok(false, "missing test - untested code is broken code."); -}); - })(jQuery); diff --git a/tests/unit/resizable/resizable_methods.js b/tests/unit/resizable/resizable_methods.js index 2b4c4256c..87859acf7 100644 --- a/tests/unit/resizable/resizable_methods.js +++ b/tests/unit/resizable/resizable_methods.js @@ -5,60 +5,5 @@ module("resizable: methods"); -test("init", function() { - expect(6); - - $("<div></div>").appendTo('body').resizable().remove(); - ok(true, '.resizable() called on element'); - - $([]).resizable().remove(); - ok(true, '.resizable() called on empty collection'); - - $('<div></div>').resizable().remove(); - ok(true, '.resizable() called on disconnected DOMElement'); - - $('<div></div>').resizable().resizable("foo").remove(); - ok(true, 'arbitrary method called after init'); - - el = $('<div></div>').resizable(); - var foo = el.resizable("option", "foo"); - el.remove(); - ok(true, 'arbitrary option getter after init'); - - $('<div></div>').resizable().resizable("option", "foo", "bar").remove(); - ok(true, 'arbitrary option setter after init'); -}); - -test("destroy", function() { - $("<div></div>").appendTo('body').resizable().resizable("destroy").remove(); - ok(true, '.resizable("destroy") called on element'); - - $([]).resizable().resizable("destroy").remove(); - ok(true, '.resizable("destroy") called on empty collection'); - - $('<div></div>').resizable().resizable("destroy").remove(); - ok(true, '.resizable("destroy") called on disconnected DOMElement'); - - $('<div></div>').resizable().resizable("destroy").resizable("foo").remove(); - ok(true, 'arbitrary method called after destroy'); - - var expected = $('<div></div>').resizable(), - actual = expected.resizable('destroy'); - equal(actual, expected, 'destroy is chainable'); -}); - -test("enable", function() { - var expected = $('<div></div>').resizable(), - actual = expected.resizable('enable'); - equal(actual, expected, 'enable is chainable'); - ok(false, "missing test - untested code is broken code."); -}); - -test("disable", function() { - var expected = $('<div></div>').resizable(), - actual = expected.resizable('disable'); - equal(actual, expected, 'disable is chainable'); - ok(false, "missing test - untested code is broken code."); -}); })(jQuery); diff --git a/tests/unit/resizable/resizable_options.js b/tests/unit/resizable/resizable_options.js index 275639ca1..e10a55a31 100644 --- a/tests/unit/resizable/resizable_options.js +++ b/tests/unit/resizable/resizable_options.js @@ -189,10 +189,10 @@ test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1 test("zIndex, applied to all handles", function() { expect(8); - + var target = $('<div></div>').resizable({ handles: 'all', zIndex: 100 }); target.children( '.ui-resizable-handle' ).each( function( index, handle ) { - equals( $( handle ).css( 'zIndex' ), 100, 'compare zIndex' ); + equal( $( handle ).css( 'zIndex' ), 100, 'compare zIndex' ); }); }); diff --git a/tests/unit/selectable/all.html b/tests/unit/selectable/all.html index bfebf46c2..51778e771 100644 --- a/tests/unit/selectable/all.html +++ b/tests/unit/selectable/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/selectable/selectable.html b/tests/unit/selectable/selectable.html index 4f70e8dd4..7b0ca6ffe 100644 --- a/tests/unit/selectable/selectable.html +++ b/tests/unit/selectable/selectable.html @@ -5,9 +5,12 @@ <title>jQuery UI Selectable Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.selectable" ], js: [ "ui/jquery.ui.core.js", @@ -18,13 +21,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="selectable_common.js"></script> <script src="selectable_core.js"></script> - <script src="selectable_defaults.js"></script> <script src="selectable_events.js"></script> <script src="selectable_methods.js"></script> <script src="selectable_options.js"></script> diff --git a/tests/unit/selectable/selectable_defaults.js b/tests/unit/selectable/selectable_common.js index 27714d0ae..27714d0ae 100644 --- a/tests/unit/selectable/selectable_defaults.js +++ b/tests/unit/selectable/selectable_common.js diff --git a/tests/unit/slider/all.html b/tests/unit/slider/all.html index 5aac26ced..bfadc0380 100644 --- a/tests/unit/slider/all.html +++ b/tests/unit/slider/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/slider/slider.html b/tests/unit/slider/slider.html index 60d124b7a..3aec78b4b 100644 --- a/tests/unit/slider/slider.html +++ b/tests/unit/slider/slider.html @@ -5,9 +5,12 @@ <title>jQuery UI Slider Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.slider" ], js: [ "ui/jquery.ui.core.js", @@ -18,13 +21,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="slider_common.js"></script> <script src="slider_core.js"></script> - <script src="slider_defaults.js"></script> <script src="slider_events.js"></script> <script src="slider_methods.js"></script> <script src="slider_options.js"></script> diff --git a/tests/unit/slider/slider_defaults.js b/tests/unit/slider/slider_common.js index 8a0b347f3..8a0b347f3 100644 --- a/tests/unit/slider/slider_defaults.js +++ b/tests/unit/slider/slider_common.js diff --git a/tests/unit/sortable/all.html b/tests/unit/sortable/all.html index 89e239250..f9d63d62e 100644 --- a/tests/unit/sortable/all.html +++ b/tests/unit/sortable/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/sortable/sortable.html b/tests/unit/sortable/sortable.html index a20eb7109..c84c62197 100644 --- a/tests/unit/sortable/sortable.html +++ b/tests/unit/sortable/sortable.html @@ -5,9 +5,12 @@ <title>jQuery UI Sortable Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.sortable" ], js: [ "ui/jquery.ui.core.js", @@ -18,13 +21,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - + <script src="sortable_common.js"></script> <script src="sortable_core.js"></script> - <script src="sortable_defaults.js"></script> <script src="sortable_events.js"></script> <script src="sortable_methods.js"></script> <script src="sortable_options.js"></script> diff --git a/tests/unit/sortable/sortable_defaults.js b/tests/unit/sortable/sortable_common.js index b5fc05a5d..b5fc05a5d 100644 --- a/tests/unit/sortable/sortable_defaults.js +++ b/tests/unit/sortable/sortable_common.js diff --git a/tests/unit/spinner/all.html b/tests/unit/spinner/all.html index e41e088c4..72a2dd77a 100644 --- a/tests/unit/spinner/all.html +++ b/tests/unit/spinner/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/spinner/spinner.html b/tests/unit/spinner/spinner.html index 0c01a5f48..b7f4a532a 100644 --- a/tests/unit/spinner/spinner.html +++ b/tests/unit/spinner/spinner.html @@ -3,14 +3,17 @@ <head> <meta charset="utf-8"> <title>jQuery UI Spinner Test Suite</title> - + <script src="../../jquery.js"></script> <script src="../../../external/jquery.mousewheel-3.0.4.js"></script> <script src="../../../external/globalize.js"></script> <script src="../../../external/globalize.culture.ja-JP.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.button", "ui.spinner" ], js: [ "ui/jquery.ui.core.js", @@ -21,14 +24,9 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="spinner_test_helpers.js"></script> + <script src="spinner_common.js"></script> <script src="spinner_core.js"></script> - <script src="spinner_defaults.js"></script> <script src="spinner_events.js"></script> <script src="spinner_methods.js"></script> <script src="spinner_options.js"></script> diff --git a/tests/unit/spinner/spinner_defaults.js b/tests/unit/spinner/spinner_common.js index 4f05b1e63..4f05b1e63 100644 --- a/tests/unit/spinner/spinner_defaults.js +++ b/tests/unit/spinner/spinner_common.js diff --git a/tests/unit/subsuiteRunner.css b/tests/unit/subsuiteRunner.css deleted file mode 100644 index bca30a75e..000000000 --- a/tests/unit/subsuiteRunner.css +++ /dev/null @@ -1,8 +0,0 @@ -iframe.qunit-subsuite { - margin: 0; - padding: 0; - border-width: 1px 0 0; - height: 600px; - width: 100%; - background: #fff; -}
\ No newline at end of file diff --git a/tests/unit/subsuiteRunner.js b/tests/unit/subsuiteRunner.js deleted file mode 100644 index 2d6de2de1..000000000 --- a/tests/unit/subsuiteRunner.js +++ /dev/null @@ -1,88 +0,0 @@ -(function( QUnit ) { - -var subsuiteFrame; - -QUnit.extend( QUnit, { - testSuites: function( suites ) { - function generateSuite( suite ) { - asyncTest( suite, function() { - QUnit.runSuite( suite ); - }); - } - - for ( var i = 0; i < suites.length; i++ ) { - generateSuite( suites[ i ] ); - } - - QUnit.done = function() { - subsuiteFrame.style.display = "none"; - }; - }, - - testStart: function( data ) { - // update the test status to show which test suite is running - QUnit.id( "qunit-testresult" ).innerHTML = "Running " + data.name + "...<br> "; - }, - - testDone: function() { - var current = QUnit.id( this.config.current.id ), - children = current.children, - i = 0, - length = children.length; - - // undo the auto-expansion of failed tests - for ( ; i < length; i++ ) { - if ( children[i].nodeName === "OL" ) { - children[i].style.display = "none"; - } - } - }, - - runSuite: function( suite ) { - var iframeWin, - body = document.getElementsByTagName( "body" )[0], - iframe = document.createElement( "iframe" ); - - subsuiteFrame = iframe; - iframe.className = "qunit-subsuite"; - body.appendChild( iframe ); - - function onIframeLoad() { - var module, test, - count = 0; - - QUnit.extend( iframeWin.QUnit, { - moduleStart: function( data ) { - // capture module name for messages - module = data.name; - }, - - testStart: function( data ) { - // capture test name for messages - test = data.name; - }, - - log: function( data ) { - // pass all test details through to the main page - var message = module + ": " + test + ": " + data.message; - expect( ++count ); - QUnit.push( data.result, data.actual, data.expected, message ); - }, - - done: function() { - // start the wrapper test from the main page - start(); - } - }); - } - QUnit.addEvent( iframe, "load", onIframeLoad ); - - iframeWin = iframe.contentWindow; - iframe.setAttribute( "src", suite ); - - this.runSuite = function( suite ) { - iframe.setAttribute( "src", suite ); - }; - } -}); -}( QUnit ) ); diff --git a/tests/unit/tabs/all.html b/tests/unit/tabs/all.html index 1da3ecad2..41bf965f2 100644 --- a/tests/unit/tabs/all.html +++ b/tests/unit/tabs/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html index 7f60ad277..fc7bfeedf 100644 --- a/tests/unit/tabs/tabs.html +++ b/tests/unit/tabs/tabs.html @@ -8,9 +8,12 @@ <script> $.uiBackCompat = false; </script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.tabs" ], js: [ "ui/jquery.ui.core.js", @@ -20,13 +23,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="tabs_test_helpers.js"></script> - <script src="tabs_defaults.js"></script> + <script src="tabs_common.js"></script> <script src="tabs_core.js"></script> <script src="tabs_events.js"></script> <script src="tabs_methods.js"></script> diff --git a/tests/unit/tabs/tabs_defaults.js b/tests/unit/tabs/tabs_common.js index 7ffb05da4..7ffb05da4 100644 --- a/tests/unit/tabs/tabs_defaults.js +++ b/tests/unit/tabs/tabs_common.js diff --git a/tests/unit/tabs/tabs_defaults_deprecated.js b/tests/unit/tabs/tabs_common_deprecated.js index fdcff21b3..fdcff21b3 100644 --- a/tests/unit/tabs/tabs_defaults_deprecated.js +++ b/tests/unit/tabs/tabs_common_deprecated.js diff --git a/tests/unit/tabs/tabs_deprecated.html b/tests/unit/tabs/tabs_deprecated.html index c22ec3369..0c7611c9d 100644 --- a/tests/unit/tabs/tabs_deprecated.html +++ b/tests/unit/tabs/tabs_deprecated.html @@ -6,9 +6,12 @@ <script src="../../jquery.js"></script> <script src="../../../external/jquery.cookie.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.tabs" ], js: [ "ui/jquery.ui.core.js", @@ -18,13 +21,8 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="tabs_test_helpers.js"></script> - <script src="tabs_defaults_deprecated.js"></script> + <script src="tabs_common_deprecated.js"></script> <script src="tabs_core.js"></script> <script src="tabs_events.js"></script> <script src="tabs_methods.js"></script> diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index a877e38af..7e505979c 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -1,7 +1,66 @@ -(function() { +(function( $ ) { window.TestHelpers = {}; +function includeStyle( url ) { + document.write( "<link rel='stylesheet' href='../../../" + url + "'>" ); +} + +function includeScript( url ) { + document.write( "<script src='../../../" + url + "'></script>" ); +} + +QUnit.config.urlConfig.push( "min" ); +TestHelpers.loadResources = QUnit.urlParams.min ? + function() { + // TODO: proper include with theme images + includeStyle( "dist/jquery-ui.min.css" ); + includeScript( "dist/jquery-ui.min.js" ); + } : + function( resources ) { + $.each( resources.css || [], function( i, resource ) { + includeStyle( "themes/base/jquery." + resource + ".css" ); + }); + $.each( resources.js || [], function( i, resource ) { + includeScript( resource ); + }); + }; + +QUnit.config.urlConfig.push( "nojshint" ); +function testJshint( widget ) { + if ( QUnit.urlParams.nojshint ) { + return; + } + + includeScript( "external/jshint.js" ); + asyncTest( "JSHint", function() { + expect( 1 ); + + $.when( + $.ajax({ + url: "../../../ui/.jshintrc", + dataType: "json" + }), + $.ajax({ + url: "../../../ui/jquery.ui." + widget + ".js", + dataType: "text" + }) + ).done(function( hintArgs, srcArgs ) { + var passed = JSHINT( srcArgs[ 0 ], hintArgs[ 0 ] ), + errors = $.map( JSHINT.errors, function( error ) { + return "[L" + error.line + ":C" + error.character + "] " + + error.reason + "\n" + error.evidence + "\n"; + }).join( "\n" ); + ok( passed, errors ); + start(); + }) + .fail(function() { + ok( false, "error loading source" ); + start(); + }); + }); +} + function testWidgetDefaults( widget, defaults ) { var pluginDefaults = $.ui[ widget ].prototype.options; @@ -24,17 +83,15 @@ function testWidgetDefaults( widget, defaults ) { }); } -var privateMethods = [ - "_createWidget", - "destroy", - "option", - "_trigger" -]; - function testWidgetOverrides( widget ) { if ( $.uiBackCompat === false ) { test( "$.widget overrides", function() { - $.each( privateMethods, function( i, method ) { + $.each([ + "_createWidget", + "destroy", + "option", + "_trigger" + ], function( i, method ) { strictEqual( $.ui[ widget ].prototype[ method ], $.Widget.prototype[ method ], "should not override " + method ); }); @@ -59,6 +116,7 @@ function testBasicUsage( widget ) { TestHelpers.commonWidgetTests = function( widget, settings ) { module( widget + ": common widget" ); + testJshint( widget ); testWidgetDefaults( widget, settings.defaults ); testWidgetOverrides( widget ); testBasicUsage( widget ); @@ -106,4 +164,4 @@ window.domEqual = function( selector, modifier, message ) { QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); }; -}()); +}( jQuery )); diff --git a/tests/unit/tooltip/all.html b/tests/unit/tooltip/all.html index deb628e2f..c1aa35acf 100644 --- a/tests/unit/tooltip/all.html +++ b/tests/unit/tooltip/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html index b5e8558e5..d20ba8578 100644 --- a/tests/unit/tooltip/tooltip.html +++ b/tests/unit/tooltip/tooltip.html @@ -5,9 +5,12 @@ <title>jQuery UI Tooltip Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core", "ui.tooltip" ], js: [ "ui/jquery.ui.core.js", @@ -18,12 +21,7 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - - <script src="tooltip_defaults.js"></script> + <script src="tooltip_common.js"></script> <script src="tooltip_core.js"></script> <script src="tooltip_events.js"></script> <script src="tooltip_methods.js"></script> diff --git a/tests/unit/tooltip/tooltip_defaults.js b/tests/unit/tooltip/tooltip_common.js index d12ee9519..d12ee9519 100644 --- a/tests/unit/tooltip/tooltip_defaults.js +++ b/tests/unit/tooltip/tooltip_common.js diff --git a/tests/unit/widget/all.html b/tests/unit/widget/all.html index cad4bdd72..e5b16c8d7 100644 --- a/tests/unit/widget/all.html +++ b/tests/unit/widget/all.html @@ -7,9 +7,9 @@ <script src="../../../jquery-1.7.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> - <link rel="stylesheet" href="../subsuiteRunner.css"> + <link rel="stylesheet" href="../qunit-composite.css"> <script src="../../../external/qunit.js"></script> - <script src="../subsuiteRunner.js"></script> + <script src="../qunit-composite.js"></script> <script src="../subsuite.js"></script> <script> diff --git a/tests/unit/widget/widget.html b/tests/unit/widget/widget.html index 6f4caaa6c..15eaee6aa 100644 --- a/tests/unit/widget/widget.html +++ b/tests/unit/widget/widget.html @@ -5,9 +5,12 @@ <title>jQuery UI Widget Test Suite</title> <script src="../../jquery.js"></script> - <script src="../../resource_loader.js"></script> + <link rel="stylesheet" href="../../../external/qunit.css"> + <script src="../../../external/qunit.js"></script> + <script src="../../jquery.simulate.js"></script> + <script src="../testsuite.js"></script> <script> - loadResources({ + TestHelpers.loadResources({ css: [ "ui.core" ], js: [ "ui/jquery.ui.widget.js" @@ -15,11 +18,6 @@ }); </script> - <link rel="stylesheet" href="../../../external/qunit.css"> - <script src="../../../external/qunit.js"></script> - <script src="../../jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="widget_core.js"></script> <script src="widget_extend.js"></script> <script src="widget_animation.js"></script> diff --git a/tests/visual/button/button_ticket_5254.html b/tests/visual/button/button_ticket_5254.html deleted file mode 100644 index c46e094ab..000000000 --- a/tests/visual/button/button_ticket_5254.html +++ /dev/null @@ -1,55 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8" /> - <title>Button Visual Test : Button ticket #5254</title> - <link rel="stylesheet" href="../visual.css" type="text/css" /> - <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css"> - <script type="text/javascript" src="../../../jquery-1.7.2.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script> - <script type="text/javascript"> - $(function() { - - $('#b1').button(); - - $('#b2').button(); - - $('#b3').button().click(function() { - return false; - }); - - $('#ua').text(navigator.userAgent); - - }); - </script> -</head> -<body> - -<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/5254">#5254 - Input, button and anchor buttons aren't consistent in IE7</a></h1> - -<dl> -<dt><h2>Screenshot from ticket:</h2></dt> -<dd><img src="http://dev.jqueryui.com/raw-attachment/ticket/5254/button.png"></dd> -</dl> - -<hr> - -<dl> -<dt><h2>Visual test:</h2></dt> -<dd> - <div id="vt"> - <input id="b1" type="button" value="Input" style="" /> - <button id="b2">Button</button> - <a id="b3" href="#">Anchor</a> - </div> -</dd> -<dt><h2>User agent:</h2></dt> -<dd> - <h3 id="ua"></h3> -</dd> -</dl> - -</body> -</html> diff --git a/tests/visual/compound/accordion_dialog.html b/tests/visual/compound/accordion_dialog.html index df179ff6a..f7965fa83 100644 --- a/tests/visual/compound/accordion_dialog.html +++ b/tests/visual/compound/accordion_dialog.html @@ -134,7 +134,8 @@ Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit a </p> <p> Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis. -</p> +</p> +<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar. </p> <p> diff --git a/tests/visual/compound/datepicker_dialog.html b/tests/visual/compound/datepicker_dialog.html index 885edb4a6..a5a3202e1 100644 --- a/tests/visual/compound/datepicker_dialog.html +++ b/tests/visual/compound/datepicker_dialog.html @@ -89,7 +89,8 @@ Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit a </p> <p> Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis. -</p> +</p> +<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar. </p> <p> diff --git a/tests/visual/compound/sortable_accordion_sortable_tabs.html b/tests/visual/compound/sortable_accordion_sortable_tabs.html index ac90f1a09..a0b65d458 100644 --- a/tests/visual/compound/sortable_accordion_sortable_tabs.html +++ b/tests/visual/compound/sortable_accordion_sortable_tabs.html @@ -69,7 +69,7 @@ </div> </div> <div id="tabs-2"> - <div id="accordion-1"> + <div id="accordion-2"> <div> <h3><a href="#">Accordion Header 1</a></h3> <div> diff --git a/tests/visual/compound/widgets_in_dialog.html b/tests/visual/compound/widgets_in_dialog.html index 89ea875d1..e155533f5 100644 --- a/tests/visual/compound/widgets_in_dialog.html +++ b/tests/visual/compound/widgets_in_dialog.html @@ -1,31 +1,31 @@ <!DOCTYPE html> <html lang="en"> <head> - <meta charset="UTF-8" /> + <meta charset="utf-8"> <title>Compound Visual Test : All Widgets in Dialog</title> <link rel="stylesheet" href="../visual.css" type="text/css" /> <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css"> - <script type="text/javascript" src="../../../jquery-1.7.2.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.position.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.menu.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.resizable.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.autocomplete.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.datepicker.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.dialog.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.progressbar.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.slider.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script> - <script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script> - <script type="text/javascript"> + <script src="../../../jquery-1.7.2.js"></script> + <script src="../../../ui/jquery.ui.core.js"></script> + <script src="../../../ui/jquery.ui.widget.js"></script> + <script src="../../../ui/jquery.ui.mouse.js"></script> + <script src="../../../ui/jquery.ui.position.js"></script> + <script src="../../../ui/jquery.ui.menu.js"></script> + <script src="../../../ui/jquery.ui.resizable.js"></script> + <script src="../../../ui/jquery.ui.draggable.js"></script> + <script src="../../../ui/jquery.ui.accordion.js"></script> + <script src="../../../ui/jquery.ui.autocomplete.js"></script> + <script src="../../../ui/jquery.ui.button.js"></script> + <script src="../../../ui/jquery.ui.datepicker.js"></script> + <script src="../../../ui/jquery.ui.dialog.js"></script> + <script src="../../../ui/jquery.ui.progressbar.js"></script> + <script src="../../../ui/jquery.ui.slider.js"></script> + <script src="../../../ui/jquery.ui.tabs.js"></script> + <script src="../../../ui/jquery.ui.tooltip.js"></script> + <script> $(function() { $("[title]").tooltip(); - + $("#accordion").accordion(); $("#autocomplete").autocomplete({ source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"] @@ -47,7 +47,7 @@ } }); $("#tabs").tabs(); - + $("#dialog").dialog(); $("#dialog2").dialog({ autoOpen: false, @@ -100,6 +100,7 @@ Yay, another dialog. </div> +<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar. </p> <p> @@ -162,6 +163,7 @@ Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit a <p> Cras a augue dui, vitae tincidunt enim. In hac habitasse platea dictumst. Proin nec magna sed nulla mollis tempus id ut lectus. Morbi volutpat ultricies ipsum, quis imperdiet libero tempor nec. Donec bibendum ornare blandit. Aliquam rutrum risus non turpis commodo non commodo erat molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fermentum, magna vel euismod convallis, mi magna vehicula velit, aliquet rhoncus ipsum massa et nunc. Nullam blandit purus non neque ullamcorper a aliquet nisl tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed sit amet velit magna, sit amet rutrum dui. Donec elementum mi sed velit consectetur vulputate. Sed interdum adipiscing mattis. </p> +<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vitae urna quam. Fusce adipiscing erat eget magna malesuada vel mollis ligula ullamcorper. Donec pulvinar, libero et vehicula facilisis, odio orci fringilla magna, non ultricies ipsum justo a tellus. Proin facilisis magna vitae quam vestibulum tempor. Aenean semper placerat posuere. In nisi diam, ullamcorper sit amet viverra sed, pretium sed neque. Sed posuere vulputate mauris vitae placerat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam in odio elit, non tempor felis. Integer non iaculis ante. Sed erat mauris, aliquam nec consequat id, congue id libero. Maecenas elementum gravida tincidunt. Suspendisse lacinia enim sit amet nulla cursus pulvinar. </p> <p> diff --git a/tests/visual/effects/effects.scale.html b/tests/visual/effects/effects.scale.html index f86c36b6e..708543257 100644 --- a/tests/visual/effects/effects.scale.html +++ b/tests/visual/effects/effects.scale.html @@ -8,7 +8,7 @@ <script src="../../../ui/jquery.effects.core.js"></script> <script src="../../../ui/jquery.effects.scale.js"></script> <script src="effects.all.js"></script> - <script type="text/javascript" charset="utf-8"> + <script> jQuery(function( $ ) { var test = $( "#testBox" ), opts = $( ".arg" ), @@ -36,9 +36,9 @@ var cur = this.selectedIndex, next = cur + direction, len = this.options.length; - + this.selectedIndex = ( next + len ) % len; - + if ( ( next+len ) % len === next ) return false; }); doAnim(); diff --git a/tests/visual/menu/drilldown.html b/tests/visual/menu/drilldown.html index 8bc30a793..7b40fc62f 100644 --- a/tests/visual/menu/drilldown.html +++ b/tests/visual/menu/drilldown.html @@ -1,6 +1,7 @@ <!doctype html> <html> <head> + <meta charset="utf-8"> <title>Menu Visual Test: Default</title> <link rel="stylesheet" href="../visual.css" type="text/css" /> <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" /> @@ -18,15 +19,15 @@ right: 10, top: 10 }).appendTo(document.body).themeswitcher(); - + $.widget("ui.drilldown", { _init: function() { var that = this; this.active = this.element.find(">ul").attr("tabindex", 0); - + // hide submenus and create indicator icons - this.element.find("ul").hide().prev("a").prepend('<span class="ui-icon ui-icon-carat-1-e"></span>').end().filter(":first").show(); - + this.element.find("ul").hide().prev("a").prepend('<span class="ui-icon ui-icon-carat-1-e"></span>').end().filter(":first").show(); + this.element.find("ul").menu({ // disable built-in key handling input: $(), @@ -46,7 +47,7 @@ } } }); - + this.back = this.element.children(":last").button({ icons: { primary: "ui-icon-carat-1-w" @@ -56,7 +57,7 @@ return false; }).hide(); }, - + _open: function(submenu) { this.active = submenu.show().css({ opacity: 0 @@ -78,7 +79,7 @@ }); this.back.show(); }, - + up: function() { if (this.active.parent()[0] == this.element[0]) { return; @@ -101,7 +102,7 @@ this.back.hide(); } }, - + down: function(event) { var nested = this.activeItem.find(">ul"); if (nested.length) { @@ -109,24 +110,24 @@ nested.menu("focus", event, nested.children(":first")) } }, - + show: function() { }, - + hide: function() { }, - + widget: function() { return this.element.find(">ul"); } }); - + var drilldown = $("#drilldown").drilldown({ select: function(event, ui) { $("#log").append("<div>Selected " + ui.item.text() + "</div>"); } }); - + drilldown.drilldown("widget").keydown(function(event) { var menu = drilldown.data("drilldown").active.data("menu"); if (menu.widget().is(":hidden")) @@ -171,7 +172,7 @@ } else { character = prev + character; } - + var match = menu.widget().children("li").filter(function() { return new RegExp("^" + character, "i").test($("a", this).text()); }); @@ -207,7 +208,7 @@ </style> </head> <body> - + <div id="drilldown"> <h3>Make a selection...</h3> <ul> diff --git a/tests/visual/menu/menu.html b/tests/visual/menu/menu.html index e62e18ae5..548f25db4 100644 --- a/tests/visual/menu/menu.html +++ b/tests/visual/menu/menu.html @@ -1,6 +1,7 @@ <!doctype html> <html> <head> + <meta charset="utf-8"> <title>Menu Visual Test: Default</title> <link rel="stylesheet" href="../visual.css" type="text/css" /> <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" /> @@ -38,7 +39,7 @@ menus: ".menuElement" }); } - + var menus = $("#menu1, #menu2, #menu3, .menu4"); create(); diff --git a/tests/visual/menu/tablemenu.html b/tests/visual/menu/tablemenu.html index 19691c614..ca4345aed 100644 --- a/tests/visual/menu/tablemenu.html +++ b/tests/visual/menu/tablemenu.html @@ -1,6 +1,7 @@ <!doctype html> <html> <head> + <meta charset="utf-8"> <title>Menu Visual Test: Default</title> <link rel="stylesheet" href="../visual.css" type="text/css" /> <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css" title="ui-theme" /> @@ -20,7 +21,7 @@ rows.each(function() { $("<table>").width("100%").append(colgroup.clone()).append(this).wrap("<li><a></a></li>").parent().parent().appendTo(menu); }); - + menu.menu({ select: function(event, ui) { $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log"); @@ -34,7 +35,7 @@ </style> </head> <body> - + <table> <colgroup><col style="width: 50%"><col style="width: 50%"></colgroup> <thead> @@ -54,7 +55,7 @@ </tr> </tbody> </table> - + <div class="ui-widget" style="clear: left; margin-top:2em; font-family:Arial"> Log: <div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div> diff --git a/tests/visual/theme.html b/tests/visual/theme.html index fe9146169..83e46d97c 100644 --- a/tests/visual/theme.html +++ b/tests/visual/theme.html @@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> + <meta charset="utf-8"> <title>jQuery UI Example Page</title> <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" type="text/css"> <script type="text/javascript" src="../../jquery-1.7.2.js"></script> @@ -28,26 +28,26 @@ // Accordion $(".accordion").accordion({ header: "h3" }); $(".accordion").last().accordion("option", "icons", false); - - + + // Tabs $('#tabs').tabs(); - - // Dialog + + // Dialog $('#dialog').dialog({ autoOpen: false, width: 600, buttons: { - "Ok": function() { - $(this).dialog("close"); - }, - "Cancel": function() { - $(this).dialog("close"); - } + "Ok": function() { + $(this).dialog("close"); + }, + "Cancel": function() { + $(this).dialog("close"); + } } }); - + // Dialog Link $('#dialog_link').click(function(){ $('#dialog').dialog('open'); @@ -59,19 +59,19 @@ inline: true, showWeek: true }); - + $('#multidatepicker').datepicker({ numberOfMonths: 3, showButtonPanel: true, inline: true }); - + // Slider $('.slider').slider({ range: true, values: [17, 67] }); - + $("#eq > span").each(function() { var value = parseInt($(this).text()); $(this).empty().slider({ @@ -81,19 +81,19 @@ orientation: "vertical" }); }); - - + + // Progressbar $("#progressbar").progressbar({ - value: 20 + value: 20 }); - + //hover states on the static widgets $('#dialog_link, ul#icons li').hover( - function() { $(this).addClass('ui-state-hover'); }, + function() { $(this).addClass('ui-state-hover'); }, function() { $(this).removeClass('ui-state-hover'); } ); - + $(".buttonset > button").button() .next() .button({ @@ -104,8 +104,8 @@ }) .parent() .buttonset(); - - + + $('#beginning').button({ text: false, icons: { @@ -144,7 +144,7 @@ }); $("#shuffle").button(); $("#repeat").buttonset(); - + }); </script> <style type="text/css"> @@ -160,13 +160,13 @@ #eq span { height:120px; float:left; margin:15px } .buttonset {margin-bottom: 5px; } #toolbar { padding: 10px 4px; } - </style> + </style> </head> <body> <!-- <p style="font-size: 1.3em; line-height: 1.5; margin: 1em 0; width: 50%;">This page demonstrates the widgets using a theme.</p> --> <div id="switcher" style="position:absolute; right: 20px; top: 20px;"></div> - + <!-- Accordion --> <h2 class="demoHeaders">Accordion</h2> <div class="columnbox"> @@ -201,8 +201,8 @@ </div> </div> </div> - - + + <!-- Tabs --> <h2 class="demoHeaders">Tabs</h2> <div id="tabs"> @@ -215,20 +215,20 @@ <div id="tabs-2">Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</div> <div id="tabs-3">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div> </div> - + <!-- Dialog NOTE: Dialog is not generated by UI in this demo so it can be visually styled in themeroller--> <h2 class="demoHeaders">Dialog</h2> <p><a href="#" id="dialog_link" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-newwin"></span>Open Dialog</a></p> - + <div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable" ><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span class="ui-dialog-title">Inline Dialog</span><a href="#" class="ui-dialog-titlebar-close ui-corner-all" ><span class="ui-icon ui-icon-closethick" >close</span></a></div><div class="ui-dialog-content ui-widget-content" > <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> </div><div class="ui-resizable-handle ui-resizable-n" ></div><div class="ui-resizable-handle ui-resizable-e" ></div><div class="ui-resizable-handle ui-resizable-s" ></div><div class="ui-resizable-handle ui-resizable-w" ></div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se" ></div><div class="ui-resizable-handle ui-resizable-sw" ></div><div class="ui-resizable-handle ui-resizable-ne" ></div><div class="ui-resizable-handle ui-resizable-nw" ></div><div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"><button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Ok</span></button><button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Cancel</span></button></div></div> - - + + <h2 class="demoHeaders">Overlay and Shadow Classes <em>(not currently used in UI widgets)</em></h2> <div style="position: relative; width: 96%; height: 200px; padding:1% 4%; overflow:hidden;" class="fakewindowcontain"> <p>Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. </p><p>Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. </p><p>Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. </p><p>Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. </p> - + <!-- ui-dialog --> <div class="ui-overlay"><div class="ui-widget-overlay"></div><div class="ui-widget-shadow ui-corner-all" style="width: 302px; height: 152px; position: absolute; left: 50px; top: 30px;"></div></div> <div style="position: absolute; width: 280px; height: 130px;left: 50px; top: 30px; padding: 10px;" class="ui-widget ui-widget-content ui-corner-all"> @@ -236,24 +236,24 @@ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> </div> </div> - + </div> - + <!-- ui-dialog --> <div id="dialog" title="Dialog Title"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> </div> - - - + + + <h2 class="demoHeaders">Framework Icons (content color preview)</h2> <ul id="icons" class="ui-widget ui-helper-clearfix"> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-n"><span class="ui-icon ui-icon-carat-1-n"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-ne"><span class="ui-icon ui-icon-carat-1-ne"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-e"><span class="ui-icon ui-icon-carat-1-e"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-se"><span class="ui-icon ui-icon-carat-1-se"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-s"><span class="ui-icon ui-icon-carat-1-s"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-1-sw"><span class="ui-icon ui-icon-carat-1-sw"></span></li> @@ -263,7 +263,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-carat-2-e-w"><span class="ui-icon ui-icon-carat-2-e-w"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-n"><span class="ui-icon ui-icon-triangle-1-n"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-ne"><span class="ui-icon ui-icon-triangle-1-ne"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-e"><span class="ui-icon ui-icon-triangle-1-e"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-se"><span class="ui-icon ui-icon-triangle-1-se"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-1-s"><span class="ui-icon ui-icon-triangle-1-s"></span></li> @@ -273,7 +273,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-n-s"><span class="ui-icon ui-icon-triangle-2-n-s"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-triangle-2-e-w"><span class="ui-icon ui-icon-triangle-2-e-w"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-n"><span class="ui-icon ui-icon-arrow-1-n"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-ne"><span class="ui-icon ui-icon-arrow-1-ne"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-e"><span class="ui-icon ui-icon-arrow-1-e"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-se"><span class="ui-icon ui-icon-arrow-1-se"></span></li> @@ -283,7 +283,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-1-nw"><span class="ui-icon ui-icon-arrow-1-nw"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-n-s"><span class="ui-icon ui-icon-arrow-2-n-s"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-ne-sw"><span class="ui-icon ui-icon-arrow-2-ne-sw"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-e-w"><span class="ui-icon ui-icon-arrow-2-e-w"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-2-se-nw"><span class="ui-icon ui-icon-arrow-2-se-nw"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowstop-1-n"><span class="ui-icon ui-icon-arrowstop-1-n"></span></li> @@ -293,7 +293,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-n"><span class="ui-icon ui-icon-arrowthick-1-n"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-ne"><span class="ui-icon ui-icon-arrowthick-1-ne"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-e"><span class="ui-icon ui-icon-arrowthick-1-e"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-se"><span class="ui-icon ui-icon-arrowthick-1-se"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-s"><span class="ui-icon ui-icon-arrowthick-1-s"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-1-sw"><span class="ui-icon ui-icon-arrowthick-1-sw"></span></li> @@ -303,7 +303,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-ne-sw"><span class="ui-icon ui-icon-arrowthick-2-ne-sw"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-e-w"><span class="ui-icon ui-icon-arrowthick-2-e-w"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthick-2-se-nw"><span class="ui-icon ui-icon-arrowthick-2-se-nw"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-n"><span class="ui-icon ui-icon-arrowthickstop-1-n"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-e"><span class="ui-icon ui-icon-arrowthickstop-1-e"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowthickstop-1-s"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span></li> @@ -313,7 +313,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-e"><span class="ui-icon ui-icon-arrowreturnthick-1-e"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturnthick-1-s"><span class="ui-icon ui-icon-arrowreturnthick-1-s"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-w"><span class="ui-icon ui-icon-arrowreturn-1-w"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-n"><span class="ui-icon ui-icon-arrowreturn-1-n"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-e"><span class="ui-icon ui-icon-arrowreturn-1-e"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowreturn-1-s"><span class="ui-icon ui-icon-arrowreturn-1-s"></span></li> @@ -323,7 +323,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-arrowrefresh-1-s"><span class="ui-icon ui-icon-arrowrefresh-1-s"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4"><span class="ui-icon ui-icon-arrow-4"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-arrow-4-diag"><span class="ui-icon ui-icon-arrow-4-diag"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-extlink"><span class="ui-icon ui-icon-extlink"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-newwin"><span class="ui-icon ui-icon-newwin"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-refresh"><span class="ui-icon ui-icon-refresh"></span></li> @@ -333,7 +333,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-collapsed"><span class="ui-icon ui-icon-folder-collapsed"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-folder-open"><span class="ui-icon ui-icon-folder-open"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-document"><span class="ui-icon ui-icon-document"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-document-b"><span class="ui-icon ui-icon-document-b"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-note"><span class="ui-icon ui-icon-note"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-mail-closed"><span class="ui-icon ui-icon-mail-closed"></span></li> @@ -343,7 +343,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-person"><span class="ui-icon ui-icon-person"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-print"><span class="ui-icon ui-icon-print"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-trash"><span class="ui-icon ui-icon-trash"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-locked"><span class="ui-icon ui-icon-locked"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-unlocked"><span class="ui-icon ui-icon-unlocked"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-bookmark"><span class="ui-icon ui-icon-bookmark"></span></li> @@ -353,7 +353,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-calculator"><span class="ui-icon ui-icon-calculator"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-cart"><span class="ui-icon ui-icon-cart"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-pencil"><span class="ui-icon ui-icon-pencil"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-clock"><span class="ui-icon ui-icon-clock"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-disk"><span class="ui-icon ui-icon-disk"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-calendar"><span class="ui-icon ui-icon-calendar"></span></li> @@ -363,7 +363,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-wrench"><span class="ui-icon ui-icon-wrench"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-gear"><span class="ui-icon ui-icon-gear"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-heart"><span class="ui-icon ui-icon-heart"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-star"><span class="ui-icon ui-icon-star"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-link"><span class="ui-icon ui-icon-link"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-cancel"><span class="ui-icon ui-icon-cancel"></span></li> @@ -373,7 +373,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-minusthick"><span class="ui-icon ui-icon-minusthick"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-close"><span class="ui-icon ui-icon-close"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-closethick"><span class="ui-icon ui-icon-closethick"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-key"><span class="ui-icon ui-icon-key"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-lightbulb"><span class="ui-icon ui-icon-lightbulb"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-scissors"><span class="ui-icon ui-icon-scissors"></span></li> @@ -384,7 +384,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-video"><span class="ui-icon ui-icon-video"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-script"><span class="ui-icon ui-icon-script"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-alert"><span class="ui-icon ui-icon-alert"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-info"><span class="ui-icon ui-icon-info"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-notice"><span class="ui-icon ui-icon-notice"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-help"><span class="ui-icon ui-icon-help"></span></li> @@ -396,7 +396,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-pin-s"><span class="ui-icon ui-icon-pin-s"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-play"><span class="ui-icon ui-icon-play"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-pause"><span class="ui-icon ui-icon-pause"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-next"><span class="ui-icon ui-icon-seek-next"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-prev"><span class="ui-icon ui-icon-seek-prev"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-seek-end"><span class="ui-icon ui-icon-seek-end"></span></li> @@ -406,7 +406,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-off"><span class="ui-icon ui-icon-volume-off"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-volume-on"><span class="ui-icon ui-icon-volume-on"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-power"><span class="ui-icon ui-icon-power"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-signal-diag"><span class="ui-icon ui-icon-signal-diag"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-signal"><span class="ui-icon ui-icon-signal"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-battery-0"><span class="ui-icon ui-icon-battery-0"></span></li> @@ -416,7 +416,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span class="ui-icon ui-icon-circle-plus"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-minus"><span class="ui-icon ui-icon-circle-minus"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-close"><span class="ui-icon ui-icon-circle-close"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-e"><span class="ui-icon ui-icon-circle-triangle-e"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-s"><span class="ui-icon ui-icon-circle-triangle-s"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-triangle-w"><span class="ui-icon ui-icon-circle-triangle-w"></span></li> @@ -426,7 +426,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-w"><span class="ui-icon ui-icon-circle-arrow-w"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-arrow-n"><span class="ui-icon ui-icon-circle-arrow-n"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomin"><span class="ui-icon ui-icon-circle-zoomin"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-zoomout"><span class="ui-icon ui-icon-circle-zoomout"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-circle-check"><span class="ui-icon ui-icon-circle-check"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-circlesmall-plus"><span class="ui-icon ui-icon-circlesmall-plus"></span></li> @@ -436,7 +436,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-minus"><span class="ui-icon ui-icon-squaresmall-minus"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-squaresmall-close"><span class="ui-icon ui-icon-squaresmall-close"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-vertical"><span class="ui-icon ui-icon-grip-dotted-vertical"></span></li> - + <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-dotted-horizontal"><span class="ui-icon ui-icon-grip-dotted-horizontal"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-vertical"><span class="ui-icon ui-icon-grip-solid-vertical"></span></li> <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-solid-horizontal"><span class="ui-icon ui-icon-grip-solid-horizontal"></span></li> @@ -444,7 +444,7 @@ <li class="ui-state-default ui-corner-all" title=".ui-icon-grip-diagonal-se"><span class="ui-icon ui-icon-grip-diagonal-se"></span></li> </ul> - + <!-- Slider --> <h2 class="demoHeaders">Slider</h2> <div class="columnbox"> @@ -461,8 +461,8 @@ <span>70</span> </div> </div> - - + + <!-- Datepicker --> <h2 class="demoHeaders">Datepicker</h2> <div class="columnbox" style="width: 32%"> @@ -471,35 +471,35 @@ <div class="columnbox" style="width: 66%; height: 220px;"> <div id="multidatepicker"></div> </div> - - + + <!-- Progressbar --> - <h2 class="demoHeaders">Progressbar</h2> + <h2 class="demoHeaders">Progressbar</h2> <div id="progressbar"></div> - + <!-- Highlight / Error --> <h2 class="demoHeaders">Highlight / Error</h2> <div class="ui-widget"> - <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;"> + <div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;"> <p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span> <strong>Hey!</strong> Sample ui-state-highlight style.</p> </div> </div> <br/> <div class="ui-widget"> - <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> - <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> + <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> + <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> <strong>Alert:</strong> Sample ui-state-error style.</p> </div> </div> - + <h2 class="demoHeaders">Button</h2> - + <div class="buttonset"> <button id="rerun">Run last action</button> <button id="select">Select an action</button> </div> - + <span id="toolbar" class="ui-widget-header ui-corner-all"> <button id="beginning">go to beginning</button> <button id="rewind">rewind</button> @@ -507,18 +507,18 @@ <button id="stop">stop</button> <button id="forward">fast forward</button> <button id="end">go to end</button> - + <input type="checkbox" id="shuffle" /><label for="shuffle">Shuffle</label> - + <span id="repeat"> <input type="radio" id="repeat0" name="repeat" checked="checked" /><label for="repeat0">No Repeat</label> <input type="radio" id="repeat1" name="repeat" /><label for="repeat1">Once</label> <input type="radio" id="repeatall" name="repeat" /><label for="repeatall">All</label> </span> - </span> - + </span> + <!-- theme switcher --> - + <script src="http://jqueryui.com/themeroller/themeswitchertool/"></script> <script> $('#switcher').themeswitcher(); diff --git a/tests/visual/tooltip/animations.html b/tests/visual/tooltip/animations.html index 10235b2f9..38ee28f1d 100644 --- a/tests/visual/tooltip/animations.html +++ b/tests/visual/tooltip/animations.html @@ -1,6 +1,7 @@ <!DOCTYPE html> <html lang="en"> <head> + <meta charset="utf-8"> <title>Tooltip Visual Test: Default</title> <link rel="stylesheet" href="../visual.css" type="text/css" /> <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css"> diff --git a/tests/visual/tooltip/tooltip.html b/tests/visual/tooltip/tooltip.html index 63c756ce0..da811645c 100644 --- a/tests/visual/tooltip/tooltip.html +++ b/tests/visual/tooltip/tooltip.html @@ -1,6 +1,7 @@ <!DOCTYPE html> <html lang="en"> <head> + <meta charset="utf-8"> <title>Tooltip Visual Test: Default</title> <link rel="stylesheet" href="../visual.css" type="text/css" /> <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css"> |