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 2a7a396c8de..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 @@ -236,3 +236,7 @@ Thomas Jaggi Vahid Sohrabloo Travis Carden Bruno M. Custódio +Nathanael Silverman +Christian Wenz +Steve Urmston +Zaven Muradyan diff --git a/grunt.js b/Gruntfile.js similarity index 64% rename from grunt.js rename to Gruntfile.js index d599496cc29..ff64f0c0da4 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,12 +46,38 @@ 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 = { @@ -65,85 +91,103 @@ 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-css" ); +grunt.loadNpmTasks( "grunt-contrib-jshint" ); +grunt.loadNpmTasks( "grunt-contrib-uglify" ); +grunt.loadNpmTasks( "grunt-contrib-concat" ); +grunt.loadNpmTasks( "grunt-contrib-qunit" ); +grunt.loadNpmTasks( "grunt-contrib-csslint" ); +grunt.loadNpmTasks( "grunt-contrib-cssmin" ); 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 +202,7 @@ grunt.initConfig({ "jquery-*.js", "MIT-LICENSE.txt", "README.md", - "grunt.js", + "Gruntfile.js", "package.json", "*.jquery.json", "ui/**/*", @@ -209,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 %>" }, @@ -230,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 %>", @@ -278,27 +315,47 @@ 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 ); }), // TODO consider reenabling some of these rules - rules: { + options: { "adjoining-classes": false, "import": false, "outline-none": false, @@ -307,39 +364,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_themes md5:cdn zip:cdn".split( " " ) ); }; 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/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 + }); } }; diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index 0d59db67070..f89f260ebcf 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -37,91 +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(), - matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( value ) + "$", "i" ), - valid = false; - select.children( "option" ).each(function() { - if ( $( this ).text().match( matcher ) ) { - 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.replace( - new RegExp( - "(?![^&;]+;)(?!<[^<>]*)(" + - $.ui.autocomplete.escapeRegex(request.term) + - ")(?![^<>]*>)(?![^&;]+;)", "gi" - ), "$1" ), - value: text, - option: this - }; - }) ); - }, - select: function( event, ui ) { - ui.item.option.selected = true; - that._trigger( "selected", 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" + }); + }, - input.data( "ui-autocomplete" )._renderItem = function( ul, item ) { - return $( "
  • " ) - .append( "" + item.label + "" ) - .appendTo( ul ); - }; + _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" @@ -136,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() { 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..a71bf57cbd9 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -1,74 +1,124 @@ -/* - * draggable_options.js - */ -(function($) { +(function( $ ) { -module("draggable: options"); +module( "draggable: options" ); -test("{ addClasses: true }, default", function() { - expect( 1 ); - var el = $("
      ").draggable({ addClasses: true }); - ok(el.is(".ui-draggable"), "'ui-draggable' class added"); +// TODO: This doesn't actually test whether append happened, possibly remove +test( "{ appendTo: 'parent' }, default, no clone", function() { + expect( 2 ); + var element = $( "#draggable2" ).draggable({ appendTo: "parent" }); + TestHelpers.draggable.shouldMove( element ); - el.draggable("destroy"); + element = $( "#draggable1" ).draggable({ appendTo: "parent" }); + TestHelpers.draggable.shouldMove( element ); }); -test("{ addClasses: false }", function() { - expect( 1 ); - var el = $("
      ").draggable({ addClasses: false }); - ok(!el.is(".ui-draggable"), "'ui-draggable' class not added"); +// TODO: This doesn't actually test whether append happened, possibly remove +test( "{ appendTo: Element }, no clone", function() { + expect( 2 ); + var element = $( "#draggable2" ).draggable({ appendTo: $( "#draggable2" ).parent()[ 0 ] }); + + TestHelpers.draggable.shouldMove( element ); - el.draggable("destroy"); + element = $( "#draggable1" ).draggable({ appendTo: $( "#draggable2" ).parent()[ 0 ] }); + TestHelpers.draggable.shouldMove( element ); }); -test("{ appendTo: 'parent' }, default", 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: "parent" }); - TestHelpers.draggable.shouldMove(el); - - el = $("#draggable1").draggable({ appendTo: "parent" }); - TestHelpers.draggable.shouldMove(el); + var element = $( "#draggable2" ).draggable({ appendTo: "#main" }); + TestHelpers.draggable.shouldMove( element ); + element = $( "#draggable1" ).draggable({ appendTo: "#main" }); + TestHelpers.draggable.shouldMove( element ); }); -test("{ appendTo: Element }", function() { +test( "{ appendTo: 'parent' }, default", function() { expect( 2 ); - var el = $("#draggable2").draggable({ appendTo: $("#draggable2").parent()[0] }); - TestHelpers.draggable.shouldMove(el); - el = $("#draggable1").draggable({ appendTo: $("#draggable2").parent()[0] }); - TestHelpers.draggable.shouldMove(el); + var element = $( "#draggable1" ).draggable(); + + TestHelpers.draggable.trackAppendedParent( element ); + + equal( element.draggable( "option", "appendTo" ), "parent" ); + + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_parent" ), $( "#qunit-fixture" )[ 0 ] ); }); -test("{ appendTo: Selector }", function() { +test( "{ appendTo: Element }", function() { + expect( 1 ); + + var appendTo = $( "#draggable2" ).parent()[ 0 ], + element = $( "#draggable1" ).draggable({ appendTo: 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(), + element = $( "#draggable1" ).draggable({ appendTo: appendTo }); + + TestHelpers.draggable.trackAppendedParent( element ); + + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_parent" ), appendTo[ 0 ] ); +}); + +test( "{ appendTo: Selector }", function() { + expect( 1 ); + + var appendTo = "#main", + element = $( "#draggable1" ).draggable({ appendTo: appendTo }); + + 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 ); - var el = $("#draggable2").draggable({ appendTo: "#main" }); - TestHelpers.draggable.shouldMove(el); - el = $("#draggable1").draggable({ appendTo: "#main" }); - TestHelpers.draggable.shouldMove(el); + var element = $( "#draggable1" ).draggable({ helper : "clone" }); + + TestHelpers.draggable.trackAppendedParent( element ); + + // 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, "{}": {}, @@ -81,193 +131,344 @@ 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("{ cancel: 'input,textarea,button,select,option' }, default", function() { +test( "axis, default, switching after initialization", function() { + expect( 3 ); + + var element = $( "#draggable1" ).draggable({ axis : false }); + + // Any Direction + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 50 ); + + // Only horizontal + element.draggable( "option", "axis", "x" ); + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 0 ); + + // Vertical only + element.draggable( "option", "axis", "y" ); + TestHelpers.draggable.testDrag( element, element, 50, 50, 0, 50 ); + +}); + +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() { - var el, +test( "{ cancel: ? }, unexpected", function() { + expect( 6 ); + + var element, unexpected = { "true": true, "false": false, "{}": {}, "[]": [], "null": null, - "undefined": undefined, - "function() {return '';}": function() {return "";}, - "function() {return true;}": function() {return true;}, - "function() {return false;}": function() {return false;} + "undefined": undefined }; - expect( 9 ); - - $.each(unexpected, function(key, val) { - el = $("#draggable2").draggable({ cancel: val }); - TestHelpers.draggable.shouldMove(el, "cancel: " + key); - el.draggable("destroy"); + $.each( unexpected, function( key, val ) { + element = $( "#draggable2" ).draggable({ cancel: val }); + TestHelpers.draggable.shouldMove( element, "cancel: " + key ); + element.draggable( "destroy" ); }); }); -/* -test("{ containment: false }, default", function() { - expect( 1 ); +/** +test( "{ cancel: Selectors }, matching parent selector", function() { + + expect( 5 ); + + var element = $( "#draggable2" ).draggable({ cancel: "span a" }); + + $( "#qunit-fixture" ).append( "
      " ); + + element.find( "span" ).append( "" ); + + $( "#wrapping a" ).append( element ); + + 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( "" ); + + + TestHelpers.draggable.testDrag( element, $( "#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("{ containment: Element }", function() { +test( "cancelement, default, switching after initialization", function() { + expect( 3 ); + + $( "
      " ).appendTo( "#main" ); + + var input = $( "#draggable-option-cancel-default input" ), + element = $( "#draggable-option-cancel-default" ).draggable(); + + TestHelpers.draggable.testDrag( element, 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() { expect( 1 ); - ok(false, "missing test - untested code is broken code"); + 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" }), - 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: 'parent' }, absolute", function() { +test( "{ containment: Selector }", function() { expect( 1 ); var offsetAfter, - el = $("#draggable2").draggable({ containment: "parent" }), - 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: 'document' }", function() { +test( "{ containment: [x1, y1, x2, y2] }", function() { expect( 1 ); - ok(false, "missing test - untested code is broken code"); + var element = $( "#draggable1" ).draggable(), + eo = element.offset(); + + 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 ); }); -test("{ containment: 'window' }", function() { +test( "{ containment: 'parent' }, relative", function() { expect( 1 ); - ok(false, "missing test - untested code is broken code"); + var offsetAfter, + element = $( "#draggable1" ).draggable({ containment: "parent" }), + p = element.parent(), + po = p.offset(), + expected = { + 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" ) + }; + + element.simulate( "drag", { + dx: -100, + dy: -100 + }); + offsetAfter = element.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, + element = $( "#draggable2" ).draggable({ containment: "parent" }), + p = element.parent(), + po = p.offset(), + expected = { + 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" ) + }; + + element.simulate( "drag", { + dx: -100, + dy: -100 + }); + offsetAfter = element.offset(); + deepEqual( offsetAfter, expected, "compare offset to parent" ); }); -test("{ containment: [x1, y1, x2, y2] }", function() { - expect( 1 ); +test( "containment, account for border", function() { + expect( 2 ); - ok(false, "missing test - untested code is broken code"); + 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("{ cursor: 'auto' }, default", function() { - function getCursor() { return $("#draggable2").css("cursor"); } +test( "containment, default, switching after initialization", function() { + expect( 2 ); + + var element = $( "#draggable1" ).draggable({ containment: false }); + + TestHelpers.draggable.testDrag( element, element, -100, -100, -100, -100 ); + + element.draggable( "option", "containment", "parent" ) + .css({ + top: 0, + left: 0 + }) + .appendTo( $( "#main" ) ); + + TestHelpers.draggable.testDrag( element, element, -100, -100, 0, 0 ); + + // TODO: Switching back to false does not update to false + // element.draggable( "option", "containment", false ); + // TestHelpers.draggable.testDrag( element, element, -100, -100, -100, -100 ); +}); - expect(2); +test( "{ cursor: 'auto' }, default", function() { + function getCursor() { + return $( "#draggable2" ).css( "cursor" ); + } - var actual, before, after, + expect( 2 ); + + 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 element = $( "#draggable1" ).draggable(); + + TestHelpers.draggable.trackMouseCss( element ); + + TestHelpers.draggable.move( element, 1, 1 ); + equal( element.data( "last_dragged_cursor" ), "auto" ); + + 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() { @@ -286,7 +487,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 ) { @@ -302,7 +503,7 @@ test( "cursorAt", function() { } }); - el.simulate( "drag", { + element.simulate( "drag", { moves: 1, dx: deltaX, dy: deltaY @@ -311,451 +512,779 @@ 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 element = $( "#draggable" + ( i + 1 ) ); + + element.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" ); + } + } + }); + + element.draggable( "option", "cursorAt", false ); + element.draggable( "option", "cursorAt", testData.cursorAt ); + + element.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 element = $( "#draggable1" ).draggable(); - TestHelpers.draggable.testDrag(el, el, -10, -10, -10, -10, "distance met"); + TestHelpers.draggable.shouldMove( element ); - TestHelpers.draggable.testDrag(el, el, 9, 9, 0, 0, "distance not met"); + 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("{ handle: 'span' }", function() { - expect( 2 ); +test( "grid, switching after initialization", function() { + expect( 4 ); + + var element = $( "#draggable1" ).draggable(); + + // Forward + TestHelpers.draggable.testDrag( element, element, 24, 24, 24, 24 ); + TestHelpers.draggable.testDrag( element, element, 0, 0, 0, 0 ); + + 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() { + 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, default, switching after initialization", function() { + expect( 6 ); + + var element = $( "#draggable2" ).draggable(); + + TestHelpers.draggable.testDrag( element, element, 50, 50, 50, 50 ); + TestHelpers.draggable.testDrag( element, "#draggable2 span", 100, 100, 100, 100 ); + + // Switch + 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 + 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() { + expect( 3 ); + + var element = $( "#draggable1" ).draggable(); + TestHelpers.draggable.shouldMove( element ); - var el = $("#draggable2").draggable({ handle: "span" }); + element.draggable( "option", "helper", "clone" ); + TestHelpers.draggable.shouldNotMove( element ); - TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 50, 50, "drag span"); - TestHelpers.draggable.shouldNotMove(el, "drag 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 ); + + var opacity = null, + element = $( "#draggable2" ).draggable({ + start: function() { + opacity = $(this).css( "opacity" ); + } + }); + + TestHelpers.draggable.move( element, 1, 1 ); + equal( opacity, 1 ); + element.draggable( "option", "opacity", 0.5 ); + TestHelpers.draggable.move( element, 2, 1 ); + equal( opacity, 0.5 ); + + element.draggable( "option", "opacity", false ); + TestHelpers.draggable.move( element, 3, 1 ); + equal( opacity, 1 ); +}); + +asyncTest( "revert and revertDuration", function() { + expect( 4 ); + + var element = $( "#draggable2" ).draggable({ + revert: true, + revertDuration: 0 + }); + TestHelpers.draggable.shouldNotMove( element, "revert: true, revertDuration: 0 should revert immediately" ); + + $( "#draggable2" ).draggable( "option", "revert", "invalid" ); + TestHelpers.draggable.shouldNotMove( element, "revert: invalid, revertDuration: 0 should revert immediately" ); + + $( "#draggable2" ).draggable( "option", "revert", false ); + TestHelpers.draggable.shouldMove( element, "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( element, 50, 50 ); + setTimeout( function() { + ok( $( "#draggable2" ).is( ":animated" ), "revert: true with revertDuration should animate" ); + }); }); -test("{ zIndex: 10 }", function() { +test( "revert: valid", function() { + expect( 1 ); + + var element = $( "#draggable2" ).draggable({ + revert: "valid", + revertDuration: 0 + }); + + $( "#droppable" ).droppable(); + + TestHelpers.draggable.testDrag( element, element, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" ); +}); + +test( "scope", function() { + expect( 2 ); + + var element = $( "#draggable2" ).draggable({ + scope: "tasks", + revert: "valid", + revertDuration: 0 + }); - expect(1); + $( "#droppable" ).droppable({ scope: "tasks" }); + + TestHelpers.draggable.testDrag( element, element, 100, 100, 0, 0, "revert: valid reverts when dropped on a droppable" ); + + $( "#droppable" ).droppable( "destroy" ).droppable({ scope: "nottasks" }); + + 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(), + element = $( "#draggable1" ).draggable({ scroll: true }), + scrollSensitivity = element.draggable( "option", "scrollSensitivity" ), + scrollSpeed = element.draggable( "option", "scrollSpeed" ); + + element.offset({ + top: viewportHeight - scrollSensitivity - 1, + left: 1 + }); + + element.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" ); + + element.draggable( "option", "scrollSensitivity", scrollSensitivity + 10 ); + + element.offset({ + top: viewportHeight - scrollSensitivity - 1, + left: 1 + }); + + element.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, + element = $( "#draggable1" ).draggable({ + snap: true, + snapMode: "both", + snapTolerance: snapTolerance + }), + element2 = $( "#draggable2" ).draggable(); + + element.offset({ + top: 1, + left: 1 + }); + + newX = element2.offset().left - element.outerWidth() - snapTolerance - 2; + newY = element2.offset().top; + + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap outside the snapTolerance" ); + + newX += 3; + + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + notDeepEqual( element.offset(), { top: newY, left: newX }, "snaps inside the snapTolerance" ); + + element.draggable( "option", "snap", "#draggable2" ); + + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + notDeepEqual( element.offset(), { top: newY, left: newX }, "snaps based on selector" ); + + element.draggable( "option", "snap", "#draggable3" ); + + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap based on invalid selector" ); + + element.draggable( "option", "snap", true ); + element.draggable( "option", "snapTolerance", snapTolerance - 2 ); + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap outside the modified snapTolerance" ); + + element.draggable( "option", "snapTolerance", snapTolerance ); + element.draggable( "option", "snapMode", "inner" ); + + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + 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; + + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( element.offset(), { top: newY, left: newX }, "doesn't snap inside the outer snapTolerance area when snapMode is inner" ); + + newX++; + + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + notDeepEqual( element.offset(), { top: newY, left: newX }, "snaps inside the inner snapTolerance area when snapMode is inner" ); + + element.draggable( "option", "snapMode", "outer" ); + + element.simulate( "drag", { + handle: "corner", + x: newX, + y: newY, + moves: 1 + }); + + deepEqual( element.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, 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( "{ 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, + element = $( "#draggable2" ).draggable({ + start: function() { + zindex = $(this).css( "z-index" ); + } }); - draggable1.simulate( "drag", { - dx: 1, - dy: 1 - }); - draggable3.simulate( "drag", { - dx: 1, - dy: 1 - }); + element.css( "z-index", 1 ); + + TestHelpers.draggable.move( element, 1, 1 ); + equal( zindex, 1 ); + + element.draggable( "option", "zIndex", 5 ); + TestHelpers.draggable.move( element, 2, 1 ); + equal( zindex, 5 ); + + element.draggable( "option", "zIndex", false ); + TestHelpers.draggable.move( element, 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); +})( jQuery ); diff --git a/tests/unit/draggable/draggable_test_helpers.js b/tests/unit/draggable/draggable_test_helpers.js index c1ac0ab8889..44e37c55961 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.bind( "drag", function() { + el.data( "last_dragged_cursor", $("body").css("cursor") ); + }); + }, + trackAppendedParent : function( el ) { + + // appendTo ignored without being clone + el.draggable( "option", "helper", "clone" ); + + el.bind( "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/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..4b8fe5acd2c 100644 --- a/tests/unit/droppable/droppable_events.js +++ b/tests/unit/droppable/droppable_events.js @@ -1,13 +1,41 @@ -/* - * droppable_events.js - */ -(function($) { +(function( $ ) { + +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" ); +}); -module("droppable: events"); -// 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 /* @@ -32,4 +60,4 @@ test("drop", function() { }); */ -})(jQuery); +})( jQuery ); diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html index c283eabff23..4538ecb0300 100644 --- a/tests/unit/effects/effects.html +++ b/tests/unit/effects/effects.html @@ -96,7 +96,11 @@

        - +
        +
        +

        Child Element Test

        diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js index c9b1e1b4a8b..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; @@ -28,6 +46,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/tests/unit/slider/slider_options.js b/tests/unit/slider/slider_options.js index dfa94696a49..f46dbde99ac 100644 --- a/tests/unit/slider/slider_options.js +++ b/tests/unit/slider/slider_options.js @@ -16,7 +16,7 @@ test( "disabled", function(){ var count = 0; element = $( "#slider1" ).slider(); - element.on( "slidestart", function() { + element.bind( "slidestart", function() { count++; }); @@ -180,13 +180,13 @@ test( "values", function() { document.createElement( "div" ), document.createElement( "div" ) ]).slider({ - range: true, + range: true, values: [ 25, 75 ] }); notStrictEqual( - ranges.eq( 0 ).data( "uiSlider" ).options.values, - ranges.eq( 1 ).data( "uiSlider" ).options.values, + ranges.eq( 0 ).data( "ui-slider" ).options.values, + ranges.eq( 1 ).data( "ui-slider" ).options.values, "multiple range sliders should not have a reference to the same options.values array" ); diff --git a/tests/unit/sortable/sortable.html b/tests/unit/sortable/sortable.html index c23a15854e4..7db14d4822f 100644 --- a/tests/unit/sortable/sortable.html +++ b/tests/unit/sortable/sortable.html @@ -63,6 +63,34 @@

      1. Item 5
      2. + + + + + + + + + + + + + + + + + + + +
        12
        34
        56
        78
        + +
        + + + + +
        + 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 cf35aedb1df..63857316236 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."); @@ -41,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."); }); @@ -185,11 +218,58 @@ test("{ opacity: 1 }", function() { test("{ placeholder: false }, default", function() { ok(false, "missing test - untested code is broken code."); }); +*/ -test("{ placeholder: String }", function() { - ok(false, "missing test - untested code is broken code."); +test( "{ 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 ); + + 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/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/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; } 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; } 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" +} 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', 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 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.dialog.js b/ui/jquery.ui.dialog.js index 85dbddda266..b35c0ffcf67 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -692,11 +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 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 @@ -705,13 +717,10 @@ $.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("ui-dialog")._focusTabbable(); + .data( widgetFullName )._focusTabbable(); } }); } diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 8b388d16650..5762d31717b 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -281,19 +281,9 @@ $.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; - } - }); - - return handle; - + return this.options.handle ? + !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : + true; }, _createHelper: function(event) { @@ -423,8 +413,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; @@ -600,7 +590,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 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; diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js index 97f006ee06a..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, { @@ -1106,14 +1109,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 + 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; } - // invalid strings - treat as "normal" speed - return typeof speed === "string" && !$.effects.effect[ speed ]; + // Didn't match any standard API + return false; } $.fn.extend({ @@ -1150,9 +1168,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 ); @@ -1162,39 +1181,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) { @@ -1265,4 +1286,4 @@ $.each( baseEasings, function( name, easeIn ) { })(); -})(jQuery)); +})(jQuery); 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 ) { diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 211ff272e8b..efc83f3d593 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(); @@ -158,7 +162,7 @@ $.widget("ui.sortable", $.ui.mouse, { _mouseStart: function(event, overrideHandle, noActivation) { - var i, + var i, body, o = this.options; this.currentContainer = this; @@ -228,11 +232,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 @@ -421,14 +428,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 { @@ -749,15 +760,25 @@ $.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( " " ); + } else if ( nodeName === "img" ) { + element.attr( "src", that.currentItem.attr( "src" ) ); + } - if(!className) { - el.style.visibility = "hidden"; + if ( !className ) { + element.css( "visibility", "hidden" ); } - return el; + return element; }, update: function(container, p) { @@ -786,7 +807,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; @@ -825,15 +846,18 @@ $.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 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])) { @@ -842,6 +866,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)){ @@ -860,10 +887,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); @@ -1178,8 +1209,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); 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 );