From f78c8ca22c12fbfc72f6b9b1964739f864f90dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 15 Feb 2013 15:07:15 -0500 Subject: [PATCH 01/50] Updating the master version to 1.10.2pre. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15fe7daffa5..ae8b13dc802 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jquery-ui", "title": "jQuery UI", "description": "A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.", - "version": "1.10.1pre", + "version": "1.10.2pre", "homepage": "http://jqueryui.com", "author": { "name": "jQuery Foundation and other contributors", From a692bf9b70305de5e9893e717fc71e1e74fb86ac Mon Sep 17 00:00:00 2001 From: Nathanael Silverman Date: Wed, 13 Feb 2013 17:34:52 +0100 Subject: [PATCH 02/50] Sortable: Inject a CSS rule to style the cursor. Fixed #7389 - sortable: 'cursor' option didn't override CSS cursor settings. --- ui/jquery.ui.sortable.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 211ff272e8b..c9b503bd09b 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -158,7 +158,7 @@ $.widget("ui.sortable", $.ui.mouse, { _mouseStart: function(event, overrideHandle, noActivation) { - var i, + var i, body, o = this.options; this.currentContainer = this; @@ -228,11 +228,14 @@ $.widget("ui.sortable", $.ui.mouse, { this._setContainment(); } - if(o.cursor) { // cursor option - if ($("body").css("cursor")) { - this._storedCursor = $("body").css("cursor"); - } - $("body").css("cursor", o.cursor); + if( o.cursor && o.cursor !== "auto" ) { // cursor option + body = this.document.find( "body" ); + + // support: IE + this.storedCursor = body.css( "cursor" ); + body.css( "cursor", o.cursor ); + + this.storedStylesheet = $( "" ).appendTo( body ); } if(o.opacity) { // opacity option @@ -1178,8 +1181,9 @@ $.widget("ui.sortable", $.ui.mouse, { } //Do what was originally in plugins - if(this._storedCursor) { - $("body").css("cursor", this._storedCursor); + if ( this.storedCursor ) { + this.document.find( "body" ).css( "cursor", this.storedCursor ); + this.storedStylesheet.remove(); } if(this._storedOpacity) { this.helper.css("opacity", this._storedOpacity); From 5e1b8dc71a72d5753a95c49c844857b91fbdbade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 18 Feb 2013 16:07:15 -0500 Subject: [PATCH 03/50] Dialog: Don't hard-code widget data key. Fixes #9097 - UI dialog inheritance. --- ui/jquery.ui.dialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 85dbddda266..9d61cf745f1 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -697,6 +697,7 @@ $.widget( "ui.dialog", { return; } + var widgetFullName = this.widgetFullName; if ( !$.ui.dialog.overlayInstances ) { // Prevent use of anchors and inputs. // We use a delay in case the overlay is created from an @@ -711,7 +712,7 @@ $.widget( "ui.dialog", { !$( event.target ).closest(".ui-datepicker").length ) { event.preventDefault(); $(".ui-dialog:visible:last .ui-dialog-content") - .data("ui-dialog")._focusTabbable(); + .data( widgetFullName )._focusTabbable(); } }); } From 10ca48308fea6a9b30d2457fbf5a1b6e0ed5966c Mon Sep 17 00:00:00 2001 From: Christian Wenz Date: Mon, 18 Feb 2013 18:35:10 -0800 Subject: [PATCH 04/50] Datepicker: Updated German locale. Fixes #9098 - Datepicker German localization - make casing of previous/next/today consistent. --- ui/i18n/jquery.ui.datepicker-de.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/i18n/jquery.ui.datepicker-de.js b/ui/i18n/jquery.ui.datepicker-de.js index cfe91759b07..abe75c4e429 100644 --- a/ui/i18n/jquery.ui.datepicker-de.js +++ b/ui/i18n/jquery.ui.datepicker-de.js @@ -2,10 +2,10 @@ /* Written by Milian Wolff (mail@milianw.de). */ jQuery(function($){ $.datepicker.regional['de'] = { - closeText: 'schließen', - prevText: '<zurück', + closeText: 'Schließen', + prevText: '<Zurück', nextText: 'Vor>', - currentText: 'heute', + currentText: 'Heute', monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'], monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', From 51eb28e76e372fe0af12724edff0b5780b5e5ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 20 Feb 2013 17:35:48 -0500 Subject: [PATCH 05/50] Dialog: Extract check for which elements can gain focus into its own method for overriding. Fixes #9087 - Dialog: Allow registering elements outside a dialog for use when a modal dialog is open. --- ui/jquery.ui.dialog.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 9d61cf745f1..b35c0ffcf67 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -692,12 +692,23 @@ $.widget( "ui.dialog", { } }, + _allowInteraction: function( event ) { + if ( $( event.target ).closest(".ui-dialog").length ) { + return true; + } + + // TODO: Remove hack when datepicker implements + // the .ui-front logic (#8989) + return !!$( event.target ).closest(".ui-datepicker").length; + }, + _createOverlay: function() { if ( !this.options.modal ) { return; } - var widgetFullName = this.widgetFullName; + var that = this, + widgetFullName = this.widgetFullName; if ( !$.ui.dialog.overlayInstances ) { // Prevent use of anchors and inputs. // We use a delay in case the overlay is created from an @@ -706,10 +717,7 @@ $.widget( "ui.dialog", { // Handle .dialog().dialog("close") (#4065) if ( $.ui.dialog.overlayInstances ) { this.document.bind( "focusin.dialog", function( event ) { - if ( !$( event.target ).closest(".ui-dialog").length && - // TODO: Remove hack when datepicker implements - // the .ui-front logic (#8989) - !$( event.target ).closest(".ui-datepicker").length ) { + if ( !that._allowInteraction( event ) ) { event.preventDefault(); $(".ui-dialog:visible:last .ui-dialog-content") .data( widgetFullName )._focusTabbable(); From bd47bd4ace3789d9eb302b0dce6f6e042d08a7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 20 Feb 2013 20:16:29 -0500 Subject: [PATCH 06/50] Sortable: When sorting table rows, create a td to force dimensions. Fixes #4765 - Sortable: Placeholder not displayed when sorting table rows. --- tests/unit/sortable/sortable.html | 21 +++++++++++++++ tests/unit/sortable/sortable_options.js | 34 +++++++++++++++++++++++-- ui/jquery.ui.sortable.js | 20 ++++++++++----- 3 files changed, 67 insertions(+), 8 deletions(-) diff --git a/tests/unit/sortable/sortable.html b/tests/unit/sortable/sortable.html index c23a15854e4..6e326a8657c 100644 --- a/tests/unit/sortable/sortable.html +++ b/tests/unit/sortable/sortable.html @@ -63,6 +63,27 @@

  • Item 5
  • + + + + + + + + + + + + + + + + + + + +
    12
    34
    56
    78
    + diff --git a/tests/unit/sortable/sortable_options.js b/tests/unit/sortable/sortable_options.js index cf35aedb1df..fe50be002d7 100644 --- a/tests/unit/sortable/sortable_options.js +++ b/tests/unit/sortable/sortable_options.js @@ -185,11 +185,41 @@ test("{ opacity: 1 }", function() { test("{ placeholder: false }, default", function() { ok(false, "missing test - untested code is broken code."); }); +*/ +test( "{ placeholder: String }", function() { + expect( 1 ); -test("{ placeholder: String }", function() { - ok(false, "missing test - untested code is broken code."); + var element = $( "#sortable" ).sortable({ + placeholder: "test", + start: function( event, ui ) { + ok( ui.placeholder.hasClass( "test" ), "placeholder has class" ); + } + }); + + element.find( "li" ).eq( 0 ).simulate( "drag", { + dy: 1 + }); +}); + +test( "{ placholder: String } tr", function() { + expect( 3 ); + + var element = $( "#sortable-table tbody" ).sortable({ + placeholder: "test", + start: function( event, ui ) { + ok( ui.placeholder.hasClass( "test" ), "placeholder has class" ); + equal( ui.placeholder.children().length, 1, "placeholder tr contains a td" ); + equal( ui.placeholder.children().html(), $( " " ).html(), + "placeholder td has content for forced dimensions" ); + } + }); + + element.find( "tr" ).eq( 0 ).simulate( "drag", { + dy: 1 + }); }); +/* test("{ revert: false }, default", function() { ok(false, "missing test - untested code is broken code."); }); diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index c9b503bd09b..f095ce9c505 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -752,15 +752,23 @@ $.widget("ui.sortable", $.ui.mouse, { o.placeholder = { element: function() { - var el = $(document.createElement(that.currentItem[0].nodeName)) - .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") - .removeClass("ui-sortable-helper")[0]; + var nodeName = that.currentItem[0].nodeName.toLowerCase(), + element = $( that.document[0].createElement( nodeName ) ) + .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper"); + + if ( nodeName === "tr" ) { + // Use a high colspan to force the td to expand the full + // width of the table (browsers are smart enough to + // handle this properly) + element.append( " " ); + } - if(!className) { - el.style.visibility = "hidden"; + if ( !className ) { + element.css( "visibility", "hidden" ); } - return el; + return element; }, update: function(container, p) { From a924af12b6743408903c642f84a00b0766cd17b7 Mon Sep 17 00:00:00 2001 From: Steve Urmston Date: Tue, 19 Feb 2013 22:58:31 +0000 Subject: [PATCH 07/50] Draggable: Revert flag honours Sortable revert speed. Fixed #9103 Draggable: revert option reset after being added to a connectedSortable. --- ui/jquery.ui.draggable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 8b388d16650..27b6b4ef042 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -600,7 +600,7 @@ $.ui.plugin.add("draggable", "connectToSortable", { //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid" if(this.shouldRevert) { - this.instance.options.revert = true; + this.instance.options.revert = this.shouldRevert; } //Trigger the stop of the sortable From 1c5171c2547130a76710dd20108b35774551e333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 22 Feb 2013 08:53:03 -0500 Subject: [PATCH 08/50] Tabs: Use border-bottom-width instead of border-bottom to remove the border on tabs. Fixes #9111 - Tabs: Can't inherit border-bottom-color for vertical tabs. --- themes/base/jquery.ui.tabs.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base/jquery.ui.tabs.css b/themes/base/jquery.ui.tabs.css index 6c35e193e95..b8f77b04078 100644 --- a/themes/base/jquery.ui.tabs.css +++ b/themes/base/jquery.ui.tabs.css @@ -22,7 +22,7 @@ position: relative; top: 0; margin: 1px .2em 0 0; - border-bottom: 0; + border-bottom-width: 0; padding: 0; white-space: nowrap; } From 2348fb8eb9ec1297a2588a23cf3447c5374bcb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 22 Feb 2013 09:15:43 -0500 Subject: [PATCH 09/50] Spinner: Call _stop() on blur. Fixes #9112 - Spinner keeps changing after losing focus. --- tests/unit/spinner/spinner_core.js | 27 +++++++++++++++++++++++++++ ui/jquery.ui.spinner.js | 1 + 2 files changed, 28 insertions(+) diff --git a/tests/unit/spinner/spinner_core.js b/tests/unit/spinner/spinner_core.js index a1179bb3517..bea5f91222c 100644 --- a/tests/unit/spinner/spinner_core.js +++ b/tests/unit/spinner/spinner_core.js @@ -80,6 +80,33 @@ test( "keydown PAGE_DOWN on input, decreases value not less than min", function( equal( element.val(), 20 ); }); +asyncTest( "blur input while spinning with UP", function() { + expect( 3 ); + var value, + element = $( "#spin" ).val( 10 ).spinner(); + + function step1() { + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + equal( element.val(), 11 ); + setTimeout( step2, 750 ); + } + + function step2() { + value = element.val(); + ok( value > 11, "repeating while key is down" ); + element[0].blur(); + setTimeout( step3, 250 ); + } + + function step3() { + equal( element.val(), value, "stopped repeating on blur" ); + start(); + } + + element[ 0 ].focus(); + setTimeout( step1 ); +}); + test( "mouse click on up button, increases value not greater than max", function() { expect( 3 ); var element = $( "#spin" ).val( 18 ).spinner({ diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index c14ef9370f4..644b652395a 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -102,6 +102,7 @@ $.widget( "ui.spinner", { return; } + this._stop(); this._refresh(); if ( this.previous !== this.element.val() ) { this._trigger( "change", event ); From ba96cb47725dc6639ae366bd381f089c1750c8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 19 Feb 2013 14:46:30 -0500 Subject: [PATCH 10/50] Autocomplete demo (Combobox): Don't highlight term matches. Fixes #9086 - Autocomplete: Incorrect escaping in combobox demo. --- demos/autocomplete/combobox.html | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index 0d59db67070..c5ef93576d3 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -48,11 +48,10 @@ .insertAfter( select ); function removeIfInvalid( element ) { - var value = $( element ).val(), - matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( value ) + "$", "i" ), + var value = $( element ).val().toLowerCase(), valid = false; select.children( "option" ).each(function() { - if ( $( this ).text().match( matcher ) ) { + if ( $( this ).text().toLowerCase() === value ) { this.selected = valid = true; return false; } @@ -86,12 +85,7 @@ var text = $( this ).text(); if ( this.value && ( !request.term || matcher.test(text) ) ) return { - label: text.replace( - new RegExp( - "(?![^&;]+;)(?!<[^<>]*)(" + - $.ui.autocomplete.escapeRegex(request.term) + - ")(?![^<>]*>)(?![^&;]+;)", "gi" - ), "$1" ), + label: text, value: text, option: this }; @@ -111,12 +105,6 @@ }) .addClass( "ui-widget ui-widget-content ui-corner-left" ); - input.data( "ui-autocomplete" )._renderItem = function( ul, item ) { - return $( "
  • " ) - .append( "" + item.label + "" ) - .appendTo( ul ); - }; - $( "" ) .attr( "tabIndex", -1 ) .attr( "title", "Show All Items" ) From 5546e76354e80adccddd8ccb29c9c6a746c9968b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 19 Feb 2013 14:47:14 -0500 Subject: [PATCH 11/50] Autocomplete demo (Combobox): Rename selected event to select. --- demos/autocomplete/combobox.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index c5ef93576d3..3e17a1dca5f 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -93,7 +93,7 @@ }, select: function( event, ui ) { ui.item.option.selected = true; - that._trigger( "selected", event, { + that._trigger( "select", event, { item: ui.item.option }); }, From c1d04def4220162f13b791d55c05f07ce9c6278b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 19 Feb 2013 15:10:02 -0500 Subject: [PATCH 12/50] Autocomplete demo (Combobox): Split code into smaller functions. --- demos/autocomplete/combobox.html | 145 +++++++++++++++++-------------- 1 file changed, 81 insertions(+), 64 deletions(-) diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index 3e17a1dca5f..f89f260ebcf 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -37,79 +37,52 @@ (function( $ ) { $.widget( "ui.combobox", { _create: function() { - var input, - that = this, - wasOpen = false, - select = this.element.hide(), - selected = select.children( ":selected" ), - value = selected.val() ? selected.text() : "", - wrapper = this.wrapper = $( "" ) - .addClass( "ui-combobox" ) - .insertAfter( select ); - - function removeIfInvalid( element ) { - var value = $( element ).val().toLowerCase(), - valid = false; - select.children( "option" ).each(function() { - if ( $( this ).text().toLowerCase() === value ) { - this.selected = valid = true; - return false; - } - }); + this.wrapper = $( "" ) + .addClass( "ui-combobox" ) + .insertAfter( this.element ); - if ( !valid ) { - // remove invalid value, as it didn't match anything - $( element ) - .val( "" ) - .attr( "title", value + " didn't match any item" ) - .tooltip( "open" ); - select.val( "" ); - setTimeout(function() { - input.tooltip( "close" ).attr( "title", "" ); - }, 2500 ); - input.data( "ui-autocomplete" ).term = ""; - } - } + this._createAutocomplete(); + this._createShowAllButton(); + }, + + _createAutocomplete: function() { + var selected = this.element.children( ":selected" ), + value = selected.val() ? selected.text() : ""; - input = $( "" ) - .appendTo( wrapper ) + this.input = $( "" ) + .appendTo( this.wrapper ) .val( value ) .attr( "title", "" ) - .addClass( "ui-state-default ui-combobox-input" ) + .addClass( "ui-state-default ui-combobox-input ui-widget ui-widget-content ui-corner-left" ) .autocomplete({ delay: 0, minLength: 0, - source: function( request, response ) { - var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); - response( select.children( "option" ).map(function() { - var text = $( this ).text(); - if ( this.value && ( !request.term || matcher.test(text) ) ) - return { - label: text, - value: text, - option: this - }; - }) ); - }, - select: function( event, ui ) { - ui.item.option.selected = true; - that._trigger( "select", event, { - item: ui.item.option - }); - }, - change: function( event, ui ) { - if ( !ui.item ) { - removeIfInvalid( this ); - } - } + source: $.proxy( this, "_source" ) }) - .addClass( "ui-widget ui-widget-content ui-corner-left" ); + .tooltip({ + tooltipClass: "ui-state-highlight" + }); + + this._on( this.input, { + autocompleteselect: function( event, ui ) { + ui.item.option.selected = true; + this._trigger( "select", event, { + item: ui.item.option + }); + }, + + autocompletechange: "_removeIfInvalid" + }); + }, + + _createShowAllButton: function() { + var wasOpen = false; $( "" ) .attr( "tabIndex", -1 ) .attr( "title", "Show All Items" ) .tooltip() - .appendTo( wrapper ) + .appendTo( this.wrapper ) .button({ icons: { primary: "ui-icon-triangle-1-s" @@ -124,18 +97,62 @@ .click(function() { input.focus(); - // close if already visible + // Close if already visible if ( wasOpen ) { return; } - // pass empty string as value to search for, displaying all results + // Pass empty string as value to search for, displaying all results input.autocomplete( "search", "" ); }); + }, + + _source: function( request, response ) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" ); + response( this.element.children( "option" ).map(function() { + var text = $( this ).text(); + if ( this.value && ( !request.term || matcher.test(text) ) ) + return { + label: text, + value: text, + option: this + }; + }) ); + }, + + _removeIfInvalid: function( event, ui ) { - input.tooltip({ - tooltipClass: "ui-state-highlight" + // Selected an item, nothing to do + if ( ui.item ) { + return; + } + + // Search for a match (case-insensitive) + var value = this.input.val(), + valueLowerCase = value.toLowerCase(), + valid = false; + this.element.children( "option" ).each(function() { + if ( $( this ).text().toLowerCase() === valueLowerCase ) { + this.selected = valid = true; + return false; + } }); + + // Found a match, nothing to do + if ( valid ) { + return; + } + + // Remove invalid value + this.input + .val( "" ) + .attr( "title", value + " didn't match any item" ) + .tooltip( "open" ); + this.element.val( "" ); + this._delay(function() { + this.input.tooltip( "close" ).attr( "title", "" ); + }, 2500 ); + this.input.data( "ui-autocomplete" ).term = ""; }, _destroy: function() { From bcae4fb9f1d84e0d0e6e7afb11002b28e5dc5ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 22 Feb 2013 17:28:45 -0500 Subject: [PATCH 13/50] Upgrade mousewheel to 3.1.0. --- external/jquery.mousewheel.js | 129 +++++++++++++++++++--------------- 1 file changed, 73 insertions(+), 56 deletions(-) diff --git a/external/jquery.mousewheel.js b/external/jquery.mousewheel.js index bf766be6d61..8c603041b95 100644 --- a/external/jquery.mousewheel.js +++ b/external/jquery.mousewheel.js @@ -1,84 +1,101 @@ -/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) +/*! Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * - * Version: 3.0.6 + * Version: 3.1.0 * * Requires: 1.2.2+ */ -(function($) { +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { -var types = ['DOMMouseScroll', 'mousewheel']; + var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll']; + var toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll']; + var lowestDelta, lowestDeltaXY; -if ($.event.fixHooks) { - for ( var i=types.length; i; ) { - $.event.fixHooks[ types[--i] ] = $.event.mouseHooks; + if ($.event.fixHooks) { + for ( var i=toFix.length; i; ) { + $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; + } } -} -$.event.special.mousewheel = { - setup: function() { - if ( this.addEventListener ) { - for ( var i=types.length; i; ) { - this.addEventListener( types[--i], handler, false ); + $.event.special.mousewheel = { + setup: function() { + if ( this.addEventListener ) { + for ( var i=toBind.length; i; ) { + this.addEventListener( toBind[--i], handler, false ); + } + } else { + this.onmousewheel = handler; } - } else { - this.onmousewheel = handler; - } - }, - - teardown: function() { - if ( this.removeEventListener ) { - for ( var i=types.length; i; ) { - this.removeEventListener( types[--i], handler, false ); + }, + + teardown: function() { + if ( this.removeEventListener ) { + for ( var i=toBind.length; i; ) { + this.removeEventListener( toBind[--i], handler, false ); + } + } else { + this.onmousewheel = null; } - } else { - this.onmousewheel = null; } - } -}; + }; -$.fn.extend({ - mousewheel: function(fn) { - return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); - }, + $.fn.extend({ + mousewheel: function(fn) { + return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); + }, + + unmousewheel: function(fn) { + return this.unbind("mousewheel", fn); + } + }); - unmousewheel: function(fn) { - return this.unbind("mousewheel", fn); - } -}); + function handler(event) { + var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, deltaX = 0, deltaY = 0, absDelta = 0, absDeltaXY = 0; + event = $.event.fix(orgEvent); + event.type = "mousewheel"; -function handler(event) { - var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; - event = $.event.fix(orgEvent); - event.type = "mousewheel"; + // Old school scrollwheel delta + if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta; } + if ( orgEvent.detail ) { delta = orgEvent.detail * -1; } - // Old school scrollwheel delta - if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } - if ( orgEvent.detail ) { delta = -orgEvent.detail/3; } + // New school wheel delta (wheel event) + if ( orgEvent.deltaY ) { + deltaY = orgEvent.deltaY * -1; + delta = deltaY; + } + if ( orgEvent.deltaX ) { + deltaX = orgEvent.deltaX; + delta = deltaX * -1; + } - // New school multidimensional scroll (touchpads) deltas - deltaY = delta; + // Webkit + if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY; } + if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = orgEvent.wheelDeltaX * -1; } - // Gecko - if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { - deltaY = 0; - deltaX = -1*delta; - } + absDelta = Math.abs(delta); + if ( !lowestDelta || absDelta < lowestDelta ) { lowestDelta = absDelta; } - // Webkit - if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } - if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } + absDeltaXY = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); + if ( !lowestDeltaXY || absDeltaXY < lowestDeltaXY ) { lowestDeltaXY = absDeltaXY; } - // Add event and delta to the front of the arguments - args.unshift(event, delta, deltaX, deltaY); + // Add event and delta to the front of the arguments + args.unshift(event, Math.floor(delta/lowestDelta), Math.floor(deltaX/lowestDeltaXY), Math.floor(deltaY/lowestDeltaXY)); - return ($.event.dispatch || $.event.handle).apply(this, args); -} + return ($.event.dispatch || $.event.handle).apply(this, args); + } -})(jQuery); \ No newline at end of file +})); From d5d3a745b00dd476195cf25b35cc02f3bc31f814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 25 Feb 2013 15:36:08 -0500 Subject: [PATCH 14/50] Autocomplete: Set isNewMenu flag on every suggestion. Fixes #9118 - Autocomplete: Mouse auto-highlights option in Firefox. --- ui/jquery.ui.autocomplete.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 1b0f2138f94..b3a05da0bac 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -234,7 +234,8 @@ $.widget( "ui.autocomplete", { } }, menufocus: function( event, ui ) { - // #7024 - Prevent accidental activation of menu items in Firefox + // support: Firefox + // Prevent accidental activation of menu items in Firefox (#7024 #9118) if ( this.isNewMenu ) { this.isNewMenu = false; if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { @@ -490,6 +491,7 @@ $.widget( "ui.autocomplete", { _suggest: function( items ) { var ul = this.menu.element.empty(); this._renderMenu( ul, items ); + this.isNewMenu = true; this.menu.refresh(); // size and position menu From e9c04bfa430eb6b18e7fe1be2f8d162e01181a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 26 Feb 2013 08:59:28 -0500 Subject: [PATCH 15/50] Position: Fix orientation check for scrollbar widths. Fixes #8763 - Position: getScrollInfo() swapped width and height. --- ui/jquery.ui.position.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 81f1e4e8ac5..2d3451c0693 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -95,8 +95,8 @@ $.position = { hasOverflowY = overflowY === "scroll" || ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); return { - width: hasOverflowX ? $.position.scrollbarWidth() : 0, - height: hasOverflowY ? $.position.scrollbarWidth() : 0 + width: hasOverflowY ? $.position.scrollbarWidth() : 0, + height: hasOverflowX ? $.position.scrollbarWidth() : 0 }; }, getWithinInfo: function( element ) { From 1c80735acb20a468300a53f85ef49b065d40af3e Mon Sep 17 00:00:00 2001 From: Zaven Muradyan Date: Sat, 23 Feb 2013 21:55:29 -0800 Subject: [PATCH 16/50] Droppable: Changed drop event to loop over a copied array instead of the droppables directly. Fixed #9116 - Droppable: Drop event can cause droppables to remain active if any droppable is created/destroyed in the event handler. --- tests/unit/droppable/droppable.html | 1 + tests/unit/droppable/droppable_events.js | 33 ++++++++++++++++++++++++ ui/jquery.ui.droppable.js | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/tests/unit/droppable/droppable.html b/tests/unit/droppable/droppable.html index 7cd5eb0f540..d084464c2c6 100644 --- a/tests/unit/droppable/droppable.html +++ b/tests/unit/droppable/droppable.html @@ -42,6 +42,7 @@

    Draggable
    Droppable
    +
    Droppable
     
    diff --git a/tests/unit/droppable/droppable_events.js b/tests/unit/droppable/droppable_events.js index 8f842e9425f..707eea1f4a2 100644 --- a/tests/unit/droppable/droppable_events.js +++ b/tests/unit/droppable/droppable_events.js @@ -5,6 +5,39 @@ module("droppable: events"); +test( "droppable destruction/recreation on drop event", function() { + expect( 1 ); + + var config = { + activeClass: "active", + drop: function() { + var element = $( this ), + newDroppable = $( "
    " ) + .css({ width: 100, height: 100 }) + .text( "Droppable" ); + element.after( newDroppable ); + element.remove(); + newDroppable.droppable( config ); + } + }, + + draggable = $( "#draggable1" ).draggable(), + droppable1 = $( "#droppable1" ).droppable( config ), + droppable2 = $( "#droppable2" ).droppable( config ), + + droppableOffset = droppable1.offset(), + draggableOffset = draggable.offset(), + dx = droppableOffset.left - draggableOffset.left, + dy = droppableOffset.top - draggableOffset.top; + + draggable.simulate( "drag", { + dx: dx, + dy: dy + }); + + ok( !droppable2.hasClass( "active" ), "subsequent droppable no longer active" ); +}); + // this is here to make JSHint pass "unused", and we don't want to // remove the parameter for when we finally implement $.noop(); diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 4fbfcde06cf..552b24a5850 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -278,7 +278,8 @@ $.ui.ddmanager = { drop: function(draggable, event) { var dropped = false; - $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + // Create a copy of the droppables in case the list changes during the drop (#9116) + $.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() { if(!this.options) { return; From d0ad572349beadc99810ecd53a532bf5f261343d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 26 Feb 2013 10:13:42 -0500 Subject: [PATCH 17/50] Droppable tests: Cleanup. --- tests/unit/droppable/droppable_events.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/unit/droppable/droppable_events.js b/tests/unit/droppable/droppable_events.js index 707eea1f4a2..4b8fe5acd2c 100644 --- a/tests/unit/droppable/droppable_events.js +++ b/tests/unit/droppable/droppable_events.js @@ -1,9 +1,6 @@ -/* - * droppable_events.js - */ -(function($) { +(function( $ ) { -module("droppable: events"); +module( "droppable: events" ); test( "droppable destruction/recreation on drop event", function() { expect( 1 ); @@ -38,9 +35,7 @@ test( "droppable destruction/recreation on drop event", function() { ok( !droppable2.hasClass( "active" ), "subsequent droppable no longer active" ); }); -// this is here to make JSHint pass "unused", and we don't want to -// remove the parameter for when we finally implement -$.noop(); + // todo: comment the following in when ready to actually test /* @@ -65,4 +60,4 @@ test("drop", function() { }); */ -})(jQuery); +})( jQuery ); From 948563b8b55802c6d4c513065f1b78bbdcff104c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 26 Feb 2013 10:36:03 -0500 Subject: [PATCH 18/50] Effects: Delegate to core show/hide when the element is already in the correct final state. This forces the element to go through the olddisplay tracking and forces styles on elements even if they're hidden via an ancestor. Fixes #9120 - Effects: .hide() inconsistent with core with a hidden parent. --- tests/unit/effects/effects.html | 4 +++- tests/unit/effects/effects_core.js | 8 ++++++++ ui/jquery.ui.effect.js | 5 +++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html index c283eabff23..7ddacf7bb66 100644 --- a/tests/unit/effects/effects.html +++ b/tests/unit/effects/effects.html @@ -96,7 +96,9 @@

      - +

      Child Element Test

      diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index c9b1e1b4a8b..928d4c15bb7 100644 --- a/tests/unit/effects/effects_core.js +++ b/tests/unit/effects/effects_core.js @@ -28,6 +28,14 @@ test( "Immediate Return Conditions", function() { equal( ++count, 3, "Both Functions worked properly" ); }); +test( ".hide() with hidden parent", function() { + expect( 1 ); + var element = $( "div.hidden" ).children(); + element.hide( "blind", function() { + equal( element.css( "display" ), "none", "display: none" ); + }); +}); + asyncTest( "Parse of null for options", function() { var hidden = $( "div.hidden" ), count = 0; diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js index 97f006ee06a..41aeb4819ab 100644 --- a/ui/jquery.ui.effect.js +++ b/ui/jquery.ui.effect.js @@ -1150,9 +1150,10 @@ $.fn.extend({ } } - // if the element is hiddden and mode is hide, - // or element is visible and mode is show + // If the element already has the correct final state, delegate to + // the core methods so the internal tracking of "olddisplay" works. if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { + elem[ mode ](); done(); } else { effectMethod.call( elem[0], args, done ); From 0cf875e5e34e4b2c11802eb856190e6cca649bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 27 Feb 2013 11:27:44 -0500 Subject: [PATCH 19/50] Accordion demo: Clean up hoverintent implementation to avoid using jQuery.event.handle. Thanks Drew Waddell for pointing out the use of an undocumented/deprecated method. --- demos/accordion/hoverintent.html | 61 ++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/demos/accordion/hoverintent.html b/demos/accordion/hoverintent.html index 023682d4b42..0ff63a32142 100644 --- a/demos/accordion/hoverintent.html +++ b/demos/accordion/hoverintent.html @@ -16,11 +16,11 @@ }); }); - var cfg = ($.hoverintent = { - sensitivity: 7, - interval: 100 - }); - + /* + * hoverIntent | Copyright 2011 Brian Cherne + * http://cherne.net/brian/resources/jquery.hoverIntent.html + * modified by the jQuery UI team + */ $.event.special.hoverintent = { setup: function() { $( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler ); @@ -29,41 +29,56 @@ $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler ); }, handler: function( event ) { - var that = this, + var currentX, currentY, timeout, args = arguments, target = $( event.target ), - cX, cY, pX, pY; + previousX = event.pageX, + previousY = event.pageY; function track( event ) { - cX = event.pageX; - cY = event.pageY; + currentX = event.pageX; + currentY = event.pageY; }; - pX = event.pageX; - pY = event.pageY; + function clear() { target .unbind( "mousemove", track ) - .unbind( "mouseout", arguments.callee ); + .unbind( "mouseout", clear ); clearTimeout( timeout ); } + function handler() { - if ( ( Math.abs( pX - cX ) + Math.abs( pY - cY ) ) < cfg.sensitivity ) { + var prop, + orig = event; + + if ( ( Math.abs( previousX - currentX ) + + Math.abs( previousY - currentY ) ) < 7 ) { clear(); - event.type = "hoverintent"; - // prevent accessing the original event since the new event + + event = $.Event( "hoverintent" ); + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + // Prevent accessing the original event since the new event // is fired asynchronously and the old event is no longer // usable (#6028) - event.originalEvent = {}; - jQuery.event.handle.apply( that, args ); + delete event.originalEvent; + + target.trigger( event ); } else { - pX = cX; - pY = cY; - timeout = setTimeout( handler, cfg.interval ); + previousX = currentX; + previousY = currentY; + timeout = setTimeout( handler, 100 ); } } - var timeout = setTimeout( handler, cfg.interval ); - target.mousemove( track ).mouseout( clear ); - return true; + + timeout = setTimeout( handler, 100 ); + target.bind({ + mousemove: track, + mouseout: clear + }); } }; From 6f2957743659387f66c9b8953bba9fac5617a440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 28 Feb 2013 13:34:49 -0500 Subject: [PATCH 20/50] Effects: Handle the .hide/show/toggle( options ) signatures from core properly. Fixes #9126 - .show()/.hide() do not support all of core's options. --- tests/unit/effects/effects.html | 2 + tests/unit/effects/effects_core.js | 18 ++++++ ui/jquery.ui.effect.js | 89 ++++++++++++++++++------------ 3 files changed, 73 insertions(+), 36 deletions(-) diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html index 7ddacf7bb66..4538ecb0300 100644 --- a/tests/unit/effects/effects.html +++ b/tests/unit/effects/effects.html @@ -96,6 +96,8 @@

        +
        +
        diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index 928d4c15bb7..11e9d0b456e 100644 --- a/tests/unit/effects/effects_core.js +++ b/tests/unit/effects/effects_core.js @@ -16,6 +16,24 @@ var minDuration = 15, module( "effects.core" ); +// TODO: test all signatures of .show(), .hide(), .toggle(). +// Look at core's signatures and UI's signatures. +asyncTest( ".hide() with step", function() { + expect( 1 ); + var element = $( "#elem" ), + step = function() { + ok( true, "step callback invoked" ); + step = $.noop; + }; + + element.hide({ + step: function() { + step(); + }, + complete: start + }); +}); + test( "Immediate Return Conditions", function() { var hidden = $( "div.hidden" ), count = 0; diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js index 41aeb4819ab..f3d9929b029 100644 --- a/ui/jquery.ui.effect.js +++ b/ui/jquery.ui.effect.js @@ -1106,14 +1106,29 @@ function _normalizeArguments( effect, options, speed, callback ) { return effect; } -function standardSpeed( speed ) { - // valid standard speeds - if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { +function standardAnimationOption( option ) { + // Valid standard speeds (nothing, number, named speed) + if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) { return true; } - // invalid strings - treat as "normal" speed - return typeof speed === "string" && !$.effects.effect[ speed ]; + // Invalid strings - treat as "normal" speed + if ( typeof option === "string" && !$.effects.effect[ option ] ) { + return true; + } + + // Complete callback + if ( $.isFunction( option ) ) { + return true; + } + + // Options hash (but not naming an effect) + if ( typeof option === "object" && !option.effect ) { + return true; + } + + // Didn't match any standard API + return false; } $.fn.extend({ @@ -1163,39 +1178,41 @@ $.fn.extend({ return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); }, - _show: $.fn.show, - show: function( speed ) { - if ( standardSpeed( speed ) ) { - return this._show.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "show"; - return this.effect.call( this, args ); - } - }, + show: (function( orig ) { + return function( option ) { + if ( standardAnimationOption( option ) ) { + return orig.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "show"; + return this.effect.call( this, args ); + } + }; + })( $.fn.show ), - _hide: $.fn.hide, - hide: function( speed ) { - if ( standardSpeed( speed ) ) { - return this._hide.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "hide"; - return this.effect.call( this, args ); - } - }, + hide: (function( orig ) { + return function( option ) { + if ( standardAnimationOption( option ) ) { + return orig.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "hide"; + return this.effect.call( this, args ); + } + }; + })( $.fn.hide ), - // jQuery core overloads toggle and creates _toggle - __toggle: $.fn.toggle, - toggle: function( speed ) { - if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { - return this.__toggle.apply( this, arguments ); - } else { - var args = _normalizeArguments.apply( this, arguments ); - args.mode = "toggle"; - return this.effect.call( this, args ); - } - }, + toggle: (function( orig ) { + return function( option ) { + if ( standardAnimationOption( option ) || typeof option === "boolean" ) { + return orig.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "toggle"; + return this.effect.call( this, args ); + } + }; + })( $.fn.toggle ), // helper functions cssUnit: function(key) { From 8655d91ac68538c37da4d94ecc287df8c90a96ae Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Wed, 27 Feb 2013 22:35:53 -0500 Subject: [PATCH 21/50] Sortable: Adding a min-width to the body on the portlet demo. Fixed #4485: Portlet demo is buggy. --- demos/sortable/portlets.html | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/sortable/portlets.html b/demos/sortable/portlets.html index 24582f5023b..5a3f2b662a2 100644 --- a/demos/sortable/portlets.html +++ b/demos/sortable/portlets.html @@ -11,6 +11,7 @@ - + @@ -23,7 +23,8 @@ "ui/jquery.ui.widget.js", "ui/jquery.ui.mouse.js", "ui/jquery.ui.resizable.js", - "ui/jquery.ui.draggable.js" + "ui/jquery.ui.draggable.js", + "ui/jquery.ui.droppable.js" ] }); @@ -45,15 +46,12 @@

          -
          - -
          Relative
          -
          Absolute
          -
          -
          -
          -
          - +
          +
          Relative
          +
          Absolute
          +
          Absolute
          +
          +
          diff --git a/tests/unit/draggable/draggable_common.js b/tests/unit/draggable/draggable_common.js index 7c6961af2ae..5abd09e4935 100644 --- a/tests/unit/draggable/draggable_common.js +++ b/tests/unit/draggable/draggable_common.js @@ -1,6 +1,5 @@ TestHelpers.commonWidgetTests( "draggable", { defaults: { - addClasses: true, appendTo: "parent", axis: false, cancel: "input,textarea,button,select,option", @@ -8,13 +7,10 @@ TestHelpers.commonWidgetTests( "draggable", { 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, @@ -29,6 +25,12 @@ TestHelpers.commonWidgetTests( "draggable", { stack: false, zIndex: false, + //todo: remove the following option checks when interactions are rewritten: + addClasses: true, + delay: 0, + distance: 1, + iframeFix: false, + // callbacks create: null, drag: null, diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index 00d9141942d..2090f2fd9ad 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -2,24 +2,40 @@ * draggable_core.js */ -(function($) { +(function( $ ) { -module("draggable"); +var relativeElement, absoluteElement; -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,hr" + - ",input,button,label,select,iframe").split(","); +module( "draggable: core", { + setup: function() { + relativeElement = $("
          Relative
          ").appendTo("#qunit-fixture"); + absoluteElement = $("
          Absolute
          ").appendTo("#qunit-fixture"); + }, + teardown: function() { + relativeElement.remove(); + absoluteElement.remove(); + } +}); + +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,hr" + + ",input,button,label,select,iframe" + ).split(","); expect( typeNames.length * 2 ); - $.each(typeNames, function(i) { + $.each( typeNames, function( i ) { var offsetBefore, offsetAfter, - typeName = typeNames[i], - el = $(document.createElement(typeName)).appendTo("#qunit-fixture"); + typeName = typeNames[ i ], + el = $( document.createElement( typeName ) ).appendTo("#qunit-fixture"); + + if ( typeName === "table" ) { + el.append("content"); + } - (typeName === "table" && el.append("content")); el.draggable({ cancel: "" }); offsetBefore = el.offset(); el.simulate( "drag", { @@ -27,39 +43,38 @@ test("element types", function() { dy: 50 }); offsetAfter = el.offset(); - // there are some rounding errors in FF, Chrome, and IE9, so we can't say equal, we have to settle for close enough - closeEnough(offsetBefore.left, offsetAfter.left - 50, 1, "dragged[50, 50] " + "<" + typeName + ">"); - closeEnough(offsetBefore.top, offsetAfter.top - 50, 1, "dragged[50, 50] " + "<" + typeName + ">"); + + // Support: FF, Chrome, and IE9, + // there are some rounding errors in so we can't say equal, we have to settle for close enough + closeEnough( offsetBefore.left, offsetAfter.left - 50, 1, "dragged[50, 50] " + "<" + typeName + ">" ); + closeEnough( offsetBefore.top, offsetAfter.top - 50, 1, "dragged[50, 50] " + "<" + typeName + ">" ); el.draggable("destroy"); el.remove(); }); }); -test("No options, relative", function() { +test( "No options, relative", function() { expect( 1 ); - var el = $("#draggable1").draggable(); - TestHelpers.draggable.shouldMove(el); + TestHelpers.draggable.shouldMove( relativeElement.draggable() ); }); -test("No options, absolute", function() { +test( "No options, absolute", function() { expect( 1 ); - var el = $("#draggable2").draggable(); - TestHelpers.draggable.shouldMove(el); + TestHelpers.draggable.shouldMove( absoluteElement.draggable() ); }); -test("resizable handle with complex markup (#8756 / #8757)", function() { +test( "resizable handle with complex markup (#8756 / #8757)", function() { expect( 2 ); - $("#draggable1") + relativeElement .append( $("
          ") - .addClass("ui-resizable-handle") - .addClass("ui-resizable-w") - .append($("
          ")) + .addClass("ui-resizable-handle ui-resizable-w") + .append( $("
          ") ) ); var handle = $(".ui-resizable-w div"), - target = $("#draggable1").draggable().resizable({ handles: "all" }); + target = relativeElement.draggable().resizable({ handles: "all" }); // todo: fix resizable so it doesn't require a mouseover handle.simulate("mouseover").simulate( "drag", { dx: -50 } ); @@ -70,4 +85,4 @@ test("resizable handle with complex markup (#8756 / #8757)", function() { equal( target.width(), 200, "compare width" ); }); -})(jQuery); +})( jQuery ); diff --git a/tests/unit/draggable/draggable_events.js b/tests/unit/draggable/draggable_events.js index f4ab3a8ea9c..199561be30d 100644 --- a/tests/unit/draggable/draggable_events.js +++ b/tests/unit/draggable/draggable_events.js @@ -1,99 +1,125 @@ /* * draggable_events.js */ -(function($) { +(function( $ ) { -module("draggable: events"); +var element; -test("callbacks occurrence count", function() { +module( "draggable: events", { + setup: function() { + element = $("
          ").appendTo("#qunit-fixture"); + }, + teardown: function() { + element.draggable("destroy"); + } +}); - expect(3); +test( "callbacks occurrence count", function() { + expect( 3 ); var start = 0, stop = 0, - dragc = 0, - el = $("#draggable2").draggable({ - start: function() { start++; }, - drag: function() { dragc++; }, - stop: function() { stop++; } - }); - - el.simulate( "drag", { + dragc = 0; + + element.draggable({ + start: function() { + start++; + }, + drag: function() { + dragc++; + }, + stop: function() { + stop++; + } + }); + + element.simulate( "drag", { dx: 10, dy: 10 }); - equal(start, 1, "start callback should happen exactly once"); - equal(dragc, 3, "drag callback should happen exactly once per mousemove"); - equal(stop, 1, "stop callback should happen exactly once"); - + equal( start, 1, "start callback should happen exactly once" ); + equal( dragc, 3, "drag callback should happen exactly once per mousemove" ); + equal( stop, 1, "stop callback should happen exactly once" ); }); -test("stopping the start callback", function() { - - expect(3); +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++; } - }); - - el.simulate( "drag", { + dragc = 0; + + element.draggable({ + start: function() { + start++; + return false; + }, + drag: function() { + dragc++; + }, + stop: function() { + stop++; + } + }); + + element.simulate( "drag", { dx: 10, dy: 10 }); - equal(start, 1, "start callback should happen exactly once"); - equal(dragc, 0, "drag callback should not happen at all"); - equal(stop, 0, "stop callback should not happen if there wasnt even a start"); - + equal( start, 1, "start callback should happen exactly once" ); + equal( dragc, 0, "drag callback should not happen at all" ); + equal( stop, 0, "stop callback should not happen if there wasnt even a start" ); }); -test("stopping the drag callback", function() { - - expect(3); +test( "stopping the drag callback", function() { + expect( 2 ); var start = 0, stop = 0, - dragc = 0, - el = $("#draggable2").draggable({ - start: function() { start++;}, - drag: function() { dragc++; return false; }, - stop: function() { stop++; } - }); - - el.simulate( "drag", { + dragc = 0; + + element.draggable({ + start: function() { + start++; + }, + drag: function() { + dragc++; + return false; + }, + stop: function() { + stop++; + } + }); + + element.simulate( "drag", { dx: 10, dy: 10 }); - equal(start, 1, "start callback should happen exactly once"); - equal(dragc, 1, "drag callback should happen exactly once"); - equal(stop, 1, "stop callback should happen, as we need to actively stop the drag"); - + equal( start, 1, "start callback should happen exactly once" ); + equal( stop, 1, "stop callback should happen, as we need to actively stop the drag" ); }); -test("stopping the stop callback", function() { - - expect(1); +test( "stopping the stop callback", function() { + expect( 1 ); - var el = $("#draggable2").draggable({ + element.draggable({ helper: "clone", - stop: function() { return false; } + stop: function() { + return false; + } }); - el.simulate( "drag", { + element.simulate( "drag", { dx: 10, dy: 10 }); - ok($("#draggable2").data("ui-draggable").helper, "the clone should not be deleted if the stop callback is stopped"); + ok( element.data("ui-draggable").helper, "the clone should not be deleted if the stop callback is stopped" ); }); -})(jQuery); +})( jQuery ); diff --git a/tests/unit/draggable/draggable_methods.js b/tests/unit/draggable/draggable_methods.js index 43db285ce4c..901c261d6ed 100644 --- a/tests/unit/draggable/draggable_methods.js +++ b/tests/unit/draggable/draggable_methods.js @@ -1,94 +1,99 @@ /* * draggable_methods.js */ -(function($) { +(function( $ ) { -module("draggable: methods"); +var element; -test("init", function() { - expect(5); +module( "draggable: methods", { + setup: function() { + element = $("
          Absolute
          ").appendTo("#qunit-fixture"); + }, + teardown: function() { + element.remove(); + } +}); + +test( "init", function() { + expect( 5 ); - $("
          ").appendTo("body").draggable().remove(); - ok(true, ".draggable() called on element"); + element.draggable(); + ok( true, ".draggable() called on element" ); $([]).draggable(); - ok(true, ".draggable() called on empty collection"); + ok( true, ".draggable() called on empty collection" ); $("
          ").draggable(); - ok(true, ".draggable() called on disconnected DOMElement"); + ok( true, ".draggable() called on disconnected DOMElement" ); - $("
          ").draggable().draggable("option", "foo"); - ok(true, "arbitrary option getter after init"); + element.draggable( "option", "foo" ); + ok( true, "arbitrary option getter after init" ); - $("
          ").draggable().draggable("option", "foo", "bar"); - ok(true, "arbitrary option setter after init"); + element.draggable( "option", "foo", "bar" ); + ok( true, "arbitrary option setter after init" ); }); -test("destroy", function() { - expect(4); - $("
          ").appendTo("body").draggable().draggable("destroy").remove(); - ok(true, ".draggable('destroy') called on element"); +test( "destroy", function() { + expect( 4 ); + + element.draggable().draggable("destroy"); + ok( true, ".draggable('destroy') called on element" ); $([]).draggable().draggable("destroy"); - ok(true, ".draggable('destroy') called on empty collection"); + ok( true, ".draggable('destroy') called on empty collection" ); - $("
          ").draggable().draggable("destroy"); - ok(true, ".draggable('destroy') called on disconnected DOMElement"); + element.draggable().draggable("destroy"); + ok( true, ".draggable('destroy') called on disconnected DOMElement" ); - var expected = $("
          ").draggable(), + var expected = element.draggable(), actual = expected.draggable("destroy"); - equal(actual, expected, "destroy is chainable"); + equal( actual, expected, "destroy is chainable" ); }); -test("enable", function() { - expect(7); +test( "enable", function() { + expect( 7 ); - var expected, actual, el; + element.draggable({ disabled: true }); + TestHelpers.draggable.shouldNotMove( element, ".draggable({ disabled: true })" ); - el = $("#draggable2").draggable({ disabled: true }); - TestHelpers.draggable.shouldNotMove(el, ".draggable({ disabled: true })"); + element.draggable("enable"); + TestHelpers.draggable.shouldMove( element, ".draggable('enable')" ); + equal( element.draggable( "option", "disabled" ), false, "disabled option getter" ); - el.draggable("enable"); - TestHelpers.draggable.shouldMove(el, ".draggable('enable')"); - equal(el.draggable("option", "disabled"), false, "disabled option getter"); + element.draggable("destroy"); + element.draggable({ disabled: true }); + TestHelpers.draggable.shouldNotMove( element, ".draggable({ disabled: true })" ); - el.draggable("destroy"); - el.draggable({ disabled: true }); - TestHelpers.draggable.shouldNotMove(el, ".draggable({ disabled: true })"); + element.draggable( "option", "disabled", false ); + equal(element.draggable( "option", "disabled" ), false, "disabled option setter" ); + TestHelpers.draggable.shouldMove( element, ".draggable('option', 'disabled', false)" ); - el.draggable("option", "disabled", false); - equal(el.draggable("option", "disabled"), false, "disabled option setter"); - TestHelpers.draggable.shouldMove(el, ".draggable('option', 'disabled', false)"); - - expected = $("
          ").draggable(), - actual = expected.draggable("enable"); - equal(actual, expected, "enable is chainable"); + var expected = element.draggable(), + actual = expected.draggable("enable"); + equal( actual, expected, "enable is chainable" ); }); -test("disable", function() { - expect(7); - - var expected, actual, el; - - el = $("#draggable2").draggable({ disabled: false }); - TestHelpers.draggable.shouldMove(el, ".draggable({ disabled: false })"); +test( "disable", function() { + expect( 7 ); - el.draggable("disable"); - TestHelpers.draggable.shouldNotMove(el, ".draggable('disable')"); - equal(el.draggable("option", "disabled"), true, "disabled option getter"); + element = $("#draggable2").draggable({ disabled: false }); + TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" ); - el.draggable("destroy"); + element.draggable("disable"); + TestHelpers.draggable.shouldNotMove( element, ".draggable('disable')" ); + equal( element.draggable( "option", "disabled" ), true, "disabled option getter" ); - el.draggable({ disabled: false }); - TestHelpers.draggable.shouldMove(el, ".draggable({ disabled: false })"); + element.draggable("destroy"); + element.draggable({ disabled: false }); + TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" ); - el.draggable("option", "disabled", true); - equal(el.draggable("option", "disabled"), true, "disabled option setter"); - TestHelpers.draggable.shouldNotMove(el, ".draggable('option', 'disabled', true)"); + element.draggable( "option", "disabled", true ); + equal( element.draggable( "option", "disabled" ), true, "disabled option setter" ); + TestHelpers.draggable.shouldNotMove( element, ".draggable('option', 'disabled', true)" ); - expected = $("
          ").draggable(), - actual = expected.draggable("disable"); - equal(actual, expected, "disable is chainable"); + var expected = element.draggable(), + actual = expected.draggable("disable"); + equal( actual, expected, "disable is chainable" ); }); -})(jQuery); +})( jQuery ); diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index 8496d6182ea..0ab41b1f16f 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -5,23 +5,8 @@ module("draggable: options"); -test("{ addClasses: true }, default", function() { - expect( 1 ); - var el = $("
          ").draggable({ addClasses: true }); - ok(el.is(".ui-draggable"), "'ui-draggable' class added"); - - el.draggable("destroy"); -}); - -test("{ addClasses: false }", function() { - expect( 1 ); - var el = $("
          ").draggable({ addClasses: false }); - ok(!el.is(".ui-draggable"), "'ui-draggable' class not added"); - - el.draggable("destroy"); -}); - -test("{ appendTo: 'parent' }, default", function() { +// TODO: This doesn't actually test whether append happened, possibly remove +test("{ appendTo: 'parent' }, default, no clone", function() { expect( 2 ); var el = $("#draggable2").draggable({ appendTo: "parent" }); TestHelpers.draggable.shouldMove(el); @@ -31,16 +16,19 @@ test("{ appendTo: 'parent' }, default", function() { }); -test("{ appendTo: Element }", function() { +// TODO: This doesn't actually test whether append happened, possibly remove +test("{ appendTo: Element }, no clone", function() { expect( 2 ); - var el = $("#draggable2").draggable({ appendTo: $("#draggable2").parent()[0] }); + var el = $("#draggable2").draggable({appendTo: $("#draggable2").parent()[0] }); + TestHelpers.draggable.shouldMove(el); el = $("#draggable1").draggable({ appendTo: $("#draggable2").parent()[0] }); TestHelpers.draggable.shouldMove(el); }); -test("{ appendTo: Selector }", function() { +// TODO: This doesn't actually test whether append happened, possibly remove +test("{ appendTo: Selector }, no clone", function() { expect( 2 ); var el = $("#draggable2").draggable({ appendTo: "#main" }); TestHelpers.draggable.shouldMove(el); @@ -49,6 +37,83 @@ test("{ appendTo: Selector }", function() { TestHelpers.draggable.shouldMove(el); }); +test("{ appendTo: 'parent' }, default", function() { + + expect(2); + + var el = $("#draggable1").draggable(); + + TestHelpers.draggable.trackAppendedParent(el); + + equal( el.draggable( "option", "appendTo" ), "parent" ); + + TestHelpers.draggable.move(el, 1, 1); + equal( el.data("last_dragged_parent"), $("#qunit-fixture")[0] ); + +}); + +test("{ appendTo: Element }", function() { + + expect(1); + + var appendTo = $("#draggable2").parent()[0], + el = $("#draggable1").draggable({ appendTo: appendTo }); + + TestHelpers.draggable.trackAppendedParent(el); + + TestHelpers.draggable.move(el, 1, 1); + equal( el.data("last_dragged_parent"), appendTo ); + +}); + +test("{ appendTo: jQuery }", function() { + + expect(1); + + var appendTo = $("#draggable2").parent(), + el = $("#draggable1").draggable({ appendTo: appendTo }); + + TestHelpers.draggable.trackAppendedParent(el); + + TestHelpers.draggable.move(el, 1, 1); + equal( el.data("last_dragged_parent"), appendTo[0] ); + +}); +test("{ appendTo: Selector }", function() { + + expect(1); + + + var appendTo = "#main", + el = $("#draggable1").draggable({ appendTo: appendTo }); + + TestHelpers.draggable.trackAppendedParent(el); + + TestHelpers.draggable.move(el, 1, 1); + equal( el.data("last_dragged_parent"), $(appendTo)[0] ); + +}); + + +test("appendTo, default, switching after initialization", function() { + + expect(2); + + var el = $("#draggable1").draggable({ helper : "clone" }); + + TestHelpers.draggable.trackAppendedParent(el); + + // Move and make sure el was appended to fixture + TestHelpers.draggable.move(el, 1, 1); + equal( el.data("last_dragged_parent"), $("#qunit-fixture")[0] ); + + // Move and make sure el was appended to main + el.draggable( "option", "appendTo", $("#main") ); + TestHelpers.draggable.move(el, 2, 2); + equal( el.data("last_dragged_parent"), $("#main")[0] ); + +}); + test("{ axis: false }, default", function() { expect( 1 ); var el = $("#draggable2").draggable({ axis: false }); @@ -87,6 +152,26 @@ test("{ axis: ? }, unexpected", function() { }); }); +test("axis, default, switching after initialization", function() { + + expect(3); + + var el; + + // Any direction + el = $("#draggable1").draggable({ axis : false }); + TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50); + + // Only horizontal + el.draggable("option", "axis", "x"); + TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 0); + + // Vertical only + el.draggable("option", "axis", "y"); + TestHelpers.draggable.testDrag(el, el, 50, 50, 0, 50); + +}); + test("{ cancel: 'input,textarea,button,select,option' }, default", function() { expect( 2 ); @@ -114,7 +199,9 @@ test("{ cancel: 'span' }", function() { TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 0, 0); }); -test("{ cancel: ? }, unexpected", function() { +test( "{ cancel: ? }, unexpected", function() { + expect( 6 ); + var el, unexpected = { "true": true, @@ -122,40 +209,75 @@ test("{ cancel: ? }, unexpected", function() { "{}": {}, "[]": [], "null": null, - "undefined": undefined, - "function() {return '';}": function() {return "";}, - "function() {return true;}": function() {return true;}, - "function() {return false;}": function() {return false;} + "undefined": undefined }; - expect( 9 ); - - $.each(unexpected, function(key, val) { + $.each( unexpected, function( key, val ) { el = $("#draggable2").draggable({ cancel: val }); - TestHelpers.draggable.shouldMove(el, "cancel: " + key); + TestHelpers.draggable.shouldMove( el, "cancel: " + key ); el.draggable("destroy"); }); }); -/* -test("{ containment: false }, default", function() { - expect( 1 ); +/** +test("{ cancel: Selectors }, matching parent selector", function() { + + expect( 5 ); + + var el = $("#draggable2").draggable({ cancel: "span a" }); + + $("#qunit-fixture").append( "
          " ); + + el.find( "span" ).append( "" ); + + $("#wrapping a").append( el ); + + TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 50, 50, "drag span child"); + TestHelpers.draggable.shouldNotMove( $("#draggable2 span a") ); + TestHelpers.draggable.shouldNotMove( $("#wrapping a") ); + + $("#draggable2").draggable( "option", "cancel", "span > a" ); + $("#draggable2").find( "a" ).append( "" ); + + + TestHelpers.draggable.testDrag(el, $("#draggable2 span a").last(), 50, 50, 50, 50, "drag span child"); + TestHelpers.draggable.shouldNotMove( $("#draggable2 span a").first() ); - ok(false, "missing test - untested code is broken code"); }); +*/ + +test("cancel, default, switching after initialization", function() { + expect( 3 ); + + $("
          ").appendTo("#main"); + + var input = $("#draggable-option-cancel-default input"), + el = $("#draggable-option-cancel-default").draggable(); + + TestHelpers.draggable.testDrag(el, input, 50, 50, 0, 0); + + el.draggable("option", "cancel", "textarea" ); + TestHelpers.draggable.testDrag(el, input, 50, 50, 50, 50); + + el.draggable("option", "cancel", "input" ); + TestHelpers.draggable.testDrag(el, input, 50, 50, 0, 0); -test("{ containment: Element }", function() { +}); + +/* + +test("{ connectToSortable: selector }, default", function() { expect( 1 ); ok(false, "missing test - untested code is broken code"); }); */ -test("{ containment: 'parent' }, relative", function() { +test( "{ containment: Element }", function() { expect( 1 ); var offsetAfter, - el = $("#draggable1").draggable({ containment: "parent" }), + el = $( "#draggable1" ).draggable({ containment: $( "#draggable1" ).parent()[ 0 ] }), p = el.parent(), po = p.offset(), expected = { @@ -171,11 +293,11 @@ test("{ containment: 'parent' }, relative", function() { deepEqual(offsetAfter, expected, "compare offset to parent"); }); -test("{ containment: 'parent' }, absolute", function() { +test( "{ containment: Selector }", function() { expect( 1 ); var offsetAfter, - el = $("#draggable2").draggable({ containment: "parent" }), + el = $( "#draggable1" ).draggable({ containment: $( "#qunit-fixture" ) }), p = el.parent(), po = p.offset(), expected = { @@ -191,31 +313,75 @@ test("{ containment: 'parent' }, absolute", function() { deepEqual(offsetAfter, expected, "compare offset to parent"); }); -/* -test("{ containment: 'document' }", function() { +test( "{ containment: [x1, y1, x2, y2] }", function() { expect( 1 ); - ok(false, "missing test - untested code is broken code"); + var el = $( "#draggable1" ).draggable(), + eo = el.offset(); + + el.draggable( "option", "containment", [ eo.left, eo.top, eo.left + el.width() + 5, eo.left + el.width() + 5 ] ); + + TestHelpers.draggable.testDrag( el, el, -100, -100, 0, 0 ); }); -test("{ containment: 'window' }", function() { +test("{ containment: 'parent' }, relative", function() { expect( 1 ); - ok(false, "missing test - untested code is broken code"); + var offsetAfter, + el = $("#draggable1").draggable({ containment: "parent" }), + p = el.parent(), + po = p.offset(), + expected = { + left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"), + top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top") + }; + + el.simulate( "drag", { + dx: -100, + dy: -100 + }); + offsetAfter = el.offset(); + deepEqual(offsetAfter, expected, "compare offset to parent"); }); -test("{ containment: Selector }", function() { +test("{ containment: 'parent' }, absolute", function() { expect( 1 ); - ok(false, "missing test - untested code is broken code"); + var offsetAfter, + el = $("#draggable2").draggable({ containment: "parent" }), + p = el.parent(), + po = p.offset(), + expected = { + left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"), + top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top") + }; + + el.simulate( "drag", { + dx: -100, + dy: -100 + }); + offsetAfter = el.offset(); + deepEqual(offsetAfter, expected, "compare offset to parent"); }); -test("{ containment: [x1, y1, x2, y2] }", function() { - expect( 1 ); +test("containment, default, switching after initialization", function() { + expect( 2 ); + + var el = $("#draggable1").draggable({ containment: false }); + + TestHelpers.draggable.testDrag(el, el, -100, -100, -100, -100); + + el.draggable( "option", "containment", "parent" ) + .css({top:0,left:0}) + .appendTo( $("#main") ); + + TestHelpers.draggable.testDrag(el, el, -100, -100, 0, 0); + + // TODO: Switching back to false does not update to false + // el.draggable( "option", "containment", false ); + // TestHelpers.draggable.testDrag(el, el, -100, -100, -100, -100); - ok(false, "missing test - untested code is broken code"); }); -*/ test("{ cursor: 'auto' }, default", function() { function getCursor() { return $("#draggable2").css("cursor"); } @@ -270,6 +436,27 @@ test("{ cursor: 'move' }", function() { }); +test("cursor, default, switching after initialization", function() { + + expect(3); + + var el = $("#draggable1").draggable(); + + TestHelpers.draggable.trackMouseCss( el ); + + TestHelpers.draggable.move( el, 1, 1 ); + equal( el.data("last_dragged_cursor"), "auto" ); + + el.draggable( "option", "cursor", "move" ); + TestHelpers.draggable.move( el, 1, 1 ); + equal( el.data("last_dragged_cursor"), "move" ); + + el.draggable( "option", "cursor", "ns-resize" ); + TestHelpers.draggable.move( el, 1, 1 ); + equal( el.data("last_dragged_cursor"), "ns-resize" ); + +}); + test( "cursorAt", function() { expect( 24 ); @@ -311,15 +498,67 @@ test( "cursorAt", function() { }); }); -test("{ distance: 10 }", function() { +test( "cursorAt, switching after initialization", function() { + + expect( 24 ); + + var deltaX = -3, + deltaY = -3, + tests = { + "false": { cursorAt : false }, + "{ left: -5, top: -5 }": { x: -5, y: -5, cursorAt : { left: -5, top: -5 } }, + "[ 10, 20 ]": { x: 10, y: 20, cursorAt : [ 10, 20 ] }, + "'10 20'": { x: 10, y: 20, cursorAt : "10 20" }, + "{ left: 20, top: 40 }": { x: 20, y: 40, cursorAt : { left: 20, top: 40 } }, + "{ right: 10, bottom: 20 }": { x: 10, y: 20, cursorAt : { right: 10, bottom: 20 } } + }; + + $.each( tests, function( testName, testData ) { + $.each( [ "relative", "absolute" ], function( i, position ) { + var el = $( "#draggable" + ( i + 1 ) ); + + el.draggable({ + drag: function( event, ui ) { + if( !testData.cursorAt ) { + equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" ); + equal( ui.position.top - ui.originalPosition.top, deltaY, testName + " " + position + " top" ); + } else if( testData.cursorAt.right ) { + equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x - TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" ); + equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y - TestHelpers.draggable.unreliableOffset, testName + " " +position + " top" ); + } else { + equal( event.clientX - ui.offset.left, testData.x + TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" ); + equal( event.clientY - ui.offset.top, testData.y + TestHelpers.draggable.unreliableOffset, testName + " " + position + " top" ); + } + } + }); + + el.draggable( "option", "cursorAt", false ); + el.draggable( "option", "cursorAt", testData.cursorAt ); + + el.simulate( "drag", { + moves: 1, + dx: deltaX, + dy: deltaY + }); + }); + }); + +}); + + +test( "disabled", function() { + expect( 3 ); - var el = $("#draggable2").draggable({ distance: 10 }); - TestHelpers.draggable.testDrag(el, el, -9, -9, 0, 0, "distance not met"); + var el = $("#draggable1").draggable(); - TestHelpers.draggable.testDrag(el, el, -10, -10, -10, -10, "distance met"); + TestHelpers.draggable.shouldMove(el); - TestHelpers.draggable.testDrag(el, el, 9, 9, 0, 0, "distance not met"); + el.draggable( "option", "disabled", true ); + TestHelpers.draggable.shouldNotMove(el); + + el.draggable( "option", "disabled", false ); + TestHelpers.draggable.shouldMove(el); }); @@ -339,6 +578,22 @@ test("{ grid: [50, 50] }, absolute", function() { TestHelpers.draggable.testDrag(el, el, 26, 25, 50, 50); }); +test("grid, switching after initialization", function() { + + expect( 4 ); + + var el = $("#draggable1").draggable(); + // Forward + TestHelpers.draggable.testDrag(el, el, 24, 24, 24, 24); + TestHelpers.draggable.testDrag(el, el, 0, 0, 0, 0); + + el.draggable( "option", "grid", [50,50] ); + + TestHelpers.draggable.testDrag(el, el, 24, 24, 0, 0); + TestHelpers.draggable.testDrag(el, el, 26, 25, 50, 50); + +}); + test("{ handle: 'span' }", function() { expect( 2 ); @@ -348,6 +603,65 @@ test("{ handle: 'span' }", function() { TestHelpers.draggable.shouldNotMove(el, "drag element"); }); +/* +test("{ handle: Selectors }, matching parent selector", function() { + + expect( 4 ); + + var el = $("#draggable2").draggable({ handle: "span a" }); + + $("#qunit-fixture").append( "
          " ); + + el.find( "span" ).append( "" ); + + $("#wrapping a").append( el ); + + TestHelpers.draggable.testDrag(el, "#draggable2 span a", 50, 50, 50, 50, "drag span child"); + TestHelpers.draggable.shouldNotMove( $("#wrapping a") ); + + $("#draggable2").draggable( "option", "handle", "span > a" ); + $("#draggable2").find( "a" ).append( "" ); + + TestHelpers.draggable.testDrag(el, $("#draggable2 span a").first(), 50, 50, 50, 50, "drag span child"); + TestHelpers.draggable.shouldNotMove( $("#draggable2 span a").last() ); + +}); +*/ + +test("handle, default, switching after initialization", function() { + expect( 6 ); + + var el = $("#draggable2").draggable(); + + TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50); + TestHelpers.draggable.testDrag(el, "#draggable2 span", 100, 100, 100, 100); + + // Switch + el.draggable( "option", "handle", "span" ); + TestHelpers.draggable.testDrag(el, el, 50, 50, 0, 0); + TestHelpers.draggable.testDrag(el, "#draggable2 span", 100, 100, 100, 100); + + // And back + el.draggable( "option", "handle", false ); + TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50); + TestHelpers.draggable.testDrag(el, "#draggable2 span", 100, 100, 100, 100); + +}); + +test("helper, default, switching after initialization", function() { + expect( 3 ); + + var el = $("#draggable1").draggable(); + TestHelpers.draggable.shouldMove(el); + + el.draggable( "option", "helper", "clone" ); + TestHelpers.draggable.shouldNotMove(el); + + el.draggable( "option", "helper", "original" ); + TestHelpers.draggable.shouldMove(el); + +}); + test("{ helper: 'clone' }, relative", function() { expect( 1 ); @@ -701,8 +1015,267 @@ test("{ opacity: 0.5 }", function() { }); -test("{ zIndex: 10 }", function() { +test("opacity, default, switching after initialization", function() { + + expect(3); + + var opacity = null, + el = $("#draggable2").draggable({ + start: function() { + opacity = $(this).css("opacity"); + } + }); + + TestHelpers.draggable.move( el, 1, 1 ); + equal( opacity, 1 ); + + el.draggable( "option", "opacity", 0.5 ); + TestHelpers.draggable.move( el, 2, 1 ); + equal( opacity, 0.5 ); + + el.draggable( "option", "opacity", false ); + TestHelpers.draggable.move( el, 3, 1 ); + equal( opacity, 1 ); + +}); + +asyncTest( "revert and revertDuration", function() { + expect( 4 ); + + var el = $( "#draggable2" ).draggable({ + revert: true, + revertDuration: 0 + }); + TestHelpers.draggable.shouldNotMove( el, "revert: true, revertDuration: 0 should revert immediately" ); + + $( "#draggable2" ).draggable( "option", "revert", "invalid" ); + TestHelpers.draggable.shouldNotMove( el, "revert: invalid, revertDuration: 0 should revert immediately" ); + + $( "#draggable2" ).draggable( "option", "revert", false ); + TestHelpers.draggable.shouldMove( el, "revert: false should allow movement" ); + + $( "#draggable2" ).draggable( "option", { + revert: true, + revertDuration: 200, + stop: function() { + start(); + } + }); + // animation are async, so test for it asynchronously + TestHelpers.draggable.move( el, 50, 50 ); + setTimeout( function() { + ok( $( "#draggable2" ).is( ":animated" ), "revert: true with revertDuration should animate" ); + }); +}); + +test( "revert: valid", function() { + expect( 1 ); + + var el = $( "#draggable2" ).draggable({ + revert: "valid", + revertDuration: 0 + }); + + $( "#droppable" ).droppable(); + + TestHelpers.draggable.testDrag( el, el, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" ); +}); + +test( "scope", function() { + expect( 2 ); + + var el = $( "#draggable2" ).draggable({ + scope: "tasks", + revert: "valid", + revertDuration: 0 + }); + + $( "#droppable" ).droppable({ scope: "tasks" }); + + TestHelpers.draggable.testDrag( el, el, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" ); + + $( "#droppable" ).droppable("destroy").droppable({ scope: "nottasks" }); + TestHelpers.draggable.testDrag( el, el, 100, 100, 100, 100, "revert: valid reverts when dropped on a droppable" ); +}); + +test( "scroll, scrollSensitivity, and scrollSpeed", function() { + expect( 2 ); + + var viewportHeight = $( window ).height(), + el = $( "#draggable1" ).draggable({ scroll: true }), + scrollSensitivity = el.draggable( "option", "scrollSensitivity" ), + scrollSpeed = el.draggable( "option", "scrollSpeed" ); + + el.offset({ + top: viewportHeight - scrollSensitivity - 1, + left: 1 + }); + + el.simulate( "drag", { + dx: 1, + y: viewportHeight - scrollSensitivity - 1, + moves: 1 + }); + + ok( $( window ).scrollTop() === 0, "scroll: true doesn't scroll when the element is dragged outside of scrollSensitivity" ); + + el.draggable( "option", "scrollSensitivity", scrollSensitivity + 10 ); + + el.offset({ + top: viewportHeight - scrollSensitivity - 1, + left: 1 + }); + + el.simulate( "drag", { + dx: 1, + y: viewportHeight - scrollSensitivity - 1, + moves: 1 + }); + + ok( $( window ).scrollTop() === scrollSpeed, "scroll: true scrolls when the element is dragged within scrollSensitivity" ); + + TestHelpers.draggable.restoreScroll( document ); +}); + +test( "snap, snapMode, and snapTolerance", function() { + expect( 9 ); + + var newX, newY, + snapTolerance = 15, + el = $( "#draggable1" ).draggable({ + snap: true, + snapMode: "both", + snapTolerance: snapTolerance + }), + element2 = $( "#draggable2" ).draggable(); + + el.offset({ + top: 1, + left: 1 + }); + + newX = element2.offset().left - el.outerWidth() - snapTolerance - 1; + newY = element2.offset().top; + + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap outside the snapTolerance" ); + + newX += 2; + + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + notDeepEqual( el.offset(), { top: newY, left: newX }, "snaps inside the snapTolerance" ); + + el.draggable( "option", "snap", "#draggable2" ); + + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + notDeepEqual( el.offset(), { top: newY, left: newX }, "snaps based on selector" ); + + el.draggable( "option", "snap", "#draggable3" ); + + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap based on invalid selector" ); + + el.draggable( "option", "snap", true ); + el.draggable( "option", "snapTolerance", snapTolerance - 2 ); + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap outside the modified snapTolerance" ); + + el.draggable( "option", "snapTolerance", snapTolerance ); + el.draggable( "option", "snapMode", "inner" ); + + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap inside the outer snapTolerance area when snapMode is inner" ); + + newX = element2.offset().left - snapTolerance - 1; + newY = element2.offset().top; + + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap inside the outer snapTolerance area when snapMode is inner" ); + + newX++; + + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + notDeepEqual( el.offset(), { top: newY, left: newX }, "snaps inside the inner snapTolerance area when snapMode is inner" ); + + el.draggable( "option", "snapMode", "outer" ); + + el.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap on the inner snapTolerance area when snapMode is outer" ); +}); + +test( "stack", function() { + expect( 2 ); + + var element = $( "#draggable1" ).draggable({ + stack: "#draggable1, #draggable2" + }), + element2 = $( "#draggable2" ).draggable({ + stack: "#draggable1, #draggable2" + }); + + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.css( "zIndex" ), "2", "stack increments zIndex correctly" ); + + TestHelpers.draggable.move( element2, 1, 1 ); + equal( element2.css( "zIndex" ), "3", "stack increments zIndex correctly" ); +}); + +test("{ zIndex: 10 }", function() { expect(1); var actual, @@ -723,39 +1296,30 @@ test("{ zIndex: 10 }", function() { }); -test( "{ stack }", function() { - expect( 4 ); +test("zIndex, default, switching after initialization", function() { - var draggable1 = $( "#draggable1" ), - draggable2 = $( "#draggable2" ), - draggable3 = $( "#draggable3" ), - draggable4 = $( "#draggable4" ); + expect(3); - // Set z-index as an inline style. - $( "#draggable1, #draggable2" ) - .css( "zIndex", 100 ) - .draggable({ - stack: "#draggable1, #draggable2" - }); - // Have z-index applied via CSS, see #9077 - $( "#draggable3, #draggable4" ) - .draggable({ - stack: "#draggable3, #draggable4" + var zindex = null, + el = $("#draggable2").draggable({ + start: function() { + zindex = $(this).css("z-index"); + } }); - draggable1.simulate( "drag", { - dx: 1, - dy: 1 - }); - draggable3.simulate( "drag", { - dx: 1, - dy: 1 - }); + el.css( "z-index", 1 ); + + TestHelpers.draggable.move( el, 1, 1 ); + equal( zindex, 1 ); + + el.draggable( "option", "zIndex", 5 ); + TestHelpers.draggable.move( el, 2, 1 ); + equal( zindex, 5 ); + + el.draggable( "option", "zIndex", false ); + TestHelpers.draggable.move( el, 3, 1 ); + equal( zindex, 1 ); - equal( draggable1.css( "zIndex" ), 102); - equal( draggable2.css( "zIndex" ), 101); - equal( draggable3.css( "zIndex" ), 102); - equal( draggable4.css( "zIndex" ), 101); }); })(jQuery); diff --git a/tests/unit/draggable/draggable_test_helpers.js b/tests/unit/draggable/draggable_test_helpers.js index c1ac0ab8889..e1c79c6cc3f 100644 --- a/tests/unit/draggable/draggable_test_helpers.js +++ b/tests/unit/draggable/draggable_test_helpers.js @@ -11,7 +11,7 @@ TestHelpers.draggable = { }); offsetAfter = el.offset(); - actual = { left: offsetAfter.left, top: offsetAfter.top }, + actual = { left: offsetAfter.left, top: offsetAfter.top }; expected = { left: offsetBefore.left + expectedDX, top: offsetBefore.top + expectedDY }; msg = msg ? msg + "." : ""; @@ -50,5 +50,29 @@ TestHelpers.draggable = { }, margin: function(el, side) { return parseInt(el.css("margin-" + side), 10) || 0; + }, + move: function( el, x, y ) { + + $( el ).simulate( "drag", { + dx: x, + dy: y + }); + + }, + trackMouseCss : function( el ) { + el.on( "drag", function() { + el.data( "last_dragged_cursor", $("body").css("cursor") ); + }); + }, + trackAppendedParent : function( el ) { + + // appendTo ignored without being clone + el.draggable( "option", "helper", "clone" ); + + el.on( "drag", function(e,ui) { + // Get what parent is at time of drag + el.data( "last_dragged_parent", ui.helper.parent()[0] ); + }); + } }; \ No newline at end of file diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 27b6b4ef042..7c1fb336106 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -283,14 +283,12 @@ $.widget("ui.draggable", $.ui.mouse, { _getHandle: function(event) { var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; - $(this.options.handle, this.element) - .find("*") - .addBack() - .each(function() { - if(this === event.target) { - handle = true; - } - }); + + this.element.find( this.options.handle ).each(function() { + if(this === event.target) { + handle = true; + } + }); return handle; From dd16205a3fe709a19d7a76342d8dd7f960cccace Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Mon, 4 Mar 2013 01:32:23 -0500 Subject: [PATCH 25/50] Draggable Tests: Style Sweep --- tests/unit/draggable/draggable_options.js | 1030 ++++++++++----------- 1 file changed, 494 insertions(+), 536 deletions(-) diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index 0ab41b1f16f..b996c644ca3 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -1,139 +1,124 @@ -/* - * draggable_options.js - */ -(function($) { +(function( $ ) { -module("draggable: options"); +module( "draggable: options" ); // TODO: This doesn't actually test whether append happened, possibly remove -test("{ appendTo: 'parent' }, default, no clone", function() { +test( "{ appendTo: 'parent' }, default, no clone", function() { expect( 2 ); - var el = $("#draggable2").draggable({ appendTo: "parent" }); - TestHelpers.draggable.shouldMove(el); - - el = $("#draggable1").draggable({ appendTo: "parent" }); - TestHelpers.draggable.shouldMove(el); + var element = $( "#draggable2" ).draggable({ appendTo: "parent" }); + TestHelpers.draggable.shouldMove( element ); + element = $( "#draggable1" ).draggable({ appendTo: "parent" }); + TestHelpers.draggable.shouldMove( element ); }); // TODO: This doesn't actually test whether append happened, possibly remove -test("{ appendTo: Element }, no clone", function() { +test( "{ appendTo: Element }, no clone", function() { expect( 2 ); - var el = $("#draggable2").draggable({appendTo: $("#draggable2").parent()[0] }); + var element = $( "#draggable2" ).draggable({ appendTo: $( "#draggable2" ).parent()[ 0 ] }); - TestHelpers.draggable.shouldMove(el); + TestHelpers.draggable.shouldMove( element ); - el = $("#draggable1").draggable({ appendTo: $("#draggable2").parent()[0] }); - TestHelpers.draggable.shouldMove(el); + element = $( "#draggable1" ).draggable({ appendTo: $( "#draggable2" ).parent()[ 0 ] }); + TestHelpers.draggable.shouldMove( element ); }); // TODO: This doesn't actually test whether append happened, possibly remove -test("{ appendTo: Selector }, no clone", function() { +test( "{ appendTo: Selector }, no clone", function() { expect( 2 ); - var el = $("#draggable2").draggable({ appendTo: "#main" }); - TestHelpers.draggable.shouldMove(el); + var element = $( "#draggable2" ).draggable({ appendTo: "#main" }); + TestHelpers.draggable.shouldMove( element ); - el = $("#draggable1").draggable({ appendTo: "#main" }); - TestHelpers.draggable.shouldMove(el); + element = $( "#draggable1" ).draggable({ appendTo: "#main" }); + TestHelpers.draggable.shouldMove( element ); }); -test("{ appendTo: 'parent' }, default", function() { - - expect(2); - - var el = $("#draggable1").draggable(); +test( "{ appendTo: 'parent' }, default", function() { + expect( 2 ); - TestHelpers.draggable.trackAppendedParent(el); + var element = $( "#draggable1" ).draggable(); - equal( el.draggable( "option", "appendTo" ), "parent" ); + TestHelpers.draggable.trackAppendedParent( element ); - TestHelpers.draggable.move(el, 1, 1); - equal( el.data("last_dragged_parent"), $("#qunit-fixture")[0] ); + equal( element.draggable( "option", "appendTo" ), "parent" ); + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_parent" ), $( "#qunit-fixture" )[ 0 ] ); }); -test("{ appendTo: Element }", function() { - - expect(1); - - var appendTo = $("#draggable2").parent()[0], - el = $("#draggable1").draggable({ appendTo: appendTo }); +test( "{ appendTo: Element }", function() { + expect( 1 ); - TestHelpers.draggable.trackAppendedParent(el); + var appendTo = $( "#draggable2" ).parent()[ 0 ], + element = $( "#draggable1" ).draggable({ appendTo: appendTo }); - TestHelpers.draggable.move(el, 1, 1); - equal( el.data("last_dragged_parent"), appendTo ); + TestHelpers.draggable.trackAppendedParent( element ); + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_parent" ), appendTo ); }); -test("{ appendTo: jQuery }", function() { - - expect(1); - - var appendTo = $("#draggable2").parent(), - el = $("#draggable1").draggable({ appendTo: appendTo }); +test( "{ appendTo: jQuery }", function() { + expect( 1 ); - TestHelpers.draggable.trackAppendedParent(el); + var appendTo = $( "#draggable2" ).parent(), + element = $( "#draggable1" ).draggable({ appendTo: appendTo }); - TestHelpers.draggable.move(el, 1, 1); - equal( el.data("last_dragged_parent"), appendTo[0] ); + TestHelpers.draggable.trackAppendedParent( element ); + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_parent" ), appendTo[ 0 ] ); }); -test("{ appendTo: Selector }", function() { - - expect(1); +test( "{ appendTo: Selector }", function() { + expect( 1 ); var appendTo = "#main", - el = $("#draggable1").draggable({ appendTo: appendTo }); + element = $( "#draggable1" ).draggable({ appendTo: appendTo }); - TestHelpers.draggable.trackAppendedParent(el); - - TestHelpers.draggable.move(el, 1, 1); - equal( el.data("last_dragged_parent"), $(appendTo)[0] ); + TestHelpers.draggable.trackAppendedParent( element ); + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_parent" ), $(appendTo)[ 0 ] ); }); +test( "appendTo, default, switching after initialization", function() { + expect( 2 ); -test("appendTo, default, switching after initialization", function() { - - expect(2); - - var el = $("#draggable1").draggable({ helper : "clone" }); - - TestHelpers.draggable.trackAppendedParent(el); + var element = $( "#draggable1" ).draggable({ helper : "clone" }); - // Move and make sure el was appended to fixture - TestHelpers.draggable.move(el, 1, 1); - equal( el.data("last_dragged_parent"), $("#qunit-fixture")[0] ); + TestHelpers.draggable.trackAppendedParent( element ); - // Move and make sure el was appended to main - el.draggable( "option", "appendTo", $("#main") ); - TestHelpers.draggable.move(el, 2, 2); - equal( el.data("last_dragged_parent"), $("#main")[0] ); + // Move and make sure element was appended to fixture + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_parent" ), $( "#qunit-fixture" )[ 0 ] ); + // Move and make sure element was appended to main + element.draggable( "option", "appendTo", $( "#main" ) ); + TestHelpers.draggable.move( element, 2, 2 ); + equal( element.data( "last_dragged_parent" ), $( "#main" )[ 0 ] ); }); -test("{ axis: false }, default", function() { +test( "{ axis: false }, default", function() { expect( 1 ); - var el = $("#draggable2").draggable({ axis: false }); - TestHelpers.draggable.shouldMove(el); + var element = $( "#draggable2" ).draggable({ axis: false }); + TestHelpers.draggable.shouldMove( element ); }); -test("{ axis: 'x' }", function() { +test( "{ axis: 'x' }", function() { expect( 1 ); - var el = $("#draggable2").draggable({ axis: "x" }); - TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 0); + var element = $( "#draggable2" ).draggable({ axis: "x" }); + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 0 ); }); -test("{ axis: 'y' }", function() { +test( "{ axis: 'y' }", function() { expect( 1 ); - var el = $("#draggable2").draggable({ axis: "y" }); - TestHelpers.draggable.testDrag(el, el, 50, 50, 0, 50); + var element = $( "#draggable2" ).draggable({ axis: "y" }); + TestHelpers.draggable.testDrag( element, element, 50, 50, 0, 50 ); }); -test("{ axis: ? }, unexpected", function() { - var el, +test( "{ axis: ? }, unexpected", function() { + var element, unexpected = { "true": true, "{}": {}, @@ -146,63 +131,61 @@ test("{ axis: ? }, unexpected", function() { expect( 6 ); $.each(unexpected, function(key, val) { - el = $("#draggable2").draggable({ axis: val }); - TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50, "axis: " + key); - el.draggable("destroy"); + element = $( "#draggable2" ).draggable({ axis: val }); + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 50, "axis: " + key ); + element.draggable( "destroy" ); }); }); -test("axis, default, switching after initialization", function() { - - expect(3); +test( "axis, default, switching after initialization", function() { + expect( 3 ); - var el; + var element = $( "#draggable1" ).draggable({ axis : false }); - // Any direction - el = $("#draggable1").draggable({ axis : false }); - TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50); + // Any Direction + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 50 ); // Only horizontal - el.draggable("option", "axis", "x"); - TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 0); + element.draggable( "option", "axis", "x" ); + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 0 ); // Vertical only - el.draggable("option", "axis", "y"); - TestHelpers.draggable.testDrag(el, el, 50, 50, 0, 50); + element.draggable( "option", "axis", "y" ); + TestHelpers.draggable.testDrag( element, element, 50, 50, 0, 50 ); }); -test("{ cancel: 'input,textarea,button,select,option' }, default", function() { +test( "{ cancel: 'input,textarea,button,select,option' }, default", function() { expect( 2 ); - $("
          ").appendTo("#main"); + $( "
          " ).appendTo( "#main" ); - var el = $("#draggable-option-cancel-default").draggable({ cancel: "input,textarea,button,select,option" }); - TestHelpers.draggable.shouldMove(el); + var element = $( "#draggable-option-cancel-default" ).draggable({ cancel: "input,textarea,button,select,option" }); + TestHelpers.draggable.shouldMove( element ); - el.draggable("destroy"); + element.draggable( "destroy" ); - el = $("#draggable-option-cancel-default").draggable({ cancel: "input,textarea,button,select,option" }); - TestHelpers.draggable.testDrag(el, "#draggable-option-cancel-default input", 50, 50, 0, 0); - el.draggable("destroy"); + element = $( "#draggable-option-cancel-default" ).draggable({ cancel: "input,textarea,button,select,option" }); + TestHelpers.draggable.testDrag( element, "#draggable-option-cancel-default input", 50, 50, 0, 0 ); + element.draggable( "destroy" ); }); -test("{ cancel: 'span' }", function() { +test( "{ cancel: 'span' }", function() { expect( 2 ); - var el = $("#draggable2").draggable(); - TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 50, 50); + var element = $( "#draggable2" ).draggable(); + TestHelpers.draggable.testDrag( element, "#draggable2 span", 50, 50, 50, 50 ); - el.draggable("destroy"); + element.draggable( "destroy" ); - el = $("#draggable2").draggable({ cancel: "span" }); - TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 0, 0); + element = $( "#draggable2" ).draggable({ cancel: "span" }); + TestHelpers.draggable.testDrag( element, "#draggable2 span", 50, 50, 0, 0 ); }); test( "{ cancel: ? }, unexpected", function() { expect( 6 ); - var el, + var element, unexpected = { "true": true, "false": false, @@ -213,63 +196,62 @@ test( "{ cancel: ? }, unexpected", function() { }; $.each( unexpected, function( key, val ) { - el = $("#draggable2").draggable({ cancel: val }); - TestHelpers.draggable.shouldMove( el, "cancel: " + key ); - el.draggable("destroy"); + element = $( "#draggable2" ).draggable({ cancel: val }); + TestHelpers.draggable.shouldMove( element, "cancel: " + key ); + element.draggable( "destroy" ); }); }); /** -test("{ cancel: Selectors }, matching parent selector", function() { +test( "{ cancel: Selectors }, matching parent selector", function() { expect( 5 ); - var el = $("#draggable2").draggable({ cancel: "span a" }); + var element = $( "#draggable2" ).draggable({ cancel: "span a" }); - $("#qunit-fixture").append( "
          " ); + $( "#qunit-fixture" ).append( "" ); - el.find( "span" ).append( "" ); + element.find( "span" ).append( "" ); - $("#wrapping a").append( el ); + $( "#wrapping a" ).append( element ); - TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 50, 50, "drag span child"); - TestHelpers.draggable.shouldNotMove( $("#draggable2 span a") ); - TestHelpers.draggable.shouldNotMove( $("#wrapping a") ); + TestHelpers.draggable.testDrag( element, "#draggable2 span", 50, 50, 50, 50, "drag span child" ); + TestHelpers.draggable.shouldNotMove( $( "#draggable2 span a" ) ); + TestHelpers.draggable.shouldNotMove( $( "#wrapping a" ) ); - $("#draggable2").draggable( "option", "cancel", "span > a" ); - $("#draggable2").find( "a" ).append( "" ); + $( "#draggable2" ).draggable( "option", "cancel", "span > a" ); + $( "#draggable2" ).find( "a" ).append( "" ); - TestHelpers.draggable.testDrag(el, $("#draggable2 span a").last(), 50, 50, 50, 50, "drag span child"); - TestHelpers.draggable.shouldNotMove( $("#draggable2 span a").first() ); + TestHelpers.draggable.testDrag( element, $( "#draggable2 span a" ).last(), 50, 50, 50, 50, "drag span child" ); + TestHelpers.draggable.shouldNotMove( $( "#draggable2 span a" ).first() ); }); */ -test("cancel, default, switching after initialization", function() { +test( "cancelement, default, switching after initialization", function() { expect( 3 ); - $("
          ").appendTo("#main"); + $( "
          " ).appendTo( "#main" ); - var input = $("#draggable-option-cancel-default input"), - el = $("#draggable-option-cancel-default").draggable(); + var input = $( "#draggable-option-cancel-default input" ), + element = $( "#draggable-option-cancel-default" ).draggable(); - TestHelpers.draggable.testDrag(el, input, 50, 50, 0, 0); + TestHelpers.draggable.testDrag( element, input, 50, 50, 0, 0 ); - el.draggable("option", "cancel", "textarea" ); - TestHelpers.draggable.testDrag(el, input, 50, 50, 50, 50); - - el.draggable("option", "cancel", "input" ); - TestHelpers.draggable.testDrag(el, input, 50, 50, 0, 0); + element.draggable( "option", "cancel", "textarea" ); + TestHelpers.draggable.testDrag( element, input, 50, 50, 50, 50 ); + element.draggable( "option", "cancel", "input" ); + TestHelpers.draggable.testDrag( element, input, 50, 50, 0, 0 ); }); /* -test("{ connectToSortable: selector }, default", function() { +test( "{ connectToSortable: selector }, default", function() { expect( 1 ); - ok(false, "missing test - untested code is broken code"); + ok(false, "missing test - untested code is broken code" ); }); */ @@ -277,184 +259,185 @@ test( "{ containment: Element }", function() { expect( 1 ); var offsetAfter, - el = $( "#draggable1" ).draggable({ containment: $( "#draggable1" ).parent()[ 0 ] }), - p = el.parent(), + element = $( "#draggable1" ).draggable({ containment: $( "#draggable1" ).parent()[ 0 ] }), + p = element.parent(), po = p.offset(), expected = { - left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"), - top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top") + left: po.left + TestHelpers.draggable.border( p, "left" ) + TestHelpers.draggable.margin( element, "left" ), + top: po.top + TestHelpers.draggable.border( p, "top" ) + TestHelpers.draggable.margin( element, "top" ) }; - el.simulate( "drag", { + element.simulate( "drag", { dx: -100, dy: -100 }); - offsetAfter = el.offset(); - deepEqual(offsetAfter, expected, "compare offset to parent"); + offsetAfter = element.offset(); + deepEqual( offsetAfter, expected, "compare offset to parent" ); }); test( "{ containment: Selector }", function() { expect( 1 ); var offsetAfter, - el = $( "#draggable1" ).draggable({ containment: $( "#qunit-fixture" ) }), - p = el.parent(), + element = $( "#draggable1" ).draggable({ containment: $( "#qunit-fixture" ) }), + p = element.parent(), po = p.offset(), expected = { - left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"), - top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top") + left: po.left + TestHelpers.draggable.border( p, "left" ) + TestHelpers.draggable.margin( element, "left" ), + top: po.top + TestHelpers.draggable.border( p, "top" ) + TestHelpers.draggable.margin( element, "top" ) }; - el.simulate( "drag", { + element.simulate( "drag", { dx: -100, dy: -100 }); - offsetAfter = el.offset(); - deepEqual(offsetAfter, expected, "compare offset to parent"); + offsetAfter = element.offset(); + deepEqual( offsetAfter, expected, "compare offset to parent" ); }); test( "{ containment: [x1, y1, x2, y2] }", function() { expect( 1 ); - var el = $( "#draggable1" ).draggable(), - eo = el.offset(); + var element = $( "#draggable1" ).draggable(), + eo = element.offset(); - el.draggable( "option", "containment", [ eo.left, eo.top, eo.left + el.width() + 5, eo.left + el.width() + 5 ] ); + element.draggable( "option", "containment", [ eo.left, eo.top, eo.left + element.width() + 5, eo.left + element.width() + 5 ] ); - TestHelpers.draggable.testDrag( el, el, -100, -100, 0, 0 ); + TestHelpers.draggable.testDrag( element, element, -100, -100, 0, 0 ); }); -test("{ containment: 'parent' }, relative", function() { +test( "{ containment: 'parent' }, relative", function() { expect( 1 ); var offsetAfter, - el = $("#draggable1").draggable({ containment: "parent" }), - p = el.parent(), + element = $( "#draggable1" ).draggable({ containment: "parent" }), + p = element.parent(), po = p.offset(), expected = { - left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"), - top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top") + left: po.left + TestHelpers.draggable.border( p, "left" ) + TestHelpers.draggable.margin( element, "left" ), + top: po.top + TestHelpers.draggable.border( p, "top" ) + TestHelpers.draggable.margin( element, "top" ) }; - el.simulate( "drag", { + element.simulate( "drag", { dx: -100, dy: -100 }); - offsetAfter = el.offset(); - deepEqual(offsetAfter, expected, "compare offset to parent"); + offsetAfter = element.offset(); + deepEqual( offsetAfter, expected, "compare offset to parent" ); }); -test("{ containment: 'parent' }, absolute", function() { +test( "{ containment: 'parent' }, absolute", function() { expect( 1 ); var offsetAfter, - el = $("#draggable2").draggable({ containment: "parent" }), - p = el.parent(), + element = $( "#draggable2" ).draggable({ containment: "parent" }), + p = element.parent(), po = p.offset(), expected = { - left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"), - top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top") + left: po.left + TestHelpers.draggable.border( p, "left" ) + TestHelpers.draggable.margin( element, "left" ), + top: po.top + TestHelpers.draggable.border( p, "top" ) + TestHelpers.draggable.margin( element, "top" ) }; - el.simulate( "drag", { + element.simulate( "drag", { dx: -100, dy: -100 }); - offsetAfter = el.offset(); - deepEqual(offsetAfter, expected, "compare offset to parent"); + offsetAfter = element.offset(); + deepEqual( offsetAfter, expected, "compare offset to parent" ); }); -test("containment, default, switching after initialization", function() { +test( "containment, default, switching after initialization", function() { expect( 2 ); - var el = $("#draggable1").draggable({ containment: false }); + var element = $( "#draggable1" ).draggable({ containment: false }); - TestHelpers.draggable.testDrag(el, el, -100, -100, -100, -100); + TestHelpers.draggable.testDrag( element, element, -100, -100, -100, -100 ); - el.draggable( "option", "containment", "parent" ) - .css({top:0,left:0}) - .appendTo( $("#main") ); + element.draggable( "option", "containment", "parent" ) + .css({ + top: 0, + left: 0 + }) + .appendTo( $( "#main" ) ); - TestHelpers.draggable.testDrag(el, el, -100, -100, 0, 0); + TestHelpers.draggable.testDrag( element, element, -100, -100, 0, 0 ); // TODO: Switching back to false does not update to false - // el.draggable( "option", "containment", false ); - // TestHelpers.draggable.testDrag(el, el, -100, -100, -100, -100); - + // element.draggable( "option", "containment", false ); + // TestHelpers.draggable.testDrag( element, element, -100, -100, -100, -100 ); }); -test("{ cursor: 'auto' }, default", function() { - function getCursor() { return $("#draggable2").css("cursor"); } +test( "{ cursor: 'auto' }, default", function() { + function getCursor() { + return $( "#draggable2" ).css( "cursor" ); + } - expect(2); + expect( 2 ); - var actual, before, after, + var actual, after, expected = "auto", - el = $("#draggable2").draggable({ + element = $( "#draggable2" ).draggable({ cursor: expected, start: function() { actual = getCursor(); } - }); + }), + before = getCursor(); - before = getCursor(); - el.simulate( "drag", { + element.simulate( "drag", { dx: -1, dy: -1 }); after = getCursor(); - equal(actual, expected, "start callback: cursor '" + expected + "'"); - equal(after, before, "after drag: cursor restored"); - + equal( actual, expected, "start callback: cursor '" + expected + "'" ); + equal( after, before, "after drag: cursor restored" ); }); -test("{ cursor: 'move' }", function() { - - function getCursor() { return $("body").css("cursor"); } +test( "{ cursor: 'move' }", function() { + function getCursor() { + return $( "body" ).css( "cursor" ); + } - expect(2); + expect( 2 ); - var actual, before, after, + var actual, after, expected = "move", - el = $("#draggable2").draggable({ + element = $( "#draggable2" ).draggable({ cursor: expected, start: function() { actual = getCursor(); } - }); + }), + before = getCursor(); - before = getCursor(); - el.simulate( "drag", { + element.simulate( "drag", { dx: -1, dy: -1 }); after = getCursor(); - equal(actual, expected, "start callback: cursor '" + expected + "'"); - equal(after, before, "after drag: cursor restored"); - + equal( actual, expected, "start callback: cursor '" + expected + "'" ); + equal( after, before, "after drag: cursor restored" ); }); -test("cursor, default, switching after initialization", function() { - - expect(3); - - var el = $("#draggable1").draggable(); +test( "cursor, default, switching after initialization", function() { + expect( 3 ); - TestHelpers.draggable.trackMouseCss( el ); + var element = $( "#draggable1" ).draggable(); - TestHelpers.draggable.move( el, 1, 1 ); - equal( el.data("last_dragged_cursor"), "auto" ); + TestHelpers.draggable.trackMouseCss( element ); - el.draggable( "option", "cursor", "move" ); - TestHelpers.draggable.move( el, 1, 1 ); - equal( el.data("last_dragged_cursor"), "move" ); + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_cursor" ), "auto" ); - el.draggable( "option", "cursor", "ns-resize" ); - TestHelpers.draggable.move( el, 1, 1 ); - equal( el.data("last_dragged_cursor"), "ns-resize" ); + element.draggable( "option", "cursor", "move" ); + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_cursor" ), "move" ); + element.draggable( "option", "cursor", "ns-resize" ); + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_cursor" ), "ns-resize" ); }); test( "cursorAt", function() { @@ -473,7 +456,7 @@ test( "cursorAt", function() { $.each( tests, function( testName, testData ) { $.each( [ "relative", "absolute" ], function( i, position ) { - var el = $( "#draggable" + ( i + 1 ) ).draggable({ + var element = $( "#draggable" + ( i + 1 ) ).draggable({ cursorAt: testData.cursorAt, drag: function( event, ui ) { if( !testData.cursorAt ) { @@ -489,7 +472,7 @@ test( "cursorAt", function() { } }); - el.simulate( "drag", { + element.simulate( "drag", { moves: 1, dx: deltaX, dy: deltaY @@ -499,7 +482,6 @@ test( "cursorAt", function() { }); test( "cursorAt, switching after initialization", function() { - expect( 24 ); var deltaX = -3, @@ -515,9 +497,9 @@ test( "cursorAt, switching after initialization", function() { $.each( tests, function( testName, testData ) { $.each( [ "relative", "absolute" ], function( i, position ) { - var el = $( "#draggable" + ( i + 1 ) ); + var element = $( "#draggable" + ( i + 1 ) ); - el.draggable({ + element.draggable({ drag: function( event, ui ) { if( !testData.cursorAt ) { equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" ); @@ -532,527 +514,502 @@ test( "cursorAt, switching after initialization", function() { } }); - el.draggable( "option", "cursorAt", false ); - el.draggable( "option", "cursorAt", testData.cursorAt ); + element.draggable( "option", "cursorAt", false ); + element.draggable( "option", "cursorAt", testData.cursorAt ); - el.simulate( "drag", { + element.simulate( "drag", { moves: 1, dx: deltaX, dy: deltaY }); }); }); - }); - test( "disabled", function() { - expect( 3 ); - var el = $("#draggable1").draggable(); + var element = $( "#draggable1" ).draggable(); - TestHelpers.draggable.shouldMove(el); + TestHelpers.draggable.shouldMove( element ); - el.draggable( "option", "disabled", true ); - TestHelpers.draggable.shouldNotMove(el); - - el.draggable( "option", "disabled", false ); - TestHelpers.draggable.shouldMove(el); + element.draggable( "option", "disabled", true ); + TestHelpers.draggable.shouldNotMove( element ); + element.draggable( "option", "disabled", false ); + TestHelpers.draggable.shouldMove( element ); }); -test("{ grid: [50, 50] }, relative", function() { +test( "{ grid: [50, 50] }, relative", function() { expect( 2 ); - var el = $("#draggable1").draggable({ grid: [50, 50] }); - TestHelpers.draggable.testDrag(el, el, 24, 24, 0, 0); - TestHelpers.draggable.testDrag(el, el, 26, 25, 50, 50); + var element = $( "#draggable1" ).draggable({ grid: [ 50, 50 ] }); + TestHelpers.draggable.testDrag( element, element, 24, 24, 0, 0 ); + TestHelpers.draggable.testDrag( element, element, 26, 25, 50, 50 ); }); -test("{ grid: [50, 50] }, absolute", function() { +test( "{ grid: [50, 50] }, absolute", function() { expect( 2 ); - var el = $("#draggable2").draggable({ grid: [50, 50] }); - TestHelpers.draggable.testDrag(el, el, 24, 24, 0, 0); - TestHelpers.draggable.testDrag(el, el, 26, 25, 50, 50); + var element = $( "#draggable2" ).draggable({ grid: [ 50, 50 ] }); + TestHelpers.draggable.testDrag( element, element, 24, 24, 0, 0 ); + TestHelpers.draggable.testDrag( element, element, 26, 25, 50, 50 ); }); -test("grid, switching after initialization", function() { - +test( "grid, switching after initialization", function() { expect( 4 ); - var el = $("#draggable1").draggable(); - // Forward - TestHelpers.draggable.testDrag(el, el, 24, 24, 24, 24); - TestHelpers.draggable.testDrag(el, el, 0, 0, 0, 0); + var element = $( "#draggable1" ).draggable(); - el.draggable( "option", "grid", [50,50] ); + // Forward + TestHelpers.draggable.testDrag( element, element, 24, 24, 24, 24 ); + TestHelpers.draggable.testDrag( element, element, 0, 0, 0, 0 ); - TestHelpers.draggable.testDrag(el, el, 24, 24, 0, 0); - TestHelpers.draggable.testDrag(el, el, 26, 25, 50, 50); + element.draggable( "option", "grid", [ 50,50 ] ); + TestHelpers.draggable.testDrag( element, element, 24, 24, 0, 0 ); + TestHelpers.draggable.testDrag( element, element, 26, 25, 50, 50 ); }); -test("{ handle: 'span' }", function() { +test( "{ handle: 'span' }", function() { expect( 2 ); - var el = $("#draggable2").draggable({ handle: "span" }); + var element = $( "#draggable2" ).draggable({ handle: "span" }); - TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 50, 50, "drag span"); - TestHelpers.draggable.shouldNotMove(el, "drag element"); + TestHelpers.draggable.testDrag( element, "#draggable2 span", 50, 50, 50, 50, "drag span" ); + TestHelpers.draggable.shouldNotMove( element, "drag element" ); }); /* -test("{ handle: Selectors }, matching parent selector", function() { +test( "{ handle: Selectors }, matching parent selector", function() { expect( 4 ); - var el = $("#draggable2").draggable({ handle: "span a" }); + var element = $( "#draggable2" ).draggable({ handle: "span a" }); - $("#qunit-fixture").append( "
          " ); + $( "#qunit-fixture" ).append( "" ); - el.find( "span" ).append( "" ); + element.find( "span" ).append( "" ); - $("#wrapping a").append( el ); + $( "#wrapping a" ).append( element ); - TestHelpers.draggable.testDrag(el, "#draggable2 span a", 50, 50, 50, 50, "drag span child"); - TestHelpers.draggable.shouldNotMove( $("#wrapping a") ); + TestHelpers.draggable.testDrag( element, "#draggable2 span a", 50, 50, 50, 50, "drag span child" ); + TestHelpers.draggable.shouldNotMove( $( "#wrapping a" ) ); - $("#draggable2").draggable( "option", "handle", "span > a" ); - $("#draggable2").find( "a" ).append( "" ); + $( "#draggable2" ).draggable( "option", "handle", "span > a" ); + $( "#draggable2" ).find( "a" ).append( "" ); - TestHelpers.draggable.testDrag(el, $("#draggable2 span a").first(), 50, 50, 50, 50, "drag span child"); - TestHelpers.draggable.shouldNotMove( $("#draggable2 span a").last() ); + TestHelpers.draggable.testDrag( element, $( "#draggable2 span a" ).first(), 50, 50, 50, 50, "drag span child" ); + TestHelpers.draggable.shouldNotMove( $( "#draggable2 span a" ).last() ); }); */ -test("handle, default, switching after initialization", function() { +test( "handle, default, switching after initialization", function() { expect( 6 ); - var el = $("#draggable2").draggable(); + var element = $( "#draggable2" ).draggable(); - TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50); - TestHelpers.draggable.testDrag(el, "#draggable2 span", 100, 100, 100, 100); + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 50 ); + TestHelpers.draggable.testDrag( element, "#draggable2 span", 100, 100, 100, 100 ); // Switch - el.draggable( "option", "handle", "span" ); - TestHelpers.draggable.testDrag(el, el, 50, 50, 0, 0); - TestHelpers.draggable.testDrag(el, "#draggable2 span", 100, 100, 100, 100); + element.draggable( "option", "handle", "span" ); + TestHelpers.draggable.testDrag( element, element, 50, 50, 0, 0 ); + TestHelpers.draggable.testDrag( element, "#draggable2 span", 100, 100, 100, 100 ); // And back - el.draggable( "option", "handle", false ); - TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50); - TestHelpers.draggable.testDrag(el, "#draggable2 span", 100, 100, 100, 100); - + element.draggable( "option", "handle", false ); + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 50 ); + TestHelpers.draggable.testDrag( element, "#draggable2 span", 100, 100, 100, 100 ); }); -test("helper, default, switching after initialization", function() { +test( "helper, default, switching after initialization", function() { expect( 3 ); - var el = $("#draggable1").draggable(); - TestHelpers.draggable.shouldMove(el); - - el.draggable( "option", "helper", "clone" ); - TestHelpers.draggable.shouldNotMove(el); + var element = $( "#draggable1" ).draggable(); + TestHelpers.draggable.shouldMove( element ); - el.draggable( "option", "helper", "original" ); - TestHelpers.draggable.shouldMove(el); + element.draggable( "option", "helper", "clone" ); + TestHelpers.draggable.shouldNotMove( element ); + element.draggable( "option", "helper", "original" ); + TestHelpers.draggable.shouldMove( element ); }); -test("{ helper: 'clone' }, relative", function() { +test( "{ helper: 'clone' }, relative", function() { expect( 1 ); - var el = $("#draggable1").draggable({ helper: "clone" }); - TestHelpers.draggable.shouldNotMove(el); + var element = $( "#draggable1" ).draggable({ helper: "clone" }); + TestHelpers.draggable.shouldNotMove( element ); }); -test("{ helper: 'clone' }, absolute", function() { +test( "{ helper: 'clone' }, absolute", function() { expect( 1 ); - var el = $("#draggable2").draggable({ helper: "clone" }); - TestHelpers.draggable.shouldNotMove(el); + var element = $( "#draggable2" ).draggable({ helper: "clone" }); + TestHelpers.draggable.shouldNotMove( element ); }); -test("{ helper: 'original' }, relative, with scroll offset on parent", function() { +test( "{ helper: 'original' }, relative, with scroll offset on parent", function() { expect( 3 ); - var el = $("#draggable1").draggable({ helper: "original" }); + var element = $( "#draggable1" ).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "relative"); + TestHelpers.draggable.testScroll( element, "relative" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.testScroll( element, "static" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.testScroll( element, "absolute" ); TestHelpers.draggable.restoreScroll(); - }); -test("{ helper: 'original' }, relative, with scroll offset on root", function() { +test( "{ helper: 'original' }, relative, with scroll offset on root", function() { expect( 3 ); - var el = $("#draggable1").draggable({ helper: "original" }); - - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "relative"); + var element = $( "#draggable1" ).draggable({ helper: "original" }); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "relative" ); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "static" ); - TestHelpers.draggable.restoreScroll("root"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "absolute" ); + TestHelpers.draggable.restoreScroll( "root" ); }); -test("{ helper: 'original' }, relative, with scroll offset on root and parent", function() { - - expect(3); +test( "{ helper: 'original' }, relative, with scroll offset on root and parent", function() { + expect( 3 ); - var el = $("#draggable1").draggable({ helper: "original" }); + var element = $( "#draggable1" ).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "relative"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "relative" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "static" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "absolute" ); TestHelpers.draggable.restoreScroll(); - TestHelpers.draggable.restoreScroll("root"); - + TestHelpers.draggable.restoreScroll( "root" ); }); -test("{ helper: 'original' }, absolute, with scroll offset on parent", function() { - - expect(3); +test( "{ helper: 'original' }, absolute, with scroll offset on parent", function() { + expect( 3 ); - var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); + var element = $( "#draggable1" ).css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "relative"); + TestHelpers.draggable.testScroll( element, "relative" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.testScroll( element, "static" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.testScroll( element, "absolute" ); TestHelpers.draggable.restoreScroll(); - }); -test("{ helper: 'original' }, absolute, with scroll offset on root", function() { - - expect(3); - - var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); +test( "{ helper: 'original' }, absolute, with scroll offset on root", function() { + expect( 3 ); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "relative"); + var element = $( "#draggable1" ).css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "relative" ); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "static" ); - TestHelpers.draggable.restoreScroll("root"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "absolute" ); + TestHelpers.draggable.restoreScroll( "root" ); }); -test("{ helper: 'original' }, absolute, with scroll offset on root and parent", function() { - - expect(3); +test( "{ helper: 'original' }, absolute, with scroll offset on root and parent", function() { + expect( 3 ); - var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); + var element = $( "#draggable1" ).css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "relative"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "relative" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "static" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "absolute" ); TestHelpers.draggable.restoreScroll(); - TestHelpers.draggable.restoreScroll("root"); - + TestHelpers.draggable.restoreScroll( "root" ); }); -test("{ helper: 'original' }, fixed, with scroll offset on parent", function() { - - expect(3); +test( "{ helper: 'original' }, fixed, with scroll offset on parent", function() { + expect( 3 ); - var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); + var element = $( "#draggable1" ).css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "relative"); + TestHelpers.draggable.testScroll( element, "relative" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.testScroll( element, "static" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.testScroll( element, "absolute" ); TestHelpers.draggable.restoreScroll(); - }); -test("{ helper: 'original' }, fixed, with scroll offset on root", function() { - - expect(3); +test( "{ helper: 'original' }, fixed, with scroll offset on root", function() { + expect( 3 ); - var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); + var element = $( "#draggable1" ).css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "relative"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "relative" ); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "static" ); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "absolute" ); - TestHelpers.draggable.restoreScroll("root"); + TestHelpers.draggable.restoreScroll( "root" ); }); -test("{ helper: 'original' }, fixed, with scroll offset on root and parent", function() { - - expect(3); +test( "{ helper: 'original' }, fixed, with scroll offset on root and parent", function() { + expect( 3 ); - var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); + var element = $( "#draggable1" ).css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "relative"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "relative" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "static"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "static" ); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll("root"); - TestHelpers.draggable.testScroll(el, "absolute"); + TestHelpers.draggable.setScroll( "root" ); + TestHelpers.draggable.testScroll( element, "absolute" ); TestHelpers.draggable.restoreScroll(); - TestHelpers.draggable.restoreScroll("root"); - + TestHelpers.draggable.restoreScroll( "root" ); }); -test("{ helper: 'clone' }, absolute", function() { - - expect(1); +test( "{ helper: 'clone' }, absolute", function() { + expect( 1 ); var helperOffset = null, - origOffset = $("#draggable1").offset(), - el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { + origOffset = $( "#draggable1" ).offset(), + element = $( "#draggable1" ).draggable({ helper: "clone", drag: function( event, ui) { helperOffset = ui.helper.offset(); } }); - el.simulate( "drag", { + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); }); -test("{ helper: 'clone' }, absolute with scroll offset on parent", function() { - - expect(3); +test( "{ helper: 'clone' }, absolute with scroll offset on parent", function() { + expect( 3 ); TestHelpers.draggable.setScroll(); var helperOffset = null, origOffset = null, - el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { - helperOffset = ui.helper.offset(); - } }); + element = $( "#draggable1" ).draggable({ + helper: "clone", + drag: function( event, ui) { + helperOffset = ui.helper.offset(); + } + }); - $("#main").css("position", "relative"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "relative" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); - $("#main").css("position", "static"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "static" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); - $("#main").css("position", "absolute"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "absolute" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); TestHelpers.draggable.restoreScroll(); - }); -test("{ helper: 'clone' }, absolute with scroll offset on root", function() { - - expect(3); +test( "{ helper: 'clone' }, absolute with scroll offset on root", function() { + expect( 3 ); - TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.setScroll( "root" ); var helperOffset = null, origOffset = null, - el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { - helperOffset = ui.helper.offset(); - } }); + element = $( "#draggable1" ).draggable({ + helper: "clone", + drag: function( event, ui) { + helperOffset = ui.helper.offset(); + } + }); - $("#main").css("position", "relative"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "relative" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); - $("#main").css("position", "static"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "static" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); - $("#main").css("position", "absolute"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "absolute" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - - TestHelpers.draggable.restoreScroll("root"); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); + TestHelpers.draggable.restoreScroll( "root" ); }); -test("{ helper: 'clone' }, absolute with scroll offset on root and parent", function() { - - expect(3); +test( "{ helper: 'clone' }, absolute with scroll offset on root and parent", function() { + expect( 3 ); - TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.setScroll( "root" ); TestHelpers.draggable.setScroll(); var helperOffset = null, origOffset = null, - el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { - helperOffset = ui.helper.offset(); - } }); + element = $( "#draggable1" ).draggable({ + helper: "clone", + drag: function( event, ui) { + helperOffset = ui.helper.offset(); + } + }); - $("#main").css("position", "relative"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "relative" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); - $("#main").css("position", "static"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "static" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); - $("#main").css("position", "absolute"); - origOffset = $("#draggable1").offset(); - el.simulate( "drag", { + $( "#main" ).css( "position", "absolute" ); + origOffset = $( "#draggable1" ).offset(); + element.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); + deepEqual({ top: helperOffset.top - 1, left: helperOffset.left - 1 }, origOffset, "dragged[1, 1]" ); - TestHelpers.draggable.restoreScroll("root"); + TestHelpers.draggable.restoreScroll( "root" ); TestHelpers.draggable.restoreScroll(); - }); -test("{ opacity: 0.5 }", function() { - - expect(1); +test( "{ opacity: 0.5 }", function() { + expect( 1 ); var opacity = null, - el = $("#draggable2").draggable({ + element = $( "#draggable2" ).draggable({ opacity: 0.5, start: function() { - opacity = $(this).css("opacity"); + opacity = $(this).css( "opacity" ); } }); - el.simulate( "drag", { + element.simulate( "drag", { dx: -1, dy: -1 }); - equal(opacity, 0.5, "start callback: opacity is"); - + equal( opacity, 0.5, "start callback: opacity is" ); }); -test("opacity, default, switching after initialization", function() { - - expect(3); +test( "opacity, default, switching after initialization", function() { + expect( 3 ); var opacity = null, - el = $("#draggable2").draggable({ + element = $( "#draggable2" ).draggable({ start: function() { - opacity = $(this).css("opacity"); + opacity = $(this).css( "opacity" ); } }); - TestHelpers.draggable.move( el, 1, 1 ); + TestHelpers.draggable.move( element, 1, 1 ); equal( opacity, 1 ); - el.draggable( "option", "opacity", 0.5 ); - TestHelpers.draggable.move( el, 2, 1 ); + element.draggable( "option", "opacity", 0.5 ); + TestHelpers.draggable.move( element, 2, 1 ); equal( opacity, 0.5 ); - el.draggable( "option", "opacity", false ); - TestHelpers.draggable.move( el, 3, 1 ); + element.draggable( "option", "opacity", false ); + TestHelpers.draggable.move( element, 3, 1 ); equal( opacity, 1 ); - }); asyncTest( "revert and revertDuration", function() { expect( 4 ); - var el = $( "#draggable2" ).draggable({ + var element = $( "#draggable2" ).draggable({ revert: true, revertDuration: 0 }); - TestHelpers.draggable.shouldNotMove( el, "revert: true, revertDuration: 0 should revert immediately" ); + TestHelpers.draggable.shouldNotMove( element, "revert: true, revertDuration: 0 should revert immediately" ); $( "#draggable2" ).draggable( "option", "revert", "invalid" ); - TestHelpers.draggable.shouldNotMove( el, "revert: invalid, revertDuration: 0 should revert immediately" ); + TestHelpers.draggable.shouldNotMove( element, "revert: invalid, revertDuration: 0 should revert immediately" ); $( "#draggable2" ).draggable( "option", "revert", false ); - TestHelpers.draggable.shouldMove( el, "revert: false should allow movement" ); + TestHelpers.draggable.shouldMove( element, "revert: false should allow movement" ); $( "#draggable2" ).draggable( "option", { revert: true, @@ -1061,8 +1018,9 @@ asyncTest( "revert and revertDuration", function() { start(); } }); + // animation are async, so test for it asynchronously - TestHelpers.draggable.move( el, 50, 50 ); + TestHelpers.draggable.move( element, 50, 50 ); setTimeout( function() { ok( $( "#draggable2" ).is( ":animated" ), "revert: true with revertDuration should animate" ); }); @@ -1071,20 +1029,20 @@ asyncTest( "revert and revertDuration", function() { test( "revert: valid", function() { expect( 1 ); - var el = $( "#draggable2" ).draggable({ + var element = $( "#draggable2" ).draggable({ revert: "valid", revertDuration: 0 }); $( "#droppable" ).droppable(); - TestHelpers.draggable.testDrag( el, el, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" ); + TestHelpers.draggable.testDrag( element, element, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" ); }); test( "scope", function() { expect( 2 ); - var el = $( "#draggable2" ).draggable({ + var element = $( "#draggable2" ).draggable({ scope: "tasks", revert: "valid", revertDuration: 0 @@ -1092,27 +1050,27 @@ test( "scope", function() { $( "#droppable" ).droppable({ scope: "tasks" }); - TestHelpers.draggable.testDrag( el, el, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" ); + TestHelpers.draggable.testDrag( element, element, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" ); - $( "#droppable" ).droppable("destroy").droppable({ scope: "nottasks" }); + $( "#droppable" ).droppable( "destroy" ).droppable({ scope: "nottasks" }); - TestHelpers.draggable.testDrag( el, el, 100, 100, 100, 100, "revert: valid reverts when dropped on a droppable" ); + TestHelpers.draggable.testDrag( element, element, 100, 100, 100, 100, "revert: valid reverts when dropped on a droppable" ); }); test( "scroll, scrollSensitivity, and scrollSpeed", function() { expect( 2 ); var viewportHeight = $( window ).height(), - el = $( "#draggable1" ).draggable({ scroll: true }), - scrollSensitivity = el.draggable( "option", "scrollSensitivity" ), - scrollSpeed = el.draggable( "option", "scrollSpeed" ); + element = $( "#draggable1" ).draggable({ scroll: true }), + scrollSensitivity = element.draggable( "option", "scrollSensitivity" ), + scrollSpeed = element.draggable( "option", "scrollSpeed" ); - el.offset({ + element.offset({ top: viewportHeight - scrollSensitivity - 1, left: 1 }); - el.simulate( "drag", { + element.simulate( "drag", { dx: 1, y: viewportHeight - scrollSensitivity - 1, moves: 1 @@ -1120,14 +1078,14 @@ test( "scroll, scrollSensitivity, and scrollSpeed", function() { ok( $( window ).scrollTop() === 0, "scroll: true doesn't scroll when the element is dragged outside of scrollSensitivity" ); - el.draggable( "option", "scrollSensitivity", scrollSensitivity + 10 ); + element.draggable( "option", "scrollSensitivity", scrollSensitivity + 10 ); - el.offset({ + element.offset({ top: viewportHeight - scrollSensitivity - 1, left: 1 }); - el.simulate( "drag", { + element.simulate( "drag", { dx: 1, y: viewportHeight - scrollSensitivity - 1, moves: 1 @@ -1143,119 +1101,119 @@ test( "snap, snapMode, and snapTolerance", function() { var newX, newY, snapTolerance = 15, - el = $( "#draggable1" ).draggable({ + element = $( "#draggable1" ).draggable({ snap: true, snapMode: "both", snapTolerance: snapTolerance }), element2 = $( "#draggable2" ).draggable(); - el.offset({ + element.offset({ top: 1, left: 1 }); - newX = element2.offset().left - el.outerWidth() - snapTolerance - 1; + newX = element2.offset().left - element.outerWidth() - snapTolerance - 1; newY = element2.offset().top; - el.simulate( "drag", { + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap outside the snapTolerance" ); + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap outside the snapTolerance" ); newX += 2; - el.simulate( "drag", { + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - notDeepEqual( el.offset(), { top: newY, left: newX }, "snaps inside the snapTolerance" ); + notDeepEqual( element.offset(), { top: newY, left: newX }, "snaps inside the snapTolerance" ); - el.draggable( "option", "snap", "#draggable2" ); + element.draggable( "option", "snap", "#draggable2" ); - el.simulate( "drag", { + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - notDeepEqual( el.offset(), { top: newY, left: newX }, "snaps based on selector" ); + notDeepEqual( element.offset(), { top: newY, left: newX }, "snaps based on selector" ); - el.draggable( "option", "snap", "#draggable3" ); + element.draggable( "option", "snap", "#draggable3" ); - el.simulate( "drag", { + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap based on invalid selector" ); + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap based on invalid selector" ); - el.draggable( "option", "snap", true ); - el.draggable( "option", "snapTolerance", snapTolerance - 2 ); - el.simulate( "drag", { + element.draggable( "option", "snap", true ); + element.draggable( "option", "snapTolerance", snapTolerance - 2 ); + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap outside the modified snapTolerance" ); + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap outside the modified snapTolerance" ); - el.draggable( "option", "snapTolerance", snapTolerance ); - el.draggable( "option", "snapMode", "inner" ); + element.draggable( "option", "snapTolerance", snapTolerance ); + element.draggable( "option", "snapMode", "inner" ); - el.simulate( "drag", { + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap inside the outer snapTolerance area when snapMode is inner" ); + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap inside the outer snapTolerance area when snapMode is inner" ); newX = element2.offset().left - snapTolerance - 1; newY = element2.offset().top; - el.simulate( "drag", { + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap inside the outer snapTolerance area when snapMode is inner" ); + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap inside the outer snapTolerance area when snapMode is inner" ); newX++; - el.simulate( "drag", { + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - notDeepEqual( el.offset(), { top: newY, left: newX }, "snaps inside the inner snapTolerance area when snapMode is inner" ); + notDeepEqual( element.offset(), { top: newY, left: newX }, "snaps inside the inner snapTolerance area when snapMode is inner" ); - el.draggable( "option", "snapMode", "outer" ); + element.draggable( "option", "snapMode", "outer" ); - el.simulate( "drag", { + element.simulate( "drag", { handle: "corner", x: newX, y: newY, moves: 1 }); - deepEqual( el.offset(), { top: newY, left: newX }, "doesn't snap on the inner snapTolerance area when snapMode is outer" ); + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap on the inner snapTolerance area when snapMode is outer" ); }); test( "stack", function() { @@ -1275,51 +1233,51 @@ test( "stack", function() { equal( element2.css( "zIndex" ), "3", "stack increments zIndex correctly" ); }); -test("{ zIndex: 10 }", function() { - expect(1); +test( "{ zIndex: 10 }", function() { + expect( 1 ); var actual, expected = 10, - el = $("#draggable2").draggable({ + element = $( "#draggable2" ).draggable({ zIndex: expected, start: function() { - actual = $(this).css("zIndex"); + actual = $(this).css( "zIndex" ); } }); - el.simulate( "drag", { + element.simulate( "drag", { dx: -1, dy: -1 }); - equal(actual, expected, "start callback: zIndex is"); + equal( actual, expected, "start callback: zIndex is" ); }); -test("zIndex, default, switching after initialization", function() { +test( "zIndex, default, switching after initialization", function() { - expect(3); + expect( 3 ); var zindex = null, - el = $("#draggable2").draggable({ + element = $( "#draggable2" ).draggable({ start: function() { - zindex = $(this).css("z-index"); + zindex = $(this).css( "z-index" ); } }); - el.css( "z-index", 1 ); + element.css( "z-index", 1 ); - TestHelpers.draggable.move( el, 1, 1 ); + TestHelpers.draggable.move( element, 1, 1 ); equal( zindex, 1 ); - el.draggable( "option", "zIndex", 5 ); - TestHelpers.draggable.move( el, 2, 1 ); + element.draggable( "option", "zIndex", 5 ); + TestHelpers.draggable.move( element, 2, 1 ); equal( zindex, 5 ); - el.draggable( "option", "zIndex", false ); - TestHelpers.draggable.move( el, 3, 1 ); + element.draggable( "option", "zIndex", false ); + TestHelpers.draggable.move( element, 3, 1 ); equal( zindex, 1 ); }); -})(jQuery); +})( jQuery ); From 5a04d237ddeb9f290ad1293c97a2e823e116fceb Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Mon, 4 Mar 2013 09:58:23 -0500 Subject: [PATCH 26/50] Draggable Tests: Fix snap test failures in IE8 --- tests/unit/draggable/draggable_options.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index b996c644ca3..c000a136b79 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -1113,7 +1113,7 @@ test( "snap, snapMode, and snapTolerance", function() { left: 1 }); - newX = element2.offset().left - element.outerWidth() - snapTolerance - 1; + newX = element2.offset().left - element.outerWidth() - snapTolerance - 2; newY = element2.offset().top; element.simulate( "drag", { @@ -1125,7 +1125,7 @@ test( "snap, snapMode, and snapTolerance", function() { deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap outside the snapTolerance" ); - newX += 2; + newX += 3; element.simulate( "drag", { handle: "corner", From ca0b4b8a6c6a687866ea27a992570648e9295721 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Mon, 4 Mar 2013 11:39:14 -0500 Subject: [PATCH 27/50] Draggable Tests: Fix containment tests --- tests/unit/draggable/draggable_options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index c000a136b79..ccbe7224ac7 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -301,7 +301,7 @@ test( "{ containment: [x1, y1, x2, y2] }", function() { var element = $( "#draggable1" ).draggable(), eo = element.offset(); - element.draggable( "option", "containment", [ eo.left, eo.top, eo.left + element.width() + 5, eo.left + element.width() + 5 ] ); + element.draggable( "option", "containment", [ eo.left, eo.top, eo.left + element.width() + 5, eo.top + element.height() + 5 ] ); TestHelpers.draggable.testDrag( element, element, -100, -100, 0, 0 ); }); From b9be6bb7ad107fd48b28e31df972b2037c47c2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 7 Mar 2013 12:55:00 -0500 Subject: [PATCH 28/50] Sortable: Copy the src of the original item when creating a placeholder from an image. Fixes #5129 - Sortable: Unable to use an image as a placeholder in Firefox. --- tests/unit/sortable/sortable.html | 7 +++++++ tests/unit/sortable/sortable_options.js | 21 +++++++++++++++++---- ui/jquery.ui.sortable.js | 2 ++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/unit/sortable/sortable.html b/tests/unit/sortable/sortable.html index 6e326a8657c..5e21a49da59 100644 --- a/tests/unit/sortable/sortable.html +++ b/tests/unit/sortable/sortable.html @@ -84,6 +84,13 @@

          +
          + + + + +
          +
          diff --git a/tests/unit/sortable/sortable_options.js b/tests/unit/sortable/sortable_options.js index fe50be002d7..caba0a7770d 100644 --- a/tests/unit/sortable/sortable_options.js +++ b/tests/unit/sortable/sortable_options.js @@ -5,10 +5,6 @@ module("sortable: options"); -// this is here to make JSHint pass "unused", and we don't want to -// remove the parameter for when we finally implement -$.noop(); - /* test("{ appendTo: 'parent' }, default", function() { ok(false, "missing test - untested code is broken code."); @@ -186,6 +182,23 @@ test("{ placeholder: false }, default", function() { ok(false, "missing test - untested code is broken code."); }); */ + +test( "{ placeholder: false } img", function() { + expect( 3 ); + + var element = $( "#sortable-images" ).sortable({ + start: function( event, ui ) { + equal( ui.placeholder.attr( "src" ), "../images/jqueryui_32x32.png", "placeholder img has correct src" ); + equal( ui.placeholder.height(), 32, "placeholder has correct height" ); + equal( ui.placeholder.width(), 32, "placeholder has correct width" ); + } + }); + + element.find( "img" ).eq( 0 ).simulate( "drag", { + dy: 1 + }); +}); + test( "{ placeholder: String }", function() { expect( 1 ); diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index f095ce9c505..93c6cccc5fb 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -762,6 +762,8 @@ $.widget("ui.sortable", $.ui.mouse, { // width of the table (browsers are smart enough to // handle this properly) element.append( " " ); + } else if ( nodeName === "img" ) { + element.attr( "src", that.currentItem.attr( "src" ) ); } if ( !className ) { From 5b2da7c127aa1afd9852063b6e4701ec6607e941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 7 Mar 2013 13:15:16 -0500 Subject: [PATCH 29/50] Sortable tests: Added alt attributes to images. --- tests/unit/sortable/sortable.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/sortable/sortable.html b/tests/unit/sortable/sortable.html index 5e21a49da59..7db14d4822f 100644 --- a/tests/unit/sortable/sortable.html +++ b/tests/unit/sortable/sortable.html @@ -85,10 +85,10 @@

          - - - - + + + +
          From 6358695df18722d8c7e99437365db42cf4957626 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Sat, 26 Jan 2013 15:31:27 -0500 Subject: [PATCH 30/50] Draggable: Fix border containment. Fixed #5569 - Draggable: Containment incorrectly calculates padding and border --- tests/unit/draggable/draggable_options.js | 31 +++++++++++++++++++++++ ui/jquery.ui.draggable.js | 4 +-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index ccbe7224ac7..2e9f85c2427 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -346,6 +346,37 @@ test( "{ containment: 'parent' }, absolute", function() { deepEqual( offsetAfter, expected, "compare offset to parent" ); }); +test( "containment, account for border", function() { + expect( 2 ); + + var el = $("#draggable1").appendTo("#main"), + parent = el.parent().css({ + height: "100px", + width: "100px", + borderStyle: "solid", + borderWidth: "5px 10px 15px 20px" + }), + parentBottom = parent.offset().top + parent.outerHeight(), + parentRight = parent.offset().left + parent.outerWidth(), + parentBorderBottom = TestHelpers.draggable.border( parent, "bottom" ), + parentBorderRight = TestHelpers.draggable.border( parent, "right" ); + + el.css({ + height: "5px", + width: "5px" + }).draggable({ containment: "parent" }); + + el.simulate( "drag", { + dx: 100, + dy: 100 + }); + + equal( el.offset().top, parentBottom - parentBorderBottom - el.height(), + "The draggable should be on top of its parent's bottom border" ); + equal( el.offset().left, parentRight - parentBorderRight - el.width(), + "The draggable should be to the right of its parent's right border" ); +}); + test( "containment, default, switching after initialization", function() { expect( 2 ); diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 7c1fb336106..56b8fc77d84 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -421,8 +421,8 @@ $.widget("ui.draggable", $.ui.mouse, { this.containment = [ (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), - (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, - (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderRightWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderBottomWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom ]; this.relative_container = c; From cdff72efed495d7a17c551578079619712758793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 8 Mar 2013 10:08:46 -0500 Subject: [PATCH 31/50] Draggable: Account for descendants in handle. --- tests/unit/draggable/draggable.html | 2 +- tests/unit/draggable/draggable_options.js | 28 ++--------------------- ui/jquery.ui.draggable.js | 14 +++--------- 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/tests/unit/draggable/draggable.html b/tests/unit/draggable/draggable.html index 6380f3e85bd..3d1d3326e02 100644 --- a/tests/unit/draggable/draggable.html +++ b/tests/unit/draggable/draggable.html @@ -48,7 +48,7 @@

          Relative
          -
          Absolute
          +
          Absolute
          Absolute
          diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index 2e9f85c2427..a71bf57cbd9 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -603,39 +603,15 @@ test( "grid, switching after initialization", function() { }); test( "{ handle: 'span' }", function() { - expect( 2 ); + expect( 3 ); var element = $( "#draggable2" ).draggable({ handle: "span" }); TestHelpers.draggable.testDrag( element, "#draggable2 span", 50, 50, 50, 50, "drag span" ); + TestHelpers.draggable.testDrag( element, "#draggable2 span em", 50, 50, 50, 50, "drag span child" ); TestHelpers.draggable.shouldNotMove( element, "drag element" ); }); -/* -test( "{ handle: Selectors }, matching parent selector", function() { - - expect( 4 ); - - var element = $( "#draggable2" ).draggable({ handle: "span a" }); - - $( "#qunit-fixture" ).append( "
          " ); - - element.find( "span" ).append( "" ); - - $( "#wrapping a" ).append( element ); - - TestHelpers.draggable.testDrag( element, "#draggable2 span a", 50, 50, 50, 50, "drag span child" ); - TestHelpers.draggable.shouldNotMove( $( "#wrapping a" ) ); - - $( "#draggable2" ).draggable( "option", "handle", "span > a" ); - $( "#draggable2" ).find( "a" ).append( "" ); - - TestHelpers.draggable.testDrag( element, $( "#draggable2 span a" ).first(), 50, 50, 50, 50, "drag span child" ); - TestHelpers.draggable.shouldNotMove( $( "#draggable2 span a" ).last() ); - -}); -*/ - test( "handle, default, switching after initialization", function() { expect( 6 ); diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 56b8fc77d84..5762d31717b 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -281,17 +281,9 @@ $.widget("ui.draggable", $.ui.mouse, { }, _getHandle: function(event) { - - var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; - - this.element.find( this.options.handle ).each(function() { - if(this === event.target) { - handle = true; - } - }); - - return handle; - + return this.options.handle ? + !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : + true; }, _createHelper: function(event) { From e0b2644d91ffb8b59f9cf6d8ac8b45f94af7dacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 8 Mar 2013 10:23:25 -0500 Subject: [PATCH 32/50] Removed guard against duplicate loading. Use safe references to original functions when proxying, don't rename originals. --- ui/jquery.ui.core.js | 36 ++++++++++------------- ui/jquery.ui.effect.js | 67 ++++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 52 deletions(-) diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index d224f181a21..1a13da2512b 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -13,13 +13,8 @@ var uuid = 0, runiqueId = /^ui-id-\d+$/; -// prevent duplicate loading -// this is only a problem because we proxy existing functions -// and we don't want to double proxy them +// $.ui might exist from components with no dependencies, e.g., $.ui.position $.ui = $.ui || {}; -if ( $.ui.version ) { - return; -} $.extend( $.ui, { version: "@VERSION", @@ -52,20 +47,21 @@ $.extend( $.ui, { // plugins $.fn.extend({ - _focus: $.fn.focus, - focus: function( delay, fn ) { - return typeof delay === "number" ? - this.each(function() { - var elem = this; - setTimeout(function() { - $( elem ).focus(); - if ( fn ) { - fn.call( elem ); - } - }, delay ); - }) : - this._focus.apply( this, arguments ); - }, + focus: (function( orig ) { + return function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + orig.apply( this, arguments ); + }; + })( $.fn.focus ), scrollParent: function() { var scrollParent; diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js index f3d9929b029..3d65b40c7c5 100644 --- a/ui/jquery.ui.effect.js +++ b/ui/jquery.ui.effect.js @@ -8,7 +8,7 @@ * * http://api.jqueryui.com/category/effects-core/ */ -;(jQuery.effects || (function($, undefined) { +(function($, undefined) { var dataSpace = "ui-effects-"; @@ -839,39 +839,42 @@ $.effects.animateClass = function( value, duration, easing, callback ) { }; $.fn.extend({ - _addClass: $.fn.addClass, - addClass: function( classNames, speed, easing, callback ) { - return speed ? - $.effects.animateClass.call( this, - { add: classNames }, speed, easing, callback ) : - this._addClass( classNames ); - }, - - _removeClass: $.fn.removeClass, - removeClass: function( classNames, speed, easing, callback ) { - return arguments.length > 1 ? - $.effects.animateClass.call( this, - { remove: classNames }, speed, easing, callback ) : - this._removeClass.apply( this, arguments ); - }, - - _toggleClass: $.fn.toggleClass, - toggleClass: function( classNames, force, speed, easing, callback ) { - if ( typeof force === "boolean" || force === undefined ) { - if ( !speed ) { - // without speed parameter - return this._toggleClass( classNames, force ); + addClass: (function( orig ) { + return function( classNames, speed, easing, callback ) { + return speed ? + $.effects.animateClass.call( this, + { add: classNames }, speed, easing, callback ) : + orig.apply( this, arguments ); + }; + })( $.fn.addClass ), + + removeClass: (function( orig ) { + return function( classNames, speed, easing, callback ) { + return arguments.length > 1 ? + $.effects.animateClass.call( this, + { remove: classNames }, speed, easing, callback ) : + orig.apply( this, arguments ); + }; + })( $.fn.removeClass ), + + toggleClass: (function( orig ) { + return function( classNames, force, speed, easing, callback ) { + if ( typeof force === "boolean" || force === undefined ) { + if ( !speed ) { + // without speed parameter + return orig.apply( this, arguments ); + } else { + return $.effects.animateClass.call( this, + (force ? { add: classNames } : { remove: classNames }), + speed, easing, callback ); + } } else { + // without force parameter return $.effects.animateClass.call( this, - (force ? { add: classNames } : { remove: classNames }), - speed, easing, callback ); + { toggle: classNames }, force, speed, easing ); } - } else { - // without force parameter - return $.effects.animateClass.call( this, - { toggle: classNames }, force, speed, easing ); - } - }, + }; + })( $.fn.toggleClass ), switchClass: function( remove, add, speed, easing, callback) { return $.effects.animateClass.call( this, { @@ -1283,4 +1286,4 @@ $.each( baseEasings, function( name, easeIn ) { })(); -})(jQuery)); +})(jQuery); From 89473f6557662d905a63faa3ae3520bf3715a7e8 Mon Sep 17 00:00:00 2001 From: John Chen Date: Sat, 16 Feb 2013 21:32:55 +0800 Subject: [PATCH 33/50] Sortable: Skip items that are not at the same line as the cursor when floating. Fixes #8792: Issue with floated items in connected lists. --- ui/jquery.ui.sortable.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 93c6cccc5fb..22acff7d116 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -21,6 +21,10 @@ function isOverAxis( x, reference, size ) { return ( x > reference ) && ( x < ( reference + size ) ); } +function isFloating(item) { + return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display")); +} + $.widget("ui.sortable", $.ui.mouse, { version: "@VERSION", widgetEventPrefix: "sort", @@ -73,7 +77,7 @@ $.widget("ui.sortable", $.ui.mouse, { this.refresh(); //Let's determine if the items are being displayed horizontally - this.floating = this.items.length ? o.axis === "x" || (/left|right/).test(this.items[0].item.css("float")) || (/inline|table-cell/).test(this.items[0].item.css("display")) : false; + this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false; //Let's determine the parent's offset this.offset = this.element.offset(); @@ -799,7 +803,7 @@ $.widget("ui.sortable", $.ui.mouse, { }, _contactContainers: function(event) { - var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, + var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating, innermostContainer = null, innermostIndex = null; @@ -845,8 +849,9 @@ $.widget("ui.sortable", $.ui.mouse, { //When entering a new container, we will find the item with the least distance and append our item near it dist = 10000; itemWithLeastDistance = null; - posProperty = this.containers[innermostIndex].floating ? "left" : "top"; - sizeProperty = this.containers[innermostIndex].floating ? "width" : "height"; + floating = innermostContainer.floating || isFloating(this.currentItem); + posProperty = floating ? "left" : "top"; + sizeProperty = floating ? "width" : "height"; base = this.positionAbs[posProperty] + this.offset.click[posProperty]; for (j = this.items.length - 1; j >= 0; j--) { if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) { @@ -855,6 +860,9 @@ $.widget("ui.sortable", $.ui.mouse, { if(this.items[j].item[0] === this.currentItem[0]) { continue; } + if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) { + continue; + } cur = this.items[j].item.offset()[posProperty]; nearBottom = false; if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ @@ -873,10 +881,14 @@ $.widget("ui.sortable", $.ui.mouse, { return; } - this.currentContainer = this.containers[innermostIndex]; + if(this.currentContainer === this.containers[innermostIndex]) { + return; + } + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); this._trigger("change", event, this._uiHash()); this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + this.currentContainer = this.containers[innermostIndex]; //Update the placeholder this.options.placeholder.update(this.currentContainer, this.placeholder); From 07ce771a13504b851bb9f74c8ce8e960d207384a Mon Sep 17 00:00:00 2001 From: John Chen Date: Sat, 16 Feb 2013 22:35:58 +0800 Subject: [PATCH 34/50] Sortable: Skip triggering over event if it's alreay over the continer. Fixes #9041: the over event fires on every pixel movement --- ui/jquery.ui.sortable.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 22acff7d116..0f9b113a4aa 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -842,8 +842,10 @@ $.widget("ui.sortable", $.ui.mouse, { // move the item into the container if it's not there already if(this.containers.length === 1) { - this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); - this.containers[innermostIndex].containerCache.over = 1; + if (!this.containers[innermostIndex].containerCache.over) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } } else { //When entering a new container, we will find the item with the least distance and append our item near it From 8b1b34c5c3e8fae056f0880776156dc003b5e2c3 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Fri, 8 Mar 2013 16:38:41 -0500 Subject: [PATCH 35/50] Sortable Tests: Add tests to support #9041 and #8792 --- tests/unit/sortable/sortable_events.js | 27 ++++++++++++++++-- tests/unit/sortable/sortable_options.js | 37 +++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/tests/unit/sortable/sortable_events.js b/tests/unit/sortable/sortable_events.js index 1b8165acba3..46a493b3e7d 100644 --- a/tests/unit/sortable/sortable_events.js +++ b/tests/unit/sortable/sortable_events.js @@ -231,11 +231,34 @@ test("receive", function() { 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( "over", function() { + expect( 8 ); + + var hash, + overCount = 0; + + $( "#sortable" ).sortable({ + over: function( e, ui ) { + hash = ui; + overCount++; + } + }).find( "li:eq(0)" ).simulate( "drag", { + 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 && ( "top" in hash.position && "left" in hash.position ), "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" ); + equal( overCount, 1, "over fires only once" ); }); +/* test("out", function() { ok(false, "missing test - untested code is broken code."); }); diff --git a/tests/unit/sortable/sortable_options.js b/tests/unit/sortable/sortable_options.js index caba0a7770d..63857316236 100644 --- a/tests/unit/sortable/sortable_options.js +++ b/tests/unit/sortable/sortable_options.js @@ -37,7 +37,44 @@ test("{ cancel: 'input,textarea,button,select,option' }, default", function() { test("{ cancel: Selector }", function() { ok(false, "missing test - untested code is broken code."); }); +*/ + +test( "#8792: issues with floated items in connected lists", function() { + expect( 2 ); + + var element, + changeCount = 0; + + $( "#qunit-fixture" ) + .html( "
          • a
          • a
          • a
          • a
          " ) + .find( "ul" ).css({ "float": "left", width: "100px" }).end() + .find( "li" ).css({ "float": "left", width: "50px", height: "50px" }); + + $( "#qunit-fixture .c" ).sortable({ + connectWith: "#qunit-fixture .c", + change: function() { + changeCount++; + } + }); + + element = $( "#qunit-fixture li:eq(0)" ); + element.simulate( "drag", { + dx: 51, + moves: 15 + }); + + equal( changeCount, 1, "change fired only once (no jitters) when dragging a floated sortable in it's own container" ); + + element.simulate( "drag", { + dx: 50, + moves: 15 + }); + + equal( changeCount, 3, "change fired once for each expected change when dragging a floated sortable to a connected container" ); +}); + +/* test("{ connectWith: false }, default", function() { ok(false, "missing test - untested code is broken code."); }); From 57051e8a7323e27fe159e5448b52666f1bdbc409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 9 Mar 2013 08:12:31 -0500 Subject: [PATCH 36/50] Draggable tests: Don't use .on(). --- tests/unit/draggable/draggable_test_helpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/draggable/draggable_test_helpers.js b/tests/unit/draggable/draggable_test_helpers.js index e1c79c6cc3f..44e37c55961 100644 --- a/tests/unit/draggable/draggable_test_helpers.js +++ b/tests/unit/draggable/draggable_test_helpers.js @@ -60,7 +60,7 @@ TestHelpers.draggable = { }, trackMouseCss : function( el ) { - el.on( "drag", function() { + el.bind( "drag", function() { el.data( "last_dragged_cursor", $("body").css("cursor") ); }); }, @@ -69,7 +69,7 @@ TestHelpers.draggable = { // appendTo ignored without being clone el.draggable( "option", "helper", "clone" ); - el.on( "drag", function(e,ui) { + el.bind( "drag", function(e,ui) { // Get what parent is at time of drag el.data( "last_dragged_parent", ui.helper.parent()[0] ); }); From 4f95a0f396965e91982f1b5e67da814bb6640ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 11 Mar 2013 11:57:21 -0400 Subject: [PATCH 37/50] CSS Framework: Add ui-icon-blank class for an icon with no image. Fixes #9150 - CSS Framework: Add ui-icon-blank. This essentially reverts 1fe06f03fac30ce76b87eab8c5a9acc72becd587 and the fix for #5659. --- themes/base/jquery.ui.theme.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base/jquery.ui.theme.css b/themes/base/jquery.ui.theme.css index c606011f058..fd586d90b0f 100644 --- a/themes/base/jquery.ui.theme.css +++ b/themes/base/jquery.ui.theme.css @@ -156,7 +156,6 @@ .ui-icon { width: 16px; height: 16px; - background-position: 16px 16px; } .ui-icon, .ui-widget-content .ui-icon { @@ -184,6 +183,7 @@ } /* positioning */ +.ui-icon-blank { background-position: 16px 16px; } .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } From 4d67f4f34908a50ef88f95df4103ee001b777e45 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Mon, 11 Mar 2013 21:28:51 -0400 Subject: [PATCH 38/50] Widget: Stop setting ui-state-disabled and aria by default on setting disabled option. Fixes #5973 - Resizable: disabled should not have the ui-state-disabled class or aria attribute aria-disabled Fixes #5974 - Draggable: disabled should not have the ui-state-disabled class or aria attribute aria-disabled Fixes #6039 - Droppable : disabled should not have ui-state-disabled --- tests/unit/accordion/accordion_methods.js | 7 +++- .../unit/autocomplete/autocomplete_options.js | 11 +++--- tests/unit/button/button_options.js | 29 +++++++++------ tests/unit/dialog/dialog_methods.js | 4 ++- tests/unit/draggable/draggable_methods.js | 14 +++++--- tests/unit/droppable/droppable_methods.js | 29 ++++++++------- tests/unit/progressbar/progressbar_methods.js | 10 ++++++ tests/unit/resizable/resizable_methods.js | 17 ++++++--- tests/unit/selectable/selectable_methods.js | 36 +++++++++++-------- tests/unit/slider/slider_methods.js | 3 +- tests/unit/sortable/sortable_methods.js | 35 +++++++++--------- tests/unit/spinner/spinner_methods.js | 4 ++- tests/unit/tabs/tabs_options.js | 18 +++++++++- tests/unit/tooltip/tooltip_methods.js | 7 +++- ui/jquery.ui.accordion.js | 3 ++ ui/jquery.ui.button.js | 10 ++---- ui/jquery.ui.droppable.js | 2 +- ui/jquery.ui.menu.js | 5 +++ ui/jquery.ui.progressbar.js | 6 +++- ui/jquery.ui.slider.js | 6 +++- ui/jquery.ui.sortable.js | 11 ------ ui/jquery.ui.spinner.js | 10 ++---- ui/jquery.ui.widget.js | 3 +- 23 files changed, 174 insertions(+), 106 deletions(-) diff --git a/tests/unit/accordion/accordion_methods.js b/tests/unit/accordion/accordion_methods.js index b1123b82847..7612479f7e3 100644 --- a/tests/unit/accordion/accordion_methods.js +++ b/tests/unit/accordion/accordion_methods.js @@ -14,10 +14,15 @@ test( "destroy", function() { }); test( "enable/disable", function() { - expect( 4 ); + expect( 7 ); var element = $( "#list1" ).accordion(); state( element, 1, 0, 0 ); element.accordion( "disable" ); + + ok( element.hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); + equal( element.attr( "aria-disabled" ), "true", "element gets aria-disabled" ); + ok( element.hasClass( "ui-accordion-disabled" ), "element gets ui-accordion-disabled" ); + // event does nothing element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "click" ); state( element, 1, 0, 0 ); diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js index 9f0bd2d43f2..c98f2c28e7c 100644 --- a/tests/unit/autocomplete/autocomplete_options.js +++ b/tests/unit/autocomplete/autocomplete_options.js @@ -88,17 +88,20 @@ asyncTest( "delay", function() { }); asyncTest( "disabled", function() { - expect( 2 ); + expect( 5 ); var element = $( "#autocomplete" ).autocomplete({ source: data, - delay: 0, - disabled: true + delay: 0 }), - menu = element.autocomplete( "widget" ); + menu = element.autocomplete( "disable" ).autocomplete( "widget" ); element.val( "ja" ).keydown(); ok( menu.is( ":hidden" ) ); + ok( !element.is( ".ui-state-disabled" ), "element doesn't get ui-state-disabled" ); + ok( !element.attr( "aria-disabled" ), "element doesn't get aria-disabled" ); + ok( menu.is( ".ui-autocomplete-disabled" ), "element gets ui-autocomplete-disabled" ); + setTimeout(function() { ok( menu.is( ":hidden" ) ); start(); diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js index e1931a54e9c..124a8699f6f 100644 --- a/tests/unit/button/button_options.js +++ b/tests/unit/button/button_options.js @@ -3,19 +3,26 @@ */ (function($) { -module("button: options"); +module( "button: options" ); -test("disabled, explicit value", function() { - expect( 4 ); - $("#radio01").button({ disabled: false }); - deepEqual(false, $("#radio01").button("option", "disabled"), - "disabled option set to false"); - deepEqual(false, $("#radio01").prop("disabled"), "element is disabled"); +test( "disabled, explicit value", function() { + expect( 9 ); - $("#radio02").button({ disabled: true }); - deepEqual(true, $("#radio02").button("option", "disabled"), - "disabled option set to true"); - deepEqual(true, $("#radio02").prop("disabled"), "element is not disabled"); + var element = $( "#radio01" ).button({ disabled: false }); + deepEqual( element.button( "option", "disabled" ), false, "disabled option set to false" ); + deepEqual( element.prop( "disabled" ), false, "element is disabled" ); + + ok( !element.button( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); + ok( !element.button( "widget" ).hasClass( "ui-button-disabled" ), "element gets ui-button-disabled" ); + + element = $( "#radio02" ).button({ disabled: true }); + + ok( element.button( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); + ok( !element.button( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.button( "widget" ).hasClass( "ui-button-disabled" ), "element gets ui-button-disabled" ); + + deepEqual( element.button( "option", "disabled" ), true, "disabled option set to true" ); + deepEqual( element.prop( "disabled" ), true, "element is not disabled" ); }); test("disabled, null", function() { diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index 6de18551373..2bb06ab465c 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -101,11 +101,13 @@ test("#4980: Destroy should place element back in original DOM position", functi }); test( "enable/disable disabled", function() { - expect( 2 ); + expect( 4 ); var element = $( "
          " ).dialog(); element.dialog( "disable" ); equal(element.dialog( "option", "disabled" ), false, "disable method doesn't do anything" ); ok( !element.dialog( "widget" ).hasClass( "ui-dialog-disabled" ), "disable method doesn't add ui-dialog-disabled class" ); + ok( !element.dialog( "widget" ).hasClass( "ui-state-disabled" ), "disable method doesn't add ui-state-disabled class" ); + ok( !element.dialog( "widget" ).attr( "aria-disabled" ), "disable method doesn't add aria-disabled" ); }); test("close", function() { diff --git a/tests/unit/draggable/draggable_methods.js b/tests/unit/draggable/draggable_methods.js index 901c261d6ed..63a19e26d17 100644 --- a/tests/unit/draggable/draggable_methods.js +++ b/tests/unit/draggable/draggable_methods.js @@ -74,16 +74,16 @@ test( "enable", function() { }); test( "disable", function() { - expect( 7 ); + expect( 10 ); - element = $("#draggable2").draggable({ disabled: false }); + element = $( "#draggable2" ).draggable({ disabled: false }); TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" ); - element.draggable("disable"); + element.draggable( "disable" ); TestHelpers.draggable.shouldNotMove( element, ".draggable('disable')" ); equal( element.draggable( "option", "disabled" ), true, "disabled option getter" ); - element.draggable("destroy"); + element.draggable( "destroy" ); element.draggable({ disabled: false }); TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" ); @@ -91,8 +91,12 @@ test( "disable", function() { equal( element.draggable( "option", "disabled" ), true, "disabled option setter" ); TestHelpers.draggable.shouldNotMove( element, ".draggable('option', 'disabled', true)" ); + ok( !element.draggable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); + ok( !element.draggable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.draggable( "widget" ).hasClass( "ui-draggable-disabled" ), "element gets ui-draggable-disabled" ); + var expected = element.draggable(), - actual = expected.draggable("disable"); + actual = expected.draggable( "disable" ); equal( actual, expected, "disable is chainable" ); }); diff --git a/tests/unit/droppable/droppable_methods.js b/tests/unit/droppable/droppable_methods.js index 2b452a63dfc..f7682d262e4 100644 --- a/tests/unit/droppable/droppable_methods.js +++ b/tests/unit/droppable/droppable_methods.js @@ -63,26 +63,29 @@ test("enable", function() { equal(actual, expected, "enable is chainable"); }); -test("disable", function() { - expect(7); +test( "disable", function() { + expect( 10 ); - var el, actual, expected; + var actual, expected, + element = $( "#droppable1" ).droppable({ disabled: false }); - el = $("#droppable1").droppable({ disabled: false }); TestHelpers.droppable.shouldDrop(); - el.droppable("disable"); + element.droppable( "disable" ); TestHelpers.droppable.shouldNotDrop(); - equal(el.droppable("option", "disabled"), true, "disabled option getter"); - el.droppable("destroy"); - el.droppable({ disabled: false }); + equal( element.droppable( "option", "disabled" ), true, "disabled option getter" ); + element.droppable( "destroy" ); + element.droppable({ disabled: false }); TestHelpers.droppable.shouldDrop(); - el.droppable("option", "disabled", true); - equal(el.droppable("option", "disabled"), true, "disabled option setter"); + element.droppable( "option", "disabled", true ); + ok( !element.droppable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); + ok( !element.droppable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.droppable( "widget" ).hasClass( "ui-droppable-disabled" ), "element gets ui-droppable-disabled" ); + equal( element.droppable( "option", "disabled" ), true, "disabled option setter" ); TestHelpers.droppable.shouldNotDrop(); - expected = $("
          ").droppable(), - actual = expected.droppable("disable"); - equal(actual, expected, "disable is chainable"); + expected = $( "
          " ).droppable(); + actual = expected.droppable( "disable" ); + equal( actual, expected, "disable is chainable" ); }); })(jQuery); diff --git a/tests/unit/progressbar/progressbar_methods.js b/tests/unit/progressbar/progressbar_methods.js index cf7faf6af81..004eacf90d2 100644 --- a/tests/unit/progressbar/progressbar_methods.js +++ b/tests/unit/progressbar/progressbar_methods.js @@ -7,6 +7,16 @@ test( "destroy", function() { }); }); +test( "disable", function() { + expect( 3 ); + + var element = $( "#progressbar" ).progressbar().progressbar( "disable" ); + + ok( element.progressbar( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); + ok( element.progressbar( "widget" ).attr( "aria-disabled" ), "element gets aria-disabled" ); + ok( element.progressbar( "widget" ).hasClass( "ui-progressbar-disabled" ), "element gets ui-progressbar-disabled" ); +}); + test( "value", function() { expect( 3 ); diff --git a/tests/unit/resizable/resizable_methods.js b/tests/unit/resizable/resizable_methods.js index b12f3035a2e..abb8951f930 100644 --- a/tests/unit/resizable/resizable_methods.js +++ b/tests/unit/resizable/resizable_methods.js @@ -3,10 +3,19 @@ */ (function($) { -module("resizable: methods"); +module( "resizable: methods" ); -// this is here to make JSHint pass "unused", and we don't want to -// remove the parameter for when we finally implement -$.noop(); +test( "disable", function() { + expect( 5 ); + + var element = $( "#resizable1" ).resizable({ disabled: false }), + chainable = element.resizable( "disable" ); + + ok( !element.resizable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); + ok( !element.resizable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.resizable( "widget" ).hasClass( "ui-resizable-disabled" ), "element gets ui-resizable-disabled" ); + equal( element.resizable( "option", "disabled" ), true, "disabled option setter" ); + equal( chainable, element, "disable is chainable" ); +}); })(jQuery); diff --git a/tests/unit/selectable/selectable_methods.js b/tests/unit/selectable/selectable_methods.js index 72f9bb28d73..179d4ecd6b6 100644 --- a/tests/unit/selectable/selectable_methods.js +++ b/tests/unit/selectable/selectable_methods.js @@ -71,34 +71,40 @@ test("enable", function() { equal(actual, expected, "enable is chainable"); }); -test("disable", function() { - expect(3); - var expected, actual, +test( "disable", function() { + expect( 6 ); + var chainable, fired = false, - el = $("#selectable1"); + element = $( "#selectable1" ); - el.selectable({ + element.selectable({ disabled: false, - start: function() { fired = true; } + start: function() { + fired = true; + } }); - el.simulate( "drag", { + element.simulate( "drag", { dx: 20, dy: 20 }); - equal(fired, true, "start fired"); - el.selectable("disable"); + equal( fired, true, "start fired" ); + + chainable = element.selectable( "disable" ); fired = false; - el.simulate( "drag", { + element.simulate( "drag", { dx: 20, dy: 20 }); - equal(fired, false, "start fired"); - el.selectable("destroy"); + equal( fired, false, "start fired" ); - expected = $("
          ").selectable(); - actual = expected.selectable("disable"); - equal(actual, expected, "disable is chainable"); + ok( !element.selectable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); + ok( !element.selectable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.selectable( "widget" ).hasClass( "ui-selectable-disabled" ), "element gets ui-selectable-disabled" ); + + element.selectable( "destroy" ); + + equal( chainable, element, "disable is chainable" ); }); })(jQuery); diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js index 75df230a646..bd902313396 100644 --- a/tests/unit/slider/slider_methods.js +++ b/tests/unit/slider/slider_methods.js @@ -49,7 +49,7 @@ test( "enable", function() { }); test( "disable", function() { - expect( 5 ); + expect( 6 ); var element, expected = $( "
          " ).slider(), actual = expected.slider( "disable" ); @@ -61,6 +61,7 @@ test( "disable", function() { element.slider( "disable" ); ok( element.hasClass( "ui-state-disabled" ), "slider has ui-state-disabled class after disable method call" ); ok( element.hasClass( "ui-slider-disabled" ), "slider has ui-slider-disabled class after disable method call" ); + ok( !element.attr( "aria-disabled" ), "slider does not have aria-disabled attr after disable method call" ); }); test( "value", function() { diff --git a/tests/unit/sortable/sortable_methods.js b/tests/unit/sortable/sortable_methods.js index 07a7bc77d63..f3fe240e701 100644 --- a/tests/unit/sortable/sortable_methods.js +++ b/tests/unit/sortable/sortable_methods.js @@ -64,29 +64,30 @@ test("enable", function() { equal(actual, expected, "enable is chainable"); }); -test("disable", function() { - expect(7); +test( "disable", function() { + expect( 9 ); - var el, actual, expected; + var chainable, + element = $( "#sortable" ).sortable({ disabled: false }); - el = $("#sortable").sortable({ disabled: false }); - TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })"); + TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" ); - el.sortable("disable"); - TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, "disabled.sortable getter"); + chainable = element.sortable( "disable" ); + TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 0, "disabled.sortable getter" ); - el.sortable("destroy"); + element.sortable( "destroy" ); - el.sortable({ disabled: false }); - TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })"); - el.sortable("option", "disabled", true); - equal(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"); - TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, ".sortable('option', 'disabled', true)"); + element.sortable({ disabled: false }); + TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" ); + element.sortable( "option", "disabled", true); + equal( element.sortable( "option", "disabled" ), true, "disabled option setter" ); - expected = $("
          ").sortable(), - actual = expected.sortable("disable"); - equal(actual, expected, "disable is chainable"); + ok( !element.sortable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); + ok( !element.sortable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); + ok( element.sortable( "widget" ).hasClass( "ui-sortable-disabled" ), "element gets ui-sortable-disabled" ); + + TestHelpers.sortable.sort($( "li", element )[ 0 ], 0, 44, 0, ".sortable('option', 'disabled', true)" ); + equal( chainable, element, "disable is chainable" ); }); })(jQuery); diff --git a/tests/unit/spinner/spinner_methods.js b/tests/unit/spinner/spinner_methods.js index af872f25763..4f44a73aef1 100644 --- a/tests/unit/spinner/spinner_methods.js +++ b/tests/unit/spinner/spinner_methods.js @@ -12,7 +12,7 @@ test( "destroy", function() { }); test( "disable", function() { - expect( 14 ); + expect( 16 ); var element = $( "#spin" ).val( 2 ).spinner(), wrapper = $( "#spin" ).spinner( "widget" ); @@ -21,6 +21,8 @@ test( "disable", function() { element.spinner( "disable" ); ok( wrapper.hasClass( "ui-spinner-disabled" ), "after: wrapper has ui-spinner-disabled class" ); + ok( wrapper.hasClass( "ui-state-disabled" ), "after: wrapper has ui-state-disabled class" ); + ok( !wrapper.attr( "aria-disabled" ), "after: wrapper does not have aria-disabled attr" ); ok( element.is( ":disabled"), "after: input has disabled attribute" ); simulateKeyDownUp( element, $.ui.keyCode.UP ); diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index c78c42b5810..02a2fea343e 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -144,24 +144,40 @@ test( "{ collapsible: true }", function() { }); test( "disabled", function() { - expect( 10 ); + expect( 22 ); // fully enabled by default var element = $( "#tabs1" ).tabs(); disabled( element, false ); + ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); + ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); + ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); + // disable single tab element.tabs( "option", "disabled", [ 1 ] ); disabled( element, [ 1 ] ); + ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); + ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); + ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); + // disabled active tab element.tabs( "option", "disabled", [ 0, 1 ] ); disabled( element, [ 0, 1 ] ); + ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); + ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); + ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); + // disable all tabs element.tabs( "option", "disabled", [ 0, 1, 2 ] ); disabled( element, true ); + ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); + ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); + ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); + // enable all tabs element.tabs( "option", "disabled", [] ); disabled( element, false ); diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index c846d216cd4..a557ff943a2 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -54,7 +54,7 @@ test( "open/close with tracking", function() { }); test( "enable/disable", function() { - expect( 7 ); + expect( 10 ); $.fx.off = true; var tooltip, element = $( "#tooltipped1" ).tooltip(); @@ -66,6 +66,11 @@ test( "enable/disable", function() { element.tooltip( "disable" ); equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" ); + + ok( !element.tooltip( "widget" ).hasClass( "ui-state-disabled" ), "element doesn't get ui-state-disabled" ); + ok( !element.tooltip( "widget" ).attr( "aria-disabled" ), "element doesn't get aria-disabled" ); + ok( !element.tooltip( "widget" ).hasClass( "ui-tooltip-disabled" ), "element doesn't get ui-tooltip-disabled" ); + // support: jQuery <1.6.2 // support: IE <8 // We should use strictEqual( ..., undefined ) when dropping jQuery 1.6.1 support (or IE6/7) diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 1afa95cb4b0..da0d5751c44 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -161,6 +161,9 @@ $.widget( "ui.accordion", { // #5332 - opacity doesn't cascade to positioned elements in IE // so we need to add the disabled class to the headers and panels if ( key === "disabled" ) { + this.element + .toggleClass( "ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); this.headers.add( this.headers.next() ) .toggleClass( "ui-state-disabled", !!value ); } diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index fcb7b14d187..5e64f5164c9 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -207,9 +207,6 @@ $.widget( "ui.button", { } } - // TODO: pull out $.Widget's handling for the disabled option into - // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can - // be overridden by individual plugins this._setOption( "disabled", options.disabled ); this._resetButton(); }, @@ -273,11 +270,8 @@ $.widget( "ui.button", { _setOption: function( key, value ) { this._super( key, value ); if ( key === "disabled" ) { - if ( value ) { - this.element.prop( "disabled", true ); - } else { - this.element.prop( "disabled", false ); - } + this.widget().toggleClass( "ui-state-disabled", !!value ); + this.element.prop( "disabled", !!value ); return; } this._resetButton(); diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 552b24a5850..34342d33d42 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -82,7 +82,7 @@ $.widget("ui.droppable", { return d.is(value); }; } - $.Widget.prototype._setOption.apply(this, arguments); + this._super( key, value ); }, _activate: function(event) { diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index 1c633786d9a..bdef9324804 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -350,6 +350,11 @@ $.widget( "ui.menu", { .removeClass( this.options.icons.submenu ) .addClass( value.submenu ); } + if ( key === "disabled" ) { + this.element + .toggleClass( "ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); + } this._super( key, value ); }, diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js index 9e959ebc4cb..0eaa8b41ec6 100644 --- a/ui/jquery.ui.progressbar.js +++ b/ui/jquery.ui.progressbar.js @@ -97,7 +97,11 @@ $.widget( "ui.progressbar", { // Don't allow a max less than min value = Math.max( this.min, value ); } - + if ( key === "disabled" ) { + this.element + .toggleClass( "ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); + } this._super( key, value ); }, diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index b3e609aa234..88281240dcb 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -427,7 +427,11 @@ $.widget( "ui.slider", $.ui.mouse, { valsLength = this.options.values.length; } - $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "disabled" ) { + this.element.toggleClass( "ui-state-disabled", !!value ); + } + + this._super( key, value ); switch ( key ) { case "orientation": diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 0f9b113a4aa..99bc23bdb93 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -102,17 +102,6 @@ $.widget("ui.sortable", $.ui.mouse, { return this; }, - _setOption: function(key, value){ - if ( key === "disabled" ) { - this.options[ key ] = value; - - this.widget().toggleClass( "ui-sortable-disabled", !!value ); - } else { - // Don't call widget base _setOption for disable as it adds ui-state-disabled class - $.Widget.prototype._setOption.apply(this, arguments); - } - }, - _mouseCapture: function(event, overrideHandle) { var currentItem = null, validHandle = false, diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index 644b652395a..c022413dc24 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -381,13 +381,9 @@ $.widget( "ui.spinner", { this._super( key, value ); if ( key === "disabled" ) { - if ( value ) { - this.element.prop( "disabled", true ); - this.buttons.button( "disable" ); - } else { - this.element.prop( "disabled", false ); - this.buttons.button( "enable" ); - } + this.widget().toggleClass( "ui-state-disabled", !!value ); + this.element.prop( "disabled", !!value ); + this.buttons.button( value ? "disable" : "enable" ); } }, diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index c581e4b8156..adc4b9da1bf 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -345,8 +345,7 @@ $.Widget.prototype = { if ( key === "disabled" ) { this.widget() - .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value ) - .attr( "aria-disabled", value ); + .toggleClass( this.widgetFullName + "-disabled", !!value ); this.hoverable.removeClass( "ui-state-hover" ); this.focusable.removeClass( "ui-state-focus" ); } From f87b4e0f4ac2342dff260c32aa8d08148e76f7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Fri, 21 Dec 2012 18:26:56 +0100 Subject: [PATCH 39/50] Build: Migrate to grunt 0.4. Rename to Gruntfile, upgrade to newer grunt-css and grunt-html, update custom tasks. Drop qunit-junit plugin, not worth the trouble. Update release script to run grunt-prepare after npm-install. --- grunt.js => Gruntfile.js | 192 +++++++++++++++++++++++---------------- build/release/release.js | 3 + build/tasks/build.js | 52 +++++------ package.json | 17 ++-- 4 files changed, 153 insertions(+), 111 deletions(-) rename grunt.js => Gruntfile.js (68%) diff --git a/grunt.js b/Gruntfile.js similarity index 68% rename from grunt.js rename to Gruntfile.js index d599496cc29..06a1855a4c4 100644 --- a/grunt.js +++ b/Gruntfile.js @@ -18,11 +18,11 @@ var uiFiles = coreFiles.map(function( file ) { return "ui/" + file; - }).concat( grunt.file.expandFiles( "ui/*.js" ).filter(function( file ) { + }).concat( expandFiles( "ui/*.js" ).filter(function( file ) { return coreFiles.indexOf( file.substring(3) ) === -1; })), - allI18nFiles = grunt.file.expandFiles( "ui/i18n/*.js" ), + allI18nFiles = expandFiles( "ui/i18n/*.js" ), cssFiles = [ "core", @@ -46,16 +46,42 @@ var // minified files minify = { - "dist/jquery-ui.min.js": [ "", "dist/jquery-ui.js" ], - "dist/i18n/jquery-ui-i18n.min.js": [ "", "dist/i18n/jquery-ui-i18n.js" ] + options: { + preserveComments: false + }, + main: { + options: { + banner: createBanner( uiFiles ) + }, + files: { + "dist/jquery-ui.min.js": "dist/jquery-ui.js" + } + }, + i18n: { + options: { + banner: createBanner( allI18nFiles ) + }, + files: { + "dist/i18n/jquery-ui-i18n.min.js": "dist/i18n/jquery-ui-i18n.js" + } + } }, minifyCSS = { - "dist/jquery-ui.min.css": "dist/jquery-ui.css" + options: { + keepSpecialComments: 0 + }, + main: { + options: { + keepSpecialComments: '*' + }, + src: "dist/jquery-ui.css", + dest: "dist/jquery-ui.min.css" + } }, compareFiles = { - all: [ + files: [ "dist/jquery-ui.js", "dist/jquery-ui.min.js" ] @@ -65,85 +91,102 @@ function mapMinFile( file ) { return "dist/" + file.replace( /\.js$/, ".min.js" ).replace( /ui\//, "minified/" ); } +function expandFiles( files ) { + return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).map(function( values ) { + return values[ 0 ]; + }); +} + uiFiles.concat( allI18nFiles ).forEach(function( file ) { - minify[ mapMinFile( file ) ] = [ "", file ]; + minify[ file ] = { + options: { + banner: createBanner() + }, + files: {} + }; + minify[ file ].files[ mapMinFile( file ) ] = file; }); cssFiles.forEach(function( file ) { - minifyCSS[ "dist/" + file.replace( /\.css$/, ".min.css" ).replace( /themes\/base\//, "themes/base/minified/" ) ] = [ "", "" ]; + minifyCSS[ file ] = { + options: { + banner: createBanner() + }, + src: file, + dest: "dist/" + file.replace( /\.css$/, ".min.css" ).replace( /themes\/base\//, "themes/base/minified/" ) + }; }); uiFiles.forEach(function( file ) { + // TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13 compareFiles[ file ] = [ file, mapMinFile( file ) ]; }); // grunt plugins +grunt.loadNpmTasks( "grunt-contrib-jshint" ); +grunt.loadNpmTasks( "grunt-contrib-uglify" ); +grunt.loadNpmTasks( "grunt-contrib-concat" ); +grunt.loadNpmTasks( "grunt-contrib-qunit" ); grunt.loadNpmTasks( "grunt-css" ); grunt.loadNpmTasks( "grunt-html" ); grunt.loadNpmTasks( "grunt-compare-size" ); -grunt.loadNpmTasks( "grunt-junit" ); grunt.loadNpmTasks( "grunt-git-authors" ); // local testswarm and build tasks grunt.loadTasks( "build/tasks" ); -grunt.registerHelper( "strip_all_banners", function( filepath ) { - return grunt.file.read( filepath ).replace( /^\s*\/\*[\s\S]*?\*\/\s*/g, "" ); -}); - -function stripBanner( files ) { - return files.map(function( file ) { - return ""; - }); -} - function stripDirectory( file ) { - // TODO: we're receiving the directive, so we need to strip the trailing > - // we should be receving a clean path without the directive return file.replace( /.+\/(.+?)>?$/, "$1" ); } -// allow access from banner template -global.stripDirectory = stripDirectory; function createBanner( files ) { // strip folders var fileNames = files && files.map( stripDirectory ); return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " + "<%= grunt.template.today('isoDate') %>\n" + - "<%= pkg.homepage ? '* ' + pkg.homepage + '\n' : '' %>" + - "* Includes: " + (files ? fileNames.join(", ") : "<%= stripDirectory(grunt.task.current.file.src[1]) %>") + "\n" + + "<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" + + (files ? "* Includes: " + fileNames.join(", ") + "\n" : "")+ "* Copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" + - " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */"; + " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n"; } grunt.initConfig({ - pkg: "", + pkg: grunt.file.readJSON("package.json"), files: { dist: "<%= pkg.name %>-<%= pkg.version %>", cdn: "<%= pkg.name %>-<%= pkg.version %>-cdn", themes: "<%= pkg.name %>-themes-<%= pkg.version %>" }, - meta: { - banner: createBanner(), - bannerAll: createBanner( uiFiles ), - bannerI18n: createBanner( allI18nFiles ), - bannerCSS: createBanner( cssFiles ) - }, compare_size: compareFiles, concat: { ui: { - src: [ "", stripBanner( uiFiles ) ], + options: { + banner: createBanner( uiFiles ), + stripBanners: { + block: true + } + }, + src: uiFiles, dest: "dist/jquery-ui.js" }, i18n: { - src: [ "", allI18nFiles ], + options: { + banner: createBanner( allI18nFiles ) + }, + src: allI18nFiles, dest: "dist/i18n/jquery-ui-i18n.js" }, css: { - src: [ "", stripBanner( cssFiles ) ], + options: { + banner: createBanner( cssFiles ), + stripBanners: { + block: true + } + }, + src: cssFiles, dest: "dist/jquery-ui.css" } }, - min: minify, + uglify: minify, cssmin: minifyCSS, htmllint: { // ignore files that contain invalid html, used only for ajax content testing @@ -158,7 +201,7 @@ grunt.initConfig({ "jquery-*.js", "MIT-LICENSE.txt", "README.md", - "grunt.js", + "Gruntfile.js", "package.json", "*.jquery.json", "ui/**/*", @@ -278,22 +321,43 @@ grunt.initConfig({ } }, qunit: { - files: grunt.file.expandFiles( "tests/unit/**/*.html" ).filter(function( file ) { + files: expandFiles( "tests/unit/**/*.html" ).filter(function( file ) { // disabling everything that doesn't (quite) work with PhantomJS for now // TODO except for all|index|test, try to include more as we go return !( /(all|index|test|dialog|dialog_deprecated|tabs|tooltip)\.html$/ ).test( file ); }) }, - lint: { - ui: "ui/*.js", - grunt: [ "grunt.js", "build/**/*.js" ], - tests: "tests/unit/**/*.js" + jshint: { + ui: { + options: { + jshintrc: "ui/.jshintrc" + }, + files: { + src: "ui/*.js" + } + }, + grunt: { + options: { + jshintrc: ".jshintrc" + }, + files: { + src: [ "Gruntfile.js", "build/**/*.js" ] + } + }, + tests: { + options: { + jshintrc: "tests/.jshintrc" + }, + files: { + src: "tests/unit/**/*.js" + } + } }, csslint: { // nothing: [] // TODO figure out what to check for, then fix and enable base_theme: { - src: grunt.file.expandFiles( "themes/base/*.css" ).filter(function( file ) { + src: expandFiles( "themes/base/*.css" ).filter(function( file ) { // TODO remove items from this list once rewritten return !( /(button|datepicker|core|dialog|theme)\.css$/ ).test( file ); }), @@ -307,39 +371,15 @@ grunt.initConfig({ "compatible-vendor-prefixes": false } } - }, - jshint: (function() { - function parserc( path ) { - var rc = grunt.file.readJSON( (path || "") + ".jshintrc" ), - settings = { - options: rc, - globals: {} - }; - - (rc.predef || []).forEach(function( prop ) { - settings.globals[ prop ] = true; - }); - delete rc.predef; - - return settings; - } - - return { - grunt: parserc(), - ui: parserc( "ui/" ), - // TODO: `evil: true` is only for document.write() https://github.com/jshint/jshint/issues/519 - // TODO: don't create so many globals in tests - tests: parserc( "tests/" ) - }; - })() + } }); -grunt.registerTask( "default", "lint csslint htmllint qunit" ); -grunt.registerTask( "sizer", "concat:ui min:dist/jquery-ui.min.js compare_size:all" ); -grunt.registerTask( "sizer_all", "concat:ui min compare_size" ); -grunt.registerTask( "build", "concat min cssmin copy:dist_units_images" ); -grunt.registerTask( "release", "clean build copy:dist copy:dist_min copy:dist_min_images copy:dist_css_min md5:dist zip:dist" ); -grunt.registerTask( "release_themes", "release generate_themes copy:themes md5:themes zip:themes" ); -grunt.registerTask( "release_cdn", "release_themes copy:cdn copy:cdn_min copy:cdn_i18n copy:cdn_i18n_min copy:cdn_min_images copy:cdn_themes md5:cdn zip:cdn" ); +grunt.registerTask( "default", [ "jshint", "csslint", "htmllint", "qunit" ] ); +grunt.registerTask( "sizer", [ "concat:ui", "uglify:main", "compare_size:all" ] ); +grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ] ); +grunt.registerTask( "build", [ "concat", "uglify", "cssmin", "copy:dist_units_images" ] ); +grunt.registerTask( "release", "clean build copy:dist copy:dist_min copy:dist_min_images copy:dist_css_min md5:dist zip:dist".split( " " ) ); +grunt.registerTask( "release_themes", "release generate_themes copy:themes md5:themes zip:themes".split( " " ) ); +grunt.registerTask( "release_cdn", "release_themes copy:cdn copy:cdn_min copy:cdn_i18n copy:cdn_i18n_min copy:cdn_min_images copy:cdn_themes md5:cdn zip:cdn".split( " " ) ); }; diff --git a/build/release/release.js b/build/release/release.js index 2eab5283fa9..6a387494b44 100644 --- a/build/release/release.js +++ b/build/release/release.js @@ -72,6 +72,9 @@ function cloneRepo() { if ( exec( "npm install download.jqueryui.com" ).code !== 0 ) { abort( "Error installing dependencies." ); } + if ( exec( "cd node_modules/download.jqueryui.com && grunt prepare" ).code !== 0 ) { + abort( "Error installing dependencies." ); + } } echo(); } diff --git a/build/tasks/build.js b/build/tasks/build.js index a8f25f98fbf..978bee0048b 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -5,6 +5,19 @@ module.exports = function( grunt ) { var path = require( "path" ), fs = require( "fs" ); +function expandFiles( files ) { + return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).filter(function(filepath) { + // restrict to files, exclude folders + try { + return fs.statSync( filepath[ 0 ] ).isFile(); + } catch(e) { + throw grunt.task.taskError(e.message, e); + } + }).map(function( values ) { + return values[ 0 ]; + }); +} + grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() { var pkg = grunt.config( "pkg" ), base = { @@ -97,8 +110,8 @@ grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @ grunt.file.copy( src, dest ); } } - var files = grunt.file.expandFiles( this.file.src ), - target = this.file.dest + "/", + var files = expandFiles( this.filesSrc ), + target = this.data.dest + "/", strip = this.data.strip, renameCount = 0, fileName; @@ -121,28 +134,11 @@ grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @ grunt.registerMultiTask( "zip", "Create a zip file for release", function() { - // TODO switch back to adm-zip for better cross-platform compability once it actually works - // 0.1.3 works, but result can't be unzipped - // its also a lot slower then zip program, probably due to how its used... - // var files = grunt.file.expandFiles( "dist/" + this.file.src + "/**/*" ); - // grunt.log.writeln( "Creating zip file " + this.file.dest ); - - //var AdmZip = require( "adm-zip" ); - //var zip = new AdmZip(); - //files.forEach(function( file ) { - // grunt.verbose.writeln( "Zipping " + file ); - // // rewrite file names from dist folder (created by build), drop the /dist part - // zip.addFile(file.replace(/^dist/, "" ), fs.readFileSync( file ) ); - //}); - //zip.writeZip( "dist/" + this.file.dest ); - //grunt.log.writeln( "Wrote " + files.length + " files to " + this.file.dest ); - var done = this.async(), - dest = this.file.dest, - src = grunt.template.process( this.file.src, grunt.config() ); - grunt.utils.spawn({ + dest = this.data.dest; + grunt.util.spawn({ cmd: "zip", - args: [ "-r", dest, src ], + args: [ "-r", dest, this.data.src ], opts: { cwd: 'dist' } @@ -159,19 +155,19 @@ grunt.registerMultiTask( "zip", "Create a zip file for release", function() { grunt.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", function() { // remove dest file before creating it, to make sure itself is not included - if ( fs.existsSync( this.file.dest ) ) { - fs.unlinkSync( this.file.dest ); + if ( fs.existsSync( this.data.dest ) ) { + fs.unlinkSync( this.data.dest ); } var crypto = require( "crypto" ), - dir = this.file.src + "/", + dir = this.filesSrc + "/", hashes = []; - grunt.file.expandFiles( dir + "**/*" ).forEach(function( fileName ) { + expandFiles( dir + "**/*" ).forEach(function( fileName ) { var hash = crypto.createHash( "md5" ); hash.update( grunt.file.read( fileName, "ascii" ) ); hashes.push( fileName.replace( dir, "" ) + " " + hash.digest( "hex" ) ); }); - grunt.file.write( this.file.dest, hashes.join( "\n" ) + "\n" ); - grunt.log.writeln( "Wrote " + this.file.dest + " with " + hashes.length + " hashes" ); + grunt.file.write( this.data.dest, hashes.join( "\n" ) + "\n" ); + grunt.log.writeln( "Wrote " + this.data.dest + " with " + hashes.length + " hashes" ); }); grunt.registerTask( "generate_themes", function() { diff --git a/package.json b/package.json index ae8b13dc802..89667bf34d4 100644 --- a/package.json +++ b/package.json @@ -53,13 +53,16 @@ ], "dependencies": {}, "devDependencies": { - "grunt": "~0.3.17", - "grunt-css": "0.2.0", - "grunt-compare-size": "0.1.4", - "grunt-html": "0.1.1", - "grunt-junit": "0.1.5", - "grunt-git-authors": "1.0.0", - "rimraf": "2.0.1", + "grunt": "0.4.0", + "grunt-contrib-jshint": "0.1.1", + "grunt-contrib-uglify": "0.1.1", + "grunt-contrib-concat": "0.1.3", + "grunt-contrib-qunit": "0.1.1", + "grunt-css": "0.5.4", + "grunt-compare-size": "0.3.1", + "grunt-html": "0.3.3", + "grunt-git-authors": "1.1.0", + "rimraf": "2.1.4", "testswarm": "1.0.0-alpha" }, "keywords": [] From bd211df0d35d7f326c338ce3f3fc81e5d966d3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Mon, 11 Mar 2013 15:29:08 +0100 Subject: [PATCH 40/50] Build: Switch from grunt-css to the equivalent grunt-contrib tasks --- Gruntfile.js | 6 +++--- package.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 06a1855a4c4..96a93ded0c9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -127,7 +127,8 @@ grunt.loadNpmTasks( "grunt-contrib-jshint" ); grunt.loadNpmTasks( "grunt-contrib-uglify" ); grunt.loadNpmTasks( "grunt-contrib-concat" ); grunt.loadNpmTasks( "grunt-contrib-qunit" ); -grunt.loadNpmTasks( "grunt-css" ); +grunt.loadNpmTasks( "grunt-contrib-csslint" ); +grunt.loadNpmTasks( "grunt-contrib-cssmin" ); grunt.loadNpmTasks( "grunt-html" ); grunt.loadNpmTasks( "grunt-compare-size" ); grunt.loadNpmTasks( "grunt-git-authors" ); @@ -354,7 +355,6 @@ grunt.initConfig({ } }, csslint: { - // nothing: [] // TODO figure out what to check for, then fix and enable base_theme: { src: expandFiles( "themes/base/*.css" ).filter(function( file ) { @@ -362,7 +362,7 @@ grunt.initConfig({ return !( /(button|datepicker|core|dialog|theme)\.css$/ ).test( file ); }), // TODO consider reenabling some of these rules - rules: { + options: { "adjoining-classes": false, "import": false, "outline-none": false, diff --git a/package.json b/package.json index 89667bf34d4..019e715bd50 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,8 @@ "grunt-contrib-uglify": "0.1.1", "grunt-contrib-concat": "0.1.3", "grunt-contrib-qunit": "0.1.1", - "grunt-css": "0.5.4", + "grunt-contrib-csslint": "0.1.0", + "grunt-contrib-cssmin": "0.4.2", "grunt-compare-size": "0.3.1", "grunt-html": "0.3.3", "grunt-git-authors": "1.1.0", From ae3af7f0700ae035183a4f9d9a8c6752189abbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Tue, 12 Mar 2013 11:00:21 +0100 Subject: [PATCH 41/50] Build: Don't call DB's grunt-prepare task, not needed anymore --- build/release/release.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/release/release.js b/build/release/release.js index 6a387494b44..2eab5283fa9 100644 --- a/build/release/release.js +++ b/build/release/release.js @@ -72,9 +72,6 @@ function cloneRepo() { if ( exec( "npm install download.jqueryui.com" ).code !== 0 ) { abort( "Error installing dependencies." ); } - if ( exec( "cd node_modules/download.jqueryui.com && grunt prepare" ).code !== 0 ) { - abort( "Error installing dependencies." ); - } } echo(); } From e090a3655550c9cd20067952809f44b052064f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Tue, 12 Mar 2013 13:53:18 +0100 Subject: [PATCH 42/50] Build: Update to grunt-contrib-qunit 0.2.0 to get latest PhantomJS --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 019e715bd50..b30f98eafa8 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "grunt-contrib-jshint": "0.1.1", "grunt-contrib-uglify": "0.1.1", "grunt-contrib-concat": "0.1.3", - "grunt-contrib-qunit": "0.1.1", + "grunt-contrib-qunit": "0.2.0", "grunt-contrib-csslint": "0.1.0", "grunt-contrib-cssmin": "0.4.2", "grunt-compare-size": "0.3.1", From 1dc5252de4147d392022b2481072316725cbae7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Tue, 12 Mar 2013 14:53:18 +0100 Subject: [PATCH 43/50] Build: Fix the key for the 'all' subtask for compare_size. Stills needs a new version of grunt-compare-size to actuall work --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 96a93ded0c9..57dcde8aba2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -81,7 +81,7 @@ var }, compareFiles = { - files: [ + all: [ "dist/jquery-ui.js", "dist/jquery-ui.min.js" ] From b280b8587e670036e1f8721e9ca3710ebad9d69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 12 Mar 2013 14:55:08 -0400 Subject: [PATCH 44/50] Upgrade to grunt-git-authors 1.2.0. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b30f98eafa8..143b37cae99 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "grunt-contrib-cssmin": "0.4.2", "grunt-compare-size": "0.3.1", "grunt-html": "0.3.3", - "grunt-git-authors": "1.1.0", + "grunt-git-authors": "1.2.0", "rimraf": "2.1.4", "testswarm": "1.0.0-alpha" }, From 787d512786db9bd05026ed09b034de6e544c483d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 12 Mar 2013 14:55:33 -0400 Subject: [PATCH 45/50] Updated AUTHORS.txt. --- AUTHORS.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AUTHORS.txt b/AUTHORS.txt index 2a7a396c8de..35267040db9 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -236,3 +236,7 @@ Thomas Jaggi Vahid Sohrabloo Travis Carden Bruno M. Custódio +Nathanael Silverman +Christian Wenz +Steve Urmston +Zaven Muradyan From 5dca601bc6b396f2d722be1ab817126aa7e8a58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Wed, 13 Mar 2013 09:59:20 -0400 Subject: [PATCH 46/50] Updated mailmap. --- .mailmap | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++-- AUTHORS.txt | 4 +-- 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/.mailmap b/.mailmap index e130cc4bb71..f83fbe970ed 100644 --- a/.mailmap +++ b/.mailmap @@ -1,6 +1,90 @@ +Aaron Peterson +Adam Baratz +Adam Sontag +Alexander Polomoshnov +Aliaksandr Rahalevich +Andrew Couch +Andrew Newcomb +Andrew Powell +Andrey Kapitcyn +Ben Hollis +Benjamin Scott Boyle +Bert ter Heide +Chairat Sunthornwiphat +Corey Frang +Courtland Allen +Dan Streetman +Diego Tres +Dominique Vincent +Doug Blood +Douglas Cerna +Douglas Neiner +Douglas Neiner +Dylan Just +Eddie Monge +Edward A Faulkner +Eric Hynds +Ethan Romba +EungJun Yi +Eyal Kobrigo +Filippo Cavallarin +Florian Gutmann +Genie <386@mail.com> +Guntupalli Karunakar +Hiroshi Tomita +Ian Simpson +Igor Milla +Israel Tsadok +Jacek Jędrzejewski +Jamie Gegerson +Jay Merrifield +John Enters +Jonathan Vingiano +Josh Varner +Justin Domnitz +Justin MacCarthy +Jörn Zaefferer +Karl Kirch +Kevin Dalman +Klaus Hartl carhartl Kris Borchers Kris Borchers -Corey Frang +Krzysztof Rosiński +Lev Kitsis Maggie Costello Wachs maggiewachs +Marc Neuwirth +Marcos Sousa +Martin Frost +Mathias Stenbom +Matthew Edward Hutton +Max Schnur +Michael Hollis +Michael Stay +Michael Wu +Mike Alsup +Milan Broum +Mohamed Cherif Bouchelaghem +Paul Irish +Pavol Hluchý +Peter Heiberg +Petr Hromadko +Phillip Barnes +Pierre-Henri Ausseil +Raymond Schwartz Richard Worth -Jörn Zaefferer +Rick Waldron +Ryan Neufeld +Ryan Olton +Saji Nediyanchath Saji +Sebastian Sauer +Sergey Kartashov +Shahyar Ghobadpour +Shane Whittet +Shannon Pekary +Simon Sattes +Stojce Slavkovski +Tarafder Ashek-E-Elahi +Thibault Duplessis +Ting Kuei +Wesley Walser +Xavi Ramirez diff --git a/AUTHORS.txt b/AUTHORS.txt index 35267040db9..756e9daa571 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -168,7 +168,7 @@ Genie <386@mail.com> Rick Waldron Ian Simpson Lev Kitsis -Ted VanToll +TJ VanToll Justin Domnitz Douglas Cerna Bert ter Heide @@ -216,8 +216,8 @@ Marc-Andre Lafortune Nate Eagle David Souther Mathias Stenbom -Avinash R Sergey Kartashov +Avinash R Ethan Romba Cory Gackenheimer Juan Pablo Kaniefsky From 054449e214449ec5578fe71bb67b9a670adac828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 12 Mar 2013 22:44:43 -0400 Subject: [PATCH 47/50] Sortable: Only animate along the specified axis when reverting. Fixes #7415 - Sortable: Incorrect revert animation with axis: 'y'. --- ui/jquery.ui.sortable.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 99bc23bdb93..642d5d9479c 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -417,14 +417,18 @@ $.widget("ui.sortable", $.ui.mouse, { if(this.options.revert) { var that = this, - cur = this.placeholder.offset(); + cur = this.placeholder.offset(), + axis = this.options.axis, + animation = {}; + if ( !axis || axis === "x" ) { + animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft); + } + if ( !axis || axis === "y" ) { + animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop); + } this.reverting = true; - - $(this.helper).animate({ - left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft), - top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop) - }, parseInt(this.options.revert, 10) || 500, function() { + $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() { that._clear(event); }); } else { From 38fce3f30478bcfce8ea837d850f63b5560d605a Mon Sep 17 00:00:00 2001 From: Rafael Xavier de Souza Date: Thu, 14 Mar 2013 15:33:29 -0300 Subject: [PATCH 48/50] Grunt: remove base theme from release cdn --- Gruntfile.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 57dcde8aba2..ff64f0c0da4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -253,9 +253,7 @@ grunt.initConfig({ "dist/jquery-ui.js": "jquery-ui.js", "dist/jquery-ui.min.js": "jquery-ui.min.js", "dist/i18n/jquery-ui-i18n.js": "i18n/jquery-ui-i18n.js", - "dist/i18n/jquery-ui-i18n.min.js": "i18n/jquery-ui-i18n.min.js", - "dist/jquery-ui.css": "themes/base/jquery-ui.css", - "dist/jquery-ui.min.css": "themes/base/minified/jquery-ui.min.css" + "dist/i18n/jquery-ui-i18n.min.js": "i18n/jquery-ui-i18n.min.js" }, dest: "dist/<%= files.cdn %>" }, @@ -274,11 +272,6 @@ grunt.initConfig({ strip: /^dist\/minified/, dest: "dist/<%= files.cdn %>/ui" }, - cdn_min_images: { - src: "themes/base/images/*", - strip: /^themes\/base\//, - dest: "dist/<%= files.cdn %>/themes/base/minified" - }, cdn_themes: { src: "dist/<%= files.themes %>/themes/**/*", strip: "dist/<%= files.themes %>", @@ -380,6 +373,6 @@ grunt.registerTask( "sizer_all", [ "concat:ui", "uglify", "compare_size" ] ); grunt.registerTask( "build", [ "concat", "uglify", "cssmin", "copy:dist_units_images" ] ); grunt.registerTask( "release", "clean build copy:dist copy:dist_min copy:dist_min_images copy:dist_css_min md5:dist zip:dist".split( " " ) ); grunt.registerTask( "release_themes", "release generate_themes copy:themes md5:themes zip:themes".split( " " ) ); -grunt.registerTask( "release_cdn", "release_themes copy:cdn copy:cdn_min copy:cdn_i18n copy:cdn_i18n_min copy:cdn_min_images copy:cdn_themes md5:cdn zip:cdn".split( " " ) ); +grunt.registerTask( "release_cdn", "release_themes copy:cdn copy:cdn_min copy:cdn_i18n copy:cdn_i18n_min copy:cdn_themes md5:cdn zip:cdn".split( " " ) ); }; From 23771d38ba9d2663f6db0243c8e992dc7ff6844a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 14 Mar 2013 15:07:06 -0400 Subject: [PATCH 49/50] Revert "Widget: Stop setting ui-state-disabled and aria by default on setting disabled option." This needs to wait for a major release. This reverts commit 4d67f4f34908a50ef88f95df4103ee001b777e45. --- tests/unit/accordion/accordion_methods.js | 7 +--- .../unit/autocomplete/autocomplete_options.js | 11 +++--- tests/unit/button/button_options.js | 29 ++++++--------- tests/unit/dialog/dialog_methods.js | 4 +-- tests/unit/draggable/draggable_methods.js | 14 +++----- tests/unit/droppable/droppable_methods.js | 29 +++++++-------- tests/unit/progressbar/progressbar_methods.js | 10 ------ tests/unit/resizable/resizable_methods.js | 17 +++------ tests/unit/selectable/selectable_methods.js | 36 ++++++++----------- tests/unit/slider/slider_methods.js | 3 +- tests/unit/sortable/sortable_methods.js | 35 +++++++++--------- tests/unit/spinner/spinner_methods.js | 4 +-- tests/unit/tabs/tabs_options.js | 18 +--------- tests/unit/tooltip/tooltip_methods.js | 7 +--- ui/jquery.ui.accordion.js | 3 -- ui/jquery.ui.button.js | 10 ++++-- ui/jquery.ui.droppable.js | 2 +- ui/jquery.ui.menu.js | 5 --- ui/jquery.ui.progressbar.js | 6 +--- ui/jquery.ui.slider.js | 6 +--- ui/jquery.ui.sortable.js | 11 ++++++ ui/jquery.ui.spinner.js | 10 ++++-- ui/jquery.ui.widget.js | 3 +- 23 files changed, 106 insertions(+), 174 deletions(-) diff --git a/tests/unit/accordion/accordion_methods.js b/tests/unit/accordion/accordion_methods.js index 7612479f7e3..b1123b82847 100644 --- a/tests/unit/accordion/accordion_methods.js +++ b/tests/unit/accordion/accordion_methods.js @@ -14,15 +14,10 @@ test( "destroy", function() { }); test( "enable/disable", function() { - expect( 7 ); + expect( 4 ); var element = $( "#list1" ).accordion(); state( element, 1, 0, 0 ); element.accordion( "disable" ); - - ok( element.hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); - equal( element.attr( "aria-disabled" ), "true", "element gets aria-disabled" ); - ok( element.hasClass( "ui-accordion-disabled" ), "element gets ui-accordion-disabled" ); - // event does nothing element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "click" ); state( element, 1, 0, 0 ); diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js index c98f2c28e7c..9f0bd2d43f2 100644 --- a/tests/unit/autocomplete/autocomplete_options.js +++ b/tests/unit/autocomplete/autocomplete_options.js @@ -88,20 +88,17 @@ asyncTest( "delay", function() { }); asyncTest( "disabled", function() { - expect( 5 ); + expect( 2 ); var element = $( "#autocomplete" ).autocomplete({ source: data, - delay: 0 + delay: 0, + disabled: true }), - menu = element.autocomplete( "disable" ).autocomplete( "widget" ); + menu = element.autocomplete( "widget" ); element.val( "ja" ).keydown(); ok( menu.is( ":hidden" ) ); - ok( !element.is( ".ui-state-disabled" ), "element doesn't get ui-state-disabled" ); - ok( !element.attr( "aria-disabled" ), "element doesn't get aria-disabled" ); - ok( menu.is( ".ui-autocomplete-disabled" ), "element gets ui-autocomplete-disabled" ); - setTimeout(function() { ok( menu.is( ":hidden" ) ); start(); diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js index 124a8699f6f..e1931a54e9c 100644 --- a/tests/unit/button/button_options.js +++ b/tests/unit/button/button_options.js @@ -3,26 +3,19 @@ */ (function($) { -module( "button: options" ); +module("button: options"); -test( "disabled, explicit value", function() { - expect( 9 ); - - var element = $( "#radio01" ).button({ disabled: false }); - deepEqual( element.button( "option", "disabled" ), false, "disabled option set to false" ); - deepEqual( element.prop( "disabled" ), false, "element is disabled" ); - - ok( !element.button( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); - ok( !element.button( "widget" ).hasClass( "ui-button-disabled" ), "element gets ui-button-disabled" ); - - element = $( "#radio02" ).button({ disabled: true }); - - ok( element.button( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); - ok( !element.button( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); - ok( element.button( "widget" ).hasClass( "ui-button-disabled" ), "element gets ui-button-disabled" ); +test("disabled, explicit value", function() { + expect( 4 ); + $("#radio01").button({ disabled: false }); + deepEqual(false, $("#radio01").button("option", "disabled"), + "disabled option set to false"); + deepEqual(false, $("#radio01").prop("disabled"), "element is disabled"); - deepEqual( element.button( "option", "disabled" ), true, "disabled option set to true" ); - deepEqual( element.prop( "disabled" ), true, "element is not disabled" ); + $("#radio02").button({ disabled: true }); + deepEqual(true, $("#radio02").button("option", "disabled"), + "disabled option set to true"); + deepEqual(true, $("#radio02").prop("disabled"), "element is not disabled"); }); test("disabled, null", function() { diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index 2bb06ab465c..6de18551373 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -101,13 +101,11 @@ test("#4980: Destroy should place element back in original DOM position", functi }); test( "enable/disable disabled", function() { - expect( 4 ); + expect( 2 ); var element = $( "
          " ).dialog(); element.dialog( "disable" ); equal(element.dialog( "option", "disabled" ), false, "disable method doesn't do anything" ); ok( !element.dialog( "widget" ).hasClass( "ui-dialog-disabled" ), "disable method doesn't add ui-dialog-disabled class" ); - ok( !element.dialog( "widget" ).hasClass( "ui-state-disabled" ), "disable method doesn't add ui-state-disabled class" ); - ok( !element.dialog( "widget" ).attr( "aria-disabled" ), "disable method doesn't add aria-disabled" ); }); test("close", function() { diff --git a/tests/unit/draggable/draggable_methods.js b/tests/unit/draggable/draggable_methods.js index 63a19e26d17..901c261d6ed 100644 --- a/tests/unit/draggable/draggable_methods.js +++ b/tests/unit/draggable/draggable_methods.js @@ -74,16 +74,16 @@ test( "enable", function() { }); test( "disable", function() { - expect( 10 ); + expect( 7 ); - element = $( "#draggable2" ).draggable({ disabled: false }); + element = $("#draggable2").draggable({ disabled: false }); TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" ); - element.draggable( "disable" ); + element.draggable("disable"); TestHelpers.draggable.shouldNotMove( element, ".draggable('disable')" ); equal( element.draggable( "option", "disabled" ), true, "disabled option getter" ); - element.draggable( "destroy" ); + element.draggable("destroy"); element.draggable({ disabled: false }); TestHelpers.draggable.shouldMove( element, ".draggable({ disabled: false })" ); @@ -91,12 +91,8 @@ test( "disable", function() { equal( element.draggable( "option", "disabled" ), true, "disabled option setter" ); TestHelpers.draggable.shouldNotMove( element, ".draggable('option', 'disabled', true)" ); - ok( !element.draggable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); - ok( !element.draggable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); - ok( element.draggable( "widget" ).hasClass( "ui-draggable-disabled" ), "element gets ui-draggable-disabled" ); - var expected = element.draggable(), - actual = expected.draggable( "disable" ); + actual = expected.draggable("disable"); equal( actual, expected, "disable is chainable" ); }); diff --git a/tests/unit/droppable/droppable_methods.js b/tests/unit/droppable/droppable_methods.js index f7682d262e4..2b452a63dfc 100644 --- a/tests/unit/droppable/droppable_methods.js +++ b/tests/unit/droppable/droppable_methods.js @@ -63,29 +63,26 @@ test("enable", function() { equal(actual, expected, "enable is chainable"); }); -test( "disable", function() { - expect( 10 ); +test("disable", function() { + expect(7); - var actual, expected, - element = $( "#droppable1" ).droppable({ disabled: false }); + var el, actual, expected; + el = $("#droppable1").droppable({ disabled: false }); TestHelpers.droppable.shouldDrop(); - element.droppable( "disable" ); + el.droppable("disable"); TestHelpers.droppable.shouldNotDrop(); - equal( element.droppable( "option", "disabled" ), true, "disabled option getter" ); - element.droppable( "destroy" ); - element.droppable({ disabled: false }); + equal(el.droppable("option", "disabled"), true, "disabled option getter"); + el.droppable("destroy"); + el.droppable({ disabled: false }); TestHelpers.droppable.shouldDrop(); - element.droppable( "option", "disabled", true ); - ok( !element.droppable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); - ok( !element.droppable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); - ok( element.droppable( "widget" ).hasClass( "ui-droppable-disabled" ), "element gets ui-droppable-disabled" ); - equal( element.droppable( "option", "disabled" ), true, "disabled option setter" ); + el.droppable("option", "disabled", true); + equal(el.droppable("option", "disabled"), true, "disabled option setter"); TestHelpers.droppable.shouldNotDrop(); - expected = $( "
          " ).droppable(); - actual = expected.droppable( "disable" ); - equal( actual, expected, "disable is chainable" ); + expected = $("
          ").droppable(), + actual = expected.droppable("disable"); + equal(actual, expected, "disable is chainable"); }); })(jQuery); diff --git a/tests/unit/progressbar/progressbar_methods.js b/tests/unit/progressbar/progressbar_methods.js index 004eacf90d2..cf7faf6af81 100644 --- a/tests/unit/progressbar/progressbar_methods.js +++ b/tests/unit/progressbar/progressbar_methods.js @@ -7,16 +7,6 @@ test( "destroy", function() { }); }); -test( "disable", function() { - expect( 3 ); - - var element = $( "#progressbar" ).progressbar().progressbar( "disable" ); - - ok( element.progressbar( "widget" ).hasClass( "ui-state-disabled" ), "element gets ui-state-disabled" ); - ok( element.progressbar( "widget" ).attr( "aria-disabled" ), "element gets aria-disabled" ); - ok( element.progressbar( "widget" ).hasClass( "ui-progressbar-disabled" ), "element gets ui-progressbar-disabled" ); -}); - test( "value", function() { expect( 3 ); diff --git a/tests/unit/resizable/resizable_methods.js b/tests/unit/resizable/resizable_methods.js index abb8951f930..b12f3035a2e 100644 --- a/tests/unit/resizable/resizable_methods.js +++ b/tests/unit/resizable/resizable_methods.js @@ -3,19 +3,10 @@ */ (function($) { -module( "resizable: methods" ); +module("resizable: methods"); -test( "disable", function() { - expect( 5 ); - - var element = $( "#resizable1" ).resizable({ disabled: false }), - chainable = element.resizable( "disable" ); - - ok( !element.resizable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); - ok( !element.resizable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); - ok( element.resizable( "widget" ).hasClass( "ui-resizable-disabled" ), "element gets ui-resizable-disabled" ); - equal( element.resizable( "option", "disabled" ), true, "disabled option setter" ); - equal( chainable, element, "disable is chainable" ); -}); +// this is here to make JSHint pass "unused", and we don't want to +// remove the parameter for when we finally implement +$.noop(); })(jQuery); diff --git a/tests/unit/selectable/selectable_methods.js b/tests/unit/selectable/selectable_methods.js index 179d4ecd6b6..72f9bb28d73 100644 --- a/tests/unit/selectable/selectable_methods.js +++ b/tests/unit/selectable/selectable_methods.js @@ -71,40 +71,34 @@ test("enable", function() { equal(actual, expected, "enable is chainable"); }); -test( "disable", function() { - expect( 6 ); - var chainable, +test("disable", function() { + expect(3); + var expected, actual, fired = false, - element = $( "#selectable1" ); + el = $("#selectable1"); - element.selectable({ + el.selectable({ disabled: false, - start: function() { - fired = true; - } + start: function() { fired = true; } }); - element.simulate( "drag", { + el.simulate( "drag", { dx: 20, dy: 20 }); - equal( fired, true, "start fired" ); - - chainable = element.selectable( "disable" ); + equal(fired, true, "start fired"); + el.selectable("disable"); fired = false; - element.simulate( "drag", { + el.simulate( "drag", { dx: 20, dy: 20 }); - equal( fired, false, "start fired" ); - - ok( !element.selectable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); - ok( !element.selectable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); - ok( element.selectable( "widget" ).hasClass( "ui-selectable-disabled" ), "element gets ui-selectable-disabled" ); - - element.selectable( "destroy" ); + equal(fired, false, "start fired"); + el.selectable("destroy"); - equal( chainable, element, "disable is chainable" ); + expected = $("
          ").selectable(); + actual = expected.selectable("disable"); + equal(actual, expected, "disable is chainable"); }); })(jQuery); diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js index bd902313396..75df230a646 100644 --- a/tests/unit/slider/slider_methods.js +++ b/tests/unit/slider/slider_methods.js @@ -49,7 +49,7 @@ test( "enable", function() { }); test( "disable", function() { - expect( 6 ); + expect( 5 ); var element, expected = $( "
          " ).slider(), actual = expected.slider( "disable" ); @@ -61,7 +61,6 @@ test( "disable", function() { element.slider( "disable" ); ok( element.hasClass( "ui-state-disabled" ), "slider has ui-state-disabled class after disable method call" ); ok( element.hasClass( "ui-slider-disabled" ), "slider has ui-slider-disabled class after disable method call" ); - ok( !element.attr( "aria-disabled" ), "slider does not have aria-disabled attr after disable method call" ); }); test( "value", function() { diff --git a/tests/unit/sortable/sortable_methods.js b/tests/unit/sortable/sortable_methods.js index f3fe240e701..07a7bc77d63 100644 --- a/tests/unit/sortable/sortable_methods.js +++ b/tests/unit/sortable/sortable_methods.js @@ -64,30 +64,29 @@ test("enable", function() { equal(actual, expected, "enable is chainable"); }); -test( "disable", function() { - expect( 9 ); +test("disable", function() { + expect(7); - var chainable, - element = $( "#sortable" ).sortable({ disabled: false }); - - TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" ); + var el, actual, expected; - chainable = element.sortable( "disable" ); - TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 0, "disabled.sortable getter" ); + el = $("#sortable").sortable({ disabled: false }); + TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })"); - element.sortable( "destroy" ); + el.sortable("disable"); + TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, "disabled.sortable getter"); - element.sortable({ disabled: false }); - TestHelpers.sortable.sort( $( "li", element )[ 0 ], 0, 44, 2, ".sortable({ disabled: false })" ); - element.sortable( "option", "disabled", true); - equal( element.sortable( "option", "disabled" ), true, "disabled option setter" ); + el.sortable("destroy"); - ok( !element.sortable( "widget" ).hasClass( "ui-state-disabled" ), "element does not get ui-state-disabled" ); - ok( !element.sortable( "widget" ).attr( "aria-disabled" ), "element does not get aria-disabled" ); - ok( element.sortable( "widget" ).hasClass( "ui-sortable-disabled" ), "element gets ui-sortable-disabled" ); + el.sortable({ disabled: false }); + TestHelpers.sortable.sort($("li", el)[0], 0, 44, 2, ".sortable({ disabled: false })"); + el.sortable("option", "disabled", true); + equal(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"); + TestHelpers.sortable.sort($("li", el)[0], 0, 44, 0, ".sortable('option', 'disabled', true)"); - TestHelpers.sortable.sort($( "li", element )[ 0 ], 0, 44, 0, ".sortable('option', 'disabled', true)" ); - equal( chainable, element, "disable is chainable" ); + expected = $("
          ").sortable(), + actual = expected.sortable("disable"); + equal(actual, expected, "disable is chainable"); }); })(jQuery); diff --git a/tests/unit/spinner/spinner_methods.js b/tests/unit/spinner/spinner_methods.js index 4f44a73aef1..af872f25763 100644 --- a/tests/unit/spinner/spinner_methods.js +++ b/tests/unit/spinner/spinner_methods.js @@ -12,7 +12,7 @@ test( "destroy", function() { }); test( "disable", function() { - expect( 16 ); + expect( 14 ); var element = $( "#spin" ).val( 2 ).spinner(), wrapper = $( "#spin" ).spinner( "widget" ); @@ -21,8 +21,6 @@ test( "disable", function() { element.spinner( "disable" ); ok( wrapper.hasClass( "ui-spinner-disabled" ), "after: wrapper has ui-spinner-disabled class" ); - ok( wrapper.hasClass( "ui-state-disabled" ), "after: wrapper has ui-state-disabled class" ); - ok( !wrapper.attr( "aria-disabled" ), "after: wrapper does not have aria-disabled attr" ); ok( element.is( ":disabled"), "after: input has disabled attribute" ); simulateKeyDownUp( element, $.ui.keyCode.UP ); diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index 02a2fea343e..c78c42b5810 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -144,40 +144,24 @@ test( "{ collapsible: true }", function() { }); test( "disabled", function() { - expect( 22 ); + expect( 10 ); // fully enabled by default var element = $( "#tabs1" ).tabs(); disabled( element, false ); - ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); - ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); - ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); - // disable single tab element.tabs( "option", "disabled", [ 1 ] ); disabled( element, [ 1 ] ); - ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); - ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); - ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); - // disabled active tab element.tabs( "option", "disabled", [ 0, 1 ] ); disabled( element, [ 0, 1 ] ); - ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); - ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); - ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); - // disable all tabs element.tabs( "option", "disabled", [ 0, 1, 2 ] ); disabled( element, true ); - ok( !element.tabs( "widget" ).hasClass( "ui-state-disabled" ), "after: wrapper doesn't have ui-state-disabled class" ); - ok( !element.tabs( "widget" ).hasClass( "ui-tabs-disabled" ), "after: wrapper doesn't have ui-tabs-disabled class" ); - ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" ); - // enable all tabs element.tabs( "option", "disabled", [] ); disabled( element, false ); diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index a557ff943a2..c846d216cd4 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -54,7 +54,7 @@ test( "open/close with tracking", function() { }); test( "enable/disable", function() { - expect( 10 ); + expect( 7 ); $.fx.off = true; var tooltip, element = $( "#tooltipped1" ).tooltip(); @@ -66,11 +66,6 @@ test( "enable/disable", function() { element.tooltip( "disable" ); equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" ); - - ok( !element.tooltip( "widget" ).hasClass( "ui-state-disabled" ), "element doesn't get ui-state-disabled" ); - ok( !element.tooltip( "widget" ).attr( "aria-disabled" ), "element doesn't get aria-disabled" ); - ok( !element.tooltip( "widget" ).hasClass( "ui-tooltip-disabled" ), "element doesn't get ui-tooltip-disabled" ); - // support: jQuery <1.6.2 // support: IE <8 // We should use strictEqual( ..., undefined ) when dropping jQuery 1.6.1 support (or IE6/7) diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index da0d5751c44..1afa95cb4b0 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -161,9 +161,6 @@ $.widget( "ui.accordion", { // #5332 - opacity doesn't cascade to positioned elements in IE // so we need to add the disabled class to the headers and panels if ( key === "disabled" ) { - this.element - .toggleClass( "ui-state-disabled", !!value ) - .attr( "aria-disabled", value ); this.headers.add( this.headers.next() ) .toggleClass( "ui-state-disabled", !!value ); } diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 5e64f5164c9..fcb7b14d187 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -207,6 +207,9 @@ $.widget( "ui.button", { } } + // TODO: pull out $.Widget's handling for the disabled option into + // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can + // be overridden by individual plugins this._setOption( "disabled", options.disabled ); this._resetButton(); }, @@ -270,8 +273,11 @@ $.widget( "ui.button", { _setOption: function( key, value ) { this._super( key, value ); if ( key === "disabled" ) { - this.widget().toggleClass( "ui-state-disabled", !!value ); - this.element.prop( "disabled", !!value ); + if ( value ) { + this.element.prop( "disabled", true ); + } else { + this.element.prop( "disabled", false ); + } return; } this._resetButton(); diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 34342d33d42..552b24a5850 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -82,7 +82,7 @@ $.widget("ui.droppable", { return d.is(value); }; } - this._super( key, value ); + $.Widget.prototype._setOption.apply(this, arguments); }, _activate: function(event) { diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index bdef9324804..1c633786d9a 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -350,11 +350,6 @@ $.widget( "ui.menu", { .removeClass( this.options.icons.submenu ) .addClass( value.submenu ); } - if ( key === "disabled" ) { - this.element - .toggleClass( "ui-state-disabled", !!value ) - .attr( "aria-disabled", value ); - } this._super( key, value ); }, diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js index 0eaa8b41ec6..9e959ebc4cb 100644 --- a/ui/jquery.ui.progressbar.js +++ b/ui/jquery.ui.progressbar.js @@ -97,11 +97,7 @@ $.widget( "ui.progressbar", { // Don't allow a max less than min value = Math.max( this.min, value ); } - if ( key === "disabled" ) { - this.element - .toggleClass( "ui-state-disabled", !!value ) - .attr( "aria-disabled", value ); - } + this._super( key, value ); }, diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index 88281240dcb..b3e609aa234 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -427,11 +427,7 @@ $.widget( "ui.slider", $.ui.mouse, { valsLength = this.options.values.length; } - if ( key === "disabled" ) { - this.element.toggleClass( "ui-state-disabled", !!value ); - } - - this._super( key, value ); + $.Widget.prototype._setOption.apply( this, arguments ); switch ( key ) { case "orientation": diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 642d5d9479c..efc83f3d593 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -102,6 +102,17 @@ $.widget("ui.sortable", $.ui.mouse, { return this; }, + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget().toggleClass( "ui-sortable-disabled", !!value ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + _mouseCapture: function(event, overrideHandle) { var currentItem = null, validHandle = false, diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index c022413dc24..644b652395a 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -381,9 +381,13 @@ $.widget( "ui.spinner", { this._super( key, value ); if ( key === "disabled" ) { - this.widget().toggleClass( "ui-state-disabled", !!value ); - this.element.prop( "disabled", !!value ); - this.buttons.button( value ? "disable" : "enable" ); + if ( value ) { + this.element.prop( "disabled", true ); + this.buttons.button( "disable" ); + } else { + this.element.prop( "disabled", false ); + this.buttons.button( "enable" ); + } } }, diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index adc4b9da1bf..c581e4b8156 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -345,7 +345,8 @@ $.Widget.prototype = { if ( key === "disabled" ) { this.widget() - .toggleClass( this.widgetFullName + "-disabled", !!value ); + .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); this.hoverable.removeClass( "ui-state-hover" ); this.focusable.removeClass( "ui-state-focus" ); } From 3f21adf08b3533e32eb3716febfc22fa428d75ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 14 Mar 2013 12:22:02 -0700 Subject: [PATCH 50/50] Tagging the 1.10.2 release. --- package.json | 6 +-- ui.accordion.jquery.json | 67 +++++++++++++++++++++++++++++++ ui.autocomplete.jquery.json | 69 ++++++++++++++++++++++++++++++++ ui.button.jquery.json | 66 +++++++++++++++++++++++++++++++ ui.core.jquery.json | 61 ++++++++++++++++++++++++++++ ui.datepicker.jquery.json | 66 +++++++++++++++++++++++++++++++ ui.dialog.jquery.json | 70 +++++++++++++++++++++++++++++++++ ui.draggable.jquery.json | 66 +++++++++++++++++++++++++++++++ ui.droppable.jquery.json | 67 +++++++++++++++++++++++++++++++ ui.effect-blind.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-bounce.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-clip.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-drop.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-explode.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-fade.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-fold.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-highlight.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-pulsate.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-scale.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-shake.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-slide.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.effect-transfer.jquery.json | 63 +++++++++++++++++++++++++++++ ui.effect.jquery.json | 68 ++++++++++++++++++++++++++++++++ ui.menu.jquery.json | 66 +++++++++++++++++++++++++++++++ ui.mouse.jquery.json | 64 ++++++++++++++++++++++++++++++ ui.position.jquery.json | 66 +++++++++++++++++++++++++++++++ ui.progressbar.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.resizable.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.selectable.jquery.json | 65 ++++++++++++++++++++++++++++++ ui.slider.jquery.json | 67 +++++++++++++++++++++++++++++++ ui.sortable.jquery.json | 66 +++++++++++++++++++++++++++++++ ui.spinner.jquery.json | 68 ++++++++++++++++++++++++++++++++ ui.tabs.jquery.json | 67 +++++++++++++++++++++++++++++++ ui.tooltip.jquery.json | 64 ++++++++++++++++++++++++++++++ ui.widget.jquery.json | 64 ++++++++++++++++++++++++++++++ 35 files changed, 2233 insertions(+), 3 deletions(-) create mode 100644 ui.accordion.jquery.json create mode 100644 ui.autocomplete.jquery.json create mode 100644 ui.button.jquery.json create mode 100644 ui.core.jquery.json create mode 100644 ui.datepicker.jquery.json create mode 100644 ui.dialog.jquery.json create mode 100644 ui.draggable.jquery.json create mode 100644 ui.droppable.jquery.json create mode 100644 ui.effect-blind.jquery.json create mode 100644 ui.effect-bounce.jquery.json create mode 100644 ui.effect-clip.jquery.json create mode 100644 ui.effect-drop.jquery.json create mode 100644 ui.effect-explode.jquery.json create mode 100644 ui.effect-fade.jquery.json create mode 100644 ui.effect-fold.jquery.json create mode 100644 ui.effect-highlight.jquery.json create mode 100644 ui.effect-pulsate.jquery.json create mode 100644 ui.effect-scale.jquery.json create mode 100644 ui.effect-shake.jquery.json create mode 100644 ui.effect-slide.jquery.json create mode 100644 ui.effect-transfer.jquery.json create mode 100644 ui.effect.jquery.json create mode 100644 ui.menu.jquery.json create mode 100644 ui.mouse.jquery.json create mode 100644 ui.position.jquery.json create mode 100644 ui.progressbar.jquery.json create mode 100644 ui.resizable.jquery.json create mode 100644 ui.selectable.jquery.json create mode 100644 ui.slider.jquery.json create mode 100644 ui.sortable.jquery.json create mode 100644 ui.spinner.jquery.json create mode 100644 ui.tabs.jquery.json create mode 100644 ui.tooltip.jquery.json create mode 100644 ui.widget.jquery.json diff --git a/package.json b/package.json index 143b37cae99..1e0840475be 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,11 @@ "name": "jquery-ui", "title": "jQuery UI", "description": "A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.", - "version": "1.10.2pre", + "version": "1.10.2", "homepage": "http://jqueryui.com", "author": { "name": "jQuery Foundation and other contributors", - "url": "https://github.com/jquery/jquery-ui/blob/master/AUTHORS.txt" + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" }, "maintainers": [ { @@ -48,7 +48,7 @@ "licenses": [ { "type": "MIT", - "url": "https://github.com/jquery/jquery-ui/blob/master/MIT-LICENSE.txt" + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" } ], "dependencies": {}, diff --git a/ui.accordion.jquery.json b/ui.accordion.jquery.json new file mode 100644 index 00000000000..8a0c04dcdfe --- /dev/null +++ b/ui.accordion.jquery.json @@ -0,0 +1,67 @@ +{ + "name": "ui.accordion", + "title": "jQuery UI Accordion", + "description": "Displays collapsible content panels for presenting information in a limited amount of space.", + "keywords": [ + "ui", + "accordion", + "navigation", + "panel", + "collapse", + "expand" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/accordion/", + "demo": "http://jqueryui.com/accordion/", + "docs": "http://api.jqueryui.com/accordion/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.autocomplete.jquery.json b/ui.autocomplete.jquery.json new file mode 100644 index 00000000000..a5955ce262d --- /dev/null +++ b/ui.autocomplete.jquery.json @@ -0,0 +1,69 @@ +{ + "name": "ui.autocomplete", + "title": "jQuery UI Autocomplete", + "description": "Lists suggested words as the user is typing.", + "keywords": [ + "ui", + "autocomplete", + "form", + "word", + "predict", + "suggest" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/autocomplete/", + "demo": "http://jqueryui.com/autocomplete/", + "docs": "http://api.jqueryui.com/autocomplete/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.menu": "1.10.2", + "ui.position": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.button.jquery.json b/ui.button.jquery.json new file mode 100644 index 00000000000..74e4b9244df --- /dev/null +++ b/ui.button.jquery.json @@ -0,0 +1,66 @@ +{ + "name": "ui.button", + "title": "jQuery UI Button", + "description": "Enhances a form with themable buttons.", + "keywords": [ + "ui", + "button", + "form", + "radio", + "checkbox" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/button/", + "demo": "http://jqueryui.com/button/", + "docs": "http://api.jqueryui.com/button/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.core.jquery.json b/ui.core.jquery.json new file mode 100644 index 00000000000..215fe238f01 --- /dev/null +++ b/ui.core.jquery.json @@ -0,0 +1,61 @@ +{ + "name": "ui.core", + "title": "jQuery UI Core", + "description": "The core of jQuery UI, required for all interactions and widgets.", + "keywords": [ + "ui", + "core" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/", + "demo": "http://jqueryui.com/", + "docs": "http://api.jqueryui.com/category/ui-core/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6" + }, + "category": "core" +} diff --git a/ui.datepicker.jquery.json b/ui.datepicker.jquery.json new file mode 100644 index 00000000000..3c68c822255 --- /dev/null +++ b/ui.datepicker.jquery.json @@ -0,0 +1,66 @@ +{ + "name": "ui.datepicker", + "title": "jQuery UI Datepicker", + "description": "Displays a calendar from an input or inline for selecting dates.", + "keywords": [ + "ui", + "datepicker", + "form", + "calendar", + "date", + "i18n" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/datepicker/", + "demo": "http://jqueryui.com/datepicker/", + "docs": "http://api.jqueryui.com/datepicker/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.dialog.jquery.json b/ui.dialog.jquery.json new file mode 100644 index 00000000000..0810d837432 --- /dev/null +++ b/ui.dialog.jquery.json @@ -0,0 +1,70 @@ +{ + "name": "ui.dialog", + "title": "jQuery UI Dialog", + "description": "Displays customizable dialog windows.", + "keywords": [ + "ui", + "dialog", + "modal", + "alert", + "popup" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/dialog/", + "demo": "http://jqueryui.com/dialog/", + "docs": "http://api.jqueryui.com/dialog/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.button": "1.10.2", + "ui.draggable": "1.10.2", + "ui.position": "1.10.2", + "ui.resizable": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.draggable.jquery.json b/ui.draggable.jquery.json new file mode 100644 index 00000000000..64eb45c9749 --- /dev/null +++ b/ui.draggable.jquery.json @@ -0,0 +1,66 @@ +{ + "name": "ui.draggable", + "title": "jQuery UI Draggable", + "description": "Enables dragging functionality for any element.", + "keywords": [ + "ui", + "draggable", + "drag", + "drop" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/draggable/", + "demo": "http://jqueryui.com/draggable/", + "docs": "http://api.jqueryui.com/draggable/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.mouse": "1.10.2" + }, + "category": "interaction" +} diff --git a/ui.droppable.jquery.json b/ui.droppable.jquery.json new file mode 100644 index 00000000000..eacd371e407 --- /dev/null +++ b/ui.droppable.jquery.json @@ -0,0 +1,67 @@ +{ + "name": "ui.droppable", + "title": "jQuery UI Droppable", + "description": "Enables drop targets for draggable elements.", + "keywords": [ + "ui", + "droppable", + "drag", + "drop" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/droppable/", + "demo": "http://jqueryui.com/droppable/", + "docs": "http://api.jqueryui.com/droppable/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.mouse": "1.10.2", + "ui.draggable": "1.10.2" + }, + "category": "interaction" +} diff --git a/ui.effect-blind.jquery.json b/ui.effect-blind.jquery.json new file mode 100644 index 00000000000..afe23f7b6c5 --- /dev/null +++ b/ui.effect-blind.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-blind", + "title": "jQuery UI Blind Effect", + "description": "Blinds the element.", + "keywords": [ + "ui", + "blind", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/blind-effect/", + "demo": "http://jqueryui.com/blind-effect/", + "docs": "http://api.jqueryui.com/blind-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-bounce.jquery.json b/ui.effect-bounce.jquery.json new file mode 100644 index 00000000000..e033780bb59 --- /dev/null +++ b/ui.effect-bounce.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-bounce", + "title": "jQuery UI Bounce Effect", + "description": "Bounces an element horizontally or vertically n times.", + "keywords": [ + "ui", + "bounce", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/bounce-effect/", + "demo": "http://jqueryui.com/bounce-effect/", + "docs": "http://api.jqueryui.com/bounce-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-clip.jquery.json b/ui.effect-clip.jquery.json new file mode 100644 index 00000000000..9697bb05265 --- /dev/null +++ b/ui.effect-clip.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-clip", + "title": "jQuery UI Clip Effect", + "description": "Clips the element on and off like an old TV.", + "keywords": [ + "ui", + "clip", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/clip-effect/", + "demo": "http://jqueryui.com/clip-effect/", + "docs": "http://api.jqueryui.com/clip-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-drop.jquery.json b/ui.effect-drop.jquery.json new file mode 100644 index 00000000000..97bfc7e7fbe --- /dev/null +++ b/ui.effect-drop.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-drop", + "title": "jQuery UI Drop Effect", + "description": "Moves an element in one direction and hides it at the same time.", + "keywords": [ + "ui", + "drop", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/drop-effect/", + "demo": "http://jqueryui.com/drop-effect/", + "docs": "http://api.jqueryui.com/drop-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-explode.jquery.json b/ui.effect-explode.jquery.json new file mode 100644 index 00000000000..a900a59106f --- /dev/null +++ b/ui.effect-explode.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-explode", + "title": "jQuery UI Explode Effect", + "description": "Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.", + "keywords": [ + "ui", + "explode", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/explode-effect/", + "demo": "http://jqueryui.com/explode-effect/", + "docs": "http://api.jqueryui.com/explode-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-fade.jquery.json b/ui.effect-fade.jquery.json new file mode 100644 index 00000000000..faec73aaa42 --- /dev/null +++ b/ui.effect-fade.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-fade", + "title": "jQuery UI Fade Effect", + "description": "Fades an element.", + "keywords": [ + "ui", + "fade", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/fade-effect/", + "demo": "http://jqueryui.com/fade-effect/", + "docs": "http://api.jqueryui.com/fade-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-fold.jquery.json b/ui.effect-fold.jquery.json new file mode 100644 index 00000000000..22039ff2918 --- /dev/null +++ b/ui.effect-fold.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-fold", + "title": "jQuery UI Fold Effect", + "description": "Folds an element first horizontally and then vertically.", + "keywords": [ + "ui", + "fold", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/fold-effect/", + "demo": "http://jqueryui.com/fold-effect/", + "docs": "http://api.jqueryui.com/fold-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-highlight.jquery.json b/ui.effect-highlight.jquery.json new file mode 100644 index 00000000000..3cb71f2af0f --- /dev/null +++ b/ui.effect-highlight.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-highlight", + "title": "jQuery UI Highlight Effect", + "description": "Highlights the background of an element in a defined color for a custom duration.", + "keywords": [ + "ui", + "highlight", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/highlight-effect/", + "demo": "http://jqueryui.com/highlight-effect/", + "docs": "http://api.jqueryui.com/highlight-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-pulsate.jquery.json b/ui.effect-pulsate.jquery.json new file mode 100644 index 00000000000..f48ad23857a --- /dev/null +++ b/ui.effect-pulsate.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-pulsate", + "title": "jQuery UI Pulsate Effect", + "description": "Pulsates an element n times by changing the opacity to zero and back.", + "keywords": [ + "ui", + "pulsate", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/pulsate-effect/", + "demo": "http://jqueryui.com/pulsate-effect/", + "docs": "http://api.jqueryui.com/pulsate-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-scale.jquery.json b/ui.effect-scale.jquery.json new file mode 100644 index 00000000000..3786b6add71 --- /dev/null +++ b/ui.effect-scale.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-scale", + "title": "jQuery UI Scale Effect", + "description": "Grows or shrinks an element and its content. Restores an elemnt to its original size.", + "keywords": [ + "ui", + "scale", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/scale-effect/", + "demo": "http://jqueryui.com/scale-effect/", + "docs": "http://api.jqueryui.com/scale-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-shake.jquery.json b/ui.effect-shake.jquery.json new file mode 100644 index 00000000000..81878975f7f --- /dev/null +++ b/ui.effect-shake.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-shake", + "title": "jQuery UI Shake Effect", + "description": "Shakes an element horizontally or vertically n times.", + "keywords": [ + "ui", + "shake", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/shake-effect/", + "demo": "http://jqueryui.com/shake-effect/", + "docs": "http://api.jqueryui.com/shake-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-slide.jquery.json b/ui.effect-slide.jquery.json new file mode 100644 index 00000000000..948ad64caa6 --- /dev/null +++ b/ui.effect-slide.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.effect-slide", + "title": "jQuery UI Slide Effect", + "description": "Slides an element in and out of the viewport.", + "keywords": [ + "ui", + "slide", + "effect", + "show", + "hide" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/slide-effect/", + "demo": "http://jqueryui.com/slide-effect/", + "docs": "http://api.jqueryui.com/slide-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect-transfer.jquery.json b/ui.effect-transfer.jquery.json new file mode 100644 index 00000000000..ddbd1842fd9 --- /dev/null +++ b/ui.effect-transfer.jquery.json @@ -0,0 +1,63 @@ +{ + "name": "ui.effect-transfer", + "title": "jQuery UI Transfer Effect", + "description": "Displays a transfer effect from one element to another.", + "keywords": [ + "ui", + "transfer", + "effect" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/transfer-effect/", + "demo": "http://jqueryui.com/transfer-effect/", + "docs": "http://api.jqueryui.com/transfer-effect/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.effect": "1.10.2" + }, + "category": "effect" +} diff --git a/ui.effect.jquery.json b/ui.effect.jquery.json new file mode 100644 index 00000000000..839fa771ef6 --- /dev/null +++ b/ui.effect.jquery.json @@ -0,0 +1,68 @@ +{ + "name": "ui.effect", + "title": "jQuery UI Effects Core", + "description": "Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.", + "keywords": [ + "ui", + "effect", + "animation", + "show", + "hide", + "color", + "class", + "transition", + "easing" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/", + "demo": "http://jqueryui.com/effects/", + "docs": "http://api.jqueryui.com/category/effects-core/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6" + }, + "category": "effect" +} diff --git a/ui.menu.jquery.json b/ui.menu.jquery.json new file mode 100644 index 00000000000..79ca10dfb16 --- /dev/null +++ b/ui.menu.jquery.json @@ -0,0 +1,66 @@ +{ + "name": "ui.menu", + "title": "jQuery UI Menu", + "description": "Creates nestable menus.", + "keywords": [ + "ui", + "menu", + "dropdown", + "flyout" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/menu/", + "demo": "http://jqueryui.com/menu/", + "docs": "http://api.jqueryui.com/menu/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.position": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.mouse.jquery.json b/ui.mouse.jquery.json new file mode 100644 index 00000000000..505e30c9d9e --- /dev/null +++ b/ui.mouse.jquery.json @@ -0,0 +1,64 @@ +{ + "name": "ui.mouse", + "title": "jQuery UI Mouse", + "description": "Abstracts mouse-based interactions to assist in creating certain widgets.", + "keywords": [ + "ui", + "mouse", + "abstraction" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/mouse/", + "demo": "http://jqueryui.com/mouse/", + "docs": "http://api.jqueryui.com/mouse/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2" + }, + "category": "core" +} diff --git a/ui.position.jquery.json b/ui.position.jquery.json new file mode 100644 index 00000000000..2462415217c --- /dev/null +++ b/ui.position.jquery.json @@ -0,0 +1,66 @@ +{ + "name": "ui.position", + "title": "jQuery UI Position", + "description": "Positions elements relative to other elements.", + "keywords": [ + "ui", + "position", + "offset", + "relative", + "absolute", + "fixed", + "collision" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/position/", + "demo": "http://jqueryui.com/position/", + "docs": "http://api.jqueryui.com/position/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6" + }, + "category": "core" +} diff --git a/ui.progressbar.jquery.json b/ui.progressbar.jquery.json new file mode 100644 index 00000000000..109c3640621 --- /dev/null +++ b/ui.progressbar.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.progressbar", + "title": "jQuery UI Progressbar", + "description": "Displays a status indicator for loading state, standard percentage, and other progress indicators.", + "keywords": [ + "ui", + "progressbar", + "determinate", + "status" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/progressbar/", + "demo": "http://jqueryui.com/progressbar/", + "docs": "http://api.jqueryui.com/progressbar/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.resizable.jquery.json b/ui.resizable.jquery.json new file mode 100644 index 00000000000..eee1a6a6be5 --- /dev/null +++ b/ui.resizable.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.resizable", + "title": "jQuery UI Resizable", + "description": "Enables resize functionality for any element.", + "keywords": [ + "ui", + "resizable", + "resize" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/resizable/", + "demo": "http://jqueryui.com/resizable/", + "docs": "http://api.jqueryui.com/resizable/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.mouse": "1.10.2" + }, + "category": "interaction" +} diff --git a/ui.selectable.jquery.json b/ui.selectable.jquery.json new file mode 100644 index 00000000000..fd5f045b359 --- /dev/null +++ b/ui.selectable.jquery.json @@ -0,0 +1,65 @@ +{ + "name": "ui.selectable", + "title": "jQuery UI Selectable", + "description": "Allows groups of elements to be selected with the mouse.", + "keywords": [ + "ui", + "selectable", + "selection" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/selectable/", + "demo": "http://jqueryui.com/selectable/", + "docs": "http://api.jqueryui.com/selectable/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.mouse": "1.10.2" + }, + "category": "interaction" +} diff --git a/ui.slider.jquery.json b/ui.slider.jquery.json new file mode 100644 index 00000000000..8e1ccf2e644 --- /dev/null +++ b/ui.slider.jquery.json @@ -0,0 +1,67 @@ +{ + "name": "ui.slider", + "title": "jQuery UI Slider", + "description": "Displays a flexible slider with ranges and accessibility via keyboard.", + "keywords": [ + "ui", + "slider", + "form", + "number", + "range" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/slider/", + "demo": "http://jqueryui.com/slider/", + "docs": "http://api.jqueryui.com/slider/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.mouse": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.sortable.jquery.json b/ui.sortable.jquery.json new file mode 100644 index 00000000000..d52c27c9b60 --- /dev/null +++ b/ui.sortable.jquery.json @@ -0,0 +1,66 @@ +{ + "name": "ui.sortable", + "title": "jQuery UI Sortable", + "description": "Enables items in a list to be sorted using the mouse.", + "keywords": [ + "ui", + "sortable", + "sort", + "list" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/sortable/", + "demo": "http://jqueryui.com/sortable/", + "docs": "http://api.jqueryui.com/sortable/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.mouse": "1.10.2" + }, + "category": "interaction" +} diff --git a/ui.spinner.jquery.json b/ui.spinner.jquery.json new file mode 100644 index 00000000000..22d3450561c --- /dev/null +++ b/ui.spinner.jquery.json @@ -0,0 +1,68 @@ +{ + "name": "ui.spinner", + "title": "jQuery UI Spinner", + "description": "Displays buttons to easily input numbers via the keyboard or mouse.", + "keywords": [ + "ui", + "spinner", + "form", + "number", + "spinbutton", + "stepper" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/spinner/", + "demo": "http://jqueryui.com/spinner/", + "docs": "http://api.jqueryui.com/spinner/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.button": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.tabs.jquery.json b/ui.tabs.jquery.json new file mode 100644 index 00000000000..851c8467f09 --- /dev/null +++ b/ui.tabs.jquery.json @@ -0,0 +1,67 @@ +{ + "name": "ui.tabs", + "title": "jQuery UI Tabs", + "description": "Transforms a set of container elements into a tab structure.", + "keywords": [ + "ui", + "tabs", + "navigation", + "panel", + "collapse", + "expand" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/tabs/", + "demo": "http://jqueryui.com/tabs/", + "docs": "http://api.jqueryui.com/tabs/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.tooltip.jquery.json b/ui.tooltip.jquery.json new file mode 100644 index 00000000000..78c22e977e4 --- /dev/null +++ b/ui.tooltip.jquery.json @@ -0,0 +1,64 @@ +{ + "name": "ui.tooltip", + "title": "jQuery UI Tooltip", + "description": "Shows additional information for any element on hover or focus.", + "keywords": [ + "ui", + "tooltip" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/tooltip/", + "demo": "http://jqueryui.com/tooltip/", + "docs": "http://api.jqueryui.com/tooltip/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6", + "ui.core": "1.10.2", + "ui.widget": "1.10.2", + "ui.position": "1.10.2" + }, + "category": "widget" +} diff --git a/ui.widget.jquery.json b/ui.widget.jquery.json new file mode 100644 index 00000000000..96cc4fd63b4 --- /dev/null +++ b/ui.widget.jquery.json @@ -0,0 +1,64 @@ +{ + "name": "ui.widget", + "title": "jQuery UI Widget", + "description": "Provides a factory for creating stateful widgets with a common API.", + "keywords": [ + "ui", + "widget", + "abstraction", + "state", + "factory" + ], + "version": "1.10.2", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Scott González", + "email": "scott.gonzalez@gmail.com", + "url": "http://scottgonzalez.com" + }, + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Kris Borchers", + "email": "kris.borchers@gmail.com", + "url": "http://krisborchers.com" + }, + { + "name": "Corey Frang", + "email": "gnarf37@gmail.com", + "url": "http://gnarf.net" + }, + { + "name": "Mike Sherov", + "email": "mike.sherov@gmail.com", + "url": "http://mike.sherov.com" + }, + { + "name": "TJ VanToll", + "email": "tj.vantoll@gmail.com", + "url": "http://tjvantoll.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jquery/jquery-ui/blob/1.10.2/MIT-LICENSE.txt" + } + ], + "bugs": "http://bugs.jqueryui.com/", + "homepage": "http://jqueryui.com/widget/", + "demo": "http://jqueryui.com/widget/", + "docs": "http://api.jqueryui.com/jQuery.widget/", + "download": "http://jqueryui.com/download/", + "dependencies": { + "jquery": ">=1.6" + }, + "category": "core" +}