Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' into menubar

  • Loading branch information...
commit 28fdac8dbc7e49207815264db56ca898bbc766de 2 parents f83c963 + 5c53dd1
Kris Borchers kborchers authored

Showing 171 changed files with 3,615 additions and 6,221 deletions. Show diff stats Hide diff stats

  1. +1 1  MIT-LICENSE.txt
  2. +4 4 demos/accordion/collapsible.html
  3. +4 4 demos/accordion/custom-icons.html
  4. +4 4 demos/accordion/default.html
  5. +4 4 demos/accordion/fillspace.html
  6. +10 6 demos/accordion/hoverintent.html
  7. +0 1  demos/accordion/index.html
  8. +0 57 demos/accordion/mouseover.html
  9. +3 4 demos/accordion/no-auto-height.html
  10. +16 18 demos/accordion/sortable.html
  11. +1 1  demos/addClass/default.html
  12. +2 2 demos/autocomplete/categories.html
  13. +2 2 demos/autocomplete/combobox.html
  14. +4 0 demos/datepicker/localization.html
  15. +2 2 demos/draggable/cursor-style.html
  16. +18 17 demos/effect/easing.html
  17. +4 2 demos/index.html
  18. +15 12 demos/position/cycler.html
  19. +1 1  demos/sortable/connect-lists.html
  20. +9 2 external/qunit.css
  21. +647 440 external/qunit.js
  22. +122 121 tests/jquery.simulate.js
  23. +0 17 tests/static/slider/default.html
  24. +0 17 tests/static/slider/default_vertical.html
  25. +0 17 tests/static/slider/slider_horizontal.html
  26. +0 17 tests/static/slider/slider_horizontal_range.html
  27. +0 17 tests/static/slider/slider_horizontal_range_max.html
  28. +0 17 tests/static/slider/slider_horizontal_range_min.html
  29. +0 17 tests/static/slider/slider_vertical.html
  30. +0 17 tests/static/slider/slider_vertical_range.html
  31. +0 17 tests/static/slider/slider_vertical_range_max.html
  32. +0 17 tests/static/slider/slider_vertical_range_min.html
  33. +6 6 tests/unit/accordion/accordion.html
  34. +0 7 tests/unit/accordion/accordion_core.js
  35. +1 1  tests/unit/accordion/accordion_defaults.js
  36. +1 0  tests/unit/accordion/accordion_defaults_deprecated.js
  37. +6 6 tests/unit/accordion/accordion_deprecated.html
  38. +39 0 tests/unit/accordion/accordion_events.js
  39. +1 1  tests/unit/accordion/accordion_options.js
  40. +3 3 tests/unit/accordion/accordion_test_helpers.js
  41. +72 0 tests/unit/all-active.html
  42. +0 43 tests/unit/autocomplete/autocomplete_core.js
  43. +4 1 tests/unit/autocomplete/autocomplete_events.js
  44. +9 2 tests/unit/autocomplete/autocomplete_methods.js
  45. +54 0 tests/unit/autocomplete/autocomplete_options.js
  46. +12 12 tests/unit/button/button_core.js
  47. +19 19 tests/unit/button/button_options.js
  48. +35 35 tests/unit/core/core.js
  49. +35 35 tests/unit/datepicker/datepicker_core.js
  50. +25 25 tests/unit/datepicker/datepicker_events.js
  51. +155 155 tests/unit/datepicker/datepicker_options.js
  52. +8 8 tests/unit/datepicker/datepicker_tickets.js
  53. +9 9 tests/unit/dialog/dialog_core.js
  54. +42 42 tests/unit/dialog/dialog_events.js
  55. +15 15 tests/unit/dialog/dialog_methods.js
  56. +77 77 tests/unit/dialog/dialog_options.js
  57. +8 8 tests/unit/dialog/dialog_tickets.js
  58. +1 1  tests/unit/draggable/draggable_core.js
  59. +9 9 tests/unit/draggable/draggable_events.js
  60. +9 9 tests/unit/draggable/draggable_methods.js
  61. +74 74 tests/unit/draggable/draggable_options.js
  62. +10 10 tests/unit/droppable/droppable_methods.js
  63. +2 2 tests/unit/droppable/droppable_options.js
  64. +17 17 tests/unit/menu/menu_core.js
  65. +4 2 tests/unit/menu/menu_defaults.js
  66. +204 175 tests/unit/menu/menu_events.js
  67. +30 0 tests/unit/menu/menu_methods.js
  68. +28 0 tests/unit/menu/menu_options.js
  69. +35 35 tests/unit/position/position_core.js
  70. +28 28 tests/unit/position/position_core_within.js
  71. +3 3 tests/unit/position/position_deprecated.js
  72. +7 7 tests/unit/progressbar/progressbar_core.js
  73. +5 5 tests/unit/progressbar/progressbar_events.js
  74. +5 5 tests/unit/progressbar/progressbar_methods.js
  75. +5 5 tests/unit/progressbar/progressbar_options.js
  76. +25 25 tests/unit/resizable/resizable_core.js
  77. +3 3 tests/unit/resizable/resizable_methods.js
  78. +52 52 tests/unit/resizable/resizable_options.js
  79. +2 2 tests/unit/selectable/selectable_events.js
  80. +9 9 tests/unit/selectable/selectable_methods.js
  81. +4 4 tests/unit/selectable/selectable_options.js
  82. +34 34 tests/unit/slider/slider_core.js
  83. +11 11 tests/unit/slider/slider_events.js
  84. +14 14 tests/unit/slider/slider_methods.js
  85. +13 13 tests/unit/slider/slider_options.js
  86. +9 9 tests/unit/sortable/sortable_methods.js
  87. +2 2 tests/unit/sortable/sortable_tickets.js
  88. +29 29 tests/unit/spinner/spinner_methods.js
  89. +18 18 tests/unit/spinner/spinner_options.js
  90. +3 3 tests/unit/tabs/tabs.html
  91. +5 4 tests/unit/tabs/tabs_core.js
  92. +3 3 tests/unit/tabs/tabs_deprecated.html
  93. +65 65 tests/unit/tabs/tabs_deprecated.js
  94. +92 53 tests/unit/tabs/tabs_events.js
  95. +14 14 tests/unit/tabs/tabs_methods.js
  96. +11 11 tests/unit/tabs/tabs_options.js
  97. +4 4 tests/unit/testsuite.js
  98. +1 0  tests/unit/tooltip/tooltip_core.js
  99. +7 7 tests/unit/tooltip/tooltip_events.js
  100. +2 2 tests/unit/tooltip/tooltip_methods.js
  101. +7 7 tests/unit/tooltip/tooltip_options.js
  102. +183 108 tests/unit/widget/widget_core.js
  103. +95 0 tests/visual/accordion/accordion.html
  104. +50 2,942 tests/visual/dialog/dialog_on_page_with_large_dom.html
  105. +7 7 tests/visual/menu/drilldown.html
  106. +6 5 tests/visual/menu/menu.html
  107. +22 15 tests/visual/tooltip/tooltip.html
  108. +6 8 themes/base/jquery.ui.accordion.css
  109. +1 1  themes/base/jquery.ui.all.css
  110. +1 1  themes/base/jquery.ui.autocomplete.css
  111. +1 1  themes/base/jquery.ui.base.css
  112. +1 1  themes/base/jquery.ui.button.css
  113. +1 1  themes/base/jquery.ui.core.css
  114. +1 1  themes/base/jquery.ui.datepicker.css
  115. +1 1  themes/base/jquery.ui.dialog.css
  116. +1 1  themes/base/jquery.ui.menu.css
  117. +1 1  themes/base/jquery.ui.progressbar.css
  118. +1 1  themes/base/jquery.ui.resizable.css
  119. +1 1  themes/base/jquery.ui.selectable.css
  120. +1 1  themes/base/jquery.ui.slider.css
  121. +1 1  themes/base/jquery.ui.spinner.css
  122. +1 1  themes/base/jquery.ui.tabs.css
  123. +1 1  themes/base/jquery.ui.theme.css
  124. +1 1  themes/base/jquery.ui.tooltip.css
  125. +15 15 ui/i18n/jquery.ui.datepicker-bg.js
  126. +1 1  ui/i18n/jquery.ui.datepicker-cs.js
  127. +8 8 ui/i18n/jquery.ui.datepicker-da.js
  128. +1 1  ui/i18n/jquery.ui.datepicker-et.js
  129. +9 9 ui/i18n/jquery.ui.datepicker-fi.js
  130. +2 2 ui/i18n/jquery.ui.datepicker-fr.js
  131. +2 2 ui/i18n/jquery.ui.datepicker-he.js
  132. +23 0 ui/i18n/jquery.ui.datepicker-hi.js
  133. +23 0 ui/i18n/jquery.ui.datepicker-km.js
  134. +7 7 ui/i18n/jquery.ui.datepicker-ko.js
  135. +1 1  ui/i18n/jquery.ui.datepicker-mk.js
  136. +18 18 ui/i18n/jquery.ui.datepicker-no.js
  137. +8 8 ui/i18n/jquery.ui.datepicker-sv.js
  138. +2 2 ui/jquery.effects.blind.js
  139. +1 1  ui/jquery.effects.bounce.js
  140. +1 1  ui/jquery.effects.clip.js
  141. +38 218 ui/jquery.effects.core.js
  142. +1 1  ui/jquery.effects.drop.js
  143. +1 1  ui/jquery.effects.explode.js
  144. +1 1  ui/jquery.effects.fade.js
  145. +1 1  ui/jquery.effects.fold.js
  146. +1 1  ui/jquery.effects.highlight.js
  147. +1 1  ui/jquery.effects.pulsate.js
  148. +1 1  ui/jquery.effects.scale.js
  149. +1 1  ui/jquery.effects.shake.js
  150. +1 1  ui/jquery.effects.slide.js
  151. +1 1  ui/jquery.effects.transfer.js
  152. +167 202 ui/jquery.ui.accordion.js
  153. +40 20 ui/jquery.ui.autocomplete.js
  154. +9 9 ui/jquery.ui.button.js
  155. +13 18 ui/jquery.ui.core.js
  156. +19 17 ui/jquery.ui.datepicker.js
  157. +1 1  ui/jquery.ui.dialog.js
  158. +19 19 ui/jquery.ui.draggable.js
  159. +1 1  ui/jquery.ui.droppable.js
  160. +43 34 ui/jquery.ui.menu.js
  161. +10 10 ui/jquery.ui.mouse.js
  162. +13 13 ui/jquery.ui.position.js
  163. +1 1  ui/jquery.ui.progressbar.js
  164. +32 66 ui/jquery.ui.resizable.js
  165. +1 1  ui/jquery.ui.selectable.js
  166. +19 23 ui/jquery.ui.slider.js
  167. +8 4 ui/jquery.ui.sortable.js
  168. +1 1  ui/jquery.ui.spinner.js
  169. +149 160 ui/jquery.ui.tabs.js
  170. +21 11 ui/jquery.ui.tooltip.js
  171. +69 35 ui/jquery.ui.widget.js
2  MIT-LICENSE.txt
... ... @@ -1,4 +1,4 @@
1   -Copyright (c) 2011 Paul Bakaus, http://jqueryui.com/
  1 +Copyright (c) 2012 Paul Bakaus, http://jqueryui.com/
2 2
3 3 This software consists of voluntary contributions made by many
4 4 individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
8 demos/accordion/collapsible.html
@@ -22,15 +22,15 @@
22 22 <div class="demo">
23 23
24 24 <div id="accordion">
25   - <h3><a href="#">Section 1</a></h3>
  25 + <h3>Section 1</h3>
26 26 <div>
27 27 <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
28 28 </div>
29   - <h3><a href="#">Section 2</a></h3>
  29 + <h3>Section 2</h3>
30 30 <div>
31 31 <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
32 32 </div>
33   - <h3><a href="#">Section 3</a></h3>
  33 + <h3>Section 3</h3>
34 34 <div>
35 35 <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
36 36 <ul>
@@ -39,7 +39,7 @@
39 39 <li>List item three</li>
40 40 </ul>
41 41 </div>
42   - <h3><a href="#">Section 4</a></h3>
  42 + <h3>Section 4</h3>
43 43 <div>
44 44 <p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
45 45 </div>
8 demos/accordion/custom-icons.html
@@ -32,15 +32,15 @@
32 32 <div class="demo">
33 33
34 34 <div id="accordion">
35   - <h3><a href="#">Section 1</a></h3>
  35 + <h3>Section 1</h3>
36 36 <div>
37 37 <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
38 38 </div>
39   - <h3><a href="#">Section 2</a></h3>
  39 + <h3>Section 2</h3>
40 40 <div>
41 41 <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
42 42 </div>
43   - <h3><a href="#">Section 3</a></h3>
  43 + <h3>Section 3</h3>
44 44 <div>
45 45 <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
46 46 <ul>
@@ -49,7 +49,7 @@
49 49 <li>List item three</li>
50 50 </ul>
51 51 </div>
52   - <h3><a href="#">Section 4</a></h3>
  52 + <h3>Section 4</h3>
53 53 <div>
54 54 <p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
55 55 </div>
8 demos/accordion/default.html
@@ -20,7 +20,7 @@
20 20 <div class="demo">
21 21
22 22 <div id="accordion">
23   - <h3><a href="#">Section 1</a></h3>
  23 + <h3>Section 1</h3>
24 24 <div>
25 25 <p>
26 26 Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
@@ -29,7 +29,7 @@
29 29 odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
30 30 </p>
31 31 </div>
32   - <h3><a href="#">Section 2</a></h3>
  32 + <h3>Section 2</h3>
33 33 <div>
34 34 <p>
35 35 Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
@@ -38,7 +38,7 @@
38 38 suscipit faucibus urna.
39 39 </p>
40 40 </div>
41   - <h3><a href="#">Section 3</a></h3>
  41 + <h3>Section 3</h3>
42 42 <div>
43 43 <p>
44 44 Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
@@ -52,7 +52,7 @@
52 52 <li>List item three</li>
53 53 </ul>
54 54 </div>
55   - <h3><a href="#">Section 4</a></h3>
  55 + <h3>Section 4</h3>
56 56 <div>
57 57 <p>
58 58 Cras dictum. Pellentesque habitant morbi tristique senectus et netus
8 demos/accordion/fillspace.html
@@ -37,15 +37,15 @@ <h3 class="docs">Resize the outer container:</h3>
37 37 <div id="accordionResizer" style="padding:10px; width:350px; height:220px;" class="ui-widget-content">
38 38
39 39 <div id="accordion">
40   - <h3><a href="#">Section 1</a></h3>
  40 + <h3>Section 1</h3>
41 41 <div>
42 42 <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
43 43 </div>
44   - <h3><a href="#">Section 2</a></h3>
  44 + <h3>Section 2</h3>
45 45 <div>
46 46 <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
47 47 </div>
48   - <h3><a href="#">Section 3</a></h3>
  48 + <h3>Section 3</h3>
49 49 <div>
50 50 <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
51 51 <ul>
@@ -54,7 +54,7 @@ <h3 class="docs">Resize the outer container:</h3>
54 54 <li>List item three</li>
55 55 </ul>
56 56 </div>
57   - <h3><a href="#">Section 4</a></h3>
  57 + <h3>Section 4</h3>
58 58 <div>
59 59 <p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
60 60 </div>
16 demos/accordion/hoverintent.html
@@ -29,7 +29,7 @@
29 29 $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
30 30 },
31 31 handler: function( event ) {
32   - var self = this,
  32 + var that = this,
33 33 args = arguments,
34 34 target = $( event.target ),
35 35 cX, cY, pX, pY;
@@ -50,7 +50,11 @@
50 50 if ( ( Math.abs( pX - cX ) + Math.abs( pY - cY ) ) < cfg.sensitivity ) {
51 51 clear();
52 52 event.type = "hoverintent";
53   - jQuery.event.handle.apply( self, args );
  53 + // prevent accessing the original event since the new event
  54 + // is fired asynchronously and the old event is no longer
  55 + // usable (#6028)
  56 + event.originalEvent = {};
  57 + jQuery.event.handle.apply( that, args );
54 58 } else {
55 59 pX = cX;
56 60 pY = cY;
@@ -69,7 +73,7 @@
69 73 <div class="demo">
70 74
71 75 <div id="accordion">
72   - <h3><a href="#">Section 1</a></h3>
  76 + <h3>Section 1</h3>
73 77 <div>
74 78 <p>
75 79 Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
@@ -78,7 +82,7 @@
78 82 odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
79 83 </p>
80 84 </div>
81   - <h3><a href="#">Section 2</a></h3>
  85 + <h3>Section 2</h3>
82 86 <div>
83 87 <p>
84 88 Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
@@ -87,7 +91,7 @@
87 91 suscipit faucibus urna.
88 92 </p>
89 93 </div>
90   - <h3><a href="#">Section 3</a></h3>
  94 + <h3>Section 3</h3>
91 95 <div>
92 96 <p>
93 97 Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
@@ -101,7 +105,7 @@
101 105 <li>List item three</li>
102 106 </ul>
103 107 </div>
104   - <h3><a href="#">Section 4</a></h3>
  108 + <h3>Section 4</h3>
105 109 <div>
106 110 <p>
107 111 Cras dictum. Pellentesque habitant morbi tristique senectus et netus
1  demos/accordion/index.html
@@ -14,7 +14,6 @@
14 14 <li><a href="fillspace.html">Fill space</a></li>
15 15 <li><a href="no-auto-height.html">No auto height</a></li>
16 16 <li><a href="collapsible.html">Collapse content</a></li>
17   - <li><a href="mouseover.html">Open on mouseover</a></li>
18 17 <li><a href="hoverintent.html">Open on hoverintent</a></li>
19 18 <li><a href="custom-icons.html">Customize icons</a></li>
20 19 <li><a href="sortable.html">Sortable</a></li>
57 demos/accordion/mouseover.html
... ... @@ -1,57 +0,0 @@
1   -<!DOCTYPE html>
2   -<html lang="en">
3   -<head>
4   - <meta charset="utf-8">
5   - <title>jQuery UI Accordion - Open on mouseover</title>
6   - <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
7   - <script src="../../jquery-1.7.1.js"></script>
8   - <script src="../../ui/jquery.ui.core.js"></script>
9   - <script src="../../ui/jquery.ui.widget.js"></script>
10   - <script src="../../ui/jquery.ui.accordion.js"></script>
11   - <link rel="stylesheet" href="../demos.css">
12   - <script>
13   - $(function() {
14   - $( "#accordion" ).accordion({
15   - event: "mouseover"
16   - });
17   - });
18   - </script>
19   -</head>
20   -<body>
21   -
22   -<div class="demo">
23   -
24   -<div id="accordion">
25   - <h3><a href="#">Section 1</a></h3>
26   - <div>
27   - <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
28   - </div>
29   - <h3><a href="#">Section 2</a></h3>
30   - <div>
31   - <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
32   - </div>
33   - <h3><a href="#">Section 3</a></h3>
34   - <div>
35   - <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
36   - <ul>
37   - <li>List item one</li>
38   - <li>List item two</li>
39   - <li>List item three</li>
40   - </ul>
41   - </div>
42   - <h3><a href="#">Section 4</a></h3>
43   - <div>
44   - <p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
45   - </div>
46   -</div>
47   -
48   -</div><!-- End demo -->
49   -
50   -
51   -
52   -<div class="demo-description">
53   -<p>Toggle sections open/closed on mouseover with the <code>event</code> option. The default value for event is "click."</p>
54   -</div><!-- End demo-description -->
55   -
56   -</body>
57   -</html>
7 demos/accordion/no-auto-height.html
@@ -22,15 +22,15 @@
22 22 <div class="demo">
23 23
24 24 <div id="accordion">
25   - <h3><a href="#section1">Section 1</a></h3>
  25 + <h3>Section 1</h3>
26 26 <div>
27 27 <p>Mauris mauris ante, blandit et, ultrices a, susceros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
28 28 </div>
29   - <h3><a href="#section2">Section 2</a></h3>
  29 + <h3>Section 2</h3>
30 30 <div>
31 31 <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
32 32 </div>
33   - <h3><a href="#section3">Section 3</a></h3>
  33 + <h3>Section 3</h3>
34 34 <div>
35 35 <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
36 36 <ul>
@@ -42,7 +42,6 @@
42 42 <li>List item</li>
43 43 <li>List item</li>
44 44 </ul>
45   - <a href="#othercontent">Link to other content</a>
46 45 </div>
47 46 </div>
48 47
34 demos/accordion/sortable.html
@@ -11,16 +11,12 @@
11 11 <script src="../../ui/jquery.ui.sortable.js"></script>
12 12 <script src="../../ui/jquery.ui.accordion.js"></script>
13 13 <link rel="stylesheet" href="../demos.css">
  14 + <style>
  15 + /* IE has layout issues when sorting (see #5413) */
  16 + .group { zoom: 1 }
  17 + </style>
14 18 <script>
15 19 $(function() {
16   - var stop = false;
17   - $( "#accordion h3" ).click(function( event ) {
18   - if ( stop ) {
19   - event.stopImmediatePropagation();
20   - event.preventDefault();
21   - stop = false;
22   - }
23   - });
24 20 $( "#accordion" )
25 21 .accordion({
26 22 header: "> div > h3"
@@ -28,8 +24,10 @@
28 24 .sortable({
29 25 axis: "y",
30 26 handle: "h3",
31   - stop: function() {
32   - stop = true;
  27 + stop: function( event, ui ) {
  28 + // IE doesn't register the blur when sorting
  29 + // so trigger focusout handlers to remove .ui-state-focus
  30 + ui.item.children( "h3" ).triggerHandler( "focusout" );
33 31 }
34 32 });
35 33 });
@@ -40,20 +38,20 @@
40 38 <div class="demo">
41 39
42 40 <div id="accordion">
43   - <div>
44   - <h3><a href="#">Section 1</a></h3>
  41 + <div class="group">
  42 + <h3>Section 1</h3>
45 43 <div>
46 44 <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p>
47 45 </div>
48 46 </div>
49   - <div>
50   - <h3><a href="#">Section 2</a></h3>
  47 + <div class="group">
  48 + <h3>Section 2</h3>
51 49 <div>
52 50 <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
53 51 </div>
54 52 </div>
55   - <div>
56   - <h3><a href="#">Section 3</a></h3>
  53 + <div class="group">
  54 + <h3>Section 3</h3>
57 55 <div>
58 56 <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
59 57 <ul>
@@ -63,8 +61,8 @@
63 61 </ul>
64 62 </div>
65 63 </div>
66   - <div>
67   - <h3><a href="#">Section 4</a></h3>
  64 + <div class="group">
  65 + <h3>Section 4</h3>
68 66 <div>
69 67 <p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p>
70 68 </div>
2  demos/addClass/default.html
@@ -33,7 +33,7 @@
33 33 <div class="demo">
34 34
35 35 <div class="toggler">
36   - <div id="effect" class=" ui-corner-all">
  36 + <div id="effect" class="ui-corner-all">
37 37 Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede.
38 38 </div>
39 39 </div>
4 demos/autocomplete/categories.html
@@ -22,14 +22,14 @@
22 22 <script>
23 23 $.widget( "custom.catcomplete", $.ui.autocomplete, {
24 24 _renderMenu: function( ul, items ) {
25   - var self = this,
  25 + var that = this,
26 26 currentCategory = "";
27 27 $.each( items, function( index, item ) {
28 28 if ( item.category != currentCategory ) {
29 29 ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
30 30 currentCategory = item.category;
31 31 }
32   - self._renderItem( ul, item );
  32 + that._renderItem( ul, item );
33 33 });
34 34 }
35 35 });
4 demos/autocomplete/combobox.html
@@ -29,7 +29,7 @@
29 29 (function( $ ) {
30 30 $.widget( "ui.combobox", {
31 31 _create: function() {
32   - var self = this,
  32 + var that = this,
33 33 select = this.element.hide(),
34 34 selected = select.children( ":selected" ),
35 35 value = selected.val() ? selected.text() : "";
@@ -85,7 +85,7 @@
85 85 },
86 86 select: function( event, ui ) {
87 87 ui.item.option.selected = true;
88   - self._trigger( "selected", event, {
  88 + that._trigger( "selected", event, {
89 89 item: ui.item.option
90 90 });
91 91 },
4 demos/datepicker/localization.html
@@ -34,6 +34,7 @@
34 34 <script src="../../ui/i18n/jquery.ui.datepicker-fr-CH.js"></script>
35 35 <script src="../../ui/i18n/jquery.ui.datepicker-gl.js"></script>
36 36 <script src="../../ui/i18n/jquery.ui.datepicker-he.js"></script>
  37 + <script src="../../ui/i18n/jquery.ui.datepicker-hi.js"></script>
37 38 <script src="../../ui/i18n/jquery.ui.datepicker-hr.js"></script>
38 39 <script src="../../ui/i18n/jquery.ui.datepicker-hu.js"></script>
39 40 <script src="../../ui/i18n/jquery.ui.datepicker-hy.js"></script>
@@ -42,6 +43,7 @@
42 43 <script src="../../ui/i18n/jquery.ui.datepicker-it.js"></script>
43 44 <script src="../../ui/i18n/jquery.ui.datepicker-ja.js"></script>
44 45 <script src="../../ui/i18n/jquery.ui.datepicker-kk.js"></script>
  46 + <script src="../../ui/i18n/jquery.ui.datepicker-km.js"></script>
45 47 <script src="../../ui/i18n/jquery.ui.datepicker-ko.js"></script>
46 48 <script src="../../ui/i18n/jquery.ui.datepicker-lb.js"></script>
47 49 <script src="../../ui/i18n/jquery.ui.datepicker-lt.js"></script>
@@ -123,12 +125,14 @@
123 125 <option value="de">German (Deutsch)</option>
124 126 <option value="el">Greek (&#917;&#955;&#955;&#951;&#957;&#953;&#954;&#940;)</option>
125 127 <option value="he">Hebrew (&#8235;(&#1506;&#1489;&#1512;&#1497;&#1514;</option>
  128 + <option value="hi">Hindi (&#2361;&#2367;&#2306;&#2342;&#2368;)</option>
126 129 <option value="hu">Hungarian (Magyar)</option>
127 130 <option value="is">Icelandic (&Otilde;slenska)</option>
128 131 <option value="id">Indonesian (Bahasa Indonesia)</option>
129 132 <option value="it">Italian (Italiano)</option>
130 133 <option value="ja">Japanese (&#26085;&#26412;&#35486;)</option>
131 134 <option value="kk">Kazakhstan (Kazakh)</option>
  135 + <option value="km">Khmer</option>
132 136 <option value="ko">Korean (&#54620;&#44397;&#50612;)</option>
133 137 <option value="lv">Latvian (Latvie&ouml;u Valoda)</option>
134 138 <option value="lt">Lithuanian (lietuviu kalba)</option>
4 demos/draggable/cursor-style.html
@@ -15,8 +15,8 @@
15 15 </style>
16 16 <script>
17 17 $(function() {
18   - $( "#draggable" ).draggable({ cursorAt: { cursor: "move", top: 56, left: 56 } });
19   - $( "#draggable2" ).draggable({ cursorAt: { cursor: "crosshair", top: -5, left: -5 } });
  18 + $( "#draggable" ).draggable({ cursor: "move", cursorAt: { top: 56, left: 56 } });
  19 + $( "#draggable2" ).draggable({ cursor: "crosshair", cursorAt: { top: -5, left: -5 } });
20 20 $( "#draggable3" ).draggable({ cursorAt: { bottom: 0 } });
21 21 });
22 22 </script>
35 demos/effect/easing.html
@@ -15,10 +15,9 @@
15 15 </style>
16 16 <script>
17 17 $(function() {
18   - if ( !$( "<canvas/>" )[0].getContext ) {
19   - $( "<div/>" ).text(
20   - "Your browser doesn't support canvas, which is required for this demo. " +
21   - "Give Firefox 3 a try!"
  18 + if ( !$( "<canvas>" )[0].getContext ) {
  19 + $( "<div>" ).text(
  20 + "Your browser doesn't support canvas, which is required for this demo."
22 21 ).appendTo( "#graphs" );
23 22 return;
24 23 }
@@ -26,15 +25,13 @@
26 25 var i = 0,
27 26 width = 100,
28 27 height = 100;
  28 +
29 29 $.each( $.easing, function( name, impl ) {
30   - // skip linear/jswing and any non functioning implementation
31   - if ( !$.isFunction( impl ) || /jswing/.test( name ) ) {
32   - return;
33   - }
34   - var graph = $( "<div/>" ).addClass( "graph" ).appendTo( "#graphs" ),
35   - text = $( "<div/>" ).text( ++i + ". " + name ).appendTo( graph ),
36   - wrap = $( "<div/>" ).appendTo( graph ).css( 'overflow', 'hidden' ),
37   - canvas = $( "<canvas/>" ).appendTo( wrap )[ 0 ];
  30 + var graph = $( "<div>" ).addClass( "graph" ).appendTo( "#graphs" ),
  31 + text = $( "<div>" ).text( ++i + ". " + name ).appendTo( graph ),
  32 + wrap = $( "<div>" ).appendTo( graph ).css( 'overflow', 'hidden' ),
  33 + canvas = $( "<canvas>" ).appendTo( wrap )[ 0 ];
  34 +
38 35 canvas.width = width;
39 36 canvas.height = height;
40 37 var drawHeight = height * 0.8,
@@ -42,6 +39,7 @@
42 39 ctx = canvas.getContext( "2d" );
43 40 ctx.fillStyle = "black";
44 41
  42 + // draw background
45 43 ctx.beginPath();
46 44 ctx.moveTo( cradius, 0 );
47 45 ctx.quadraticCurveTo( 0, 0, 0, cradius );
@@ -53,31 +51,34 @@
53 51 ctx.lineTo( cradius, 0 );
54 52 ctx.fill();
55 53
  54 + // draw bottom line
56 55 ctx.strokeStyle = "#555";
57 56 ctx.beginPath();
58 57 ctx.moveTo( width * 0.1, drawHeight + .5 );
59 58 ctx.lineTo( width * 0.9, drawHeight + .5 );
60 59 ctx.stroke();
61 60
  61 + // draw top line
62 62 ctx.strokeStyle = "#555";
63 63 ctx.beginPath();
64 64 ctx.moveTo( width * 0.1, drawHeight * .3 - .5 );
65 65 ctx.lineTo( width * 0.9, drawHeight * .3 - .5 );
66 66 ctx.stroke();
67   -
  67 +
  68 + // plot easing
68 69 ctx.strokeStyle = "white";
69 70 ctx.beginPath();
70 71 ctx.lineWidth = 2;
71 72 ctx.moveTo( width * 0.1, drawHeight );
72 73 $.each( new Array( width ), function( position ) {
73   - var val = impl( 0, position, 0, 1, height );
74   - if ( /linear|jswing/.test( name ) ) {
75   - val = position / width;
76   - }
  74 + var state = position / width,
  75 + val = impl( state, position, 0, 1, width );
77 76 ctx.lineTo( position * 0.8 + width * 0.1,
78 77 drawHeight - drawHeight * val * 0.7 );
79 78 });
80 79 ctx.stroke();
  80 +
  81 + // animate on click
81 82 graph.click(function() {
82 83 wrap
83 84 .animate( { height: "hide" }, 2000, name )
6 demos/index.html
@@ -70,6 +70,7 @@
70 70 <script src="../ui/i18n/jquery.ui.datepicker-fr-CH.js"></script>
71 71 <script src="../ui/i18n/jquery.ui.datepicker-gl.js"></script>
72 72 <script src="../ui/i18n/jquery.ui.datepicker-he.js"></script>
  73 + <script src="../ui/i18n/jquery.ui.datepicker-hi.js"></script>
73 74 <script src="../ui/i18n/jquery.ui.datepicker-hr.js"></script>
74 75 <script src="../ui/i18n/jquery.ui.datepicker-hu.js"></script>
75 76 <script src="../ui/i18n/jquery.ui.datepicker-hy.js"></script>
@@ -78,6 +79,7 @@
78 79 <script src="../ui/i18n/jquery.ui.datepicker-it.js"></script>
79 80 <script src="../ui/i18n/jquery.ui.datepicker-ja.js"></script>
80 81 <script src="../ui/i18n/jquery.ui.datepicker-kk.js"></script>
  82 + <script src="../ui/i18n/jquery.ui.datepicker-km.js"></script>
81 83 <script src="../ui/i18n/jquery.ui.datepicker-ko.js"></script>
82 84 <script src="../ui/i18n/jquery.ui.datepicker-lb.js"></script>
83 85 <script src="../ui/i18n/jquery.ui.datepicker-lt.js"></script>
@@ -227,9 +229,9 @@
227 229 return false;
228 230 });
229 231 });
230   - });
  232 + }, "html" );
231 233 }
232   - });
  234 + }, "html" );
233 235 }
234 236
235 237 function updateDemoNotes() {
27 demos/position/cycler.html
@@ -17,6 +17,7 @@
17 17 </style>
18 18 <script>
19 19 $(function() {
  20 + // TODO refactor into a widget and get rid of these plugin methods
20 21 $.fn.position2 = function( options ) {
21 22 return this.position( $.extend({
22 23 of: window,
@@ -52,10 +53,6 @@
52 53 });
53 54 };
54 55
55   - $( "img:eq(0)" ).left();
56   - $( "img:eq(1)" ).center();
57   - $( "img:eq(2)" ).right();
58   -
59 56 $( "body" ).css({
60 57 overflow: "hidden"
61 58 })
@@ -66,15 +63,21 @@
66 63 position: "absolute",
67 64 });
68 65
  66 + $( "img:eq(0)" ).left();
  67 + $( "img:eq(1)" ).center();
  68 + $( "img:eq(2)" ).right();
  69 +
69 70 function animate( to ) {
70   - $(this).animate( to );
  71 + $(this).stop( true, false ).animate( to );
71 72 }
72   - function next() {
  73 + function next( event ) {
  74 + event.preventDefault();
73 75 $( "img:eq(2)" ).center( animate );
74 76 $( "img:eq(1)" ).left( animate )
75 77 $( "img:eq(0)" ).right().appendTo( ".demo" );
76 78 }
77   - function previous() {
  79 + function previous( event ) {
  80 + event.preventDefault();
78 81 $( "img:eq(0)" ).center( animate );
79 82 $( "img:eq(1)" ).right( animate );
80 83 $( "img:eq(2)" ).left().prependTo( ".demo" );
@@ -82,8 +85,8 @@
82 85 $( "#previous" ).click( previous );
83 86 $( "#next" ).click( next );
84 87
85   - $( ".demo img" ).click(function() {
86   - $( ".demo img" ).index( this ) === 0 ? previous() : next();
  88 + $( ".demo img" ).click(function( event ) {
  89 + $( ".demo img" ).index( this ) === 0 ? previous( event ) : next( event );
87 90 });
88 91
89 92 $( window ).resize(function() {
@@ -98,9 +101,9 @@
98 101
99 102 <div class="demo">
100 103
101   -<img src="images/earth.jpg" />
102   -<img src="images/flight.jpg" />
103   -<img src="images/rocket.jpg" />
  104 +<img src="images/earth.jpg" width="458" height="308" />
  105 +<img src="images/flight.jpg" width="512" height="307" />
  106 +<img src="images/rocket.jpg" width="300" height="353" />
104 107
105 108 <a id="previous" href="#">Previous</a>
106 109 <a id="next" href="#">Next</a>
2  demos/sortable/connect-lists.html
@@ -11,7 +11,7 @@
11 11 <script src="../../ui/jquery.ui.sortable.js"></script>
12 12 <link rel="stylesheet" href="../demos.css">
13 13 <style>
14   - #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; }
  14 + #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0 0 2.5em; float: left; margin-right: 10px; }
15 15 #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 120px; }
16 16 </style>
17 17 <script>
11 external/qunit.css
... ... @@ -1,9 +1,9 @@
1 1 /**
2   - * QUnit - A JavaScript Unit Testing Framework
  2 + * QUnit v1.4.0 - A JavaScript Unit Testing Framework
3 3 *
4 4 * http://docs.jquery.com/QUnit
5 5 *
6   - * Copyright (c) 2011 John Resig, Jörn Zaefferer
  6 + * Copyright (c) 2012 John Resig, Jörn Zaefferer
7 7 * Dual licensed under the MIT (MIT-LICENSE.txt)
8 8 * or GPL (GPL-LICENSE.txt) licenses.
9 9 */
@@ -54,6 +54,10 @@
54 54 color: #fff;
55 55 }
56 56
  57 +#qunit-header label {
  58 + display: inline-block;
  59 +}
  60 +
57 61 #qunit-banner {
58 62 height: 5px;
59 63 }
@@ -186,6 +190,7 @@
186 190 color: #710909;
187 191 background-color: #fff;
188 192 border-left: 26px solid #EE5757;
  193 + white-space: pre;
189 194 }
190 195
191 196 #qunit-tests > li:last-child {
@@ -222,4 +227,6 @@
222 227 position: absolute;
223 228 top: -10000px;
224 229 left: -10000px;
  230 + width: 1000px;
  231 + height: 1000px;
225 232 }
1,087 external/qunit.js
... ... @@ -1,9 +1,9 @@
1 1 /**
2   - * QUnit - A JavaScript Unit Testing Framework
  2 + * QUnit v1.4.0 - A JavaScript Unit Testing Framework
3 3 *
4 4 * http://docs.jquery.com/QUnit
5 5 *
6   - * Copyright (c) 2011 John Resig, Jörn Zaefferer
  6 + * Copyright (c) 2012 John Resig, Jörn Zaefferer
7 7 * Dual licensed under the MIT (MIT-LICENSE.txt)
8 8 * or GPL (GPL-LICENSE.txt) licenses.
9 9 */
@@ -13,21 +13,25 @@
13 13 var defined = {
14 14 setTimeout: typeof window.setTimeout !== "undefined",
15 15 sessionStorage: (function() {
  16 + var x = "qunit-test-string";
16 17 try {
17   - return !!sessionStorage.getItem;
18   - } catch(e){
  18 + sessionStorage.setItem(x, x);
  19 + sessionStorage.removeItem(x);
  20 + return true;
  21 + } catch(e) {
19 22 return false;
20 23 }
21   - })()
  24 + }())
22 25 };
23 26
24   -var testId = 0;
  27 +var testId = 0,
  28 + toString = Object.prototype.toString,
  29 + hasOwn = Object.prototype.hasOwnProperty;
25 30
26   -var Test = function(name, testName, expected, testEnvironmentArg, async, callback) {
  31 +var Test = function(name, testName, expected, async, callback) {
27 32 this.name = name;
28 33 this.testName = testName;
29 34 this.expected = expected;
30   - this.testEnvironmentArg = testEnvironmentArg;
31 35 this.async = async;
32 36 this.callback = callback;
33 37 this.assertions = [];
@@ -48,7 +52,7 @@ Test.prototype = {
48 52 setup: function() {
49 53 if (this.module != config.previousModule) {
50 54 if ( config.previousModule ) {
51   - QUnit.moduleDone( {
  55 + runLoggingCallbacks('moduleDone', QUnit, {
52 56 name: config.previousModule,
53 57 failed: config.moduleStats.bad,
54 58 passed: config.moduleStats.all - config.moduleStats.bad,
@@ -57,7 +61,11 @@ Test.prototype = {
57 61 }
58 62 config.previousModule = this.module;
59 63 config.moduleStats = { all: 0, bad: 0 };
60   - QUnit.moduleStart( {
  64 + runLoggingCallbacks( 'moduleStart', QUnit, {
  65 + name: this.module
  66 + } );
  67 + } else if (config.autorun) {
  68 + runLoggingCallbacks( 'moduleStart', QUnit, {
61 69 name: this.module
62 70 } );
63 71 }
@@ -67,29 +75,31 @@ Test.prototype = {
67 75 setup: function() {},
68 76 teardown: function() {}
69 77 }, this.moduleTestEnvironment);
70   - if (this.testEnvironmentArg) {
71   - extend(this.testEnvironment, this.testEnvironmentArg);
72   - }
73 78
74   - QUnit.testStart( {
75   - name: this.testName
76   - } );
  79 + runLoggingCallbacks( 'testStart', QUnit, {
  80 + name: this.testName,
  81 + module: this.module
  82 + });
77 83
78 84 // allow utility functions to access the current test environment
79 85 // TODO why??
80 86 QUnit.current_testEnvironment = this.testEnvironment;
81 87
  88 + if ( !config.pollution ) {
  89 + saveGlobal();
  90 + }
  91 + if ( config.notrycatch ) {
  92 + this.testEnvironment.setup.call(this.testEnvironment);
  93 + return;
  94 + }
82 95 try {
83   - if ( !config.pollution ) {
84   - saveGlobal();
85   - }
86   -
87 96 this.testEnvironment.setup.call(this.testEnvironment);
88 97 } catch(e) {
89   - QUnit.ok( false, "Setup failed on " + this.testName + ": " + e.message );
  98 + QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
90 99 }
91 100 },
92 101 run: function() {
  102 + config.current = this;
93 103 if ( this.async ) {
94 104 QUnit.stop();
95 105 }
@@ -101,43 +111,52 @@ Test.prototype = {
101 111 try {
102 112 this.callback.call(this.testEnvironment);
103 113 } catch(e) {
104   - fail("Test " + this.testName + " died, exception and test follows", e, this.callback);
105   - QUnit.ok( false, "Died on test #" + (this.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) );
  114 + QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + ": " + e.message, extractStacktrace( e, 1 ) );
106 115 // else next test will carry the responsibility
107 116 saveGlobal();
108 117
109 118 // Restart the tests if they're blocking
110 119 if ( config.blocking ) {
111   - start();
  120 + QUnit.start();
112 121 }
113 122 }
114 123 },
115 124 teardown: function() {
116   - try {
  125 + config.current = this;
  126 + if ( config.notrycatch ) {
117 127 this.testEnvironment.teardown.call(this.testEnvironment);
118   - checkPollution();
119   - } catch(e) {
120   - QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message );
  128 + return;
  129 + } else {
  130 + try {
  131 + this.testEnvironment.teardown.call(this.testEnvironment);
  132 + } catch(e) {
  133 + QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
  134 + }
121 135 }
  136 + checkPollution();
122 137 },
123 138 finish: function() {
124   - if ( this.expected && this.expected != this.assertions.length ) {
125   - QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
  139 + config.current = this;
  140 + if ( this.expected != null && this.expected != this.assertions.length ) {
  141 + QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
  142 + } else if ( this.expected == null && !this.assertions.length ) {
  143 + QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions." );
126 144 }
127 145
128 146 var good = 0, bad = 0,
  147 + li, i,
129 148 tests = id("qunit-tests");
130 149
131 150 config.stats.all += this.assertions.length;
132 151 config.moduleStats.all += this.assertions.length;
133 152
134 153 if ( tests ) {
135   - var ol = document.createElement("ol");
  154 + var ol = document.createElement("ol");
136 155
137   - for ( var i = 0; i < this.assertions.length; i++ ) {
  156 + for ( i = 0; i < this.assertions.length; i++ ) {
138 157 var assertion = this.assertions[i];
139 158
140   - var li = document.createElement("li");
  159 + li = document.createElement("li");
141 160 li.className = assertion.result ? "pass" : "fail";
142 161 li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed");
143 162 ol.appendChild( li );
@@ -154,13 +173,13 @@ Test.prototype = {
154 173 // store result when possible
155 174 if ( QUnit.config.reorder && defined.sessionStorage ) {
156 175 if (bad) {
157   - sessionStorage.setItem("qunit-" + this.module + "-" + this.testName, bad);
  176 + sessionStorage.setItem("qunit-test-" + this.module + "-" + this.testName, bad);
158 177 } else {
159   - sessionStorage.removeItem("qunit-" + this.module + "-" + this.testName);
  178 + sessionStorage.removeItem("qunit-test-" + this.module + "-" + this.testName);
160 179 }
161 180 }
162 181
163   - if (bad == 0) {
  182 + if (bad === 0) {
164 183 ol.style.display = "none";
165 184 }
166 185
@@ -187,7 +206,7 @@ Test.prototype = {
187 206 }
188 207 });
189 208
190   - var li = id(this.id);
  209 + li = id(this.id);
191 210 li.className = bad ? "fail" : "pass";
192 211 li.removeChild( li.firstChild );
193 212 li.appendChild( b );
@@ -195,7 +214,7 @@ Test.prototype = {
195 214 li.appendChild( ol );
196 215
197 216 } else {
198   - for ( var i = 0; i < this.assertions.length; i++ ) {
  217 + for ( i = 0; i < this.assertions.length; i++ ) {
199 218 if ( !this.assertions[i].result ) {
200 219 bad++;
201 220 config.stats.bad++;
@@ -204,14 +223,11 @@ Test.prototype = {
204 223 }
205 224 }
206 225
207   - try {
208   - QUnit.reset();
209   - } catch(e) {
210   - fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset);
211   - }
  226 + QUnit.reset();
212 227
213   - QUnit.testDone( {
  228 + runLoggingCallbacks( 'testDone', QUnit, {
214 229 name: this.testName,
  230 + module: this.module,
215 231 failed: bad,
216 232 passed: this.assertions.length - bad,
217 233 total: this.assertions.length
@@ -239,12 +255,12 @@ Test.prototype = {
239 255 });
240 256 }
241 257 // defer when previous test run passed, if storage is available
242   - var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-" + this.module + "-" + this.testName);
  258 + var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-test-" + this.module + "-" + this.testName);
243 259 if (bad) {
244 260 run();
245 261 } else {
246   - synchronize(run);
247   - };
  262 + synchronize(run, true);
  263 + }
248 264 }
249 265
250 266 };
@@ -260,24 +276,19 @@ var QUnit = {
260 276 asyncTest: function(testName, expected, callback) {
261 277 if ( arguments.length === 2 ) {
262 278 callback = expected;
263   - expected = 0;
  279 + expected = null;
264 280 }
265 281
266 282 QUnit.test(testName, expected, callback, true);
267 283 },
268 284
269 285 test: function(testName, expected, callback, async) {
270   - var name = '<span class="test-name">' + testName + '</span>', testEnvironmentArg;
  286 + var name = '<span class="test-name">' + escapeInnerText(testName) + '</span>';
271 287
272 288 if ( arguments.length === 2 ) {
273 289 callback = expected;
274 290 expected = null;
275 291 }
276   - // is 2nd argument a testEnvironment?
277   - if ( expected && typeof expected === 'object') {
278   - testEnvironmentArg = expected;
279   - expected = null;
280   - }
281 292
282 293 if ( config.currentModule ) {
283 294 name = '<span class="module-name">' + config.currentModule + "</span>: " + name;
@@ -287,49 +298,45 @@ var QUnit = {
287 298 return;
288 299 }
289 300
290   - var test = new Test(name, testName, expected, testEnvironmentArg, async, callback);
  301 + var test = new Test(name, testName, expected, async, callback);
291 302 test.module = config.currentModule;
292 303 test.moduleTestEnvironment = config.currentModuleTestEnviroment;
293 304 test.queue();
294 305 },
295 306
296   - /**
297   - * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
298   - */
  307 + // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
299 308 expect: function(asserts) {
300 309 config.current.expected = asserts;
301 310 },
302 311
303   - /**
304   - * Asserts true.
305   - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
306   - */
307   - ok: function(a, msg) {
308   - a = !!a;
  312 + // Asserts true.
  313 + // @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
  314 + ok: function(result, msg) {
  315 + if (!config.current) {
  316 + throw new Error("ok() assertion outside test context, was " + sourceFromStacktrace(2));
  317 + }
  318 + result = !!result;
309 319 var details = {
310   - result: a,
  320 + result: result,
311 321 message: msg
312 322 };
313   - msg = escapeHtml(msg);
314   - QUnit.log(details);
  323 + msg = escapeInnerText(msg || (result ? "okay" : "failed"));
  324 + if ( !result ) {
  325 + var source = sourceFromStacktrace(2);
  326 + if (source) {
  327 + details.source = source;
  328 + msg += '<table><tr class="test-source"><th>Source: </th><td><pre>' + escapeInnerText(source) + '</pre></td></tr></table>';
  329 + }
  330 + }
  331 + runLoggingCallbacks( 'log', QUnit, details );
315 332 config.current.assertions.push({
316   - result: a,
  333 + result: result,
317 334 message: msg
318 335 });
319 336 },
320 337
321   - /**
322   - * Checks that the first two arguments are equal, with an optional message.
323   - * Prints out both actual and expected values.
324   - *
325   - * Prefered to ok( actual == expected, message )
326   - *
327   - * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
328   - *
329   - * @param Object actual
330   - * @param Object expected
331   - * @param String message (optional)
332   - */
  338 + // Checks that the first two arguments are equal, with an optional message. Prints out both actual and expected values.
  339 + // @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
333 340 equal: function(actual, expected, message) {
334 341 QUnit.push(expected == actual, actual, expected, message);
335 342 },
@@ -387,8 +394,8 @@ var QUnit = {
387 394 QUnit.ok(ok, message);
388 395 },
389