From 3909e6d89e01e4cd8777377c63037896bb95aa2f Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Fri, 25 Nov 2011 21:18:19 +0100 Subject: new jq layout --- src/main/webapp/jquery-ui-1.9pre/tests/index.html | 22 + .../webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js | 8936 +++++++++++++++++++ .../webapp/jquery-ui-1.9pre/tests/jquery-1.6.2.js | 8981 +++++++++++++++++++ .../webapp/jquery-ui-1.9pre/tests/jquery-1.6.3.js | 9044 +++++++++++++++++++ .../webapp/jquery-ui-1.9pre/tests/jquery-1.6.4.js | 9046 +++++++++++++++++++ .../webapp/jquery-ui-1.9pre/tests/jquery-1.6.js | 8865 +++++++++++++++++++ .../webapp/jquery-ui-1.9pre/tests/jquery-1.7.1.js | 9266 +++++++++++++++++++ .../webapp/jquery-ui-1.9pre/tests/jquery-1.7.js | 9300 ++++++++++++++++++++ src/main/webapp/jquery-ui-1.9pre/tests/jquery.js | 26 + .../jquery-ui-1.9pre/tests/jquery.simulate.js | 234 + .../jquery-ui-1.9pre/tests/resource_loader.js | 39 + .../tests/static/button/default.html | 161 + .../tests/static/datepicker/datepicker.html | 1367 +++ .../tests/static/datepicker/default.html | 86 + .../jquery-ui-1.9pre/tests/static/icons.html | 246 + .../tests/static/slider/default.html | 17 + .../tests/static/slider/default_vertical.html | 17 + .../tests/static/slider/slider_horizontal.html | 17 + .../static/slider/slider_horizontal_range.html | 17 + .../static/slider/slider_horizontal_range_max.html | 17 + .../static/slider/slider_horizontal_range_min.html | 17 + .../tests/static/slider/slider_vertical.html | 17 + .../tests/static/slider/slider_vertical_range.html | 17 + .../static/slider/slider_vertical_range_max.html | 17 + .../static/slider/slider_vertical_range_min.html | 17 + .../jquery-ui-1.9pre/tests/static/static.css | 1 + .../webapp/jquery-ui-1.9pre/tests/static/static.js | 9 + .../tests/unit/accordion/accordion.html | 144 + .../tests/unit/accordion/accordion_core.js | 55 + .../tests/unit/accordion/accordion_defaults.js | 20 + .../accordion/accordion_defaults_deprecated.js | 28 + .../tests/unit/accordion/accordion_deprecated.html | 142 + .../tests/unit/accordion/accordion_deprecated.js | 338 + .../tests/unit/accordion/accordion_events.js | 122 + .../tests/unit/accordion/accordion_methods.js | 40 + .../tests/unit/accordion/accordion_options.js | 283 + .../tests/unit/accordion/accordion_test_helpers.js | 30 + .../jquery-ui-1.9pre/tests/unit/accordion/all.html | 30 + .../webapp/jquery-ui-1.9pre/tests/unit/all.html | 72 + .../tests/unit/autocomplete/all.html | 30 + .../tests/unit/autocomplete/autocomplete.html | 51 + .../tests/unit/autocomplete/autocomplete_core.js | 83 + .../unit/autocomplete/autocomplete_defaults.js | 25 + .../tests/unit/autocomplete/autocomplete_events.js | 179 + .../unit/autocomplete/autocomplete_methods.js | 30 + .../unit/autocomplete/autocomplete_options.js | 193 + .../autocomplete/remote_object_array_labels.txt | 1 + .../autocomplete/remote_object_array_values.txt | 1 + .../unit/autocomplete/remote_string_array.txt | 1 + .../jquery-ui-1.9pre/tests/unit/button/all.html | 30 + .../jquery-ui-1.9pre/tests/unit/button/button.html | 71 + .../tests/unit/button/button_core.js | 84 + .../tests/unit/button/button_defaults.js | 14 + .../tests/unit/button/button_events.js | 8 + .../tests/unit/button/button_methods.js | 19 + .../tests/unit/button/button_options.js | 93 + .../tests/unit/button/button_tickets.js | 59 + .../jquery-ui-1.9pre/tests/unit/core/all.html | 30 + .../jquery-ui-1.9pre/tests/unit/core/core.html | 134 + .../jquery-ui-1.9pre/tests/unit/core/core.js | 157 + .../jquery-ui-1.9pre/tests/unit/core/selector.js | 239 + .../tests/unit/datepicker/all.html | 30 + .../tests/unit/datepicker/datepicker.html | 60 + .../tests/unit/datepicker/datepicker_core.js | 449 + .../tests/unit/datepicker/datepicker_defaults.js | 9 + .../tests/unit/datepicker/datepicker_events.js | 127 + .../tests/unit/datepicker/datepicker_methods.js | 121 + .../tests/unit/datepicker/datepicker_options.js | 925 ++ .../tests/unit/datepicker/datepicker_tickets.js | 84 + .../jquery-ui-1.9pre/tests/unit/dialog/all.html | 30 + .../jquery-ui-1.9pre/tests/unit/dialog/dialog.html | 60 + .../tests/unit/dialog/dialog_core.js | 138 + .../tests/unit/dialog/dialog_defaults.js | 34 + .../tests/unit/dialog/dialog_events.js | 254 + .../tests/unit/dialog/dialog_methods.js | 127 + .../tests/unit/dialog/dialog_options.js | 444 + .../tests/unit/dialog/dialog_tickets.js | 143 + .../jquery-ui-1.9pre/tests/unit/draggable/all.html | 30 + .../tests/unit/draggable/draggable.html | 60 + .../tests/unit/draggable/draggable_core.js | 67 + .../tests/unit/draggable/draggable_defaults.js | 36 + .../tests/unit/draggable/draggable_events.js | 81 + .../tests/unit/draggable/draggable_methods.js | 99 + .../tests/unit/draggable/draggable_options.js | 753 ++ .../jquery-ui-1.9pre/tests/unit/droppable/all.html | 30 + .../tests/unit/droppable/droppable.html | 60 + .../tests/unit/droppable/droppable_core.js | 36 + .../tests/unit/droppable/droppable_defaults.js | 16 + .../tests/unit/droppable/droppable_events.js | 28 + .../tests/unit/droppable/droppable_methods.js | 86 + .../tests/unit/droppable/droppable_options.js | 68 + .../jquery-ui-1.9pre/tests/unit/effects/all.html | 30 + .../tests/unit/effects/effects.html | 117 + .../tests/unit/effects/effects_core.js | 182 + .../tests/unit/effects/effects_scale.js | 68 + .../tests/unit/images/jqueryui_32x32.png | Bin 0 -> 1193 bytes .../webapp/jquery-ui-1.9pre/tests/unit/index.html | 96 + .../jquery-ui-1.9pre/tests/unit/menu/all.html | 30 + .../jquery-ui-1.9pre/tests/unit/menu/menu.html | 258 + .../jquery-ui-1.9pre/tests/unit/menu/menu_core.js | 41 + .../tests/unit/menu/menu_defaults.js | 14 + .../tests/unit/menu/menu_events.js | 431 + .../tests/unit/menu/menu_methods.js | 15 + .../tests/unit/menu/menu_options.js | 10 + .../tests/unit/menu/menu_test_helpers.js | 14 + .../jquery-ui-1.9pre/tests/unit/position/all.html | 30 + .../tests/unit/position/position.html | 75 + .../tests/unit/position/position_core.js | 547 ++ .../tests/unit/position/position_core_within.js | 545 ++ .../tests/unit/position/position_deprecated.html | 68 + .../tests/unit/position/position_deprecated.js | 32 + .../tests/unit/progressbar/all.html | 30 + .../tests/unit/progressbar/progressbar.html | 46 + .../tests/unit/progressbar/progressbar_core.js | 28 + .../tests/unit/progressbar/progressbar_defaults.js | 10 + .../tests/unit/progressbar/progressbar_events.js | 51 + .../tests/unit/progressbar/progressbar_methods.js | 36 + .../tests/unit/progressbar/progressbar_options.js | 59 + .../jquery-ui-1.9pre/tests/unit/resizable/all.html | 30 + .../tests/unit/resizable/images/test.jpg | Bin 0 -> 391 bytes .../tests/unit/resizable/resizable.html | 58 + .../tests/unit/resizable/resizable_core.js | 148 + .../tests/unit/resizable/resizable_defaults.js | 28 + .../tests/unit/resizable/resizable_events.js | 20 + .../tests/unit/resizable/resizable_methods.js | 64 + .../tests/unit/resizable/resizable_options.js | 190 + .../tests/unit/selectable/all.html | 30 + .../tests/unit/selectable/selectable.html | 63 + .../tests/unit/selectable/selectable_core.js | 16 + .../tests/unit/selectable/selectable_defaults.js | 16 + .../tests/unit/selectable/selectable_events.js | 32 + .../tests/unit/selectable/selectable_methods.js | 93 + .../tests/unit/selectable/selectable_options.js | 46 + .../jquery-ui-1.9pre/tests/unit/slider/all.html | 30 + .../jquery-ui-1.9pre/tests/unit/slider/slider.html | 60 + .../tests/unit/slider/slider_core.js | 292 + .../tests/unit/slider/slider_defaults.js | 19 + .../tests/unit/slider/slider_events.js | 109 + .../tests/unit/slider/slider_methods.js | 102 + .../tests/unit/slider/slider_options.js | 146 + .../jquery-ui-1.9pre/tests/unit/sortable/all.html | 30 + .../tests/unit/sortable/sortable.html | 64 + .../tests/unit/sortable/sortable_core.js | 9 + .../tests/unit/sortable/sortable_defaults.js | 34 + .../tests/unit/sortable/sortable_events.js | 147 + .../tests/unit/sortable/sortable_methods.js | 108 + .../tests/unit/sortable/sortable_options.js | 256 + .../tests/unit/sortable/sortable_tickets.js | 83 + .../jquery-ui-1.9pre/tests/unit/spinner/all.html | 30 + .../tests/unit/spinner/spinner.html | 52 + .../tests/unit/spinner/spinner_core.js | 206 + .../tests/unit/spinner/spinner_defaults.js | 19 + .../tests/unit/spinner/spinner_events.js | 221 + .../tests/unit/spinner/spinner_methods.js | 164 + .../tests/unit/spinner/spinner_options.js | 190 + .../tests/unit/spinner/spinner_test_helpers.js | 5 + .../webapp/jquery-ui-1.9pre/tests/unit/subsuite.js | 21 + .../jquery-ui-1.9pre/tests/unit/subsuiteRunner.css | 8 + .../jquery-ui-1.9pre/tests/unit/subsuiteRunner.js | 82 + .../jquery-ui-1.9pre/tests/unit/swarminject.js | 9 + .../jquery-ui-1.9pre/tests/unit/tabs/all.html | 30 + .../tests/unit/tabs/data/test.html | 1 + .../jquery-ui-1.9pre/tests/unit/tabs/tabs.html | 181 + .../jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js | 94 + .../tests/unit/tabs/tabs_defaults.js | 16 + .../tests/unit/tabs/tabs_defaults_deprecated.js | 29 + .../tests/unit/tabs/tabs_deprecated.html | 180 + .../tests/unit/tabs/tabs_deprecated.js | 576 ++ .../tests/unit/tabs/tabs_events.js | 277 + .../tests/unit/tabs/tabs_methods.js | 237 + .../tests/unit/tabs/tabs_options.js | 213 + .../jquery-ui-1.9pre/tests/unit/testsuite.js | 105 + .../jquery-ui-1.9pre/tests/unit/tooltip/all.html | 30 + .../tests/unit/tooltip/tooltip.html | 51 + .../tests/unit/tooltip/tooltip_core.js | 26 + .../tests/unit/tooltip/tooltip_defaults.js | 20 + .../tests/unit/tooltip/tooltip_events.js | 83 + .../tests/unit/tooltip/tooltip_methods.js | 67 + .../tests/unit/tooltip/tooltip_options.js | 73 + .../jquery-ui-1.9pre/tests/unit/widget/all.html | 30 + .../jquery-ui-1.9pre/tests/unit/widget/widget.html | 46 + .../tests/unit/widget/widget_animation.js | 257 + .../tests/unit/widget/widget_core.js | 1069 +++ .../tests/unit/widget/widget_extend.js | 103 + .../tests/visual/addClass/addClass_queue.html | 50 + .../tests/visual/button/button.html | 140 + .../tests/visual/button/button_disabled_true.html | 84 + .../tests/visual/button/button_performance.html | 555 ++ .../tests/visual/button/button_ticket_5254.html | 55 + .../tests/visual/button/button_ticket_5261.html | 42 + .../tests/visual/button/button_ticket_5278.html | 58 + .../tests/visual/compound/accordion_dialog.html | 202 + .../tests/visual/compound/accordion_tabs.html | 86 + .../tests/visual/compound/datepicker_dialog.html | 157 + .../tests/visual/compound/draggable_accordion.html | 65 + ...aggable_accordion_accordion_tabs_draggable.html | 109 + .../compound/sortable_accordion_sortable_tabs.html | 108 + .../tests/visual/compound/tabs_tabs.html | 73 + .../tests/visual/compound/tabs_tooltips.html | 37 + .../tests/visual/compound/widgets_in_dialog.html | 229 + .../dialog/dialog_on_page_with_large_dom.html | 2963 +++++++ .../tests/visual/effects/effects.all.css | 55 + .../tests/visual/effects/effects.all.html | 217 + .../tests/visual/effects/effects.all.js | 106 + .../tests/visual/effects/effects.scale.html | 159 + .../tests/visual/menu/drilldown.html | 266 + .../jquery-ui-1.9pre/tests/visual/menu/menu.html | 283 + .../tests/visual/menu/tablemenu.html | 67 + .../tests/visual/position/position.html | 67 + .../tests/visual/position/position_fit.html | 148 + .../tests/visual/position/position_flip.html | 77 + .../tests/visual/position/position_flipfit.html | 86 + .../tests/visual/position/position_margin.html | 43 + .../tests/visual/position/position_within.html | 200 + .../jquery-ui-1.9pre/tests/visual/theme.html | 532 ++ .../tests/visual/tooltip/ajaxcontent.php | 2 + .../tests/visual/tooltip/animations.html | 72 + .../tests/visual/tooltip/callout.html | 213 + .../tests/visual/tooltip/tooltip.html | 186 + .../jquery-ui-1.9pre/tests/visual/visual.css | 3 + 220 files changed, 90902 insertions(+) create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/index.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.2.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.3.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.4.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.1.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.7.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/jquery.simulate.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/resource_loader.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/button/default.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/datepicker.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/default.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/icons.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default_vertical.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_max.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_min.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_max.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_min.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/static.css create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/static/static.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults_deprecated.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_test_helpers.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_labels.txt create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_values.txt create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_string_array.txt create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/button/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_tickets.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/core/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/core/selector.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_tickets.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_tickets.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_scale.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/images/jqueryui_32x32.png create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/index.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_test_helpers.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/position/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core_within.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/images/test.jpg create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_tickets.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_test_helpers.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuite.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.css create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/swarminject.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/data/test.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults_deprecated.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/testsuite.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_defaults.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_events.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_methods.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_options.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_animation.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_core.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_extend.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/addClass/addClass_queue.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_disabled_true.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_performance.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5254.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5261.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5278.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_dialog.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_tabs.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/datepicker_dialog.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/sortable_accordion_sortable_tabs.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tabs.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tooltips.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/widgets_in_dialog.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/dialog/dialog_on_page_with_large_dom.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.css create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.js create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.scale.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/drilldown.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/menu.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/tablemenu.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_fit.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flip.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flipfit.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_margin.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_within.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/theme.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/ajaxcontent.php create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/animations.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/callout.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/tooltip.html create mode 100644 src/main/webapp/jquery-ui-1.9pre/tests/visual/visual.css (limited to 'src/main/webapp/jquery-ui-1.9pre/tests') diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/index.html b/src/main/webapp/jquery-ui-1.9pre/tests/index.html new file mode 100644 index 0000000..710c726 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/index.html @@ -0,0 +1,22 @@ + + + + + jQuery UI Tests + + + + + + + +

jQuery UI Tests

+ +

Static Tests

+ +

Unit Tests

+ +

Visual Tests

+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js new file mode 100644 index 0000000..5d5a1d5 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery-1.6.1.js @@ -0,0 +1,8936 @@ +/*! + * jQuery JavaScript Library v1.6.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu May 12 15:04:36 2011 -0400 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document, + navigator = window.navigator, + location = window.location; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // The deferred used on DOM ready + readyList, + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = quickExpr.exec( selector ); + } + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.6.1", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = this.constructor(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // Add the callback + readyList.done( fn ); + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + // Either a released hold or an DOMready/load event and not yet ready + if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyList ) { + return; + } + + readyList = jQuery._Deferred(); + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return (new Function( "return " + data ))(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + // (xml & tmp used internally) + parseXML: function( data , xml , tmp ) { + + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + + tmp = xml.documentElement; + + if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) { + jQuery.error( "Invalid XML: " + data ); + } + + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction( object ); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + break; + } + } + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type( array ); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + + if ( indexOf ) { + return indexOf.call( array, elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + if ( typeof context === "string" ) { + var tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + var args = slice.call( arguments, 2 ), + proxy = function() { + return fn.apply( context, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can be optionally by executed if its a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + sub: function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +// Expose jQuery to the global object +return jQuery; + +})(); + + +var // Promise methods + promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ), + // Static reference to slice + sliceDeferred = [].slice; + +jQuery.extend({ + // Create a simple deferred (one callbacks list) + _Deferred: function() { + var // callbacks list + callbacks = [], + // stored [ context , args ] + fired, + // to avoid firing when already doing so + firing, + // flag to know if the deferred has been cancelled + cancelled, + // the deferred itself + deferred = { + + // done( f1, f2, ...) + done: function() { + if ( !cancelled ) { + var args = arguments, + i, + length, + elem, + type, + _fired; + if ( fired ) { + _fired = fired; + fired = 0; + } + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + deferred.done.apply( deferred, elem ); + } else if ( type === "function" ) { + callbacks.push( elem ); + } + } + if ( _fired ) { + deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); + } + } + return this; + }, + + // resolve with given context and args + resolveWith: function( context, args ) { + if ( !cancelled && !fired && !firing ) { + // make sure args are available (#8421) + args = args || []; + firing = 1; + try { + while( callbacks[ 0 ] ) { + callbacks.shift().apply( context, args ); + } + } + finally { + fired = [ context, args ]; + firing = 0; + } + } + return this; + }, + + // resolve with this as context and given arguments + resolve: function() { + deferred.resolveWith( this, arguments ); + return this; + }, + + // Has this deferred been resolved? + isResolved: function() { + return !!( firing || fired ); + }, + + // Cancel + cancel: function() { + cancelled = 1; + callbacks = []; + return this; + } + }; + + return deferred; + }, + + // Full fledged deferred (two callbacks list) + Deferred: function( func ) { + var deferred = jQuery._Deferred(), + failDeferred = jQuery._Deferred(), + promise; + // Add errorDeferred methods, then and promise + jQuery.extend( deferred, { + then: function( doneCallbacks, failCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ); + return this; + }, + always: function() { + return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments ); + }, + fail: failDeferred.done, + rejectWith: failDeferred.resolveWith, + reject: failDeferred.resolve, + isRejected: failDeferred.isResolved, + pipe: function( fnDone, fnFail ) { + return jQuery.Deferred(function( newDefer ) { + jQuery.each( { + done: [ fnDone, "resolve" ], + fail: [ fnFail, "reject" ] + }, function( handler, data ) { + var fn = data[ 0 ], + action = data[ 1 ], + returned; + if ( jQuery.isFunction( fn ) ) { + deferred[ handler ](function() { + returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise().then( newDefer.resolve, newDefer.reject ); + } else { + newDefer[ action ]( returned ); + } + }); + } else { + deferred[ handler ]( newDefer[ action ] ); + } + }); + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + if ( promise ) { + return promise; + } + promise = obj = {}; + } + var i = promiseMethods.length; + while( i-- ) { + obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ]; + } + return obj; + } + }); + // Make sure only one callback list will be used + deferred.done( failDeferred.cancel ).fail( deferred.cancel ); + // Unexpose cancel + delete deferred.cancel; + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + return deferred; + }, + + // Deferred helper + when: function( firstParam ) { + var args = arguments, + i = 0, + length = args.length, + count = length, + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? + firstParam : + jQuery.Deferred(); + function resolveFunc( i ) { + return function( value ) { + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + if ( !( --count ) ) { + // Strange bug in FF4: + // Values changed onto the arguments object sometimes end up as undefined values + // outside the $.when method. Cloning the object into a fresh array solves the issue + deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) ); + } + }; + } + if ( length > 1 ) { + for( ; i < length; i++ ) { + if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) { + args[ i ].promise().then( resolveFunc(i), deferred.reject ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( deferred, args ); + } + } else if ( deferred !== firstParam ) { + deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); + } + return deferred.promise(); + } +}); + + + +jQuery.support = (function() { + + var div = document.createElement( "div" ), + documentElement = document.documentElement, + all, + a, + select, + opt, + input, + marginDiv, + support, + fragment, + body, + bodyStyle, + tds, + events, + eventName, + i, + isSupported; + + // Preliminary tests + div.setAttribute("className", "t"); + div.innerHTML = "
a"; + + all = div.getElementsByTagName( "*" ); + a = div.getElementsByTagName( "a" )[ 0 ]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return {}; + } + + // First batch of supports tests + select = document.createElement( "select" ); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName( "input" )[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName( "tbody" ).length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName( "link" ).length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + div.detachEvent( "onclick", click ); + }); + div.cloneNode( true ).fireEvent( "onclick" ); + } + + // Check if a radio maintains it's value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute("type", "radio"); + support.radioValue = input.value === "t"; + + input.setAttribute("checked", "checked"); + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + div.innerHTML = ""; + + // Figure out if the W3C box model works as expected + div.style.width = div.style.paddingLeft = "1px"; + + // We use our own, invisible, body + body = document.createElement( "body" ); + bodyStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + // Set background to avoid IE crashes when removing (#9028) + background: "none" + }; + for ( i in bodyStyle ) { + body.style[ i ] = bodyStyle[ i ]; + } + body.appendChild( div ); + documentElement.insertBefore( body, documentElement.firstChild ); + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + support.boxModel = div.offsetWidth === 2; + + if ( "zoom" in div.style ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "
"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); + } + + div.innerHTML = "
t
"; + tds = div.getElementsByTagName( "td" ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE < 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + div.innerHTML = ""; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + if ( document.defaultView && document.defaultView.getComputedStyle ) { + marginDiv = document.createElement( "div" ); + marginDiv.style.width = "0"; + marginDiv.style.marginRight = "0"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + } + + // Remove the body element we added + body.innerHTML = ""; + documentElement.removeChild( body ); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for( i in { + submit: 1, + change: 1, + focusin: 1 + } ) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + return support; +})(); + +// Keep track of boxModel +jQuery.boxModel = jQuery.support.boxModel; + + + + +var rbrace = /^(?:\{.*\}|\[.*\])$/, + rmultiDash = /([a-z])([A-Z])/g; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } else { + id = jQuery.expando; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); + } else { + cache[ id ] = jQuery.extend(cache[ id ], name); + } + } + + thisCache = cache[ id ]; + + // Internal jQuery data is stored in a separate object inside the object's data + // cache in order to avoid key collisions between internal data and user-defined + // data + if ( pvt ) { + if ( !thisCache[ internalKey ] ) { + thisCache[ internalKey ] = {}; + } + + thisCache = thisCache[ internalKey ]; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should + // not attempt to inspect the internal events object using jQuery.data, as this + // internal data object is undocumented and subject to change. + if ( name === "events" && !thisCache[name] ) { + return thisCache[ internalKey ] && thisCache[ internalKey ].events; + } + + return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var internalKey = jQuery.expando, isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + + // See jQuery.data for more information + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; + + if ( thisCache ) { + delete thisCache[ name ]; + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !isEmptyDataObject(thisCache) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( pvt ) { + delete cache[ id ][ internalKey ]; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject(cache[ id ]) ) { + return; + } + } + + var internalCache = cache[ id ][ internalKey ]; + + // Browsers that fail expando deletion also refuse to delete expandos on + // the window, but it will allow it on all other JS objects; other browsers + // don't care + if ( jQuery.support.deleteExpando || cache != window ) { + delete cache[ id ]; + } else { + cache[ id ] = null; + } + + // We destroyed the entire user cache at once because it's faster than + // iterating through each key, but we need to continue to persist internal + // data if it existed + if ( internalCache ) { + cache[ id ] = {}; + // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery + // metadata on plain JS objects when the object is serialized using + // JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + + cache[ id ][ internalKey ] = internalCache; + + // Otherwise, we need to eliminate the expando on the node to avoid + // false lookups in the cache for entries that no longer exist + } else if ( isNode ) { + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } else { + elem[ jQuery.expando ] = null; + } + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + data = jQuery.data( this[0] ); + + if ( this[0].nodeType === 1 ) { + var attr = this[0].attributes, name; + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( this[0], name, data[ name ] ); + } + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON +// property to be considered empty objects; this property always exists in +// order to make sure JSON.stringify does not expose internal metadata +function isEmptyDataObject( obj ) { + for ( var name in obj ) { + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + + + + +function handleQueueMarkDefer( elem, type, src ) { + var deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + defer = jQuery.data( elem, deferDataKey, undefined, true ); + if ( defer && + ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) && + ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) { + // Give room for hard-coded callbacks to fire first + // and eventually mark/queue something else on the element + setTimeout( function() { + if ( !jQuery.data( elem, queueDataKey, undefined, true ) && + !jQuery.data( elem, markDataKey, undefined, true ) ) { + jQuery.removeData( elem, deferDataKey, true ); + defer.resolve(); + } + }, 0 ); + } +} + +jQuery.extend({ + + _mark: function( elem, type ) { + if ( elem ) { + type = (type || "fx") + "mark"; + jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true ); + } + }, + + _unmark: function( force, elem, type ) { + if ( force !== true ) { + type = elem; + elem = force; + force = false; + } + if ( elem ) { + type = type || "fx"; + var key = type + "mark", + count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 ); + if ( count ) { + jQuery.data( elem, key, count, true ); + } else { + jQuery.removeData( elem, key, true ); + handleQueueMarkDefer( elem, type, "mark" ); + } + } + }, + + queue: function( elem, type, data ) { + if ( elem ) { + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type, undefined, true ); + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data), true ); + } else { + q.push( data ); + } + } + return q || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(), + defer; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + + if ( !queue.length ) { + jQuery.removeData( elem, type + "queue", true ); + handleQueueMarkDefer( elem, type, "queue" ); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function() { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, object ) { + if ( typeof type !== "string" ) { + object = type; + type = undefined; + } + type = type || "fx"; + var defer = jQuery.Deferred(), + elements = this, + i = elements.length, + count = 1, + deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + tmp; + function resolve() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + } + while( i-- ) { + if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || + ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || + jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && + jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) { + count++; + tmp.done( resolve ); + } + } + resolve(); + return defer.promise(); + } +}); + + + + +var rclass = /[\n\t\r]/g, + rspace = /\s+/, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + rinvalidChar = /\:/, + formHook, boolHook; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.prop ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class") || "") ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspace ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", + setClass = elem.className; + + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split( rspace ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + return (elem.value || "").replace(rreturn, ""); + } + + return undefined; + } + + var isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var self = jQuery(this), val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attrFix: { + // Always normalize to ensure hook usage + tabindex: "tabIndex" + }, + + attr: function( elem, name, value, pass ) { + var nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( !("getAttribute" in elem) ) { + return jQuery.prop( elem, name, value ); + } + + var ret, hooks, + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // Normalize the name if needed + name = notxml && jQuery.attrFix[ name ] || name; + + hooks = jQuery.attrHooks[ name ]; + + if ( !hooks ) { + // Use boolHook for boolean attributes + if ( rboolean.test( name ) && + (typeof value === "boolean" || value === undefined || value.toLowerCase() === name.toLowerCase()) ) { + + hooks = boolHook; + + // Use formHook for forms and if the name contains certain characters + } else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) { + hooks = formHook; + } + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return undefined; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, "" + value ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml ) { + return hooks.get( elem, name ); + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, name ) { + var propName; + if ( elem.nodeType === 1 ) { + name = jQuery.attrFix[ name ] || name; + + if ( jQuery.support.getSetAttribute ) { + // Use removeAttribute in browsers that support it + elem.removeAttribute( name ); + } else { + jQuery.attr( elem, name, "" ); + elem.removeAttributeNode( elem.getAttributeNode( name ) ); + } + + // Set corresponding property to false for boolean attributes + if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) { + elem[ propName ] = false; + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabIndex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return undefined; + } + + var ret, hooks, + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // Try to normalize/fix the name + name = notxml && jQuery.propFix[ name ] || name; + + hooks = jQuery.propHooks[ name ]; + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return (elem[ name ] = value); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: {} +}); + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + return elem[ jQuery.propFix[ name ] || name ] ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = value; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// Use the value property for back compat +// Use the formHook for button elements in IE6/7 (#1954) +jQuery.attrHooks.value = { + get: function( elem, name ) { + if ( formHook && jQuery.nodeName( elem, "button" ) ) { + return formHook.get( elem, name ); + } + return elem.value; + }, + set: function( elem, value, name ) { + if ( formHook && jQuery.nodeName( elem, "button" ) ) { + return formHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !jQuery.support.getSetAttribute ) { + + // propFix is more comprehensive and contains all fixes + jQuery.attrFix = jQuery.propFix; + + // Use this for any attribute on a form in IE6/7 + formHook = jQuery.attrHooks.name = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + // Return undefined if nodeValue is empty string + return ret && ret.nodeValue !== "" ? + ret.nodeValue : + undefined; + }, + set: function( elem, value, name ) { + // Check form objects in IE (multiple bugs related) + // Only use nodeValue if the attribute node exists on the form + var ret = elem.getAttributeNode( name ); + if ( ret ) { + ret.nodeValue = value; + return value; + } + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return (elem.style.cssText = "" + value); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }); +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0); + } + } + }); +}); + + + + +var hasOwn = Object.prototype.hasOwnProperty, + rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspaces = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery._data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + var events = elemData.events, + eventHandle = elemData.handle; + + if ( !events ) { + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ), + events = elemData && elemData.events; + + if ( !elemData || !events ) { + return; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem, undefined, true ); + } + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Event object or event type + var type = event.type || event, + namespaces = [], + exclusive; + + if ( type.indexOf("!") >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.exclusive = exclusive; + event.namespace = namespaces.join("."); + event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); + + // triggerHandler() and global events don't bubble or run the default action + if ( onlyHandlers || !elem ) { + event.preventDefault(); + event.stopPropagation(); + } + + // Handle a global trigger + if ( !elem ) { + // TODO: Stop taunting the data cache; remove global events and always attach to document + jQuery.each( jQuery.cache, function() { + // internalKey variable is just used to make it easier to find + // and potentially change this stuff later; currently it just + // points to jQuery.expando + var internalKey = jQuery.expando, + internalCache = this[ internalKey ]; + if ( internalCache && internalCache.events && internalCache.events[ type ] ) { + jQuery.event.trigger( event, data, internalCache.handle.elem ); + } + }); + return; + } + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + event.target = elem; + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + var cur = elem, + // IE doesn't like method names with a colon (#3533, #8272) + ontype = type.indexOf(":") < 0 ? "on" + type : ""; + + // Fire event on the current element, then bubble up the DOM tree + do { + var handle = jQuery._data( cur, "handle" ); + + event.currentTarget = cur; + if ( handle ) { + handle.apply( cur, data ); + } + + // Trigger an inline bound script + if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) { + event.result = false; + event.preventDefault(); + } + + // Bubble up to document, then to window + cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window; + } while ( cur && !event.isPropagationStopped() ); + + // If nobody prevented the default action, do it now + if ( !event.isDefaultPrevented() ) { + var old, + special = jQuery.event.special[ type ] || {}; + + if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction)() check here because IE6/7 fails that test. + // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch. + try { + if ( ontype && elem[ type ] ) { + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + jQuery.event.triggered = type; + elem[ type ](); + } + } catch ( ieError ) {} + + if ( old ) { + elem[ ontype ] = old; + } + + jQuery.event.triggered = undefined; + } + } + + return event.result; + }, + + handle: function( event ) { + event = jQuery.event.fix( event || window.event ); + // Snapshot the handlers list since a called handler may add/remove events. + var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0), + run_all = !event.exclusive && !event.namespace, + args = Array.prototype.slice.call( arguments, 0 ); + + // Use the fix-ed Event rather than the (read-only) native event + args[0] = event; + event.currentTarget = this; + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Triggered event must 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event. + if ( run_all || event.namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var eventDocument = event.target.ownerDocument || document, + doc = eventDocument.documentElement, + body = eventDocument.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // set the correct event type + event.type = event.data; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + + // Chrome does something similar, the parentNode property + // can be accessed but is null. + if ( parent && parent !== document && !parent.parentNode ) { + return; + } + + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( !jQuery.nodeName( this, "form" ) ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( jQuery.nodeName( elem, "select" ) ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery._data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery._data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; + + if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) { + testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : ""; + + if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery._data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + // Don't pass args or remember liveFired; they apply to the donor event. + var event = jQuery.extend( {}, args[ 0 ] ); + event.type = type; + event.originalEvent = {}; + event.liveFired = undefined; + jQuery.event.handle.call( elem, event ); + if ( event.isDefaultPrevented() ) { + args[ 0 ].preventDefault(); + } +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + + function handler( donor ) { + // Donor event is always a native one; fix it and switch its type. + // Let focusin/out handler cancel the donor focus/blur event. + var e = jQuery.event.fix( donor ); + e.type = fix; + e.originalEvent = {}; + jQuery.event.trigger( e, null, e.target ); + if ( e.isDefaultPrevented() ) { + donor.preventDefault(); + } + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + var handler; + + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( arguments.length === 2 || data === false ) { + fn = data; + data = undefined; + } + + if ( name === "one" ) { + handler = function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }; + handler.guid = fn.guid || jQuery.guid++; + } else { + handler = fn; + } + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( typeof types === "object" && !types.preventDefault ) { + for ( var key in types ) { + context[ name ]( key, data, types[key], selector ); + } + + return this; + } + + if ( name === "die" && !types && + origSelector && origSelector.charAt(0) === "." ) { + + context.unbind( origSelector ); + + return this; + } + + if ( data === false || jQuery.isFunction( data ) ) { + fn = data || returnFalse; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( liveMap[ type ] ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + for ( var j = 0, l = context.length; j < l; j++ ) { + jQuery.event.add( context[j], "live." + liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + } + + } else { + // unbind live handler + context.unbind( "live." + liveConvert( type, selector ), fn ); + } + } + + return this; + }; +}); + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery._data( this, "events" ); + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) + if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + + // Make sure not to accidentally match a child element with the same selector + if ( related && jQuery.contains( elem, related ) ) { + related = elem; + } + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.bind( name, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + + + +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + var attr = elem.getAttribute( "type" ), type = elem.type; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); + }, + + radio: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; + }, + + checkbox: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; + }, + + file: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; + }, + + password: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; + }, + + submit: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "submit" === elem.type; + }, + + image: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; + }, + + reset: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "reset" === elem.type; + }, + + button: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && "button" === elem.type || name === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + }, + + focus: function( elem ) { + return elem === elem.ownerDocument.activeElement; + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; + + if ( matches ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9 fails this) + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + var ret = matches.call( node, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || !disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9, so check for that + node.document && node.document.nodeType !== 11 ) { + return ret; + } + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var self = this, + i, l; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + var ret = this.pushStack( "", "find", selector ), + length, n, r; + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( typeof selector === "string" ? + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + // Array + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[ selector ] ) { + matches[ selector ] = POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[ selector ]; + + if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + // String + var pos = POS.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ), + // The variable 'args' was introduced in + // https://github.com/jquery/jquery/commit/52a0238 + // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. + // http://code.google.com/p/v8/issues/detail?id=1050 + args = slice.call(arguments); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, args.join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /", "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and " ); + +}() ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/jquery.simulate.js b/src/main/webapp/jquery-ui-1.9pre/tests/jquery.simulate.js new file mode 100644 index 0000000..a37302c --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/jquery.simulate.js @@ -0,0 +1,234 @@ +/* + * jquery.simulate - simulate browser mouse and keyboard events + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + */ + +;(function( $ ) { + +$.fn.extend({ + simulate: function( type, options ) { + return this.each(function() { + var opt = $.extend( {}, $.simulate.defaults, options ); + new $.simulate( this, type, opt ); + }); + } +}); + +$.simulate = function( el, type, options ) { + this.target = el; + this.options = options; + + if ( type === "drag" ) { + this[ type ].apply( this, [ this.target, options ] ); + } else if ( type === "focus" || type === "blur" ) { + this[ type ](); + } else { + this.simulateEvent( el, type, options ); + } +}; + +$.extend( $.simulate.prototype, { + simulateEvent: function( el, type, options ) { + var evt = this.createEvent( type, options ); + this.dispatchEvent( el, type, evt, options ); + return evt; + }, + createEvent: function( type, options ) { + if ( /^mouse(over|out|down|up|move)|(dbl)?click$/.test( type ) ) { + return this.mouseEvent( type, options ); + } else if ( /^key(up|down|press)$/.test( type ) ) { + return this.keyboardEvent( type, options ); + } + }, + mouseEvent: function( type, options ) { + var evt; + var e = $.extend({ + bubbles: true, + cancelable: (type !== "mousemove"), + view: window, + detail: 0, + screenX: 0, + screenY: 0, + clientX: 0, + clientY: 0, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + button: 0, + relatedTarget: undefined + }, options ); + + var relatedTarget = $( e.relatedTarget )[0]; + + if ( $.isFunction( document.createEvent ) ) { + evt = document.createEvent( "MouseEvents" ); + evt.initMouseEvent( type, e.bubbles, e.cancelable, e.view, e.detail, + e.screenX, e.screenY, e.clientX, e.clientY, + e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, + e.button, e.relatedTarget || document.body.parentNode ); + } else if ( document.createEventObject ) { + evt = document.createEventObject(); + $.extend( evt, e ); + evt.button = { 0:1, 1:4, 2:2 }[evt.button] || evt.button; + } + return evt; + }, + keyboardEvent: function( type, options ) { + var evt; + + var e = $.extend({ + bubbles: true, + cancelable: true, + view: window, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + keyCode: 0, + charCode: undefined + }, options ); + + if ( $.isFunction( document.createEvent ) ) { + try { + evt = document.createEvent( "KeyEvents" ); + evt.initKeyEvent( type, e.bubbles, e.cancelable, e.view, + e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, + e.keyCode, e.charCode ); + } catch( err ) { + evt = document.createEvent( "Events" ); + evt.initEvent( type, e.bubbles, e.cancelable ); + $.extend(evt, { + view: e.view, + ctrlKey: e.ctrlKey, + altKey: e.altKey, + shiftKey: e.shiftKey, + metaKey: e.metaKey, + keyCode: e.keyCode, + charCode: e.charCode + }); + } + } else if ( document.createEventObject ) { + evt = document.createEventObject(); + $.extend( evt, e ); + } + if ( $.browser.msie || $.browser.opera ) { + evt.keyCode = (e.charCode > 0) ? e.charCode : e.keyCode; + evt.charCode = undefined; + } + return evt; + }, + + dispatchEvent: function( el, type, evt ) { + if ( el.dispatchEvent ) { + el.dispatchEvent( evt ); + } else if ( el.fireEvent ) { + el.fireEvent( "on" + type, evt ); + } + return evt; + }, + + drag: function( el ) { + var self = this, + center = this.findCenter(this.target), + options = this.options, + x = Math.floor( center.x ), + y = Math.floor( center.y ), + dx = options.dx || 0, + dy = options.dy || 0, + target = this.target, + coord = { clientX: x, clientY: y }; + this.simulateEvent( target, "mousedown", coord ); + coord = { clientX: x + 1, clientY: y + 1 }; + this.simulateEvent( document, "mousemove", coord ); + coord = { clientX: x + dx, clientY: y + dy }; + this.simulateEvent( document, "mousemove", coord ); + this.simulateEvent( document, "mousemove", coord ); + this.simulateEvent( target, "mouseup", coord ); + this.simulateEvent( target, "click", coord ); + }, + findCenter: function( el ) { + var el = $( this.target ), + o = el.offset(), + d = $( document ); + return { + x: o.left + el.outerWidth() / 2 - d.scrollLeft(), + y: o.top + el.outerHeight() / 2 - d.scrollTop() + }; + }, + + focus: function() { + var focusinEvent, + triggered = false, + element = $( this.target ); + + function trigger() { + triggered = true; + } + + element.bind( "focus", trigger ); + element[ 0 ].focus(); + + if ( !triggered ) { + focusinEvent = $.Event( "focusin" ); + focusinEvent.preventDefault(); + element.trigger( focusinEvent ); + element.triggerHandler( "focus" ); + } + element.unbind( "focus", trigger ); + }, + + blur: function() { + var focusoutEvent, + triggered = false, + element = $( this.target ); + + function trigger() { + triggered = true; + } + + element.bind( "blur", trigger ); + element[ 0 ].blur(); + + // blur events are async in IE + setTimeout(function() { + // IE won't let the blur occur if the window is inactive + if ( element[ 0 ].ownerDocument.activeElement === element[ 0 ] ) { + element[ 0 ].ownerDocument.body.focus(); + } + + // Firefox won't trigger events if the window is inactive + // IE doesn't trigger events if we had to manually focus the body + if ( !triggered ) { + focusoutEvent = $.Event( "focusout" ); + focusoutEvent.preventDefault(); + element.trigger( focusoutEvent ); + element.triggerHandler( "blur" ); + } + element.unbind( "blur", trigger ); + }, 1 ); + } +}); + +$.extend( $.simulate, { + defaults: { + speed: "sync" + }, + VK_TAB: 9, + VK_ENTER: 13, + VK_ESC: 27, + VK_PGUP: 33, + VK_PGDN: 34, + VK_END: 35, + VK_HOME: 36, + VK_LEFT: 37, + VK_UP: 38, + VK_RIGHT: 39, + VK_DOWN: 40 +}); + +})( jQuery ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/resource_loader.js b/src/main/webapp/jquery-ui-1.9pre/tests/resource_loader.js new file mode 100644 index 0000000..c8dec48 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/resource_loader.js @@ -0,0 +1,39 @@ +(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( "" ); +} + +function includeScript( url ) { + document.write( "" ); +} + +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/src/main/webapp/jquery-ui-1.9pre/tests/static/button/default.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/button/default.html new file mode 100644 index 0000000..606df0a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/button/default.html @@ -0,0 +1,161 @@ + + + + + Button Static Test : Default + + + + + + + + + +

Using button elements

+ +
+ + + + + + + + + + + + + +
+ +

Using anchor elements

+ +
+ + Button + + + + + Primary icon + + + + Secondary icon + + + + + + Primary icon + + + + Secondary icon + + + + + + Both icons + + + + + + No text + + +
+ + + +

Using label elements (used when proxying to radio or check inputs)

+ +
+ + + + + + + + + + + + + +
+ + +

Button Sets

+ +
+ + + + +
+ + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/datepicker.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/datepicker.html new file mode 100644 index 0000000..6b8253b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/datepicker.html @@ -0,0 +1,1367 @@ + + + + + jQuery UI Datepicker Static Markup Test Page + + + + + + + + + + +
+
+ Prev + Next +
+ December + 2008 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
123456
78910111213
14151617181920
21222324252627
28293031
+
+ + +
+
+ Prev + Next +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
123456
78910111213
14151617181920
21222324252627
28293031
+
+ + +
+
+ Prev + Next +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
123456
78910111213
14151617181920
21222324252627
28293031
+
+ + +
+
+ Prev + Next +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
123456
78910111213
14151617181920
21222324252627
28293031
+
+ + +
+
+ + +
+
+
+ Prev +
+ December + 2008 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+
+ Next +
+ January + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+ + +
+
+
+ Prev +
+ December + 2008 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+
+
+ January + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+
+ Next +
+ February + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+ + +
+
+ + +
+
+
+ Prev +
+ December + 2008 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+
+
+ January + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
1
2345678
9101112131415
16171819202122
23242526272829
3031
+
+
+
+
+ February + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+
+ Next +
+ March + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+ +
+
+
+
+ April + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+
+
+ May + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+
+
+ June + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+
+
+
+ July + 2009 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
1
2345678
9101112131415
16171819202122
23242526272829
3031
+
+
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/default.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/default.html new file mode 100644 index 0000000..9c81be1 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/datepicker/default.html @@ -0,0 +1,86 @@ + + + + + Datepicker Static Test : Default + + + + + + + + +
+
+ Prev + Next +
+ December + 2008 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SuMoTuWeThFrSa
+ 123456
78910111213
14151617181920
21222324252627
28293031 + + +
+
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/icons.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/icons.html new file mode 100644 index 0000000..49edb0e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/icons.html @@ -0,0 +1,246 @@ + + + + + jQuery UI CSS Framework Icons Test Page + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default.html new file mode 100644 index 0000000..aec1f78 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Default + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default_vertical.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default_vertical.html new file mode 100644 index 0000000..6ddf1de --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/default_vertical.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Default vertical + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal.html new file mode 100644 index 0000000..e28d9d7 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Slider horizontal + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range.html new file mode 100644 index 0000000..227ce44 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Slider horizontal range + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_max.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_max.html new file mode 100644 index 0000000..11b2a96 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_max.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Slider horizontal range max + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_min.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_min.html new file mode 100644 index 0000000..9ed15f5 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_horizontal_range_min.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Slider horizontal range min + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical.html new file mode 100644 index 0000000..63ef3d1 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Slider vertical + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range.html new file mode 100644 index 0000000..4f1ffb0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Slider vertical range + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_max.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_max.html new file mode 100644 index 0000000..a5c9857 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_max.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Slider vertical range max + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_min.html b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_min.html new file mode 100644 index 0000000..b43d451 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/slider/slider_vertical_range_min.html @@ -0,0 +1,17 @@ + + + + + Slider Static Test : Slider vertical range min + + + + + + + + +
+ + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/static.css b/src/main/webapp/jquery-ui-1.9pre/tests/static/static.css new file mode 100644 index 0000000..60f25b5 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/static.css @@ -0,0 +1 @@ +body { font-size: 62.5%; } diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/static/static.js b/src/main/webapp/jquery-ui-1.9pre/tests/static/static.js new file mode 100644 index 0000000..1c29079 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/static/static.js @@ -0,0 +1,9 @@ +/* static_helpers.js + */ +$(function(){ + //add hover states on the static widgets + $('.ui-state-default:not(.ui-state-disabled, .ui-slider-range, .ui-progressbar-value), a.ui-datepicker-next, a.ui-datepicker-prev, .ui-dialog-titlebar-close').hover( + function(){ $(this).addClass('ui-state-hover'); }, + function(){ $(this).removeClass('ui-state-hover'); } + ); +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion.html new file mode 100644 index 0000000..ed9b1aa --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion.html @@ -0,0 +1,144 @@ + + + + + jQuery UI Accordion Test Suite + + + + + + + + + + + + + + + + + + + + + + +

jQuery UI Accordion Test Suite

+

+
+

+
    +
    + +
    +

    There is one obvious advantage:

    +
    +

    + You've seen it coming! +
    + Buy now and get nothing for free! +
    + Well, at least no free beer. Perhaps a bear, if you can afford it. +

    +
    +

    Now that you've got...

    +
    +

    + your bear, you have to admit it! +
    + No, we aren't selling bears. +

    +

    + We could talk about renting one. +

    +
    +

    Rent one bear, ...

    +
    +

    + get two for three beer. +

    +

    + And now, for something completely different. +

    +
    +
    + + + +
    +
    + Accordion Header 1 +
    +
    + Accordion Content 1 +
    +
    + Accordion Header 2 +
    +
    + Accordion Content 2 +
    +
    + Accordion Header 3 +
    +
    + Accordion Content 3 +
    +
    + +
    + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_core.js new file mode 100644 index 0000000..3442cad --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_core.js @@ -0,0 +1,55 @@ +(function( $ ) { + +module( "accordion: core", accordion_setupTeardown() ); + +$.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( type, selector ) { + test( "markup structure: " + type, function() { + expect( 4 ); + var element = $( selector ).accordion(); + ok( element.hasClass( "ui-accordion" ), "main element is .ui-accordion" ); + equal( element.find( ".ui-accordion-header" ).length, 3, + ".ui-accordion-header elements exist, correct number" ); + equal( element.find( ".ui-accordion-content" ).length, 3, + ".ui-accordion-content elements exist, correct number" ); + deepEqual( element.find( ".ui-accordion-header" ).next().get(), + element.find( ".ui-accordion-content" ).get(), + "content panels come immediately after headers" ); + }); +}); + +test( "handle click on header-descendant", function() { + expect( 1 ); + var element = $( "#navigation" ).accordion(); + $( "#navigation h2:eq(1) a" ).click(); + accordion_state( element, 0, 1, 0 ); +}); + +test( "ui-accordion-heading class added to headers anchor", function() { + expect( 1 ); + var element = $( "#list1" ).accordion(); + var anchors = element.find( ".ui-accordion-heading" ); + equal( anchors.length, 3 ); +}); + +test( "accessibility", function () { + expect( 13 ); + var element = $( "#list1" ).accordion().accordion( "option", "active", 1 ); + var headers = element.find( ".ui-accordion-header" ); + + equal( headers.eq( 1 ).attr( "tabindex" ), 0, "active header should have tabindex=0" ); + equal( headers.eq( 0 ).attr( "tabindex" ), -1, "inactive header should have tabindex=-1" ); + equal( element.attr( "role" ), "tablist", "main role" ); + equal( headers.attr( "role" ), "tab", "tab roles" ); + equal( headers.next().attr( "role" ), "tabpanel", "tabpanel roles" ); + equal( headers.eq( 1 ).attr( "aria-expanded" ), "true", "active tab has aria-expanded" ); + equal( headers.eq( 0 ).attr( "aria-expanded" ), "false", "inactive tab has aria-expanded" ); + equal( headers.eq( 1 ).attr( "aria-selected" ), "true", "active tab has aria-selected" ); + equal( headers.eq( 0 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" ); + element.accordion( "option", "active", 0 ); + equal( headers.eq( 0 ).attr( "aria-expanded" ), "true", "newly active tab has aria-expanded" ); + equal( headers.eq( 1 ).attr( "aria-expanded" ), "false", "newly inactive tab has aria-expanded" ); + equal( headers.eq( 0 ).attr( "aria-selected" ), "true", "active tab has aria-selected" ); + equal( headers.eq( 1 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults.js new file mode 100644 index 0000000..9aa58e6 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults.js @@ -0,0 +1,20 @@ +commonWidgetTests( "accordion", { + defaults: { + active: 0, + animated: "slide", + collapsible: false, + disabled: false, + event: "click", + header: "> li > :first-child,> :not(li):even", + heightStyle: "auto", + icons: { + "activeHeader": "ui-icon-triangle-1-s", + "header": "ui-icon-triangle-1-e" + }, + + // callbacks + activate: null, + beforeActivate: null, + create: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults_deprecated.js new file mode 100644 index 0000000..3f45a1f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_defaults_deprecated.js @@ -0,0 +1,28 @@ +commonWidgetTests( "accordion", { + defaults: { + active: 0, + animated: "slide", + autoHeight: true, + clearStyle: false, + collapsible: false, + disabled: false, + event: "click", + fillSpace: false, + header: "> li > :first-child,> :not(li):even", + heightStyle: null, + icons: { + "activeHeader": null, + "header": "ui-icon-triangle-1-e", + "headerSelected": "ui-icon-triangle-1-s" + }, + navigation: false, + navigationFilter: function() {}, + + // callbacks + activate: null, + beforeActivate: null, + change: null, + changestart: null, + create: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.html new file mode 100644 index 0000000..f730d80 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.html @@ -0,0 +1,142 @@ + + + + + jQuery UI Accordion Test Suite + + + + + + + + + + + + + + + + + + + + + + +

    jQuery UI Accordion Test Suite

    +

    +
    +

    +
      +
      + +
      +

      There is one obvious advantage:

      +
      +

      + You've seen it coming! +
      + Buy now and get nothing for free! +
      + Well, at least no free beer. Perhaps a bear, if you can afford it. +

      +
      +

      Now that you've got...

      +
      +

      + your bear, you have to admit it! +
      + No, we aren't selling bears. +

      +

      + We could talk about renting one. +

      +
      +

      Rent one bear, ...

      +
      +

      + get two for three beer. +

      +

      + And now, for something completely different. +

      +
      +
      + + + +
      +
      + Accordion Header 1 +
      +
      + Accordion Content 1 +
      +
      + Accordion Header 2 +
      +
      + Accordion Content 2 +
      +
      + Accordion Header 3 +
      +
      + Accordion Content 3 +
      +
      + +
      + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.js new file mode 100644 index 0000000..eec034e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_deprecated.js @@ -0,0 +1,338 @@ +(function( $ ) { + +module( "accordion (deprecated): expanded active option, activate method", accordion_setupTeardown() ); + +test( "activate, numeric", function() { + expect( 5 ); + var element = $( "#list1" ).accordion({ active: 1 }); + accordion_state( element, 0, 1, 0 ); + element.accordion( "activate", 2 ); + accordion_state( element, 0, 0, 1 ); + element.accordion( "activate", 0 ); + accordion_state( element, 1, 0, 0 ); + element.accordion( "activate", 1 ); + accordion_state( element, 0, 1, 0 ); + element.accordion( "activate", 2 ); + accordion_state( element, 0, 0, 1 ); +}); + +test( "activate, numeric, collapsible:true", function() { + expect( 3 ); + var element = $( "#list1" ).accordion({ collapsible: true }); + element.accordion( "activate", 2 ); + accordion_state( element, 0, 0, 1 ); + element.accordion( "activate", 0 ); + accordion_state( element, 1, 0, 0 ); + element.accordion( "activate", -1 ); + accordion_state( element, 0, 0, 0 ); +}); + +test( "activate, boolean, collapsible: true", function() { + expect( 2 ); + var element = $( "#list1" ).accordion({ collapsible: true }); + element.accordion( "activate", 2 ); + accordion_state( element, 0, 0, 1 ); + element.accordion( "activate", false ); + accordion_state( element, 0, 0, 0 ); +}); + +test( "activate, boolean, collapsible: false", function() { + expect( 2 ); + var element = $( "#list1" ).accordion(); + element.accordion( "activate", 2 ); + accordion_state( element, 0, 0, 1 ); + element.accordion( "activate", false ); + accordion_state( element, 0, 0, 1 ); +}); + +test( "activate, string expression", function() { + expect( 4 ); + var element = $( "#list1" ).accordion({ active: "h3:last" }); + accordion_state( element, 0, 0, 1 ); + element.accordion( "activate", ":first" ); + accordion_state( element, 1, 0, 0 ); + element.accordion( "activate", ":eq(1)" ); + accordion_state( element, 0, 1, 0 ); + element.accordion( "activate", ":last" ); + accordion_state( element, 0, 0, 1 ); +}); + +test( "activate, jQuery or DOM element", function() { + expect( 3 ); + var element = $( "#list1" ).accordion({ active: $( "#list1 h3:last" ) }); + accordion_state( element, 0, 0, 1 ); + element.accordion( "activate", $( "#list1 h3:first" ) ); + accordion_state( element, 1, 0, 0 ); + element.accordion( "activate", $( "#list1 h3" )[ 1 ] ); + accordion_state( element, 0, 1, 0 ); +}); + +test( "{ active: Selector }", function() { + expect( 2 ); + var element = $("#list1").accordion({ + active: "h3:last" + }); + accordion_state( element, 0, 0, 1 ); + element.accordion( "option", "active", "h3:eq(1)" ); + accordion_state( element, 0, 1, 0 ); +}); + +test( "{ active: Element }", function() { + expect( 2 ); + var element = $( "#list1" ).accordion({ + active: $( "#list1 h3:last" )[ 0 ] + }); + accordion_state( element, 0, 0, 1 ); + element.accordion( "option", "active", $( "#list1 h3:eq(1)" )[ 0 ] ); + accordion_state( element, 0, 1, 0 ); +}); + +test( "{ active: jQuery Object }", function() { + expect( 2 ); + var element = $( "#list1" ).accordion({ + active: $( "#list1 h3:last" ) + }); + accordion_state( element, 0, 0, 1 ); + element.accordion( "option", "active", $( "#list1 h3:eq(1)" ) ); + accordion_state( element, 0, 1, 0 ); +}); + + + + + +module( "accordion (deprecated) - height options", accordion_setupTeardown() ); + +test( "{ autoHeight: true }, default", function() { + expect( 3 ); + accordion_equalHeights( $( "#navigation" ).accordion({ autoHeight: true }), 95, 130 ); +}); + +test( "{ autoHeight: false }", function() { + expect( 3 ); + var element = $( "#navigation" ).accordion({ autoHeight: false }); + var sizes = []; + element.find( ".ui-accordion-content" ).each(function() { + sizes.push( $(this).height() ); + }); + ok( sizes[0] >= 70 && sizes[0] <= 105, "was " + sizes[0] ); + ok( sizes[1] >= 98 && sizes[1] <= 126, "was " + sizes[1] ); + ok( sizes[2] >= 42 && sizes[2] <= 54, "was " + sizes[2] ); +}); + +test( "{ fillSpace: true }", function() { + expect( 3 ); + $( "#navigationWrapper" ).height( 500 ); + var element = $( "#navigation" ).accordion({ fillSpace: true }); + accordion_equalHeights( element, 446, 458 ); +}); + +test( "{ fillSapce: true } with sibling", function() { + expect( 3 ); + $( "#navigationWrapper" ).height( 500 ); + $( "

      Lorem Ipsum

      " ) + .css({ + height: 50, + marginTop: 20, + marginBottom: 30 + }) + .prependTo( "#navigationWrapper" ); + var element = $( "#navigation" ).accordion({ fillSpace: true }); + accordion_equalHeights( element , 346, 358); +}); + +test( "{ fillSpace: true } with multiple siblings", function() { + expect( 3 ); + $( "#navigationWrapper" ).height( 500 ); + $( "

      Lorem Ipsum

      " ) + .css({ + height: 50, + marginTop: 20, + marginBottom: 30 + }) + .prependTo( "#navigationWrapper" ); + $( "

      Lorem Ipsum

      " ) + .css({ + height: 50, + marginTop: 20, + marginBottom: 30, + position: "absolute" + }) + .prependTo( "#navigationWrapper" ); + $( "

      Lorem Ipsum

      " ) + .css({ + height: 25, + marginTop: 10, + marginBottom: 15 + }) + .prependTo( "#navigationWrapper" ); + var element = $( "#navigation" ).accordion({ fillSpace: true }); + accordion_equalHeights( element, 296, 308 ); +}); + + + + + +module( "accordion (deprecated) - icons", accordion_setupTeardown() ); + +test( "icons, headerSelected", function() { + expect( 3 ); + var element = $( "#list1" ).accordion({ + icons: { headerSelected: "a1", header: "h1" } + }); + ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) ); + element.accordion( "option", "icons", { headerSelected: "a2", header: "h2" } ); + ok( !element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) ); + ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a2" ) ); +}); + + + + + +module( "accordion (deprecated) - resize", accordion_setupTeardown() ); + +test( "resize", function() { + expect( 6 ); + var element = $( "#navigation" ) + .parent() + .height( 300 ) + .end() + .accordion({ + heightStyle: "fill" + }); + accordion_equalHeights( element, 246, 258 ); + + element.parent().height( 500 ); + element.accordion( "resize" ); + accordion_equalHeights( element, 446, 458 ); +}); + + + + + +module( "accordion (deprecated) - navigation", accordion_setupTeardown() ); + +test( "{ navigation: true, navigationFilter: header }", function() { + expect( 2 ); + var element = $( "#navigation" ).accordion({ + navigation: true, + navigationFilter: function() { + return /\?p=1\.1\.3$/.test( this.href ); + } + }); + equal( element.accordion( "option", "active" ), 2 ); + accordion_state( element, 0, 0, 1 ); +}); + +test( "{ navigation: true, navigationFilter: content }", function() { + expect( 2 ); + var element = $( "#navigation" ).accordion({ + navigation: true, + navigationFilter: function() { + return /\?p=1\.1\.3\.2$/.test( this.href ); + } + }); + equal( element.accordion( "option", "active" ), 2 ); + accordion_state( element, 0, 0, 1 ); +}); + + + + + +module( "accordion (deprecated) - changestart/change events", accordion_setupTeardown() ); + +test( "changestart", function() { + expect( 26 ); + var element = $( "#list1" ).accordion({ + active: false, + collapsible: true + }); + var headers = element.find( ".ui-accordion-header" ); + var content = element.find( ".ui-accordion-content" ); + + element.one( "accordionchangestart", function( event, ui ) { + equal( ui.oldHeader.size(), 0 ); + equal( ui.oldContent.size(), 0 ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 0 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 0 ] ); + accordion_state( element, 0, 0, 0 ); + }); + element.accordion( "option", "active", 0 ); + accordion_state( element, 1, 0, 0 ); + + element.one( "accordionchangestart", function( event, ui ) { + equal( ui.oldHeader.size(), 1 ); + strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] ); + equal( ui.oldContent.size(), 1 ); + strictEqual( ui.oldContent[ 0 ], content[ 0 ] ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 1 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 1 ] ); + accordion_state( element, 1, 0, 0 ); + }); + headers.eq( 1 ).click(); + accordion_state( element, 0, 1, 0 ); + + element.one( "accordionchangestart", function( event, ui ) { + equal( ui.oldHeader.size(), 1 ); + strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] ); + equal( ui.oldContent.size(), 1 ); + strictEqual( ui.oldContent[ 0 ], content[ 1 ] ); + equal( ui.newHeader.size(), 0 ); + equal( ui.newContent.size(), 0 ); + accordion_state( element, 0, 1, 0 ); + }); + element.accordion( "option", "active", false ); + accordion_state( element, 0, 0, 0 ); +}); + +test( "change", function() { + expect( 20 ); + var element = $( "#list1" ).accordion({ + active: false, + collapsible: true + }); + var headers = element.find( ".ui-accordion-header" ); + var content = element.find( ".ui-accordion-content" ); + + element.one( "accordionchange", function( event, ui ) { + equal( ui.oldHeader.size(), 0 ); + equal( ui.oldContent.size(), 0 ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 0 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 0 ] ); + }); + element.accordion( "option", "active", 0 ); + + element.one( "accordionchange", function( event, ui ) { + equal( ui.oldHeader.size(), 1 ); + strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] ); + equal( ui.oldContent.size(), 1 ); + strictEqual( ui.oldContent[ 0 ], content[ 0 ] ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 1 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 1 ] ); + }); + headers.eq( 1 ).click(); + + element.one( "accordionchange", function( event, ui ) { + equal( ui.oldHeader.size(), 1 ); + strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] ); + equal( ui.oldContent.size(), 1 ); + strictEqual( ui.oldContent[ 0 ], content[ 1 ] ); + equal( ui.newHeader.size(), 0 ); + equal( ui.newContent.size(), 0 ); + }); + element.accordion( "option", "active", false ); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_events.js new file mode 100644 index 0000000..12acf2a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_events.js @@ -0,0 +1,122 @@ +(function( $ ) { + +module( "accordion: events", accordion_setupTeardown() ); + +test( "beforeActivate", function() { + expect( 38 ); + var element = $( "#list1" ).accordion({ + active: false, + collapsible: true + }); + var headers = element.find( ".ui-accordion-header" ); + var content = element.find( ".ui-accordion-content" ); + + element.one( "accordionbeforeactivate", function( event, ui ) { + ok( !( "originalEvent" in event ) ); + equal( ui.oldHeader.size(), 0 ); + equal( ui.oldContent.size(), 0 ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 0 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 0 ] ); + accordion_state( element, 0, 0, 0 ); + }); + element.accordion( "option", "active", 0 ); + accordion_state( element, 1, 0, 0 ); + + element.one( "accordionbeforeactivate", function( event, ui ) { + equal( event.originalEvent.type, "click" ); + equal( ui.oldHeader.size(), 1 ); + strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] ); + equal( ui.oldContent.size(), 1 ); + strictEqual( ui.oldContent[ 0 ], content[ 0 ] ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 1 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 1 ] ); + accordion_state( element, 1, 0, 0 ); + }); + headers.eq( 1 ).click(); + accordion_state( element, 0, 1, 0 ); + + element.one( "accordionbeforeactivate", function( event, ui ) { + ok( !( "originalEvent" in event ) ); + equal( ui.oldHeader.size(), 1 ); + strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] ); + equal( ui.oldContent.size(), 1 ); + strictEqual( ui.oldContent[ 0 ], content[ 1 ] ); + equal( ui.newHeader.size(), 0 ); + equal( ui.newContent.size(), 0 ); + accordion_state( element, 0, 1, 0 ); + }); + element.accordion( "option", "active", false ); + accordion_state( element, 0, 0, 0 ); + + element.one( "accordionbeforeactivate", function( event, ui ) { + ok( !( "originalEvent" in event ) ); + equal( ui.oldHeader.size(), 0 ); + equal( ui.oldContent.size(), 0 ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 2 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 2 ] ); + event.preventDefault(); + accordion_state( element, 0, 0, 0 ); + }); + element.accordion( "option", "active", 2 ); + accordion_state( element, 0, 0, 0 ); +}); + +test( "activate", function() { + expect( 21 ); + var element = $( "#list1" ).accordion({ + active: false, + collapsible: true + }); + var headers = element.find( ".ui-accordion-header" ); + var content = element.find( ".ui-accordion-content" ); + + element.one( "accordionactivate", function( event, ui ) { + equal( ui.oldHeader.size(), 0 ); + equal( ui.oldContent.size(), 0 ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 0 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 0 ] ); + }); + element.accordion( "option", "active", 0 ); + + element.one( "accordionactivate", function( event, ui ) { + equal( ui.oldHeader.size(), 1 ); + strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] ); + equal( ui.oldContent.size(), 1 ); + strictEqual( ui.oldContent[ 0 ], content[ 0 ] ); + equal( ui.newHeader.size(), 1 ); + strictEqual( ui.newHeader[ 0 ], headers[ 1 ] ); + equal( ui.newContent.size(), 1 ); + strictEqual( ui.newContent[ 0 ], content[ 1 ] ); + }); + headers.eq( 1 ).click(); + + element.one( "accordionactivate", function( event, ui ) { + equal( ui.oldHeader.size(), 1 ); + strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] ); + equal( ui.oldContent.size(), 1 ); + strictEqual( ui.oldContent[ 0 ], content[ 1 ] ); + equal( ui.newHeader.size(), 0 ); + equal( ui.newContent.size(), 0 ); + }); + element.accordion( "option", "active", false ); + + // prevent activation + element.one( "accordionbeforeactivate", function( event ) { + ok( true ); + event.preventDefault(); + }); + element.one( "accordionactivate", function() { + ok( false ); + }); + element.accordion( "option", "active", 1 ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_methods.js new file mode 100644 index 0000000..9f61647 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_methods.js @@ -0,0 +1,40 @@ +(function( $ ) { + +module( "accordion: methods", accordion_setupTeardown() ); + +test( "destroy", function() { + expect( 1 ); + domEqual( "#list1", function() { + $( "#list1" ).accordion().accordion( "destroy" ); + }); +}); + +test( "enable/disable", function() { + expect( 3 ); + var element = $( "#list1" ).accordion(); + accordion_state( element, 1, 0, 0 ); + element.accordion( "disable" ); + element.accordion( "option", "active", 1 ); + accordion_state( element, 1, 0, 0 ); + element.accordion( "enable" ); + element.accordion( "option", "active", 1 ); + accordion_state( element, 0, 1, 0 ); +}); + +test( "refresh", function() { + expect( 6 ); + var element = $( "#navigation" ) + .parent() + .height( 300 ) + .end() + .accordion({ + heightStyle: "fill" + }); + accordion_equalHeights( element, 246, 258 ); + + element.parent().height( 500 ); + element.accordion( "refresh" ); + accordion_equalHeights( element, 446, 458 ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_options.js new file mode 100644 index 0000000..a60bb27 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_options.js @@ -0,0 +1,283 @@ +(function( $ ) { + +module( "accordion: options", accordion_setupTeardown() ); + +test( "{ active: default }", function() { + expect( 2 ); + var element = $( "#list1" ).accordion(); + equal( element.accordion( "option", "active" ), 0 ); + accordion_state( element, 1, 0, 0 ); +}); + +test( "{ active: false }", function() { + expect( 7 ); + var element = $( "#list1" ).accordion({ + active: false, + collapsible: true + }); + accordion_state( element, 0, 0, 0 ); + equal( element.find( ".ui-accordion-header.ui-state-active" ).size(), 0, "no headers selected" ); + equal( element.accordion( "option", "active" ), false ); + + element.accordion( "option", "collapsible", false ); + accordion_state( element, 1, 0, 0 ); + equal( element.accordion( "option", "active" ), 0 ); + + element.accordion( "destroy" ); + element.accordion({ + active: false + }); + accordion_state( element, 1, 0, 0 ); + strictEqual( element.accordion( "option", "active" ), 0 ); +}); + +test( "{ active: Number }", function() { + expect( 8 ); + var element = $( "#list1" ).accordion({ + active: 2 + }); + equal( element.accordion( "option", "active" ), 2 ); + accordion_state( element, 0, 0, 1 ); + + element.accordion( "option", "active", 0 ); + equal( element.accordion( "option", "active" ), 0 ); + accordion_state( element, 1, 0, 0 ); + + element.find( ".ui-accordion-header" ).eq( 1 ).click(); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); + + element.accordion( "option", "active", 10 ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); +}); + +if ( $.uiBackCompat === false ) { + test( "{ active: -Number }", function() { + expect( 8 ); + var element = $( "#list1" ).accordion({ + active: -1 + }); + equal( element.accordion( "option", "active" ), 2 ); + accordion_state( element, 0, 0, 1 ); + + element.accordion( "option", "active", -2 ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); + + element.accordion( "option", "active", -10 ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); + + element.accordion( "option", "active", -3 ); + equal( element.accordion( "option", "active" ), 0 ); + accordion_state( element, 1, 0, 0 ); + }); +} + +// TODO: add animation tests + +test( "{ collapsible: false }", function() { + expect( 4 ); + var element = $( "#list1" ).accordion({ + active: 1 + }); + element.accordion( "option", "active", false ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); + + element.find( ".ui-accordion-header" ).eq( 1 ).click(); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); +}); + +test( "{ collapsible: true }", function() { + expect( 6 ); + var element = $( "#list1" ).accordion({ + active: 1, + collapsible: true + }); + + element.accordion( "option", "active", false ); + equal( element.accordion( "option", "active" ), false ); + accordion_state( element, 0, 0, 0 ); + + element.accordion( "option", "active", 1 ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); + + element.find( ".ui-accordion-header" ).eq( 1 ).click(); + equal( element.accordion( "option", "active" ), false ); + accordion_state( element, 0, 0, 0 ); +}); + +test( "{ event: null }", function() { + expect( 5 ); + var element = $( "#list1" ).accordion({ + event: null + }); + accordion_state( element, 1, 0, 0 ); + + element.accordion( "option", "active", 1 ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); + + // ensure default click handler isn't bound + element.find( ".ui-accordion-header" ).eq( 2 ).click(); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); +}); + +test( "{ event: custom }", function() { + expect( 11 ); + var element = $( "#list1" ).accordion({ + event: "custom1 custom2" + }); + accordion_state( element, 1, 0, 0 ); + + element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); + + // ensure default click handler isn't bound + element.find( ".ui-accordion-header" ).eq( 2 ).trigger( "click" ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); + + element.find( ".ui-accordion-header" ).eq( 2 ).trigger( "custom2" ); + equal( element.accordion( "option", "active" ), 2 ); + accordion_state( element, 0, 0, 1 ); + + element.accordion( "option", "event", "custom3" ); + + // ensure old event handlers are unbound + element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" ); + equal( element.accordion( "option", "active" ), 2 ); + accordion_state( element, 0, 0, 1 ); + + element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom3" ); + equal( element.accordion( "option", "active" ), 1 ); + accordion_state( element, 0, 1, 0 ); +}); + +test( "{ header: default }", function() { + expect( 2 ); + // default: > li > :first-child,> :not(li):even + // > :not(li):even + accordion_state( $( "#list1" ).accordion(), 1, 0, 0); + // > li > :first-child + accordion_state( $( "#navigation" ).accordion(), 1, 0, 0); +}); + +test( "{ header: custom }", function() { + expect( 6 ); + var element = $( "#navigationWrapper" ).accordion({ + header: "h2" + }); + element.find( "h2" ).each(function() { + ok( $( this ).hasClass( "ui-accordion-header" ) ); + }); + equal( element.find( ".ui-accordion-header" ).length, 3 ); + accordion_state( element, 1, 0, 0 ); + element.accordion( "option", "active", 2 ); + accordion_state( element, 0, 0, 1 ); +}); + +test( "{ heightStyle: 'auto' }", function() { + expect( 3 ); + var element = $( "#navigation" ).accordion({ heightStyle: "auto" }); + accordion_equalHeights( element, 95, 130 ); +}); + +test( "{ heightStyle: 'content' }", function() { + expect( 3 ); + var element = $( "#navigation" ).accordion({ heightStyle: "content" }); + var sizes = element.find( ".ui-accordion-content" ).map(function() { + return $( this ).height(); + }).get(); + ok( sizes[ 0 ] >= 70 && sizes[ 0 ] <= 105, "was " + sizes[ 0 ] ); + ok( sizes[ 1 ] >= 98 && sizes[ 1 ] <= 126, "was " + sizes[ 1 ] ); + ok( sizes[ 2 ] >= 42 && sizes[ 2 ] <= 54, "was " + sizes[ 2 ] ); +}); + +test( "{ heightStyle: 'fill' }", function() { + expect( 3 ); + $( "#navigationWrapper" ).height( 500 ); + var element = $( "#navigation" ).accordion({ heightStyle: "fill" }); + accordion_equalHeights( element, 446, 458 ); +}); + +test( "{ heightStyle: 'fill' } with sibling", function() { + expect( 3 ); + $( "#navigationWrapper" ).height( 500 ); + $( "

      Lorem Ipsum

      " ) + .css({ + height: 50, + marginTop: 20, + marginBottom: 30 + }) + .prependTo( "#navigationWrapper" ); + var element = $( "#navigation" ).accordion({ heightStyle: "fill" }); + accordion_equalHeights( element , 346, 358); +}); + +test( "{ heightStyle: 'fill' } with multiple siblings", function() { + expect( 3 ); + $( "#navigationWrapper" ).height( 500 ); + $( "

      Lorem Ipsum

      " ) + .css({ + height: 50, + marginTop: 20, + marginBottom: 30 + }) + .prependTo( "#navigationWrapper" ); + $( "

      Lorem Ipsum

      " ) + .css({ + height: 50, + marginTop: 20, + marginBottom: 30, + position: "absolute" + }) + .prependTo( "#navigationWrapper" ); + $( "

      Lorem Ipsum

      " ) + .css({ + height: 25, + marginTop: 10, + marginBottom: 15 + }) + .prependTo( "#navigationWrapper" ); + var element = $( "#navigation" ).accordion({ heightStyle: "fill" }); + accordion_equalHeights( element, 296, 308 ); +}); + +test( "{ icons: false }", function() { + expect( 8 ); + var element = $( "#list1" ); + function icons( on ) { + deepEqual( element.find( "span.ui-icon").length, on ? 3 : 0 ); + deepEqual( element.hasClass( "ui-accordion-icons" ), on ); + } + element.accordion(); + icons( true ); + element.accordion( "destroy" ).accordion({ + icons: false + }); + icons( false ); + element.accordion( "option", "icons", { header: "foo", activeHeader: "bar" } ); + icons( true ); + element.accordion( "option", "icons", false ); + icons( false ); +}); + +test( "{ icons: hash }", function() { + expect( 3 ); + var element = $( "#list1" ).accordion({ + icons: { activeHeader: "a1", header: "h1" } + }); + ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) ); + element.accordion( "option", "icons", { activeHeader: "a2", header: "h2" } ); + ok( !element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) ); + ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a2" ) ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_test_helpers.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_test_helpers.js new file mode 100644 index 0000000..66d60a4 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/accordion_test_helpers.js @@ -0,0 +1,30 @@ +function accordion_state( accordion ) { + var expected = $.makeArray( arguments ).slice( 1 ); + var actual = accordion.find( ".ui-accordion-content" ).map(function() { + return $( this ).css( "display" ) === "none" ? 0 : 1; + }).get(); + deepEqual( actual, expected ); +} + +function accordion_equalHeights( accordion, min, max ) { + var sizes = []; + accordion.find( ".ui-accordion-content" ).each(function() { + sizes.push( $( this ).outerHeight() ); + }); + ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max, + "must be within " + min + " and " + max + ", was " + sizes[ 0 ] ); + deepEqual( sizes[ 0 ], sizes[ 1 ] ); + deepEqual( sizes[ 0 ], sizes[ 2 ] ); +} + +function accordion_setupTeardown() { + var animated = $.ui.accordion.prototype.options.animated; + return { + setup: function() { + $.ui.accordion.prototype.options.animated = false; + }, + teardown: function() { + $.ui.accordion.prototype.options.animated = animated; + } + }; +} diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/all.html new file mode 100644 index 0000000..0d600e1 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/accordion/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Accordion Test Suite + + + + + + + + + + + + + +

      jQuery UI Accordion Test Suite

      +

      +
      +

      +
        +
        + +
        + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/all.html new file mode 100644 index 0000000..d5152bb --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/all.html @@ -0,0 +1,72 @@ + + + + + jQuery UI Test Suite + + + + + + + + + + + + +

        jQuery UI Test Suite

        +

        +
        +

        +
          +
          + +
          + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/all.html new file mode 100644 index 0000000..c644e27 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Autocomplete Test Suite + + + + + + + + + + + + + +

          jQuery UI Autocomplete Test Suite

          +

          +
          +

          +
            +
            + +
            + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete.html new file mode 100644 index 0000000..70d2ecf --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete.html @@ -0,0 +1,51 @@ + + + + + jQuery UI Autocomplete Test Suite + + + + + + + + + + + + + + + + + + + + +

            jQuery UI Autocomplete Test Suite

            +

            +
            +

            +
              +
              + +
              +
              +
              + + +
              + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_core.js new file mode 100644 index 0000000..3f92aa0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_core.js @@ -0,0 +1,83 @@ +(function( $ ) { + +module( "autocomplete: core" ); + +asyncTest( "close-on-blur is properly delayed", function() { + expect( 3 ); + var element = $( "#autocomplete" ) + .autocomplete({ + source: [ "java", "javascript" ] + }) + .val( "ja" ) + .autocomplete( "search" ), + menu = element.autocomplete( "widget" ); + + ok( menu.is( ":visible" ) ); + element.blur(); + ok( menu.is( ":visible" ) ); + setTimeout(function() { + ok( menu.is( ":hidden") ); + start(); + }, 200 ); +}); + +asyncTest( "close-on-blur is cancelled when starting a search", function() { + expect( 3 ); + var element = $( "#autocomplete" ) + .autocomplete({ + source: [ "java", "javascript" ] + }) + .val( "ja" ) + .autocomplete( "search" ), + menu = element.autocomplete( "widget" ); + + ok( menu.is( ":visible" ) ); + element.blur(); + ok( menu.is( ":visible" ) ); + element.autocomplete( "search" ); + setTimeout(function() { + ok( menu.is( ":visible" ) ); + start(); + }, 200 ); +}); + +test( "prevent form submit on enter when menu is active", function() { + expect( 2 ); + var event, + element = $( "#autocomplete" ) + .autocomplete({ + source: [ "java", "javascript" ] + }) + .val( "ja" ) + .autocomplete( "search" ), + menu = element.autocomplete( "widget" ); + + event = $.Event( "keydown" ); + event.keyCode = $.ui.keyCode.DOWN; + element.trigger( event ); + deepEqual( menu.find( ".ui-menu-item:has(.ui-state-focus)" ).length, 1, "menu item is active" ); + + event = $.Event( "keydown" ); + event.keyCode = $.ui.keyCode.ENTER; + element.trigger( event ); + ok( event.isDefaultPrevented(), "default action is prevented" ); +}); + +test( "allow form submit on enter when menu is not active", function() { + expect( 1 ); + var event, + element = $( "#autocomplete" ) + .autocomplete({ + autoFocus: false, + source: [ "java", "javascript" ] + }) + .val( "ja" ) + .autocomplete( "search" ); + + event = $.Event( "keydown" ); + event.keyCode = $.ui.keyCode.ENTER; + element.trigger( event ); + ok( !event.isDefaultPrevented(), "default action is prevented" ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_defaults.js new file mode 100644 index 0000000..ac83eae --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_defaults.js @@ -0,0 +1,25 @@ +commonWidgetTests( "autocomplete", { + defaults: { + appendTo: "body", + autoFocus: false, + delay: 300, + disabled: false, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null, + + // callbacks + change: null, + close: null, + create: null, + focus: null, + open: null, + response: null, + search: null, + select: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_events.js new file mode 100644 index 0000000..7b51ec4 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_events.js @@ -0,0 +1,179 @@ +(function( $ ) { + +module( "autocomplete: events" ); + +var data = [ "Clojure", "COBOL", "ColdFusion", "Java", "JavaScript", "Scala", "Scheme" ]; + +$.each([ + { + type: "input", + selector: "#autocomplete", + valueMethod: "val" + }, + { + type: "textarea", + selector: "#autocomplete-textarea", + valueMethod: "val" + }, + { + type: "contenteditable", + selector: "#autocomplete-contenteditable", + valueMethod: "text" + } +], function( i, settings ) { + asyncTest( "all events - " + settings.type, function() { + expect( 13 ); + var element = $( settings.selector ) + .autocomplete({ + autoFocus: false, + delay: 0, + source: data, + search: function( event ) { + equal( event.originalEvent.type, "keydown", "search originalEvent" ); + }, + response: function( event, ui ) { + deepEqual( ui.content, [ + { label: "Clojure", value: "Clojure" }, + { label: "Java", value: "Java" }, + { label: "JavaScript", value: "JavaScript" } + ], "response ui.content" ); + ui.content.splice( 0, 1 ); + }, + open: function( event ) { + ok( menu.is( ":visible" ), "menu open on open" ); + }, + focus: function( event, ui ) { + equal( event.originalEvent.type, "menufocus", "focus originalEvent" ); + deepEqual( ui.item, { label: "Java", value: "Java" }, "focus ui.item" ); + }, + close: function( event ) { + equal( event.originalEvent.type, "menuselect", "close originalEvent" ); + ok( menu.is( ":hidden" ), "menu closed on close" ); + }, + select: function( event, ui ) { + equal( event.originalEvent.type, "menuselect", "select originalEvent" ); + deepEqual( ui.item, { label: "Java", value: "Java" }, "select ui.item" ); + }, + change: function( event, ui ) { + equal( event.originalEvent.type, "blur", "change originalEvent" ); + deepEqual( ui.item, { label: "Java", value: "Java" }, "change ui.item" ); + ok( menu.is( ":hidden" ), "menu closed on change" ); + start(); + } + }), + menu = element.autocomplete( "widget" ); + + element.simulate( "focus" )[ settings.valueMethod ]( "j" ).keydown(); + setTimeout(function() { + ok( menu.is( ":visible" ), "menu is visible after delay" ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + element.simulate( "blur" ); + }, 50 ); + }); +}); + +asyncTest( "change without selection", function() { + expect( 1 ); + var element = $( "#autocomplete" ).autocomplete({ + delay: 0, + source: data, + change: function( event, ui ) { + strictEqual( ui.item, null ); + start(); + } + }); + element.triggerHandler( "focus" ); + element.val( "ja" ).triggerHandler( "blur" ); +}); + +asyncTest( "cancel search", function() { + expect( 6 ); + var first = true, + element = $( "#autocomplete" ).autocomplete({ + delay: 0, + source: data, + search: function() { + if ( first ) { + equal( element.val(), "ja", "val on first search" ); + first = false; + return false; + } + equal( element.val(), "java", "val on second search" ); + }, + open: function() { + ok( true, "menu opened" ); + } + }), + menu = element.autocomplete( "widget" ); + element.val( "ja" ).keydown(); + setTimeout(function() { + ok( menu.is( ":hidden" ), "menu is hidden after first search" ); + element.val( "java" ).keydown(); + setTimeout(function() { + ok( menu.is( ":visible" ), "menu is visible after second search" ); + equal( menu.find( ".ui-menu-item" ).length, 2, "# of menu items" ); + start(); + }, 50 ); + }, 50 ); +}); + +asyncTest( "cancel focus", function() { + expect( 1 ); + var customVal = "custom value"; + element = $( "#autocomplete" ).autocomplete({ + delay: 0, + source: data, + focus: function( event, ui ) { + $( this ).val( customVal ); + return false; + } + }); + element.val( "ja" ).keydown(); + setTimeout(function() { + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + equal( element.val(), customVal ); + start(); + }, 50 ); +}); + +asyncTest( "cancel select", function() { + expect( 1 ); + var customVal = "custom value", + element = $( "#autocomplete" ).autocomplete({ + delay: 0, + source: data, + select: function( event, ui ) { + $( this ).val( customVal ); + return false; + } + }); + element.val( "ja" ).keydown(); + setTimeout(function() { + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + equal( element.val(), customVal ); + start(); + }, 50 ); +}); + +asyncTest( "blur during remote search", function() { + expect( 1 ); + var ac = $( "#autocomplete" ).autocomplete({ + delay: 0, + source: function( request, response ) { + ok( true, "trigger request" ); + ac.simulate( "blur" ); + setTimeout(function() { + response([ "result" ]); + start(); + }, 100 ); + }, + open: function() { + ok( false, "opened after a blur" ); + } + }); + ac.val( "ro" ).keydown(); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_methods.js new file mode 100644 index 0000000..3fe035d --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_methods.js @@ -0,0 +1,30 @@ +(function( $ ) { + +module( "autocomplete: methods" ); + +test( "destroy", function() { + expect( 1 ); + domEqual( "#autocomplete", function() { + $( "#autocomplete" ).autocomplete().autocomplete( "destroy" ); + }); +}); + +test( "search", function() { + expect( 3 ); + var data = [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl" ], + element = $( "#autocomplete" ).autocomplete({ + source: data, + minLength: 0 + }), + menu = element.autocomplete( "widget" ); + element.autocomplete( "search" ); + equal( menu.find( ".ui-menu-item" ).length, data.length, "all items for a blank search" ); + + element.val( "has" ).autocomplete( "search" ); + equal( menu.find( ".ui-menu-item" ).text(), "haskell", "only one item for set input value" ); + + element.autocomplete( "search", "ja" ); + equal( menu.find( ".ui-menu-item" ).length, 2, "only java and javascript for 'ja'" ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_options.js new file mode 100644 index 0000000..114e9a4 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/autocomplete_options.js @@ -0,0 +1,193 @@ +(function( $ ) { + +module( "autocomplete: options" ); + +var data = [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl" ]; + +test( "appendTo", function() { + expect( 5 ); + var element = $( "#autocomplete" ).autocomplete(); + equal( element.autocomplete( "widget" ).parent()[0], document.body, "defaults to body" ); + element.autocomplete( "destroy" ); + + element.autocomplete({ + appendTo: ".ac-wrap" + }); + equal( element.autocomplete( "widget" ).parent()[0], $( "#ac-wrap1" )[0], "first found element" ); + equal( $( "#ac-wrap2 .ui-autocomplete" ).length, 0, "only appends to one element" ); + element.autocomplete( "destroy" ); + + element.autocomplete({ + appendTo: null + }); + equal( element.autocomplete( "widget" ).parent()[0], document.body, "null" ); + element.autocomplete( "destroy" ); + + element.autocomplete().autocomplete( "option", "appendTo", "#ac-wrap1" ); + equal( element.autocomplete( "widget" ).parent()[0], $( "#ac-wrap1" )[0], "modified after init" ); + element.autocomplete( "destroy" ); +}); + +function autoFocusTest( afValue, focusedLength ) { + var element = $( "#autocomplete" ).autocomplete({ + autoFocus: afValue, + delay: 0, + source: data, + open: function( event, ui ) { + equal( element.autocomplete( "widget" ).children( ".ui-menu-item:first" ).find( ".ui-state-focus" ).length, + focusedLength, "first item is " + (afValue ? "" : "not") + " auto focused" ); + start(); + } + }); + element.val( "ja" ).keydown(); + stop(); +} + +test( "autoFocus: false", function() { + expect( 1 ); + autoFocusTest( false, 0 ); +}); + +test( "autoFocus: true", function() { + expect( 1 ); + autoFocusTest( true, 1 ); +}); + +asyncTest( "delay", function() { + expect( 2 ); + var element = $( "#autocomplete" ).autocomplete({ + source: data, + delay: 50 + }), + menu = element.autocomplete( "widget" ); + element.val( "ja" ).keydown(); + + ok( menu.is( ":hidden" ), "menu is closed immediately after search" ); + + setTimeout(function() { + ok( menu.is( ":visible" ), "menu is open after delay" ); + start(); + }, 100 ); +}); + +asyncTest( "disabled", function() { + expect( 2 ); + var element = $( "#autocomplete" ).autocomplete({ + source: data, + delay: 0, + disabled: true + }), + menu = element.autocomplete( "widget" ); + element.val( "ja" ).keydown(); + + ok( menu.is( ":hidden" ) ); + + setTimeout(function() { + ok( menu.is( ":hidden" ) ); + start(); + }, 50 ); +}); + +test( "minLength", function() { + expect( 2 ); + var element = $( "#autocomplete" ).autocomplete({ + source: data + }), + menu = element.autocomplete( "widget" ); + element.autocomplete( "search", "" ); + ok( menu.is( ":hidden" ), "blank not enough for minLength: 1" ); + + element.autocomplete( "option", "minLength", 0 ); + element.autocomplete( "search", "" ); + ok( menu.is( ":visible" ), "blank enough for minLength: 0" ); +}); + +test( "source, local string array", function() { + expect( 1 ); + var element = $( "#autocomplete" ).autocomplete({ + source: data + }), + menu = element.autocomplete( "widget" ); + element.val( "ja" ).autocomplete( "search" ); + equal( menu.find( ".ui-menu-item" ).text(), "javajavascript" ); +}); + +function sourceTest( source, async ) { + var element = $( "#autocomplete" ).autocomplete({ + source: source + }), + menu = element.autocomplete( "widget" ); + function result() { + equal( menu.find( ".ui-menu-item" ).text(), "javajavascript" ); + element.autocomplete( "destroy" ); + if ( async ) { + start(); + } + } + if ( async ) { + stop(); + $( document ).one( "ajaxStop", result ); + } + element.val( "ja" ).autocomplete( "search" ); + if ( !async ) { + result(); + } +} + +test( "source, local object array, only label property", function() { + expect( 1 ); + sourceTest([ + { label: "java" }, + { label: "php" }, + { label: "coldfusion" }, + { label: "javascript" } + ]); +}); + +test( "source, local object array, only value property", function() { + expect( 1 ); + sourceTest([ + { value: "java" }, + { value: "php" }, + { value: "coldfusion" }, + { value: "javascript" } + ]); +}); + +test( "source, url string with remote json string array", function() { + expect( 1 ); + sourceTest( "remote_string_array.txt", true ); +}); + +test( "source, url string with remote json object array, only value properties", function() { + expect( 1 ); + sourceTest( "remote_object_array_values.txt", true ); +}); + +test( "source, url string with remote json object array, only label properties", function() { + expect( 1 ); + sourceTest( "remote_object_array_labels.txt", true ); +}); + +test( "source, custom", function() { + expect( 2 ); + sourceTest(function( request, response ) { + equal( request.term, "ja" ); + response( ["java", "javascript"] ); + }); +}); + +test( "source, update after init", function() { + expect( 2 ); + var element = $( "#autocomplete" ).autocomplete({ + source: [ "java", "javascript", "haskell" ] + }), + menu = element.autocomplete( "widget" ); + element.val( "ja" ).autocomplete( "search" ); + equal( menu.find( ".ui-menu-item" ).text(), "javajavascript" ); + element.autocomplete( "option", "source", [ "php", "asp" ] ); + element.val( "ph" ).autocomplete( "search" ); + equal( menu.find( ".ui-menu-item" ).text(), "php" ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_labels.txt b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_labels.txt new file mode 100644 index 0000000..502496c --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_labels.txt @@ -0,0 +1 @@ +[{"label":"java"},{"label":"javascript"}] \ No newline at end of file diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_values.txt b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_values.txt new file mode 100644 index 0000000..029cbb9 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_object_array_values.txt @@ -0,0 +1 @@ +[{"value":"java"},{"value":"javascript"}] \ No newline at end of file diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_string_array.txt b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_string_array.txt new file mode 100644 index 0000000..3b24c8e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/autocomplete/remote_string_array.txt @@ -0,0 +1 @@ +["java", "javascript"] \ No newline at end of file diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/all.html new file mode 100644 index 0000000..fa9e224 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Button Test Suite + + + + + + + + + + + + + +

              jQuery UI Button Test Suite

              +

              +
              +

              +
                +
                + +
                + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button.html new file mode 100644 index 0000000..5ec7e31 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button.html @@ -0,0 +1,71 @@ + + + + + jQuery UI Button Test Suite + + + + + + + + + + + + + + + + + + + + + +

                jQuery UI Button Test Suite

                +

                +
                +

                +
                  +
                  + +
                  + +
                  + + + +
                  +
                  +
                  + + + +
                  +
                  +
                  +
                  + + + +
                  +
                  + + + +
                  + +
                  + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_core.js new file mode 100644 index 0000000..692c403 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_core.js @@ -0,0 +1,84 @@ +/* + * button_core.js + */ + + +(function($) { + +module("button: core"); + +test("checkbox", function() { + var input = $("#check"); + label = $("label[for=check]"); + ok( input.is(":visible") ); + ok( label.is(":not(.ui-button)") ); + input.button(); + ok( input.is(".ui-helper-hidden-accessible") ); + ok( label.is(".ui-button") ); +}); + +test("radios", function() { + var inputs = $("#radio0 input"); + labels = $("#radio0 label"); + ok( inputs.is(":visible") ); + ok( labels.is(":not(.ui-button)") ); + inputs.button(); + ok( inputs.is(".ui-helper-hidden-accessible") ); + ok( labels.is(".ui-button") ); +}); + +function assert(noForm, form1, form2) { + ok( $("#radio0 .ui-button" + noForm).is(".ui-state-active") ); + ok( $("#radio1 .ui-button" + form1).is(".ui-state-active") ); + ok( $("#radio2 .ui-button" + form2).is(".ui-state-active") ); +} + +test("radio groups", function() { + $(":radio").button(); + assert(":eq(0)", ":eq(1)", ":eq(2)"); + + // click outside of forms + $("#radio0 .ui-button:eq(1)").click(); + assert(":eq(1)", ":eq(1)", ":eq(2)"); + + // click in first form + $("#radio1 .ui-button:eq(0)").click(); + assert(":eq(1)", ":eq(0)", ":eq(2)"); + + // click in second form + $("#radio2 .ui-button:eq(0)").click(); + assert(":eq(1)", ":eq(0)", ":eq(0)"); +}); + +test("input type submit, don't create child elements", function() { + var input = $("#submit") + same( input.children().length, 0 ); + input.button(); + same( input.children().length, 0 ); +}); + +test("buttonset", function() { + var set = $("#radio1").buttonset(); + ok( set.is(".ui-buttonset") ); + same( set.children(".ui-button").length, 3 ); + same( set.children("input:radio.ui-helper-hidden-accessible").length, 3 ); + ok( set.children("label:eq(0)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") ); + ok( set.children("label:eq(1)").is(".ui-button:not(.ui-corner-all)") ); + ok( set.children("label:eq(2)").is(".ui-button.ui-corner-right:not(.ui-corner-all)") ); +}); + +test("buttonset (rtl)", function() { + var parent = $("#radio1").parent(); + // Set to rtl + parent.attr("dir", "rtl"); + + var set = $("#radio1").buttonset(); + ok( set.is(".ui-buttonset") ); + same( set.children(".ui-button").length, 3 ); + same( set.children("input:radio.ui-helper-hidden-accessible").length, 3 ); + ok( set.children("label:eq(0)").is(".ui-button.ui-corner-right:not(.ui-corner-all)") ); + ok( set.children("label:eq(1)").is(".ui-button:not(.ui-corner-all)") ); + ok( set.children("label:eq(2)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") ); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_defaults.js new file mode 100644 index 0000000..96c7e5b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_defaults.js @@ -0,0 +1,14 @@ +commonWidgetTests( "button", { + defaults: { + disabled: null, + icons: { + primary: null, + secondary: null + }, + label: null, + text: true, + + // callbacks + create: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_events.js new file mode 100644 index 0000000..a215402 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_events.js @@ -0,0 +1,8 @@ +/* + * button_events.js + */ +(function($) { + +module("button: events"); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_methods.js new file mode 100644 index 0000000..a83a73b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_methods.js @@ -0,0 +1,19 @@ +/* + * button_methods.js + */ +(function($) { + + +module("button: methods"); + +test("destroy", function() { + var beforeHtml = $("#button").parent().html(); + var afterHtml = $("#button").button().button("destroy").parent().html(); + // Opera 9 outputs role="" instead of removing the attribute like everyone else + if ($.browser.opera) { + afterHtml = afterHtml.replace(/ role=""/g, ""); + } + equal( afterHtml, beforeHtml ); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_options.js new file mode 100644 index 0000000..a3ab5ae --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_options.js @@ -0,0 +1,93 @@ +/* + * button_options.js + */ +(function($) { + +module("button: options"); + +test("disabled, explicit value", function() { + $("#radio01").button({ disabled: false }); + same(false, $("#radio01").button("option", "disabled"), + "disabled option set to false"); + same(false, $("#radio01").prop("disabled"), "element is disabled"); + + $("#radio02").button({ disabled: true }); + same(true, $("#radio02").button("option", "disabled"), + "disabled option set to true"); + same(true, $("#radio02").prop("disabled"), "element is not disabled"); +}); + +test("disabled, null", function() { + $("#radio01").button({ disabled: null }); + same(false, $("#radio01").button("option", "disabled"), + "disabled option set to false"); + same(false, $("#radio01").prop("disabled"), "element is disabled"); + + $("#radio02").prop("disabled", true).button({ disabled: null }); + same(true, $("#radio02").button("option", "disabled"), + "disabled option set to true"); + same(true, $("#radio02").prop("disabled"), "element is not disabled"); +}); + +test("text false without icon", function() { + $("#button").button({ + text: false + }); + ok( $("#button").is(".ui-button-text-only:not(.ui-button-icon-only)") ); + + $("#button").button("destroy"); +}); + +test("text false with icon", function() { + $("#button").button({ + text: false, + icons: { + primary: "iconclass" + } + }); + ok( $("#button").is(".ui-button-icon-only:not(.ui-button-text):has(span.ui-icon.iconclass)") ); + + $("#button").button("destroy"); +}); + +test("label, default", function() { + $("#button").button(); + same( $("#button").text(), "Label" ); + + $("#button").button("destroy"); +}); + +test("label", function() { + $("#button").button({ + label: "xxx" + }); + same( $("#button").text(), "xxx" ); + + $("#button").button("destroy"); +}); + +test("label default with input type submit", function() { + same( $("#submit").button().val(), "Label" ); +}); + +test("label with input type submit", function() { + var label = $("#submit").button({ + label: "xxx" + }).val(); + same( label, "xxx" ); +}); + +test("icons", function() { + $("#button").button({ + text: false, + icons: { + primary: "iconclass", + secondary: "iconclass2" + } + }); + ok( $("#button").is(":has(span.ui-icon.ui-button-icon-primary.iconclass):has(span.ui-icon.ui-button-icon-secondary.iconclass2)") ); + + $("#button").button("destroy"); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_tickets.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_tickets.js new file mode 100644 index 0000000..624d167 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/button/button_tickets.js @@ -0,0 +1,59 @@ +/* + * button_tickets.js + */ +(function( $ ) { + +module( "button: tickets" ); + +test( "#5946 - buttonset should ignore buttons that are not :visible", function() { + $( "#radio01" ).next().andSelf().hide(); + var set = $( "#radio0" ).buttonset({ items: ":radio:visible" }); + ok( set.find( "label:eq(0)" ).is( ":not(.ui-button):not(.ui-corner-left)" ) ); + ok( set.find( "label:eq(1)" ).is( ".ui-button.ui-corner-left" ) ); +}); + +test( "#6262 - buttonset not applying ui-corner to invisible elements", function() { + $( "#radio0" ).hide(); + var set = $( "#radio0" ).buttonset(); + ok( set.find( "label:eq(0)" ).is( ".ui-button.ui-corner-left" ) ); + ok( set.find( "label:eq(1)" ).is( ".ui-button" ) ); + ok( set.find( "label:eq(2)" ).is( ".ui-button.ui-corner-right" ) ); +}); + +test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard Navigation", function() { + var check = $( "#check" ).button(), + label = $( "label[for='check']" ); + ok( !label.is( ".ui-state-focus" ) ); + check.focus(); + ok( label.is( ".ui-state-focus" ) ); +}); + +test( "#7092 - button creation that requires a matching label does not find label in all cases", function() { + var group = $( "" ); + group.find( "input:checkbox" ).button(); + ok( group.find( "label" ).is( ".ui-button" ) ); + + group = $( "" ); + group.filter( "input:checkbox" ).button(); + ok( group.filter( "label" ).is( ".ui-button" ) ); + + group = $( "" ); + group.find( "input:checkbox" ).button(); + ok( group.filter( "label" ).is( ".ui-button" ) ); + + group = $( "" ); + group.find( "input:checkbox" ).button(); + ok( group.find( "label" ).is( ".ui-button" ) ); + + group = $( "" ); + group.filter( "input:checkbox" ).button(); + ok( group.find( "label" ).is( ".ui-button" ) ); +}); + +test( "#7534 - Button label selector works for ids with \":\"", function() { + var group = $( "" ); + group.find( "input" ).button(); + ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" ); +}); + +})( jQuery ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/all.html new file mode 100644 index 0000000..e8d84e1 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Core Test Suite + + + + + + + + + + + + + +

                  jQuery UI Core Test Suite

                  +

                  +
                  +

                  +
                    +
                    + +
                    + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.html new file mode 100644 index 0000000..3b1dc1f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.html @@ -0,0 +1,134 @@ + + + + + jQuery UI Core Test Suite + + + + + + + + + + + + + + + + + + +

                    jQuery UI Core Test Suite

                    +

                    +
                    +

                    +
                      +
                      + + + + + + + + + + + + +
                      +
                      + +
                      + + + + + + + + + + xxx + anchor + anchor + x +
                      x
                      + x +
                      x
                      +
                      + +
                      + + + + + + + + + +
                      + +
                      + + + + + + + + + +
                      + +
                      + + + + + + . + . + . + . +
                      + +
                      +
                      .
                      +
                      +
                      +
                      .
                      +
                      +
                      +
                      .
                      +
                      +
                      + +
                      + +
                      + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.js new file mode 100644 index 0000000..03a7ab8 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/core.js @@ -0,0 +1,157 @@ +/* + * core unit tests + */ +(function($) { + +module('core - jQuery extensions'); + +test('focus - original functionality', function() { + expect(1); + + $('#inputTabindex0') + .focus(function() { + ok(true, 'event triggered'); + }) + .focus(); +}); + +asyncTest('focus', function() { + expect(2); + $('#inputTabindex0') + .focus(function() { + ok(true, 'event triggered'); + }) + .focus(500, function() { + ok(true, 'callback triggered'); + $(this).unbind('focus'); + start(); + }); +}); + +test('zIndex', function() { + var el = $('#zIndexAutoWithParent'), + parent = el.parent(); + equals(el.zIndex(), 100, 'zIndex traverses up to find value'); + equals(parent.zIndex(200), parent, 'zIndex setter is chainable'); + equals(el.zIndex(), 200, 'zIndex setter changed zIndex'); + + el = $('#zIndexAutoWithParentViaCSS'); + equals(el.zIndex(), 0, 'zIndex traverses up to find CSS value, not found because not positioned'); + + el = $('#zIndexAutoWithParentViaCSSPositioned'); + equals(el.zIndex(), 100, 'zIndex traverses up to find CSS value'); + el.parent().zIndex(200); + equals(el.zIndex(), 200, 'zIndex setter changed zIndex, overriding CSS'); + + equals($('#zIndexAutoNoParent').zIndex(), 0, 'zIndex never explicitly set in hierarchy'); +}); + +test( "innerWidth - getter", function() { + var el = $( "#dimensions" ); + + equals( el.innerWidth(), 122, "getter passthru" ); + el.hide(); + equals( el.innerWidth(), 122, "getter passthru when hidden" ); +}); + +test( "innerWidth - setter", function() { + var el = $( "#dimensions" ); + + el.innerWidth( 120 ); + equals( el.width(), 98, "width set properly" ); + el.hide(); + el.innerWidth( 100 ); + equals( el.width(), 78, "width set properly when hidden" ); +}); + +test( "innerHeight - getter", function() { + var el = $( "#dimensions" ); + + equals( el.innerHeight(), 70, "getter passthru" ); + el.hide(); + equals( el.innerHeight(), 70, "getter passthru when hidden" ); +}); + +test( "innerHeight - setter", function() { + var el = $( "#dimensions" ); + + el.innerHeight( 60 ); + equals( el.height(), 40, "height set properly" ); + el.hide(); + el.innerHeight( 50 ); + equals( el.height(), 30, "height set properly when hidden" ); +}); + +test( "outerWidth - getter", function() { + var el = $( "#dimensions" ); + + equals( el.outerWidth(), 140, "getter passthru" ); + el.hide(); + equals( el.outerWidth(), 140, "getter passthru when hidden" ); +}); + +test( "outerWidth - setter", function() { + var el = $( "#dimensions" ); + + el.outerWidth( 130 ); + equals( el.width(), 90, "width set properly" ); + el.hide(); + el.outerWidth( 120 ); + equals( el.width(), 80, "width set properly when hidden" ); +}); + +test( "outerWidth(true) - getter", function() { + var el = $( "#dimensions" ); + + equals( el.outerWidth(true), 154, "getter passthru w/ margin" ); + el.hide(); + equals( el.outerWidth(true), 154, "getter passthru w/ margin when hidden" ); +}); + +test( "outerWidth(true) - setter", function() { + var el = $( "#dimensions" ); + + el.outerWidth( 130, true ); + equals( el.width(), 76, "width set properly" ); + el.hide(); + el.outerWidth( 120, true ); + equals( el.width(), 66, "width set properly when hidden" ); +}); + +test( "outerHeight - getter", function() { + var el = $( "#dimensions" ); + + equals( el.outerHeight(), 86, "getter passthru" ); + el.hide(); + equals( el.outerHeight(), 86, "getter passthru when hidden" ); +}); + +test( "outerHeight - setter", function() { + var el = $( "#dimensions" ); + + el.outerHeight( 80 ); + equals( el.height(), 44, "height set properly" ); + el.hide(); + el.outerHeight( 70 ); + equals( el.height(), 34, "height set properly when hidden" ); +}); + +test( "outerHeight(true) - getter", function() { + var el = $( "#dimensions" ); + + equals( el.outerHeight(true), 98, "getter passthru w/ margin" ); + el.hide(); + equals( el.outerHeight(true), 98, "getter passthru w/ margin when hidden" ); +}); + +test( "outerHeight(true) - setter", function() { + var el = $( "#dimensions" ); + + el.outerHeight( 90, true ); + equals( el.height(), 42, "height set properly" ); + el.hide(); + el.outerHeight( 80, true ); + equals( el.height(), 32, "height set properly when hidden" ); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/selector.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/selector.js new file mode 100644 index 0000000..2fb7802 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/core/selector.js @@ -0,0 +1,239 @@ +/* + * selector unit tests + */ +(function($) { + +module("core - selectors"); + +function isFocusable(selector, msg) { + ok($(selector).is(':focusable'), msg + " - selector " + selector + " is focusable"); +} + +function isNotFocusable(selector, msg) { + ok($(selector).length && !$(selector).is(':focusable'), msg + " - selector " + selector + " is not focusable"); +} + +function isTabbable(selector, msg) { + ok($(selector).is(':tabbable'), msg + " - selector " + selector + " is tabbable"); +} + +function isNotTabbable(selector, msg) { + ok($(selector).length && !$(selector).is(':tabbable'), msg + " - selector " + selector + " is not tabbable"); +} + +test("data", function() { + expect(15); + + var el; + function shouldHaveData(msg) { + ok(el.is(':data(test)'), msg); + } + function shouldNotHaveData(msg) { + ok(!el.is(':data(test)'), msg); + } + + el = $('
                      '); + shouldNotHaveData('data never set'); + + el = $('
                      ').data('test', null); + shouldNotHaveData('data is null'); + + el = $('
                      ').data('test', true); + shouldHaveData('data set to true'); + + el = $('
                      ').data('test', false); + shouldNotHaveData('data set to false'); + + el = $('
                      ').data('test', 0); + shouldNotHaveData('data set to 0'); + + el = $('
                      ').data('test', 1); + shouldHaveData('data set to 1'); + + el = $('
                      ').data('test', ''); + shouldNotHaveData('data set to empty string'); + + el = $('
                      ').data('test', 'foo'); + shouldHaveData('data set to string'); + + el = $('
                      ').data('test', []); + shouldHaveData('data set to empty array'); + + el = $('
                      ').data('test', [1]); + shouldHaveData('data set to array'); + + el = $('
                      ').data('test', {}); + shouldHaveData('data set to empty object'); + + el = $('
                      ').data('test', {foo: 'bar'}); + shouldHaveData('data set to object'); + + el = $('
                      ').data('test', new Date()); + shouldHaveData('data set to date'); + + el = $('
                      ').data('test', /test/); + shouldHaveData('data set to regexp'); + + el = $('
                      ').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'); + isFocusable('#visibleAncestor-inputTypeText', 'input, type text'); + isFocusable('#visibleAncestor-inputTypeCheckbox', 'input, type checkbox'); + isFocusable('#visibleAncestor-inputTypeRadio', 'input, type radio'); + isFocusable('#visibleAncestor-inputTypeButton', 'input, type button'); + isNotFocusable('#visibleAncestor-inputTypeHidden', 'input, type hidden'); + isFocusable('#visibleAncestor-button', 'button'); + isFocusable('#visibleAncestor-select', 'select'); + isFocusable('#visibleAncestor-textarea', 'textarea'); + isFocusable('#visibleAncestor-object', 'object'); + isFocusable('#visibleAncestor-anchorWithHref', 'anchor with href'); + isNotFocusable('#visibleAncestor-anchorWithoutHref', 'anchor without href'); + isNotFocusable('#visibleAncestor-span', 'span'); + isNotFocusable('#visibleAncestor-div', 'div'); + isFocusable("#visibleAncestor-spanWithTabindex", 'span with tabindex'); + isFocusable("#visibleAncestor-divWithNegativeTabindex", 'div with tabindex'); +}); + +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'); + isNotFocusable('#disabledElement-inputTypeRadio', 'input, type radio'); + isNotFocusable('#disabledElement-inputTypeButton', 'input, type button'); + isNotFocusable('#disabledElement-inputTypeHidden', 'input, type hidden'); + isNotFocusable('#disabledElement-button', 'button'); + isNotFocusable('#disabledElement-select', 'select'); + isNotFocusable('#disabledElement-textarea', 'textarea'); +}); + +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'); + isFocusable('#inputTabindex-50', 'input, tabindex -50'); +}); + +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'); + isFocusable('#spanTabindex-50', 'span, tabindex -50'); +}); + +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'); + isTabbable('#visibleAncestor-inputTypeText', 'input, type text'); + isTabbable('#visibleAncestor-inputTypeCheckbox', 'input, type checkbox'); + isTabbable('#visibleAncestor-inputTypeRadio', 'input, type radio'); + isTabbable('#visibleAncestor-inputTypeButton', 'input, type button'); + isNotTabbable('#visibleAncestor-inputTypeHidden', 'input, type hidden'); + isTabbable('#visibleAncestor-button', 'button'); + isTabbable('#visibleAncestor-select', 'select'); + isTabbable('#visibleAncestor-textarea', 'textarea'); + isTabbable('#visibleAncestor-object', 'object'); + isTabbable('#visibleAncestor-anchorWithHref', 'anchor with href'); + isNotTabbable('#visibleAncestor-anchorWithoutHref', 'anchor without href'); + isNotTabbable('#visibleAncestor-span', 'span'); + isNotTabbable('#visibleAncestor-div', 'div'); + isTabbable("#visibleAncestor-spanWithTabindex", 'span with tabindex'); + isNotTabbable("#visibleAncestor-divWithNegativeTabindex", 'div with tabindex'); +}); + +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'); + isNotTabbable('#disabledElement-inputTypeRadio', 'input, type radio'); + isNotTabbable('#disabledElement-inputTypeButton', 'input, type button'); + isNotTabbable('#disabledElement-inputTypeHidden', 'input, type hidden'); + isNotTabbable('#disabledElement-button', 'button'); + isNotTabbable('#disabledElement-select', 'select'); + isNotTabbable('#disabledElement-textarea', 'textarea'); +}); + +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'); + isNotTabbable('#inputTabindex-50', 'input, tabindex -50'); +}); + +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'); + isNotTabbable('#spanTabindex-50', 'span, tabindex -50'); +}); + +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'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/all.html new file mode 100644 index 0000000..67d5cb2 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Datepicker Test Suite + + + + + + + + + + + + + +

                      jQuery UI Datepicker Test Suite

                      +

                      +
                      +

                      +
                        +
                        + +
                        + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker.html new file mode 100644 index 0000000..592db53 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Datepicker Test Suite + + + + + + + + + + + + + + + + + + + + + + +

                        jQuery UI Datepicker Test Suite

                        +

                        +
                        +

                        +
                          +
                          + +
                          +

                          + +
                          + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_core.js new file mode 100644 index 0000000..badb837 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_core.js @@ -0,0 +1,449 @@ +/* + * datepicker_core.js + */ + +function equalsDate(d1, d2, message) { + if (!d1 || !d2) { + ok(false, message + ' - missing date'); + return; + } + d1 = new Date(d1.getFullYear(), d1.getMonth(), d1.getDate()); + d2 = new Date(d2.getFullYear(), d2.getMonth(), d2.getDate()); + equals(d1.toString(), d2.toString(), message); +} + +function equalsDateArray(a1, a2, message) { + if (!a1 || !a2) { + ok(false, message + ' - missing dates'); + return; + } + a1[0] = (a1[0] ? new Date(a1[0].getFullYear(), a1[0].getMonth(), a1[0].getDate()) : ''); + a1[1] = (a1[1] ? new Date(a1[1].getFullYear(), a1[1].getMonth(), a1[1].getDate()) : ''); + a2[0] = (a2[0] ? new Date(a2[0].getFullYear(), a2[0].getMonth(), a2[0].getDate()) : ''); + a2[1] = (a2[1] ? new Date(a2[1].getFullYear(), a2[1].getMonth(), a2[1].getDate()) : ''); + same(a1, a2, message); +} + +function addMonths(date, offset) { + var maxDay = 32 - new Date(date.getFullYear(), date.getMonth() + offset, 32).getDate(); + date.setDate(Math.min(date.getDate(), maxDay)); + date.setMonth(date.getMonth() + offset); + return date; +} + +function init(id, options) { + $.datepicker.setDefaults($.datepicker.regional['']); + return $(id).datepicker($.extend({showAnim: ''}, options || {})); +} + +var PROP_NAME = 'datepicker'; + +(function($) { + +module("datepicker: core"); + +test( "widget method - empty collection", function() { + $( "#nonExist" ).datepicker(); // should create nothing + ok( !$( "#ui-datepicker-div" ).length, "Non init on empty collection" ); +}); + +test("widget method", function() { + var actual = $("#inp").datepicker().datepicker("widget")[0]; + same($("body > #ui-datepicker-div:last-child")[0], actual); +}); + +test('baseStructure', function() { + var inp = init('#inp'); + inp.focus(); + var dp = $('#ui-datepicker-div'); + var iframe = ($.browser.msie && parseInt($.browser.version) < 7); + ok(dp.is(':visible'), 'Structure - datepicker visible'); + ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left'); + ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month'); + equals(dp.children().length, 2 + (iframe ? 1 : 0), 'Structure - child count'); + + var header = dp.children(':first'); + ok(header.is('div.ui-datepicker-header'), 'Structure - header division'); + equals(header.children().length, 3, 'Structure - header child count'); + ok(header.children(':first').is('a.ui-datepicker-prev') && header.children(':first').html() != '', 'Structure - prev link'); + ok(header.children(':eq(1)').is('a.ui-datepicker-next') && header.children(':eq(1)').html() != '', 'Structure - next link'); + + var title = header.children(':last'); + ok(title.is('div.ui-datepicker-title') && title.html() != '','Structure - title division'); + equals(title.children().length, 2, 'Structure - title child count'); + ok(title.children(':first').is('span.ui-datepicker-month') && title.children(':first').text() != '', 'Structure - month text') + ok(title.children(':last').is('span.ui-datepicker-year') && title.children(':last').text() != '', 'Structure - year text') + + var table = dp.children(':eq(1)'); + ok(table.is('table.ui-datepicker-calendar'), 'Structure - month table'); + ok(table.children(':first').is('thead'), 'Structure - month table thead'); + var thead = table.children(':first').children(':first'); + ok(thead.is('tr'), 'Structure - month table title row'); + equals(thead.find('th').length, 7, 'Structure - month table title cells'); + ok(table.children(':eq(1)').is('tbody'), 'Structure - month table body'); + ok(table.children(':eq(1)').children('tr').length >= 4, 'Structure - month table week count'); + var week = table.children(':eq(1)').children(':first'); + ok(week.is('tr'), 'Structure - month table week row'); + equals(week.children().length, 7, 'Structure - week child count'); + ok(week.children(':first').is('td.ui-datepicker-week-end'), 'Structure - month table first day cell'); + ok(week.children(':last').is('td.ui-datepicker-week-end'), 'Structure - month table second day cell'); + ok(dp.children('iframe').length == (iframe ? 1 : 0), 'Structure - iframe'); + inp.datepicker('hide').datepicker('destroy'); + + // Editable month/year and button panel + inp = init('#inp', {changeMonth: true, changeYear: true, showButtonPanel: true}); + inp.focus(); + + var title = dp.find('div.ui-datepicker-title'); + ok(title.children(':first').is('select.ui-datepicker-month'), 'Structure - month selector'); + ok(title.children(':last').is('select.ui-datepicker-year'), 'Structure - year selector'); + + var panel = dp.children(':last'); + ok(panel.is('div.ui-datepicker-buttonpane'), 'Structure - button panel division'); + equals(panel.children().length, 2, 'Structure - button panel child count'); + ok(panel.children(':first').is('button.ui-datepicker-current'), 'Structure - today button'); + ok(panel.children(':last').is('button.ui-datepicker-close'), 'Structure - close button'); + inp.datepicker('hide').datepicker('destroy'); + + // Multi-month 2 + inp = init('#inp', {numberOfMonths: 2}); + inp.focus(); + ok(dp.is('.ui-datepicker-multi'), 'Structure multi [2] - multi-month'); + equals(dp.children().length, 3 + (iframe ? 1 : 0), 'Structure multi [2] - child count'); + var child = dp.children(':first'); + ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2] - first month division'); + child = dp.children(':eq(1)'); + ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-last'), 'Structure multi [2] - second month division'); + child = dp.children(':eq(2)'); + ok(child.is('div.ui-datepicker-row-break'), 'Structure multi [2] - row break'); + ok(dp.is('.ui-datepicker-multi-2'), 'Structure multi [2] - multi-2'); + inp.datepicker('hide').datepicker('destroy'); + + // Multi-month 3 + inp = init('#inp', {numberOfMonths: 3}); + inp.focus(); + ok(dp.is('.ui-datepicker-multi-3'), 'Structure multi [3] - multi-3'); + ok(! dp.is('.ui-datepicker-multi-2'), 'Structure multi [3] - Trac #6704'); + inp.datepicker('hide').datepicker('destroy'); + + // Multi-month [2, 2] + inp = init('#inp', {numberOfMonths: [2, 2]}); + inp.focus(); + ok(dp.is('.ui-datepicker-multi'), 'Structure multi - multi-month'); + equals(dp.children().length, 6 + (iframe ? 1 : 0), 'Structure multi [2,2] - child count'); + child = dp.children(':first'); + ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2,2] - first month division'); + child = dp.children(':eq(1)'); + ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-last'), 'Structure multi [2,2] - second month division'); + child = dp.children(':eq(2)'); + ok(child.is('div.ui-datepicker-row-break'), 'Structure multi [2,2] - row break'); + child = dp.children(':eq(3)'); + ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure multi [2,2] - third month division'); + child = dp.children(':eq(4)'); + ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-last'), 'Structure multi [2,2] - fourth month division'); + child = dp.children(':eq(5)'); + ok(child.is('div.ui-datepicker-row-break'), 'Structure multi [2,2] - row break'); + inp.datepicker('hide').datepicker('destroy'); + + // Inline + var inl = init('#inl'); + dp = inl.children(); + ok(dp.is('.ui-datepicker-inline'), 'Structure inline - main div'); + ok(!dp.is('.ui-datepicker-rtl'), 'Structure inline - not right-to-left'); + ok(!dp.is('.ui-datepicker-multi'), 'Structure inline - not multi-month'); + equals(dp.children().length, 2, 'Structure inline - child count'); + var header = dp.children(':first'); + ok(header.is('div.ui-datepicker-header'), 'Structure inline - header division'); + equals(header.children().length, 3, 'Structure inline - header child count'); + var table = dp.children(':eq(1)'); + ok(table.is('table.ui-datepicker-calendar'), 'Structure inline - month table'); + ok(table.children(':first').is('thead'), 'Structure inline - month table thead'); + ok(table.children(':eq(1)').is('tbody'), 'Structure inline - month table body'); + inl.datepicker('destroy'); + + // Inline multi-month + inl = init('#inl', {numberOfMonths: 2}); + dp = inl.children(); + ok(dp.is('.ui-datepicker-inline') && dp.is('.ui-datepicker-multi'), 'Structure inline multi - main div'); + equals(dp.children().length, 3 + (iframe ? 1 : 0), 'Structure inline multi - child count'); + child = dp.children(':first'); + ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-first'), 'Structure inline multi - first month division'); + child = dp.children(':eq(1)'); + ok(child.is('div.ui-datepicker-group') && child.is('div.ui-datepicker-group-last'), 'Structure inline multi - second month division'); + child = dp.children(':eq(2)'); + ok(child.is('div.ui-datepicker-row-break'), 'Structure inline multi - row break'); + inl.datepicker('destroy'); +}); + +test('customStructure', function() { + var dp = $('#ui-datepicker-div'); + // Check right-to-left localisation + var inp = init('#inp', $.datepicker.regional['he']); + inp.data('showButtonPanel.datepicker',true); + inp.focus(); + var iframe = ($.browser.msie && parseInt($.browser.version) < 7); + ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left'); + var header = dp.children(':first'); + ok(header.is('div.ui-datepicker-header'), 'Structure RTL - header division'); + equals(header.children().length, 3, 'Structure RTL - header child count'); + ok(header.children(':first').is('a.ui-datepicker-next'), 'Structure RTL - prev link'); + ok(header.children(':eq(1)').is('a.ui-datepicker-prev'), 'Structure RTL - next link'); + var panel = dp.children(':last'); + ok(panel.is('div.ui-datepicker-buttonpane'), 'Structure RTL - button division'); + equals(panel.children().length, 2, 'Structure RTL - button panel child count'); + ok(panel.children(':first').is('button.ui-datepicker-close'), 'Structure RTL - close button'); + ok(panel.children(':last').is('button.ui-datepicker-current'), 'Structure RTL - today button'); + inp.datepicker('hide').datepicker('destroy'); + + // Hide prev/next + inp = init('#inp', {hideIfNoPrevNext: true, minDate: new Date(2008, 2 - 1, 4), maxDate: new Date(2008, 2 - 1, 14)}); + inp.val('02/10/2008').focus(); + var header = dp.children(':first'); + ok(header.is('div.ui-datepicker-header'), 'Structure hide prev/next - header division'); + equals(header.children().length, 1, 'Structure hide prev/next - links child count'); + ok(header.children(':first').is('div.ui-datepicker-title'), 'Structure hide prev/next - title division'); + inp.datepicker('hide').datepicker('destroy'); + + // Changeable Month with read-only year + inp = init('#inp', {changeMonth: true}); + inp.focus(); + var title = dp.children(':first').children(':last'); + equals(title.children().length, 2, 'Structure changeable month - title child count'); + ok(title.children(':first').is('select.ui-datepicker-month'), 'Structure changeable month - month selector'); + ok(title.children(':last').is('span.ui-datepicker-year'), 'Structure changeable month - read-only year'); + inp.datepicker('hide').datepicker('destroy'); + + // Changeable year with read-only month + inp = init('#inp', {changeYear: true}); + inp.focus(); + var title = dp.children(':first').children(':last'); + equals(title.children().length, 2, 'Structure changeable year - title child count'); + ok(title.children(':first').is('span.ui-datepicker-month'), 'Structure changeable year - read-only month'); + ok(title.children(':last').is('select.ui-datepicker-year'), 'Structure changeable year - year selector'); + inp.datepicker('hide').datepicker('destroy'); + + // Read-only first day of week + inp = init('#inp', {changeFirstDay: false}); + inp.focus(); + var thead = dp.find('.ui-datepicker-calendar thead tr'); + equals(thead.children().length, 7, 'Structure read-only first day - thead child count'); + equals(thead.find('a').length, 0, 'Structure read-only first day - thead links count'); + inp.datepicker('hide').datepicker('destroy'); +}); + +test('keystrokes', function() { + var inp = init('#inp'); + var date = new Date(); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke enter'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Keystroke enter - preset'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+home'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END}); + ok(inp.datepicker('getDate') == null, 'Keystroke ctrl+end'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + ok(inp.datepicker('getDate') == null, 'Keystroke esc'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Keystroke esc - preset'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Keystroke esc - abandoned'); + // Moving by day or week + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_LEFT}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 1); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+left'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_LEFT}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 1); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke left'); + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_RIGHT}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 1); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+right'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_RIGHT}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 1); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke right'); + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_UP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 7); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+up'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_UP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 7); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke up'); + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 7); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+down'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 7); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke down'); + // Moving by month or year + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 1 - 1, 4), + 'Keystroke pgup'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 3 - 1, 4), + 'Keystroke pgdn'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2007, 2 - 1, 4), + 'Keystroke ctrl+pgup'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2009, 2 - 1, 4), + 'Keystroke ctrl+pgdn'); + // Check for moving to short months + inp.val('03/31/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 29), + 'Keystroke pgup - Feb'); + inp.val('01/30/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 29), + 'Keystroke pgdn - Feb'); + inp.val('02/29/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2007, 2 - 1, 28), + 'Keystroke ctrl+pgup - Feb'); + inp.val('02/29/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2009, 2 - 1, 28), + 'Keystroke ctrl+pgdn - Feb'); + // Goto current + inp.datepicker('option', {gotoCurrent: true}). + datepicker('hide').val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Keystroke ctrl+home'); + // Change steps + inp.datepicker('option', {stepMonths: 2, gotoCurrent: false}). + datepicker('hide').val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2007, 12 - 1, 4), + 'Keystroke pgup step 2'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 4 - 1, 4), + 'Keystroke pgdn step 2'); +}); + +test('mouse', function() { + var inp = init('#inp'); + var dp = $('#ui-datepicker-div'); + var date = new Date(); + inp.val('').datepicker('show'); + $('.ui-datepicker-calendar tbody a:contains(10)', dp).simulate('click', {}); + date.setDate(10); + equalsDate(inp.datepicker('getDate'), date, 'Mouse click'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-calendar tbody a:contains(12)', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 12), + 'Mouse click - preset'); + inp.val('02/04/2008').datepicker('show'); + inp.val('').datepicker('show'); + $('button.ui-datepicker-close', dp).simulate('click', {}); + ok(inp.datepicker('getDate') == null, 'Mouse click - close'); + inp.val('02/04/2008').datepicker('show'); + $('button.ui-datepicker-close', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Mouse click - close + preset'); + inp.val('02/04/2008').datepicker('show'); + $('a.ui-datepicker-prev', dp).simulate('click', {}); + $('button.ui-datepicker-close', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Mouse click - abandoned'); + // Current/previous/next + inp.val('02/04/2008').datepicker('option', {showButtonPanel: true}).datepicker('show'); + $('.ui-datepicker-current', dp).simulate('click', {}); + $('.ui-datepicker-calendar tbody a:contains(14)', dp).simulate('click', {}); + date.setDate(14); + equalsDate(inp.datepicker('getDate'), date, 'Mouse click - current'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-prev', dp).simulate('click'); + $('.ui-datepicker-calendar tbody a:contains(16)', dp).simulate('click'); + equalsDate(inp.datepicker('getDate'), new Date(2008, 1 - 1, 16), + 'Mouse click - previous'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-next', dp).simulate('click'); + $('.ui-datepicker-calendar tbody a:contains(18)', dp).simulate('click'); + equalsDate(inp.datepicker('getDate'), new Date(2008, 3 - 1, 18), + 'Mouse click - next'); + // Previous/next with minimum/maximum + inp.datepicker('option', {minDate: new Date(2008, 2 - 1, 2), + maxDate: new Date(2008, 2 - 1, 26)}).val('02/04/2008').datepicker('show'); + $('.ui-datepicker-prev', dp).simulate('click'); + $('.ui-datepicker-calendar tbody a:contains(16)', dp).simulate('click'); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 16), + 'Mouse click - previous + min/max'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-next', dp).simulate('click'); + $('.ui-datepicker-calendar tbody a:contains(18)', dp).simulate('click'); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 18), + 'Mouse click - next + min/max'); + // Inline + var inl = init('#inl'); + var dp = $('.ui-datepicker-inline', inl); + var date = new Date(); + inl.datepicker('setDate', date); + $('.ui-datepicker-calendar tbody a:contains(10)', dp).simulate('click', {}); + date.setDate(10); + equalsDate(inl.datepicker('getDate'), date, 'Mouse click inline'); + inl.datepicker('option', {showButtonPanel: true}).datepicker('setDate', new Date(2008, 2 - 1, 4)); + $('.ui-datepicker-calendar tbody a:contains(12)', dp).simulate('click', {}); + equalsDate(inl.datepicker('getDate'), new Date(2008, 2 - 1, 12), 'Mouse click inline - preset'); + inl.datepicker('option', {showButtonPanel: true}); + $('.ui-datepicker-current', dp).simulate('click', {}); + $('.ui-datepicker-calendar tbody a:contains(14)', dp).simulate('click', {}); + date.setDate(14); + equalsDate(inl.datepicker('getDate'), date, 'Mouse click inline - current'); + inl.datepicker('setDate', new Date(2008, 2 - 1, 4)); + $('.ui-datepicker-prev', dp).simulate('click'); + $('.ui-datepicker-calendar tbody a:contains(16)', dp).simulate('click'); + equalsDate(inl.datepicker('getDate'), new Date(2008, 1 - 1, 16), + 'Mouse click inline - previous'); + inl.datepicker('setDate', new Date(2008, 2 - 1, 4)); + $('.ui-datepicker-next', dp).simulate('click'); + $('.ui-datepicker-calendar tbody a:contains(18)', dp).simulate('click'); + equalsDate(inl.datepicker('getDate'), new Date(2008, 3 - 1, 18), + 'Mouse click inline - next'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_defaults.js new file mode 100644 index 0000000..4243cf1 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_defaults.js @@ -0,0 +1,9 @@ +/* + * datepicker_defaults.js + */ + +var datepicker_defaults = { + disabled: false +}; + +//commonWidgetTests('datepicker', { defaults: datepicker_defaults }); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_events.js new file mode 100644 index 0000000..c7c16b6 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_events.js @@ -0,0 +1,127 @@ +/* + * datepicker_events.js + */ +(function($) { + +module("datepicker: events"); + +var selectedThis = null; +var selectedDate = null; +var selectedInst = null; + +function callback(date, inst) { + selectedThis = this; + selectedDate = date; + selectedInst = inst; +} + +function callback2(year, month, inst) { + selectedThis = this; + selectedDate = year + '/' + month; + selectedInst = inst; +} + +test('events', function() { + var inp = init('#inp', {onSelect: callback}); + var date = new Date(); + // onSelect + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(selectedThis, inp[0], 'Callback selected this'); + equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback selected inst'); + equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date), + 'Callback selected date'); + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 7); + equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date), + 'Callback selected date - ctrl+down'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date), + 'Callback selected date - esc'); + var dateStr = '02/04/2008'; + inp.val(dateStr).datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(dateStr, selectedDate, + 'onSelect is called after enter keydown'); + // onChangeMonthYear + inp.datepicker('option', {onChangeMonthYear: callback2, onSelect: null}). + val('').datepicker('show'); + var newMonthYear = function(date) { + return date.getFullYear() + '/' + (date.getMonth() + 1); + }; + date = new Date(); + date.setDate(1); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGUP}); + date.setMonth(date.getMonth() - 1); + equals(selectedThis, inp[0], 'Callback change month/year this'); + equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback change month/year inst'); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - pgup'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}); + date.setMonth(date.getMonth() + 1); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - pgdn'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}); + date.setFullYear(date.getFullYear() - 1); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - ctrl+pgup'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}); + date.setFullYear(date.getFullYear() + 1); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - ctrl+home'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}); + date.setFullYear(date.getFullYear() + 1); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - ctrl+pgdn'); + inp.datepicker('setDate', new Date(2007, 1 - 1, 26)); + equals(selectedDate, '2007/1', 'Callback change month/year date - setDate'); + selectedDate = null; + inp.datepicker('setDate', new Date(2007, 1 - 1, 12)); + ok(selectedDate == null, 'Callback change month/year date - setDate no change'); + // onChangeMonthYear step by 2 + inp.datepicker('option', {stepMonths: 2}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}); + date.setMonth(date.getMonth() - 14); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year by 2 date - pgup'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}); + date.setMonth(date.getMonth() - 12); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year by 2 date - ctrl+pgup'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}); + date.setMonth(date.getMonth() + 2); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year by 2 date - pgdn'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}); + date.setMonth(date.getMonth() + 12); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year by 2 date - ctrl+pgdn'); + // onClose + inp.datepicker('option', {onClose: callback, onChangeMonthYear: null, stepMonths: 1}). + val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(selectedThis, inp[0], 'Callback close this'); + equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback close inst'); + equals(selectedDate, '', 'Callback close date - esc'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', new Date()), + 'Callback close date - enter'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(selectedDate, '02/04/2008', 'Callback close date - preset'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END}); + equals(selectedDate, '', 'Callback close date - ctrl+end'); + + var inp2 = init('#inp2'); + inp2.datepicker().datepicker('option', {onClose: callback}).datepicker('show'); + inp.datepicker('show'); + equals(selectedThis, inp2[0], 'Callback close this'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_methods.js new file mode 100644 index 0000000..c8f1b75 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_methods.js @@ -0,0 +1,121 @@ +/* + * datepicker_methods.js + */ +(function($) { + +module("datepicker: methods"); + +test('destroy', function() { + var inp = init('#inp'); + ok(inp.is('.hasDatepicker'), 'Default - marker class set'); + ok($.data(inp[0], PROP_NAME), 'Default - instance present'); + ok(inp.next().is('#alt'), 'Default - button absent'); + inp.datepicker('destroy'); + inp = $('#inp'); + ok(!inp.is('.hasDatepicker'), 'Default - marker class cleared'); + ok(!$.data(inp[0], PROP_NAME), 'Default - instance absent'); + ok(inp.next().is('#alt'), 'Default - button absent'); + // With button + inp= init('#inp', {showOn: 'both'}); + ok(inp.is('.hasDatepicker'), 'Button - marker class set'); + ok($.data(inp[0], PROP_NAME), 'Button - instance present'); + ok(inp.next().text() == '...', 'Button - button added'); + inp.datepicker('destroy'); + inp = $('#inp'); + ok(!inp.is('.hasDatepicker'), 'Button - marker class cleared'); + ok(!$.data(inp[0], PROP_NAME), 'Button - instance absent'); + ok(inp.next().is('#alt'), 'Button - button removed'); + // With append text + inp = init('#inp', {appendText: 'Testing'}); + ok(inp.is('.hasDatepicker'), 'Append - marker class set'); + ok($.data(inp[0], PROP_NAME), 'Append - instance present'); + ok(inp.next().text() == 'Testing', 'Append - append text added'); + inp.datepicker('destroy'); + inp = $('#inp'); + ok(!inp.is('.hasDatepicker'), 'Append - marker class cleared'); + ok(!$.data(inp[0], PROP_NAME), 'Append - instance absent'); + ok(inp.next().is('#alt'), 'Append - append text removed'); + // With both + inp= init('#inp', {showOn: 'both', buttonImageOnly: true, + buttonImage: 'img/calendar.gif', appendText: 'Testing'}); + ok(inp.is('.hasDatepicker'), 'Both - marker class set'); + ok($.data(inp[0], PROP_NAME), 'Both - instance present'); + ok(inp.next()[0].nodeName.toLowerCase() == 'img', 'Both - button added'); + ok(inp.next().next().text() == 'Testing', 'Both - append text added'); + inp.datepicker('destroy'); + inp = $('#inp'); + ok(!inp.is('.hasDatepicker'), 'Both - marker class cleared'); + ok(!$.data(inp[0], PROP_NAME), 'Both - instance absent'); + ok(inp.next().is('#alt'), 'Both - button and append text absent'); + // Inline + var inl = init('#inl'); + ok(inl.is('.hasDatepicker'), 'Inline - marker class set'); + ok(inl.html() != '', 'Inline - datepicker present'); + ok($.data(inl[0], PROP_NAME), 'Inline - instance present'); + ok(inl.next().length == 0 || inl.next().is('p'), 'Inline - button absent'); + inl.datepicker('destroy'); + inl = $('#inl'); + ok(!inl.is('.hasDatepicker'), 'Inline - marker class cleared'); + ok(inl.html() == '', 'Inline - datepicker absent'); + ok(!$.data(inl[0], PROP_NAME), 'Inline - instance absent'); + ok(inl.next().length == 0 || inl.next().is('p'), 'Inline - button absent'); +}); + +test('enableDisable', function() { + var inp = init('#inp'); + ok(!inp.datepicker('isDisabled'), 'Enable/disable - initially marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable - field initially enabled'); + inp.datepicker('disable'); + ok(inp.datepicker('isDisabled'), 'Enable/disable - now marked as disabled'); + ok(inp[0].disabled, 'Enable/disable - field now disabled'); + inp.datepicker('enable'); + ok(!inp.datepicker('isDisabled'), 'Enable/disable - now marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable - field now enabled'); + inp.datepicker('destroy'); + // With a button + inp = init('#inp', {showOn: 'button'}); + ok(!inp.datepicker('isDisabled'), 'Enable/disable button - initially marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable button - field initially enabled'); + ok(!inp.next('button')[0].disabled, 'Enable/disable button - button initially enabled'); + inp.datepicker('disable'); + ok(inp.datepicker('isDisabled'), 'Enable/disable button - now marked as disabled'); + ok(inp[0].disabled, 'Enable/disable button - field now disabled'); + ok(inp.next('button')[0].disabled, 'Enable/disable button - button now disabled'); + inp.datepicker('enable'); + ok(!inp.datepicker('isDisabled'), 'Enable/disable button - now marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable button - field now enabled'); + ok(!inp.next('button')[0].disabled, 'Enable/disable button - button now enabled'); + inp.datepicker('destroy'); + // With an image button + inp = init('#inp', {showOn: 'button', buttonImageOnly: true, + buttonImage: 'img/calendar.gif'}); + ok(!inp.datepicker('isDisabled'), 'Enable/disable image - initially marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable image - field initially enabled'); + ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image initially enabled'); + inp.datepicker('disable'); + ok(inp.datepicker('isDisabled'), 'Enable/disable image - now marked as disabled'); + ok(inp[0].disabled, 'Enable/disable image - field now disabled'); + ok(inp.next('img').css('opacity') != 1, 'Enable/disable image - image now disabled'); + inp.datepicker('enable'); + ok(!inp.datepicker('isDisabled'), 'Enable/disable image - now marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable image - field now enabled'); + ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image now enabled'); + inp.datepicker('destroy'); + // Inline + var inl = init('#inl', {changeYear: true}); + var dp = $('.ui-datepicker-inline', inl); + ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - initially marked as enabled'); + ok(!dp.children().is('.ui-state-disabled'), 'Enable/disable inline - not visually disabled initially'); + ok(!dp.find('select').prop('disabled'), 'Enable/disable inline - form element enabled initially'); + inl.datepicker('disable'); + ok(inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as disabled'); + ok(dp.children().is('.ui-state-disabled'), 'Enable/disable inline - visually disabled'); + ok(dp.find('select').prop('disabled'), 'Enable/disable inline - form element disabled'); + inl.datepicker('enable'); + ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as enabled'); + ok(!dp.children().is('.ui-state-disabled'), 'Enable/disable inline - not visiually disabled'); + ok(!dp.find('select').prop('disabled'), 'Enable/disable inline - form element enabled'); + inl.datepicker('destroy'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_options.js new file mode 100644 index 0000000..272af9d --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_options.js @@ -0,0 +1,925 @@ +/* + * datepicker_options.js + */ + +(function($) { + +module("datepicker: options"); + +test('setDefaults', function() { + var inp = init('#inp'); + equals($.datepicker._defaults.showOn, 'focus', 'Initial showOn'); + $.datepicker.setDefaults({showOn: 'button'}); + equals($.datepicker._defaults.showOn, 'button', 'Change default showOn'); + $.datepicker.setDefaults({showOn: 'focus'}); + equals($.datepicker._defaults.showOn, 'focus', 'Restore showOn'); +}); + +test('option', function() { + var inp = init('#inp'); + var inst = $.data(inp[0], PROP_NAME); + // Set option + equals(inst.settings.showOn, null, 'Initial setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'focus', 'Initial instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Initial default showOn'); + inp.datepicker('option', 'showOn', 'button'); + equals(inst.settings.showOn, 'button', 'Change setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'button', 'Change instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); + inp.datepicker('option', {showOn: 'both'}); + equals(inst.settings.showOn, 'both', 'Change setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'both', 'Change instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); + inp.datepicker('option', 'showOn', undefined); + equals(inst.settings.showOn, null, 'Clear setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'focus', 'Restore instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); + // Get option + inp = init('#inp'); + equals(inp.datepicker('option', 'showOn'), 'focus', 'Initial setting showOn'); + inp.datepicker('option', 'showOn', 'button'); + equals(inp.datepicker('option', 'showOn'), 'button', 'Change instance showOn'); + inp.datepicker('option', 'showOn', undefined); + equals(inp.datepicker('option', 'showOn'), 'focus', 'Reset instance showOn'); + same(inp.datepicker('option', 'all'), {showAnim: ''}, 'Get instance settings'); + same(inp.datepicker('option', 'defaults'), $.datepicker._defaults, + 'Get default settings'); +}); + +test('change', function() { + var inp = init('#inp'); + var inst = $.data(inp[0], PROP_NAME); + equals(inst.settings.showOn, null, 'Initial setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'focus', 'Initial instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Initial default showOn'); + inp.datepicker('change', 'showOn', 'button'); + equals(inst.settings.showOn, 'button', 'Change setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'button', 'Change instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); + inp.datepicker('change', {showOn: 'both'}); + equals(inst.settings.showOn, 'both', 'Change setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'both', 'Change instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); + inp.datepicker('change', 'showOn', undefined); + equals(inst.settings.showOn, null, 'Clear setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'focus', 'Restore instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); +}); + +test('invocation', function() { + var inp = init('#inp'); + var dp = $('#ui-datepicker-div'); + var body = $('body'); + // On focus + var button = inp.siblings('button'); + ok(button.length == 0, 'Focus - button absent'); + var image = inp.siblings('img'); + ok(image.length == 0, 'Focus - image absent'); + inp.focus(); + ok(dp.is(':visible'), 'Focus - rendered on focus'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ESC}); + ok(!dp.is(':visible'), 'Focus - hidden on exit'); + inp.focus(); + ok(dp.is(':visible'), 'Focus - rendered on focus'); + body.simulate('mousedown', {}); + ok(!dp.is(':visible'), 'Focus - hidden on external click'); + inp.datepicker('hide').datepicker('destroy'); + // On button + inp = init('#inp', {showOn: 'button', buttonText: 'Popup'}); + ok(!dp.is(':visible'), 'Button - initially hidden'); + button = inp.siblings('button'); + image = inp.siblings('img'); + ok(button.length == 1, 'Button - button present'); + ok(image.length == 0, 'Button - image absent'); + equals(button.text(), 'Popup', 'Button - button text'); + inp.focus(); + ok(!dp.is(':visible'), 'Button - not rendered on focus'); + button.click(); + ok(dp.is(':visible'), 'Button - rendered on button click'); + button.click(); + ok(!dp.is(':visible'), 'Button - hidden on second button click'); + inp.datepicker('hide').datepicker('destroy'); + // On image button + inp = init('#inp', {showOn: 'button', buttonImageOnly: true, + buttonImage: 'img/calendar.gif', buttonText: 'Cal'}); + ok(!dp.is(':visible'), 'Image button - initially hidden'); + button = inp.siblings('button'); + ok(button.length == 0, 'Image button - button absent'); + image = inp.siblings('img'); + ok(image.length == 1, 'Image button - image present'); + equals(image.attr('src'), 'img/calendar.gif', 'Image button - image source'); + equals(image.attr('title'), 'Cal', 'Image button - image text'); + inp.focus(); + ok(!dp.is(':visible'), 'Image button - not rendered on focus'); + image.click(); + ok(dp.is(':visible'), 'Image button - rendered on image click'); + image.click(); + ok(!dp.is(':visible'), 'Image button - hidden on second image click'); + inp.datepicker('hide').datepicker('destroy'); + // On both + inp = init('#inp', {showOn: 'both', buttonImage: 'img/calendar.gif'}); + ok(!dp.is(':visible'), 'Both - initially hidden'); + button = inp.siblings('button'); + ok(button.length == 1, 'Both - button present'); + image = inp.siblings('img'); + ok(image.length == 0, 'Both - image absent'); + image = button.children('img'); + ok(image.length == 1, 'Both - button image present'); + inp.focus(); + ok(dp.is(':visible'), 'Both - rendered on focus'); + body.simulate('mousedown', {}); + ok(!dp.is(':visible'), 'Both - hidden on external click'); + button.click(); + ok(dp.is(':visible'), 'Both - rendered on button click'); + button.click(); + ok(!dp.is(':visible'), 'Both - hidden on second button click'); + inp.datepicker('hide').datepicker('destroy'); +}); + +test('otherMonths', function() { + var inp = init('#inp'); + var pop = $('#ui-datepicker-div'); + inp.val('06/01/2009').datepicker('show'); + equals(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0', + 'Other months - none'); + ok(pop.find('td:last *').length == 0, 'Other months - no content'); + inp.datepicker('hide').datepicker('option', 'showOtherMonths', true).datepicker('show'); + equals(pop.find('tbody').text(), '311234567891011121314151617181920212223242526272829301234', + 'Other months - show'); + ok(pop.find('td:last span').length == 1, 'Other months - span content'); + inp.datepicker('hide').datepicker('option', 'selectOtherMonths', true).datepicker('show'); + equals(pop.find('tbody').text(), '311234567891011121314151617181920212223242526272829301234', + 'Other months - select'); + ok(pop.find('td:last a').length == 1, 'Other months - link content'); + inp.datepicker('hide').datepicker('option', 'showOtherMonths', false).datepicker('show'); + equals(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0', + 'Other months - none'); + ok(pop.find('td:last *').length == 0, 'Other months - no content'); +}); + +test('defaultDate', function() { + var inp = init('#inp'); + var date = new Date(); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Default date null'); + // Numeric values + inp.datepicker('option', {defaultDate: -2}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 2); + equalsDate(inp.datepicker('getDate'), date, 'Default date -2'); + inp.datepicker('option', {defaultDate: 3}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 5); + equalsDate(inp.datepicker('getDate'), date, 'Default date 3'); + inp.datepicker('option', {defaultDate: 1 / 0}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 3); + equalsDate(inp.datepicker('getDate'), date, 'Default date Infinity'); + inp.datepicker('option', {defaultDate: 1 / 'a'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Default date NaN'); + // String offset values + inp.datepicker('option', {defaultDate: '-1d'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 1); + equalsDate(inp.datepicker('getDate'), date, 'Default date -1d'); + inp.datepicker('option', {defaultDate: '+3D'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 4); + equalsDate(inp.datepicker('getDate'), date, 'Default date +3D'); + inp.datepicker('option', {defaultDate: ' -2 w '}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = new Date(); + date.setDate(date.getDate() - 14); + equalsDate(inp.datepicker('getDate'), date, 'Default date -2 w'); + inp.datepicker('option', {defaultDate: '+1 W'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 21); + equalsDate(inp.datepicker('getDate'), date, 'Default date +1 W'); + inp.datepicker('option', {defaultDate: ' -1 m '}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = addMonths(new Date(), -1); + equalsDate(inp.datepicker('getDate'), date, 'Default date -1 m'); + inp.datepicker('option', {defaultDate: '+2M'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = addMonths(new Date(), 2); + equalsDate(inp.datepicker('getDate'), date, 'Default date +2M'); + inp.datepicker('option', {defaultDate: '-2y'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = new Date(); + date.setFullYear(date.getFullYear() - 2); + equalsDate(inp.datepicker('getDate'), date, 'Default date -2y'); + inp.datepicker('option', {defaultDate: '+1 Y '}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setFullYear(date.getFullYear() + 3); + equalsDate(inp.datepicker('getDate'), date, 'Default date +1 Y'); + inp.datepicker('option', {defaultDate: '+1M +10d'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = addMonths(new Date(), 1); + date.setDate(date.getDate() + 10); + equalsDate(inp.datepicker('getDate'), date, 'Default date +1M +10d'); + // String date values + inp.datepicker('option', {defaultDate: '07/04/2007'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = new Date(2007, 7 - 1, 4); + equalsDate(inp.datepicker('getDate'), date, 'Default date 07/04/2007'); + inp.datepicker('option', {dateFormat: 'yy-mm-dd', defaultDate: '2007-04-02'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = new Date(2007, 4 - 1, 2); + equalsDate(inp.datepicker('getDate'), date, 'Default date 2007-04-02'); + // Date value + date = new Date(2007, 1 - 1, 26); + inp.datepicker('option', {dateFormat: 'mm/dd/yy', defaultDate: date}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Default date 01/26/2007'); +}); + +test('miscellaneous', function() { + var dp = $('#ui-datepicker-div'); + var inp = init('#inp'); + // Year range + var genRange = function(start, offset) { + var range = ''; + for (var i = start; i < start + offset; i++) { + range += i; + } + return range; + }; + var curYear = new Date().getFullYear(); + inp.val('02/04/2008').datepicker('show'); + equals(dp.find('.ui-datepicker-year').text(), '2008', 'Year range - read-only default'); + inp.datepicker('hide').datepicker('option', {changeYear: true}).datepicker('show'); + equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 10, 21), 'Year range - changeable default'); + inp.datepicker('hide').datepicker('option', {yearRange: 'c-6:c+2', changeYear: true}).datepicker('show'); + equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 6, 9), 'Year range - c-6:c+2'); + inp.datepicker('hide').datepicker('option', {yearRange: '2000:2010', changeYear: true}).datepicker('show'); + equals(dp.find('.ui-datepicker-year').text(), genRange(2000, 11), 'Year range - 2000:2010'); + inp.datepicker('hide').datepicker('option', {yearRange: '-5:+3', changeYear: true}).datepicker('show'); + equals(dp.find('.ui-datepicker-year').text(), genRange(curYear - 5, 9), 'Year range - -5:+3'); + inp.datepicker('hide').datepicker('option', {yearRange: '2000:-5', changeYear: true}).datepicker('show'); + equals(dp.find('.ui-datepicker-year').text(), genRange(2000, curYear - 2004), 'Year range - 2000:-5'); + inp.datepicker('hide').datepicker('option', {yearRange: '', changeYear: true}).datepicker('show'); + equals(dp.find('.ui-datepicker-year').text(), genRange(curYear, 1), 'Year range - -6:+2'); + + // Navigation as date format + inp.datepicker('option', {showButtonPanel: true}); + equals(dp.find('.ui-datepicker-prev').text(), 'Prev', 'Navigation prev - default'); + equals(dp.find('.ui-datepicker-current').text(), 'Today', 'Navigation current - default'); + equals(dp.find('.ui-datepicker-next').text(), 'Next', 'Navigation next - default'); + inp.datepicker('hide').datepicker('option', {navigationAsDateFormat: true, prevText: '< M', currentText: 'MM', nextText: 'M >'}). + val('02/04/2008').datepicker('show'); + var longNames = $.datepicker.regional[''].monthNames; + var shortNames = $.datepicker.regional[''].monthNamesShort; + var date = new Date(); + equals(dp.find('.ui-datepicker-prev').text(), '< ' + shortNames[0], 'Navigation prev - as date format'); + equals(dp.find('.ui-datepicker-current').text(), + longNames[date.getMonth()], 'Navigation current - as date format'); + equals(dp.find('.ui-datepicker-next').text(), + shortNames[2] + ' >', 'Navigation next - as date format'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}); + equals(dp.find('.ui-datepicker-prev').text(), + '< ' + shortNames[1], 'Navigation prev - as date format + pgdn'); + equals(dp.find('.ui-datepicker-current').text(), + longNames[date.getMonth()], 'Navigation current - as date format + pgdn'); + equals(dp.find('.ui-datepicker-next').text(), + shortNames[3] + ' >', 'Navigation next - as date format + pgdn'); + inp.datepicker('hide').datepicker('option', {gotoCurrent: true}). + val('02/04/2008').datepicker('show'); + equals(dp.find('.ui-datepicker-prev').text(), + '< ' + shortNames[0], 'Navigation prev - as date format + goto current'); + equals(dp.find('.ui-datepicker-current').text(), + longNames[1], 'Navigation current - as date format + goto current'); + equals(dp.find('.ui-datepicker-next').text(), + shortNames[2] + ' >', 'Navigation next - as date format + goto current'); +}); + +test('minMax', function() { + var inp = init('#inp'); + var lastYear = new Date(2007, 6 - 1, 4); + var nextYear = new Date(2009, 6 - 1, 4); + var minDate = new Date(2008, 2 - 1, 29); + var maxDate = new Date(2008, 12 - 1, 7); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), lastYear, + 'Min/max - null, null - ctrl+pgup'); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), nextYear, + 'Min/max - null, null - ctrl+pgdn'); + inp.datepicker('option', {minDate: minDate}). + datepicker('hide').val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), minDate, + 'Min/max - 02/29/2008, null - ctrl+pgup'); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), nextYear, + 'Min/max - 02/29/2008, null - ctrl+pgdn'); + inp.datepicker('option', {maxDate: maxDate}). + datepicker('hide').val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), minDate, + 'Min/max - 02/29/2008, 12/07/2008 - ctrl+pgup'); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), maxDate, + 'Min/max - 02/29/2008, 12/07/2008 - ctrl+pgdn'); + inp.datepicker('option', {minDate: null}). + datepicker('hide').val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), lastYear, + 'Min/max - null, 12/07/2008 - ctrl+pgup'); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), maxDate, + 'Min/max - null, 12/07/2008 - ctrl+pgdn'); + // Relative dates + var date = new Date(); + date.setDate(date.getDate() - 7); + inp.datepicker('option', {minDate: '-1w', maxDate: '+1 M +10 D '}). + datepicker('hide').val('').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, + 'Min/max - -1w, +1 M +10 D - ctrl+pgup'); + date = addMonths(new Date(), 1); + date.setDate(date.getDate() + 10); + inp.val('').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, + 'Min/max - -1w, +1 M +10 D - ctrl+pgdn'); + // With existing date + inp = init('#inp'); + inp.val('06/04/2008').datepicker('option', {minDate: minDate}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 6 - 1, 4), 'Min/max - setDate > min'); + inp.datepicker('option', {minDate: null}).val('01/04/2008').datepicker('option', {minDate: minDate}); + equalsDate(inp.datepicker('getDate'), minDate, 'Min/max - setDate < min'); + inp.datepicker('option', {minDate: null}).val('06/04/2008').datepicker('option', {maxDate: maxDate}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 6 - 1, 4), 'Min/max - setDate < max'); + inp.datepicker('option', {maxDate: null}).val('01/04/2009').datepicker('option', {maxDate: maxDate}); + equalsDate(inp.datepicker('getDate'), maxDate, 'Min/max - setDate > max'); + inp.datepicker('option', {maxDate: null}).val('01/04/2008').datepicker('option', {minDate: minDate, maxDate: maxDate}); + equalsDate(inp.datepicker('getDate'), minDate, 'Min/max - setDate < min'); + inp.datepicker('option', {maxDate: null}).val('06/04/2008').datepicker('option', {minDate: minDate, maxDate: maxDate}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 6 - 1, 4), 'Min/max - setDate > min, < max'); + inp.datepicker('option', {maxDate: null}).val('01/04/2009').datepicker('option', {minDate: minDate, maxDate: maxDate}); + equalsDate(inp.datepicker('getDate'), maxDate, 'Min/max - setDate > max'); +}); + +test('setDate', function() { + var inp = init('#inp'); + var date1 = new Date(2008, 6 - 1, 4); + var date2 = new Date(); + ok(inp.datepicker('getDate') == null, 'Set date - default'); + inp.datepicker('setDate', date1); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - 2008-06-04'); + date1 = new Date(); + date1.setDate(date1.getDate() + 7); + inp.datepicker('setDate', +7); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - +7'); + date2.setFullYear(date2.getFullYear() + 2); + inp.datepicker('setDate', '+2y'); + equalsDate(inp.datepicker('getDate'), date2, 'Set date - +2y'); + inp.datepicker('setDate', date1, date2); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - two dates'); + inp.datepicker('setDate'); + ok(inp.datepicker('getDate') == null, 'Set date - null'); + // Relative to current date + date1 = new Date(); + date1.setDate(date1.getDate() + 7); + inp.datepicker('setDate', 'c +7'); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - c +7'); + date1.setDate(date1.getDate() + 7); + inp.datepicker('setDate', 'c+7'); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - c+7'); + date1.setDate(date1.getDate() - 21); + inp.datepicker('setDate', 'c -3 w'); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - c -3 w'); + // Inline + var inl = init('#inl'); + date1 = new Date(2008, 6 - 1, 4); + date2 = new Date(); + equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - default'); + inl.datepicker('setDate', date1); + equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - 2008-06-04'); + date1 = new Date(); + date1.setDate(date1.getDate() + 7); + inl.datepicker('setDate', +7); + equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - +7'); + date2.setFullYear(date2.getFullYear() + 2); + inl.datepicker('setDate', '+2y'); + equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - +2y'); + inl.datepicker('setDate', date1, date2); + equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - two dates'); + inl.datepicker('setDate'); + ok(inl.datepicker('getDate') == null, 'Set date inline - null'); + // Alternate field + var alt = $('#alt'); + inp.datepicker('option', {altField: '#alt', altFormat: 'yy-mm-dd'}); + date1 = new Date(2008, 6 - 1, 4); + inp.datepicker('setDate', date1); + equals(inp.val(), '06/04/2008', 'Set date alternate - 06/04/2008'); + equals(alt.val(), '2008-06-04', 'Set date alternate - 2008-06-04'); + // With minimum/maximum + inp = init('#inp'); + date1 = new Date(2008, 1 - 1, 4); + date2 = new Date(2008, 6 - 1, 4); + var minDate = new Date(2008, 2 - 1, 29); + var maxDate = new Date(2008, 3 - 1, 28); + inp.val('').datepicker('option', {minDate: minDate}).datepicker('setDate', date2); + equalsDate(inp.datepicker('getDate'), date2, 'Set date min/max - setDate > min'); + inp.datepicker('setDate', date1); + equalsDate(inp.datepicker('getDate'), minDate, 'Set date min/max - setDate < min'); + inp.val('').datepicker('option', {maxDate: maxDate, minDate: null}).datepicker('setDate', date1); + equalsDate(inp.datepicker('getDate'), date1, 'Set date min/max - setDate < max'); + inp.datepicker('setDate', date2); + equalsDate(inp.datepicker('getDate'), maxDate, 'Set date min/max - setDate > max'); + inp.val('').datepicker('option', {minDate: minDate}).datepicker('setDate', date1); + equalsDate(inp.datepicker('getDate'), minDate, 'Set date min/max - setDate < min'); + inp.datepicker('setDate', date2); + equalsDate(inp.datepicker('getDate'), maxDate, 'Set date min/max - setDate > max'); + var dateAndTimeToSet = new Date(2008, 3 - 1, 28, 1, 11, 0); + var dateAndTimeClone = new Date(2008, 3 - 1, 28, 1, 11, 0); + inp.datepicker('setDate', dateAndTimeToSet); + equals(dateAndTimeToSet.getTime(), dateAndTimeClone.getTime(), 'Date object passed should not be changed by setDate'); +}); + +test('altField', function() { + var inp = init('#inp'); + var alt = $('#alt'); + // No alternate field set + alt.val(''); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '06/04/2008', 'Alt field - dp - enter'); + equals(alt.val(), '', 'Alt field - alt not set'); + // Alternate field set + alt.val(''); + inp.datepicker('option', {altField: '#alt', altFormat: 'yy-mm-dd'}). + val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '06/04/2008', 'Alt field - dp - enter'); + equals(alt.val(), '2008-06-04', 'Alt field - alt - enter'); + // Move from initial date + alt.val(''); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '07/04/2008', 'Alt field - dp - pgdn'); + equals(alt.val(), '2008-07-04', 'Alt field - alt - pgdn'); + // Alternate field set - closed + alt.val(''); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(inp.val(), '06/04/2008', 'Alt field - dp - pgdn/esc'); + equals(alt.val(), '', 'Alt field - alt - pgdn/esc'); + // Clear date and alternate + alt.val(''); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END}); + equals(inp.val(), '', 'Alt field - dp - ctrl+end'); + equals(alt.val(), '', 'Alt field - alt - ctrl+end'); + + return + // TODO manual entry impl works (see altField demo) but this test doesn't + // probably something the rewrite won't cover anymore anyway + + // Verify alt field is updated on keyup + alt.val(''); + inp.val('06/04/200').datepicker('show'); + inp.simulate('keydown', {charCode: '8'.charCodeAt(0)}); + inp.simulate('keypress', {charCode: '8'.charCodeAt(0)}); + inp.simulate('keyup', {charCode: '8'.charCodeAt(0)}); + equals(inp.val(), '06/04/2008', 'Alt field - dp - manual entry'); + equals(alt.val(), '2008-06-04', 'Alt field - manual entry'); + // Verify alt field is not updated on keyup if date is invalid + inp.val('12/04'); + inp.simulate('keydown', {charCode: '/'.charCodeAt(0)}); + inp.simulate('keypress', {charCode: '/'.charCodeAt(0)}); + inp.simulate('keyup', {charCode: '/'.charCodeAt(0)}); + equals(inp.val(), '12/04/', 'Alt field - dp - manual entry incomplete'); + equals(alt.val(), '2008-06-04', 'Alt field - manual entry - not updated'); +}); + +test('autoSize', function() { + var inp = init('#inp'); + equals(inp.prop('size'), 20, 'Auto size - default'); + inp.datepicker('option', 'autoSize', true); + equals(inp.prop('size'), 10, 'Auto size - mm/dd/yy'); + inp.datepicker('option', 'dateFormat', 'm/d/yy'); + equals(inp.prop('size'), 10, 'Auto size - m/d/yy'); + inp.datepicker('option', 'dateFormat', 'D M d yy'); + equals(inp.prop('size'), 15, 'Auto size - D M d yy'); + inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy'); + equals(inp.prop('size'), 29, 'Auto size - DD, MM dd, yy'); + // French + inp.datepicker('option', $.extend({autoSize: false}, $.datepicker.regional['fr'])); + equals(inp.prop('size'), 29, 'Auto size - fr - default'); + inp.datepicker('option', 'autoSize', true); + equals(inp.prop('size'), 10, 'Auto size - fr - dd/mm/yy'); + inp.datepicker('option', 'dateFormat', 'm/d/yy'); + equals(inp.prop('size'), 10, 'Auto size - fr - m/d/yy'); + inp.datepicker('option', 'dateFormat', 'D M d yy'); + equals(inp.prop('size'), 18, 'Auto size - fr - D M d yy'); + inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy'); + equals(inp.prop('size'), 28, 'Auto size - fr - DD, MM dd, yy'); + // Hebrew + inp.datepicker('option', $.extend({autoSize: false}, $.datepicker.regional['he'])); + equals(inp.prop('size'), 28, 'Auto size - he - default'); + inp.datepicker('option', 'autoSize', true); + equals(inp.prop('size'), 10, 'Auto size - he - dd/mm/yy'); + inp.datepicker('option', 'dateFormat', 'm/d/yy'); + equals(inp.prop('size'), 10, 'Auto size - he - m/d/yy'); + inp.datepicker('option', 'dateFormat', 'D M d yy'); + equals(inp.prop('size'), 14, 'Auto size - he - D M d yy'); + inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy'); + equals(inp.prop('size'), 23, 'Auto size - he - DD, MM dd, yy'); +}); + +test('daylightSaving', function() { + var inp = init('#inp'); + var dp = $('#ui-datepicker-div'); + ok(true, 'Daylight saving - ' + new Date()); + // Australia, Sydney - AM change, southern hemisphere + inp.val('04/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(6) a', dp).simulate('click'); + equals(inp.val(), '04/05/2008', 'Daylight saving - Australia 04/05/2008'); + inp.val('04/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(7) a', dp).simulate('click'); + equals(inp.val(), '04/06/2008', 'Daylight saving - Australia 04/06/2008'); + inp.val('04/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(8) a', dp).simulate('click'); + equals(inp.val(), '04/07/2008', 'Daylight saving - Australia 04/07/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(6) a', dp).simulate('click'); + equals(inp.val(), '10/04/2008', 'Daylight saving - Australia 10/04/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(7) a', dp).simulate('click'); + equals(inp.val(), '10/05/2008', 'Daylight saving - Australia 10/05/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(8) a', dp).simulate('click'); + equals(inp.val(), '10/06/2008', 'Daylight saving - Australia 10/06/2008'); + // Brasil, Brasilia - midnight change, southern hemisphere + inp.val('02/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(20) a', dp).simulate('click'); + equals(inp.val(), '02/16/2008', 'Daylight saving - Brasil 02/16/2008'); + inp.val('02/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(21) a', dp).simulate('click'); + equals(inp.val(), '02/17/2008', 'Daylight saving - Brasil 02/17/2008'); + inp.val('02/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(22) a', dp).simulate('click'); + equals(inp.val(), '02/18/2008', 'Daylight saving - Brasil 02/18/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(13) a', dp).simulate('click'); + equals(inp.val(), '10/11/2008', 'Daylight saving - Brasil 10/11/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(14) a', dp).simulate('click'); + equals(inp.val(), '10/12/2008', 'Daylight saving - Brasil 10/12/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(15) a', dp).simulate('click'); + equals(inp.val(), '10/13/2008', 'Daylight saving - Brasil 10/13/2008'); + // Lebanon, Beirut - midnight change, northern hemisphere + inp.val('03/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(34) a', dp).simulate('click'); + equals(inp.val(), '03/29/2008', 'Daylight saving - Lebanon 03/29/2008'); + inp.val('03/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(35) a', dp).simulate('click'); + equals(inp.val(), '03/30/2008', 'Daylight saving - Lebanon 03/30/2008'); + inp.val('03/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(36) a', dp).simulate('click'); + equals(inp.val(), '03/31/2008', 'Daylight saving - Lebanon 03/31/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(27) a', dp).simulate('click'); + equals(inp.val(), '10/25/2008', 'Daylight saving - Lebanon 10/25/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(28) a', dp).simulate('click'); + equals(inp.val(), '10/26/2008', 'Daylight saving - Lebanon 10/26/2008'); + inp.val('10/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(29) a', dp).simulate('click'); + equals(inp.val(), '10/27/2008', 'Daylight saving - Lebanon 10/27/2008'); + // US, Eastern - AM change, northern hemisphere + inp.val('03/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(13) a', dp).simulate('click'); + equals(inp.val(), '03/08/2008', 'Daylight saving - US 03/08/2008'); + inp.val('03/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(14) a', dp).simulate('click'); + equals(inp.val(), '03/09/2008', 'Daylight saving - US 03/09/2008'); + inp.val('03/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(15) a', dp).simulate('click'); + equals(inp.val(), '03/10/2008', 'Daylight saving - US 03/10/2008'); + inp.val('11/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(6) a', dp).simulate('click'); + equals(inp.val(), '11/01/2008', 'Daylight saving - US 11/01/2008'); + inp.val('11/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(7) a', dp).simulate('click'); + equals(inp.val(), '11/02/2008', 'Daylight saving - US 11/02/2008'); + inp.val('11/01/2008').datepicker('show'); + $('.ui-datepicker-calendar td:eq(8) a', dp).simulate('click'); + equals(inp.val(), '11/03/2008', 'Daylight saving - US 11/03/2008'); +}); + +var beforeShowThis = null; +var beforeShowInput = null; +var beforeShowInst = null; + +function beforeAll(input, inst) { + beforeShowThis = this; + beforeShowInput = input; + beforeShowInst = inst; + return {currentText: 'Current'}; +} + +var beforeShowDayThis = null; +var beforeShowDayOK = true; + +function beforeDay(date) { + beforeShowDayThis = this; + beforeShowDayOK &= (date > new Date(2008, 1 - 1, 26) && + date < new Date(2008, 3 - 1, 6)); + return [(date.getDate() % 2 == 0), (date.getDate() % 10 == 0 ? 'day10' : ''), + (date.getDate() % 3 == 0 ? 'Divisble by 3' : '')]; +} + +function calcWeek(date) { + var doy = date.getDate() + 6; + for (var m = date.getMonth() - 1; m >= 0; m--) + doy += $.datepicker._getDaysInMonth(date.getFullYear(), m); + // Simple count from 01/01 starting at week 1 + return Math.floor(doy / 7); +} + +test('callbacks', function() { + // Before show + var inp = init('#inp', {beforeShow: beforeAll}); + var inst = $.data(inp[0], 'datepicker'); + equals($.datepicker._get(inst, 'currentText'), 'Today', 'Before show - initial'); + inp.val('02/04/2008').datepicker('show'); + equals($.datepicker._get(inst, 'currentText'), 'Current', 'Before show - changed'); + ok(beforeShowThis.id == inp[0].id, 'Before show - this OK'); + ok(beforeShowInput.id == inp[0].id, 'Before show - input OK'); + deepEqual(beforeShowInst, inst, 'Before show - inst OK'); + inp.datepicker('hide').datepicker('destroy'); + // Before show day + inp = init('#inp', {beforeShowDay: beforeDay}); + var dp = $('#ui-datepicker-div'); + inp.val('02/04/2008').datepicker('show'); + ok(beforeShowDayThis.id == inp[0].id, 'Before show day - this OK'); + ok(beforeShowDayOK, 'Before show day - dates OK'); + var day20 = dp.find('.ui-datepicker-calendar td:contains("20")'); + var day21 = dp.find('.ui-datepicker-calendar td:contains("21")'); + ok(!day20.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 20'); + ok(day21.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 21'); + ok(day20.is('.day10'), 'Before show day - CSS 20'); + ok(!day21.is('.day10'), 'Before show day - CSS 21'); + ok(!day20.attr('title'), 'Before show day - title 20'); + ok(day21.attr('title') == 'Divisble by 3', 'Before show day - title 21'); + inp.datepicker('hide').datepicker('destroy'); +}); + +test('localisation', function() { + var inp = init('#inp', $.datepicker.regional['fr']); + inp.datepicker('option', {dateFormat: 'DD, d MM yy', showButtonPanel:true, changeMonth:true, changeYear:true}).val('').datepicker('show'); + var dp = $('#ui-datepicker-div'); + equals($('.ui-datepicker-close', dp).text(), 'Fermer', 'Localisation - close'); + $('.ui-datepicker-close', dp).simulate('mouseover'); + equals($('.ui-datepicker-prev', dp).text(), 'Précédent', 'Localisation - previous'); + equals($('.ui-datepicker-current', dp).text(), 'Aujourd\'hui', 'Localisation - current'); + equals($('.ui-datepicker-next', dp).text(), 'Suivant', 'Localisation - next'); + var month = 0; + $('.ui-datepicker-month option', dp).each(function() { + equals($(this).text(), $.datepicker.regional['fr'].monthNamesShort[month], + 'Localisation - month ' + month); + month++; + }); + var day = 1; + $('.ui-datepicker-calendar th', dp).each(function() { + equals($(this).text(), $.datepicker.regional['fr'].dayNamesMin[day], + 'Localisation - day ' + day); + day = (day + 1) % 7; + }); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + var date = new Date(); + equals(inp.val(), $.datepicker.regional['fr'].dayNames[date.getDay()] + ', ' + + date.getDate() + ' ' + $.datepicker.regional['fr'].monthNames[date.getMonth()] + + ' ' + date.getFullYear(), 'Localisation - formatting'); +}); + +test('noWeekends', function() { + for (var i = 1; i <= 31; i++) { + var date = new Date(2001, 1 - 1, i); + deepEqual($.datepicker.noWeekends(date), [(i + 1) % 7 >= 2, ''], + 'No weekends ' + date); + } +}); + +test('iso8601Week', function() { + var date = new Date(2000, 12 - 1, 31); + equals($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date); + date = new Date(2001, 1 - 1, 1); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2001, 1 - 1, 7); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2001, 1 - 1, 8); + equals($.datepicker.iso8601Week(date), 2, 'ISO 8601 week ' + date); + date = new Date(2003, 12 - 1, 28); + equals($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date); + date = new Date(2003, 12 - 1, 29); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2004, 1 - 1, 4); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2004, 1 - 1, 5); + equals($.datepicker.iso8601Week(date), 2, 'ISO 8601 week ' + date); + date = new Date(2009, 12 - 1, 28); + equals($.datepicker.iso8601Week(date), 53, 'ISO 8601 week ' + date); + date = new Date(2010, 1 - 1, 3); + equals($.datepicker.iso8601Week(date), 53, 'ISO 8601 week ' + date); + date = new Date(2010, 1 - 1, 4); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2010, 1 - 1, 10); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); +}); + +test('parseDate', function() { + init('#inp'); + ok($.datepicker.parseDate('d m y', '') == null, 'Parse date empty'); + equalsDate($.datepicker.parseDate('d m y', '3 2 01'), + new Date(2001, 2 - 1, 3), 'Parse date d m y'); + equalsDate($.datepicker.parseDate('dd mm yy', '03 02 2001'), + new Date(2001, 2 - 1, 3), 'Parse date dd mm yy'); + equalsDate($.datepicker.parseDate('d m y', '13 12 01'), + new Date(2001, 12 - 1, 13), 'Parse date d m y'); + equalsDate($.datepicker.parseDate('dd mm yy', '13 12 2001'), + new Date(2001, 12 - 1, 13), 'Parse date dd mm yy'); + equalsDate($.datepicker.parseDate('y-o', '01-34'), + new Date(2001, 2 - 1, 3), 'Parse date y-o'); + equalsDate($.datepicker.parseDate('yy-oo', '2001-347'), + new Date(2001, 12 - 1, 13), 'Parse date yy-oo'); + equalsDate($.datepicker.parseDate('oo yy', '348 2004'), + new Date(2004, 12 - 1, 13), 'Parse date oo yy'); + equalsDate($.datepicker.parseDate('D d M y', 'Sat 3 Feb 01'), + new Date(2001, 2 - 1, 3), 'Parse date D d M y'); + equalsDate($.datepicker.parseDate('d MM DD yy', '3 February Saturday 2001'), + new Date(2001, 2 - 1, 3), 'Parse date dd MM DD yy'); + equalsDate($.datepicker.parseDate('DD, MM d, yy', 'Saturday, February 3, 2001'), + new Date(2001, 2 - 1, 3), 'Parse date DD, MM d, yy'); + equalsDate($.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy', + 'day 3 of February (\'Saturday\'), 2001'), new Date(2001, 2 - 1, 3), + 'Parse date \'day\' d \'of\' MM (\'\'DD\'\'), yy'); + var currentYear = new Date().getFullYear(); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000) + '-02-03'), + new Date(currentYear, 2 - 1, 3), 'Parse date y-m-d - default cutuff'); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 10) + '-02-03'), + new Date(currentYear+10, 2 - 1, 3), 'Parse date y-m-d - default cutuff'); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 11) + '-02-03'), + new Date(currentYear-89, 2 - 1, 3), 'Parse date y-m-d - default cutuff'); + equalsDate($.datepicker.parseDate('y-m-d', '80-02-03', {shortYearCutoff: 80}), + new Date(2080, 2 - 1, 3), 'Parse date y-m-d - cutoff 80'); + equalsDate($.datepicker.parseDate('y-m-d', '81-02-03', {shortYearCutoff: 80}), + new Date(1981, 2 - 1, 3), 'Parse date y-m-d - cutoff 80'); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 60) + '-02-03', {shortYearCutoff: '+60'}), + new Date(currentYear + 60, 2 - 1, 3), 'Parse date y-m-d - cutoff +60'); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 61) + '-02-03', {shortYearCutoff: '+60'}), + new Date(currentYear - 39, 2 - 1, 3), 'Parse date y-m-d - cutoff +60'); + var gmtDate = new Date(2001, 2 - 1, 3); + gmtDate.setMinutes(gmtDate.getMinutes() - gmtDate.getTimezoneOffset()); + equalsDate($.datepicker.parseDate('@', '981158400000'), gmtDate, 'Parse date @'); + equalsDate($.datepicker.parseDate('!', '631167552000000000'), gmtDate, 'Parse date !'); + var fr = $.datepicker.regional['fr']; + var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames, + monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames}; + equalsDate($.datepicker.parseDate('D d M y', 'Lun. 9 Avril 01', settings), + new Date(2001, 4 - 1, 9), 'Parse date D M y with settings'); + equalsDate($.datepicker.parseDate('d MM DD yy', '9 Avril Lundi 2001', settings), + new Date(2001, 4 - 1, 9), 'Parse date d MM DD yy with settings'); + equalsDate($.datepicker.parseDate('DD, MM d, yy', 'Lundi, Avril 9, 2001', settings), + new Date(2001, 4 - 1, 9), 'Parse date DD, MM d, yy with settings'); + equalsDate($.datepicker.parseDate('\'jour\' d \'de\' MM (\'\'DD\'\'), yy', + 'jour 9 de Avril (\'Lundi\'), 2001', settings), new Date(2001, 4 - 1, 9), + 'Parse date \'jour\' d \'de\' MM (\'\'DD\'\'), yy with settings'); + + var zh = $.datepicker.regional['zh-CN']; + equalsDate($.datepicker.parseDate('yy M d', '2011 十一 22', zh), + new Date(2011, 11 - 1, 22), 'Parse date yy M d with zh-CN'); +}); + +test('parseDateErrors', function() { + init('#inp'); + var expectError = function(expr, value, error) { + try { + expr(); + ok(false, 'Parsed error ' + value); + } + catch (e) { + equals(e, error, 'Parsed error ' + value); + } + }; + expectError(function() { $.datepicker.parseDate(null, 'Sat 2 01'); }, + 'Sat 2 01', 'Invalid arguments'); + expectError(function() { $.datepicker.parseDate('d m y', null); }, + 'null', 'Invalid arguments'); + expectError(function() { $.datepicker.parseDate('d m y', 'Sat 2 01'); }, + 'Sat 2 01 - d m y', 'Missing number at position 0'); + expectError(function() { $.datepicker.parseDate('dd mm yy', 'Sat 2 01'); }, + 'Sat 2 01 - dd mm yy', 'Missing number at position 0'); + expectError(function() { $.datepicker.parseDate('d m y', '3 Feb 01'); }, + '3 Feb 01 - d m y', 'Missing number at position 2'); + expectError(function() { $.datepicker.parseDate('dd mm yy', '3 Feb 01'); }, + '3 Feb 01 - dd mm yy', 'Missing number at position 2'); + expectError(function() { $.datepicker.parseDate('d m y', '3 2 AD01'); }, + '3 2 AD01 - d m y', 'Missing number at position 4'); + expectError(function() { $.datepicker.parseDate('d m yy', '3 2 AD01'); }, + '3 2 AD01 - dd mm yy', 'Missing number at position 4'); + expectError(function() { $.datepicker.parseDate('y-o', '01-D01'); }, + '2001-D01 - y-o', 'Missing number at position 3'); + expectError(function() { $.datepicker.parseDate('yy-oo', '2001-D01'); }, + '2001-D01 - yy-oo', 'Missing number at position 5'); + expectError(function() { $.datepicker.parseDate('D d M y', 'D7 3 Feb 01'); }, + 'D7 3 Feb 01 - D d M y', 'Unknown name at position 0'); + expectError(function() { $.datepicker.parseDate('D d M y', 'Sat 3 M2 01'); }, + 'Sat 3 M2 01 - D d M y', 'Unknown name at position 6'); + expectError(function() { $.datepicker.parseDate('DD, MM d, yy', 'Saturday- Feb 3, 2001'); }, + 'Saturday- Feb 3, 2001 - DD, MM d, yy', 'Unexpected literal at position 8'); + expectError(function() { $.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy', + 'day 3 of February ("Saturday"), 2001'); }, + 'day 3 of Mon2 ("Day7"), 2001', 'Unexpected literal at position 19'); + expectError(function() { $.datepicker.parseDate('d m y', '29 2 01'); }, + '29 2 01 - d m y', 'Invalid date'); + var fr = $.datepicker.regional['fr']; + var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames, + monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames}; + expectError(function() { $.datepicker.parseDate('D d M y', 'Mon 9 Avr 01', settings); }, + 'Mon 9 Avr 01 - D d M y', 'Unknown name at position 0'); + expectError(function() { $.datepicker.parseDate('D d M y', 'Lun. 9 Apr 01', settings); }, + 'Lun. 9 Apr 01 - D d M y', 'Unknown name at position 7'); +}); + +test('formatDate', function() { + init('#inp'); + equals($.datepicker.formatDate('d m y', new Date(2001, 2 - 1, 3)), + '3 2 01', 'Format date d m y'); + equals($.datepicker.formatDate('dd mm yy', new Date(2001, 2 - 1, 3)), + '03 02 2001', 'Format date dd mm yy'); + equals($.datepicker.formatDate('d m y', new Date(2001, 12 - 1, 13)), + '13 12 01', 'Format date d m y'); + equals($.datepicker.formatDate('dd mm yy', new Date(2001, 12 - 1, 13)), + '13 12 2001', 'Format date dd mm yy'); + equals($.datepicker.formatDate('yy-o', new Date(2001, 2 - 1, 3)), + '2001-34', 'Format date yy-o'); + equals($.datepicker.formatDate('yy-oo', new Date(2001, 2 - 1, 3)), + '2001-034', 'Format date yy-oo'); + equals($.datepicker.formatDate('D M y', new Date(2001, 2 - 1, 3)), + 'Sat Feb 01', 'Format date D M y'); + equals($.datepicker.formatDate('DD MM yy', new Date(2001, 2 - 1, 3)), + 'Saturday February 2001', 'Format date DD MM yy'); + equals($.datepicker.formatDate('DD, MM d, yy', new Date(2001, 2 - 1, 3)), + 'Saturday, February 3, 2001', 'Format date DD, MM d, yy'); + equals($.datepicker.formatDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy', + new Date(2001, 2 - 1, 3)), 'day 3 of February (\'Saturday\'), 2001', + 'Format date \'day\' d \'of\' MM (\'\'DD\'\'), yy'); + var gmtDate = new Date(2001, 2 - 1, 3); + gmtDate.setMinutes(gmtDate.getMinutes() - gmtDate.getTimezoneOffset()); + equals($.datepicker.formatDate('@', gmtDate), '981158400000', 'Format date @'); + equals($.datepicker.formatDate('!', gmtDate), '631167552000000000', 'Format date !'); + var fr = $.datepicker.regional['fr']; + var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames, + monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames}; + equals($.datepicker.formatDate('D M y', new Date(2001, 4 - 1, 9), settings), + 'Lun. Avril 01', 'Format date D M y with settings'); + equals($.datepicker.formatDate('DD MM yy', new Date(2001, 4 - 1, 9), settings), + 'Lundi Avril 2001', 'Format date DD MM yy with settings'); + equals($.datepicker.formatDate('DD, MM d, yy', new Date(2001, 4 - 1, 9), settings), + 'Lundi, Avril 9, 2001', 'Format date DD, MM d, yy with settings'); + equals($.datepicker.formatDate('\'jour\' d \'de\' MM (\'\'DD\'\'), yy', + new Date(2001, 4 - 1, 9), settings), 'jour 9 de Avril (\'Lundi\'), 2001', + 'Format date \'jour\' d \'de\' MM (\'\'DD\'\'), yy with settings'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_tickets.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_tickets.js new file mode 100644 index 0000000..3534266 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/datepicker/datepicker_tickets.js @@ -0,0 +1,84 @@ +/* + * datepicker_tickets.js + */ +(function($) { + +module("datepicker: tickets"); + +// http://forum.jquery.com/topic/several-breaking-changes-in-jquery-ui-1-8rc1 +test('beforeShowDay-getDate', function() { + var inp = init('#inp', {beforeShowDay: function(date) { inp.datepicker('getDate'); return [true, '']; }}); + var dp = $('#ui-datepicker-div'); + inp.val('01/01/2010').datepicker('show'); + // contains non-breaking space + equals($('div.ui-datepicker-title').text(), 'January 2010', 'Initial month'); + $('a.ui-datepicker-next', dp).click(); + $('a.ui-datepicker-next', dp).click(); + // contains non-breaking space + equals($('div.ui-datepicker-title').text(), 'March 2010', 'After next clicks'); + inp.datepicker('hide').datepicker('show'); + $('a.ui-datepicker-prev', dp).click(); + $('a.ui-datepicker-prev', dp).click(); + // contains non-breaking space + equals($('div.ui-datepicker-title').text(), 'November 2009', 'After prev clicks'); + inp.datepicker('hide'); +}); + +test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){ + var inp = init('#inp',{ + beforeShow: function(){ + return false; + } + }); + var dp = $('#ui-datepicker-div'); + inp.datepicker('show'); + equals(dp.css('display'), 'none',"beforeShow returns false"); + inp.datepicker('destroy'); + + inp = init('#inp',{ + beforeShow: function(){ + } + }); + dp = $('#ui-datepicker-div'); + inp.datepicker('show'); + equal(dp.css('display'), 'block',"beforeShow returns nothing"); + inp.datepicker('hide'); + inp.datepicker('destroy'); + + inp = init('#inp',{ + beforeShow: function(){ + return true; + } + }); + dp = $('#ui-datepicker-div'); + inp.datepicker('show'); + equal(dp.css('display'), 'block',"beforeShow returns true"); + inp.datepicker('hide'); + inp.datepicker('destroy'); +}); + +test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){ + var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT")); + equals(time, "089"); +}); + +test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() { + var date; + try{ + date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881'); + ok(false, "Did not properly detect an invalid date"); + }catch(e){ + ok("invalid date detected"); + } + + try { + date = $.datepicker.parseDate('dd/mm/yy', '18/04/1988 @ 2:43 pm'); + equal(date.getDate(), 18); + equal(date.getMonth(), 3); + equal(date.getFullYear(), 1988); + } catch(e) { + ok(false, "Did not properly parse date with extra text separated by whitespace"); + } +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/all.html new file mode 100644 index 0000000..e0416ec --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Dialog Test Suite + + + + + + + + + + + + + +

                          jQuery UI Dialog Test Suite

                          +

                          +
                          +

                          +
                            +
                            + +
                            + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog.html new file mode 100644 index 0000000..94b20a2 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Dialog Test Suite + + + + + + + + + + + + + + + + + + + + + + + +

                            jQuery UI Dialog Test Suite

                            +

                            +
                            +

                            +
                              +
                              + +
                              + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_core.js new file mode 100644 index 0000000..2003689 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_core.js @@ -0,0 +1,138 @@ +/* + * dialog_core.js + */ + +var el, + offsetBefore, offsetAfter, + heightBefore, heightAfter, + widthBefore, widthAfter, + dragged; + +function dlg() { + return el.dialog('widget'); +} + +function isOpen(why) { + ok(dlg().is(":visible"), why); +} + +function isNotOpen(why) { + ok(!dlg().is(":visible"), why); +} + +function drag(handle, dx, dy) { + var d = dlg(); + offsetBefore = d.offset(); + heightBefore = d.height(); + widthBefore = d.width(); + //this mouseover is to work around a limitation in resizable + //TODO: fix resizable so handle doesn't require mouseover in order to be used + $(handle, d).simulate("mouseover"); + $(handle, d).simulate("drag", { + dx: dx || 0, + dy: dy || 0 + }); + dragged = { dx: dx, dy: dy }; + offsetAfter = d.offset(); + heightAfter = d.height(); + widthAfter = d.width(); +} + +function moved(dx, dy, msg) { + msg = msg ? msg + "." : ""; + var actual = { left: Math.round(offsetAfter.left), top: Math.round(offsetAfter.top) }; + var expected = { left: Math.round(offsetBefore.left + dx), top: Math.round(offsetBefore.top + dy) }; + same(actual, expected, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ' + msg); +} + +function shouldmove(why) { + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, -50); + moved(50, -50, why); +} + +function shouldnotmove(why) { + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, -50); + moved(0, 0, why); +} + +function resized(dw, dh, msg) { + msg = msg ? msg + "." : ""; + var actual = { width: widthAfter, height: heightAfter }; + var expected = { width: widthBefore + dw, height: heightBefore + dh }; + same(actual, expected, 'resized[' + dragged.dx + ', ' + dragged.dy + '] ' + msg); +} + +function shouldresize(why) { + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + resized(50, 50, why); +} + +function shouldnotresize(why) { + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + resized(0, 0, why); +} + +function broder(el, side){ + return parseInt(el.css('border-' + side + '-width'), 10); +} + +function margin(el, side) { + return parseInt(el.css('margin-' + side), 10); +} + +(function($) { + +module("dialog: core"); + +test("title id", function() { + expect(3); + + var titleId; + + // reset the uuid so we know what values to expect + $.ui.dialog.uuid = 0; + + el = $('
                              ').dialog(); + titleId = dlg().find('.ui-dialog-title').attr('id'); + equals(titleId, 'ui-dialog-title-1', 'auto-numbered title id'); + el.remove(); + + el = $('
                              ').dialog(); + titleId = dlg().find('.ui-dialog-title').attr('id'); + equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id'); + el.remove(); + + el = $('
                              ').dialog(); + titleId = dlg().find('.ui-dialog-title').attr('id'); + equals(titleId, 'ui-dialog-title-foo', 'carried over title id'); + el.remove(); +}); + +test("ARIA", function() { + expect(4); + + el = $('
                              ').dialog(); + + equals(dlg().attr('role'), 'dialog', 'dialog role'); + + var labelledBy = dlg().attr('aria-labelledby'); + ok(labelledBy.length > 0, 'has aria-labelledby attribute'); + equals(dlg().find('.ui-dialog-title').attr('id'), labelledBy, + 'proper aria-labelledby attribute'); + + equals(dlg().find('.ui-dialog-titlebar-close').attr('role'), 'button', + 'close link role'); + + el.remove(); +}); + +test("widget method", function() { + var dialog = $("
                              ").appendTo("#main").dialog(); + same(dialog.parent()[0], dialog.dialog("widget")[0]); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_defaults.js new file mode 100644 index 0000000..9f2e4c6 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_defaults.js @@ -0,0 +1,34 @@ +commonWidgetTests( "dialog", { + defaults: { + autoOpen: true, + buttons: {}, + closeOnEscape: true, + closeText: 'close', + disabled: false, + dialogClass: '', + draggable: true, + height: 'auto', + hide: null, + maxHeight: false, + maxWidth: false, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: 'center', + at: 'center', + of: window, + collision: 'fit', + using: $.ui.dialog.prototype.options.position.using + }, + resizable: true, + show: null, + stack: true, + title: '', + width: 300, + zIndex: 1000, + + // callbacks + create: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_events.js new file mode 100644 index 0000000..40a8575 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_events.js @@ -0,0 +1,254 @@ +/* + * dialog_events.js + */ +(function($) { + +module("dialog: events"); + +test("open", function() { + expect(13); + + el = $("
                              "); + el.dialog({ + open: function(ev, ui) { + ok(el.data("dialog")._isOpen, "interal _isOpen flag is set"); + ok(true, 'autoOpen: true fires open callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogopen', 'event type in callback'); + same(ui, {}, 'ui hash in callback'); + } + }); + el.remove(); + + el = $("
                              "); + el.dialog({ + autoOpen: false, + open: function(ev, ui) { + ok(true, '.dialog("open") fires open callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogopen', 'event type in callback'); + same(ui, {}, 'ui hash in callback'); + } + }).bind('dialogopen', function(ev, ui) { + ok(el.data("dialog")._isOpen, "interal _isOpen flag is set"); + ok(true, 'dialog("open") fires open event'); + equals(this, el[0], 'context of event'); + same(ui, {}, 'ui hash in event'); + }); + el.dialog("open"); + el.remove(); +}); + +test("dragStart", function() { + expect(9); + + el = $('
                              ').dialog({ + dragStart: function(ev, ui) { + ok(true, 'dragging fires dragStart callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogdragstart', 'event type in callback'); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.offset !== undefined, "ui.offset in callback"); + } + }).bind('dialogdragstart', function(ev, ui) { + ok(true, 'dragging fires dialogdragstart event'); + equals(this, el[0], 'context of event'); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.offset !== undefined, "ui.offset in callback"); + }); + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("drag", function() { + expect(9); + var hasDragged = false; + + el = $('
                              ').dialog({ + drag: function(ev, ui) { + if (!hasDragged) { + ok(true, 'dragging fires drag callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogdrag', 'event type in callback'); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.offset !== undefined, "ui.offset in callback"); + + hasDragged = true; + } + } + }).one('dialogdrag', function(ev, ui) { + ok(true, 'dragging fires dialogdrag event'); + equals(this, el[0], 'context of event'); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.offset !== undefined, "ui.offset in callback"); + }); + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("dragStop", function() { + expect(9); + + el = $('
                              ').dialog({ + dragStop: function(ev, ui) { + ok(true, 'dragging fires dragStop callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogdragstop', 'event type in callback'); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.offset !== undefined, "ui.offset in callback"); + } + }).bind('dialogdragstop', function(ev, ui) { + ok(true, 'dragging fires dialogdragstop event'); + equals(this, el[0], 'context of event'); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.offset !== undefined, "ui.offset in callback"); + }); + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("resizeStart", function() { + expect(13); + + el = $('
                              ').dialog({ + resizeStart: function(ev, ui) { + ok(true, 'resizing fires resizeStart callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogresizestart', 'event type in callback'); + ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); + ok(ui.originalSize !== undefined, "ui.originalSize in callback"); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.size !== undefined, "ui.size in callback"); + } + }).bind('dialogresizestart', function(ev, ui) { + ok(true, 'resizing fires dialogresizestart event'); + equals(this, el[0], 'context of event'); + ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); + ok(ui.originalSize !== undefined, "ui.originalSize in callback"); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.size !== undefined, "ui.size in callback"); + }); + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("resize", function() { + expect(13); + var hasResized = false; + + el = $('
                              ').dialog({ + resize: function(ev, ui) { + if (!hasResized) { + ok(true, 'resizing fires resize callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogresize', 'event type in callback'); + ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); + ok(ui.originalSize !== undefined, "ui.originalSize in callback"); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.size !== undefined, "ui.size in callback"); + + hasResized = true; + } + } + }).one('dialogresize', function(ev, ui) { + ok(true, 'resizing fires dialogresize event'); + equals(this, el[0], 'context of event'); + ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); + ok(ui.originalSize !== undefined, "ui.originalSize in callback"); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.size !== undefined, "ui.size in callback"); + }); + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("resizeStop", function() { + expect(13); + + el = $('
                              ').dialog({ + resizeStop: function(ev, ui) { + ok(true, 'resizing fires resizeStop callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogresizestop', 'event type in callback'); + ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); + ok(ui.originalSize !== undefined, "ui.originalSize in callback"); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.size !== undefined, "ui.size in callback"); + } + }).bind('dialogresizestop', function(ev, ui) { + ok(true, 'resizing fires dialogresizestop event'); + equals(this, el[0], 'context of event'); + ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); + ok(ui.originalSize !== undefined, "ui.originalSize in callback"); + ok(ui.position !== undefined, "ui.position in callback"); + ok(ui.size !== undefined, "ui.size in callback"); + }); + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("close", function() { + expect(7); + + el = $('
                              ').dialog({ + close: function(ev, ui) { + ok(true, '.dialog("close") fires close callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogclose', 'event type in callback'); + same(ui, {}, 'ui hash in callback'); + } + }).bind('dialogclose', function(ev, ui) { + ok(true, '.dialog("close") fires dialogclose event'); + equals(this, el[0], 'context of event'); + same(ui, {}, 'ui hash in event'); + }); + el.dialog('close'); + el.remove(); +}); + +test("beforeClose", function() { + expect(14); + + el = $('
                              ').dialog({ + beforeClose: function(ev, ui) { + ok(true, '.dialog("close") fires beforeClose callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogbeforeclose', 'event type in callback'); + same(ui, {}, 'ui hash in callback'); + return false; + } + }); + el.dialog('close'); + isOpen('beforeClose callback should prevent dialog from closing'); + el.remove(); + + el = $('
                              ').dialog(); + el.dialog('option', 'beforeClose', function(ev, ui) { + ok(true, '.dialog("close") fires beforeClose callback'); + equals(this, el[0], "context of callback"); + equals(ev.type, 'dialogbeforeclose', 'event type in callback'); + same(ui, {}, 'ui hash in callback'); + return false; + }); + el.dialog('close'); + isOpen('beforeClose callback should prevent dialog from closing'); + el.remove(); + + el = $('
                              ').dialog().bind('dialogbeforeclose', function(ev, ui) { + ok(true, '.dialog("close") triggers dialogbeforeclose event'); + equals(this, el[0], "context of event"); + same(ui, {}, 'ui hash in event'); + return false; + }); + el.dialog('close'); + isOpen('dialogbeforeclose event should prevent dialog from closing'); + el.remove(); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_methods.js new file mode 100644 index 0000000..a961b4e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_methods.js @@ -0,0 +1,127 @@ +/* + * dialog_methods.js + */ +(function($) { + +module("dialog: methods", { + teardown: function() { + $("body>.ui-dialog").remove(); + } +}); + +test("init", function() { + expect(6); + + $("
                              ").appendTo('body').dialog().remove(); + ok(true, '.dialog() called on element'); + + $([]).dialog().remove(); + ok(true, '.dialog() called on empty collection'); + + $('
                              ').dialog().remove(); + ok(true, '.dialog() called on disconnected DOMElement - never connected'); + + $('
                              ').appendTo('body').remove().dialog().remove(); + ok(true, '.dialog() called on disconnected DOMElement - removed'); + + el = $('
                              ').dialog(); + var foo = el.dialog("option", "foo"); + el.remove(); + ok(true, 'arbitrary option getter after init'); + + $('
                              ').dialog().dialog("option", "foo", "bar").remove(); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + $("
                              ").appendTo('body').dialog().dialog("destroy").remove(); + ok(true, '.dialog("destroy") called on element'); + + $([]).dialog().dialog("destroy").remove(); + ok(true, '.dialog("destroy") called on empty collection'); + + $('
                              ').dialog().dialog("destroy").remove(); + ok(true, '.dialog("destroy") called on disconnected DOMElement'); + + var expected = $('
                              ').dialog(), + actual = expected.dialog('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test("enable", function() { + var expected = $('
                              ').dialog(), + actual = expected.dialog('enable'); + equals(actual, expected, 'enable is chainable'); + + el = $('
                              ').dialog({ disabled: true }); + el.dialog('enable'); + equals(el.dialog('option', 'disabled'), false, 'enable method sets disabled option to false'); + ok(!dlg().hasClass('ui-dialog-disabled'), 'enable method removes ui-dialog-disabled class from ui-dialog element'); +}); + +test("disable", function() { + var expected = $('
                              ').dialog(), + actual = expected.dialog('disable'); + equals(actual, expected, 'disable is chainable'); + + el = $('
                              ').dialog({ disabled: false }); + el.dialog('disable'); + equals(el.dialog('option', 'disabled'), true, 'disable method sets disabled option to true'); + ok(dlg().hasClass('ui-dialog-disabled'), 'disable method adds ui-dialog-disabled class to ui-dialog element'); +}); + +test("close", function() { + var expected = $('
                              ').dialog(), + actual = expected.dialog('close'); + equals(actual, expected, 'close is chainable'); + + el = $('
                              ').dialog(); + ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog visible before close method called'); + el.dialog('close'); + ok(dlg().is(':hidden') && !dlg().is(':visible'), 'dialog hidden after close method called'); +}); + +test("isOpen", function() { + expect(4); + + el = $('
                              ').dialog(); + equals(el.dialog('isOpen'), true, "dialog is open after init"); + el.dialog('close'); + equals(el.dialog('isOpen'), false, "dialog is closed"); + el.remove(); + + el = $('
                              ').dialog({autoOpen: false}); + equals(el.dialog('isOpen'), false, "dialog is closed after init"); + el.dialog('open'); + equals(el.dialog('isOpen'), true, "dialog is open"); + el.remove(); +}); + +test("moveToTop", function() { + var expected = $('
                              ').dialog(), + actual = expected.dialog('moveToTop'); + equals(actual, expected, 'moveToTop is chainable'); + + var d1 = $('
                              ').dialog(), dlg1 = d1.parents('.ui-dialog'); + d1.dialog('close'); + d1.dialog('open'); + var d2 = $('
                              ').dialog(), dlg2 = d2.parents('.ui-dialog'); + d2.dialog('close'); + d2.dialog('open'); + ok(dlg1.css('zIndex') < dlg2.css('zIndex'), 'dialog 1 under dialog 2 before moveToTop method called'); + d1.dialog('moveToTop'); + ok(dlg1.css('zIndex') > dlg2.css('zIndex'), 'dialog 1 above dialog 2 after moveToTop method called'); +}); + +test("open", function() { + var expected = $('
                              ').dialog(), + actual = expected.dialog('open'); + equals(actual, expected, 'open is chainable'); + + el = $('
                              ').dialog({ autoOpen: false }); + ok(dlg().is(':hidden') && !dlg().is(':visible'), 'dialog hidden before open method called'); + el.dialog('open'); + ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog visible after open method called'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_options.js new file mode 100644 index 0000000..eab577c --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_options.js @@ -0,0 +1,444 @@ +/* + * dialog_options.js + */ +(function($) { + +module("dialog: options"); + +test("autoOpen", function() { + expect(2); + + el = $('
                              ').dialog({ autoOpen: false }); + isNotOpen('.dialog({ autoOpen: false })'); + el.remove(); + + el = $('
                              ').dialog({ autoOpen: true }); + isOpen('.dialog({ autoOpen: true })'); + el.remove(); +}); + +test("buttons", function() { + expect(21); + + var buttons = { + "Ok": function(ev, ui) { + ok(true, "button click fires callback"); + equals(this, el[0], "context of callback"); + equals(ev.target, btn[0], "event target"); + }, + "Cancel": function(ev, ui) { + ok(true, "button click fires callback"); + equals(this, el[0], "context of callback"); + equals(ev.target, btn[1], "event target"); + } + }; + + el = $('
                              ').dialog({ buttons: buttons }); + var btn = $("button", dlg()); + equals(btn.length, 2, "number of buttons"); + + var i = 0; + $.each(buttons, function(key, val) { + equals(btn.eq(i).text(), key, "text of button " + (i+1)); + i++; + }); + + ok(btn.parent().hasClass('ui-dialog-buttonset'), "buttons in container"); + ok(el.parent().hasClass('ui-dialog-buttons'), "dialog wrapper adds class about having buttons"); + + btn.trigger("click"); + + var newButtons = { + "Close": function(ev, ui) { + ok(true, "button click fires callback"); + equals(this, el[0], "context of callback"); + equals(ev.target, btn[0], "event target"); + } + }; + + same(el.dialog("option", "buttons"), buttons, '.dialog("option", "buttons") getter'); + el.dialog("option", "buttons", newButtons); + same(el.dialog("option", "buttons"), newButtons, '.dialog("option", "buttons", ...) setter'); + + btn = $("button", dlg()); + equals(btn.length, 1, "number of buttons after setter"); + btn.trigger('click'); + + i = 0; + $.each(newButtons, function(key, val) { + equals(btn.eq(i).text(), key, "text of button " + (i+1)); + i += 1; + }); + + el.dialog("option", "buttons", null); + btn = $("button", dlg()); + equals(btn.length, 0, "all buttons have been removed"); + equals(el.find(".ui-dialog-buttonset").length, 0, "buttonset has been removed"); + equals(el.parent().hasClass('ui-dialog-buttons'), false, "dialog wrapper removes class about having buttons"); + + el.remove(); +}); + +test("buttons - advanced", function() { + expect(5); + + el = $("
                              ").dialog({ + buttons: [ + { + text: "a button", + "class": "additional-class", + id: "my-button-id", + click: function() { + equals(this, el[0], "correct context"); + } + } + ] + }); + var buttons = dlg().find("button"); + equals(buttons.length, 1, "correct number of buttons"); + equals(buttons.attr("id"), "my-button-id", "correct id"); + equals(buttons.text(), "a button", "correct label"); + ok(buttons.hasClass("additional-class"), "additional classes added"); + buttons.click(); + + el.remove(); +}); + +test("closeOnEscape", function() { + el = $('
                              ').dialog({ closeOnEscape: false }); + ok(true, 'closeOnEscape: false'); + ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open before ESC'); + el.simulate('keydown', { keyCode: $.ui.keyCode.ESCAPE }) + .simulate('keypress', { keyCode: $.ui.keyCode.ESCAPE }) + .simulate('keyup', { keyCode: $.ui.keyCode.ESCAPE }); + ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open after ESC'); + + el.remove(); + + el = $('
                              ').dialog({ closeOnEscape: true }); + ok(true, 'closeOnEscape: true'); + ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open before ESC'); + el.simulate('keydown', { keyCode: $.ui.keyCode.ESCAPE }) + .simulate('keypress', { keyCode: $.ui.keyCode.ESCAPE }) + .simulate('keyup', { keyCode: $.ui.keyCode.ESCAPE }); + ok(dlg().is(':hidden') && !dlg().is(':visible'), 'dialog is closed after ESC'); +}); + +test("closeText", function() { + expect(3); + + el = $('
                              ').dialog(); + equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'close', + 'default close text'); + el.remove(); + + el = $('
                              ').dialog({ closeText: "foo" }); + equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'foo', + 'closeText on init'); + el.remove(); + + el = $('
                              ').dialog().dialog('option', 'closeText', 'bar'); + equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'bar', + 'closeText via option method'); + el.remove(); +}); + +test("dialogClass", function() { + expect(4); + + el = $('
                              ').dialog(); + equals(dlg().is(".foo"), false, 'dialogClass not specified. foo class added'); + el.remove(); + + el = $('
                              ').dialog({ dialogClass: "foo" }); + equals(dlg().is(".foo"), true, 'dialogClass in init. foo class added'); + el.remove(); + + el = $('
                              ').dialog({ dialogClass: "foo bar" }); + equals(dlg().is(".foo"), true, 'dialogClass in init, two classes. foo class added'); + equals(dlg().is(".bar"), true, 'dialogClass in init, two classes. bar class added'); + el.remove(); +}); + +test("draggable", function() { + expect(4); + + el = $('
                              ').dialog({ draggable: false }); + shouldnotmove(); + el.dialog('option', 'draggable', true); + shouldmove(); + el.remove(); + + el = $('
                              ').dialog({ draggable: true }); + shouldmove(); + el.dialog('option', 'draggable', false); + shouldnotmove(); + el.remove(); +}); + +test("height", function() { + expect(3); + + el = $('
                              ').dialog(); + equals(dlg().height(), 150, "default height"); + el.remove(); + + el = $('
                              ').dialog({ height: 237 }); + equals(dlg().height(), 237, "explicit height"); + el.remove(); + + el = $('
                              ').dialog(); + el.dialog('option', 'height', 238); + equals(dlg().height(), 238, "explicit height set after init"); + el.remove(); +}); + +test("maxHeight", function() { + expect(3); + + el = $('
                              ').dialog({ maxHeight: 200 }); + drag('.ui-resizable-s', 1000, 1000); + equals(heightAfter, 200, "maxHeight"); + el.remove(); + + el = $('
                              ').dialog({ maxHeight: 200 }); + drag('.ui-resizable-n', -1000, -1000); + equals(heightAfter, 200, "maxHeight"); + el.remove(); + + el = $('
                              ').dialog({ maxHeight: 200 }).dialog('option', 'maxHeight', 300); + drag('.ui-resizable-s', 1000, 1000); + equals(heightAfter, 300, "maxHeight"); + el.remove(); +}); + +test("maxWidth", function() { + expect(3); + + el = $('
                              ').dialog({ maxWidth: 200 }); + drag('.ui-resizable-e', 1000, 1000); + equals(widthAfter, 200, "maxWidth"); + el.remove(); + + el = $('
                              ').dialog({ maxWidth: 200 }); + drag('.ui-resizable-w', -1000, -1000); + equals(widthAfter, 200, "maxWidth"); + el.remove(); + + el = $('
                              ').dialog({ maxWidth: 200 }).dialog('option', 'maxWidth', 300); + drag('.ui-resizable-w', -1000, -1000); + equals(widthAfter, 300, "maxWidth"); + el.remove(); +}); + +test("minHeight", function() { + expect(3); + + el = $('
                              ').dialog({ minHeight: 10 }); + drag('.ui-resizable-s', -1000, -1000); + equals(heightAfter, 10, "minHeight"); + el.remove(); + + el = $('
                              ').dialog({ minHeight: 10 }); + drag('.ui-resizable-n', 1000, 1000); + equals(heightAfter, 10, "minHeight"); + el.remove(); + + el = $('
                              ').dialog({ minHeight: 10 }).dialog('option', 'minHeight', 30); + drag('.ui-resizable-n', 1000, 1000); + equals(heightAfter, 30, "minHeight"); + el.remove(); +}); + +test("minWidth", function() { + expect(3); + + el = $('
                              ').dialog({ minWidth: 10 }); + drag('.ui-resizable-e', -1000, -1000); + equals(widthAfter, 10, "minWidth"); + el.remove(); + + el = $('
                              ').dialog({ minWidth: 10 }); + drag('.ui-resizable-w', 1000, 1000); + equals(widthAfter, 10, "minWidth"); + el.remove(); + + el = $('
                              ').dialog({ minWidth: 30 }).dialog('option', 'minWidth', 30); + drag('.ui-resizable-w', 1000, 1000); + equals(widthAfter, 30, "minWidth"); + el.remove(); +}); + +test("position, default center on window", function() { + var el = $('
                              ').dialog(); + var dialog = el.dialog('widget'); + var offset = dialog.offset(); + same(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft()); + same(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop()); + el.remove(); +}); + +test("position, top on window", function() { + var el = $('
                              ').dialog({ position: "top" }); + var dialog = el.dialog('widget'); + var offset = dialog.offset(); + same(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft()); + same(offset.top, $(window).scrollTop()); + el.remove(); +}); + +test("position, left on window", function() { + var el = $('
                              ').dialog({ position: "left" }); + var dialog = el.dialog('widget'); + var offset = dialog.offset(); + same(offset.left, 0); + same(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop()); + el.remove(); +}); + +test("position, right bottom on window", function() { + var el = $('
                              ').dialog({ position: "right bottom" }); + var dialog = el.dialog('widget'); + var offset = dialog.offset(); + same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft()); + same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop()); + el.remove(); +}); + +test("position, right bottom on window w/array", function() { + var el = $('
                              ').dialog({ position: ["right", "bottom"] }); + var dialog = el.dialog('widget'); + var offset = dialog.offset(); + same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft()); + same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop()); + el.remove(); +}); + +test("position, offset from top left w/array", function() { + var el = $('
                              ').dialog({ position: [10, 10] }); + var dialog = el.dialog('widget'); + var offset = dialog.offset(); + same(offset.left, 10 + $(window).scrollLeft()); + same(offset.top, 10 + $(window).scrollTop()); + el.remove(); +}); + +test("position, right bottom at right bottom via ui.position args", function() { + var el = $('
                              ').dialog({ + position: { + my: "right bottom", + at: "right bottom" + } + }); + + var dialog = el.dialog('widget'); + var offset = dialog.offset(); + + same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft()); + same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop()); + el.remove(); +}); + +test("position, at another element", function() { + var parent = $('
                              ').css({ + position: 'absolute', + top: 400, + left: 600, + height: 10, + width: 10 + }).appendTo('body'); + + var el = $('
                              ').dialog({ + position: { + my: "left top", + at: "left top", + of: parent + } + }); + + var dialog = el.dialog('widget'); + var offset = dialog.offset(); + + same(offset.left, 600); + same(offset.top, 400); + + el.dialog('option', 'position', { + my: "left top", + at: "right bottom", + of: parent + }); + + var offset = dialog.offset(); + + same(offset.left, 610); + same(offset.top, 410); + + el.remove(); + parent.remove(); +}); + +test("resizable", function() { + expect(4); + + el = $('
                              ').dialog(); + shouldresize("[default]"); + el.dialog('option', 'resizable', false); + shouldnotresize('disabled after init'); + el.remove(); + + el = $('
                              ').dialog({ resizable: false }); + shouldnotresize("disabled in init options"); + el.dialog('option', 'resizable', true); + shouldresize('enabled after init'); + el.remove(); +}); + +test("title", function() { + expect(9); + + function titleText() { + return dlg().find(".ui-dialog-title").html(); + } + + el = $('
                              ').dialog(); + // some browsers return a non-breaking space and some return " " + // so we get the text to normalize to the actual non-breaking space + equals(dlg().find(".ui-dialog-title").text(), " ", "[default]"); + equals(el.dialog("option", "title"), "", "option not changed"); + el.remove(); + + el = $('
                              ').dialog(); + equals(titleText(), "foo", "title in element attribute"); + equals(el.dialog("option", "title"), "foo", "option updated from attribute"); + el.remove(); + + el = $('
                              ').dialog({ title: 'foo' }); + equals(titleText(), "foo", "title in init options"); + equals(el.dialog("option", "title"), "foo", "opiton set from options hash"); + el.remove(); + + el = $('
                              ').dialog({ title: 'bar' }); + equals(titleText(), "bar", "title in init options should override title in element attribute"); + equals(el.dialog("option", "title"), "bar", "opiton set from options hash"); + el.remove(); + + el = $('
                              ').dialog().dialog('option', 'title', 'foo'); + equals(titleText(), 'foo', 'title after init'); + el.remove(); +}); + +test("width", function() { + expect(3); + + el = $('
                              ').dialog(); + equals(dlg().width(), 300, "default width"); + el.remove(); + + el = $('
                              ').dialog({width: 437 }); + equals(dlg().width(), 437, "explicit width"); + el.dialog('option', 'width', 438); + equals(dlg().width(), 438, 'explicit width after init'); + el.remove(); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_tickets.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_tickets.js new file mode 100644 index 0000000..b203ca7 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/dialog/dialog_tickets.js @@ -0,0 +1,143 @@ +/* + * dialog_tickets.js + */ +(function($) { + +module( "dialog: tickets" ); + +asyncTest( "#3123: Prevent tabbing out of modal dialogs", function() { + expect( 3 ); + + var el = $( "
                              " ).dialog({ modal: true }), + inputs = el.find( "input" ), + widget = el.dialog( "widget" ); + + inputs.eq( 1 ).focus(); + equal( document.activeElement, inputs[1], "Focus set on second input" ); + inputs.eq( 1 ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB }); + + setTimeout( checkTab, 2 ); + + function checkTab() { + ok( $.contains( widget, document.activeElement ), "Tab key event moved focus within the modal" ); + + // check shift tab + $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB, shiftKey: true }); + setTimeout( checkShiftTab, 2 ); + } + + function checkShiftTab() { + ok( $.contains( widget, document.activeElement ), "Shift-Tab key event moved focus within the modal" ); + + el.remove(); + start(); + } +}); + +test("#4826: setting resizable false toggles resizable on dialog", function() { + expect(6); + + el = $('
                              ').dialog({ resizable: false }); + shouldnotresize("[default]"); + for (var i=0; i<2; i++) { + el.dialog('close').dialog('open'); + shouldnotresize('initialized with resizable false toggle ('+ (i+1) +')'); + } + el.remove(); + + el = $('
                              ').dialog({ resizable: true }); + shouldresize("[default]"); + for (var i=0; i<2; i++) { + el.dialog('close').dialog('option', 'resizable', false).dialog('open'); + shouldnotresize('set option resizable false toggle ('+ (i+1) +')'); + } + el.remove(); + +}); + +test("#5184: isOpen in dialogclose event is true", function() { + expect( 3 ); + + el = $( "
                              " ).dialog({ + close: function() { + ok( !el.dialog("isOpen"), "dialog is not open during close" ); + } + }); + ok( el.dialog("isOpen"), "dialog is open after init" ); + el.dialog( "close" ); + ok( !el.dialog("isOpen"), "dialog is not open after close" ); + el.remove(); +}); + +test("#5531: dialog width should be at least minWidth on creation", function () { + el = $('
                              ').dialog({ + width: 200, + minWidth: 300 + }); + + equals(el.dialog('option', 'width'), 300, "width is minWidth"); + el.dialog('option', 'width', 200); + equals(el.dialog('option', 'width'), 300, "width unchanged when set to < minWidth"); + el.dialog('option', 'width', 320); + equals(el.dialog('option', 'width'), 320, "width changed if set to > minWidth"); + el.remove(); + + el = $('
                              ').dialog({ + minWidth: 300 + }); + ok(el.dialog('option', 'width') >= 300, "width is at least 300"); + el.remove(); + +}); + +test("#6137: dialog('open') causes form elements to reset on IE7", function() { + expect(2); + + d1 = $('
                              ' + + 'b
                              ').appendTo( "body" ).dialog({autoOpen: false}); + + d1.find('#b').prop( "checked", true ); + equal($('input:checked').val(), 'b', "checkbox b is checked"); + + d1.dialog('open'); + equal($('input:checked').val(), 'b', "checkbox b is checked"); + + d1.remove(); +}); + +test("#6645: Missing element not found check in overlay", function(){ + expect(2); + d1 = $('
                              Dialog 1
                              ').dialog({modal: true}); + d2 = $('
                              Dialog 2
                              ').dialog({modal: true, close: function(){ d2.remove()}}); + equals($.ui.dialog.overlay.instances.length, 2, 'two overlays created'); + d2.dialog('close'); + equals($.ui.dialog.overlay.instances.length, 1, 'one overlay remains after closing the 2nd overlay'); + d1.add(d2).remove(); +}); + +test("#6966: Escape key closes all dialogs, not the top one", function(){ + expect(8); + // test with close function removing dialog + d1 = $('
                              Dialog 1
                              ').dialog({modal: true}); + d2 = $('
                              Dialog 2
                              ').dialog({modal: true, close: function(){ d2.remove()}}); + ok(d1.dialog("isOpen"), 'first dialog is open'); + ok(d2.dialog("isOpen"), 'second dialog is open'); + d2.simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE}); + ok(d1.dialog("isOpen"), 'first dialog still open'); + ok(!d2.data('dialog'), 'second dialog is closed'); + d2.remove(); + d1.remove(); + + // test without close function removing dialog + d1 = $('
                              Dialog 1
                              ').dialog({modal: true}); + d2 = $('
                              Dialog 2
                              ').dialog({modal: true}); + ok(d1.dialog("isOpen"), 'first dialog is open'); + ok(d2.dialog("isOpen"), 'second dialog is open'); + d2.simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE}); + ok(d1.dialog("isOpen"), 'first dialog still open'); + ok(!d2.dialog("isOpen"), 'second dialog is closed'); + d2.remove(); + d1.remove(); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/all.html new file mode 100644 index 0000000..3796d3f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Draggable Test Suite + + + + + + + + + + + + + +

                              jQuery UI Draggable Test Suite

                              +

                              +
                              +

                              +
                                +
                                + +
                                + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable.html new file mode 100644 index 0000000..5be71f4 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Draggable Test Suite + + + + + + + + + + + + + + + + + + + + + +

                                jQuery UI Draggable Test Suite

                                +

                                +
                                +

                                +
                                  +
                                  + +
                                  Relative
                                  +
                                  Absolute
                                  +
                                  +
                                  + +
                                  + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_core.js new file mode 100644 index 0000000..a01de40 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_core.js @@ -0,0 +1,67 @@ +/* + * draggable_core.js + */ + +var el, offsetBefore, offsetAfter, dragged; + +var drag = function(handle, dx, dy) { + var element = el.data("draggable").element; + offsetBefore = el.offset(); + $(handle).simulate("drag", { + dx: dx || 0, + dy: dy || 0 + }); + dragged = { dx: dx, dy: dy }; + offsetAfter = el.offset(); +} + +var moved = function (dx, dy, msg) { + msg = msg ? msg + "." : ""; + var actual = { left: offsetAfter.left, top: offsetAfter.top }; + var expected = { left: offsetBefore.left + dx, top: offsetBefore.top + dy }; + same(actual, expected, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ' + msg); +} + +function restoreScroll(what) { + if(what) { + $(document).scrollTop(0); $(document).scrollLeft(0); + } else { + $("#main")[0].scrollTop = 0; $("#main")[0].scrollLeft = 0; + } +} + +(function($) { + +module("draggable"); + +test("element types", function() { + var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form' + + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr' + + ',acronym,code,samp,kbd,var,img,object,hr' + + ',input,button,label,select,iframe').split(','); + + $.each(typeNames, function(i) { + var typeName = typeNames[i]; + el = $(document.createElement(typeName)).appendTo('body'); + (typeName == 'table' && el.append("content")); + el.draggable({ cancel: '' }); + drag(el, 50, 50); + moved(50, 50, "<" + typeName + ">"); + el.draggable("destroy"); + el.remove(); + }); +}); + +test("No options, relative", function() { + el = $("#draggable1").draggable(); + drag(el, 50, 50); + moved(50, 50); +}); + +test("No options, absolute", function() { + el = $("#draggable2").draggable(); + drag(el, 50, 50); + moved(50, 50); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_defaults.js new file mode 100644 index 0000000..4b0aaca --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_defaults.js @@ -0,0 +1,36 @@ +/* + * draggable_defaults.js + */ + +var draggable_defaults = { + addClasses: true, + appendTo: "parent", + axis: false, + cancel: ":input,option", + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + delay: 0, + disabled: false, + distance: 1, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false +}; + +commonWidgetTests('draggable', { defaults: draggable_defaults }); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_events.js new file mode 100644 index 0000000..d92d8ee --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_events.js @@ -0,0 +1,81 @@ +/* + * draggable_events.js + */ +(function($) { + +module("draggable: events"); + +test("callbacks occurance count", function() { + + expect(3); + + var start = 0, stop = 0, dragc = 0; + el = $("#draggable2").draggable({ + start: function() { start++; }, + drag: function() { dragc++; }, + stop: function() { stop++; } + }); + + drag(el, 10, 10); + + equals(start, 1, "start callback should happen exactly once"); + equals(dragc, 3, "drag callback should happen exactly once per mousemove"); + equals(stop, 1, "stop callback should happen exactly once"); + +}); + +test("stopping the start callback", function() { + + expect(3); + + var start = 0, stop = 0, dragc = 0; + el = $("#draggable2").draggable({ + start: function() { start++; return false; }, + drag: function() { dragc++; }, + stop: function() { stop++; } + }); + + drag(el, 10, 10); + + equals(start, 1, "start callback should happen exactly once"); + equals(dragc, 0, "drag callback should not happen at all"); + equals(stop, 0, "stop callback should not happen if there wasnt even a start"); + +}); + +test("stopping the drag callback", function() { + + expect(3); + + var start = 0, stop = 0, dragc = 0; + el = $("#draggable2").draggable({ + start: function() { start++;}, + drag: function() { dragc++; return false; }, + stop: function() { stop++; } + }); + + drag(el, 10, 10); + + equals(start, 1, "start callback should happen exactly once"); + equals(dragc, 1, "drag callback should happen exactly once"); + equals(stop, 1, "stop callback should happen, as we need to actively stop the drag"); + +}); + +test("stopping the stop callback", function() { + + expect(1); + + el = $("#draggable2").draggable({ + helper: 'clone', + stop: function() { return false; } + }); + + drag(el, 10, 10); + + ok($("#draggable2").data('draggable').helper, "the clone should not be deleted if the stop callback is stopped"); + + +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_methods.js new file mode 100644 index 0000000..4ffadf0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_methods.js @@ -0,0 +1,99 @@ +/* + * draggable_methods.js + */ +(function($) { + +function shouldmove(why) { + drag(el, 50, 50); + moved(50, 50, why); +} + +function shouldnotmove(why) { + drag(el, 50, 50); + moved(0, 0, why); +} + +module("draggable: methods"); + +test("init", function() { + expect(6); + + $("
                                  ").appendTo('body').draggable().remove(); + ok(true, '.draggable() called on element'); + + $([]).draggable(); + ok(true, '.draggable() called on empty collection'); + + $("
                                  ").draggable(); + ok(true, '.draggable() called on disconnected DOMElement'); + + $("
                                  ").draggable().draggable("foo"); + ok(true, 'arbitrary method called after init'); + + $("
                                  ").draggable().draggable("option", "foo"); + ok(true, 'arbitrary option getter after init'); + + $("
                                  ").draggable().draggable("option", "foo", "bar"); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + $("
                                  ").appendTo('body').draggable().draggable("destroy").remove(); + ok(true, '.draggable("destroy") called on element'); + + $([]).draggable().draggable("destroy"); + ok(true, '.draggable("destroy") called on empty collection'); + + $("
                                  ").draggable().draggable("destroy"); + ok(true, '.draggable("destroy") called on disconnected DOMElement'); + + $("
                                  ").draggable().draggable("destroy").draggable("foo"); + ok(true, 'arbitrary method called after destroy'); + + var expected = $('
                                  ').draggable(), + actual = expected.draggable('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test("enable", function() { + expect(7); + el = $("#draggable2").draggable({ disabled: true }); + shouldnotmove('.draggable({ disabled: true })'); + el.draggable("enable"); + shouldmove('.draggable("enable")'); + equals(el.draggable("option", "disabled"), false, "disabled option getter"); + + el.draggable("destroy"); + el.draggable({ disabled: true }); + shouldnotmove('.draggable({ disabled: true })'); + el.draggable("option", "disabled", false); + equals(el.draggable("option", "disabled"), false, "disabled option setter"); + shouldmove('.draggable("option", "disabled", false)'); + + var expected = $('
                                  ').draggable(), + actual = expected.draggable('enable'); + equals(actual, expected, 'enable is chainable'); +}); + +test("disable", function() { + expect(7); + el = $("#draggable2").draggable({ disabled: false }); + shouldmove('.draggable({ disabled: false })'); + el.draggable("disable"); + shouldnotmove('.draggable("disable")'); + equals(el.draggable("option", "disabled"), true, "disabled option getter"); + + el.draggable("destroy"); + + el.draggable({ disabled: false }); + shouldmove('.draggable({ disabled: false })'); + el.draggable("option", "disabled", true); + equals(el.draggable("option", "disabled"), true, "disabled option setter"); + shouldnotmove('.draggable("option", "disabled", true)'); + + var expected = $('
                                  ').draggable(), + actual = expected.draggable('disable'); + equals(actual, expected, 'disable is chainable'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_options.js new file mode 100644 index 0000000..8ba77fb --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/draggable/draggable_options.js @@ -0,0 +1,753 @@ +/* + * draggable_options.js + */ +(function($) { + +function testScroll(position) { + $("#main").css('position', position); + drag(el, 50, 50); + moved(50, 50, position+' parent'); +} + +function setScroll(what) { + if(what) { + $(document).scrollTop(100); $(document).scrollLeft(100); + } else { + $("#main")[0].scrollTop = 100; $("#main")[0].scrollLeft = 100; + } +} + +var border = function(el, side) { return parseInt(el.css('border-' + side + '-width')); } + +var margin = function(el, side) { return parseInt(el.css('margin-' + side)); } + +module("draggable: options"); + +test("{ addClasses: true }, default", function() { + equals(draggable_defaults.addClasses, true); + + el = $("
                                  ").draggable({ addClasses: true }); + ok(el.is(".ui-draggable"), "'ui-draggable' class added"); + + el.draggable("destroy"); +}); + +test("{ addClasses: false }", function() { + el = $("
                                  ").draggable({ addClasses: false }); + ok(!el.is(".ui-draggable"), "'ui-draggable' class not added"); + + el.draggable("destroy"); +}); + +test("{ appendTo: 'parent' }, default", function() { + equals(draggable_defaults.appendTo, "parent"); + + el = $("#draggable2").draggable({ appendTo: 'parent' }); + drag(el, 50, 50); + moved(50, 50); + + el = $("#draggable1").draggable({ appendTo: 'parent' }); + drag(el, 50, 50); + moved(50, 50); + +}); + +test("{ appendTo: Element }", function() { + el = $("#draggable2").draggable({ appendTo: $("#draggable2").parent()[0] }); + drag(el, 50, 50); + moved(50, 50); + + el = $("#draggable1").draggable({ appendTo: $("#draggable2").parent()[0] }); + drag(el, 50, 50); + moved(50, 50); +}); + +test("{ appendTo: Selector }", function() { + el = $("#draggable2").draggable({ appendTo: "#main" }); + drag(el, 50, 50); + moved(50, 50); + + el = $("#draggable1").draggable({ appendTo: "#main" }); + drag(el, 50, 50); + moved(50, 50); +}); + +test("{ axis: false }, default", function() { + equals(draggable_defaults.axis, false); + + el = $("#draggable2").draggable({ axis: false }); + drag(el, 50, 50); + moved(50, 50); +}); + +test("{ axis: 'x' }", function() { + el = $("#draggable2").draggable({ axis: "x" }); + drag(el, 50, 50); + moved(50, 0); +}); + +test("{ axis: 'y' }", function() { + el = $("#draggable2").draggable({ axis: "y" }); + drag(el, 50, 50); + moved(0, 50); +}); + +test("{ axis: ? }, unexpected", function() { + var unexpected = { + "true": true, + "{}": {}, + "[]": [], + "null": null, + "undefined": undefined, + "function() {}": function() {} + }; + $.each(unexpected, function(key, val) { + el = $("#draggable2").draggable({ axis: val }); + drag(el, 50, 50); + moved(50, 50, "axis: " + key); + el.draggable("destroy"); + }) +}); + +test("{ cancel: ':input,option' }, default", function() { + equals(draggable_defaults.cancel, ":input,option"); + + $('
                                  ').appendTo('#main'); + + el = $("#draggable-option-cancel-default").draggable({ cancel: ":input,option" }); + drag("#draggable-option-cancel-default", 50, 50); + moved(50, 50); + + el = $("#draggable-option-cancel-default").draggable({ cancel: ":input,option" }); + drag("#draggable-option-cancel-default :input", 50, 50); + moved(0, 0); + + el.draggable("destroy"); +}); + +test("{ cancel: 'span' }", function() { + el = $("#draggable2").draggable(); + drag("#draggable2 span", 50, 50); + moved(50, 50); + + el.draggable("destroy"); + + el = $("#draggable2").draggable({ cancel: 'span' }); + drag("#draggable2 span", 50, 50); + moved(0, 0); +}); + +test("{ cancel: ? }, unexpected", function() { + var unexpected = { + "true": true, + "false": false, + "{}": {}, + "[]": [], + "null": null, + "undefined": undefined, + "function() {return '';}": function() {return '';}, + "function() {return true;}": function() {return true;}, + "function() {return false;}": function() {return false;} + }; + $.each(unexpected, function(key, val) { + el = $("#draggable2").draggable({ cancel: val }); + drag(el, 50, 50); + var expected = [50, 50]; + moved(expected[0], expected[1], "cancel: " + key); + el.draggable("destroy"); + }) +}); + +test("{ containment: false }, default", function() { + equals(draggable_defaults.containment, false); + + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ containment: Element }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ containment: 'parent' }, relative", function() { + el = $("#draggable1").draggable({ containment: 'parent' }); + var p = el.parent(), po = p.offset(); + drag(el, -100, -100); + var expected = { + left: po.left + border(p, 'left') + margin(el, 'left'), + top: po.top + border(p, 'top') + margin(el, 'top') + } + same(offsetAfter, expected, 'compare offset to parent'); +}); + +test("{ containment: 'parent' }, absolute", function() { + el = $("#draggable2").draggable({ containment: 'parent' }); + var p = el.parent(), po = p.offset(); + drag(el, -100, -100); + var expected = { + left: po.left + border(p, 'left') + margin(el, 'left'), + top: po.top + border(p, 'top') + margin(el, 'top') + } + same(offsetAfter, expected, 'compare offset to parent'); +}); + +test("{ containment: 'document' }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ containment: 'window' }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ containment: Selector }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ containment: [x1, y1, x2, y2] }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ cursor: 'auto' }, default", function() { + equals(draggable_defaults.cursor, 'auto'); + + function getCursor() { return $("#draggable2").css("cursor"); } + + expect(3); + + var expected = "auto", actual, before, after; + + el = $("#draggable2").draggable({ + cursor: expected, + start: function(event, ui) { + actual = getCursor(); + } + }); + + before = getCursor(); + drag("#draggable2", -1, -1); + after = getCursor(); + + equals(actual, expected, "start callback: cursor '" + expected + "'"); + equals(after, before, "after drag: cursor restored"); + +}); + +test("{ cursor: 'move' }", function() { + + function getCursor() { return $("body").css("cursor"); } + + expect(2); + + var expected = "move", actual, before, after; + + el = $("#draggable2").draggable({ + cursor: expected, + start: function(event, ui) { + actual = getCursor(); + } + }); + + before = getCursor(); + drag("#draggable2", -1, -1); + after = getCursor(); + + equals(actual, expected, "start callback: cursor '" + expected + "'"); + equals(after, before, "after drag: cursor restored"); + +}); + +test("{ cursorAt: false}, default", function() { + equals(draggable_defaults.cursorAt, false); + + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ cursorAt: { left: -5, top: -5 } }", function() { + expect(4); + + var deltaX = -3, deltaY = -3, + offsetX = 5, offsetY = 5, + cursorAtX = -5, cursorAtY = -5; + + $.each(['relative', 'absolute'], function(i, position) { + var el = $('#draggable' + (i + 1)).draggable({ + cursorAt: { left: cursorAtX, top: cursorAtY }, + drag: function(event, ui) { + equals(ui.offset.left, expected.left, position + ' left'); + equals(ui.offset.top, expected.top, position + ' top'); + } + }), + before = el.offset(), + pos = { + clientX: before.left + offsetX, + clientY: before.top + offsetY + }, + expected = { + left: before.left + offsetX - cursorAtX + deltaX, + top: before.top + offsetY - cursorAtY + deltaY + }; + + el.simulate("mousedown", pos); + pos.clientX += deltaX; + pos.clientY += deltaY; + $(document).simulate("mousemove", pos); + el.simulate("mouseup", pos); + }); +}); + +test("{ cursorAt: { right: 10, bottom: 20 } }", function() { + expect(4); + + var deltaX = -3, deltaY = -3, + offsetX = 5, offsetY = 5, + cursorAtX = 10, cursorAtY = 20; + + $.each(['relative', 'absolute'], function(i, position) { + var el = $('#draggable' + (i + 1)).draggable({ + cursorAt: { right: cursorAtX, bottom: cursorAtY }, + drag: function(event, ui) { + equals(ui.offset.left, expected.left, position + ' left'); + equals(ui.offset.top, expected.top, position + ' top'); + } + }), + before = el.offset(), + pos = { + clientX: before.left + offsetX, + clientY: before.top + offsetY + }, + expected = { + left: before.left + offsetX - el.width() + cursorAtX + deltaX, + top: before.top + offsetY - el.height() + cursorAtY + deltaY + }; + + el.simulate("mousedown", pos); + pos.clientX += deltaX; + pos.clientY += deltaY; + $(document).simulate("mousemove", pos); + el.simulate("mouseup", pos); + }); +}); + +test("{ cursorAt: [10, 20] }", function() { + expect(4); + + var deltaX = -3, deltaY = -3, + offsetX = 5, offsetY = 5, + cursorAtX = 10, cursorAtY = 20; + + $.each(['relative', 'absolute'], function(i, position) { + var el = $('#draggable' + (i + 1)).draggable({ + cursorAt: { left: cursorAtX, top: cursorAtY }, + drag: function(event, ui) { + equals(ui.offset.left, expected.left, position + ' left'); + equals(ui.offset.top, expected.top, position + ' top'); + } + }), + before = el.offset(), + pos = { + clientX: before.left + offsetX, + clientY: before.top + offsetY + }, + expected = { + left: before.left + offsetX - cursorAtX + deltaX, + top: before.top + offsetY - cursorAtY + deltaY + }; + + el.simulate("mousedown", pos); + pos.clientX += deltaX; + pos.clientY += deltaY; + $(document).simulate("mousemove", pos); + el.simulate("mouseup", pos); + }); +}); + +test("{ cursorAt: '20, 40' }", function() { + expect(4); + + var deltaX = -3, deltaY = -3, + offsetX = 5, offsetY = 5, + cursorAtX = 20, cursorAtY = 40; + + $.each(['relative', 'absolute'], function(i, position) { + var el = $('#draggable' + (i + 1)).draggable({ + cursorAt: { left: cursorAtX, top: cursorAtY }, + drag: function(event, ui) { + equals(ui.offset.left, expected.left, position + ' left'); + equals(ui.offset.top, expected.top, position + ' top'); + } + }), + before = el.offset(), + pos = { + clientX: before.left + offsetX, + clientY: before.top + offsetY + }, + expected = { + left: before.left + offsetX - cursorAtX + deltaX, + top: before.top + offsetY - cursorAtY + deltaY + }; + + el.simulate("mousedown", pos); + pos.clientX += deltaX; + pos.clientY += deltaY; + $(document).simulate("mousemove", pos); + el.simulate("mouseup", pos); + }); +}); + +test("{ distance: 10 }", function() { + + el = $("#draggable2").draggable({ distance: 10 }); + drag(el, -9, -9); + moved(0, 0, 'distance not met'); + + drag(el, -10, -10); + moved(-10, -10, 'distance met'); + + drag(el, 9, 9); + moved(0, 0, 'distance not met'); + +}); + +test("{ grid: [50, 50] }, relative", function() { + el = $("#draggable1").draggable({ grid: [50, 50] }); + drag(el, 24, 24); + moved(0, 0); + drag(el, 26, 25); + moved(50, 50); +}); + +test("{ grid: [50, 50] }, absolute", function() { + el = $("#draggable2").draggable({ grid: [50, 50] }); + drag(el, 24, 24); + moved(0, 0); + drag(el, 26, 25); + moved(50, 50); +}); + +test("{ handle: 'span' }", function() { + el = $("#draggable2").draggable({ handle: 'span' }); + + drag("#draggable2 span", 50, 50); + moved(50, 50, "drag span"); + + drag("#draggable2", 50, 50); + moved(0, 0, "drag element"); +}); + +test("{ helper: 'clone' }, relative", function() { + el = $("#draggable1").draggable({ helper: "clone" }); + drag(el, 50, 50); + moved(0, 0); +}); + +test("{ helper: 'clone' }, absolute", function() { + el = $("#draggable2").draggable({ helper: "clone" }); + drag(el, 50, 50); + moved(0, 0); +}); + +test("{ helper: 'original' }, relative, with scroll offset on parent", function() { + + el = $("#draggable1").draggable({ helper: "original" }); + + setScroll(); + testScroll('relative'); + + setScroll(); + testScroll('static'); + + setScroll(); + testScroll('absolute'); + + restoreScroll(); + +}); + +test("{ helper: 'original' }, relative, with scroll offset on root", function() { + + el = $("#draggable1").draggable({ helper: "original" }); + + setScroll('root'); + testScroll('relative'); + + setScroll('root'); + testScroll('static'); + + setScroll('root'); + testScroll('absolute'); + + restoreScroll('root'); + +}); + +test("{ helper: 'original' }, relative, with scroll offset on root and parent", function() { + + el = $("#draggable1").draggable({ helper: "original" }); + + setScroll(); + setScroll('root'); + testScroll('relative'); + + setScroll(); + setScroll('root'); + testScroll('static'); + + setScroll(); + setScroll('root'); + testScroll('absolute'); + + restoreScroll(); + restoreScroll('root'); + +}); + +test("{ helper: 'original' }, absolute, with scroll offset on parent", function() { + + el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" }); + + setScroll(); + testScroll('relative'); + + setScroll(); + testScroll('static'); + + setScroll(); + testScroll('absolute'); + + restoreScroll(); + +}); + +test("{ helper: 'original' }, absolute, with scroll offset on root", function() { + + el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" }); + + setScroll('root'); + testScroll('relative'); + + setScroll('root'); + testScroll('static'); + + setScroll('root'); + testScroll('absolute'); + + restoreScroll('root'); + +}); + +test("{ helper: 'original' }, absolute, with scroll offset on root and parent", function() { + + el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" }); + + setScroll(); + setScroll('root'); + testScroll('relative'); + + setScroll(); + setScroll('root'); + testScroll('static'); + + setScroll(); + setScroll('root'); + testScroll('absolute'); + + restoreScroll(); + restoreScroll('root'); + +}); + +test("{ helper: 'original' }, fixed, with scroll offset on parent", function() { + + el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" }); + + setScroll(); + testScroll('relative'); + + setScroll(); + testScroll('static'); + + setScroll(); + testScroll('absolute'); + + restoreScroll(); + +}); + +test("{ helper: 'original' }, fixed, with scroll offset on root", function() { + + el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" }); + + setScroll('root'); + testScroll('relative'); + + setScroll('root'); + testScroll('static'); + + setScroll('root'); + testScroll('absolute'); + + restoreScroll('root'); +}); + +test("{ helper: 'original' }, fixed, with scroll offset on root and parent", function() { + + el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" }); + + setScroll(); + setScroll('root'); + testScroll('relative'); + + setScroll(); + setScroll('root'); + testScroll('static'); + + setScroll(); + setScroll('root'); + testScroll('absolute'); + + restoreScroll(); + restoreScroll('root'); + +}); + +test("{ helper: 'clone' }, absolute", function() { + + var helperOffset = null; + var origOffset = $("#draggable1").offset(); + + el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { + helperOffset = ui.helper.offset(); + } }); + + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + +}); + +test("{ helper: 'clone' }, absolute with scroll offset on parent", function() { + + setScroll(); + var helperOffset = null; + var origOffset = null; + + el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { + helperOffset = ui.helper.offset(); + } }); + + $("#main").css('position', 'relative'); + origOffset = $("#draggable1").offset(); + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + $("#main").css('position', 'static'); + origOffset = $("#draggable1").offset(); + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + $("#main").css('position', 'absolute'); + origOffset = $("#draggable1").offset(); + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + restoreScroll(); + +}); + +test("{ helper: 'clone' }, absolute with scroll offset on root", function() { + + setScroll('root'); + var helperOffset = null; + var origOffset = null; + + el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { + helperOffset = ui.helper.offset(); + } }); + + $("#main").css('position', 'relative'); + origOffset = $("#draggable1").offset(); + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + $("#main").css('position', 'static'); + origOffset = $("#draggable1").offset(); + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + $("#main").css('position', 'absolute'); + origOffset = $("#draggable1").offset(); + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + restoreScroll('root'); + +}); + +test("{ helper: 'clone' }, absolute with scroll offset on root and parent", function() { + + setScroll('root'); + setScroll(); + var helperOffset = null; + var origOffset = null; + + el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { + helperOffset = ui.helper.offset(); + } }); + + $("#main").css('position', 'relative'); + origOffset = $("#draggable1").offset() + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + $("#main").css('position', 'static'); + origOffset = $("#draggable1").offset() + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + $("#main").css('position', 'absolute'); + origOffset = $("#draggable1").offset() + drag(el, 1, 1); + same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] '); + + restoreScroll('root'); + restoreScroll(); + +}); + +test("{ opacity: 0.5 }", function() { + + expect(1); + + var opacity = null; + el = $("#draggable2").draggable({ + opacity: 0.5, + start: function(event, ui) { + opacity = $(this).css("opacity"); + } + }); + + drag("#draggable2", -1, -1); + + equals(opacity, 0.5, "start callback: opacity is"); + +}); + +test("{ zIndex: 10 }", function() { + + expect(1); + + var expected = 10, actual; + + var zIndex = null; + el = $("#draggable2").draggable({ + zIndex: expected, + start: function(event, ui) { + actual = $(this).css("zIndex"); + } + }); + + drag("#draggable2", -1, -1); + + equals(actual, expected, "start callback: zIndex is"); + +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html new file mode 100644 index 0000000..e7f274c --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Droppable Test Suite + + + + + + + + + + + + + +

                                  jQuery UI Droppable Test Suite

                                  +

                                  +
                                  +

                                  +
                                    +
                                    + +
                                    + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html new file mode 100644 index 0000000..abf94f0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Droppable Test Suite + + + + + + + + + + + + + + + + + + + + + +

                                    jQuery UI Droppable Test Suite

                                    +

                                    +
                                    +

                                    +
                                      +
                                      + +
                                      Draggable
                                      +
                                      Droppable
                                      +
                                       
                                      + +
                                      + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js new file mode 100644 index 0000000..4d82017 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_core.js @@ -0,0 +1,36 @@ +/* + * droppable_core.js + */ + +var el, drg; + +function shouldBeDroppable() { + ok(false, 'missing test - untested code is broken code'); +} + +function shouldNotBeDroppable() { + ok(false, 'missing test - untested code is broken code'); +} + +(function($) { + +module("droppable: core"); + +test("element types", function() { + var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form' + + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr' + + ',acronym,code,samp,kbd,var,img,object,hr' + + ',input,button,label,select,iframe').split(','); + + $.each(typeNames, function(i) { + var typeName = typeNames[i]; + el = $(document.createElement(typeName)).appendTo('body'); + (typeName == 'table' && el.append("content")); + el.droppable(); + shouldBeDroppable(); + el.droppable("destroy"); + el.remove(); + }); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js new file mode 100644 index 0000000..7584f5e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_defaults.js @@ -0,0 +1,16 @@ +/* + * droppable_defaults.js + */ + +var droppable_defaults = { + accept: '*', + activeClass: false, + addClasses: true, + disabled: false, + greedy: false, + hoverClass: false, + scope: "default", + tolerance: "intersect" +}; + +commonWidgetTests('droppable', { defaults: droppable_defaults }); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js new file mode 100644 index 0000000..f22a035 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_events.js @@ -0,0 +1,28 @@ +/* + * droppable_events.js + */ +(function($) { + +module("droppable: events"); + +test("activate", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("deactivate", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("over", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("out", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("drop", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js new file mode 100644 index 0000000..87b9168 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_methods.js @@ -0,0 +1,86 @@ +/* + * droppable_methods.js + */ +(function($) { + +module("droppable: methods"); + +test("init", function() { + expect(6); + + $("
                                      ").appendTo('body').droppable().remove(); + ok(true, '.droppable() called on element'); + + $([]).droppable(); + ok(true, '.droppable() called on empty collection'); + + $("
                                      ").droppable(); + ok(true, '.droppable() called on disconnected DOMElement'); + + $("
                                      ").droppable().droppable("foo"); + ok(true, 'arbitrary method called after init'); + + $("
                                      ").droppable().droppable("option", "foo"); + ok(true, 'arbitrary option getter after init'); + + $("
                                      ").droppable().droppable("option", "foo", "bar"); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + $("
                                      ").appendTo('body').droppable().droppable("destroy").remove(); + ok(true, '.droppable("destroy") called on element'); + + $([]).droppable().droppable("destroy"); + ok(true, '.droppable("destroy") called on empty collection'); + + $("
                                      ").droppable().droppable("destroy"); + ok(true, '.droppable("destroy") called on disconnected DOMElement'); + + $("
                                      ").droppable().droppable("destroy").droppable("foo"); + ok(true, 'arbitrary method called after destroy'); + + var expected = $('
                                      ').droppable(), + actual = expected.droppable('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test("enable", function() { + expect(7); + el = $("#droppable1").droppable({ disabled: true }); + shouldNotBeDroppable(); + el.droppable("enable"); + shouldBeDroppable(); + equals(el.droppable("option", "disabled"), false, "disabled option getter"); + el.droppable("destroy"); + el.droppable({ disabled: true }); + shouldNotBeDroppable(); + el.droppable("option", "disabled", false); + equals(el.droppable("option", "disabled"), false, "disabled option setter"); + shouldBeDroppable(); + + var expected = $('
                                      ').droppable(), + actual = expected.droppable('enable'); + equals(actual, expected, 'enable is chainable'); +}); + +test("disable", function() { + expect(7); + el = $("#droppable1").droppable({ disabled: false }); + shouldBeDroppable(); + el.droppable("disable"); + shouldNotBeDroppable(); + equals(el.droppable("option", "disabled"), true, "disabled option getter"); + el.droppable("destroy"); + el.droppable({ disabled: false }); + shouldBeDroppable(); + el.droppable("option", "disabled", true); + equals(el.droppable("option", "disabled"), true, "disabled option setter"); + shouldNotBeDroppable(); + + var expected = $('
                                      ').droppable(), + actual = expected.droppable('disable'); + equals(actual, expected, 'disable is chainable'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js new file mode 100644 index 0000000..2f2dbf6 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/droppable/droppable_options.js @@ -0,0 +1,68 @@ +/* + * droppable_options.js + */ +(function($) { + +module("droppable: options"); + +test("{ accept '*' }, default ", function() { + equals(droppable_defaults.accept, '*'); + + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ accept: Selector }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ accept: function(draggable) }", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("activeClass", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("{ addClasses: true }, default", function() { + equals(droppable_defaults.addClasses, true); + + el = $("
                                      ").droppable({ addClasses: true }); + ok(el.is(".ui-droppable"), "'ui-droppable' class added"); + el.droppable("destroy"); +}); + +test("{ addClasses: false }", function() { + el = $("
                                      ").droppable({ addClasses: false }); + ok(!el.is(".ui-droppable"), "'ui-droppable' class not added"); + el.droppable("destroy"); +}); + +test("greedy", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("hoverClass", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("scope", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("tolerance, fit", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("tolerance, intersect", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("tolerance, pointer", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +test("tolerance, touch", function() { + ok(false, 'missing test - untested code is broken code'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/all.html new file mode 100644 index 0000000..56890ba --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Effects Test Suite + + + + + + + + + + + + + +

                                      jQuery UI Effects Test Suite

                                      +

                                      +
                                      +

                                      +
                                        +
                                        + +
                                        + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects.html new file mode 100644 index 0000000..06023c5 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects.html @@ -0,0 +1,117 @@ + + + + + jQuery UI Effects Test Suite + + + + + + + + + + + + + + + + + + +

                                        jQuery UI Effects Test Suite

                                        +

                                        +
                                        +

                                        +
                                          +
                                          + +
                                          +

                                          Child Element Test

                                          +
                                          +
                                          +

                                          Slide with relative width

                                          +
                                          +
                                          +
                                          +
                                          +
                                          + +
                                          + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_core.js new file mode 100644 index 0000000..aca4c46 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_core.js @@ -0,0 +1,182 @@ +(function($) { + +function present( value, array, message ) { + QUnit.push( jQuery.inArray( value, array ) !== -1 , value, array, message ); +} + +function notPresent( value, array, message ) { + QUnit.push( jQuery.inArray( value, array ) === -1 , value, array, message ); +} + +// minDuration is used for "short" animate tests where we are only concerned about the final +var minDuration = 15, + + // duration is used for "long" animates where we plan on testing properties during animation + duration = 200, + + // mid is used for testing in the "middle" of the "duration" animations + mid = duration / 2; + +module( "effects.core" ); + +test( "Immediate Return Conditions", function() { + var hidden = $( "div.hidden" ), + count = 0; + expect( 3 ); + hidden.hide( "blind", function() { + equal( ++count, 1, "Hide on hidden returned immediately" ); + }).show().show( "blind", function() { + equal( ++count, 2, "Show on shown returned immediately" ); + }); + equal( ++count, 3, "Both Functions worked properly" ); +}); + +test( "createWrapper and removeWrapper retain focused elements (#7595)", function() { + expect( 2 ); + var test = $( "div.hidden" ).show(), + input = $( "" ).appendTo( test ).focus(); + + $.effects.createWrapper( test ); + equal( document.activeElement, input[ 0 ], "Active element is still input after createWrapper" ); + $.effects.removeWrapper( test ); + equal( document.activeElement, input[ 0 ], "Active element is still input after removeWrapper" ); +}); + + +module( "effects.core: animateClass" ); + +asyncTest( "animateClass works with borderStyle", function() { + var test = $("div.animateClass"), + count = 0; + expect(3); + test.toggleClass("testAddBorder", minDuration, function() { + test.toggleClass("testAddBorder", minDuration, function() { + equal( test.css("borderLeftStyle"), "none", "None border set" ); + start(); + }); + equal( test.css("borderLeftStyle"), "solid", "None border not immedately set" ); + }); + equal( test.css("borderLeftStyle"), "solid", "Solid border immedately set" ); +}); + +asyncTest( "animateClass works with colors", function() { + var test = $("div.animateClass"), + count = 0; + expect(2); + test.toggleClass("testChangeBackground", duration, function() { + present( test.css("backgroundColor"), [ "#ffffff", "#fff", "rgb(255, 255, 255)" ], "Color is final" ); + start(); + }); + setTimeout(function() { + var color = test.css("backgroundColor"); + notPresent( color, [ "#000000", "#ffffff", "#000", "#fff", "rgb(0, 0, 0)", "rgb(255,255,255)" ], + "Color is not endpoints in middle." ); + }, mid); +}); + +asyncTest( "animateClass works with children", function() { + var test = $("div.animateClass"), + h2 = test.find("h2"); + + expect(4); + setTimeout(function() { + notPresent( h2.css("fontSize"), ["10px","20px"], "Font size is neither endpoint when in middle."); + }, mid); + test.toggleClass("testChildren", { children: true, duration: duration, complete: function() { + equal( h2.css("fontSize"), "20px", "Text size is final during complete"); + test.toggleClass("testChildren", duration, function() { + equal( h2.css("fontSize"), "10px", "Text size revertted after class removed"); + + start(); + }); + setTimeout(function() { + equal( h2.css("fontSize"), "20px", "Text size unchanged during animate with children: undefined" ); + }, mid); + }}); +}); + +asyncTest( "animateClass clears style properties when stopped", function() { + var test = $("div.animateClass"), + style = test[0].style, + orig = style.cssText; + + expect( 2 ); + + test.addClass( "testChangeBackground", duration ); + notEqual( orig, style.cssText, "cssText is not the same after starting animation" ); + + test.stop( true, true ); + equal( orig, $.trim( style.cssText ), "cssText is the same after stopping animation midway" ); + start(); +}); + +asyncTest( "animateClass: css and class changes during animation are not lost (#7106)", function() { + var test = $( "div.ticket7106" ); + + // add a class and change a style property after starting an animated class + test.addClass( "animate", minDuration, animationComplete ) + .addClass( "testClass" ) + .height( 100 ); + + // ensure the class stays and that the css property stays + function animationComplete() { + ok( test.hasClass( "testClass" ), "class change during animateClass was not lost" ); + equal( test.height(), 100, "css change during animateClass was not lost" ); + start(); + } +}); + + +$.each( $.effects.effect, function( effect ) { + if ( effect === "transfer" ) { + return; + } + module( "effect."+effect ); + asyncTest( "show/hide", function() { + var hidden = $( "div.hidden" ); + expect( 8 ); + + var count = 0, + test = 0; + + function queueTest( fn ) { + count++; + var point = count; + return function( next ) { + test++; + equal( point, test, "Queue function fired in order" ); + if ( fn ) { + fn(); + } else { + setTimeout( next, minDuration ); + } + }; + } + + hidden.queue( queueTest() ).show( effect, minDuration, queueTest(function() { + equal( hidden.css("display"), "block", "Hidden is shown after .show(\"" +effect+ "\", time)" ); + })).queue( queueTest() ).hide( effect, minDuration, queueTest(function() { + equal( hidden.css("display"), "none", "Back to hidden after .hide(\"" +effect+ "\", time)" ); + })).queue( queueTest(function(next) { + deepEqual( hidden.queue(), ["inprogress"], "Only the inprogress sentinel remains"); + start(); + })); + }); + + asyncTest( "relative width & height - properties are preserved", function() { + var test = $("div.relWidth.relHeight"), + width = test.width(), height = test.height(), + cssWidth = test[0].style.width, cssHeight = test[0].style.height; + + expect( 4 ); + test.toggle( effect, minDuration, function() { + equal( test[0].style.width, cssWidth, "Inline CSS Width has been reset after animation ended" ); + equal( test[0].style.height, cssHeight, "Inline CSS Height has been rest after animation ended" ); + start(); + }); + equal( test.width(), width, "Width is the same px after animation started" ); + equal( test.height(), height, "Height is the same px after animation started" ); + }); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_scale.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_scale.js new file mode 100644 index 0000000..b9bb91c --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/effects/effects_scale.js @@ -0,0 +1,68 @@ +(function( $ ) { +module( "effect.scale: Scale" ); + +function run( position, v, h, vo, ho ) { + var desc = "End Position Correct: " + position + " (" + v + "," + h + ") - origin: (" + vo + "," + ho + ")"; + asyncTest( desc, function() { + var test = $( ".testScale" ), + css = { + position: position + }, + effect = { + effect: "scale", + mode: "effect", + percent: 200, + origin: [ vo, ho ], + complete: complete, + duration: 1 + }, + target = {}, + relative = position === "relative"; + + css[ h ] = 33; + css[ v ] = 33; + target[ h ] = h === ho ? css[ h ] : ho == "center" ? css[ h ] - 35 : css[ h ] - 70; + target[ v ] = v === vo ? css[ v ] : vo == "middle" ? css[ v ] - 35 : css[ v ] - 70; + if ( relative && h == "right" ) { + target[ h ] += 70; + } + if ( relative && v == "bottom" ) { + target[ v ] += 70; + } + test.css( css ); + test.effect( effect ); + + function complete() { + equal( parseInt( test.css( h ), 10 ), target[ h ], "Horizontal Position Correct " + desc ); + equal( parseInt( test.css( v ), 10 ), target[ v ], "Vertical Position Correct " + desc ); + start(); + } + }); +} + +function suite( position ) { + run( position, "top", "left", "top", "left" ); + run( position, "top", "left", "middle", "center" ); + run( position, "top", "left", "bottom", "right" ); + /* Firefox is currently not capable of supporting detection of bottom and right.... + run( position, "bottom", "right", "top", "left" ); + run( position, "bottom", "right", "middle", "center" ); + run( position, "bottom", "right", "bottom", "right" ); + */ +} + +$(function() { + suite( "absolute" ); + suite( "relative" ); + var fixed = $.support.fixedPosition; + // jQuery < 1.7 uses $.offset.supportsFixedPosition + if ( fixed === undefined ) { + $.offset.initialize(); + fixed = $.offset.supportsFixedPosition; + } + if ( fixed ) { + suite( "fixed" ); + } +}); + +})( jQuery ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/images/jqueryui_32x32.png b/src/main/webapp/jquery-ui-1.9pre/tests/unit/images/jqueryui_32x32.png new file mode 100644 index 0000000..e003d16 Binary files /dev/null and b/src/main/webapp/jquery-ui-1.9pre/tests/unit/images/jqueryui_32x32.png differ diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/index.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/index.html new file mode 100644 index 0000000..b73ede2 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/index.html @@ -0,0 +1,96 @@ + + + + + jQuery UI Unit Tests + + + + + + + + + + +
                                          +

                                          jQuery UI Unit Tests

                                          +
                                          +

                                          Full Test Suite

                                          + + +

                                          Core

                                          + + +

                                          Interactions

                                          + + +

                                          Widgets

                                          + + +

                                          Utilities

                                          + + +

                                          Effects

                                          + +
                                          +
                                          + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/all.html new file mode 100644 index 0000000..38b7603 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Menu Test Suite + + + + + + + + + + + + + +

                                          jQuery UI Menu Test Suite

                                          +

                                          +
                                          +

                                          +
                                            +
                                            + +
                                            + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu.html new file mode 100644 index 0000000..76f4a7a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu.html @@ -0,0 +1,258 @@ + + + + + jQuery UI Menu Test Suite + + + + + + + + + + + + + + + + + + + + + + +

                                            jQuery UI Menu Test Suite

                                            +

                                            +
                                            +

                                            +
                                              +
                                              + + + + + + + + + + + +
                                              + +
                                              + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_core.js new file mode 100644 index 0000000..c0feae7 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_core.js @@ -0,0 +1,41 @@ +/* + * menu_core.js + */ + + +(function($) { + +module("menu: core"); + +test("accessibility", function () { + expect(5); + var ac = $('#menu1').menu(); + var item0 = $("li:eq(0) a"); + + ok( ac.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all"), "menu class"); + equals( ac.attr("role"), "menu", "main role"); + ok( !ac.attr("aria-activedescendant"), "aria attribute not yet active"); + + var item = ac.find( "li:first" ).find( "a" ).attr( "id", "xid" ).end(); + ac.menu( "focus", $.Event(), item ); + equals( ac.attr("aria-activedescendant"), "xid", "aria attribute, id from dom"); + + var item = ac.find( "li:last" ); + ac.menu( "focus", $.Event(), item ); + equals( ac.attr("aria-activedescendant"), "menu1-4", "aria attribute, generated id"); +}); + +test("items class and role", function () { + var ac = $('#menu1').menu(); + expect(1 + 5 * $("li",ac).length); + ok( ($("li",ac).length > 0 ), "number of menu items"); + $("li",ac).each(function(item) { + ok( $(this).hasClass("ui-menu-item"), "menu item ("+ item + ") class for item"); + equals( $(this).attr("role"), "presentation", "menu item ("+ item + ") role"); + equals( $("a", this).attr("role"), "menuitem", "menu item ("+ item + ") role"); + ok( $("a",this).hasClass("ui-corner-all"), "a element class for menu item ("+ item + ") "); + equals( $("a",this).attr("tabindex"), "-1", "a element tabindex for menu item ("+ item + ") "); + }); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_defaults.js new file mode 100644 index 0000000..a559a3d --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_defaults.js @@ -0,0 +1,14 @@ +commonWidgetTests( "menu", { + defaults: { + disabled: false, + position: { + my: "left top", + at: "right top" + }, + items: "ul", + trigger: null, + + // callbacks + create: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_events.js new file mode 100644 index 0000000..55ec1e2 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_events.js @@ -0,0 +1,431 @@ +/* + * menu_events.js + */ +(function($) { + +module("menu: events"); + +test("handle click on menu", function() { + expect(1); + var ac = $('#menu1').menu({ + select: function(event, ui) { + menu_log(); + } + }); + menu_log("click",true); + menu_click($('#menu1'),"1"); + menu_log("afterclick"); + menu_click( ac,"2"); + menu_click($('#menu1'),"3"); + menu_click( ac,"1"); + equals( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid."); +}); + +test("handle click on custom item menu", function() { + expect(1); + var ac = $('#menu5').menu({ + select: function(event, ui) { + menu_log(); + }, + items: "div" + }); + menu_log("click",true); + menu_click($('#menu5'),"1"); + menu_log("afterclick"); + menu_click( ac,"2"); + menu_click($('#menu5'),"3"); + menu_click( ac,"1"); + equals( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid."); +}); + +test( "handle blur: click", function() { + expect( 4 ); + var $menu = $( "#menu1" ).menu({ + focus: function( event, ui ) { + equal( event.originalEvent.type, "click", "focus triggered 'click'" ); + equal( event.type, "menufocus", "focus event.type is 'menufocus'" ); + + }, + blur: function( event, ui ) { + equal( event.originalEvent.type, "click", "blur triggered 'click'" ); + equal( event.type, "menublur", "blur event.type is 'menublur'" ); + } + }); + + $menu.find( "li a:first" ).trigger( "click" ); + $( "", { id: "remove"} ).appendTo("body").trigger( "click" ); + + $("#remove").remove(); +}); + +test( "handle blur on custom item menu: click", function() { + expect( 4 ); + var $menu = $( "#menu5" ).menu({ + focus: function( event, ui ) { + equal( event.originalEvent.type, "click", "focus triggered 'click'" ); + equal( event.type, "menufocus", "focus event.type is 'menufocus'" ); + + }, + blur: function( event, ui ) { + equal( event.originalEvent.type, "click", "blur triggered 'click'" ); + equal( event.type, "menublur", "blur event.type is 'menublur'" ); + }, + items: "div" + }); + + menu_click($('#menu5'),"1"); + $( "", { id: "remove"} ).appendTo("body").trigger( "click" ); + + $("#remove").remove(); +}); + +asyncTest( "handle submenu auto collapse: mouseleave", function() { + expect( 4 ); + var $menu = $( "#menu2" ).menu(); + + $menu.find( "li:nth-child(7)" ).trigger( "mouseover" ); + setTimeout(function() { + equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "first submenu expanded" ); + $menu.find( "li:nth-child(7) li:first" ).trigger( "mouseover" ); + setTimeout(function() { + equal( $menu.find( "ul[aria-expanded='true']" ).length, 2, "second submenu expanded" ); + $menu.find( "ul[aria-expanded='true']:first" ).trigger( "mouseleave" ); + equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "second submenu collapsed" ); + $menu.trigger( "mouseleave" ); + equal( $menu.find( "ul[aria-expanded='true']" ).length, 0, "first submenu collapsed" ); + start(); + }, 400); + }, 200); +}); + +asyncTest( "handle custom menu item submenu auto collapse: mouseleave", function() { + expect( 5 ); + var $menu = $( "#menu5" ).menu( { items: "div" } ); + + $menu.children( ":nth-child(7)" ).trigger( "mouseover" ); + setTimeout(function() { + equal( $menu.find( "div[aria-expanded='true']" ).length, 1, "first submenu expanded" ); + $menu.children( ":nth-child(7)" ).find( "div:first" ).children( ":first" ).trigger( "mouseover" ); + setTimeout(function() { + equal( $menu.find( "div[aria-expanded='true']" ).length, 2, "second submenu expanded" ); + $menu.find( "div[aria-expanded='true']:first" ).trigger( "mouseleave" ); + equal( $menu.find( "div[aria-expanded='true']" ).length, 1, "second submenu collapsed" ); + + $menu.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN }); + ok( $menu.find( ".ui-state-active" ).is( "#menu5 :nth-child(7) a" ), + "down keypress selected an item from the first submenu" ); + + $menu.trigger( "mouseleave" ); + equal( $menu.find( "div[aria-expanded='true']" ).length, 0, "first submenu collapsed" ); + start(); + }, 400); + }, 200); +}); + + +test("handle keyboard navigation on menu without scroll and without submenus", function() { + expect(12); + var element = $('#menu1').menu({ + select: function(event, ui) { + menu_log($(ui.item[0]).text()); + }, + focus: function( event, ui ) { + menu_log($(event.target).find(".ui-state-focus").parent().index()); + } + }); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + equals( $("#log").html(), "0,keydown,", "Keydown UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } ); + equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } ); + equals( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "4,keydown,", "Keydown PAGE_DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.END } ); + equals( $("#log").html(), "4,keydown,", "Keydown END"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } ); + equals( $("#log").html(), "0,keydown,", "Keydown HOME"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } ); + equals( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER"); +}); + +asyncTest("handle keyboard navigation on menu without scroll and with submenus", function() { + expect(14); + var element = $('#menu2').menu({ + select: function(event, ui) { + menu_log($(ui.item[0]).text()); + }, + focus: function( event, ui ) { + menu_log($(event.target).find(".ui-state-focus").parent().index()); + } + }); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + equals( $("#log").html(), "0,keydown,", "Keydown UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } ); + equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } ); + + setTimeout( function() { + equals( $("#log").html(), "0,4,3,2,1,keydown,", "Keydown RIGHT (open submenu)"); + }, 50); + + setTimeout( function() { + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } ); + equals( $("#log").html(), "4,keydown,", "Keydown LEFT (close submenu)"); + + //re-open submenu + element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } ); + + setTimeout( function() { + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "2,keydown,", "Keydown PAGE_DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.END } ); + equals( $("#log").html(), "2,keydown,", "Keydown END"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } ); + equals( $("#log").html(), "0,keydown,", "Keydown HOME"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } ); + equals( $("#log").html(), "4,keydown,", "Keydown ESCAPE (close submenu)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + + setTimeout( function() { + equals( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + equals( $("#log").html(), "Ada,keydown,", "Keydown ENTER (select item)"); + + start(); + }, 200); + }, 150); + }, 100); + +}); + +test("handle keyboard navigation on menu with scroll and without submenus", function() { + expect(14); + var element = $('#menu3').menu({ + select: function(event, ui) { + menu_log($(ui.item[0]).text()); + }, + focus: function( event, ui ) { + menu_log($(event.target).find(".ui-state-focus").parent().index()); + } + }); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + equals( $("#log").html(), "0,keydown,", "Keydown UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } ); + equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } ); + equals( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "10,keydown,", "Keydown PAGE_UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.END } ); + equals( $("#log").html(), "37,keydown,", "Keydown END"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } ); + equals( $("#log").html(), "0,keydown,", "Keydown HOME"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } ); + equals( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER"); +}); + +asyncTest("handle keyboard navigation on menu with scroll and with submenus", function() { + expect(14); + var element = $('#menu4').menu({ + select: function(event, ui) { + menu_log($(ui.item[0]).text()); + }, + focus: function( event, ui ) { + menu_log($(event.target).find(".ui-state-focus").parent().index()); + } + }); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + equals( $("#log").html(), "0,keydown,", "Keydown UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } ); + equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } ); + + setTimeout( function() { + equals( $("#log").html(), "0,1,keydown,", "Keydown RIGHT (open submenu)"); + }, 50); + + setTimeout( function() { + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } ); + equals( $("#log").html(), "1,keydown,", "Keydown LEFT (close submenu)"); + + //re-open submenu + element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } ); + + setTimeout( function() { + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } ); + equals( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "10,keydown,", "Keydown PAGE_UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } ); + equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.END } ); + equals( $("#log").html(), "27,keydown,", "Keydown END"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } ); + equals( $("#log").html(), "0,keydown,", "Keydown HOME"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } ); + equals( $("#log").html(), "1,keydown,", "Keydown ESCAPE (close submenu)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + + setTimeout( function() { + equals( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)"); + + menu_log("keydown",true); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER (select item)"); + + start(); + }, 200); + }, 150); + }, 100); + +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_methods.js new file mode 100644 index 0000000..0ecaf73 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_methods.js @@ -0,0 +1,15 @@ +/* + * menu_methods.js + */ +(function($) { + +module("menu: methods"); + +test("destroy", function() { + domEqual("#menu1", function() { + $("#menu1").menu().menu("destroy"); + }); +}); + + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_options.js new file mode 100644 index 0000000..03822fd --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_options.js @@ -0,0 +1,10 @@ +/* + * menu_options.js + */ +(function($) { + +module("menu: options"); + + + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_test_helpers.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_test_helpers.js new file mode 100644 index 0000000..e83795e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/menu/menu_test_helpers.js @@ -0,0 +1,14 @@ +function menu_log( message, clear ) { + if ( clear ) { + $( "#log" ).empty(); + } + if ( message === undefined ) { + message = $( "#log" ).data( "lastItem" ); + } + $( "#log" ).prepend( $.trim( message ) + "," ); +} + +function menu_click( menu, item ) { + $( "#log" ).data( "lastItem", item ); + menu.children( ":eq(" + item + ")" ).find( "a:first" ).trigger( "click" ); +} \ No newline at end of file diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/all.html new file mode 100644 index 0000000..07676f1 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Position Test Suite + + + + + + + + + + + + + +

                                              jQuery UI Position Test Suite

                                              +

                                              +
                                              +

                                              +
                                                +
                                                + +
                                                + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position.html new file mode 100644 index 0000000..115adc3 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position.html @@ -0,0 +1,75 @@ + + + + + jQuery UI Position Test Suite + + + + + + + + + + + + + + + + + +
                                                +

                                                jQuery UI Position Test Suite

                                                +

                                                +
                                                +

                                                +
                                                  +
                                                +
                                                + + + +
                                                +
                                                +
                                                +
                                                +
                                                + +
                                                +
                                                +
                                                +
                                                + +
                                                +
                                                +
                                                +
                                                +
                                                +
                                                +
                                                + +
                                                + +
                                                +
                                                +
                                                +
                                                + +
                                                +
                                                +
                                                +
                                                + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core.js new file mode 100644 index 0000000..ea1baee --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core.js @@ -0,0 +1,547 @@ +(function( $ ) { + +function scrollTopSupport() { + $( window ).scrollTop( 1 ); + return $( window ).scrollTop() === 1; +} + +module( "position" ); + +test( "my, at, of", function() { + $( "#elx" ).position({ + my: "left top", + at: "left top", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 40, left: 40 }, "left top, left top" ); + + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 60, left: 40 }, "left top, left bottom" ); + + $( "#elx" ).position({ + my: "left", + at: "bottom", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 55, left: 50 }, "left, bottom" ); + + $( "#elx" ).position({ + my: "left foo", + at: "bar baz", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 45, left: 50 }, "left foo, bar baz" ); +}); + +test( "multiple elements", function() { + var elements = $( "#el1, #el2" ); + var result = elements.position({ + my: "left top", + at: "left bottom", + of: "#parent", + collision: "none" + }); + + same( result, elements ); + var expected = { top: 10, left: 4 }; + elements.each(function() { + same( $( this ).offset(), expected ); + }); +}); + +test( "positions", function() { + var definitions = []; + var offsets = { + left: 0, + center: 3, + right: 6, + top: 0, + bottom: 6 + }; + var start = { left: 4, top: 4 }; + $.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 el = $( "#el1" ); + $.each( definitions, function( index, definition ) { + el.position({ + my: definition.my, + at: definition.at, + of: "#parent", + collision: "none" + }); + same( el.offset(), definition.result, + "Position via " + QUnit.jsDump.parse({ my:definition.my, at:definition.at }) ); + }); +}); + +test( "of", function() { + $( "#elx" ).position({ + my: "left top", + at: "left top", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 40, left: 40 }, "selector" ); + + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: $( "#parentx"), + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 60, left: 40 }, "jQuery object" ); + + $( "#elx" ).position({ + my: "left top", + at: "left top", + of: $( "#parentx" )[ 0 ], + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 40, left: 40 }, "DOM element" ); + + $( "#elx" ).position({ + my: "right bottom", + at: "right bottom", + of: document, + collision: "none" + }); + same( $( "#elx" ).offset(), { + top: $( document ).height() - 10, + left: $( document ).width() - 10 + }, "document" ); + + $( "#elx" ).position({ + my: "right bottom", + at: "right bottom", + of: $( document ), + collision: "none" + }); + same( $( "#elx" ).offset(), { + top: $( document ).height() - 10, + left: $( document ).width() - 10 + }, "document as jQuery object" ); + + $( window ).scrollTop( 0 ); + + $( "#elx" ).position({ + my: "right bottom", + at: "right bottom", + of: window, + collision: "none" + }); + same( $( "#elx" ).offset(), { + top: $( window ).height() - 10, + left: $( window ).width() - 10 + }, "window" ); + + $( "#elx" ).position({ + my: "right bottom", + at: "right bottom", + of: $( window ), + collision: "none" + }); + same( $( "#elx" ).offset(), { + top: $( window ).height() - 10, + left: $( window ).width() - 10 + }, "window as jQuery object" ); + + if ( scrollTopSupport() ) { + $( window ).scrollTop( 500 ).scrollLeft( 200 ); + $( "#elx" ).position({ + my: "right bottom", + at: "right bottom", + of: window, + collision: "none" + }); + same( $( "#elx" ).offset(), { + top: $( window ).height() + 500 - 10, + left: $( window ).width() + 200 - 10 + }, "window, scrolled" ); + $( window ).scrollTop( 0 ).scrollLeft( 0 ); + } + + var event = $.extend( $.Event( "someEvent" ), { pageX: 200, pageY: 300 } ); + $( "#elx" ).position({ + my: "left top", + at: "left top", + of: event, + collision: "none" + }); + same( $( "#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" + }); + same( $( "#elx" ).offset(), { + top: 600, + left: 400 + }, "event - left top, right bottom" ); +}); + +test( "offsets", function() { + $( "#elx" ).position({ + my: "left top", + at: "left+10 bottom+10", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 70, left: 50 }, "offsets in at" ); + + $( "#elx" ).position({ + my: "left+10 top-10", + at: "left bottom", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 50, left: 50 }, "offsets in my" ); + + $( "#elx" ).position({ + my: "left top", + at: "left+50% bottom-10%", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 58, left: 50 }, "percentage offsets in at" ); + + $( "#elx" ).position({ + my: "left-30% top+50%", + at: "left bottom", + of: "#parentx", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 65, left: 37 }, "percentage offsets in my" ); +}); + +test( "using", function() { + expect( 6 ); + + var count = 0, + elems = $( "#el1, #el2" ), + expectedPosition = { top: 40, left: 40 }, + originalPosition = elems.position({ + my: "right bottom", + at: "rigt bottom", + of: "#parentx", + collision: "none" + }).offset(); + + elems.position({ + my: "left top", + at: "left top", + of: "#parentx", + using: function( position ) { + same( this, elems[ count ], "correct context for call #" + count ); + same( position, expectedPosition, "correct position for call #" + count ); + count++; + } + }); + + elems.each(function() { + same( $( this ).offset(), originalPosition, "elements not moved" ); + }); +}); + +function collisionTest( config, result, msg ) { + var elem = $( "#elx" ).position( $.extend({ + my: "left top", + at: "right bottom", + of: window + }, config ) ); + same( elem.offset(), result, msg ); +} + +function collisionTest2( config, result, msg ) { + collisionTest( $.extend({ + my: "right bottom", + at: "left top" + }, config ), result, msg ); +} + +test( "collision: fit, no offset", function() { + collisionTest({ + collision: "fit" + }, { top: $( window ).height() - 10, left: $( window ).width() - 10 }, "right bottom" ); + + collisionTest2({ + collision: "fit" + }, { top: 0, left: 0 }, "left top" ); +}); + +test( "collision: fit, with offset", function() { + collisionTest({ + collision: "fit", + at: "right+2 bottom+3" + }, { top: $(window).height() - 10, left: $(window).width() - 10 }, "right bottom"); + + collisionTest2({ + collision: "fit", + at: "left+2 top+3" + }, { top: 0, left: 0 }, "left top, positive offset" ); + + collisionTest2({ + collision: "fit", + at: "left-2 top-3" + }, { top: 0, left: 0 }, "left top, negative 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" ); + + win.scrollTop( 0 ).scrollLeft( 0 ); + } +}); + +test( "collision: flip, no offset", function() { + collisionTest({ + collision: "flip" + }, { top: $( window ).height(), left: $( window ).width() }, "left top" ); + + collisionTest2({ + collision: "flip" + }, { top: -10, left: -10 }, "right bottom" ); +}); + +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" ); + + collisionTest2({ + collision: "flip", + at: "left+2 top+3" + }, { top: -7, left: -8 }, "bottom, positive offset" ); + + collisionTest2({ + collision: "flip", + at: "left-2 top-3" + }, { top: -13, left: -12 }, "right bottom, negative offset" ); +}); + +test( "collision: none, no offset", function() { + collisionTest({ + collision: "none" + }, { top: $( window ).height(), left: $( window ).width() }, "left top" ); + + collisionTest2({ + collision: "none" + }, { top: -10, left: -10 }, "moved to the right bottom" ); +}); + +test( "collision: none, with offset", function() { + collisionTest({ + collision: "none", + at: "right+2 bottom+3" + }, { top: $( window ).height() + 3, left: $( window ).width() + 2 }, "right bottom, with offset added" ); + + collisionTest2({ + collision: "none", + at: "left+2 top+3" + }, { top: -7, left: -8 }, "left top, positive offset" ); + + collisionTest2({ + collision: "none", + at: "left-2 top-3" + }, { top: -13, left: -12 }, "left top, negative offset" ); +}); + +test( "collision: fit, with margin", function() { + $( "#elx" ).css( "margin", 10 ); + + collisionTest({ + collision: "fit" + }, { top: $( window ).height() - 20, left: $( window ).width() - 20 }, "right bottom" ); + + collisionTest2({ + collision: "fit" + }, { top: 10, left: 10 }, "left top" ); + + $( "#elx" ).css({ + "margin-left": 5, + "margin-top": 5 + }); + + collisionTest({ + collision: "fit" + }, { top: $( window ).height() - 20, left: $( window ).width() - 20 }, "right bottom" ); + + collisionTest2({ + collision: "fit" + }, { top: 5, left: 5 }, "left top" ); + + $( "#elx" ).css({ + "margin-right": 15, + "margin-bottom": 15 + }); + + collisionTest({ + collision: "fit" + }, { top: $( window ).height() - 25, left: $( window ).width() - 25 }, "right bottom" ); + + collisionTest2({ + collision: "fit" + }, { top: 5, left: 5 }, "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" + }); + + same( elem.hasClass( 'ui-flipped-left' ), false, 'Has ui-flipped-left class' ); + + elem.position( { + my: "right center", + of: window, + collision: "flip", + at: "left center" + }) + + same( 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" + }); + + same( elem.hasClass( 'ui-flipped-top' ), false, 'Has ui-flipped-top class' ); + + elem.position( { + my: "left bottom", + of: window, + collision: "flip", + at: "right top" + }); + + same( elem.hasClass( 'ui-flipped-top' ), false, 'Removed ui-flipped-top class' ); +}); + +test( "addClass: flipped right", function() { + var elem = $( "#elx" ).position( { + my: "right center", + of: window, + collision: "flip", + at: "left center" + }); + + same( elem.hasClass( 'ui-flipped-right' ), false, 'Has ui-flipped-right class' ); + + elem.position( { + my: "left center", + of: window, + collision: "flip", + at: "right center" + }); + + same( elem.hasClass( 'ui-flipped-right' ), false, 'Removed ui-flipped-right class' ); + +}); + +test( "addClass: flipped bottom", function() { + var elem = $( "#elx" ).position( { + my: "left bottom", + of: window, + collision: "flip", + at: "right top" + }); + + same( elem.hasClass( 'ui-flipped-bottom' ), false, 'Has ui-flipped-bottom class' ); + + elem.position( { + my: "left top", + of: window, + collision: "flip", + at: "right bottom" + }); + + same( elem.hasClass( 'ui-flipped-bottom' ), false, 'Removed ui-flipped-bottom class' ); +}); + +test( "fractions", function() { + $( "#fractions-element" ).position({ + my: "left top", + at: "left top", + of: "#fractions-parent", + collision: "none" + }); + same( $( "#fractions-element" ).offset(), $( "#fractions-parent" ).offset(), "left top, left top" ); +}); + +test( "bug #5280: consistent results (avoid fractional values)", function() { + var wrapper = $( "#bug-5280" ), + elem = wrapper.children(), + offset1 = elem.position({ + my: "center", + at: "center", + of: wrapper, + collision: "none" + }).offset(), + offset2 = elem.position({ + my: "center", + at: "center", + of: wrapper, + collision: "none" + }).offset(); + same( offset1, offset2 ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core_within.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core_within.js new file mode 100644 index 0000000..392e409 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_core_within.js @@ -0,0 +1,545 @@ +(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 + }); + same( $( "#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 + }); + same( $( "#elx" ).addOffsets(), { top: addTop + 60, left: addLeft + 40 }, "left top, left bottom" ); + + $( "#elx" ).position({ + my: "left", + at: "bottom", + of: "#parentx", + collision: "none", + within: within + }); + same( $( "#elx" ).addOffsets(), { top: addTop + 55, left: addLeft + 50 }, "left, bottom" ); + + $( "#elx" ).position({ + my: "left foo", + at: "bar baz", + of: "#parentx", + collision: "none", + within: within + }); + same( $( "#elx" ).addOffsets(), { top: addTop + 45, left: addLeft +50 }, "left foo, bar baz" ); +}); + +test( "multiple elements", function() { + var elements = $( "#el1, #el2" ); + var result = elements.position({ + my: "left top", + at: "left bottom", + of: "#parent", + collision: "none", + within: $("#within-container") + }); + + same( result, elements ); + var expected = { top: addTop + 10, left: addLeft + 4 }; + elements.each(function() { + same( $( this ).addOffsets(), expected ); + }); +}); + +test( "positions", function() { + var definitions = []; + var offsets = { + left: 0, + center: 3, + right: 6, + top: 0, + bottom: 6 + }; + var start = { left: 4, top: 4 }; + $.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 ]) + } + }); + }); + }); + }); + var el = $( "#el1" ); + $.each( definitions, function( index, definition ) { + el.position({ + my: definition.my, + at: definition.at, + of: "#parent", + collision: "none", + within: $("#within-container") + }); + same( el.addOffsets(), definition.result, + "Position via " + QUnit.jsDump.parse({ my:definition.my, at:definition.at }) ); + }); +}); + +test( "of", function() { + var within = $("#within-container"); + + $( "#elx" ).position({ + my: "left top", + at: "left top", + of: "#parentx", + collision: "none", + within: within + }); + same( $( "#elx" ).addOffsets(), { top: addTop + 40, left: addLeft + 40 }, "selector" ); + + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: $( "#parentx"), + collision: "none", + within: within + }); + same( $( "#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 + }); + same( $( "#elx" ).addOffsets(), { top: addTop + 40, left: addLeft + 40 }, "DOM element" ); + + var event = $.extend( $.Event( "someEvent" ), { pageX: 200, pageY: 300 } ); + $( "#elx" ).position({ + my: "left top", + at: "left top", + of: event, + collision: "none", + within: within + }); + same( $( "#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 + }); + same( $( "#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 + }); + same( $( "#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 + }); + same( $( "#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 + }); + same( $( "#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 + }); + same( $( "#elx" ).addOffsets(), { top: addTop + 65, left: addLeft + 37 }, "percentage offsets in my" ); +}); + +test( "using", function() { + expect( 6 ); + + var within = $("#within-container"); + + var 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; + same( this, elems[ count ], "correct context for call #" + count ); + same( position, expectedPosition, "correct position for call #" + count ); + count++; + }, + within: within + }); + + elems.each(function() { + same( $( this ).addOffsets(), originalPosition, "elements not moved" ); + }); +}); + +function collisionTest( config, result, msg ) { + var within = $("#within-container"); + + var elem = $( "#elx" ).position( $.extend({ + my: "left top", + at: "right bottom", + of: "#parentx", + within: within + }, config ) ); + + same( 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( within ).height, left: addLeft + of.position().left + of.width() - $.position.getScrollInfo( 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( within ).height, left: addLeft + of.position().left + of.width() - $.position.getScrollInfo( 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( within ).height, left: addLeft + of.position().left + of.width() - 10 - $.position.getScrollInfo( 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( within ).height, left: addLeft + of.position().left + of.width() - 10 - $.position.getScrollInfo( 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( within ).height, left: addLeft + of.position().left + of.width() - 15 - $.position.getScrollInfo( 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"); + + var elem = $( "#elx" ).position( { + my: "left center", + of: within[0], + within: within, + collision: "flip", + at: "right center" + }); + + same( 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" + }) + + same( elem.hasClass( 'ui-flipped-left' ), false, 'Removed ui-flipped-left class' ); +}); + +test( "addClass: flipped top", function() { + var within = $("#within-container"); + + var elem = $( "#elx" ).position( { + my: "left top", + of: within[0], + within: within, + collision: "flip", + at: "right bottom" + }); + + same( 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" + }); + + same( elem.hasClass( 'ui-flipped-top' ), false, 'Removed ui-flipped-top class' ); +}); + +test( "addClass: flipped right", function() { + var within = $("#within-container"); + + var elem = $( "#elx" ).position( { + my: "right center", + of: within[0], + within: within, + collision: "flip", + at: "left center" + }); + + same( 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" + }); + + same( elem.hasClass( 'ui-flipped-right' ), false, 'Removed ui-flipped-right class' ); + +}); + +test( "addClass: flipped bottom", function() { + var within = $("#within-container"); + + var elem = $( "#elx" ).position( { + my: "left bottom", + of: window, + collision: "flip", + at: "right top" + }); + + same( elem.hasClass( 'ui-flipped-bottom' ), false, 'Has ui-flipped-bottom class' ); + + elem.position( { + my: "left top", + of: window, + collision: "flip", + at: "right bottom" + }); + + same( elem.hasClass( 'ui-flipped-bottom' ), false, 'Removed ui-flipped-bottom class' ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.html new file mode 100644 index 0000000..ee9be18 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.html @@ -0,0 +1,68 @@ + + + + + jQuery UI Position Test Suite + + + + + + + + + + + + + + + + + +

                                                jQuery UI Position Test Suite

                                                +

                                                +
                                                +

                                                +
                                                  + + + +
                                                  +
                                                  +
                                                  +
                                                  +
                                                  + +
                                                  +
                                                  +
                                                  +
                                                  + +
                                                  +
                                                  +
                                                  +
                                                  +
                                                  +
                                                  +
                                                  + +
                                                  + +
                                                  +
                                                  +
                                                  + +
                                                  +
                                                  +
                                                  + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.js new file mode 100644 index 0000000..3e72c4a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/position/position_deprecated.js @@ -0,0 +1,32 @@ +(function( $ ) { + +test( "offset", function() { + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: "#parentx", + offset: "10", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 70, left: 50 }, "single value" ); + + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: "#parentx", + offset: "5 -3", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 57, left: 45 }, "two values" ); + + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: "#parentx", + offset: "5px -3px", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 57, left: 45 }, "with units" ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/all.html new file mode 100644 index 0000000..52c1950 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Progressbar Test Suite + + + + + + + + + + + + + +

                                                  jQuery UI Progressbar Test Suite

                                                  +

                                                  +
                                                  +

                                                  +
                                                    +
                                                    + +
                                                    + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar.html new file mode 100644 index 0000000..8b55f5a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar.html @@ -0,0 +1,46 @@ + + + + + jQuery UI Progressbar Test Suite + + + + + + + + + + + + + + + + + + + + +

                                                    jQuery UI Progressbar Test Suite

                                                    +

                                                    +
                                                    +

                                                    +
                                                      +
                                                      + +
                                                      + +
                                                      + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_core.js new file mode 100644 index 0000000..a499d85 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_core.js @@ -0,0 +1,28 @@ +/* + * progressbar_core.js + */ + +var el; + +(function($) { + +module("progressbar: core"); + +test("accessibility", function() { + expect(7); + el = $("#progressbar").progressbar(); + + equals(el.attr("role"), "progressbar", "aria role"); + equals(el.attr("aria-valuemin"), 0, "aria-valuemin"); + equals(el.attr("aria-valuemax"), 100, "aria-valuemax"); + equals(el.attr("aria-valuenow"), 0, "aria-valuenow initially"); + el.progressbar("value", 77); + equals(el.attr("aria-valuenow"), 77, "aria-valuenow"); + el.progressbar("disable"); + equals(el.attr("aria-disabled"), "true", "aria-disabled on"); + el.progressbar("enable"); + // FAIL: for some reason IE6 and 7 return a boolean false instead of the string + equals(el.attr("aria-disabled"), "false", "aria-disabled off"); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_defaults.js new file mode 100644 index 0000000..3856e31 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_defaults.js @@ -0,0 +1,10 @@ +commonWidgetTests( "progressbar", { + defaults: { + disabled: false, + value: 0, + max: 100, + + //callbacks + create: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js new file mode 100644 index 0000000..585c090 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_events.js @@ -0,0 +1,51 @@ +/* + * progressbar_events.js + */ +(function($) { + +module("progressbar: events"); + +test("create", function() { + expect(1); + $("#progressbar").progressbar({ + value: 5, + create: function() { + same(5, $(this).progressbar("value") ); + }, + change: function() { + ok(false, 'create() has triggered change()'); + } + }) +}); + +test("change", function() { + expect(1); + $("#progressbar").progressbar({ + change: function() { + same( 5, $(this).progressbar("value") ); + } + }).progressbar("value", 5); +}); + +test( "complete", function() { + expect( 3 ); + var changes = 0, + value; + + $( "#progressbar" ).progressbar({ + change: function() { + changes++; + same( $( this ).progressbar( "value" ), value, "change at " + value ); + }, + complete: function() { + equal( changes, 2, "complete triggered after change" ); + } + }); + + value = 5; + $( "#progressbar" ).progressbar( "value", value ); + value = 100; + $( "#progressbar" ).progressbar( "value", value ); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js new file mode 100644 index 0000000..a48fa3d --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js @@ -0,0 +1,36 @@ +/* + * progressbar_methods.js + */ +(function($) { + +module("progressbar: methods"); + +test("init", function() { + expect(1); + + $("
                                                      ").appendTo('body').progressbar().remove(); + ok(true, '.progressbar() called on element'); + +}); + +test("destroy", function() { + expect(2); + + $("
                                                      ").appendTo('body').progressbar().progressbar("destroy").remove(); + ok(true, '.progressbar("destroy") called on element'); + + var expected = $('
                                                      ').progressbar(), + actual = expected.progressbar('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test('value', function() { + expect(3); + + var el = $('
                                                      ').progressbar({ value: 20 }); + equals(el.progressbar('value'), 20, 'correct value as getter'); + equals(el.progressbar('value', 30), el, 'chainable as setter'); + equals(el.progressbar('option', 'value'), 30, 'correct value after setter'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js new file mode 100644 index 0000000..230c939 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js @@ -0,0 +1,59 @@ +/* + * progressbar_options.js + */ +(function($) { + +module("progressbar: options"); + +test("{ value : 0 }, default", function() { + $("#progressbar").progressbar(); + same( 0, $("#progressbar").progressbar("value") ); +}); + +// Ticket #7231 - valueDiv should be hidden when value is at 0% +test( "value: visibility of valueDiv", function() { + expect( 5 ); + var element = $( "#progressbar" ).progressbar({ + value: 0 + }); + ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is initialized at 0" ); + element.progressbar( "value", 1 ); + ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 1" ); + element.progressbar( "value", 100 ); + ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 100" ); + element.progressbar( "value", 0 ); + ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is set to 0" ); + element.progressbar( "value", -1 ); + ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value set to -1 (normalizes to 0)" ); +}); + +test("{ value : 5 }", function() { + $("#progressbar").progressbar({ + value: 5 + }); + same( 5, $("#progressbar").progressbar("value") ); +}); + +test("{ value : -5 }", function() { + $("#progressbar").progressbar({ + value: -5 + }); + same( 0, $("#progressbar").progressbar("value") ); +}); + +test("{ value : 105 }", function() { + $("#progressbar").progressbar({ + value: 105 + }); + same( 100, $("#progressbar").progressbar("value") ); +}); + +test("{ max : 5, value : 10 }", function() { + $("#progressbar").progressbar({ + max: 5, + value: 10 + }); + same( 5, $("#progressbar").progressbar("value") ); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/all.html new file mode 100644 index 0000000..2f56d02 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Resizable Test Suite + + + + + + + + + + + + + +

                                                      jQuery UI Resizable Test Suite

                                                      +

                                                      +
                                                      +

                                                      +
                                                        +
                                                        + +
                                                        + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/images/test.jpg b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/images/test.jpg new file mode 100644 index 0000000..0175b13 Binary files /dev/null and b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/images/test.jpg differ diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable.html new file mode 100644 index 0000000..4e886d2 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable.html @@ -0,0 +1,58 @@ + + + + + jQuery UI Resizable Test Suite + + + + + + + + + + + + + + + + + + + + + +

                                                        jQuery UI Resizable Test Suite

                                                        +

                                                        +
                                                        +

                                                        +
                                                          +
                                                          + +
                                                          I'm a resizable.
                                                          + + +
                                                          + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_core.js new file mode 100644 index 0000000..33a3f72 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_core.js @@ -0,0 +1,148 @@ +/* + * resizable_core.js + */ + +var el; + +var drag = function(el, dx, dy, complete) { + + // speed = sync -> Drag syncrhonously. + // speed = fast|slow -> Drag asyncrhonously - animated. + + //this mouseover is to work around a limitation in resizable + //TODO: fix resizable so handle doesn't require mouseover in order to be used + $(el).simulate("mouseover"); + + return $(el).simulate("drag", { + dx: dx||0, dy: dy||0, speed: 'sync', complete: complete + }); +}; + +(function($) { + +module("resizable: core"); + +/* +test("element types", function() { + var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form' + + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr' + + ',acronym,code,samp,kbd,var,img,object,hr' + + ',input,button,label,select,iframe').split(','); + + $.each(typeNames, function(i) { + var typeName = typeNames[i]; + el = $(document.createElement(typeName)).appendTo('body'); + (typeName == 'table' && el.append("content")); + el.resizable(); + ok(true, '$("<' + typeName + '/>").resizable()'); + el.resizable("destroy"); + el.remove(); + }); +}); +*/ + +test("n", function() { + expect(2); + + var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ handles: 'all' }); + + drag(handle, 0, -50); + equals( target.height(), 150, "compare height" ); + + drag(handle, 0, 50); + equals( target.height(), 100, "compare height" ); +}); + +test("s", function() { + expect(2); + + var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ handles: 'all' }); + + drag(handle, 0, 50); + equals( target.height(), 150, "compare height" ); + + drag(handle, 0, -50); + equals( target.height(), 100, "compare height" ); +}); + +test("e", function() { + expect(2); + + var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ handles: 'all' }); + + drag(handle, 50); + equals( target.width(), 150, "compare width"); + + drag(handle, -50); + equals( target.width(), 100, "compare width" ); +}); + +test("w", function() { + expect(2); + + var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ handles: 'all' }); + + drag(handle, -50); + equals( target.width(), 150, "compare width" ); + + drag(handle, 50); + equals( target.width(), 100, "compare width" ); +}); + +test("ne", function() { + expect(4); + + var handle = '.ui-resizable-ne', target = $('#resizable1').css({ overflow: 'hidden' }).resizable({ handles: 'all' }); + + drag(handle, -50, -50); + equals( target.width(), 50, "compare width" ); + equals( target.height(), 150, "compare height" ); + + drag(handle, 50, 50); + equals( target.width(), 100, "compare width" ); + equals( target.height(), 100, "compare height" ); +}); + +test("se", function() { + expect(4); + + var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all' }); + + drag(handle, 50, 50); + equals( target.width(), 150, "compare width" ); + equals( target.height(), 150, "compare height" ); + + drag(handle, -50, -50); + equals( target.width(), 100, "compare width" ); + equals( target.height(), 100, "compare height" ); +}); + +test("sw", function() { + expect(4); + + var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all' }); + + drag(handle, -50, -50); + equals( target.width(), 150, "compare width" ); + equals( target.height(), 50, "compare height" ); + + drag(handle, 50, 50); + equals( target.width(), 100, "compare width" ); + equals( target.height(), 100, "compare height" ); +}); + +test("nw", function() { + expect(4); + + var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all' }); + + drag(handle, -50, -50); + equals( target.width(), 150, "compare width" ); + equals( target.height(), 150, "compare height" ); + + drag(handle, 50, 50); + equals( target.width(), 100, "compare width" ); + equals( target.height(), 100, "compare height" ); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_defaults.js new file mode 100644 index 0000000..f69e521 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_defaults.js @@ -0,0 +1,28 @@ +/* + * resizable_defaults.js + */ + +var resizable_defaults = { + alsoResize: false, + animate: false, + animateDuration: 'slow', + animateEasing: 'swing', + aspectRatio: false, + autoHide: false, + cancel: ':input,option', + containment: false, + delay: 0, + disabled: false, + distance: 1, + ghost: false, + grid: false, + handles: 'e,s,se', + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 +}; + +commonWidgetTests('resizable', { defaults: resizable_defaults }); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_events.js new file mode 100644 index 0000000..e8041f0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_events.js @@ -0,0 +1,20 @@ +/* + * resizable_events.js + */ +(function($) { + +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/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js new file mode 100644 index 0000000..6ac287f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_methods.js @@ -0,0 +1,64 @@ +/* + * resizable_methods.js + */ +(function($) { + +module("resizable: methods"); + +test("init", function() { + expect(6); + + $("
                                                          ").appendTo('body').resizable().remove(); + ok(true, '.resizable() called on element'); + + $([]).resizable().remove(); + ok(true, '.resizable() called on empty collection'); + + $('
                                                          ').resizable().remove(); + ok(true, '.resizable() called on disconnected DOMElement'); + + $('
                                                          ').resizable().resizable("foo").remove(); + ok(true, 'arbitrary method called after init'); + + el = $('
                                                          ').resizable() + var foo = el.resizable("option", "foo"); + el.remove(); + ok(true, 'arbitrary option getter after init'); + + $('
                                                          ').resizable().resizable("option", "foo", "bar").remove(); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + $("
                                                          ").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'); + + $('
                                                          ').resizable().resizable("destroy").remove(); + ok(true, '.resizable("destroy") called on disconnected DOMElement'); + + $('
                                                          ').resizable().resizable("destroy").resizable("foo").remove(); + ok(true, 'arbitrary method called after destroy'); + + var expected = $('
                                                          ').resizable(), + actual = expected.resizable('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test("enable", function() { + var expected = $('
                                                          ').resizable(), + actual = expected.resizable('enable'); + equals(actual, expected, 'enable is chainable'); + ok(false, "missing test - untested code is broken code."); +}); + +test("disable", function() { + var expected = $('
                                                          ').resizable(), + actual = expected.resizable('disable'); + equals(actual, expected, 'disable is chainable'); + ok(false, "missing test - untested code is broken code."); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_options.js new file mode 100644 index 0000000..389931f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/resizable/resizable_options.js @@ -0,0 +1,190 @@ +/* + * resizable_options.js + */ +(function($) { + +module("resizable: options"); + +test("aspectRatio: 'preserve' (e)", function() { + expect(4); + + var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); + + drag(handle, 80); + equals( target.width(), 130, "compare maxWidth"); + equals( target.height(), 130, "compare maxHeight"); + + drag(handle, -130); + equals( target.width(), 70, "compare minWidth"); + equals( target.height(), 70, "compare minHeight"); +}); + +test("aspectRatio: 'preserve' (w)", function() { + expect(4); + + var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); + + drag(handle, -80); + equals( target.width(), 130, "compare maxWidth"); + equals( target.height(), 130, "compare maxHeight"); + + drag(handle, 130); + equals( target.width(), 70, "compare minWidth"); + equals( target.height(), 70, "compare minHeight"); +}); + +test("aspectRatio: 'preserve' (n)", function() { + expect(4); + + var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); + + drag(handle, 0, -80); + equals( target.width(), 130, "compare maxWidth"); + equals( target.height(), 130, "compare maxHeight"); + + drag(handle, 0, 80); + equals( target.width(), 70, "compare minWidth"); + equals( target.height(), 70, "compare minHeight"); +}); + +test("aspectRatio: 'preserve' (s)", function() { + expect(4); + + var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); + + drag(handle, 0, 80); + equals( target.width(), 130, "compare maxWidth"); + equals( target.height(), 130, "compare maxHeight"); + + drag(handle, 0, -80); + equals( target.width(), 70, "compare minWidth"); + equals( target.height(), 70, "compare minHeight"); +}); + +test("aspectRatio: 'preserve' (se)", function() { + expect(4); + + var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); + + drag(handle, 80, 80); + equals( target.width(), 130, "compare maxWidth"); + equals( target.height(), 130, "compare maxHeight"); + + drag(handle, -80, -80); + equals( target.width(), 70, "compare minWidth"); + equals( target.height(), 70, "compare minHeight"); +}); + +test("aspectRatio: 'preserve' (sw)", function() { + expect(4); + + var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); + + drag(handle, -80, 80); + equals( target.width(), 130, "compare maxWidth"); + equals( target.height(), 130, "compare maxHeight"); + + drag(handle, 80, -80); + equals( target.width(), 70, "compare minWidth"); + equals( target.height(), 70, "compare minHeight"); +}); + +test("aspectRatio: 'preserve' (ne)", function() { + expect(4); + + var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 }); + + drag(handle, 80, -80); + equals( target.width(), 130, "compare maxWidth"); + equals( target.height(), 130, "compare maxHeight"); + + drag(handle, -80, 80); + equals( target.width(), 70, "compare minWidth"); + equals( target.height(), 70, "compare minHeight"); +}); + +test("grid", function() { + expect(4); + + var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', grid: [0, 20] }); + + drag(handle, 3, 9); + equals( target.width(), 103, "compare width"); + equals( target.height(), 100, "compare height"); + + drag(handle, 15, 11); + equals( target.width(), 118, "compare width"); + equals( target.height(), 120, "compare height"); +}); + +test("grid (wrapped)", function() { + expect(4); + + var handle = '.ui-resizable-se', target = $('#resizable2').resizable({ handles: 'all', grid: [0, 20] }); + + drag(handle, 3, 9); + equals( target.width(), 103, "compare width"); + equals( target.height(), 100, "compare height"); + + drag(handle, 15, 11); + equals( target.width(), 118, "compare width"); + equals( target.height(), 120, "compare height"); +}); + +test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() { + expect(4); + + var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }); + + drag(handle, -50, -50); + equals( target.width(), 60, "compare minWidth" ); + equals( target.height(), 60, "compare minHeight" ); + + drag(handle, 70, 70); + equals( target.width(), 100, "compare maxWidth" ); + equals( target.height(), 100, "compare maxHeight" ); +}); + +test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() { + expect(4); + + var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }); + + drag(handle, 50, -50); + equals( target.width(), 60, "compare minWidth" ); + equals( target.height(), 60, "compare minHeight" ); + + drag(handle, -70, 70); + equals( target.width(), 100, "compare maxWidth" ); + equals( target.height(), 100, "compare maxHeight" ); +}); + +test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() { + expect(4); + + var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }); + + drag(handle, -50, 50); + equals( target.width(), 60, "compare minWidth" ); + equals( target.height(), 60, "compare minHeight" ); + + drag(handle, 70, -70); + equals( target.width(), 100, "compare maxWidth" ); + equals( target.height(), 100, "compare maxHeight" ); +}); + +test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }", function() { + expect(4); + + var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 }); + + drag(handle, 70, 70); + equals( target.width(), 60, "compare minWidth" ); + equals( target.height(), 60, "compare minHeight" ); + + drag(handle, -70, -70); + equals( target.width(), 100, "compare maxWidth" ); + equals( target.height(), 100, "compare maxHeight" ); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/all.html new file mode 100644 index 0000000..e77829b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Selectable Test Suite + + + + + + + + + + + + + +

                                                          jQuery UI Selectable Test Suite

                                                          +

                                                          +
                                                          +

                                                          +
                                                            +
                                                            + +
                                                            + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable.html new file mode 100644 index 0000000..4f70e8d --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable.html @@ -0,0 +1,63 @@ + + + + + jQuery UI Selectable Test Suite + + + + + + + + + + + + + + + + + + + + + +

                                                            jQuery UI Selectable Test Suite

                                                            +

                                                            +
                                                            +

                                                            +
                                                              +
                                                              + +
                                                                +
                                                              • Item 1
                                                              • +
                                                              • Item 2
                                                              • +
                                                              • Item 3
                                                              • +
                                                              • Item 4
                                                              • +
                                                              • Item 5
                                                              • +
                                                              + +
                                                              + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_core.js new file mode 100644 index 0000000..18ea3a3 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_core.js @@ -0,0 +1,16 @@ +/* + * selectable_core.js + */ + +var el; + +var drag = function(dx, dy) { + var off = el.offset(), pos = { clientX: off.left, clientY: off.top }; + el.simulate("mousedown", pos); + $(document).simulate("mousemove", pos); + pos.clientX += dx; + pos.clientY += dy; + $(document).simulate("mousemove", pos); + $(document).simulate("mouseup", pos); +}; + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_defaults.js new file mode 100644 index 0000000..dbf799a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_defaults.js @@ -0,0 +1,16 @@ +/* + * selectable_defaults.js + */ + +var selectable_defaults = { + appendTo: 'body', + autoRefresh: true, + cancel: ':input,option', + delay: 0, + disabled: false, + distance: 0, + filter: '*', + tolerance: 'touch' +}; + +commonWidgetTests('selectable', { defaults: selectable_defaults }); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_events.js new file mode 100644 index 0000000..03b65ab --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_events.js @@ -0,0 +1,32 @@ +/* + * selectable_events.js + */ +(function($) { + +module("selectable: events"); + +test("start", function() { + expect(2); + el = $("#selectable1"); + el.selectable({ + start: function(ev, ui) { + ok(true, "drag fired start callback"); + equals(this, el[0], "context of callback"); + } + }); + el.simulate("drag", 20, 20); +}); + +test("stop", function() { + expect(2); + el = $("#selectable1"); + el.selectable({ + start: function(ev, ui) { + ok(true, "drag fired stop callback"); + equals(this, el[0], "context of callback"); + } + }); + el.simulate("drag", 20, 20); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_methods.js new file mode 100644 index 0000000..06b75f9 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_methods.js @@ -0,0 +1,93 @@ +/* + * selectable_methods.js + */ +(function($) { + +module("selectable: methods"); + +test("init", function() { + expect(6); + + $("
                                                              ").appendTo('body').selectable().remove(); + ok(true, '.selectable() called on element'); + + $([]).selectable().remove(); + ok(true, '.selectable() called on empty collection'); + + $("
                                                              ").selectable().remove(); + ok(true, '.selectable() called on disconnected DOMElement'); + + $("
                                                              ").selectable().selectable("foo").remove(); + ok(true, 'arbitrary method called after init'); + + el = $("
                                                              ").selectable() + var foo = el.selectable("option", "foo"); + el.remove(); + ok(true, 'arbitrary option getter after init'); + + $("
                                                              ").selectable().selectable("option", "foo", "bar").remove(); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + $("
                                                              ").appendTo('body').selectable().selectable("destroy").remove(); + ok(true, '.selectable("destroy") called on element'); + + $([]).selectable().selectable("destroy").remove(); + ok(true, '.selectable("destroy") called on empty collection'); + + $("
                                                              ").selectable().selectable("destroy").remove(); + ok(true, '.selectable("destroy") called on disconnected DOMElement'); + + $("
                                                              ").selectable().selectable("destroy").selectable("foo").remove(); + ok(true, 'arbitrary method called after destroy'); + + var expected = $('
                                                              ').selectable(), + actual = expected.selectable('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test("enable", function() { + expect(3); + var fired = false; + + el = $("#selectable1"); + el.selectable({ + disabled: true, + start: function() { fired = true; } + }); + el.simulate("drag", 20, 20); + equals(fired, false, "start fired"); + el.selectable("enable"); + el.simulate("drag", 20, 20); + equals(fired, true, "start fired"); + el.selectable("destroy"); + + var expected = $('
                                                              ').selectable(), + actual = expected.selectable('enable'); + equals(actual, expected, 'enable is chainable'); +}); + +test("disable", function() { + expect(3); + var fired = false; + + el = $("#selectable1"); + el.selectable({ + disabled: false, + start: function() { fired = true; } + }); + el.simulate("drag", 20, 20); + equals(fired, true, "start fired"); + el.selectable("disable"); + fired = false; + el.simulate("drag", 20, 20); + equals(fired, false, "start fired"); + el.selectable("destroy"); + + var expected = $('
                                                              ').selectable(), + actual = expected.selectable('disable'); + equals(actual, expected, 'disable is chainable'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_options.js new file mode 100644 index 0000000..36b7b5b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/selectable/selectable_options.js @@ -0,0 +1,46 @@ +/* + * selectable_options.js + */ +(function($) { + +module("selectable: options"); + +test("autoRefresh", function() { + expect(3); + el = $("#selectable1"); + var actual, sel = $("*", el), selected = function() { actual += 1 }; + + actual = 0; + el = $("#selectable1").selectable({ autoRefresh: false, selected: selected }); + sel.hide(); + drag(1000, 1000); + equals(actual, sel.length); + el.selectable("destroy"); + + actual = 0; + sel.show(); + el = $("#selectable1").selectable({ autoRefresh: true, selected: selected }); + sel.hide(); + drag(1000, 1000); + equals(actual, 0); + sel.show(); + drag(1000, 1000); + equals(actual, sel.length); + el.selectable("destroy"); + sel.show(); +}); + +test("filter", function() { + expect(2); + el = $("#selectable1"); + var actual, sel = $("*", el), selected = function() { actual += 1 }; + + actual = 0; + el = $("#selectable1").selectable({ filter: '.special', selected: selected }); + drag(1000, 1000); + ok(sel.length != 1, "this test assumes more than 1 selectee"); + equals(actual, 1); + el.selectable("destroy"); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/all.html new file mode 100644 index 0000000..cbdbd2f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Slider Test Suite + + + + + + + + + + + + + +

                                                              jQuery UI Slider Test Suite

                                                              +

                                                              +
                                                              +

                                                              +
                                                                +
                                                                + +
                                                                + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider.html new file mode 100644 index 0000000..60d124b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Slider Test Suite + + + + + + + + + + + + + + + + + + + + + +

                                                                jQuery UI Slider Test Suite

                                                                +

                                                                +
                                                                +

                                                                +
                                                                  +
                                                                  + +
                                                                  +
                                                                  +
                                                                  +
                                                                  + +
                                                                  + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_core.js new file mode 100644 index 0000000..38d4f46 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_core.js @@ -0,0 +1,292 @@ +/* + * slider unit tests + */ +(function($) { +// +// Slider Test Helper Functions +// + +var el, options; + +function handle() { + return el.find(".ui-slider-handle"); +} + +// Slider Tests +module("slider: core"); + +test("keydown HOME on handle sets value to min", function() { + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'horizontal', + step: 1 + }; + el.slider(options); + + el.slider("value", 0); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.HOME }); + equals(el.slider("value"), options.min); + + el.slider('destroy'); + + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'vertical', + step: 1 + }; + el.slider(options); + + el.slider("value", 0); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.HOME }); + equals(el.slider("value"), options.min); + + el.slider('destroy'); +}); + +test("keydown END on handle sets value to max", function() { + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'horizontal', + step: 1 + }; + el.slider(options); + + el.slider("value", 0); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.END }); + equals(el.slider("value"), options.max); + + el.slider('destroy'); + + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'vertical', + step: 1 + }; + el.slider(options); + + el.slider("value", 0); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.END }); + equals(el.slider("value"), options.max); + + el.slider('destroy'); +}); + +test("keydown PAGE_UP on handle increases value by 1/5 range, not greater than max", function() { + $.each(['horizontal', 'vertical'], function(i, orientation) { + el = $('
                                                                  '); + options = { + max: 100, + min: 0, + orientation: orientation, + step: 1 + }; + el.slider(options); + + el.slider("value", 70); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_UP }); + equals(el.slider("value"), 90); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_UP }); + equals(el.slider("value"), 100); + + el.slider("destroy"); + }); +}); + +test("keydown PAGE_DOWN on handle decreases value by 1/5 range, not less than min", function() { + $.each(['horizontal', 'vertical'], function(i, orientation) { + el = $('
                                                                  '); + options = { + max: 100, + min: 0, + orientation: orientation, + step: 1 + }; + el.slider(options); + + el.slider("value", 30); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_DOWN }); + equals(el.slider("value"), 10); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_DOWN }); + equals(el.slider("value"), 0); + + el.slider("destroy"); + }); +}); + +test("keydown UP on handle increases value by step, not greater than max", function() { + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'horizontal', + step: 1 + }; + el.slider(options); + + el.slider("value", options.max - options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.UP }); + equals(el.slider("value"), options.max); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.UP }); + equals(el.slider("value"), options.max); + + el.slider("destroy"); + + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'vertical', + step: 1 + }; + el.slider(options); + + el.slider("value", options.max - options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.UP }); + equals(el.slider("value"), options.max); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.UP }); + equals(el.slider("value"), options.max); + + el.slider("destroy"); +}); + +test("keydown RIGHT on handle increases value by step, not greater than max", function() { + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'horizontal', + step: 1 + }; + el.slider(options); + + el.slider("value", options.max - options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT }); + equals(el.slider("value"), options.max); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT }); + equals(el.slider("value"), options.max); + + el.slider("destroy"); + + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'vertical', + step: 1 + }; + el.slider(options); + + el.slider("value", options.max - options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT }); + equals(el.slider("value"), options.max); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT }); + equals(el.slider("value"), options.max); + + el.slider("destroy"); +}); + +test("keydown DOWN on handle decreases value by step, not less than min", function() { + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'horizontal', + step: 1 + }; + el.slider(options); + + el.slider("value", options.min + options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN }); + equals(el.slider("value"), options.min); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN }); + equals(el.slider("value"), options.min); + + el.slider("destroy"); + + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'vertical', + step: 1 + }; + el.slider(options); + + el.slider("value", options.min + options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN }); + equals(el.slider("value"), options.min); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN }); + equals(el.slider("value"), options.min); + + el.slider("destroy"); +}); + +test("keydown LEFT on handle decreases value by step, not less than min", function() { + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'horizontal', + step: 1 + }; + el.slider(options); + + el.slider("value", options.min + options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT }); + equals(el.slider("value"), options.min); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT }); + equals(el.slider("value"), options.min); + + el.slider("destroy"); + + el = $('
                                                                  '); + options = { + max: 5, + min: -5, + orientation: 'vertical', + step: 1 + }; + el.slider(options); + + el.slider("value", options.min + options.step); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT }); + equals(el.slider("value"), options.min); + + handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT }); + equals(el.slider("value"), options.min); + + el.slider("destroy"); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_defaults.js new file mode 100644 index 0000000..8049fe9 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_defaults.js @@ -0,0 +1,19 @@ +commonWidgetTests( "slider", { + defaults: { + animate: false, + cancel: ':input,option', + delay: 0, + disabled: false, + distance: 0, + max: 100, + min: 0, + orientation: 'horizontal', + range: false, + step: 1, + value: 0, + values: null, + + // callbacks + create: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_events.js new file mode 100644 index 0000000..0b7b250 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_events.js @@ -0,0 +1,109 @@ +/* + * slider_events.js + */ +(function($) { + +module( "slider: events" ); + +//Specs from http://wiki.jqueryui.com/Slider#specs +//"change callback: triggers when the slider has stopped moving and has a new +// value (even if same as previous value), via mouse(mouseup) or keyboard(keyup) +// or value method/option" +test( "mouse based interaction", function() { + expect(4); + + var el = $( "
                                                                  " ) + .appendTo( "body" ) + .slider({ + start: function(event, ui) { + equals( event.originalEvent.type, "mousedown", "start triggered by mousedown" ); + }, + slide: function(event, ui) { + equals( event.originalEvent.type, "mousemove", "slider triggered by mousemove" ); + }, + stop: function(event, ui) { + equals( event.originalEvent.type, "mouseup", "stop triggered by mouseup" ); + }, + change: function(event, ui) { + equals( event.originalEvent.type, "mouseup", "change triggered by mouseup" ); + } + }); + + el.find( ".ui-slider-handle" ).eq( 0 ) + .simulate( "drag", { dx: 10, dy: 10 } ); + +}); +test( "keyboard based interaction", function() { + expect(3); + + // Test keyup at end of handle slide (keyboard) + var el = $( "
                                                                  " ) + .appendTo( "body" ) + .slider({ + start: function(event, ui) { + equals( event.originalEvent.type, "keydown", "start triggered by keydown" ); + }, + slide: function(event, ui) { + ok( false, "Slider never triggered by keys" ); + }, + stop: function(event, ui) { + equals( event.originalEvent.type, "keyup", "stop triggered by keyup" ); + }, + change: function(event, ui) { + equals( event.originalEvent.type, "keyup", "change triggered by keyup" ); + } + }); + + el.find( ".ui-slider-handle" ).eq( 0 ) + .simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } ) + .simulate( "keypress", { keyCode: $.ui.keyCode.LEFT } ) + .simulate( "keyup", { keyCode: $.ui.keyCode.LEFT } ); + +}); +test( "programmatic event triggers", function() { + expect(6); + + // Test value method + var el = $( "
                                                                  " ) + .slider({ + change: function(event, ui) { + ok( true, "change triggered by value method" ); + } + }) + .slider( "value", 0 ); + + QUnit.reset(); + // Test values method + el = $( "
                                                                  " ) + .slider({ + values: [ 10, 20 ], + change: function(event, ui) { + ok( true, "change triggered by values method" ); + } + }) + .slider( "values", [80, 90] ); + + QUnit.reset(); + // Test value option + el = $( "
                                                                  " ) + .slider({ + change: function(event, ui) { + ok( true, "change triggered by value option" ); + } + }) + .slider( "option", "value", 0 ); + + QUnit.reset(); + // Test values option + el = $( "
                                                                  " ) + .slider({ + values: [ 10, 20 ], + change: function(event, ui) { + ok( true, "change triggered by values option" ); + } + }) + .slider( "option", "values", [80, 90] ); + +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_methods.js new file mode 100644 index 0000000..66624e8 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_methods.js @@ -0,0 +1,102 @@ +/* + * slider_methods.js + */ +(function($) { + +module("slider: methods"); + +test("init", function() { + expect(5); + + $("
                                                                  ").appendTo('body').slider().remove(); + ok(true, '.slider() called on element'); + + $([]).slider().remove(); + ok(true, '.slider() called on empty collection'); + + $('
                                                                  ').slider().remove(); + ok(true, '.slider() called on disconnected DOMElement'); + + var el = $('
                                                                  ').slider(); + var foo = el.slider("option", "foo"); + el.remove(); + ok(true, 'arbitrary option getter after init'); + + $('
                                                                  ').slider().slider("option", "foo", "bar").remove(); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + $("
                                                                  ").appendTo('body').slider().slider("destroy").remove(); + ok(true, '.slider("destroy") called on element'); + + $([]).slider().slider("destroy").remove(); + ok(true, '.slider("destroy") called on empty collection'); + + $('
                                                                  ').appendTo('body').remove().slider().slider("destroy").remove(); + ok(true, '.slider("destroy") called on disconnected DOMElement'); + + var expected = $('
                                                                  ').slider(), + actual = expected.slider('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test("enable", function() { + var expected = $('
                                                                  ').slider(), + actual = expected.slider('enable'); + equals(actual, expected, 'enable is chainable'); + + var el = $('
                                                                  ').slider({ disabled: true }); + ok(el.hasClass('ui-disabled'), 'slider has ui-disabled class before enable method call'); + ok(el.hasClass('ui-slider-disabled'), 'slider has ui-slider-disabled class before enable method call'); + el.slider('enable'); + ok(!el.hasClass('ui-disabled'), 'slider does not have ui-disabled class after enable method call'); + ok(!el.hasClass('ui-slider-disabled'), 'slider does not have ui-slider-disabled class after enable method call'); +}); + +test("disable", function() { + var expected = $('
                                                                  ').slider(), + actual = expected.slider('disable'); + equals(actual, expected, 'disable is chainable'); + + var el = $('
                                                                  ').slider({ disabled: false }); + ok(!el.hasClass('ui-disabled'), 'slider does not have ui-disabled class before disabled method call'); + ok(!el.hasClass('ui-slider-disabled'), 'slider does not have ui-slider-disabled class before disable method call'); + el.slider('disable'); + ok(el.hasClass('ui-disabled'), 'slider has ui-disabled class after disable method call'); + ok(el.hasClass('ui-slider-disabled'), 'slider has ui-slider-disabled class after disable method call'); +}); + +test("value", function() { + $([false, 'min', 'max']).each(function() { + var el = $('
                                                                  ').slider({ + range: this, + value: 5 + }); + equals(el.slider('value'), 5, 'range: ' + this + ' slider method get'); + equals(el.slider('value', 10), el, 'value method is chainable'); + equals(el.slider('value'), 10, 'range: ' + this + ' slider method set'); + el.remove(); + }); + var el = $('
                                                                  ').slider({ + min: -1, value: 0, max: 1 + }); + // min with value option vs value method + el.slider('option', 'value', -2); + equals(el.slider('option', 'value'), -2, 'value option does not respect min'); + equals(el.slider('value'), -1, 'value method get respects min'); + equals(el.slider('value', -2), el, 'value method is chainable'); + equals(el.slider('option', 'value'), -1, 'value method set respects min'); + // max with value option vs value method + el.slider('option', 'value', 2); + equals(el.slider('option', 'value'), 2, 'value option does not respect max'); + equals(el.slider('value'), 1, 'value method get respects max'); + equals(el.slider('value', 2), el, 'value method is chainable'); + equals(el.slider('option', 'value'), 1, 'value method set respects max'); +}); + +//test("values", function() { +// ok(false, "missing test - untested code is broken code."); +//}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_options.js new file mode 100644 index 0000000..040589b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/slider/slider_options.js @@ -0,0 +1,146 @@ +/* + * slider_options.js + */ +(function($) { + +var el, options; + +function handle() { + return el.find(".ui-slider-handle"); +} + +module("slider: options"); + +test("max", function() { + el = $('
                                                                  '); + + options = { + max: 37, + min: 6, + orientation: 'horizontal', + step: 1, + value: 50 + }; + + el.slider(options); + ok(el.slider("option", "value") == options.value, "value option is not contained by max"); + ok(el.slider("value") == options.max, "value method is contained by max"); + el.slider('destroy'); + +}); + +test("min", function() { + el = $('
                                                                  '); + + options = { + max: 37, + min: 6, + orientation: 'vertical', + step: 1, + value: 2 + }; + + el.slider(options); + ok(el.slider("option", "value") == options.value, "value option is not contained by min"); + ok(el.slider("value") == options.min, "value method is contained by min"); + el.slider('destroy'); + +}); + +test("orientation", function() { + el = $('
                                                                  '); + + options = { + max: 2, + min: -2, + orientation: 'vertical', + value: 1 + }; + + var percentVal = (options.value - options.min) / (options.max - options.min) * 100; + + el.slider(options).slider("option", "orientation", "horizontal"); + ok(el.is('.ui-slider-horizontal'), "horizontal slider has class .ui-slider-horizontal"); + ok(!el.is('.ui-slider-vertical'), "horizontal slider does not have class .ui-slider-vertical"); + equals(handle().css('left'), percentVal + '%', "horizontal slider handle is positioned with left: %"); + + el.slider('destroy'); + + options = { + max: 2, + min: -2, + orientation: 'horizontal', + value: -1 + }; + + var percentVal = (options.value - options.min) / (options.max - options.min) * 100; + + el.slider(options).slider("option", "orientation", "vertical"); + ok(el.is('.ui-slider-vertical'), "vertical slider has class .ui-slider-vertical"); + ok(!el.is('.ui-slider-horizontal'), "vertical slider does not have class .ui-slider-horizontal"); + equals(handle().css('bottom'), percentVal + '%', "vertical slider handle is positioned with bottom: %"); + + el.slider('destroy'); + +}); + +//test("range", function() { +// ok(false, "missing test - untested code is broken code."); +//}); + +//spec: http://wiki.jqueryui.com/Slider#specs +// value option/method: the value option is not restricted by min/max/step. +// What is returned by the value method is restricted by min (>=), max (<=), and step (even multiple) +test("step", function() { + var el = $('
                                                                  ').slider({ + min: 0, + value: 0, + step: 10, + max: 100 + }); + equals( el.slider("value"), 0 ); + + el.slider("value", 1); + equals( el.slider("value"), 0 ); + + el.slider("value", 9); + equals( el.slider("value"), 10 ); + + el.slider("value", 11); + equals( el.slider("value"), 10 ); + + el.slider("value", 19); + equals( el.slider("value"), 20 ); + +el = $('
                                                                  ').slider({ + min: 0, + value: 0, + step: 20, + max: 100 + }); + el.slider("value", 0); + + el.slider("option", "value", 1); + equals( el.slider("value"), 0 ); + + el.slider("option", "value", 9); + equals( el.slider("value"), 0 ); + + el.slider("option", "value", 11); + equals( el.slider("value"), 20 ); + + el.slider("option", "value", 19); + equals( el.slider("value"), 20 ); + + el.slider('destroy'); +}); + +//test("value", function() { +// ok(false, "missing test - untested code is broken code."); +//}); + +//test("values", function() { +// ok(false, "missing test - untested code is broken code."); +//}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/all.html new file mode 100644 index 0000000..0ee6b56 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Sortable Test Suite + + + + + + + + + + + + + +

                                                                  jQuery UI Sortable Test Suite

                                                                  +

                                                                  +
                                                                  +

                                                                  +
                                                                    +
                                                                    + +
                                                                    + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable.html new file mode 100644 index 0000000..a20eb71 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable.html @@ -0,0 +1,64 @@ + + + + + jQuery UI Sortable Test Suite + + + + + + + + + + + + + + + + + + + + + + +

                                                                    jQuery UI Sortable Test Suite

                                                                    +

                                                                    +
                                                                    +

                                                                    +
                                                                      +
                                                                      + +
                                                                        +
                                                                      • Item 1
                                                                      • +
                                                                      • Item 2
                                                                      • +
                                                                      • Item 3
                                                                      • +
                                                                      • Item 4
                                                                      • +
                                                                      • Item 5
                                                                      • +
                                                                      + +
                                                                      + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_core.js new file mode 100644 index 0000000..ff18598 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_core.js @@ -0,0 +1,9 @@ +/* + * sortable_core.js + */ + +(function($) { + +module("sortable: core"); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_defaults.js new file mode 100644 index 0000000..7681add --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_defaults.js @@ -0,0 +1,34 @@ +/* + * sortable_defaults.js + */ + +var sortable_defaults = { + appendTo: "parent", + axis: false, + cancel: ":input,option", + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + delay: 0, + disabled: false, + distance: 1, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: "> *", + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 +}; + +commonWidgetTests('sortable', { defaults: sortable_defaults }); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_events.js new file mode 100644 index 0000000..cb4ff4f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_events.js @@ -0,0 +1,147 @@ +/* + * sortable_events.js + */ +(function($) { + +module("sortable: events"); + +test("start", function() { + + var hash; + $("#sortable") + .sortable({ start: function(e, ui) { hash = ui; } }) + .find('li:eq(0)').simulate("drag", { dx: 0, dy: 10 }); + + ok(hash, 'start event triggered'); + ok(hash.helper, 'UI hash includes: helper'); + ok(hash.placeholder, 'UI hash includes: placeholder'); + ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position'); + ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset'); + ok(hash.item, 'UI hash includes: item'); + ok(!hash.sender, 'UI hash does not include: sender'); + + +}); + +test("sort", function() { + + var hash; + $("#sortable") + .sortable({ sort: function(e, ui) { hash = ui; } }) + .find('li:eq(0)').simulate("drag", { dx: 0, dy: 10 }); + + ok(hash, 'sort event triggered'); + ok(hash.helper, 'UI hash includes: helper'); + ok(hash.placeholder, 'UI hash includes: placeholder'); + ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position'); + ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset'); + ok(hash.item, 'UI hash includes: item'); + ok(!hash.sender, 'UI hash does not include: sender'); + +}); + +test("change", function() { + + var hash; + $("#sortable") + .sortable({ change: function(e, ui) { hash = ui; } }) + .find('li:eq(0)').simulate("drag", { dx: 1, dy: 1 }); + + ok(!hash, '1px drag, change event should not be triggered'); + + $("#sortable") + .sortable({ change: function(e, ui) { hash = ui; } }) + .find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 }); + + ok(hash, 'change event triggered'); + ok(hash.helper, 'UI hash includes: helper'); + ok(hash.placeholder, 'UI hash includes: placeholder'); + ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position'); + ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset'); + ok(hash.item, 'UI hash includes: item'); + ok(!hash.sender, 'UI hash does not include: sender'); + +}); + +test("beforeStop", function() { + + var hash; + $("#sortable") + .sortable({ beforeStop: function(e, ui) { hash = ui; } }) + .find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 }); + + ok(hash, 'beforeStop event triggered'); + ok(hash.helper, 'UI hash includes: helper'); + ok(hash.placeholder, 'UI hash includes: placeholder'); + ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position'); + ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset'); + ok(hash.item, 'UI hash includes: item'); + ok(!hash.sender, 'UI hash does not include: sender'); + +}); + +test("stop", function() { + + var hash; + $("#sortable") + .sortable({ stop: function(e, ui) { hash = ui; } }) + .find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 }); + + ok(hash, 'stop event triggered'); + ok(!hash.helper, 'UI should not include: helper'); + ok(hash.placeholder, 'UI hash includes: placeholder'); + ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position'); + ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset'); + ok(hash.item, 'UI hash includes: item'); + ok(!hash.sender, 'UI hash does not include: sender'); + +}); + +test("update", function() { + + var hash; + $("#sortable") + .sortable({ update: function(e, ui) { hash = ui; } }) + .find('li:eq(0)').simulate("drag", { dx: 1, dy: 1 }); + + ok(!hash, '1px drag, update event should not be triggered'); + + $("#sortable") + .sortable({ update: function(e, ui) { hash = ui; } }) + .find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 }); + + ok(hash, 'update event triggered'); + ok(!hash.helper, 'UI hash should not include: helper'); + ok(hash.placeholder, 'UI hash includes: placeholder'); + ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position'); + ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset'); + ok(hash.item, 'UI hash includes: item'); + ok(!hash.sender, 'UI hash does not include: sender'); + +}); + +test("receive", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("remove", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("over", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("out", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("activate", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("deactivate", function() { + ok(false, "missing test - untested code is broken code."); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_methods.js new file mode 100644 index 0000000..c4b5cdc --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_methods.js @@ -0,0 +1,108 @@ +/* + * sortable_methods.js + */ +(function($) { + +var el, offsetBefore, offsetAfter, dragged; + +var drag = function(handle, dx, dy) { + offsetBefore = $(handle).offset(); + $(handle).simulate("drag", { + dx: dx || 0, + dy: dy || 0 + }); + dragged = { dx: dx, dy: dy }; + offsetAfter = $(handle).offset(); +} + +var sort = function(handle, dx, dy, index, msg) { + drag(handle, dx, dy); + equals($(handle).parent().children().index(handle), index, msg); +} + +module("sortable: methods"); + +test("init", function() { + expect(6); + + $("
                                                                      ").appendTo('body').sortable().remove(); + ok(true, '.sortable() called on element'); + + $([]).sortable(); + ok(true, '.sortable() called on empty collection'); + + $("
                                                                      ").sortable(); + ok(true, '.sortable() called on disconnected DOMElement'); + + $("
                                                                      ").sortable().sortable("foo"); + ok(true, 'arbitrary method called after init'); + + $("
                                                                      ").sortable().sortable("option", "foo"); + ok(true, 'arbitrary option getter after init'); + + $("
                                                                      ").sortable().sortable("option", "foo", "bar"); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + $("
                                                                      ").appendTo('body').sortable().sortable("destroy").remove(); + ok(true, '.sortable("destroy") called on element'); + + $([]).sortable().sortable("destroy"); + ok(true, '.sortable("destroy") called on empty collection'); + + $("
                                                                      ").sortable().sortable("destroy"); + ok(true, '.sortable("destroy") called on disconnected DOMElement'); + + $("
                                                                      ").sortable().sortable("destroy").sortable("foo"); + ok(true, 'arbitrary method called after destroy'); + + var expected = $('
                                                                      ').sortable(), + actual = expected.sortable('destroy'); + equals(actual, expected, 'destroy is chainable'); +}); + +test("enable", function() { + expect(5); + el = $("#sortable").sortable({ disabled: true }); + + sort($("li", el)[0], 0, 40, 0, '.sortable({ disabled: true })'); + + el.sortable("enable"); + equals(el.sortable("option", "disabled"), false, "disabled option getter"); + + el.sortable("destroy"); + el.sortable({ disabled: true }); + el.sortable("option", "disabled", false); + equals(el.sortable("option", "disabled"), false, "disabled option setter"); + + sort($("li", el)[0], 0, 40, 2, '.sortable("option", "disabled", false)'); + + var expected = $('
                                                                      ').sortable(), + actual = expected.sortable('enable'); + equals(actual, expected, 'enable is chainable'); +}); + +test("disable", function() { + expect(7); + el = $("#sortable").sortable({ disabled: false }); + sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })'); + + el.sortable("disable"); + sort($("li", el)[0], 0, 40, 0, 'disabled.sortable getter'); + + el.sortable("destroy"); + + el.sortable({ disabled: false }); + sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })'); + el.sortable("option", "disabled", true); + equals(el.sortable("option", "disabled"), true, "disabled option setter"); + ok(el.sortable("widget").is(":not(.ui-state-disabled)"), "sortable element does not get ui-state-disabled since it's an interaction"); + sort($("li", el)[0], 0, 40, 0, '.sortable("option", "disabled", true)'); + + var expected = $('
                                                                      ').sortable(), + actual = expected.sortable('disable'); + equals(actual, expected, 'disable is chainable'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_options.js new file mode 100644 index 0000000..507d5dc --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_options.js @@ -0,0 +1,256 @@ +/* + * sortable_options.js + */ +(function($) { + +module("sortable: options"); + +test("{ appendTo: 'parent' }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ appendTo: Selector }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ axis: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ axis: 'x' }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ axis: 'y' }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ axis: ? }, unexpected", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ cancel: ':input,button' }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ cancel: Selector }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ connectWith: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ connectWith: Selector }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ containment: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ containment: Element }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ containment: 'document' }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ containment: 'parent' }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ containment: 'window' }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ containment: Selector }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ cursor: 'auto' }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ cursor: 'move' }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ cursorAt: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ cursorAt: true }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ delay: 0 }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ delay: 100 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ distance: 1 }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ distance: 10 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ dropOnEmpty: true }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ dropOnEmpty: false }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ forcePlaceholderSize: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ forcePlaceholderSize: true }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ forceHelperSize: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ forceHelperSize: true }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ grid: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ grid: [17, 3] }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ grid: [3, 7] }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ handle: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ handle: Element }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ handle: Selector }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ helper: 'original' }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ helper: Function }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ items: '> *' }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ items: Selector }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ opacity: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ opacity: .37 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ opacity: 1 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ placeholder: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ placeholder: String }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ revert: false }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ revert: true }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scroll: true }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scroll: false }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scrollSensitivity: 20 }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scrollSensitivity: 2 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scrollSensitivity: 200 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scrollSpeed: 20 }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scrollSpeed: 2 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scrollSpeed: 200 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scope: 'default' }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ scope: ??? }, unexpected", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ tolerance: 'intersect' }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ tolerance: 'pointer' }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ zIndex: 1000 }, default", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ zIndex: 1 }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +test("{ zIndex: false }", function() { + ok(false, "missing test - untested code is broken code."); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_tickets.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_tickets.js new file mode 100644 index 0000000..3edc8c0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/sortable/sortable_tickets.js @@ -0,0 +1,83 @@ +/* + * sortable_tickets.js + */ +(function($) { + +var el, offsetBefore, offsetAfter, dragged; + +var drag = function(handle, dx, dy) { + offsetBefore = $(handle).offset(); + $(handle).simulate("drag", { + dx: dx || 0, + dy: dy || 0 + }); + dragged = { dx: dx, dy: dy }; + offsetAfter = $(handle).offset(); +} + +var sort = function(handle, dx, dy, index, msg) { + drag(handle, dx, dy); + equals($(handle).parent().children().index(handle), index, msg); +} + +module("sortable: tickets"); + +test("#3019: Stop fires too early", function() { + + var helper = null; + el = $("#sortable").sortable({ + stop: function(event, ui) { + helper = ui.helper; + } + }); + + sort($("li", el)[0], 0, 40, 2, 'Dragging the sortable'); + equals(helper, null, "helper should be false"); + +}); + +test('#4752: link event firing on sortable with connect list', function () { + var fired = {}, + hasFired = function (type) { return (type in fired) && (true === fired[type]); }; + + $('#sortable').clone().attr('id', 'sortable2').insertAfter('#sortable'); + + $('#main ul').sortable({ + connectWith: '#main ul', + change: function (e, ui) { + fired.change = true; + }, + receive: function (e, ui) { + fired.receive = true; + }, + remove: function (e, ui) { + fired.remove = true; + } + }); + + $('#main ul li').live('click.ui-sortable-test', function () { + fired.click = true; + }); + + $('#sortable li:eq(0)').simulate('click'); + ok(!hasFired('change'), 'Click only, change event should not have fired'); + ok(hasFired('click'), 'Click event should have fired'); + + // Drag an item within the first list + fired = {}; + $('#sortable li:eq(0)').simulate('drag', { dx: 0, dy: 40 }); + ok(hasFired('change'), '40px drag, change event should have fired'); + ok(!hasFired('receive'), 'Receive event should not have fired'); + ok(!hasFired('remove'), 'Remove event should not have fired'); + ok(!hasFired('click'), 'Click event should not have fired'); + + // Drag an item from the first list to the second, connected list + fired = {}; + $('#sortable li:eq(0)').simulate('drag', { dx: 0, dy: 150 }); + ok(hasFired('change'), '150px drag, change event should have fired'); + ok(hasFired('receive'), 'Receive event should have fired'); + ok(hasFired('remove'), 'Remove event should have fired'); + ok(!hasFired('click'), 'Click event should not have fired'); +}); + +})(jQuery); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/all.html new file mode 100644 index 0000000..1075362 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Spinner Test Suite + + + + + + + + + + + + + +

                                                                      jQuery UI Spinner Test Suite

                                                                      +

                                                                      +
                                                                      +

                                                                      +
                                                                        +
                                                                        + +
                                                                        + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner.html new file mode 100644 index 0000000..0c01a5f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner.html @@ -0,0 +1,52 @@ + + + + + jQuery UI Spinner Test Suite + + + + + + + + + + + + + + + + + + + + + + + + +

                                                                        jQuery UI Spinner Test Suite

                                                                        +

                                                                        +
                                                                        +

                                                                        +
                                                                          +
                                                                          + + + + +
                                                                          + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_core.js new file mode 100644 index 0000000..e12d1af --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_core.js @@ -0,0 +1,206 @@ +(function( $ ) { + +module( "spinner: core" ); + +test( "keydown UP on input, increases value not greater than max", function() { + expect( 5 ); + var element = $( "#spin" ).val( 70 ).spinner({ + max: 100, + step: 10 + }); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + equal( element.val(), 80 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + equal( element.val(), 90 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + equal( element.val(), 100 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + equal( element.val(), 100 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + equal( element.val(), 100 ); +}); + +test( "keydown DOWN on input, decreases value not less than min", function() { + expect( 5 ); + var element = $( "#spin" ).val( 50 ).spinner({ + min: 20, + step: 10 + }); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + equal( element.val(), 40 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + equal( element.val(), 30 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + equal( element.val(), 20 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + equal( element.val(), 20 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + equal( element.val(), 20 ); +}); + +test( "keydown PAGE_UP on input, increases value not greater than max", function() { + expect( 5 ); + var element = $( "#spin" ).val( 70 ).spinner({ + max: 100, + page: 10 + }); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + equal( element.val(), 80 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + equal( element.val(), 90 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + equal( element.val(), 100 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + equal( element.val(), 100 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + equal( element.val(), 100 ); +}); + +test( "keydown PAGE_DOWN on input, decreases value not less than min", function() { + expect( 5 ); + var element = $( "#spin" ).val( 50 ).spinner({ + min: 20, + page: 10 + }); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + equal( element.val(), 40 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + equal( element.val(), 30 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + equal( element.val(), 20 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + equal( element.val(), 20 ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + equal( element.val(), 20 ); +}); + +test( "mouse click on up button, increases value not greater than max", function() { + expect( 3 ); + var element = $( "#spin" ).val( 18 ).spinner({ + max: 20 + }), + button = element.spinner( "widget" ).find( ".ui-spinner-up" ); + + button.trigger( "mousedown" ).trigger( "mouseup" ); + equal( element.val(), 19 ); + button.trigger( "mousedown" ).trigger( "mouseup" ); + equal( element.val(), 20 ); + button.trigger( "mousedown" ).trigger( "mouseup" ); + equal( element.val(), 20 ); +}); + +test( "mouse click on up button, increases value not greater than max", function() { + expect( 3 ); + var element = $( "#spin" ).val( 2 ).spinner({ + min: 0 + }), + button = element.spinner( "widget" ).find( ".ui-spinner-down" ); + + button.trigger( "mousedown" ).trigger( "mouseup" ); + equal( element.val(), 1 ); + button.trigger( "mousedown" ).trigger( "mouseup" ); + equal( element.val(), 0 ); + button.trigger( "mousedown" ).trigger( "mouseup" ); + equal( element.val(), 0 ); +}); + +test( "mousewheel on input", function() { + expect( 4 ); + + var element = $( "#spin" ).val( 0 ).spinner({ + step: 2 + }); + + element.trigger( "mousewheel" ); + equal( element.val(), 0, "mousewheel event without delta does not change value" ); + + element.trigger( "mousewheel", 1 ); + equal( element.val(), 2 ); + + element.trigger( "mousewheel", -0.2 ); + equal( element.val(), 0 ); + + element.trigger( "mousewheel", -15 ); + equal(element.val(), -2 ); +}); + +test( "reading HTML5 attributes", function() { + expect( 6 ); + var markup = "", + element = $( markup ).spinner(); + equal( element.spinner( "option", "min" ), -100, "min from markup" ); + equal( element.spinner( "option", "max" ), 100, "max from markup" ); + equal( element.spinner( "option", "step" ), 2, "step from markup" ); + + element = $( markup ).spinner({ + min: -200, + max: 200, + step: 5 + }); + equal( element.spinner( "option", "min" ), -200, "min from options" ); + equal( element.spinner( "option", "max" ), 200, "max from options" ); + equal( element.spinner( "option", "step" ), 5, "stop from options" ); +}); + +test( "ARIA attributes", function() { + expect( 9 ); + var element = $( "#spin" ).val( 2 ).spinner({ min: -5, max: 5 }); + + equal( element.attr( "role" ), "spinbutton", "role" ); + equal( element.attr( "aria-valuemin" ), "-5", "aria-valuemin" ); + equal( element.attr( "aria-valuemax" ), "5", "aria-valuemax" ); + equal( element.attr( "aria-valuenow" ), "2", "aria-valuenow" ); + + element.spinner( "stepUp" ); + + equal( element.attr( "aria-valuenow" ), "3", "stepUp 1 step changes aria-valuenow" ); + + element.spinner( "option", { min: -10, max: 10 } ); + + equal( element.attr( "aria-valuemin" ), "-10", "min option changed aria-valuemin changes" ); + equal( element.attr( "aria-valuemax" ), "10", "max option changed aria-valuemax changes" ); + + element.spinner( "option", "min", null ); + equal( element.attr( "aria-valuemin" ), undefined, "aria-valuemin not set when no min" ); + + element.spinner( "option", "max", null ); + equal( element.attr( "aria-valuemax" ), undefined, "aria-valuemax not set when no max" ); +}); + +test( "focus text field when pressing button", function() { + expect( 2 ); + var element = $( "#spin" ).spinner(); + $( "body" ).focus(); + ok( element[ 0 ] !== document.activeElement, "not focused before" ); + element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown(); + ok( element[ 0 ] === document.activeElement, "focused after" ); +}); + +test( "don't clear invalid value on blur", function() { + expect( 1 ); + var element = $( "#spin" ).spinner(); + element.focus().val( "a" ).blur(); + equal( element.val(), "a" ); +}); + +test( "precision", function() { + expect( 2 ); + var element = $( "#spin" ).val( .05 ).spinner({ + step: .0001 + }); + element.spinner( "stepUp" ); + equal( element.val(), "0.0501", "precision from step" ); + + element.val( 1.05 ).spinner( "option", { + step: 1, + min: -9.95 + }); + element.spinner( "stepDown" ); + equal( element.val(), "0.05", "precision from min" ); +}); + +})( jQuery ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_defaults.js new file mode 100644 index 0000000..0a4e7c2 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_defaults.js @@ -0,0 +1,19 @@ +commonWidgetTests( "spinner", { + defaults: { + culture: null, + disabled: false, + incremental: true, + max: null, + min: null, + numberFormat: null, + page: 10, + step: 1, + + // callbacks + change: null, + create: null, + spin: null, + start: null, + stop: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_events.js new file mode 100644 index 0000000..e43ba33 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_events.js @@ -0,0 +1,221 @@ +(function( $ ) { + +module( "spinner: events" ); + +test( "start", function() { + expect( 6 ); + var element = $( "#spin" ).spinner(); + + function shouldStart( expectation, msg ) { + element.spinner( "option", "start", function() { + ok( expectation, msg ); + }); + } + + shouldStart( true, "key UP" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + shouldStart( true, "key DOWN" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + + shouldStart( true, "key PAGE_UP" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + shouldStart( true, "key PAGE_DOWN" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + + shouldStart( true, "button up" ); + element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + shouldStart( true, "button down" ); + element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + + shouldStart( false, "stepUp" ); + element.spinner( "stepUp" ); + shouldStart( false, "stepDown" ); + element.spinner( "stepDown" ); + + shouldStart( false, "pageUp" ); + element.spinner( "pageUp" ); + shouldStart( false, "pageDown" ); + element.spinner( "pageDown" ); + + shouldStart( false, "value" ); + element.spinner( "value", 999 ); +}); + +test( "spin", function() { + expect( 6 ); + var element = $( "#spin" ).spinner(); + + function shouldSpin( expectation, msg ) { + element.spinner( "option", "spin", function() { + ok( expectation, msg ); + }); + } + + shouldSpin( true, "key UP" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + shouldSpin( true, "key DOWN" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + + shouldSpin( true, "key PAGE_UP" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + shouldSpin( true, "key PAGE_DOWN" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + + shouldSpin( true, "button up" ); + element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + shouldSpin( true, "button down" ); + element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + + shouldSpin( false, "stepUp" ); + element.spinner( "stepUp" ); + shouldSpin( false, "stepDown" ); + element.spinner( "stepDown" ); + + shouldSpin( false, "pageUp" ); + element.spinner( "pageUp" ); + shouldSpin( false, "pageDown" ); + element.spinner( "pageDown" ); + + shouldSpin( false, "value" ); + element.spinner( "value", 999 ); +}); + +test( "stop", function() { + expect( 6 ); + var element = $( "#spin" ).spinner(); + + function shouldStop( expectation, msg ) { + element.spinner( "option", "stop", function() { + ok( expectation, msg ); + }); + } + + shouldStop( true, "key UP" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + shouldStop( true, "key DOWN" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + + shouldStop( true, "key PAGE_UP" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + shouldStop( true, "key PAGE_DOWN" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + + shouldStop( true, "button up" ); + element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + shouldStop( true, "button down" ); + element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + + shouldStop( false, "stepUp" ); + element.spinner( "stepUp" ); + shouldStop( false, "stepDown" ); + element.spinner( "stepDown" ); + + shouldStop( false, "pageUp" ); + element.spinner( "pageUp" ); + shouldStop( false, "pageDown" ); + element.spinner( "pageDown" ); + + shouldStop( false, "value" ); + element.spinner( "value", 999 ); +}); + +test( "change", function() { + expect( 14 ); + var element = $( "#spin" ).spinner(); + + function shouldChange( expectation, msg ) { + element.spinner( "option", "change", function() { + ok( expectation, msg ); + }); + } + + element.focus(); + shouldChange( false, "key UP, before blur" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + shouldChange( true, "blur after key UP" ); + element.blur(); + + element.focus(); + shouldChange( false, "key DOWN, before blur" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + shouldChange( true, "blur after key DOWN" ); + element.blur(); + + element.focus(); + shouldChange( false, "key PAGE_UP, before blur" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + shouldChange( true, "blur after key PAGE_UP" ); + element.blur(); + + element.focus(); + shouldChange( false, "key PAGE_DOWN, before blur" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + shouldChange( true, "blur after key PAGE_DOWN" ); + element.blur(); + + shouldChange( false, "many keys, before blur" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + shouldChange( true, "blur after many keys" ); + element.blur(); + + shouldChange( false, "many keys, same final value, before blur" ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + shouldChange( false, "blur after many keys, same final value" ); + + shouldChange( false, "button up, before blur" ); + element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + shouldChange( true, "blur after button up" ); + element.blur(); + + shouldChange( false, "button down, before blur" ); + element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + shouldChange( true, "blur after button down" ); + element.blur(); + + shouldChange( false, "many buttons, same final value, before blur" ); + element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-up" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + element.spinner( "widget" ).find( ".ui-spinner-down" ).mousedown().mouseup(); + shouldChange( false, "blur after many buttons, same final value" ); + element.blur(); + + shouldChange( true, "stepUp" ); + element.spinner( "stepUp" ); + + shouldChange( true, "stepDown" ); + element.spinner( "stepDown" ); + + shouldChange( true, "pageUp" ); + element.spinner( "pageUp" ); + + shouldChange( true, "pageDown" ); + element.spinner( "pageDown" ); + + shouldChange( true, "value" ); + element.spinner( "value", 999 ); + + shouldChange( false, "value, same value" ); + element.spinner( "value", 999 ); + + shouldChange( true, "max, value changed" ); + element.spinner( "option", "max", 900 ); + + shouldChange( false, "max, value not changed" ); + element.spinner( "option", "max", 1000 ); + + shouldChange( true, "min, value changed" ); + element.spinner( "option", "min", 950 ); + + shouldChange( false, "min, value not changed" ); + element.spinner( "option", "min", 200 ); +}); + +})( jQuery ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_methods.js new file mode 100644 index 0000000..a9fd6c8 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_methods.js @@ -0,0 +1,164 @@ +(function( $ ) { + +module( "spinner: methods" ); + +test( "destroy", function() { + expect( 1 ); + domEqual( "#spin", function() { + $( "#spin" ).spinner().spinner( "destroy" ); + }); +}); + +test( "disable", function() { + expect( 14 ); + var element = $( "#spin" ).val( 2 ).spinner(), + wrapper = $( "#spin" ).spinner( "widget" ); + + ok( !wrapper.hasClass( "ui-spinner-disabled" ), "before: wrapper does not have ui-spinner-disabled class" ); + ok( !element.is( ":disabled" ), "before: input does not have disabled attribute" ); + + element.spinner( "disable" ); + ok( wrapper.hasClass( "ui-spinner-disabled" ), "after: wrapper has ui-spinner-disabled class" ); + ok( element.is( ":disabled"), "after: input has disabled attribute" ); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + equals( 2, element.val(), "keyboard - value does not change on key UP" ); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.DOWN ); + equals( 2, element.val(), "keyboard - value does not change on key DOWN" ); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_UP ); + equals( 2, element.val(), "keyboard - value does not change on key PGUP" ); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.PAGE_DOWN ); + equals( 2, element.val(), "keyboard - value does not change on key PGDN" ); + + wrapper.find( ".ui-spinner-up" ).trigger( "mousedown" ).trigger( "mouseup" ); + equals( 2, element.val(), "mouse - value does not change on clicking up button" ); + + wrapper.find( ".ui-spinner-down" ).trigger( "mousedown" ).trigger( "mouseup" ); + equals( 2, element.val(), "mouse - value does not change on clicking down button" ); + + element.spinner( "stepUp", 6 ); + equals( 8, element.val(), "script - stepUp 6 steps changes value"); + + element.spinner( "stepDown" ); + equals( 7, element.val(), "script - stepDown 1 step changes value" ); + + element.spinner( "pageUp" ); + equals( 17, element.val(), "script - pageUp 1 page changes value" ); + + element.spinner( "pageDown" ); + equals( 7, element.val(), "script - pageDown 1 page changes value" ); +}); + +test( "enable", function() { + expect( 5 ); + var element = $( "#spin" ).val( 1 ).spinner({ disabled: true }) + wrapper = element.spinner( "widget" ); + + ok( wrapper.hasClass( "ui-spinner-disabled" ), "before: wrapper has ui-spinner-disabled class" ); + ok( element.is( ":disabled" ), "before: input has disabled attribute" ); + + element.spinner( "enable" ); + + ok( !wrapper.hasClass( ".ui-spinner-disabled" ), "after: wrapper does not have ui-spinner-disabled class" ); + ok( !element.is( ":disabled" ), "after: input does not have disabled attribute" ); + + spinner_simulateKeyDownUp( element, $.ui.keyCode.UP ); + equals( 2, element.val(), "keyboard - value changes on key UP" ); +}); + +test( "pageDown", function() { + expect( 4 ); + var element = $( "#spin" ).val( -12 ).spinner({ + page: 20, + min: -100 + }); + + element.spinner( "pageDown" ); + equals( element.val(), -32, "pageDown 1 page" ); + + element.spinner( "pageDown", 3 ); + equals( element.val(), -92, "pageDown 3 pages" ); + + element.spinner( "pageDown" ); + equals( element.val(), -100, "value close to min and pageDown 1 page" ); + + element.spinner( "pageDown", 10 ); + equals( element.val(), -100, "value at min and pageDown 10 pages" ); +}); + +test( "pageUp", function() { + expect( 4 ); + var element = $( "#spin" ).val( 12 ).spinner({ + page: 20, + max: 100 + }); + + element.spinner( "pageUp" ); + equals( element.val(), 32, "pageUp 1 page" ); + + element.spinner( "pageUp", 3 ); + equals( element.val(), 92, "pageUp 3 pages" ); + + element.spinner( "pageUp" ); + equals( element.val(), 100, "value close to max and pageUp 1 page" ); + + element.spinner( "pageUp", 10 ); + equals( element.val(), 100, "value at max and pageUp 10 pages" ); +}); + +test( "stepDown", function() { + expect( 4 ); + var element = $( "#spin" ).val( 0 ).spinner({ + step: 2, + min: -15 + }); + + element.spinner( "stepDown" ); + equals( element.val(), "-1", "stepDown 1 step" ); + + element.spinner( "stepDown", 5 ); + equals( element.val(), "-11", "stepDown 5 steps" ); + + element.spinner( "stepDown", 4 ); + equals( element.val(), "-15", "close to min and stepDown 4 steps" ); + + element.spinner( "stepDown" ); + equals( element.val(), "-15", "at min and stepDown 1 step" ); +}); + +test( "stepUp", function() { + expect( 4 ); + var element = $( "#spin" ).val( 0 ).spinner({ + step: 2, + max: 16 + }); + + element.spinner( "stepUp" ); + equals( element.val(), 2, "stepUp 1 step" ); + + element.spinner( "stepUp", 5 ); + equals( element.val(), 12, "stepUp 5 steps" ); + + element.spinner( "stepUp", 4 ); + equals( element.val(), 16, "close to min and stepUp 4 steps" ); + + element.spinner( "stepUp" ); + equals( element.val(), 16, "at max and stepUp 1 step" ); +}); + +test( "value", function() { + expect( 2 ); + var element = $( "#spin" ).val( 0 ).spinner({ + step: 3 + }); + + element.spinner( "value", 10 ); + equals( element.val(), 9, "change value via value method" ); + + equals( element.spinner( "value" ), 9, "get value via value method" ); +}); + +})( jQuery ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_options.js new file mode 100644 index 0000000..81f434f --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_options.js @@ -0,0 +1,190 @@ +(function( $ ) { + +module( "spinner: options" ); + +// culture is tested after numberFormat, since it depends on numberFormat + +test( "incremental, false", function() { + expect( 100 ); + + var i, diff, + prev = 0, + element = $( "#spin" ).val( prev ).spinner({ + incremental: false, + spin: function( event, ui ) { + equal( ui.value - prev, 1 ); + prev = ui.value; + } + }); + + for ( i = 0; i < 100; i++ ) { + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + } + element.simulate( "keyup", { keyCode: $.ui.keyCode.UP } ); +}); + +test( "incremental, true", function() { + expect( 100 ); + + function fill( num, val ) { + return $.map( new Array( num ), function() { + return val; + }); + } + + var i, diff, + prev = 0, + expected = [].concat( fill( 18, 1 ), fill( 37, 2 ), fill( 14, 3 ), + fill( 9, 4 ), fill( 6, 5 ), fill( 5, 6 ), fill ( 5, 7 ), + fill( 4, 8 ), fill( 2, 9 ) ), + element = $( "#spin" ).val( prev ).spinner({ + incremental: true, + spin: function( event, ui ) { + equal( ui.value - prev, expected[ i ] ); + prev = ui.value; + } + }); + + for ( i = 0; i < 100; i++ ) { + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + } + element.simulate( "keyup", { keyCode: $.ui.keyCode.UP } ); +}); + +test( "incremental, function", function() { + expect( 100 ); + + var i, + prev = 0, + element = $( "#spin" ).val( prev ).spinner({ + incremental: function( i ) { + return i; + }, + spin: function( event, ui ) { + equal( ui.value - prev, i + 1 ); + prev = ui.value; + } + }); + + for ( i = 0; i < 100; i++ ) { + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + } + element.simulate( "keyup", { keyCode: $.ui.keyCode.UP } ); +}); + +test( "numberFormat, number", function() { + expect( 2 ); + var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "n" }); + equal( element.val(), "0.00", "formatted on init" ); + element.spinner( "stepUp" ); + equal( element.val(), "1.00", "formatted after step" ); +}); + +test( "numberFormat, number, simple", function() { + expect( 2 ); + var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "n0" }); + equal( element.val(), "0", "formatted on init" ); + element.spinner( "stepUp" ); + equal( element.val(), "1", "formatted after step" ); +}); + +test( "numberFormat, currency", function() { + expect( 2 ); + var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "C" }); + equal( element.val(), "$0.00", "formatted on init" ); + element.spinner( "stepUp" ); + equal( element.val(), "$1.00", "formatted after step" ); +}); + +test( "numberFormat, change", function() { + expect( 2 ); + var element = $( "#spin" ).val( 5 ).spinner({ numberFormat: "n1" }); + equal( element.val(), "5.0", "formatted on init" ); + element.spinner( "option", "numberFormat", "c" ); + equal( element.val(), "$5.00", "formatted after change" ); +}); + +test( "culture, null", function() { + expect( 2 ); + Globalize.culture( "ja-JP" ); + var element = $( "#spin" ).val( 0 ).spinner({ numberFormat: "C" }); + equal( element.val(), "¥0", "formatted on init" ); + element.spinner( "stepUp" ); + equal( element.val(), "¥1", "formatted after step" ); + + // reset culture + Globalize.culture( "default" ); +}); + +test( "currency, ja-JP", function() { + expect( 2 ); + var element = $( "#spin" ).val( 0 ).spinner({ + numberFormat: "C", + culture: "ja-JP" + }); + equal( element.val(), "¥0", "formatted on init" ); + element.spinner( "stepUp" ); + equal( element.val(), "¥1", "formatted after step" ); +}); + +test( "currency, change", function() { + expect( 2 ); + var element = $( "#spin" ).val( 5 ).spinner({ + numberFormat: "C", + culture: "ja-JP" + }); + equal( element.val(), "¥5", "formatted on init" ); + element.spinner( "option", "culture", "en" ); + equal( element.val(), "$5.00", "formatted after change" ); +}); + +test( "max", function() { + expect( 3 ); + var element = $( "#spin" ).val( 1000 ).spinner({ max: 100 }); + equals( element.val(), 1000, "value not constrained on init" ); + + element.spinner( "value", 1000 ); + equals( element.val(), 100, "max constrained if value method is greater" ); + + element.val( 1000 ).blur(); + equals( element.val(), 1000, "max not constrained if manual entry" ); +}); + +test( "min", function() { + expect( 3 ); + var element = $( "#spin" ).val( -1000 ).spinner({ min: -100 }); + equals( element.val(), -1000, "value not constrained on init" ); + + element.spinner( "value", -1000 ); + equals( element.val(), -100, "min constrained if value method is greater" ); + + element.val( -1000 ).blur(); + equals( element.val(), -1000, "min not constrained if manual entry" ); +}); + +test( "step, 2", function() { + expect( 3 ); + var element = $( "#spin" ).val( 0 ).spinner({ step: 2 }); + + element.spinner( "stepUp" ); + equals( element.val(), "2", "stepUp" ); + + element.spinner( "value", "10.5" ); + equals( element.val(), "10", "value reset to 10" ); + + element.val( "4.5" ); + element.spinner( "stepUp" ); + equals( element.val(), "6", "stepUp" ); +}); + +test( "step, 0.7", function() { + expect( 1 ); + var element = $("#spin").val( 0 ).spinner({ + step: 0.7 + }); + + element.spinner( "stepUp" ); + equals( element.val(), "0.7", "stepUp" ); +}); + +})( jQuery ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_test_helpers.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_test_helpers.js new file mode 100644 index 0000000..af555db --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/spinner/spinner_test_helpers.js @@ -0,0 +1,5 @@ +var spinner_simulateKeyDownUp = function( element, keyCode, shift ) { + element + .simulate( "keydown", { keyCode: keyCode, shiftKey: shift || false } ) + .simulate( "keyup", { keyCode: keyCode, shiftKey: shift || false } ); +}; diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuite.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuite.js new file mode 100644 index 0000000..e584d28 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuite.js @@ -0,0 +1,21 @@ +(function() { + +var versions = [ "1.6", "1.6.1", "1.6.2", "1.6.3", "1.6.4", "1.7", "1.7.1", "git" ]; + +var additionalTests = { + accordion: [ "accordion_deprecated.html" ], + position: [ "position_deprecated.html" ], + tabs: [ "tabs_deprecated.html" ] +}; + +window.testAllVersions = function( widget ) { + QUnit.testSuites( $.map( + [ widget + ".html" ].concat( additionalTests[ widget ] || [] ), + function( test ) { + return $.map( versions, function( version ) { + return test + "?jquery=" + version; + }); + })); +}; + +}()); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.css b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.css new file mode 100644 index 0000000..bca30a7 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.css @@ -0,0 +1,8 @@ +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/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.js new file mode 100644 index 0000000..ddfccc7 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/subsuiteRunner.js @@ -0,0 +1,82 @@ +(function( QUnit ) { + +var subsuiteFrame; + +QUnit.extend( QUnit, { + testSuites: function( suites ) { + for ( var i = 0; i < suites.length; i++ ) { + (function( suite ) { + asyncTest( suite, function() { + QUnit.runSuite( suite ); + }); + }( 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 + "...
                                                                           "; + }, + + testDone: function() { + var current = QUnit.id( this.config.current.id ), + children = current.children; + + // undo the auto-expansion of failed tests + for ( var i = 0; i < children.length; i++ ) { + if ( children[i].nodeName === "OL" ) { + children[i].style.display = "none"; + } + } + }, + + runSuite: function( suite ) { + var body = document.getElementsByTagName( "body" )[0], + iframe = subsuiteFrame = document.createElement( "iframe" ), + iframeWin; + + 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/src/main/webapp/jquery-ui-1.9pre/tests/unit/swarminject.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/swarminject.js new file mode 100644 index 0000000..db69326 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/swarminject.js @@ -0,0 +1,9 @@ +// load testswarm agent +(function() { + var url = window.location.search; + url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) ); + if ( !url || url.indexOf("http") !== 0 ) { + return; + } + document.write(""); +})(); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/all.html new file mode 100644 index 0000000..363edc0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Tabs Test Suite + + + + + + + + + + + + + +

                                                                          jQuery UI Tabs Test Suite

                                                                          +

                                                                          +
                                                                          +

                                                                          +
                                                                            +
                                                                            + +
                                                                            + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/data/test.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/data/test.html new file mode 100644 index 0000000..cd59e64 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/data/test.html @@ -0,0 +1 @@ +

                                                                            …content loaded via Ajax.

                                                                            \ No newline at end of file diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs.html new file mode 100644 index 0000000..f2a672b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs.html @@ -0,0 +1,181 @@ + + + + + jQuery UI Tabs Test Suite + + + + + + + + + + + + + + + + + + + + + + +

                                                                            jQuery UI Tabs Test Suite

                                                                            +

                                                                            +
                                                                            +

                                                                            +
                                                                              +
                                                                              + +
                                                                              + +
                                                                              +
                                                                              +
                                                                              +
                                                                              + +
                                                                              + +
                                                                              +
                                                                              +
                                                                              + +
                                                                              +
                                                                              +
                                                                                +
                                                                              • 1
                                                                              • +
                                                                              +
                                                                              +
                                                                              + +
                                                                              +
                                                                                +
                                                                              • 1
                                                                              • +
                                                                              +
                                                                                +
                                                                              1. 1
                                                                              2. +
                                                                              +
                                                                              + +
                                                                              +
                                                                                +
                                                                              1. 1
                                                                              2. +
                                                                              +
                                                                                +
                                                                              • 1
                                                                              • +
                                                                              +
                                                                              + +
                                                                              +
                                                                              +
                                                                                +
                                                                                +
                                                                                + +
                                                                                +
                                                                                  +
                                                                                • 1 +
                                                                                    +
                                                                                  • 3
                                                                                  • +
                                                                                  • 4
                                                                                  • +
                                                                                  +
                                                                                • +
                                                                                • 2
                                                                                • +
                                                                                +
                                                                                +
                                                                                +
                                                                                + +
                                                                                +
                                                                                  +
                                                                                • 1
                                                                                • +
                                                                                • 2
                                                                                • +
                                                                                +
                                                                                +
                                                                                +
                                                                                + +
                                                                                + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js new file mode 100644 index 0000000..e7c1ee5 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_core.js @@ -0,0 +1,94 @@ +(function( $ ) { + +module( "tabs: core" ); + +test( "markup structure", function() { + expect( 3 ); + var element = $( "#tabs1" ).tabs(); + ok( element.hasClass( "ui-tabs" ), "main element is .ui-tabs" ); + ok( element.find( "ul" ).hasClass( "ui-tabs-nav" ), "list item is .ui-tabs-nav" ); + equal( element.find( ".ui-tabs-panel" ).length, 3, + ".ui-tabs-panel elements exist, correct number" ); +}); + +$.each({ + "deep ul": "#tabs3", + "multiple lists, ul first": "#tabs4", + "multiple lists, ol first": "#tabs5", + "empty list": "#tabs6" +}, function( type, selector ) { + test( "markup structure: " + type, function() { + expect( 2 ); + var element = $( selector ).tabs(); + ok( element.hasClass( "ui-tabs" ), "main element is .ui-tabs" ); + ok( $( selector + "-list" ).hasClass( "ui-tabs-nav" ), + "list item is .ui-tabs-nav" ); + }); +}); + +// #5893 - Sublist in the tab list are considered as tab +test( "nested list", function() { + expect( 1 ); + + var element = $( "#tabs6" ).tabs(); + equals( element.data( "tabs" ).anchors.length, 2, "should contain 2 tab" ); +}); + +test( "disconnected from DOM", function() { + expect( 2 ); + + var element = $( "#tabs1" ).remove().tabs(); + equals( element.find( ".ui-tabs-nav" ).length, 1, "should initialize nav" ); + equals( element.find( ".ui-tabs-panel" ).length, 3, "should initialize panels" ); +}); + +test( "aria-controls", function() { + expect( 7 ); + var element = $( "#tabs1" ).tabs(), + tabs = element.find( ".ui-tabs-nav a" ); + tabs.each(function() { + var tab = $( this ); + equal( tab.prop( "hash" ).substring( 1 ), tab.attr( "aria-controls" ) ); + }); + + element = $( "#tabs2" ).tabs(); + tabs = element.find( ".ui-tabs-nav a" ); + equal( tabs.eq( 0 ).attr( "aria-controls" ), "colon:test" ); + equal( tabs.eq( 1 ).attr( "aria-controls" ), "inline-style" ); + ok( /^ui-tabs-\d+$/.test( tabs.eq( 2 ).attr( "aria-controls" ) ), "generated id" ); + equal( tabs.eq( 3 ).attr( "aria-controls" ), "custom-id" ); +}); + +test( "accessibility", function() { + // TODO: add tests +}); + +test( "#3627 - Ajax tab with url containing a fragment identifier fails to load", function() { + expect( 1 ); + + var element = $( "#tabs2" ).tabs({ + active: 2, + beforeLoad: function( event, ui ) { + event.preventDefault(); + ok( /test.html$/.test( ui.ajaxSettings.url ), "should ignore fragment identifier" ); + } + }); +}); + +test( "#4033 - IE expands hash to full url and misinterprets tab as ajax", function() { + expect( 2 ); + + var element = $( "" ); + element.appendTo( "#main" ); + element.tabs({ + beforeLoad: function( event, ui ) { + event.preventDefault(); + ok( false, 'should not be an ajax tab'); + } + }); + + equals( element.find( ".ui-tabs-nav a" ).attr( "aria-controls" ), "tab", "aria-contorls attribute is correct" ); + tabs_state( element, 1 ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults.js new file mode 100644 index 0000000..52b6f8a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults.js @@ -0,0 +1,16 @@ +commonWidgetTests( "tabs", { + defaults: { + active: null, + collapsible: false, + disabled: false, + event: "click", + fx: null, + + // callbacks + activate: null, + beforeActivate: null, + beforeLoad: null, + create: null, + load: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults_deprecated.js new file mode 100644 index 0000000..1a56297 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_defaults_deprecated.js @@ -0,0 +1,29 @@ +commonWidgetTests( "tabs", { + defaults: { + active: null, + ajaxOptions: null, + cache: false, + collapsible: false, + cookie: null, + disabled: false, + event: "click", + fx: null, + idPrefix: "ui-tabs-", + panelTemplate: "
                                                                                ", + spinner: "Loading…", + tabTemplate: "
                                                                              • #{label}
                                                                              • ", + + // callbacks + activate: null, + add: null, + beforeActivate: null, + beforeLoad: null, + create: null, + disable: null, + enable: null, + load: null, + remove: null, + select: null, + show: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.html new file mode 100644 index 0000000..92d9be8 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.html @@ -0,0 +1,180 @@ + + + + + jQuery UI Tabs Test Suite + + + + + + + + + + + + + + + + + + + + + + + +

                                                                                jQuery UI Tabs Test Suite

                                                                                +

                                                                                +
                                                                                +

                                                                                +
                                                                                  +
                                                                                  + +
                                                                                  +
                                                                                    +
                                                                                  • 1
                                                                                  • +
                                                                                  • 2
                                                                                  • +
                                                                                  • 3
                                                                                  • +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  + +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +
                                                                                  +
                                                                                    +
                                                                                  • 1
                                                                                  • +
                                                                                  +
                                                                                  +
                                                                                  + +
                                                                                  +
                                                                                    +
                                                                                  • 1
                                                                                  • +
                                                                                  +
                                                                                    +
                                                                                  1. 1
                                                                                  2. +
                                                                                  +
                                                                                  + +
                                                                                  +
                                                                                    +
                                                                                  1. 1
                                                                                  2. +
                                                                                  +
                                                                                    +
                                                                                  • 1
                                                                                  • +
                                                                                  +
                                                                                  + +
                                                                                  +
                                                                                  +
                                                                                    +
                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                      +
                                                                                    • 1 +
                                                                                        +
                                                                                      • 3
                                                                                      • +
                                                                                      • 4
                                                                                      • +
                                                                                      +
                                                                                    • +
                                                                                    • 2
                                                                                    • +
                                                                                    +
                                                                                    +
                                                                                    +
                                                                                    + +
                                                                                    +
                                                                                      +
                                                                                    • 1
                                                                                    • +
                                                                                    • 2
                                                                                    • +
                                                                                    +
                                                                                    +
                                                                                    +
                                                                                    + +
                                                                                    + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.js new file mode 100644 index 0000000..1323c77 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_deprecated.js @@ -0,0 +1,576 @@ +(function( $ ) { + +module( "tabs (deprecated): core" ); + +test( "panel ids", function() { + expect( 2 ); + + var element = $( "#tabs2" ).tabs(); + + element.one( "tabsbeforeload", function( event, ui ) { + equal( ui.panel.attr( "id" ), "∫ßáö_Սե", "from title attribute" ); + event.preventDefault(); + }); + element.tabs( "option", "active", 4 ); + + element.one( "tabsbeforeload", function( event, ui ) { + ok( /^ui-tabs-\d+$/.test( ui.panel.attr( "id" ) ), "generated id" ); + event.preventDefault(); + }); + element.tabs( "option", "active", 2 ); +}); + +module( "tabs (deprecated): options" ); + +asyncTest( "ajaxOptions", function() { + expect( 1 ); + + var element = $( "#tabs2" ).tabs({ + ajaxOptions: { + converters: { + "text html": function() { + return "test"; + } + } + } + }); + element.one( "tabsload", function( event, ui ) { + equals( $( ui.panel ).html(), "test" ); + start(); + }); + element.tabs( "option", "active", 2 ); +}); + +asyncTest( "cache", function() { + expect( 5 ); + + var element = $( "#tabs2" ).tabs({ + cache: true + }); + element.one( "tabsshow", function( event, ui ) { + tabs_state( element, 0, 0, 1, 0, 0 ); + }); + element.one( "tabsload", function( event, ui ) { + ok( true, "tabsload" ); + + setTimeout(function() { + element.tabs( "option", "active", 0 ); + tabs_state( element, 1, 0, 0, 0, 0 ); + + element.one( "tabsshow", function( event, ui ) { + tabs_state( element, 0, 0, 1, 0, 0 ); + }); + element.one( "tabsload", function( event, ui ) { + ok( false, "should be cached" ); + }); + element.tabs( "option", "active", 2 ); + start(); + }, 1 ); + }); + element.tabs( "option", "active", 2 ); + tabs_state( element, 0, 0, 1, 0, 0 ); +}); + +test( "idPrefix", function() { + expect( 1 ); + + $( "#tabs2" ) + .one( "tabsbeforeload", function( event, ui ) { + ok( /^testing-\d+$/.test( ui.panel.attr( "id" ) ), "generated id" ); + event.preventDefault(); + }) + .tabs({ + idPrefix: "testing-", + active: 2 + }); +}); + +test( "tabTemplate + panelTemplate", function() { + // defaults are tested in the add method test + expect( 11 ); + + var element = $( "#tabs2" ).tabs({ + tabTemplate: "
                                                                                  • #{label}
                                                                                  • ", + panelTemplate: "
                                                                                    " + }); + element.one( "tabsadd", function( event, ui ) { + var anchor = $( ui.tab ); + equal( ui.index, 5, "ui.index" ); + equal( anchor.text(), "New", "ui.tab" ); + equal( anchor.attr( "href" ), "http://example.com/#new", "tab href" ); + ok( anchor.parent().hasClass( "customTab" ), "tab custom class" ); + equal( ui.panel.id, "new", "ui.panel" ); + ok( $( ui.panel ).hasClass( "customPanel" ), "panel custom class" ); + }); + element.tabs( "add", "#new", "New" ); + var tab = element.find( ".ui-tabs-nav li" ).last(), + anchor = tab.find( "a" ); + equals( tab.text(), "New", "label" ); + ok( tab.hasClass( "customTab" ), "tab custom class" ); + equals( anchor.attr( "href" ), "http://example.com/#new", "href" ); + equals( anchor.attr( "aria-controls" ), "new", "aria-controls" ); + ok( element.find( "#new" ).hasClass( "customPanel" ), "panel custom class" ); +}); + +test( "cookie", function() { + expect( 6 ); + + var element = $( "#tabs1" ), + cookieName = "tabs_test", + cookieObj = { name: cookieName }; + $.cookie( cookieName, null ); + function cookie() { + return parseInt( $.cookie( cookieName ), 10 ); + } + + element.tabs({ cookie: cookieObj }); + equals( cookie(), 0, "initial cookie value" ); + + element.tabs( "destroy" ); + element.tabs({ active: 1, cookie: cookieObj }); + equals( cookie(), 1, "initial cookie value, from active property" ); + + element.tabs( "option", "active", 2 ); + equals( cookie(), 2, "cookie value updated after activating" ); + + element.tabs( "destroy" ); + $.cookie( cookieName, 1 ); + element.tabs({ cookie: cookieObj }); + equals( cookie(), 1, "initial cookie value, from existing cookie" ); + + element.tabs( "destroy" ); + element.tabs({ cookie: cookieObj, collapsible: true }); + element.tabs( "option", "active", false ); + equals( cookie(), -1, "cookie value for all tabs unselected" ); + + element.tabs( "destroy" ); + ok( $.cookie( cookieName ) === null, "erase cookie after destroy" ); +}); + +asyncTest( "spinner", function() { + expect( 2 ); + + var element = $( "#tabs2" ).tabs(); + + element.one( "tabsbeforeload", function( event, ui ) { + equals( element.find( ".ui-tabs-nav li:eq(2) em" ).length, 1, "beforeload" ); + }); + element.one( "tabsload", function( event, ui ) { + // wait until after the load finishes before checking for the spinner to be removed + setTimeout(function() { + equals( element.find( ".ui-tabs-nav li:eq(2) em" ).length, 0, "load" ); + start(); + }, 1 ); + }); + element.tabs( "option", "active", 2 ); +}); + +test( "selected", function() { + expect( 19 ); + + var element = $( "#tabs1" ).tabs(); + equals( element.tabs( "option", "selected" ), 0, "should be 0 by default" ); + tabs_state( element, 1, 0, 0 ); + element.tabs( "destroy" ); + + location.hash = "#fragment-3"; + element = $( "#tabs1" ).tabs(); + equals( element.tabs( "option", "selected" ), 2, "should be 2 based on URL" ); + tabs_state( element, 0, 0, 1 ); + element.tabs( "destroy" ); + + el = $('#tabs1').tabs({ + selected: -1, + collapsible: true + }); + tabs_state( element, 0, 0, 0 ); + equal( element.find( ".ui-tabs-nav .ui-state-active" ).size(), 0, "no tabs selected" ); + strictEqual( element.tabs( "option", "selected" ), -1 ); + + element.tabs( "option", "collapsible", false ); + tabs_state( element, 1, 0, 0 ); + equal( element.tabs( "option", "selected" ), 0 ); + element.tabs( "destroy" ); + + element.tabs({ + selected: -1 + }); + tabs_state( element, 1, 0, 0 ); + strictEqual( element.tabs( "option", "selected" ), 0 ); + element.tabs( "destroy" ); + + element.tabs({ selected: 2 }); + equals( element.tabs( "option", "selected" ), 2 ); + tabs_state( element, 0, 0, 1 ); + + element.tabs( "option", "selected", 0 ); + equals( element.tabs( "option", "selected" ), 0 ); + tabs_state( element, 1, 0, 0 ); + + element.find( ".ui-tabs-nav a" ).eq( 1 ).click(); + equals( element.tabs( "option", "selected" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + element.tabs( "option", "selected", 10 ); + equals( element.tabs( "option", "selected" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + location.hash = "#"; +}); + +module( "tabs (deprecated): events" ); + +asyncTest( "load", function() { + expect( 15 ); + + var tab, panelId, panel, + element = $( "#tabs2" ); + + // init + element.one( "tabsload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 2 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + strictEqual( ui.tab, tab[ 0 ], "tab" ); + strictEqual( ui.panel, panel[ 0 ], "panel" ); + equals( $( ui.panel ).find( "p" ).length, 1, "panel html" ); + tabs_state( element, 0, 0, 1, 0, 0 ); + tabsload1(); + }); + element.tabs({ active: 2 }); + + function tabsload1() { + // .option() + element.one( "tabsload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 3 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + strictEqual( ui.tab, tab[ 0 ], "tab" ); + strictEqual( ui.panel, panel[ 0 ], "panel" ); + equals( $( ui.panel ).find( "p" ).length, 1, "panel html" ); + tabs_state( element, 0, 0, 0, 1, 0 ); + tabsload2(); + }); + element.tabs( "option", "active", 3 ); + } + + function tabsload2() { + // click, change panel content + element.one( "tabsload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 4 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + equals( event.originalEvent.type, "click", "originalEvent" ); + strictEqual( ui.tab, tab[ 0 ], "tab" ); + strictEqual( ui.panel, panel[ 0 ], "panel" ); + equals( $( ui.panel ).find( "p" ).length, 1, "panel html" ); + tabs_state( element, 0, 0, 0, 0, 1 ); + start(); + }); + element.find( ".ui-tabs-nav a" ).eq( 4 ).click(); + } +}); + +test( "enable", function() { + expect( 3 ); + + var element = $( "#tabs1" ).tabs({ + disabled: [ 0, 1 ], + enable: function ( event, ui ) { + equals( ui.tab, element.find( ".ui-tabs-nav a" )[ 1 ], "ui.tab" ); + equals( ui.panel, element.find( ".ui-tabs-panel" )[ 1 ], "ui.panel" ); + equals( ui.index, 1, "ui.index" ); + } + }); + element.tabs( "enable", 1 ); + // shouldn't trigger event + element.tabs( "enable", 2 ); +}); + +test( "disable", function() { + expect( 3 ); + + var element = $( "#tabs1" ).tabs({ + disable: function ( event, ui ) { + equals( ui.tab, element.find( ".ui-tabs-nav a" )[ 1 ], "ui.tab" ); + equals( ui.panel, element.find( ".ui-tabs-panel" )[ 1 ], "ui.panel" ); + equals( ui.index, 1, "ui.index" ); + } + }); + element.tabs( "disable", 1 ); + // shouldn't trigger event + element.tabs( "disable", 1 ); +}); + + +test( "show", function() { + expect( 13 ); + + var element = $( "#tabs1" ).tabs({ + active: false, + collapsible: true + }), + tabs = element.find( ".ui-tabs-nav a" ), + panels = element.find( ".ui-tabs-panel" ); + + // from collapsed + element.one( "tabsshow", function( event, ui ) { + ok( !( "originalEvent" in event ), "originalEvent" ); + strictEqual( ui.tab, tabs[ 0 ], "ui.tab" ); + strictEqual( ui.panel, panels[ 0 ], "ui.panel" ); + equal( ui.index, 0, "ui.index" ); + tabs_state( element, 1, 0, 0 ); + }); + element.tabs( "option", "active", 0 ); + tabs_state( element, 1, 0, 0 ); + + // switching tabs + element.one( "tabsshow", function( event, ui ) { + equals( event.originalEvent.type, "click", "originalEvent" ); + strictEqual( ui.tab, tabs[ 1 ], "ui.tab" ); + strictEqual( ui.panel, panels[ 1 ], "ui.panel" ); + equal( ui.index, 1, "ui.index" ); + tabs_state( element, 0, 1, 0 ); + }); + tabs.eq( 1 ).click(); + tabs_state( element, 0, 1, 0 ); + + // collapsing + element.one( "tabsshow", function( event, ui ) { + ok( false, "collapsing" ); + }); + element.tabs( "option", "active", false ); + tabs_state( element, 0, 0, 0 ); +}); + +test( "select", function() { + expect( 13 ); + + var element = $( "#tabs1" ).tabs({ + active: false, + collapsible: true + }), + tabs = element.find( ".ui-tabs-nav a" ), + panels = element.find( ".ui-tabs-panel" ); + + // from collapsed + element.one( "tabsselect", function( event, ui ) { + ok( !( "originalEvent" in event ), "originalEvent" ); + strictEqual( ui.tab, tabs[ 0 ], "ui.tab" ); + strictEqual( ui.panel, panels[ 0 ], "ui.panel" ); + equal( ui.index, 0, "ui.index" ); + tabs_state( element, 0, 0, 0 ); + }); + element.tabs( "option", "active", 0 ); + tabs_state( element, 1, 0, 0 ); + + // switching tabs + element.one( "tabsselect", function( event, ui ) { + equals( event.originalEvent.type, "click", "originalEvent" ); + strictEqual( ui.tab, tabs[ 1 ], "ui.tab" ); + strictEqual( ui.panel, panels[ 1 ], "ui.panel" ); + equal( ui.index, 1, "ui.index" ); + tabs_state( element, 1, 0, 0 ); + }); + tabs.eq( 1 ).click(); + tabs_state( element, 0, 1, 0 ); + + // collapsing + element.one( "tabsselect", function( event, ui ) { + ok( false, "collapsing" ); + }); + element.tabs( "option", "active", false ); + tabs_state( element, 0, 0, 0 ); +}); + +module( "tabs (deprecated): methods" ); + +test( "add", function() { + expect( 27 ); + + var element = $( "#tabs1" ).tabs(); + tabs_state( element, 1, 0, 0 ); + + // add without index + element.one( "tabsadd", function( event, ui ) { + equal( ui.index, 3, "ui.index" ); + equal( $( ui.tab ).text(), "New", "ui.tab" ); + equal( ui.panel.id, "new", "ui.panel" ); + }); + element.tabs( "add", "#new", "New" ); + tabs_state( element, 1, 0, 0, 0 ); + var tab = element.find( ".ui-tabs-nav li" ).last(), + anchor = tab.find( "a" ); + equals( tab.text(), "New", "label" ); + equals( anchor.attr( "href" ), "#new", "href" ); + equals( anchor.attr( "aria-controls" ), "new", "aria-controls" ); + ok( !tab.hasClass( "ui-state-hover" ), "not hovered" ); + anchor.simulate( "mouseover" ); + ok( tab.hasClass( "ui-state-hover" ), "hovered" ); + anchor.simulate( "click" ); + tabs_state( element, 0, 0, 0, 1 ); + + // add remote tab with index + element.one( "tabsadd", function( event, ui ) { + equal( ui.index, 1, "ui.index" ); + equal( $( ui.tab ).text(), "New Remote", "ui.tab" ); + equal( ui.panel.id, $( ui.tab ).attr( "aria-controls" ), "ui.panel" ); + }); + element.tabs( "add", "data/test.html", "New Remote", 1 ); + tabs_state( element, 0, 0, 0, 0, 1 ); + tab = element.find( ".ui-tabs-nav li" ).eq( 1 ); + anchor = tab.find( "a" ); + equals( tab.text(), "New Remote", "label" ); + equals( anchor.attr( "href" ), "data/test.html", "href" ); + ok( /^ui-tabs-\d+$/.test( anchor.attr( "aria-controls" ) ), "aria controls" ); + ok( !tab.hasClass( "ui-state-hover" ), "not hovered" ); + anchor.simulate( "mouseover" ); + ok( tab.hasClass( "ui-state-hover" ), "hovered" ); + anchor.simulate( "click" ); + tabs_state( element, 0, 1, 0, 0, 0 ); + + // add to empty tab set + element = $( "
                                                                                      " ).tabs(); + equals( element.tabs( "option", "active" ), false, "active: false on init" ); + element.one( "tabsadd", function( event, ui ) { + equal( ui.index, 0, "ui.index" ); + equal( $( ui.tab ).text(), "First", "ui.tab" ); + equal( ui.panel.id, "first", "ui.panel" ); + }); + element.tabs( "add", "#first", "First" ); + tabs_state( element, 1 ); + equals( element.tabs( "option", "active" ), 0, "active: 0 after add" ); +}); + +test( "#5069 - ui.tabs.add creates two tab panels when using a full URL", function() { + expect( 2 ); + + var element = $( "#tabs2" ).tabs(); + equals( element.children( "div" ).length, element.find( ".ui-tabs-nav li" ).length ); + element.tabs( "add", "/new", "New" ); + equals( element.children( "div" ).length, element.find( ".ui-tabs-nav li" ).length ); +}); + +test( "remove", function() { + expect( 17 ); + + var element = $( "#tabs1" ).tabs({ active: 1 }); + tabs_state( element, 0, 1, 0 ); + + element.one( "tabsremove", function( event, ui ) { + equal( ui.index, -1, "ui.index" ); + equal( $( ui.tab ).text(), "2", "ui.tab" ); + equal( ui.panel.id, "fragment-2", "ui.panel" ); + }); + element.tabs( "remove", 1 ); + tabs_state( element, 0, 1 ); + equals( element.tabs( "option", "active" ), 1 ); + equals( element.find( ".ui-tabs-nav li a[href$='fragment-2']" ).length, 0, + "remove correct list item" ); + equals( element.find( "#fragment-2" ).length, 0, "remove correct panel" ); + + element.one( "tabsremove", function( event, ui ) { + equal( ui.index, -1, "ui.index" ); + equal( $( ui.tab ).text(), "3", "ui.tab" ); + equal( ui.panel.id, "fragment-3", "ui.panel" ); + }); + element.tabs( "remove", 1 ); + tabs_state( element, 1 ); + equals( element.tabs( "option", "active"), 0 ); + + element.one( "tabsremove", function( event, ui ) { + equal( ui.index, -1, "ui.index" ); + equal( $( ui.tab ).text(), "1", "ui.tab" ); + equal( ui.panel.id, "fragment-1", "ui.panel" ); + }); + element.tabs( "remove", 0 ); + equals( element.tabs( "option", "active" ), false ); +}); + +test( "select", function() { + expect( 23 ); + + var element = $( "#tabs1" ).tabs(); + tabs_state( element, 1, 0, 0 ); + element.tabs( "select", 1 ); + tabs_state( element, 0, 1, 0 ); + equals( element.tabs( "option", "active" ), 1, "active" ); + equals( element.tabs( "option", "selected" ), 1, "selected" ); + element.tabs( "destroy" ); + + element.tabs({ collapsible: true }); + tabs_state( element, 1, 0, 0 ); + element.tabs( "select", 0 ); + tabs_state( element, 0, 0, 0 ); + equals( element.tabs( "option", "active" ), false, "active" ); + equals( element.tabs( "option", "selected" ), -1, "selected" ); + element.tabs( "destroy" ); + + element.tabs({ collapsible: true }); + element.tabs( "select", -1 ); + tabs_state( element, 0, 0, 0 ); + equals( element.tabs( "option", "active" ), false, "active" ); + equals( element.tabs( "option", "selected" ), -1, "selected" ); + element.tabs( "destroy" ); + + element.tabs(); + tabs_state( element, 1, 0, 0 ); + equals( element.tabs( "option", "active" ), 0, "active" ); + equals( element.tabs( "option", "selected" ), 0, "selected" ); + element.tabs( "select", 0 ); + tabs_state( element, 1, 0, 0 ); + equals( element.tabs( "option", "active" ), 0, "active" ); + equals( element.tabs( "option", "selected" ), 0, "selected" ); + element.tabs( "select", -1 ); + tabs_state( element, 1, 0, 0 ); + equals( element.tabs( "option", "active" ), 0, "active" ); + equals( element.tabs( "option", "selected" ), 0, "selected" ); + + element.tabs( "select", "#fragment-2" ); + tabs_state( element, 0, 1, 0 ); + equals( element.tabs( "option", "active" ), 1, "active" ); + equals( element.tabs( "option", "selected" ), 1, "selected" ); +}); + +test( "length", function() { + expect( 2 ); + + equals( $( "#tabs1" ).tabs().tabs( "length" ), 3, "basic tabs" ); + equals( $( "#tabs2" ).tabs().tabs( "length" ), 5, "ajax tabs with missing panels" ); +}); + +test( "url", function() { + expect( 2 ); + + var element = $( "#tabs2" ).tabs(), + tab = element.find( "a" ).eq( 3 ); + + element.tabs( "url", 3, "data/test2.html" ); + equals( tab.attr( "href" ), "data/test2.html", "href was updated" ); + element.one( "tabsbeforeload", function( event, ui ) { + equals( ui.ajaxSettings.url, "data/test2.html", "ajaxSettings.url" ); + event.preventDefault(); + }); + element.tabs( "option", "active", 3 ); +}); + +asyncTest( "abort", function() { + expect( 1 ); + + var element = $( "#tabs2" ).tabs(); + element.one( "tabsbeforeload", function( event, ui ) { + ui.jqXHR.error(function( jqXHR, status ) { + equals( status, "abort", "aborted" ); + start(); + }); + }); + element.tabs( "option", "active", 2 ); + element.tabs( "abort" ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_events.js new file mode 100644 index 0000000..f5cde18 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_events.js @@ -0,0 +1,277 @@ +(function( $ ) { + +module( "tabs: events" ); + +test( "beforeActivate", function() { + expect( 38 ); + + var element = $( "#tabs1" ).tabs({ + active: false, + collapsible: true + }), + tabs = element.find( ".ui-tabs-nav a" ), + panels = element.find( ".ui-tabs-panel" ); + + // from collapsed + element.one( "tabsbeforeactivate", function( event, ui ) { + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.oldTab.size(), 0, "oldTab size" ); + equals( ui.oldPanel.size(), 0, "oldPanel size" ); + equals( ui.newTab.size(), 1, "newTab size" ); + strictEqual( ui.newTab[ 0 ], tabs[ 0 ], "newTab" ); + equals( ui.newPanel.size(), 1, "newPanel size" ); + strictEqual( ui.newPanel[ 0 ], panels[ 0 ], "newPanel" ); + tabs_state( element, 0, 0, 0 ); + }); + element.tabs( "option", "active", 0 ); + tabs_state( element, 1, 0, 0 ); + + // switching tabs + element.one( "tabsbeforeactivate", function( event, ui ) { + equals( event.originalEvent.type, "click", "originalEvent" ); + equals( ui.oldTab.size(), 1, "oldTab size" ); + strictEqual( ui.oldTab[ 0 ], tabs[ 0 ], "oldTab" ); + equals( ui.oldPanel.size(), 1, "oldPanel size" ); + strictEqual( ui.oldPanel[ 0 ], panels[ 0 ], "oldPanel" ); + equals( ui.newTab.size(), 1, "newTab size" ); + strictEqual( ui.newTab[ 0 ], tabs[ 1 ], "newTab" ); + equals( ui.newPanel.size(), 1, "newPanel size" ); + strictEqual( ui.newPanel[ 0 ], panels[ 1 ], "newPanel" ); + tabs_state( element, 1, 0, 0 ); + }); + tabs.eq( 1 ).click(); + tabs_state( element, 0, 1, 0 ); + + // collapsing + element.one( "tabsbeforeactivate", function( event, ui ) { + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.oldTab.size(), 1, "oldTab size" ); + strictEqual( ui.oldTab[ 0 ], tabs[ 1 ], "oldTab" ); + equals( ui.oldPanel.size(), 1, "oldPanel size" ); + strictEqual( ui.oldPanel[ 0 ], panels[ 1 ], "oldPanel" ); + equals( ui.newTab.size(), 0, "newTab size" ); + equals( ui.newPanel.size(), 0, "newPanel size" ); + tabs_state( element, 0, 1, 0 ); + }); + element.tabs( "option", "active", false ); + tabs_state( element, 0, 0, 0 ); + + // prevent activation + element.one( "tabsbeforeactivate", function( event, ui ) { + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.oldTab.size(), 0, "oldTab size" ); + equals( ui.oldPanel.size(), 0, "oldTab" ); + equals( ui.newTab.size(), 1, "newTab size" ); + strictEqual( ui.newTab[ 0 ], tabs[ 1 ], "newTab" ); + equals( ui.newPanel.size(), 1, "newPanel size" ); + strictEqual( ui.newPanel[ 0 ], panels[ 1 ], "newPanel" ); + event.preventDefault(); + tabs_state( element, 0, 0, 0 ); + }); + element.tabs( "option", "active", 1 ); + tabs_state( element, 0, 0, 0 ); +}); + +test( "activate", function() { + expect( 30 ); + + var element = $( "#tabs1" ).tabs({ + active: false, + collapsible: true + }), + tabs = element.find( ".ui-tabs-nav a" ), + panels = element.find( ".ui-tabs-panel" ); + + // from collapsed + element.one( "tabsactivate", function( event, ui ) { + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.oldTab.size(), 0, "oldTab size" ); + equals( ui.oldPanel.size(), 0, "oldPanel size" ); + equals( ui.newTab.size(), 1, "newTab size" ); + strictEqual( ui.newTab[ 0 ], tabs[ 0 ], "newTab" ); + equals( ui.newPanel.size(), 1, "newPanel size" ); + strictEqual( ui.newPanel[ 0 ], panels[ 0 ], "newPanel" ); + tabs_state( element, 1, 0, 0 ); + }); + element.tabs( "option", "active", 0 ); + tabs_state( element, 1, 0, 0 ); + + // switching tabs + element.one( "tabsactivate", function( event, ui ) { + equals( event.originalEvent.type, "click", "originalEvent" ); + equals( ui.oldTab.size(), 1, "oldTab size" ); + strictEqual( ui.oldTab[ 0 ], tabs[ 0 ], "oldTab" ); + equals( ui.oldPanel.size(), 1, "oldPanel size" ); + strictEqual( ui.oldPanel[ 0 ], panels[ 0 ], "oldPanel" ); + equals( ui.newTab.size(), 1, "newTab size" ); + strictEqual( ui.newTab[ 0 ], tabs[ 1 ], "newTab" ); + equals( ui.newPanel.size(), 1, "newPanel size" ); + strictEqual( ui.newPanel[ 0 ], panels[ 1 ], "newPanel" ); + tabs_state( element, 0, 1, 0 ); + }); + tabs.eq( 1 ).click(); + tabs_state( element, 0, 1, 0 ); + + // collapsing + element.one( "tabsactivate", function( event, ui ) { + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.oldTab.size(), 1, "oldTab size" ); + strictEqual( ui.oldTab[ 0 ], tabs[ 1 ], "oldTab" ); + equals( ui.oldPanel.size(), 1, "oldPanel size" ); + strictEqual( ui.oldPanel[ 0 ], panels[ 1 ], "oldPanel" ); + equals( ui.newTab.size(), 0, "newTab size" ); + equals( ui.newPanel.size(), 0, "newPanel size" ); + tabs_state( element, 0, 0, 0 ); + }); + element.tabs( "option", "active", false ); + tabs_state( element, 0, 0, 0 ); + + // prevent activation + element.one( "tabsbeforeactivate", function( event ) { + ok( true, "tabsbeforeactivate" ); + event.preventDefault(); + }); + element.one( "tabsactivate", function() { + ok( false, "tabsactivate" ); + }); + element.tabs( "option", "active", 1 ); +}); + +test( "beforeLoad", function() { + expect( 32 ); + + var tab, panelId, panel, + element = $( "#tabs2" ); + + // init + element.one( "tabsbeforeload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 2 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + ok( "abort" in ui.jqXHR, "jqXHR" ); + ok( ui.ajaxSettings.url, "data/test.html", "ajaxSettings.url" ); + equals( ui.tab.size(), 1, "tab size" ); + strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" ); + equals( ui.panel.size(), 1, "panel size" ); + strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" ); + equals( ui.panel.html(), "", "panel html" ); + event.preventDefault(); + tabs_state( element, 0, 0, 1, 0, 0 ); + }); + element.tabs({ active: 2 }); + tabs_state( element, 0, 0, 1, 0, 0 ); + equals( panel.html(), "", "panel html after" ); + element.tabs( "destroy" ); + + // .option() + element.one( "tabsbeforeload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 2 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + ok( "abort" in ui.jqXHR, "jqXHR" ); + ok( ui.ajaxSettings.url, "data/test.html", "ajaxSettings.url" ); + equals( ui.tab.size(), 1, "tab size" ); + strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" ); + equals( ui.panel.size(), 1, "panel size" ); + strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" ); + equals( ui.panel.html(), "", "panel html" ); + event.preventDefault(); + tabs_state( element, 1, 0, 0, 0, 0 ); + }); + element.tabs(); + element.tabs( "option", "active", 2 ); + tabs_state( element, 0, 0, 1, 0, 0 ); + equals( panel.html(), "", "panel html after" ); + + // click, change panel content + element.one( "tabsbeforeload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 3 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + equals( event.originalEvent.type, "click", "originalEvent" ); + ok( "abort" in ui.jqXHR, "jqXHR" ); + ok( ui.ajaxSettings.url, "data/test.html", "ajaxSettings.url" ); + equals( ui.tab.size(), 1, "tab size" ); + strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" ); + equals( ui.panel.size(), 1, "panel size" ); + strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" ); + ui.panel.html( "

                                                                                      testing

                                                                                      " ); + event.preventDefault(); + tabs_state( element, 0, 0, 1, 0, 0 ); + }); + element.find( ".ui-tabs-nav a" ).eq( 3 ).click(); + tabs_state( element, 0, 0, 0, 1, 0 ); + // .toLowerCase() is needed to convert

                                                                                      to

                                                                                      in old IEs + equals( panel.html().toLowerCase(), "

                                                                                      testing

                                                                                      ", "panel html after" ); +}); + +if ( $.uiBackCompat === false ) { + asyncTest( "load", function() { + expect( 21 ); + + var tab, panelId, panel, + element = $( "#tabs2" ); + + // init + element.one( "tabsload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 2 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.tab.size(), 1, "tab size" ); + strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" ); + equals( ui.panel.size(), 1, "panel size" ); + strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" ); + equals( ui.panel.find( "p" ).length, 1, "panel html" ); + tabs_state( element, 0, 0, 1, 0, 0 ); + tabsload1(); + }); + element.tabs({ active: 2 }); + + function tabsload1() { + // .option() + element.one( "tabsload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 3 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.tab.size(), 1, "tab size" ); + strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" ); + equals( ui.panel.size(), 1, "panel size" ); + strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" ); + equals( ui.panel.find( "p" ).length, 1, "panel html" ); + tabs_state( element, 0, 0, 0, 1, 0 ); + tabsload2(); + }); + element.tabs( "option", "active", 3 ); + } + + function tabsload2() { + // click, change panel content + element.one( "tabsload", function( event, ui ) { + tab = element.find( ".ui-tabs-nav a" ).eq( 4 ); + panelId = tab.attr( "aria-controls" ); + panel = $( "#" + panelId ); + + equals( event.originalEvent.type, "click", "originalEvent" ); + equals( ui.tab.size(), 1, "tab size" ); + strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" ); + equals( ui.panel.size(), 1, "panel size" ); + strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" ); + equals( ui.panel.find( "p" ).length, 1, "panel html" ); + tabs_state( element, 0, 0, 0, 0, 1 ); + start(); + }); + element.find( ".ui-tabs-nav a" ).eq( 4 ).click(); + } + }); +} + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_methods.js new file mode 100644 index 0000000..b62f7bb --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_methods.js @@ -0,0 +1,237 @@ +(function( $ ) { + +module( "tabs: methods" ); + +test( "destroy", function() { + domEqual( "#tabs1", function() { + $( "#tabs1" ).tabs().tabs( "destroy" ); + }); +}); + +test( "enable", function() { + expect( 8 ); + + var element = $( "#tabs1" ).tabs({ disabled: true }); + tabs_disabled( element, true ); + element.tabs( "enable" ); + tabs_disabled( element, false ); + element.tabs( "destroy" ); + + element.tabs({ disabled: [ 0, 1 ] }); + tabs_disabled( element, [ 0, 1 ] ); + element.tabs( "enable" ); + tabs_disabled( element, false ); +}); + +test( "enable( index )", function() { + expect( 10 ); + + var element = $( "#tabs1" ).tabs({ disabled: true }); + tabs_disabled( element, true ); + // fully disabled -> partially disabled + element.tabs( "enable", 1 ); + tabs_disabled( element, [ 0, 2 ] ); + // partially disabled -> partially disabled + element.tabs( "enable", 2 ); + tabs_disabled( element, [ 0 ] ); + // already enabled tab, no change + element.tabs( "enable", 2 ); + tabs_disabled( element, [ 0 ] ); + // partially disabled -> fully enabled + element.tabs( "enable", 0 ); + tabs_disabled( element, false ); +}); + +test( "disable", function() { + expect( 8 ); + + var element = $( "#tabs1" ).tabs({ disabled: false }); + tabs_disabled( element, false ); + element.tabs( "disable" ); + tabs_disabled( element, true ); + element.tabs( "destroy" ); + + element.tabs({ disabled: [ 0, 1 ] }); + tabs_disabled( element, [ 0, 1 ] ); + element.tabs( "disable" ); + tabs_disabled( element, true ); +}); + +test( "disable( index )", function() { + expect( 10 ); + + var element = $( "#tabs1" ).tabs({ disabled: false }); + tabs_disabled( element, false ); + // fully enabled -> partially disabled + element.tabs( "disable", 1 ); + tabs_disabled( element, [ 1 ] ); + // partially disabled -> partially disabled + element.tabs( "disable", 2 ); + tabs_disabled( element, [ 1, 2 ] ); + // already disabled tab, no change + element.tabs( "disable", 2 ); + tabs_disabled( element, [ 1, 2 ] ); + // partially disabled -> fully disabled + element.tabs( "disable", 0 ); + tabs_disabled( element, true ); +}); + +test( "refresh", function() { + expect( 27 ); + + var element = $( "#tabs1" ).tabs(); + tabs_state( element, 1, 0, 0 ); + tabs_disabled( element, false ); + + // disable tab via markup + element.find( ".ui-tabs-nav li" ).eq( 1 ).addClass( "ui-state-disabled" ); + element.tabs( "refresh" ); + tabs_state( element, 1, 0, 0 ); + tabs_disabled( element, [ 1 ] ); + + // add remote tab + element.find( ".ui-tabs-nav" ).append( "
                                                                                    • new
                                                                                    • " ); + element.tabs( "refresh" ); + tabs_state( element, 1, 0, 0, 0 ); + tabs_disabled( element, [ 1 ] ); + equals( element.find( "#" + $( "#newTab a" ).attr( "aria-controls" ) ).length, 1, + "panel added for remote tab" ); + + // remove all tabs + element.find( ".ui-tabs-nav li, .ui-tabs-panel" ).remove(); + element.tabs( "refresh" ); + tabs_state( element ); + equals( element.tabs( "option", "active" ), false, "no active tab" ); + + // add tabs + element.find( ".ui-tabs-nav" ) + .append( "
                                                                                    • new 2
                                                                                    • " ) + .append( "
                                                                                    • new 3
                                                                                    • " ) + .append( "
                                                                                    • new 4
                                                                                    • " ) + .append( "
                                                                                    • new 5
                                                                                    • " ); + element + .append( "
                                                                                      new 2
                                                                                      " ) + .append( "
                                                                                      new 3
                                                                                      " ) + .append( "
                                                                                      new 4
                                                                                      " ) + .append( "
                                                                                      new 5
                                                                                      " ); + element.tabs( "refresh" ); + tabs_state( element, 0, 0, 0, 0 ); + tabs_disabled( element, [ 0 ] ); + + // activate third tab + element.tabs( "option", "active", 2 ); + tabs_state( element, 0, 0, 1, 0 ); + tabs_disabled( element, [ 0 ] ); + + // remove fourth tab, third tab should stay active + element.find( ".ui-tabs-nav li" ).eq( 3 ).remove(); + element.find( ".ui-tabs-panel" ).eq( 3 ).remove(); + element.tabs( "refresh" ); + tabs_state( element, 0, 0, 1 ); + tabs_disabled( element, [ 0 ] ); + + // remove third (active) tab, second tab should become active + element.find( ".ui-tabs-nav li" ).eq( 2 ).remove(); + element.find( ".ui-tabs-panel" ).eq( 2 ).remove(); + element.tabs( "refresh" ); + tabs_state( element, 0, 1 ); + tabs_disabled( element, [ 0 ] ); + + // remove first tab, previously active tab (now first) should stay active + element.find( ".ui-tabs-nav li" ).eq( 0 ).remove(); + element.find( ".ui-tabs-panel" ).eq( 0 ).remove(); + element.tabs( "refresh" ); + tabs_state( element, 1 ); + tabs_disabled( element, false ); +}); + +asyncTest( "load", function() { + expect( 30 ); + + var element = $( "#tabs2" ).tabs(); + + // load content of inactive tab + // useful for preloading content with custom caching + element.one( "tabsbeforeload", function( event, ui ) { + var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ), + panelId = tab.attr( "aria-controls" ), + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.tab.size(), 1, "tab size" ); + strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" ); + equals( ui.panel.size(), 1, "panel size" ); + strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" ); + tabs_state( element, 1, 0, 0, 0, 0 ); + }); + element.one( "tabsload", function( event, ui ) { + // TODO: remove wrapping in 2.0 + var uiTab = $( ui.tab ), + uiPanel = $( ui.panel ); + + var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ), + panelId = tab.attr( "aria-controls" ), + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( uiTab.size(), 1, "tab size" ); + strictEqual( uiTab[ 0 ], tab[ 0 ], "tab" ); + equals( uiPanel.size(), 1, "panel size" ); + strictEqual( uiPanel[ 0 ], panel[ 0 ], "panel" ); + equals( uiPanel.find( "p" ).length, 1, "panel html" ); + tabs_state( element, 1, 0, 0, 0, 0 ); + setTimeout( tabsload1, 100 ); + }); + element.tabs( "load", 3 ); + tabs_state( element, 1, 0, 0, 0, 0 ); + + function tabsload1() { + // no need to test details of event (tested in events tests) + element.one( "tabsbeforeload", function() { + ok( true, "tabsbeforeload invoked" ); + }); + element.one( "tabsload", function() { + ok( true, "tabsload invoked" ); + setTimeout( tabsload2, 100 ); + }); + element.tabs( "option", "active", 3 ); + tabs_state( element, 0, 0, 0, 1, 0 ); + } + + function tabsload2() { + // reload content of active tab + element.one( "tabsbeforeload", function( event, ui ) { + var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ), + panelId = tab.attr( "aria-controls" ), + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( ui.tab.size(), 1, "tab size" ); + strictEqual( ui.tab[ 0 ], tab[ 0 ], "tab" ); + equals( ui.panel.size(), 1, "panel size" ); + strictEqual( ui.panel[ 0 ], panel[ 0 ], "panel" ); + tabs_state( element, 0, 0, 0, 1, 0 ); + }); + element.one( "tabsload", function( event, ui ) { + // TODO: remove wrapping in 2.0 + var uiTab = $( ui.tab ), + uiPanel = $( ui.panel ); + + var tab = element.find( ".ui-tabs-nav a" ).eq( 3 ), + panelId = tab.attr( "aria-controls" ), + panel = $( "#" + panelId ); + + ok( !( "originalEvent" in event ), "originalEvent" ); + equals( uiTab.size(), 1, "tab size" ); + strictEqual( uiTab[ 0 ], tab[ 0 ], "tab" ); + equals( uiPanel.size(), 1, "panel size" ); + strictEqual( uiPanel[ 0 ], panel[ 0 ], "panel" ); + tabs_state( element, 0, 0, 0, 1, 0 ); + start(); + }); + element.tabs( "load", 3 ); + tabs_state( element, 0, 0, 0, 1, 0 ); + } +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_options.js new file mode 100644 index 0000000..8d61c47 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tabs/tabs_options.js @@ -0,0 +1,213 @@ +(function( $ ) { + +module( "tabs: options" ); + +test( "{ active: default }", function() { + expect( 4 ); + + var element = $( "#tabs1" ).tabs(); + equals( element.tabs( "option", "active" ), 0, "should be 0 by default" ); + tabs_state( element, 1, 0, 0 ); + element.tabs( "destroy" ); + + location.hash = "#fragment-3"; + element = $( "#tabs1" ).tabs(); + equals( element.tabs( "option", "active" ), 2, "should be 2 based on URL" ); + tabs_state( element, 0, 0, 1 ); + element.tabs( "destroy" ); + location.hash = "#"; +}); + +test( "{ active: false }", function() { + expect( 7 ); + + var element = $( "#tabs1" ).tabs({ + active: false, + collapsible: true + }); + tabs_state( element, 0, 0, 0 ); + equal( element.find( ".ui-tabs-nav .ui-state-active" ).size(), 0, "no tabs selected" ); + strictEqual( element.tabs( "option", "active" ), false ); + + element.tabs( "option", "collapsible", false ); + tabs_state( element, 1, 0, 0 ); + equal( element.tabs( "option", "active" ), 0 ); + + element.tabs( "destroy" ); + element.tabs({ + active: false + }); + tabs_state( element, 1, 0, 0 ); + strictEqual( element.tabs( "option", "active" ), 0 ); +}); + +test( "{ active: Number }", function() { + expect( 8 ); + + var element = $( "#tabs1" ).tabs({ + active: 2 + }); + equals( element.tabs( "option", "active" ), 2 ); + tabs_state( element, 0, 0, 1 ); + + element.tabs( "option", "active", 0 ); + equals( element.tabs( "option", "active" ), 0 ); + tabs_state( element, 1, 0, 0 ); + + element.find( ".ui-tabs-nav a" ).eq( 1 ).click(); + equals( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + element.tabs( "option", "active", 10 ); + equals( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); +}); + +if ( $.uiBackCompat === false ) { + test( "{ active: -Number }", function() { + var element = $( "#tabs1" ).tabs({ + active: -1 + }); + equals( element.tabs( "option", "active" ), 2 ); + tabs_state( element, 0, 0, 1 ); + + element.tabs( "option", "active", -2 ); + equals( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + element.tabs( "option", "active", -10 ); + equals( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + element.tabs( "option", "active", -3 ); + equals( element.tabs( "option", "active" ), 0 ); + tabs_state( element, 1, 0, 0 ); + }); +} + +test( "active - mismatched tab/panel order", function() { + expect( 3 ); + + location.hash = "#tabs7-2"; + var element = $( "#tabs7" ).tabs(); + equals( element.tabs( "option", "active" ), 1, "should be 1 based on URL" ); + tabs_state( element, 0, 1 ); + element.tabs( "option", "active", 0 ); + tabs_state( element, 1, 0 ); + location.hash = "#"; +}); + +test( "{ collapsible: false }", function() { + expect( 4 ); + + var element = $( "#tabs1" ).tabs({ + active: 1 + }); + element.tabs( "option", "active", false ); + equal( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + element.find( ".ui-state-active a" ).eq( 1 ).click(); + equal( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); +}); + +test( "{ collapsible: true }", function() { + expect( 6 ); + + var element = $( "#tabs1" ).tabs({ + active: 1, + collapsible: true + }); + + element.tabs( "option", "active", false ); + equal( element.tabs( "option", "active" ), false ); + tabs_state( element, 0, 0, 0 ); + + element.tabs( "option", "active", 1 ); + equal( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + element.find( ".ui-state-active a" ).click(); + equal( element.tabs( "option", "active" ), false ); + tabs_state( element, 0, 0, 0 ); +}); + +test( "disabled", function() { + expect( 10 ); + + // fully enabled by default + var element = $( "#tabs1" ).tabs(); + tabs_disabled( element, false ); + + // disable single tab + element.tabs( "option", "disabled", [ 1 ] ); + tabs_disabled( element, [ 1 ] ); + + // disabled active tab + element.tabs( "option", "disabled", [ 0, 1 ] ); + tabs_disabled( element, [ 0, 1 ] ); + + // disable all tabs + element.tabs( "option", "disabled", [ 0, 1, 2 ] ); + tabs_disabled( element, true ); + + // enable all tabs + element.tabs( "option", "disabled", [] ); + tabs_disabled( element, false ); +}); + +test( "{ event: null }", function() { + expect( 5 ); + + var element = $( "#tabs1" ).tabs({ + event: null + }); + tabs_state( element, 1, 0, 0 ); + + element.tabs( "option", "active", 1 ); + equal( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + // ensure default click handler isn't bound + element.find( ".ui-tabs-nav a" ).eq( 2 ).click(); + equal( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); +}); + +test( "{ event: custom }", function() { + expect( 11 ); + + var element = $( "#tabs1" ).tabs({ + event: "custom1 custom2" + }); + tabs_state( element, 1, 0, 0 ); + + element.find( ".ui-tabs-nav a" ).eq( 1 ).trigger( "custom1" ); + equal( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + // ensure default click handler isn't bound + element.find( ".ui-tabs-nav a" ).eq( 2 ).trigger( "click" ); + equal( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); + + element.find( ".ui-tabs-nav a" ).eq( 2 ).trigger( "custom2" ); + equal( element.tabs( "option", "active" ), 2 ); + tabs_state( element, 0, 0, 1 ); + + element.tabs( "option", "event", "custom3" ); + + // ensure old event handlers are unbound + element.find( ".ui-tabs-nav a" ).eq( 1 ).trigger( "custom1" ); + equal( element.tabs( "option", "active" ), 2 ); + tabs_state( element, 0, 0, 1 ); + + element.find( ".ui-tabs-nav a" ).eq( 1 ).trigger( "custom3" ); + equal( element.tabs( "option", "active" ), 1 ); + tabs_state( element, 0, 1, 0 ); +}); + +// TODO: add animation tests + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/testsuite.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/testsuite.js new file mode 100644 index 0000000..c8afcbe --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/testsuite.js @@ -0,0 +1,105 @@ +(function() { + +function testWidgetDefaults( widget, defaults ) { + var pluginDefaults = $.ui[ widget ].prototype.options; + + // ensure that all defaults have the correct value + test( "defined defaults", function() { + $.each( defaults, function( key, val ) { + if ( $.isFunction( val ) ) { + ok( $.isFunction( pluginDefaults[ key ] ), key ); + return; + } + same( pluginDefaults[ key ], val, key ); + }); + }); + + // ensure that all defaults were tested + test( "tested defaults", function() { + $.each( pluginDefaults, function( key, val ) { + ok( key in defaults, key ); + }); + }); +} + +var privateMethods = [ + "_createWidget", + "destroy", + "option", + "_trigger" +]; + +function testWidgetOverrides( widget ) { + if ( $.uiBackCompat === false ) { + test( "$.widget overrides", function() { + $.each( privateMethods, function( i, method ) { + strictEqual( $.ui[ widget ].prototype[ method ], + $.Widget.prototype[ method ], "should not override " + method ); + }); + }); + } +} + +function testBasicUsage( widget ) { + test( "basic usage", function() { + var defaultElement = $.ui[ widget ].prototype.defaultElement; + $( defaultElement ).appendTo( "body" )[ widget ]().remove(); + ok( true, "initialized on element" ); + + $( defaultElement )[ widget ]().remove(); + ok( true, "initialized on disconnected DOMElement - never connected" ); + + $( defaultElement ).appendTo( "body" ).remove()[ widget ]().remove(); + ok( true, "initialized on disconnected DOMElement - removed" ); + }); +} + +window.commonWidgetTests = function( widget, settings ) { + module( widget + ": common widget" ); + + testWidgetDefaults( widget, settings.defaults ); + testWidgetOverrides( widget ); + testBasicUsage( widget ); + test( "version", function() { + ok( "version" in $.ui[ widget ].prototype, "version property exists" ); + }); +} + +/* + * Experimental assertion for comparing DOM objects. + * + * Serializes an element and some attributes and it's children if any, otherwise the text. + * Then compares the result using deepEqual. + */ +window.domEqual = function( selector, modifier, message ) { + var attributes = ["class", "role", "id", "tabIndex", "aria-activedescendant"]; + + function extract(value) { + if (!value || !value.length) { + QUnit.push( false, actual, expected, "domEqual failed, can't extract " + selector + ", message was: " + message ); + return; + } + var result = {}; + result.nodeName = value[0].nodeName; + $.each(attributes, function(index, attr) { + result[attr] = value.prop(attr); + }); + result.children = []; + var children = value.children(); + if (children.length) { + children.each(function() { + result.children.push(extract($(this))); + }); + } else { + result.text = value.text(); + } + return result; + } + var expected = extract($(selector)); + modifier($(selector)); + + var actual = extract($(selector)); + QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); +} + +}()); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/all.html new file mode 100644 index 0000000..0ef6e09 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Tooltip Test Suite + + + + + + + + + + + + + +

                                                                                      jQuery UI Tooltip Test Suite

                                                                                      +

                                                                                      +
                                                                                      +

                                                                                      +
                                                                                        +
                                                                                        + +
                                                                                        + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip.html new file mode 100644 index 0000000..b5e8558 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip.html @@ -0,0 +1,51 @@ + + + + + jQuery UI Tooltip Test Suite + + + + + + + + + + + + + + + + + + + + +

                                                                                        jQuery UI Tooltip Test Suite

                                                                                        +

                                                                                        +
                                                                                        +

                                                                                        +
                                                                                          +
                                                                                          + +
                                                                                          + anchor + + span +
                                                                                          + +
                                                                                          + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_core.js new file mode 100644 index 0000000..d18b853 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_core.js @@ -0,0 +1,26 @@ +(function( $ ) { + +module( "tooltip: core" ); + +test( "markup structure", function() { + expect( 6 ); + var element = $( "#tooltipped1" ).tooltip(), + tooltip = $( ".ui-tooltip" ); + + equal( element.attr( "aria-describedby" ), undefined, "no aria-describedby on init" ); + equal( tooltip.length, 0, "no tooltip on init" ); + + element.tooltip( "open" ); + tooltip = $( "#" + element.attr( "aria-describedby" ) ); + equal( tooltip.length, 1, "tooltip exists" ); + ok( tooltip.hasClass( "ui-tooltip" ), "tooltip is .ui-tooltip" ); + equal( tooltip.length, 1, ".ui-tooltip exists" ); + equal( tooltip.find( ".ui-tooltip-content" ).length, 1, + ".ui-tooltip-content exists" ); +}); + +test( "accessibility", function() { + // TODO: add tests +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_defaults.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_defaults.js new file mode 100644 index 0000000..b8b41bf --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_defaults.js @@ -0,0 +1,20 @@ +commonWidgetTests( "tooltip", { + defaults: { + content: function() {}, + disabled: false, + hide: true, + items: "[title]", + position: { + my: "left+15 center", + at: "right center", + collision: "flipfit flipfit" + }, + show: true, + tooltipClass: null, + + // callbacks + close: null, + create: null, + open: null + } +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_events.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_events.js new file mode 100644 index 0000000..99e1fbd --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_events.js @@ -0,0 +1,83 @@ +(function( $ ) { + +module( "tooltip: events" ); + +test( "programmatic triggers", function() { + expect( 4 ); + var tooltip, + element = $( "#tooltipped1" ).tooltip(); + + element.one( "tooltipopen", function( event, ui ) { + tooltip = ui.tooltip; + ok( !( "originalEvent" in event ), "open" ); + strictEqual( ui.tooltip[0], + $( "#" + element.attr( "aria-describedby" ) )[0], "ui.tooltip" ); + }); + element.tooltip( "open" ); + + element.one( "tooltipclose", function( event, ui ) { + ok( !( "originalEvent" in event ), "close" ); + strictEqual( ui.tooltip[0], tooltip[0], "ui.tooltip" ); + }); + element.tooltip( "close" ); +}); + +test( "mouse events", function() { + expect( 2 ); + var element = $( "#tooltipped1" ).tooltip(); + + element.one( "tooltipopen", function( event ) { + same( event.originalEvent.type, "mouseover" ); + }); + element.trigger( "mouseover" ); + + element.one( "tooltipclose", function( event ) { + same( event.originalEvent.type, "mouseleave" ); + }); + element.trigger( "mouseleave" ); +}); + +test( "focus events", function() { + expect( 2 ); + var element = $( "#tooltipped1" ).tooltip(); + + element.one( "tooltipopen", function( event ) { + same( event.originalEvent.type, "focusin" ); + }); + element.trigger( "focusin" ); + + element.one( "tooltipclose", function( event ) { + same( event.originalEvent.type, "blur" ); + }); + element.trigger( "blur" ); +}); + +asyncTest( "mixed events", function() { + expect( 2 ); + var element = $( "#tooltipped1" ).tooltip(); + + element.one( "tooltipopen", function( event ) { + same( event.originalEvent.type, "focusin" ); + }); + element.simulate( "focus" ); + + element.one( "tooltipopen", function() { + ok( false, "open triggered while already open" ); + }); + element.trigger( "mouseover" ); + + element.bind( "tooltipclose", function( event ) { + ok( false, "close triggered while still focused" ); + }); + element.trigger( "mouseleave" ); + element.unbind( "tooltipclose" ); + + // blurring is async in IE + element.one( "tooltipclose", function( event ) { + same( event.originalEvent.type, "blur" ); + start(); + }); + element.simulate( "blur" ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_methods.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_methods.js new file mode 100644 index 0000000..74fd35d --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_methods.js @@ -0,0 +1,67 @@ +(function( $ ) { + +module( "tooltip: methods" ); + +test( "destroy", function() { + expect( 2 ); + domEqual( "#tooltipped1", function() { + $( "#tooltipped1" ).tooltip().tooltip( "destroy" ); + }); + + // make sure that open tooltips are removed on destroy + $( "#tooltipped1" ).tooltip().tooltip( "open" ).tooltip( "destroy" ); + equal( $( ".ui-tooltip" ).length, 0 ); +}); + +test( "open/close", function() { + expect( 3 ); + $.fx.off = true; + var element = $( "#tooltipped1" ).tooltip(); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" ); + + element.tooltip( "open" ); + var tooltip = $( "#" + element.attr( "aria-describedby" ) ); + ok( tooltip.is( ":visible" ) ); + + element.tooltip( "close" ); + ok( tooltip.is( ":hidden" ) ); + $.fx.off = false; +}); + +test( "enable/disable", function() { + expect( 7 ); + $.fx.off = true; + var element = $( "#tooltipped1" ).tooltip(); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" ); + + element.tooltip( "open" ); + var tooltip = $( "#" + element.attr( "aria-describedby" ) ); + ok( tooltip.is( ":visible" ) ); + + element.tooltip( "disable" ); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" ); + equal( tooltip.attr( "title" ), undefined, "title removed on disable" ); + + element.tooltip( "open" ); + equal( $( ".ui-tooltip" ).length, 0, "open does nothing when disabled" ); + + element.tooltip( "enable" ); + equal( element.attr( "title" ), "anchortitle", "title restored on enable" ); + + element.tooltip( "open" ); + tooltip = $( "#" + element.attr( "aria-describedby" ) ); + ok( tooltip.is( ":visible" ) ); + $.fx.off = false; +}); + +/* +TODO currently tooltip doesn't override widget +can't return anything useful if no element is kept around and there's no useful reference +test("widget", function() { + var tooltip = $("#tooltipped1").tooltip(); + same(tooltip.tooltip("widget")[0], $(".ui-tooltip")[0]); + same(tooltip.tooltip("widget").end()[0], tooltip[0]); +}); +*/ + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_options.js new file mode 100644 index 0000000..04bb4c6 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/tooltip/tooltip_options.js @@ -0,0 +1,73 @@ +(function( $ ) { + +module( "tooltip: options" ); + +test( "content: default", function() { + var element = $( "#tooltipped1" ).tooltip().tooltip( "open" ); + same( $( "#" + element.attr( "aria-describedby" ) ).text(), "anchortitle" ); +}); + +test( "content: return string", function() { + var element = $( "#tooltipped1" ).tooltip({ + content: function() { + return "customstring"; + } + }).tooltip( "open" ); + same( $( "#" + element.attr( "aria-describedby" ) ).text(), "customstring" ); +}); + +test( "content: return jQuery", function() { + var element = $( "#tooltipped1" ).tooltip({ + content: function() { + return $( "
                                                                                          " ).html( "customstring" ); + } + }).tooltip( "open" ); + same( $( "#" + element.attr( "aria-describedby" ) ).text(), "customstring" ); +}); + +asyncTest( "content: sync + async callback", function() { + expect( 2 ); + var element = $( "#tooltipped1" ).tooltip({ + content: function( response ) { + setTimeout(function() { + same( $( "#" + element.attr("aria-describedby") ).text(), "loading..." ); + + response( "customstring2" ); + setTimeout(function() { + same( $( "#" + element.attr("aria-describedby") ).text(), "customstring2" ); + start(); + }, 13 ); + }, 13 ); + return "loading..."; + } + }).tooltip( "open" ); +}); + +test( "items", function() { + expect( 2 ); + var element = $( "#qunit-fixture" ).tooltip({ + items: "#fixture-span" + }); + + var event = $.Event( "mouseenter" ); + event.target = $( "#fixture-span" )[ 0 ]; + element.tooltip( "open", event ); + same( $( "#" + $( "#fixture-span" ).attr( "aria-describedby" ) ).text(), "title-text" ); + + // make sure default [title] doesn't get used + event.target = $( "#tooltipped1" )[ 0 ]; + element.tooltip( "open", event ); + same( $( "#tooltipped1" ).attr( "aria-describedby" ), undefined ); + + element.tooltip( "destroy" ); +}); + +test( "tooltipClass", function() { + expect( 1 ) + var element = $( "#tooltipped1" ).tooltip({ + tooltipClass: "custom" + }).tooltip( "open" ); + ok( $( "#" + element.attr( "aria-describedby" ) ).hasClass( "custom" ) ); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/all.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/all.html new file mode 100644 index 0000000..ae8bc3c --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/all.html @@ -0,0 +1,30 @@ + + + + + jQuery UI Widget Test Suite + + + + + + + + + + + + + +

                                                                                          jQuery UI Widget Test Suite

                                                                                          +

                                                                                          +
                                                                                          +

                                                                                          +
                                                                                            +
                                                                                            + +
                                                                                            + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget.html b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget.html new file mode 100644 index 0000000..6f4caaa --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget.html @@ -0,0 +1,46 @@ + + + + + jQuery UI Widget Test Suite + + + + + + + + + + + + + + + + + + +

                                                                                            jQuery UI Widget Test Suite

                                                                                            +

                                                                                            +
                                                                                            +

                                                                                            +
                                                                                              +
                                                                                              + +
                                                                                              +
                                                                                              +
                                                                                              ...
                                                                                              +
                                                                                              +
                                                                                              + +
                                                                                              + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_animation.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_animation.js new file mode 100644 index 0000000..8ef55aa --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_animation.js @@ -0,0 +1,257 @@ + +module( "widget animation", (function() { + var show = $.fn.show, + fadeIn = $.fn.fadeIn, + slideDown = $.fn.slideDown; + return { + setup: function() { + $.widget( "ui.testWidget", { + _create: function() { + this.element.hide(); + }, + show: function( fn ) { + this._show( this.element, this.options.show, fn ); + } + }); + $.effects = { effect: { testEffect: $.noop } }; + }, + teardown: function() { + delete $.ui.testWidget; + delete $.effects.effect.testEffect; + $.fn.show = show; + $.fn.fadeIn = fadeIn; + $.fn.slideDown = slideDown; + } + }; +}())); + +asyncTest( "show: null", function() { + expect( 4 ); + + var element = $( "#widget" ).testWidget(), + hasRun = false; + $.fn.show = function() { + ok( true, "show called" ); + equal( arguments.length, 0, "no args passed to show" ); + }; + + element + .delay( 50 ) + .queue(function( next ) { + ok( !hasRun, "queue before show" ); + next(); + }) + .testWidget( "show", function() { + hasRun = true; + }) + .queue(function( next ) { + ok( hasRun, "queue after show" ); + start(); + next(); + }); +}); + +asyncTest( "show: true", function() { + expect( 4 ); + + var element = $( "#widget" ).testWidget({ + show: true + }), + hasRun = false; + $.fn.fadeIn = function( duration, easing, complete ) { + return this.queue(function( next ) { + strictEqual( duration, undefined, "duration" ); + strictEqual( easing, undefined, "easing" ); + complete(); + next(); + }); + }; + + element + .delay( 50 ) + .queue(function( next ) { + ok( !hasRun, "queue before show" ); + next(); + }) + .testWidget( "show", function() { + hasRun = true; + }) + .queue(function( next ) { + ok( hasRun, "queue after show" ); + start(); + next(); + }); +}); + +asyncTest( "show: number", function() { + expect( 4 ); + + var element = $( "#widget" ).testWidget({ + show: 123 + }), + hasRun = false; + $.fn.fadeIn = function( duration, easing, complete ) { + return this.queue(function( next ) { + strictEqual( duration, 123, "duration" ); + strictEqual( easing, undefined, "easing" ); + complete(); + next(); + }); + }; + + element + .delay( 50 ) + .queue(function( next ) { + ok( !hasRun, "queue before show" ); + next(); + }) + .testWidget( "show", function() { + hasRun = true; + }) + .queue(function( next ) { + ok( hasRun, "queue after show" ); + start(); + next(); + }); +}); + +asyncTest( "show: core animation", function() { + expect( 4 ); + + var element = $( "#widget" ).testWidget({ + show: "slideDown" + }), + hasRun = false; + $.fn.slideDown = function( duration, easing, complete ) { + return this.queue(function( next ) { + strictEqual( duration, undefined, "duration" ); + strictEqual( easing, undefined, "easing" ); + complete(); + next(); + }); + }; + + element + .delay( 50 ) + .queue(function( next ) { + ok( !hasRun, "queue before show" ); + next(); + }) + .testWidget( "show", function() { + hasRun = true; + }) + .queue(function( next ) { + ok( hasRun, "queue after show" ); + start(); + next(); + }); +}); + +asyncTest( "show: effect", function() { + expect( 5 ); + + var element = $( "#widget" ).testWidget({ + show: "testEffect" + }), + hasRun = false; + $.fn.show = function( options ) { + return this.queue(function( next ) { + equal( options.effect, "testEffect", "effect" ); + ok( !("duration" in options), "duration" ); + ok( !("easing" in options), "easing" ); + options.complete(); + next(); + }); + }; + + element + .delay( 50 ) + .queue(function( next ) { + ok( !hasRun, "queue before show" ); + next(); + }) + .testWidget( "show", function() { + hasRun = true; + }) + .queue(function( next ) { + ok( hasRun, "queue after show" ); + start(); + next(); + }); +}); + +asyncTest( "show: object(core animation)", function() { + expect( 4 ); + + var element = $( "#widget" ).testWidget({ + show: { + effect: "slideDown", + duration: 123, + easing: "testEasing" + } + }), + hasRun = false; + $.fn.slideDown = function( duration, easing, complete ) { + return this.queue(function( next ) { + equal( duration, 123, "duration" ); + equal( easing, "testEasing", "easing" ); + complete(); + next(); + }); + }; + + element + .delay( 50 ) + .queue(function( next ) { + ok( !hasRun, "queue before show" ); + next(); + }) + .testWidget( "show", function() { + hasRun = true; + }) + .queue(function( next ) { + ok( hasRun, "queue after show" ); + start(); + next(); + }); +}); + +asyncTest( "show: object(effect)", function() { + expect( 3 ); + + var element = $( "#widget" ).testWidget({ + show: { + effect: "testEffect", + duration: 123, + easing: "testEasing" + } + }), + hasRun = false; + $.fn.show = function( options ) { + return this.queue(function( next ) { + deepEqual( options, { + effect: "testEffect", + duration: 123, + easing: "testEasing", + complete: options.complete + }); + options.complete(); + next(); + }); + }; + + element + .delay( 50 ) + .queue(function( next ) { + ok( !hasRun, "queue before show" ); + next(); + }) + .testWidget( "show", function() { + hasRun = true; + }) + .queue(function( next ) { + ok( hasRun, "queue after show" ); + start(); + next(); + }); +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_core.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_core.js new file mode 100644 index 0000000..2e55ad7 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_core.js @@ -0,0 +1,1069 @@ +(function( $ ) { + +module( "widget factory", { + teardown: function() { + delete $.ui.testWidget; + } +}); + +test( "widget creation", function() { + var myPrototype = { + _create: function() {}, + creationTest: function() {} + }; + + $.widget( "ui.testWidget", myPrototype ); + ok( $.isFunction( $.ui.testWidget ), "constructor was created" ); + equals( "object", typeof $.ui.testWidget.prototype, "prototype was created" ); + equals( $.ui.testWidget.prototype._create, myPrototype._create, + "create function is copied over" ); + equals( $.ui.testWidget.prototype.creationTest, myPrototype.creationTest, + "random function is copied over" ); + equals( $.ui.testWidget.prototype.option, $.Widget.prototype.option, + "option method copied over from base widget" ); +}); + +test( "element normalization", function() { + expect( 11 ); + var elem; + $.widget( "ui.testWidget", {} ); + + $.ui.testWidget.prototype._create = function() { + // workaround for core ticket #8381 + this.element.appendTo( "#qunit-fixture" ); + ok( this.element.is( "div" ), "generated div" ); + same( this.element.data( "testWidget" ), this, "intance stored in .data()" ); + }; + $.ui.testWidget(); + + $.ui.testWidget.prototype.defaultElement = ""; + $.ui.testWidget.prototype._create = function() { + ok( this.element.is( "span[data-test=pass]" ), "generated span with properties" ); + same( this.element.data( "testWidget" ), this, "instace stored in .data()" ); + }; + $.ui.testWidget(); + + elem = $( "" ); + $.ui.testWidget.prototype._create = function() { + same( this.element[ 0 ], elem[ 0 ], "from element" ); + same( elem.data( "testWidget" ), this, "instace stored in .data()" ); + }; + $.ui.testWidget( {}, elem[ 0 ] ); + + elem = $( "
                                                                                              " ); + $.ui.testWidget.prototype._create = function() { + same( this.element[ 0 ], elem[ 0 ], "from jQuery object" ); + same( elem.data( "testWidget" ), this, "instace stored in .data()" ); + }; + $.ui.testWidget( {}, elem ); + + elem = $( "
                                                                                              " ) + .appendTo( "#qunit-fixture" ); + $.ui.testWidget.prototype._create = function() { + same( this.element[ 0 ], elem[ 0 ], "from selector" ); + same( elem.data( "testWidget" ), this, "instace stored in .data()" ); + }; + $.ui.testWidget( {}, "#element-normalization-selector" ); + + $.ui.testWidget.prototype.defaultElement = null; + $.ui.testWidget.prototype._create = function() { + // using strictEqual throws an error (Maximum call stack size exceeded) + ok( this.element[ 0 ] === this, "instance as element" ); + }; + $.ui.testWidget(); +}); + +test( "jQuery usage", function() { + expect( 13 ); + + var shouldCreate = false; + + $.widget( "ui.testWidget", { + getterSetterVal: 5, + _create: function() { + ok( shouldCreate, "create called on instantiation" ); + }, + methodWithParams: function( param1, param2 ) { + ok( true, "method called via .pluginName(methodName)" ); + equals( param1, "value1", + "parameter passed via .pluginName(methodName, param)" ); + equals( param2, "value2", + "multiple parameters passed via .pluginName(methodName, param, param)" ); + + return this; + }, + getterSetterMethod: function( val ) { + if ( val ) { + this.getterSetterVal = val; + } else { + return this.getterSetterVal; + } + }, + jQueryObject: function() { + return $( "body" ); + } + }); + + shouldCreate = true; + var elem = $( "
                                                                                              " ) + .bind( "testwidgetcreate", function() { + ok( shouldCreate, "create event triggered on instantiation" ); + }) + .testWidget(); + shouldCreate = false; + + var instance = elem.data( "testWidget" ); + equals( typeof instance, "object", "instance stored in .data(pluginName)" ); + equals( instance.element[0], elem[0], "element stored on widget" ); + var ret = elem.testWidget( "methodWithParams", "value1", "value2" ); + equals( ret, elem, "jQuery object returned from method call" ); + + ret = elem.testWidget( "getterSetterMethod" ); + equals( ret, 5, "getter/setter can act as getter" ); + ret = elem.testWidget( "getterSetterMethod", 30 ); + equals( ret, elem, "getter/setter method can be chainable" ); + equals( instance.getterSetterVal, 30, "getter/setter can act as setter" ); + ret = elem.testWidget( "jQueryObject" ); + equal( ret[ 0 ], document.body, "returned jQuery object" ); + equal( ret.end(), elem, "stack preserved" ); +}); + +test( "direct usage", function() { + expect( 9 ); + + var shouldCreate = false; + + $.widget( "ui.testWidget", { + getterSetterVal: 5, + _create: function() { + ok( shouldCreate, "create called on instantiation" ); + }, + methodWithParams: function( param1, param2 ) { + ok( true, "method called dirctly" ); + equals( param1, "value1", "parameter passed via direct call" ); + equals( param2, "value2", "multiple parameters passed via direct call" ); + + return this; + }, + getterSetterMethod: function( val ) { + if ( val ) { + this.getterSetterVal = val; + } else { + return this.getterSetterVal; + } + } + }); + + var elem = $( "
                                                                                              " )[ 0 ]; + + shouldCreate = true; + var instance = new $.ui.testWidget( {}, elem ); + shouldCreate = false; + + equals( $( elem ).data( "testWidget" ), instance, + "instance stored in .data(pluginName)" ); + equals( instance.element[ 0 ], elem, "element stored on widget" ); + + var ret = instance.methodWithParams( "value1", "value2" ); + equals( ret, instance, "plugin returned from method call" ); + + ret = instance.getterSetterMethod(); + equals( ret, 5, "getter/setter can act as getter" ); + instance.getterSetterMethod( 30 ); + equals( instance.getterSetterVal, 30, "getter/setter can act as setter" ); +}); + +test( "error handling", function() { + expect( 3 ); + var error = $.error; + $.widget( "ui.testWidget", { + _privateMethod: function () {} + }); + $.error = function( msg ) { + equal( msg, "cannot call methods on testWidget prior to initialization; " + + "attempted to call method 'missing'", "method call before init" ); + }; + $( "
                                                                                              " ).testWidget( "missing" ); + $.error = function( msg ) { + equal( msg, "no such method 'missing' for testWidget widget instance", + "invalid method call on widget instance" ); + }; + $( "
                                                                                              " ).testWidget().testWidget( "missing" ); + $.error = function ( msg ) { + equal( msg, "no such method '_privateMethod' for testWidget widget instance", + "invalid method call on widget instance" ); + }; + $( "
                                                                                              " ).testWidget().testWidget( "_privateMethod" ); + $.error = error; +}); + +test( "merge multiple option arguments", function() { + expect( 1 ); + $.widget( "ui.testWidget", { + _create: function() { + same( this.options, { + create: null, + disabled: false, + option1: "value1", + option2: "value2", + option3: "value3", + option4: { + option4a: "valuea", + option4b: "valueb" + } + }); + } + }); + $( "
                                                                                              " ).testWidget({ + option1: "valuex", + option2: "valuex", + option3: "value3", + option4: { + option4a: "valuex" + } + }, { + option1: "value1", + option2: "value2", + option4: { + option4b: "valueb" + } + }, { + option4: { + option4a: "valuea" + } + }); +}); + +test( "._getCreateOptions()", function() { + expect( 1 ); + $.widget( "ui.testWidget", { + options: { + option1: "valuex", + option2: "valuex", + option3: "value3" + }, + _getCreateOptions: function() { + return { + option1: "override1", + option2: "overideX" + }; + }, + _create: function() { + same( this.options, { + create: null, + disabled: false, + option1: "override1", + option2: "value2", + option3: "value3" + }); + } + }); + $( "
                                                                                              " ).testWidget({ option2: "value2" }); +}); + +test( "re-init", function() { + var div = $( "
                                                                                              " ), + actions = []; + + $.widget( "ui.testWidget", { + _create: function() { + actions.push( "create" ); + }, + _init: function() { + actions.push( "init" ); + }, + _setOption: function( key, value ) { + actions.push( "option" + key ); + } + }); + + actions = []; + div.testWidget({ foo: "bar" }); + same( actions, [ "create", "init" ], "correct methods called on init" ); + + actions = []; + div.testWidget(); + same( actions, [ "init" ], "correct methods call on re-init" ); + + actions = []; + div.testWidget({ foo: "bar" }); + same( actions, [ "optionfoo", "init" ], "correct methods called on re-init with options" ); +}); + +test( "inheritance - options", function() { + // #5830 - Widget: Using inheritance overwrites the base classes options + $.widget( "ui.testWidgetBase", { + options: { + obj: { + key1: "foo", + key2: "bar" + }, + arr: [ "testing" ] + } + }); + + $.widget( "ui.testWidgetExtension", $.ui.testWidgetBase, { + options: { + obj: { + key1: "baz" + }, + arr: [ "alpha", "beta" ] + } + }); + + same( $.ui.testWidgetBase.prototype.options.obj, { + key1: "foo", + key2: "bar" + }, "base class option object not overridden"); + same( $.ui.testWidgetBase.prototype.options.arr, [ "testing" ], + "base class option array not overridden"); + + same( $.ui.testWidgetExtension.prototype.options.obj, { + key1: "baz", + key2: "bar" + }, "extension class option object extends base"); + same( $.ui.testWidgetExtension.prototype.options.arr, [ "alpha", "beta" ], + "extension class option array overwrites base"); + + delete $.ui.testWidgetBase; + delete $.ui.testWidgetExtension; +}); + +test( "._super()", function() { + expect( 9 ); + var instance; + $.widget( "ui.testWidget", { + method: function( a, b ) { + same( this, instance, "this is correct in testWidget" ); + same( a, 5, "parameter passed to testWidget" ); + same( b, 20, "second parameter passed to testWidget" ); + return a + b; + } + }); + + $.widget( "ui.testWidget2", $.ui.testWidget, { + method: function( a, b ) { + same( this, instance, "this is correct in testWidget2" ); + same( a, 5, "parameter passed to testWidget2" ); + same( b, 10, "parameter passed to testWidget2" ); + return this._super( a, b*2 ); + } + }); + + $.widget( "ui.testWidget3", $.ui.testWidget2, { + method: function( a ) { + same( this, instance, "this is correct in testWidget3" ); + same( a, 5, "parameter passed to testWidget3" ); + var ret = this._super( a, a*2 ); + same( ret, 25, "super returned value" ); + } + }); + + instance = $( "
                                                                                              " ).testWidget3().data( "testWidget3" ); + instance.method( 5 ); + delete $.ui.testWidget3; + delete $.ui.testWidget2; +}); + +test( "._superApply()", function() { + expect( 10 ); + var instance; + $.widget( "ui.testWidget", { + method: function( a, b ) { + same( this, instance, "this is correct in testWidget" ); + same( a, 5, "parameter passed to testWidget" ); + same( b, 10, "second parameter passed to testWidget" ); + return a + b; + } + }); + + $.widget( "ui.testWidget2", $.ui.testWidget, { + method: function( a, b ) { + same( this, instance, "this is correct in testWidget2" ); + same( a, 5, "parameter passed to testWidget2" ); + same( b, 10, "second parameter passed to testWidget2" ); + return this._superApply( arguments ); + } + }); + + $.widget( "ui.testWidget3", $.ui.testWidget2, { + method: function( a, b ) { + same( this, instance, "this is correct in testWidget3" ); + same( a, 5, "parameter passed to testWidget3" ); + same( b, 10, "second parameter passed to testWidget3" ); + var ret = this._superApply( arguments ); + same( ret, 15, "super returned value" ); + } + }); + + instance = $( "
                                                                                              " ).testWidget3().data( "testWidget3" ); + instance.method( 5, 10 ); + delete $.ui.testWidget3; + delete $.ui.testWidget2; +}); + +test( ".option() - getter", function() { + $.widget( "ui.testWidget", { + _create: function() {} + }); + + var div = $( "
                                                                                              " ).testWidget({ + foo: "bar", + baz: 5, + qux: [ "quux", "quuux" ] + }); + + same( div.testWidget( "option", "x" ), null, "non-existent option" ); + same( div.testWidget( "option", "foo"), "bar", "single option - string" ); + same( div.testWidget( "option", "baz"), 5, "single option - number" ); + same( div.testWidget( "option", "qux"), [ "quux", "quuux" ], + "single option - array" ); + + var options = div.testWidget( "option" ); + same( options, { + create: null, + disabled: false, + foo: "bar", + baz: 5, + qux: [ "quux", "quuux" ] + }, "full options hash returned" ); + options.foo = "notbar"; + same( div.testWidget( "option", "foo"), "bar", + "modifying returned options hash does not modify plugin instance" ); +}); + +test( ".option() - deep option getter", function() { + $.widget( "ui.testWidget", {} ); + var div = $( "
                                                                                              " ).testWidget({ + foo: { + bar: "baz", + qux: { + quux: "xyzzy" + } + } + }); + equal( div.testWidget( "option", "foo.bar" ), "baz", "one level deep - string" ); + deepEqual( div.testWidget( "option", "foo.qux" ), { quux: "xyzzy" }, + "one level deep - object" ); + equal( div.testWidget( "option", "foo.qux.quux" ), "xyzzy", "two levels deep - string" ); + equal( div.testWidget( "option", "x.y" ), null, "top level non-existent" ); + equal( div.testWidget( "option", "foo.x.y" ), null, "one level deep - non-existent" ); +}); + +test( ".option() - delegate to ._setOptions()", function() { + var calls = []; + $.widget( "ui.testWidget", { + _create: function() {}, + _setOptions: function( options ) { + calls.push( options ); + } + }); + var div = $( "
                                                                                              " ).testWidget(); + + calls = []; + div.testWidget( "option", "foo", "bar" ); + same( calls, [{ foo: "bar" }], "_setOptions called for single option" ); + + calls = []; + div.testWidget( "option", { + bar: "qux", + quux: "quuux" + }); + same( calls, [{ bar: "qux", quux: "quuux" }], + "_setOptions called with multiple options" ); +}); + +test( ".option() - delegate to ._setOption()", function() { + var calls = []; + $.widget( "ui.testWidget", { + _create: function() {}, + _setOption: function( key, val ) { + calls.push({ + key: key, + val: val + }); + } + }); + var div = $( "
                                                                                              " ).testWidget(); + + calls = []; + div.testWidget( "option", "foo", "bar" ); + same( calls, [{ key: "foo", val: "bar" }], + "_setOption called for single option" ); + + calls = []; + div.testWidget( "option", { + bar: "qux", + quux: "quuux" + }); + same( calls, [ + { key: "bar", val: "qux" }, + { key: "quux", val: "quuux" } + ], "_setOption called with multiple options" ); +}); + +test( ".option() - deep option setter", function() { + $.widget( "ui.testWidget", {} ); + var div = $( "
                                                                                              " ).testWidget(); + function deepOption( from, to, msg ) { + div.data( "testWidget" ).options.foo = from; + $.ui.testWidget.prototype._setOption = function( key, value ) { + same( key, "foo", msg + ": key" ); + same( value, to, msg + ": value" ); + }; + } + + deepOption( { bar: "baz" }, { bar: "qux" }, "one deep" ); + div.testWidget( "option", "foo.bar", "qux" ); + + deepOption( null, { bar: "baz" }, "null" ); + div.testWidget( "option", "foo.bar", "baz" ); + + deepOption( + { bar: "baz", qux: { quux: "quuux" } }, + { bar: "baz", qux: { quux: "quuux", newOpt: "newVal" } }, + "add property" ); + div.testWidget( "option", "foo.qux.newOpt", "newVal" ); +}); + +test( ".enable()", function() { + expect( 2 ); + $.widget( "ui.testWidget", { + _create: function() {}, + _setOption: function( key, val ) { + same( key, "disabled", "_setOption called with disabled option" ); + same( val, false, "disabled set to false" ); + } + }); + $( "
                                                                                              " ).testWidget().testWidget( "enable" ); +}); + +test( ".disable()", function() { + expect( 2 ); + $.widget( "ui.testWidget", { + _create: function() {}, + _setOption: function( key, val ) { + same( key, "disabled", "_setOption called with disabled option" ); + same( val, true, "disabled set to true" ); + } + }); + $( "
                                                                                              " ).testWidget().testWidget( "disable" ); +}); + +test( ".widget() - base", function() { + $.widget( "ui.testWidget", { + _create: function() {} + }); + var div = $( "
                                                                                              " ).testWidget(); + same( div[0], div.testWidget( "widget" )[0]); +}); + +test( ".widget() - overriden", function() { + var wrapper = $( "
                                                                                              " ); + $.widget( "ui.testWidget", { + _create: function() {}, + widget: function() { + return wrapper; + } + }); + same( wrapper[0], $( "
                                                                                              " ).testWidget().testWidget( "widget" )[0] ); +}); + +test( "._bind() to element (default)", function() { + expect( 12 ); + var that; + $.widget( "ui.testWidget", { + _create: function() { + that = this; + this._bind({ + keyup: this.keyup, + keydown: "keydown" + }); + }, + keyup: function( event ) { + equals( that, this ); + equals( that.element[0], event.currentTarget ); + equals( "keyup", event.type ); + }, + keydown: function( event ) { + equals( that, this ); + equals( that.element[0], event.currentTarget ); + equals( "keydown", event.type ); + } + }); + var widget = $( "
                                                                                              " ) + .testWidget() + .trigger( "keyup" ) + .trigger( "keydown" ); + widget + .testWidget( "disable" ) + .trigger( "keyup" ) + .trigger( "keydown" ); + widget + .testWidget( "enable" ) + .trigger( "keyup" ) + .trigger( "keydown" ); + widget + .testWidget( "destroy" ) + .trigger( "keyup" ) + .trigger( "keydown" ); +}); + +test( "._bind() to descendent", function() { + expect( 12 ); + var that; + $.widget( "ui.testWidget", { + _create: function() { + that = this; + this._bind( this.element.find( "strong" ), { + keyup: this.keyup, + keydown: "keydown" + }); + }, + keyup: function( event ) { + equals( that, this ); + equals( that.element.find( "strong" )[0], event.currentTarget ); + equals( "keyup", event.type ); + }, + keydown: function(event) { + equals( that, this ); + equals( that.element.find( "strong" )[0], event.currentTarget ); + equals( "keydown", event.type ); + } + }); + // trigger events on both widget and descendent to ensure that only descendent receives them + var widget = $( "

                                                                                              hello world

                                                                                              " ) + .testWidget() + .trigger( "keyup" ) + .trigger( "keydown" ); + var descendent = widget.find( "strong" ) + .trigger( "keyup" ) + .trigger( "keydown" ); + widget + .testWidget( "disable" ) + .trigger( "keyup" ) + .trigger( "keydown" ); + descendent + .trigger( "keyup" ) + .trigger( "keydown" ); + widget + .testWidget( "enable" ) + .trigger( "keyup" ) + .trigger( "keydown" ); + descendent + .trigger( "keyup" ) + .trigger( "keydown" ); + descendent + .addClass( "ui-state-disabled" ) + .trigger( "keyup" ) + .trigger( "keydown" ); + widget + .testWidget( "destroy" ) + .trigger( "keyup" ) + .trigger( "keydown" ); + descendent + .trigger( "keyup" ) + .trigger( "keydown" ); +}); + +test( "_bind() with delegate", function() { + expect( 8 ); + $.widget( "ui.testWidget", { + _create: function() { + this.element = { + bind: function( event, handler ) { + equal( event, "click.testWidget" ); + ok( $.isFunction(handler) ); + }, + trigger: $.noop + }; + this.widget = function() { + return { + delegate: function( selector, event, handler ) { + equal( selector, "a" ); + equal( event, "click.testWidget" ); + ok( $.isFunction(handler) ); + } + }; + }; + this._bind({ + "click": "handler", + "click a": "handler" + }); + this.widget = function() { + return { + delegate: function( selector, event, handler ) { + equal( selector, "form fieldset > input" ); + equal( event, "change.testWidget" ); + ok( $.isFunction(handler) ); + } + }; + }; + this._bind({ + "change form fieldset > input": "handler" + }); + } + }); + $.ui.testWidget(); +}); + +test( "._hoverable()", function() { + $.widget( "ui.testWidget", { + _create: function() { + this._hoverable( this.element.children() ); + } + }); + + var div = $( "#widget" ).testWidget().children(); + ok( !div.hasClass( "ui-state-hover" ), "not hovered on init" ); + div.trigger( "mouseenter" ); + ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" ); + div.trigger( "mouseleave" ); + ok( !div.hasClass( "ui-state-hover" ), "not hovered after mouseleave" ); + + div.trigger( "mouseenter" ); + ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" ); + $( "#widget" ).testWidget( "disable" ); + ok( !div.hasClass( "ui-state-hover" ), "not hovered while disabled" ); + div.trigger( "mouseenter" ); + ok( !div.hasClass( "ui-state-hover" ), "can't hover while disabled" ); + $( "#widget" ).testWidget( "enable" ); + ok( !div.hasClass( "ui-state-hover" ), "enabling doesn't reset hover" ); + + div.trigger( "mouseenter" ); + ok( div.hasClass( "ui-state-hover" ), "hovered after mouseenter" ); + $( "#widget" ).testWidget( "destroy" ); + ok( !div.hasClass( "ui-state-hover" ), "not hovered after destroy" ); + div.trigger( "mouseenter" ); + ok( !div.hasClass( "ui-state-hover" ), "event handler removed on destroy" ); +}); + +test( "._focusable()", function() { + $.widget( "ui.testWidget", { + _create: function() { + this._focusable( this.element.children() ); + } + }); + + var div = $( "#widget" ).testWidget().children(); + ok( !div.hasClass( "ui-state-focus" ), "not focused on init" ); + div.trigger( "focusin" ); + ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" ); + div.trigger( "focusout" ); + ok( !div.hasClass( "ui-state-focus" ), "not focused after blur" ); + + div.trigger( "focusin" ); + ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" ); + $( "#widget" ).testWidget( "disable" ); + ok( !div.hasClass( "ui-state-focus" ), "not focused while disabled" ); + div.trigger( "focusin" ); + ok( !div.hasClass( "ui-state-focus" ), "can't focus while disabled" ); + $( "#widget" ).testWidget( "enable" ); + ok( !div.hasClass( "ui-state-focus" ), "enabling doesn't reset focus" ); + + div.trigger( "focusin" ); + ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" ); + $( "#widget" ).testWidget( "destroy" ); + ok( !div.hasClass( "ui-state-focus" ), "not focused after destroy" ); + div.trigger( "focusin" ); + ok( !div.hasClass( "ui-state-focus" ), "event handler removed on destroy" ); +}); + +test( "._trigger() - no event, no ui", function() { + expect( 7 ); + var handlers = []; + + $.widget( "ui.testWidget", { + _create: function() {} + }); + + $( "#widget" ).testWidget({ + foo: function( event, ui ) { + same( event.type, "testwidgetfoo", "correct event type in callback" ); + same( ui, {}, "empty ui hash passed" ); + handlers.push( "callback" ); + } + }); + $( document ).add( "#widget-wrapper" ).add( "#widget" ) + .bind( "testwidgetfoo", function( event, ui ) { + same( ui, {}, "empty ui hash passed" ); + handlers.push( this ); + }); + same( $( "#widget" ).data( "testWidget" )._trigger( "foo" ), true, + "_trigger returns true when event is not cancelled" ); + same( handlers, [ + $( "#widget" )[ 0 ], + $( "#widget-wrapper" )[ 0 ], + document, + "callback" + ], "event bubbles and then invokes callback" ); + + $( document ).unbind( "testwidgetfoo" ); +}); + +test( "._trigger() - cancelled event", function() { + expect( 3 ); + + $.widget( "ui.testWidget", { + _create: function() {} + }); + + $( "#widget" ).testWidget({ + foo: function( event, ui ) { + ok( true, "callback invoked even if event is cancelled" ); + } + }) + .bind( "testwidgetfoo", function( event, ui ) { + ok( true, "event was triggered" ); + return false; + }); + same( $( "#widget" ).data( "testWidget" )._trigger( "foo" ), false, + "_trigger returns false when event is cancelled" ); +}); + +test( "._trigger() - cancelled callback", function() { + $.widget( "ui.testWidget", { + _create: function() {} + }); + + $( "#widget" ).testWidget({ + foo: function( event, ui ) { + return false; + } + }); + same( $( "#widget" ).data( "testWidget" )._trigger( "foo" ), false, + "_trigger returns false when callback returns false" ); +}); + +test( "._trigger() - provide event and ui", function() { + expect( 7 ); + + var originalEvent = $.Event( "originalTest" ); + $.widget( "ui.testWidget", { + _create: function() {}, + testEvent: function() { + var ui = { + foo: "bar", + baz: { + qux: 5, + quux: 20 + } + }; + this._trigger( "foo", originalEvent, ui ); + same( ui, { + foo: "notbar", + baz: { + qux: 10, + quux: "jQuery" + } + }, "ui object modified" ); + } + }); + $( "#widget" ).bind( "testwidgetfoo", function( event, ui ) { + equal( event.originalEvent, originalEvent, "original event object passed" ); + same( ui, { + foo: "bar", + baz: { + qux: 5, + quux: 20 + } + }, "ui hash passed" ); + ui.foo = "notbar"; + }); + $( "#widget-wrapper" ).bind( "testwidgetfoo", function( event, ui ) { + equal( event.originalEvent, originalEvent, "original event object passed" ); + same( ui, { + foo: "notbar", + baz: { + qux: 5, + quux: 20 + } + }, "modified ui hash passed" ); + ui.baz.qux = 10; + }); + $( "#widget" ).testWidget({ + foo: function( event, ui ) { + equal( event.originalEvent, originalEvent, "original event object passed" ); + same( ui, { + foo: "notbar", + baz: { + qux: 10, + quux: 20 + } + }, "modified ui hash passed" ); + ui.baz.quux = "jQuery"; + } + }) + .testWidget( "testEvent" ); +}); + +test( "._trigger() - array as ui", function() { + // #6795 - Widget: handle array arguments to _trigger consistently + expect( 4 ); + + $.widget( "ui.testWidget", { + _create: function() {}, + testEvent: function() { + var ui = { + foo: "bar", + baz: { + qux: 5, + quux: 20 + } + }; + var extra = { + bar: 5 + }; + this._trigger( "foo", null, [ ui, extra ] ); + } + }); + $( "#widget" ).bind( "testwidgetfoo", function( event, ui, extra ) { + same( ui, { + foo: "bar", + baz: { + qux: 5, + quux: 20 + } + }, "event: ui hash passed" ); + same( extra, { + bar: 5 + }, "event: extra argument passed" ); + }); + $( "#widget" ).testWidget({ + foo: function( event, ui, extra ) { + same( ui, { + foo: "bar", + baz: { + qux: 5, + quux: 20 + } + }, "callback: ui hash passed" ); + same( extra, { + bar: 5 + }, "callback: extra argument passed" ); + } + }) + .testWidget( "testEvent" ); +}); + +test( "._trigger() - instance as element", function() { + expect( 4 ); + $.widget( "ui.testWidget", { + defaultElement: null, + testEvent: function() { + var ui = { foo: "bar" }; + this._trigger( "foo", null, ui ); + } + }); + var instance = $.ui.testWidget({ + foo: function( event, ui ) { + equal( event.type, "testwidgetfoo", "event object passed to callback" ); + same( ui, { foo: "bar" }, "ui object passed to callback" ); + } + }); + $( instance ).bind( "testwidgetfoo", function( event, ui ) { + equal( event.type, "testwidgetfoo", "event object passed to event handler" ); + same( ui, { foo: "bar" }, "ui object passed to event handler" ); + }); + instance.testEvent(); +}); + +(function() { + function shouldDestroy( expected, callback ) { + expect( 1 ); + var destroyed = false; + $.widget( "ui.testWidget", { + _create: function() {}, + destroy: function() { + destroyed = true; + } + }); + callback(); + equal( destroyed, expected ); + } + + test( "auto-destroy - .remove()", function() { + shouldDestroy( true, function() { + $( "#widget" ).testWidget().remove(); + }); + }); + + test( "auto-destroy - .remove() on parent", function() { + shouldDestroy( true, function() { + $( "#widget" ).testWidget().parent().remove(); + }); + }); + + test( "auto-destroy - .remove() on child", function() { + shouldDestroy( false, function() { + $( "#widget" ).testWidget().children().remove(); + }); + }); + + test( "auto-destroy - .empty()", function() { + shouldDestroy( false, function() { + $( "#widget" ).testWidget().empty(); + }); + }); + + test( "auto-destroy - .empty() on parent", function() { + shouldDestroy( true, function() { + $( "#widget" ).testWidget().parent().empty(); + }); + }); + + test( "auto-destroy - .detach()", function() { + shouldDestroy( false, function() { + $( "#widget" ).testWidget().detach(); + }); + }); +}()); + +test( "redefine", function() { + expect( 4 ); + $.widget( "ui.testWidget", { + method: function( str ) { + strictEqual( this, instance, "original invoked with correct this" ); + equal( str, "bar", "original invoked with correct parameter" ); + } + }); + $.ui.testWidget.foo = "bar"; + $.widget( "ui.testWidget", $.ui.testWidget, { + method: function( str ) { + equal( str, "foo", "new invoked with correct parameter" ); + this._super( "bar" ); + } + }); + + var instance = new $.ui.testWidget(); + instance.method( "foo" ); + equal( $.ui.testWidget.foo, "bar", "static properties remain" ); +}); + +asyncTest( "_delay", function() { + expect( 6 ); + var order = 0, + that; + $.widget( "ui.testWidget", { + defaultElement: null, + _create: function() { + that = this; + var timer = this._delay(function() { + strictEqual( this, that ); + equal( order, 1 ); + start(); + }, 500); + ok( timer !== undefined ); + timer = this._delay("callback"); + ok( timer !== undefined ); + }, + callback: function() { + strictEqual( this, that ); + equal( order, 0 ); + order += 1; + } + }); + $( "#widget" ).testWidget(); +}); + +}( jQuery ) ); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_extend.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_extend.js new file mode 100644 index 0000000..90e686e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/widget/widget_extend.js @@ -0,0 +1,103 @@ +test( "$.widget.extend()", function() { + expect( 26 ); + + var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, + options = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, + optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, + merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "x", xxx: "newstring" }, + deep1 = { foo: { bar: true } }, + deep2 = { foo: { baz: true }, foo2: document }, + deep2copy = { foo: { baz: true }, foo2: document }, + deepmerged = { foo: { bar: true, baz: true }, foo2: document }, + arr = [1, 2, 3], + nestedarray = { arr: arr }, + ret; + + $.widget.extend( settings, options ); + deepEqual( settings, merged, "Check if extended: settings must be extended" ); + deepEqual( options, optionsCopy, "Check if not modified: options must not be modified" ); + + $.widget.extend( deep1, deep2 ); + deepEqual( deep1.foo, deepmerged.foo, "Check if foo: settings must be extended" ); + deepEqual( deep2.foo, deep2copy.foo, "Check if not deep2: options must not be modified" ); + equal( deep1.foo2, document, "Make sure that a deep clone was not attempted on the document" ); + + strictEqual( $.widget.extend({}, nestedarray).arr, arr, "Don't clone arrays" ); + ok( $.isPlainObject( $.widget.extend({ arr: arr }, { arr: {} }).arr ), "Cloned object heve to be an plain object" ); + + var empty = {}; + var optionsWithLength = { foo: { length: -1 } }; + $.widget.extend( empty, optionsWithLength ); + deepEqual( empty.foo, optionsWithLength.foo, "The length property must copy correctly" ); + + empty = {}; + var optionsWithDate = { foo: { date: new Date } }; + $.widget.extend( empty, optionsWithDate ); + deepEqual( empty.foo, optionsWithDate.foo, "Dates copy correctly" ); + + var myKlass = function() {}; + var customObject = new myKlass(); + var optionsWithCustomObject = { foo: { date: customObject } }; + empty = {}; + $.widget.extend( empty, optionsWithCustomObject ); + strictEqual( empty.foo.date, customObject, "Custom objects copy correctly (no methods)" ); + + // Makes the class a little more realistic + myKlass.prototype = { someMethod: function(){} }; + empty = {}; + $.widget.extend( empty, optionsWithCustomObject ); + strictEqual( empty.foo.date, customObject, "Custom objects copy correctly" ); + + ret = $.widget.extend({ foo: 4 }, { foo: new Number(5) } ); + equal( ret.foo, 5, "Wrapped numbers copy correctly" ); + + var nullUndef; + nullUndef = $.widget.extend( {}, options, { xnumber2: null } ); + strictEqual( nullUndef.xnumber2, null, "Check to make sure null values are copied"); + + nullUndef = $.widget.extend( {}, options, { xnumber2: undefined } ); + strictEqual( nullUndef.xnumber2, options.xnumber2, "Check to make sure undefined values are not copied"); + + nullUndef = $.widget.extend( {}, options, { xnumber0: null } ); + strictEqual( nullUndef.xnumber0, null, "Check to make sure null values are inserted"); + + var target = {}; + var recursive = { foo:target, bar:5 }; + $.widget.extend( target, recursive ); + deepEqual( target, { foo: {}, bar: 5 }, "Check to make sure a recursive obj doesn't go never-ending loop by not copying it over" ); + + ret = $.widget.extend( { foo: [] }, { foo: [0] } ); // 1907 + equal( ret.foo.length, 1, "Check to make sure a value with coersion 'false' copies over when necessary to fix #1907" ); + + ret = $.widget.extend( { foo: "1,2,3" }, { foo: [1, 2, 3] } ); + strictEqual( typeof ret.foo, "object", "Check to make sure values equal with coersion (but not actually equal) overwrite correctly" ); + + ret = $.widget.extend( { foo:"bar" }, { foo:null } ); + strictEqual( typeof ret.foo, "object", "Make sure a null value doesn't crash with deep extend, for #1908" ); + + var obj = { foo:null }; + $.widget.extend( obj, { foo:"notnull" } ); + equal( obj.foo, "notnull", "Make sure a null value can be overwritten" ); + + var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, + defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, + options1 = { xnumber2: 1, xstring2: "x" }, + options1Copy = { xnumber2: 1, xstring2: "x" }, + options2 = { xstring2: "xx", xxx: "newstringx" }, + options2Copy = { xstring2: "xx", xxx: "newstringx" }, + merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" }; + + var settings = $.widget.extend( {}, defaults, options1, options2 ); + deepEqual( settings, merged2, "Check if extended: settings must be extended" ); + deepEqual( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" ); + deepEqual( options1, options1Copy, "Check if not modified: options1 must not be modified" ); + deepEqual( options2, options2Copy, "Check if not modified: options2 must not be modified" ); + + var input = { + key: [ 1, 2, 3 ] + }; + var output = $.widget.extend( {}, input ); + deepEqual( input, output, "don't clone arrays" ); + input.key[0] = 10; + deepEqual( input, output, "don't clone arrays" ); +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/addClass/addClass_queue.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/addClass/addClass_queue.html new file mode 100644 index 0000000..c00101b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/addClass/addClass_queue.html @@ -0,0 +1,50 @@ + + + + + addClass Visual Test : Queue + + + + + + + + + +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button.html new file mode 100644 index 0000000..e93c795 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button.html @@ -0,0 +1,140 @@ + + + + + Button Visual push: Default + + + + + + + + + + + + +
                                                                                              +
                                                                                              + No icon + + +
                                                                                              +
                                                                                              +
                                                                                              + With icon + + + + + +
                                                                                              +
                                                                                              + +
                                                                                              + +
                                                                                              + +
                                                                                              + + + +
                                                                                              +
                                                                                              +
                                                                                              + + + +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + +
                                                                                              +
                                                                                              + +
                                                                                              + + + + + + + + + + + + + + + + + + +
                                                                                              + +
                                                                                              + + +
                                                                                              + + + +
                                                                                              + + +
                                                                                              +
                                                                                              + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_disabled_true.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_disabled_true.html new file mode 100644 index 0000000..ac21a56 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_disabled_true.html @@ -0,0 +1,84 @@ + + + + + Button Visual Test : Button disabled true + + + + + + + + + + +
                                                                                              + button + +
                                                                                              + +
                                                                                              + +
                                                                                              + anchor + anchor 1 +
                                                                                              + anchor 1 +
                                                                                              + +
                                                                                              + input type="button" + +
                                                                                              + +
                                                                                              + +
                                                                                              + input type="radio" + + + +
                                                                                              + + + +
                                                                                              + +
                                                                                              + input type="checkbox" + + + +
                                                                                              + + + +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_performance.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_performance.html new file mode 100644 index 0000000..439e2c1 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_performance.html @@ -0,0 +1,555 @@ + + + + + Button Visual push: Default + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5254.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5254.html new file mode 100644 index 0000000..14d2769 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5254.html @@ -0,0 +1,55 @@ + + + + + Button Visual Test : Button ticket #5254 + + + + + + + + + + +

                                                                                              #5254 - Input, button and anchor buttons aren't consistent in IE7

                                                                                              + +
                                                                                              +

                                                                                              Screenshot from ticket:

                                                                                              +
                                                                                              +
                                                                                              + +
                                                                                              + +
                                                                                              +

                                                                                              Visual test:

                                                                                              +
                                                                                              +
                                                                                              + + + Anchor +
                                                                                              +
                                                                                              +

                                                                                              User agent:

                                                                                              +
                                                                                              +

                                                                                              +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5261.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5261.html new file mode 100644 index 0000000..0024393 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5261.html @@ -0,0 +1,42 @@ + + + + + Button Visual Test : Button ticket #5261 + + + + + + + + + + +

                                                                                              #5261 - button change events don't fire in IE 7/8

                                                                                              + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5278.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5278.html new file mode 100644 index 0000000..477a0b3 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/button/button_ticket_5278.html @@ -0,0 +1,58 @@ + + + + + Button Visual Test : Button ticket #5278 + + + + + + + + + + +

                                                                                              #5278 - ui.buttons doesn't visually reset on form "reset" event or input "change" event

                                                                                              + +
                                                                                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_dialog.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_dialog.html new file mode 100644 index 0000000..7b3b227 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_dialog.html @@ -0,0 +1,202 @@ + + + + + Compound Visual Test : Accordion in Dialog + + + + + + + + + + + + + + + +
                                                                                              +
                                                                                              +

                                                                                              Section 1

                                                                                              +
                                                                                              +

                                                                                              + 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. +

                                                                                              +
                                                                                              +

                                                                                              Section 2

                                                                                              +
                                                                                              +

                                                                                              + 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. +

                                                                                              +

                                                                                              + Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. + Class aptent taciti sociosqu ad litora torquent per conubia nostra, per + inceptos himenaeos. +

                                                                                              +
                                                                                              +

                                                                                              Section 3

                                                                                              +
                                                                                              +

                                                                                              + 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. +

                                                                                              +
                                                                                                +
                                                                                              • List item one
                                                                                              • +
                                                                                              • List item two
                                                                                              • +
                                                                                              • List item three
                                                                                              • +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + +

                                                                                              +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. +

                                                                                              +

                                                                                              +Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci. +

                                                                                              +

                                                                                              +Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida. +

                                                                                              +

                                                                                              +Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper. +

                                                                                              +

                                                                                              +Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor. +

                                                                                              +

                                                                                              + +Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi. +

                                                                                              +

                                                                                              +Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae. +

                                                                                              +

                                                                                              +Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat. +

                                                                                              +

                                                                                              +Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna. +

                                                                                              +

                                                                                              +Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc. +

                                                                                              +

                                                                                              +Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod. +

                                                                                              + +

                                                                                              +Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; +

                                                                                              +

                                                                                              +Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis. +

                                                                                              +

                                                                                              +Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis. +

                                                                                              +

                                                                                              +In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est. +

                                                                                              +

                                                                                              +Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat. +

                                                                                              +

                                                                                              +Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida. + +

                                                                                              +

                                                                                              +Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl. +

                                                                                              +

                                                                                              +Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia. +

                                                                                              +

                                                                                              +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. +

                                                                                              +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. +

                                                                                              +

                                                                                              +Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci. +

                                                                                              +

                                                                                              +Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida. +

                                                                                              +

                                                                                              +Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper. +

                                                                                              +

                                                                                              +Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor. +

                                                                                              +

                                                                                              + +Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi. +

                                                                                              +

                                                                                              +Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae. +

                                                                                              +

                                                                                              +Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat. +

                                                                                              +

                                                                                              +Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna. +

                                                                                              +

                                                                                              +Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc. +

                                                                                              +

                                                                                              +Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod. +

                                                                                              + +

                                                                                              +Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; +

                                                                                              +

                                                                                              +Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis. +

                                                                                              +

                                                                                              +Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis. +

                                                                                              +

                                                                                              +In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est. +

                                                                                              +

                                                                                              +Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat. +

                                                                                              +

                                                                                              +Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida. + +

                                                                                              +

                                                                                              +Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl. +

                                                                                              +

                                                                                              +Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia. +

                                                                                              +

                                                                                              +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. +

                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_tabs.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_tabs.html new file mode 100644 index 0000000..e98edaf --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/accordion_tabs.html @@ -0,0 +1,86 @@ + + + + + Compound Visual Test : Accordion in Tabs + + + + + + + + + + + +
                                                                                              + +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 1

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +
                                                                                              +

                                                                                              Accordion Header 2

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +
                                                                                              +

                                                                                              Accordion Header 3

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 1

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +
                                                                                              +

                                                                                              Accordion Header 2

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +
                                                                                              +

                                                                                              Accordion Header 3

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/datepicker_dialog.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/datepicker_dialog.html new file mode 100644 index 0000000..0ef3f9b --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/datepicker_dialog.html @@ -0,0 +1,157 @@ + + + + + Compound Visual Test : Datepicker in Dialog + + + + + + + + + + + + + + + +
                                                                                              + +
                                                                                              + +

                                                                                              +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. +

                                                                                              +

                                                                                              +Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci. +

                                                                                              +

                                                                                              +Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida. +

                                                                                              +

                                                                                              +Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper. +

                                                                                              +

                                                                                              +Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor. +

                                                                                              +

                                                                                              + +Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi. +

                                                                                              +

                                                                                              +Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae. +

                                                                                              +

                                                                                              +Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat. +

                                                                                              +

                                                                                              +Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna. +

                                                                                              +

                                                                                              +Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc. +

                                                                                              +

                                                                                              +Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod. +

                                                                                              + +

                                                                                              +Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; +

                                                                                              +

                                                                                              +Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis. +

                                                                                              +

                                                                                              +Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis. +

                                                                                              +

                                                                                              +In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est. +

                                                                                              +

                                                                                              +Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat. +

                                                                                              +

                                                                                              +Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida. + +

                                                                                              +

                                                                                              +Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl. +

                                                                                              +

                                                                                              +Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia. +

                                                                                              +

                                                                                              +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. +

                                                                                              +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. +

                                                                                              +

                                                                                              +Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci. +

                                                                                              +

                                                                                              +Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida. +

                                                                                              +

                                                                                              +Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper. +

                                                                                              +

                                                                                              +Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor. +

                                                                                              +

                                                                                              + +Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi. +

                                                                                              +

                                                                                              +Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae. +

                                                                                              +

                                                                                              +Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat. +

                                                                                              +

                                                                                              +Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna. +

                                                                                              +

                                                                                              +Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc. +

                                                                                              +

                                                                                              +Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod. +

                                                                                              + +

                                                                                              +Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; +

                                                                                              +

                                                                                              +Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis. +

                                                                                              +

                                                                                              +Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis. +

                                                                                              +

                                                                                              +In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est. +

                                                                                              +

                                                                                              +Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat. +

                                                                                              +

                                                                                              +Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida. + +

                                                                                              +

                                                                                              +Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl. +

                                                                                              +

                                                                                              +Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia. +

                                                                                              +

                                                                                              +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. +

                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion.html new file mode 100644 index 0000000..396d0e2 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion.html @@ -0,0 +1,65 @@ + + + + + Compound Visual Test : Draggable in Accordion + + + + + + + + + + + + + +
                                                                                              +

                                                                                              .draggable()

                                                                                              +
                                                                                              +
                                                                                              Draggable 1-1
                                                                                              +
                                                                                              Draggable 1-2
                                                                                              +
                                                                                              Draggable 1-3
                                                                                              +
                                                                                              Draggable 1-4
                                                                                              +
                                                                                              Draggable 1-5
                                                                                              +
                                                                                              +

                                                                                              .draggable({ appendTo: "body" })

                                                                                              +
                                                                                              +
                                                                                              Draggable 2-1
                                                                                              +
                                                                                              Draggable 2-2
                                                                                              +
                                                                                              Draggable 2-3
                                                                                              +
                                                                                              Draggable 2-4
                                                                                              +
                                                                                              Draggable 2-5
                                                                                              +
                                                                                              +

                                                                                              .draggable({ helper: "clone", appendTo: "body" })

                                                                                              +
                                                                                              +
                                                                                              Draggable 3-1
                                                                                              +
                                                                                              Draggable 3-2
                                                                                              +
                                                                                              Draggable 3-3
                                                                                              +
                                                                                              Draggable 3-4
                                                                                              +
                                                                                              Draggable 3-5
                                                                                              +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html new file mode 100644 index 0000000..a1199c8 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html @@ -0,0 +1,109 @@ + + + + + Compound Visual Test : Draggable in Accordion + + + + + + + + + + + + + +
                                                                                              +

                                                                                              Drag me around!

                                                                                              +
                                                                                              + +
                                                                                              +

                                                                                              Click the other tab!

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Group 1

                                                                                              +
                                                                                              +

                                                                                              Header 1-1

                                                                                              +
                                                                                              +
                                                                                              Draggable 1-1
                                                                                              +
                                                                                              Draggable 1-2
                                                                                              +
                                                                                              Draggable 1-3
                                                                                              +
                                                                                              Draggable 1-4
                                                                                              +
                                                                                              Draggable 1-5
                                                                                              +
                                                                                              +

                                                                                              Header 1-2

                                                                                              +
                                                                                              +
                                                                                              Draggable 2-1
                                                                                              +
                                                                                              Draggable 2-2
                                                                                              +
                                                                                              Draggable 2-3
                                                                                              +
                                                                                              Draggable 2-4
                                                                                              +
                                                                                              Draggable 2-5
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Group 2

                                                                                              +
                                                                                              +

                                                                                              Header 2-1

                                                                                              +
                                                                                              +
                                                                                              Draggable 1-1
                                                                                              +
                                                                                              Draggable 1-2
                                                                                              +
                                                                                              Draggable 1-3
                                                                                              +
                                                                                              Draggable 1-4
                                                                                              +
                                                                                              Draggable 1-5
                                                                                              +
                                                                                              +

                                                                                              Header 2-2

                                                                                              +
                                                                                              +
                                                                                              Draggable 2-1
                                                                                              +
                                                                                              Draggable 2-2
                                                                                              +
                                                                                              Draggable 2-3
                                                                                              +
                                                                                              Draggable 2-4
                                                                                              +
                                                                                              Draggable 2-5
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/sortable_accordion_sortable_tabs.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/sortable_accordion_sortable_tabs.html new file mode 100644 index 0000000..02a6c0d --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/sortable_accordion_sortable_tabs.html @@ -0,0 +1,108 @@ + + + + + Compound Visual Test : Accordion in Tabs + + + + + + + + + + + + + +
                                                                                              + +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 1

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 2

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 3

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 1

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +

                                                                                              Accordion Content 1

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 2

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +

                                                                                              Accordion Content 2

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 3

                                                                                              +
                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +

                                                                                              Accordion Content 3

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tabs.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tabs.html new file mode 100644 index 0000000..12515a4 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tabs.html @@ -0,0 +1,73 @@ + + + + + Compound Visual Test : Tabs in Tabs + + + + + + + + + + + +
                                                                                              + +
                                                                                              +
                                                                                              + +
                                                                                              +

                                                                                              nested tabs a-1

                                                                                              +

                                                                                              nested tabs a-1

                                                                                              +

                                                                                              nested tabs a-1

                                                                                              +

                                                                                              nested tabs a-1

                                                                                              +

                                                                                              nested tabs a-1

                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              nested tabs a-2

                                                                                              +

                                                                                              nested tabs a-2

                                                                                              +

                                                                                              nested tabs a-2

                                                                                              +

                                                                                              nested tabs a-2

                                                                                              +

                                                                                              nested tabs a-2

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + +
                                                                                              +

                                                                                              nested tabs b-1

                                                                                              +

                                                                                              nested tabs b-1

                                                                                              +

                                                                                              nested tabs b-1

                                                                                              +

                                                                                              nested tabs b-1

                                                                                              +

                                                                                              nested tabs b-1

                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              nested tabs b-2

                                                                                              +

                                                                                              nested tabs b-2

                                                                                              +

                                                                                              nested tabs b-2

                                                                                              +

                                                                                              nested tabs b-2

                                                                                              +

                                                                                              nested tabs b-2

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tooltips.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tooltips.html new file mode 100644 index 0000000..38b85e5 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/tabs_tooltips.html @@ -0,0 +1,37 @@ + + + + + Compound Visual Test : Tabs in Tabs + + + + + + + + + + + + +
                                                                                              + +
                                                                                              + label +
                                                                                              + +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/widgets_in_dialog.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/widgets_in_dialog.html new file mode 100644 index 0000000..b711efa --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/compound/widgets_in_dialog.html @@ -0,0 +1,229 @@ + + + + + Compound Visual Test : All Widgets in Dialog + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                              +
                                                                                              +

                                                                                              Accordion Header 1

                                                                                              +
                                                                                              + Accordion Content 1 +
                                                                                              +

                                                                                              Accordion Header 2

                                                                                              +
                                                                                              + Accordion Content 2 +
                                                                                              +

                                                                                              Accordion Header 3

                                                                                              +
                                                                                              + Accordion Content 3 +
                                                                                              +
                                                                                              + + + + +
                                                                                              + +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + +
                                                                                              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.
                                                                                              +
                                                                                              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.
                                                                                              +
                                                                                              Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + Yay, another dialog. +
                                                                                              + +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. +

                                                                                              +

                                                                                              +Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci. +

                                                                                              +

                                                                                              +Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida. +

                                                                                              +

                                                                                              +Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper. +

                                                                                              +

                                                                                              +Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor. +

                                                                                              +

                                                                                              + +Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi. +

                                                                                              +

                                                                                              +Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae. +

                                                                                              +

                                                                                              +Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat. +

                                                                                              +

                                                                                              +Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna. +

                                                                                              +

                                                                                              +Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc. +

                                                                                              +

                                                                                              +Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod. +

                                                                                              + +

                                                                                              +Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; +

                                                                                              +

                                                                                              +Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis. +

                                                                                              +

                                                                                              +Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis. +

                                                                                              +

                                                                                              +In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est. +

                                                                                              +

                                                                                              +Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat. +

                                                                                              +

                                                                                              +Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida. + +

                                                                                              +

                                                                                              +Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl. +

                                                                                              +

                                                                                              +Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia. +

                                                                                              +

                                                                                              +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. +

                                                                                              +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. +

                                                                                              +

                                                                                              +Proin ut sem nulla, at cursus sapien. Duis sagittis lacus vitae justo mattis in sagittis ligula eleifend. Curabitur sit amet felis pharetra justo facilisis mollis eget nec massa. Sed nisi urna, semper lobortis pretium ac, interdum nec lacus. In gravida, leo sit amet vehicula malesuada, augue nunc consectetur nulla, vel tincidunt est nunc aliquet neque. Maecenas imperdiet eros id ligula tempor dapibus. Integer commodo metus sit amet quam vestibulum volutpat. In et lorem ac leo rhoncus auctor sit amet ut urna. Nulla sed nisl quis turpis vestibulum accumsan. Duis mollis aliquam sollicitudin. Pellentesque porta semper interdum. Sed eros orci, congue quis sollicitudin ut, rutrum vitae nibh. Nunc et leo non ligula interdum imperdiet. Integer tincidunt rhoncus ullamcorper. Curabitur et ullamcorper lorem. Ut at tellus eu metus congue sollicitudin eget at orci. +

                                                                                              +

                                                                                              +Duis sem mauris, pulvinar quis placerat vel, aliquet non leo. Cras eros arcu, ullamcorper sit amet imperdiet at, blandit interdum augue. Phasellus non nunc ac ante condimentum tristique vitae sed urna. Integer nec sapien et dolor volutpat bibendum ac vitae justo. Aliquam gravida fermentum felis, nec dictum dui dictum ac. Maecenas eget magna leo. Phasellus ac nulla risus, dapibus ornare turpis. Morbi a massa tortor. Duis ac turpis lacus. Duis nibh metus, euismod quis ultrices vitae, sollicitudin vel leo. Nullam volutpat odio ac elit imperdiet gravida. +

                                                                                              +

                                                                                              +Donec luctus magna id ipsum aliquam eget convallis tortor tristique. Etiam est quam, aliquam ac rutrum quis, pretium sed tortor. Aliquam lacus diam, rhoncus molestie convallis ut, luctus ac lacus. Nunc porttitor ante a ligula rutrum elementum. Cras dui tellus, pulvinar vel convallis sit amet, facilisis nec ipsum. Donec fermentum lectus lorem, id accumsan eros. Nunc semper laoreet lacus quis ullamcorper. Nunc luctus erat vitae orci sodales facilisis non ut felis. Aliquam pretium sapien sed enim adipiscing in feugiat est ornare. Aenean ultricies convallis tortor sit amet ullamcorper. +

                                                                                              +

                                                                                              +Etiam ultricies elit non enim elementum aliquet. Vivamus quis fringilla mauris. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc blandit felis at massa interdum ac molestie lectus volutpat. Mauris commodo nibh id sem porta id feugiat ante euismod. Nullam fermentum libero varius turpis pharetra cursus ut sed lacus. Mauris molestie egestas augue eu bibendum. Quisque pulvinar, leo luctus vehicula faucibus, quam mi ornare dui, a rhoncus nisi eros nec dolor. Sed dictum ultricies ipsum eu ultrices. Etiam semper condimentum nibh in tempor. +

                                                                                              +

                                                                                              + +Vivamus interdum ligula nec neque sollicitudin ornare. Vestibulum a eros eget nisi accumsan hendrerit quis sit amet ipsum. Phasellus condimentum vestibulum felis eu hendrerit. Suspendisse in est tellus, et consequat ante. Nam at sapien lobortis risus dignissim malesuada. In dapibus lectus sed nibh adipiscing dictum. Nulla pellentesque convallis auctor. Suspendisse ut purus et nibh pulvinar tincidunt. Maecenas dapibus purus at odio commodo ac cursus risus luctus. Ut quis libero justo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam vestibulum ipsum quis ante porttitor porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut in ante neque. Donec ante ante, porttitor non egestas a, pulvinar sed sem. Nam augue quam, fringilla sed egestas et, vulputate non nisi. +

                                                                                              +

                                                                                              +Nunc sit amet arcu ac nulla bibendum sollicitudin. Pellentesque sed ligula urna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Quisque egestas, tortor a vestibulum malesuada, ante dui condimentum massa, ac rutrum massa mauris non mi. Praesent in nisi leo. Sed ac augue nisl. Donec eget enim ut arcu posuere condimentum vel id magna. Vestibulum laoreet imperdiet massa, ut venenatis ante dapibus eu. Phasellus faucibus vestibulum eros mollis adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque aliquet lectus at enim gravida tempus tincidunt mi porta. Sed vehicula molestie ligula, sed tincidunt diam suscipit vitae. +

                                                                                              +

                                                                                              +Nullam euismod tempus ante, vel semper turpis pharetra eget. Nulla pretium ante et ipsum dapibus imperdiet. Praesent ipsum velit, gravida sed adipiscing id, condimentum in odio. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce blandit vehicula felis, pretium ullamcorper leo tempor non. Nunc eget nisi nunc, posuere pellentesque enim. Nunc gravida orci quis odio semper ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque eu neque a sapien commodo placerat. Aenean non eros semper metus viverra porttitor. Integer vel tortor eu neque commodo ultrices eu quis tellus. Nam commodo sagittis dolor in consequat. Fusce hendrerit turpis eget leo rutrum ut scelerisque nibh condimentum. Fusce sit amet feugiat mauris. Maecenas elementum tellus nec augue rutrum mattis. Sed viverra tempor blandit. Pellentesque adipiscing tincidunt est sit amet tincidunt. Proin suscipit suscipit odio, eu pellentesque dolor pharetra non. Aliquam erat volutpat. +

                                                                                              +

                                                                                              +Duis pellentesque, enim sed mollis congue, ante mauris feugiat nisi, bibendum euismod erat enim ac magna. Mauris risus nisl, sodales vel viverra ut, interdum sed neque. Nunc ac dignissim felis. Proin tincidunt orci elementum erat molestie suscipit. Cras suscipit, sem ac vehicula vehicula, lorem orci dictum nibh, ut bibendum odio sem non erat. Maecenas quis metus eget mauris feugiat porta a eu ipsum. Vivamus tortor purus, posuere ut luctus sed, ullamcorper feugiat neque. In hac habitasse platea dictumst. Vivamus nec justo vel lacus mattis pellentesque. Nunc vel gravida quam. Etiam at aliquam magna. +

                                                                                              +

                                                                                              +Sed ac lacus ac felis auctor suscipit. Aliquam lacinia lectus ac nunc placerat aliquam accumsan neque interdum. Aenean in sapien sem. Suspendisse potenti. Aenean congue vulputate scelerisque. Proin eget eros tortor. Morbi rhoncus, mi vitae sollicitudin luctus, est orci porttitor turpis, vitae cursus est dui sed leo. Curabitur erat nunc, placerat bibendum tempus in, blandit eget ipsum. Cras in feugiat ipsum. Vestibulum dapibus quam nec odio pretium non dapibus purus dapibus. Pellentesque vehicula metus bibendum orci ultrices tincidunt. Sed fermentum, neque eget porta tempor, sem neque pulvinar ligula, vitae elementum massa metus eget nunc. Nunc sed orci eu purus sodales fringilla. Quisque aliquet arcu ac dolor ultrices fringilla. Nullam ornare tempus lorem, in mattis magna mollis laoreet. Vestibulum convallis arcu in purus lobortis et sollicitudin ipsum aliquet. Quisque risus est, sagittis eu aliquam ac, condimentum at massa. Fusce consectetur dignissim sem vel ornare. Maecenas posuere ultricies sollicitudin. Duis luctus, purus quis auctor egestas, diam felis scelerisque diam, a varius tellus erat a nunc. +

                                                                                              +

                                                                                              +Phasellus id ante neque, eget volutpat risus. Vivamus scelerisque, nisi rutrum ultrices varius, sem quam suscipit purus, in elementum nibh nulla nec nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus interdum hendrerit mi, nec cursus nisi tempor ac. Phasellus luctus ligula bibendum mauris iaculis id tempor odio volutpat. Nunc in augue metus. Suspendisse at libero at libero lacinia convallis eu vitae metus. Duis eget risus odio. Nam id mi tellus, non vulputate libero. In placerat dictum orci eu pellentesque. Etiam sed varius felis. Phasellus ut adipiscing leo. Morbi ante eros, interdum eget dapibus ac, varius congue nunc. Donec vulputate sapien id risus sodales sit amet pretium velit iaculis. Etiam ultrices tempor euismod. +

                                                                                              + +

                                                                                              +Praesent in turpis ut mauris cursus commodo. Mauris lectus tellus, congue sit amet dictum id, convallis ac nisi. Curabitur ante dolor, sagittis ac auctor ac, aliquet vel nisl. Nulla non porta sapien. Nunc non aliquet erat. Vestibulum euismod auctor volutpat. Mauris libero tellus, pharetra eget lacinia sit amet, viverra eget velit. Sed viverra varius velit at pharetra. Sed pharetra dolor sed erat interdum in placerat magna lacinia. Cras venenatis tellus non sapien egestas sollicitudin. Duis congue pharetra lacinia. Curabitur eu diam vel tortor rhoncus dignissim vel sed enim. Proin ut congue mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra elit eu dolor tincidunt tempor vel nec magna. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; +

                                                                                              +

                                                                                              +Sed ligula purus, tristique nec condimentum sed, facilisis ac augue. Integer volutpat velit urna, et posuere ligula. In tempus luctus dignissim. Duis augue neque, egestas ut tincidunt in, congue a enim. Aliquam ut odio dui, id congue tortor. Nullam venenatis erat non nulla tincidunt scelerisque. Morbi in urna ac nulla molestie scelerisque eu a nulla. Aliquam erat volutpat. Praesent dictum scelerisque lorem mattis vehicula. Quisque ut rutrum metus. Mauris pharetra ante vitae nunc mattis vulputate. Mauris molestie volutpat mauris, ut iaculis dui bibendum ac. Ut egestas laoreet est, eget mollis libero laoreet at. In sagittis vestibulum accumsan. Nam dapibus ultrices urna sit amet accumsan. Pellentesque id ultrices elit. Aliquam quis magna ut leo sagittis posuere sit amet id enim. Etiam congue eros sit amet nulla aliquam gravida. In accumsan lectus nibh. Proin volutpat pretium facilisis. +

                                                                                              +

                                                                                              +Mauris pulvinar erat at quam egestas ac aliquet mi gravida. Integer pellentesque quam vel massa commodo vitae sollicitudin eros volutpat. Aenean mollis felis molestie quam placerat et elementum eros gravida. In hac habitasse platea dictumst. Mauris ullamcorper facilisis eros, nec rutrum mi auctor sed. Ut viverra, orci a viverra ultricies, turpis enim pellentesque urna, sit amet viverra metus enim ut justo. Donec aliquam, urna id condimentum rutrum, nibh nunc tristique magna, at luctus quam enim at turpis. Maecenas dapibus dui ac velit adipiscing fringilla. Nullam malesuada nunc vel lorem cursus sed congue felis lacinia. Pellentesque vehicula gravida est nec facilisis. Nullam imperdiet fringilla orci in dignissim. Praesent orci dolor, vestibulum eu auctor quis, tristique auctor mi. Nunc euismod dui sit amet metus malesuada feugiat. Fusce iaculis neque in velit interdum rhoncus. Aenean at risus ut arcu dapibus congue a tincidunt dolor. Donec porttitor lacus et urna vestibulum a sagittis nunc mollis. +

                                                                                              +

                                                                                              +In metus tellus, eleifend id aliquet at, pulvinar ut tortor. Aliquam erat volutpat. Vivamus lacus magna, consequat vel euismod sed, viverra a ipsum. Praesent dapibus laoreet nisi, nec posuere massa commodo vel. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ullamcorper adipiscing ante, dapibus molestie velit cursus id. Nam cursus arcu consectetur lectus sollicitudin gravida. Maecenas urna sapien, fermentum sit amet consectetur at, feugiat ut massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet ante nec arcu bibendum bibendum ut ut justo. Nulla ut libero est. +

                                                                                              +

                                                                                              +Aenean sem augue, malesuada quis elementum id, aliquet at turpis. Nam volutpat interdum purus, at dictum risus posuere rhoncus. Praesent metus diam, egestas in lacinia eu, tincidunt in nibh. Phasellus sollicitudin volutpat erat, sit amet mattis sapien fringilla in. Quisque rhoncus, felis a pellentesque dictum, arcu urna molestie sem, ut tincidunt nulla magna in enim. Vestibulum erat nulla, sollicitudin quis faucibus et, blandit quis est. Nam vehicula justo augue. Vivamus elementum sodales aliquet. Donec convallis neque sed dui euismod aliquet. Morbi elementum hendrerit odio, vel mollis felis dignissim vitae. Phasellus a diam lacus. Integer congue, mi vehicula egestas imperdiet, nulla mi commodo tortor, sit amet fermentum urna leo non dolor. Donec elementum elementum urna at sollicitudin. Vestibulum placerat tortor in nibh lobortis ac consectetur felis interdum. Integer faucibus diam nec magna porttitor sit amet dictum elit consectetur. Suspendisse risus velit, pellentesque eget viverra in, porta eget metus. Sed porta elit erat. +

                                                                                              +

                                                                                              +Nulla facilisi. Aliquam vulputate dolor quis nisi auctor luctus. Fusce vitae scelerisque velit. Sed sit amet tortor a nisi convallis pulvinar et eget sapien. Nulla condimentum auctor velit, a viverra nibh pellentesque eget. Aenean at lacus quam, lobortis posuere justo. Duis et diam in ligula rhoncus pellentesque. Morbi massa tellus, mattis nec condimentum ut, tempus eu lectus. In mi orci, luctus at pulvinar vel, scelerisque nec enim. Vestibulum vehicula odio in augue dignissim tincidunt. Integer ac velit ligula. Integer elit turpis, mattis eget ornare ut, eleifend in magna. Curabitur sagittis dui in felis ultricies gravida. + +

                                                                                              +

                                                                                              +Praesent adipiscing rhoncus rutrum. Aenean ultricies auctor risus at fringilla. Mauris quam lectus, ullamcorper sed ultricies at, interdum eget tellus. Vestibulum ac mi erat. Sed ac tellus erat, sed laoreet arcu. Fusce eget ipsum ac sem volutpat viverra. Suspendisse ac felis sit amet purus viverra luctus non eget ipsum. Praesent eleifend euismod tortor, vel malesuada felis consectetur ac. Nunc a mi sit amet nulla venenatis tincidunt. Morbi vitae nisl nulla, nec adipiscing sem. Nullam porttitor scelerisque urna, id dapibus diam malesuada vitae. Duis auctor eleifend lectus, a tempor odio aliquet quis. Nam eu est urna, nec ultricies lectus. Ut egestas aliquet nunc, et hendrerit erat vehicula non. Aliquam tempus faucibus arcu, at vulputate erat tempor eu. Quisque tempus, lectus adipiscing blandit scelerisque, magna felis eleifend odio, non volutpat felis enim sit amet leo. Mauris augue tortor, ultrices ac sagittis non, vulputate quis nisl. +

                                                                                              +

                                                                                              +Fusce erat sem, dictum in bibendum ac, feugiat ut odio. Duis aliquam felis sit amet diam egestas consectetur. Phasellus consequat, mauris eget venenatis porta, velit sapien malesuada nibh, id dignissim ante tellus vitae lacus. Duis non nisl sit amet nunc euismod posuere. Donec eros erat, fringilla vel iaculis condimentum, vestibulum at neque. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam lorem sapien, bibendum eu mollis nec, gravida dapibus lectus. Aenean pretium volutpat nunc a placerat. Nullam eget tellus quis ipsum ultrices ullamcorper non eu mauris. Donec volutpat tincidunt elit, sit amet cursus justo elementum quis. Mauris volutpat, enim sit amet tempor commodo, purus lacus luctus dui, sed aliquet ligula nisi vel diam. Donec est elit, lobortis at eleifend id, feugiat egestas massa. Fusce elementum sollicitudin adipiscing. Vivamus et dapibus ipsum. Morbi interdum libero a nisl dignissim sed facilisis ipsum lacinia. +

                                                                                              +

                                                                                              +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. +

                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/dialog/dialog_on_page_with_large_dom.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/dialog/dialog_on_page_with_large_dom.html new file mode 100644 index 0000000..c7c1056 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/dialog/dialog_on_page_with_large_dom.html @@ -0,0 +1,2963 @@ + + + + + Dialog Visual Test : Modal Dialog in Large DOM + + + + + + + + + + + + + + + +
                                                                                              +

                                                                                              Dialog Content

                                                                                              + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + +
                                                                                              + + + + + + +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.css b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.css new file mode 100644 index 0000000..1d531b0 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.css @@ -0,0 +1,55 @@ + +body,html { + margin: 0; + padding: 0; + font-size: 12px; + font-family: Arial; + background: #191919; + color: #fff; +} +body { margin: 1em; } + +ul.effects { + list-style-type: none; + margin: 0; + padding: 0; +} + +ul.effects li { + list-style-type: none; + margin: 0; + padding: 0; + width: 120px; + height: 100px; + float: left; + margin-top: 20px; + margin-left: 20px; +} + +div.effect { + width: 120px; + height: 100px; + background: #ccc; + border: 5px outset #aaa; + float: left; + cursor: pointer; + cursor: hand; +} + +div.current { + border: 5px outset #FF9C08; + background: #FF9C08; +} + +div.effect p { + color: #191919; + font-weight: bold; + margin: 0px; + padding: 10px; +} + +.ui-effects-transfer { + border: 1px dotted #fff; + background: #666; + opacity: 0.5; +} diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.html new file mode 100644 index 0000000..ddc6654 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.html @@ -0,0 +1,217 @@ + + + + + jQuery UI Effects Test Suite + + + + + + + + + + + + + + + + + + + + +
                                                                                                + +
                                                                                              • +
                                                                                                +

                                                                                                Blind up

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Blind down

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Blind left

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Blind right

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Bounce 3 times

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Clip horizontally

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Clip vertically

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • + +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Drop up

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Drop left

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Drop right

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Explode in 9 pieces

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Explode in 36 pieces

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Fade

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Fold

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Highlight

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Pulsate 2 times

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Puff

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Scale

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Shake

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Size Default Show/Hide

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Size Toggle

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Slide down

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Slide up

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Slide left

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Slide right

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                Transfer to first element

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                addClass

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                removeClass

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                toggleClass

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              • +
                                                                                                +

                                                                                                hide/show (jQuery)

                                                                                                +
                                                                                                +
                                                                                              • + +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.js b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.js new file mode 100644 index 0000000..a28c41a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.all.js @@ -0,0 +1,106 @@ + +$(function() { + var duration = 1000, wait = 500; + + $("div.effect") + .hover(function() { $(this).addClass("hover"); }, + function() { $(this).removeClass("hover"); }); + + var effect = function(el, n, o) { + + $.extend(o, { + easing: "easeOutQuint" + }); + + $(el).bind("click", function() { + + $(this).addClass("current") + // delaying the initial animation makes sure that the queue stays in tact + .delay( 10 ) + .hide( n, o, duration ) + .delay( wait ) + .show( n, o, duration, function() { + $( this ).removeClass("current"); + }); + }); + + }; + + $("#hide").click(function() { + var el = $(this); + el.addClass("current").hide(duration, function() { + setTimeout(function() { + el.show(duration, function() { el.removeClass("current"); }); + }, wait); + }); + }); + + effect("#blindLeft", "blind", { direction: "left" }); + effect("#blindUp", "blind", { direction: "up" }); + effect("#blindRight", "blind", { direction: "right" }); + effect("#blindDown", "blind", { direction: "down" }); + + effect("#bounce3times", "bounce", { times: 3 }); + + effect("#clipHorizontally", "clip", { direction: "horizontal" }); + effect("#clipVertically", "clip", { direction: "vertical" }); + + effect("#dropDown", "drop", { direction: "down" }); + effect("#dropUp", "drop", { direction: "up" }); + effect("#dropLeft", "drop", { direction: "left" }); + effect("#dropRight", "drop", { direction: "right" }); + + effect("#explode9", "explode", {}); + effect("#explode36", "explode", { pieces: 36 }); + + effect("#fade", "fade", {}); + + effect("#fold", "fold", { size: 50 }); + + effect("#highlight", "highlight", {}); + + effect("#pulsate", "pulsate", { times: 2 }); + + effect("#puff", "puff", { times: 2 }); + effect("#scale", "scale", {}); + effect("#size", "size", {}); + $("#sizeToggle").bind("click", function() { + var opts = { to: { width: 300, height: 300 }}; + $(this).addClass('current') + .toggle("size", opts, duration) + .delay(wait) + .toggle("size", opts, duration, function() { + $(this).removeClass("current"); + }); + }); + + $("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); }); + + effect("#slideDown", "slide", { direction: "down" }); + effect("#slideUp", "slide", { direction: "up" }); + effect("#slideLeft", "slide", { direction: "left" }); + effect("#slideRight", "slide", { direction: "right" }); + + $("#transfer").bind("click", function() { $(this).addClass("current").effect("transfer", { to: "div:eq(0)" }, 1000, function() { $(this).removeClass("current"); }); }); + + $("#addClass").click(function() { + $(this).addClass(function() { + window.console && console.log(arguments); + return "current"; + }, duration, function() { + $(this).removeClass("current"); + }); + }); + $("#removeClass").click(function() { + $(this).addClass("current").removeClass(function() { + window.console && console.log(arguments); + return "current"; + }, duration); + }); + $("#toggleClass").click(function() { + $(this).toggleClass(function() { + window.console && console.log(arguments); + return "current"; + }, duration); + }); +}); diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.scale.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.scale.html new file mode 100644 index 0000000..845625e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/effects/effects.scale.html @@ -0,0 +1,159 @@ + + + + + jQuery UI Effects Test Suite + + + + + + + + + +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + + +
                                                                                              + + + + +
                                                                                              + \ No newline at end of file diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/drilldown.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/drilldown.html new file mode 100644 index 0000000..a2ae9e8 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/drilldown.html @@ -0,0 +1,266 @@ + + + + Menu Visual Test: Default + + + + + + + + + + + + + + +
                                                                                              +

                                                                                              Make a selection...

                                                                                              + + Go back +
                                                                                              + +
                                                                                              + Log: +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/menu.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/menu.html new file mode 100644 index 0000000..50837f4 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/menu.html @@ -0,0 +1,283 @@ + + + + Menu Visual Test: Default + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                              + Log: +
                                                                                              +
                                                                                              + + + + + + \ No newline at end of file diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/tablemenu.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/tablemenu.html new file mode 100644 index 0000000..bce64bf --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/menu/tablemenu.html @@ -0,0 +1,67 @@ + + + + Menu Visual Test: Default + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                              FirstnameLastname
                                                                                              ScottGonzo
                                                                                              RichyWorth
                                                                                              + +
                                                                                              + Log: +
                                                                                              +
                                                                                              + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position.html new file mode 100644 index 0000000..9d29abe --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position.html @@ -0,0 +1,67 @@ + + + + + Position Visual Test: Default + + + + + + + + + + + + + +
                                                                                              + + + + + + + + + + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_fit.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_fit.html new file mode 100644 index 0000000..78751d3 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_fit.html @@ -0,0 +1,148 @@ + + + + + Position Visual Test: Fit + + + + + + + + + + + + + +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flip.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flip.html new file mode 100644 index 0000000..7b26f6a --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flip.html @@ -0,0 +1,77 @@ + + + + + Position Visual Test: Flip + + + + + + + + + + + + + +
                                                                                              +
                                                                                              +

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + + + + + + + + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flipfit.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flipfit.html new file mode 100644 index 0000000..b5cf829 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_flipfit.html @@ -0,0 +1,86 @@ + + + + + Position Visual Test: FlipFit + + + + + + + + + + + + + +
                                                                                              +
                                                                                              +

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_margin.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_margin.html new file mode 100644 index 0000000..52b8008 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_margin.html @@ -0,0 +1,43 @@ + + + + + Position Visual Test: Default + + + + + + + + + + + + +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_within.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_within.html new file mode 100644 index 0000000..156c82e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/position/position_within.html @@ -0,0 +1,200 @@ + + + + + Position Visual Test: Containing Element + + + + + + + + + + + + + + + + +
                                                                                              + Use the form controls to configure the positioning, or drag the positioned element to modify its offset. +
                                                                                              Drag around the parent element to see collision detection in action. +
                                                                                              + +
                                                                                              +
                                                                                              + +
                                                                                              +

                                                                                              This is the position parent element.

                                                                                              +
                                                                                              + +
                                                                                              +

                                                                                              to position

                                                                                              +
                                                                                              + +
                                                                                              +

                                                                                              to position 2

                                                                                              +
                                                                                              + +
                                                                                              + position... +
                                                                                              + my: + + +
                                                                                              +
                                                                                              + at: + + +
                                                                                              +
                                                                                              + offset: + +
                                                                                              +
                                                                                              + collision: + + +
                                                                                              +
                                                                                              + +
                                                                                              +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/theme.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/theme.html new file mode 100644 index 0000000..131cc41 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/theme.html @@ -0,0 +1,532 @@ + + + + + jQuery UI Example Page + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                              + + +

                                                                                              Accordion

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              First

                                                                                              +
                                                                                              Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Second

                                                                                              +
                                                                                              Phasellus mattis tincidunt nibh.
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Third

                                                                                              +
                                                                                              Nam dui erat, auctor a, dignissim quis.
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              First no icons

                                                                                              +
                                                                                              Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Second no icons

                                                                                              +
                                                                                              Phasellus mattis tincidunt nibh.
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              Third no icons

                                                                                              +
                                                                                              Nam dui erat, auctor a, dignissim quis.
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + +

                                                                                              Tabs

                                                                                              +
                                                                                              + +
                                                                                              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.
                                                                                              +
                                                                                              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.
                                                                                              +
                                                                                              Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.
                                                                                              +
                                                                                              + + +

                                                                                              Dialog

                                                                                              +

                                                                                              Open Dialog

                                                                                              + +
                                                                                              Inline Dialogclose
                                                                                              +

                                                                                              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.

                                                                                              +
                                                                                              + + +

                                                                                              Overlay and Shadow Classes (not currently used in UI widgets)

                                                                                              +
                                                                                              +

                                                                                              Lorem ipsum dolor sit amet, 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. 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. 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.

                                                                                              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.

                                                                                              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.

                                                                                              + + +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              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.

                                                                                              +
                                                                                              +
                                                                                              + +
                                                                                              + + + +
                                                                                              +

                                                                                              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.

                                                                                              +
                                                                                              + + + +

                                                                                              Framework Icons (content color preview)

                                                                                              +
                                                                                                + +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • + +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              • +
                                                                                              + + + +

                                                                                              Slider

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + 88 + 77 + 55 + 33 + 40 + 45 + 70 +
                                                                                              +
                                                                                              + + + +

                                                                                              Datepicker

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              + + + +

                                                                                              Progressbar

                                                                                              +
                                                                                              + + +

                                                                                              Highlight / Error

                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              + Hey! Sample ui-state-highlight style.

                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +
                                                                                              +

                                                                                              + Alert: Sample ui-state-error style.

                                                                                              +
                                                                                              +
                                                                                              + +

                                                                                              Button

                                                                                              + +
                                                                                              + + +
                                                                                              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/ajaxcontent.php b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/ajaxcontent.php new file mode 100644 index 0000000..a689a73 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/ajaxcontent.php @@ -0,0 +1,2 @@ + +Hello world! \ No newline at end of file diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/animations.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/animations.html new file mode 100644 index 0000000..993fbbd --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/animations.html @@ -0,0 +1,72 @@ + + + + Tooltip Visual Test: Default + + + + + + + + + + + + + + + + + + +
                                                                                              +
                                                                                                +
                                                                                              +
                                                                                              + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/callout.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/callout.html new file mode 100644 index 0000000..79d8d32 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/callout.html @@ -0,0 +1,213 @@ + + + + Tooltip Visual Test: Default + + + + + + + + + + + + + +
                                                                                              + + +
                                                                                              + collision detection should kick in around here +
                                                                                              + + + +
                                                                                              + right aligned with custom position +
                                                                                              + +
                                                                                              + gets its content via ajax +
                                                                                              + +
                                                                                              + span +
                                                                                              + div + nested span +
                                                                                              +
                                                                                              + +
                                                                                              +
                                                                                              + + +
                                                                                              +
                                                                                              + + +
                                                                                              +
                                                                                              + +
                                                                                              This is the footnote, including other elements
                                                                                              + + + +
                                                                                              + + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/tooltip.html b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/tooltip.html new file mode 100644 index 0000000..b282a73 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/tooltip/tooltip.html @@ -0,0 +1,186 @@ + + + + Tooltip Visual Test: Default + + + + + + + + + + + + + +
                                                                                              + + +
                                                                                              + collision detection should kick in around here +
                                                                                              + + + +
                                                                                              + right aligned with custom position +
                                                                                              + +
                                                                                              + gets its content via ajax +
                                                                                              +
                                                                                              + gets its content via ajax, caches the response +
                                                                                              + +
                                                                                              + span +
                                                                                              + div + nested span +
                                                                                              +
                                                                                              + +
                                                                                              + Text in bold. +
                                                                                              + +
                                                                                              +
                                                                                              + + +
                                                                                              +
                                                                                              + + +
                                                                                              +
                                                                                              + +
                                                                                              + + + + +
                                                                                              + +
                                                                                              This is the footnote, including other elements
                                                                                              +
                                                                                              This is the other footnote, including other elements
                                                                                              + + + +
                                                                                              + +
                                                                                              + + + diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/visual/visual.css b/src/main/webapp/jquery-ui-1.9pre/tests/visual/visual.css new file mode 100644 index 0000000..b61fc0e --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/visual/visual.css @@ -0,0 +1,3 @@ +body { font-size: 62.5%; } +#draggable, #resizable { width: 100px; height: 100px; background: #abc; } +#droppable { width: 100px; height: 100px; background: #cde; } -- cgit v1.1