From 3d9545ad2719853a075a00646458dfc679074d72 Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 3 Oct 2012 21:23:20 -0400 Subject: Update lint task to include the release script. --- build/.jshintrc | 13 +++++++++++++ build/release/release.js | 3 ++- grunt.js | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 build/.jshintrc diff --git a/build/.jshintrc b/build/.jshintrc new file mode 100644 index 000000000..9e6abf31d --- /dev/null +++ b/build/.jshintrc @@ -0,0 +1,13 @@ +{ + "curly": true, + "eqnull": true, + "eqeqeq": true, + "expr": true, + "noarg": true, + "node": true, + "onevar": true, + "smarttabs": true, + "strict": false, + "trailing": true, + "undef": true +} diff --git a/build/release/release.js b/build/release/release.js index 9a0f9a9e7..0acd33256 100644 --- a/build/release/release.js +++ b/build/release/release.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +/*global cat:true echo:true exec:true exit:true cd:true*/ var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime, fs = require( "fs" ), @@ -250,7 +251,7 @@ function gatherContributors() { echo ( "Adding people thanked in commits..." ); contributors = contributors.concat( gitLog( "%b%n%s" ).filter(function( line ) { - return /thank/i.test( line ); + return (/thank/i).test( line ); })); fs.writeFileSync( contributorsPath, contributors.join( "\n" ) ); diff --git a/grunt.js b/grunt.js index 548393b59..08647a7a1 100644 --- a/grunt.js +++ b/grunt.js @@ -287,7 +287,7 @@ grunt.initConfig({ // TODO remove items from this list once rewritten return !( /(mouse|datepicker|draggable|droppable|resizable|selectable|sortable)\.js$/ ).test( file ); }), - grunt: [ "grunt.js", "build/tasks/*.js" ], + grunt: [ "grunt.js", "build/**/*.js" ], tests: "tests/unit/**/*.js" }, csslint: { -- cgit v1.2.3 From a8f5e3c399844f82e67ffdceb29dbbfb0e1314db Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Thu, 4 Oct 2012 14:05:52 +0200 Subject: Grunt/testswarm: Undo the change from 6e55168318495da50cae457433eae2438699e1f3 to see if its responsible for the position errors in IE8 --- build/tasks/testswarm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index 34c17d4f6..d3d9f2040 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -51,7 +51,7 @@ function submit( commit, tests, configFile, version, done ) { }, { authUsername: config.authUsername, authToken: config.authToken, - jobName: 'jQuery UI ' + version + '#' + commit.substr( 0, 10 ) + '', + jobName: 'jQuery UI ' + version + '' + commit.substr( 0, 7 ) + '', runMax: config.runMax, "runNames[]": Object.keys(tests), "runUrls[]": testUrls, -- cgit v1.2.3 From 7009e9b332a8b96bb368ff43546a9682ef20918e Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Thu, 4 Oct 2012 14:45:01 +0200 Subject: Revert "Grunt/testswarm: Undo the change from 6e55168318495da50cae457433eae2438699e1f3 to see if its responsible for the position errors in IE8" This reverts commit a8f5e3c399844f82e67ffdceb29dbbfb0e1314db. Did not have any effect on TestSwarm --- build/tasks/testswarm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index d3d9f2040..34c17d4f6 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -51,7 +51,7 @@ function submit( commit, tests, configFile, version, done ) { }, { authUsername: config.authUsername, authToken: config.authToken, - jobName: 'jQuery UI ' + version + '' + commit.substr( 0, 7 ) + '', + jobName: 'jQuery UI ' + version + '#' + commit.substr( 0, 10 ) + '', runMax: config.runMax, "runNames[]": Object.keys(tests), "runUrls[]": testUrls, -- cgit v1.2.3 From f5261f359e8cad8f525f6a36c113b7058e533c71 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 4 Oct 2012 11:13:14 -0400 Subject: Tooltip: Stop tracking the mouse if the element gains focus. Fixes #8622 - Tooltip tracks mouse when the element has focus. --- ui/jquery.ui.tooltip.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index f38379f21..bb6ea6d88 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -140,6 +140,8 @@ $.widget( "ui.tooltip", { this._find( target ).position( $.extend({ of: target }, this.options.position ) ); + // Stop tacking (#8622) + this._off( this.document, "mousemove" ); return; } -- cgit v1.2.3 From 49406c108f8cc60169feab5b0bcf491e8a21bfd4 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 4 Oct 2012 11:16:13 -0400 Subject: Build: Throw an Error object instead of a string. --- build/tasks/build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/tasks/build.js b/build/tasks/build.js index 2f191b69a..3f3dd31c5 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -177,8 +177,8 @@ grunt.registerTask( "generate_themes", function() { distFolder = "dist/" + grunt.template.process( grunt.config( "files.dist" ), grunt.config() ); try { require.resolve( "download.jqueryui.com" ); - } catch( e ) { - throw "You need to manually install download.jqueryui.com for this task to work"; + } catch( error ) { + throw new Error( "You need to manually install download.jqueryui.com for this task to work" ); } // copy release files into download builder to avoid cloning again -- cgit v1.2.3 From d434c9a442788ed844567237b7046c34210b6564 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 4 Oct 2012 11:59:11 -0400 Subject: typo --- ui/jquery.ui.tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index bb6ea6d88..a97d698e3 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -140,7 +140,7 @@ $.widget( "ui.tooltip", { this._find( target ).position( $.extend({ of: target }, this.options.position ) ); - // Stop tacking (#8622) + // Stop tracking (#8622) this._off( this.document, "mousemove" ); return; } -- cgit v1.2.3 From f417a92c544d48dd61134b2d60336aaebf405afa Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 4 Oct 2012 16:48:42 -0400 Subject: Build: Generate quick download in release script. --- build/release/release.js | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/build/release/release.js b/build/release/release.js index 0acd33256..77430d8d1 100644 --- a/build/release/release.js +++ b/build/release/release.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -/*global cat:true echo:true exec:true exit:true cd:true*/ +/*global cat:true cd:true cp:true echo:true exec:true exit:true ls:true*/ var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime, fs = require( "fs" ), @@ -41,6 +41,9 @@ walk([ section( "gathering contributors" ), gatherContributors, + section( "generating quick download" ), + generateQuickDownload, + section( "updating trac" ), updateTrac, confirm @@ -258,6 +261,34 @@ function gatherContributors() { echo( "Stored contributors in " + contributorsPath.cyan + "." ); } +function generateQuickDownload() { + var config, + downloadDir = repoDir + "/node_modules/download.jqueryui.com", + filename = "jquery-ui-" + newVersion + ".custom.zip", + destination = baseDir + "/" + filename; + + cd( downloadDir ); + + // Update jQuery UI version for download builder + config = JSON.parse( cat( "config.json" ) ); + config.jqueryUi = newVersion; + JSON.stringify( config ).to( "config.json" ); + + // Generate quick download + // TODO: Find a way to avoid having to clone jquery-ui inside download builder + if ( exec( "grunt prepare build" ).code !== 0 ) { + abort( "Error generating quick download." ); + } + cp( downloadDir + "/release/" + filename, destination ); + // cp() doesn't have error handling, so check for the file + if ( ls( destination ).length !== 1 ) { + abort( "Error copying quick download." ); + } + + // Go back to repo directory for consistency + cd( repoDir ); +} + function updateTrac() { echo( newVersion.cyan + " was tagged at " + tagTime.cyan + "." ); echo( "Close the " + newVersion.cyan + " Milestone with the above date and time." ); @@ -348,8 +379,8 @@ function bootstrap( fn ) { return process.exit( 1 ); } - require( baseDir + "/node_modules/shelljs/global" ); - require( baseDir + "/node_modules/colors" ); + require( "shelljs/global" ); + require( "colors" ); fn(); }); -- cgit v1.2.3 From 96f2aa4c72b5f29782b0736ed95468e50d338d6e Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 5 Oct 2012 11:26:49 -0400 Subject: Tooltip: Check if event exists before checking properties in open(). Fixes #8626 - Programatically opening a tooltip with out giving an event results in a javascript error. --- tests/unit/tooltip/tooltip_methods.js | 17 +++++++++++++++++ ui/jquery.ui.tooltip.js | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index 0af1e06e9..896e910c6 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -29,6 +29,23 @@ test( "open/close", function() { $.fx.off = false; }); +// #8626 - Calling open() without an event +test( "open/close with tracking", function() { + expect( 3 ); + $.fx.off = true; + var tooltip, + element = $( "#tooltipped1" ).tooltip({ track: true }); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" ); + + element.tooltip( "open" ); + tooltip = $( "#" + element.data( "ui-tooltip-id" ) ); + ok( tooltip.is( ":visible" ) ); + + element.tooltip( "close" ); + ok( tooltip.is( ":hidden" ) ); + $.fx.off = false; +}); + test( "enable/disable", function() { expect( 7 ); $.fx.off = true; diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index a97d698e3..32aad6487 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -216,7 +216,7 @@ $.widget( "ui.tooltip", { positionOption.of = event; tooltip.position( positionOption ); } - if ( this.options.track && /^mouse/.test( event.originalEvent.type ) ) { + if ( this.options.track && event && /^mouse/.test( event.originalEvent.type ) ) { positionOption = $.extend( {}, this.options.position ); this._on( this.document, { mousemove: position -- cgit v1.2.3 From 0a31a828319493d6642ce876555e5383106ce039 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 5 Oct 2012 12:52:02 -0400 Subject: Tooltip: Better cleanup on destroy. Fixes #8627 - The Tooltip destroy method is not clearing up the data properties. --- tests/unit/tooltip/tooltip_methods.js | 13 ++++++++++--- ui/jquery.ui.tooltip.js | 18 +++++++++++++++++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index 896e910c6..c846d216c 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -3,13 +3,20 @@ module( "tooltip: methods" ); test( "destroy", function() { - expect( 2 ); + expect( 3 ); + var element = $( "#tooltipped1" ); + domEqual( "#tooltipped1", function() { - $( "#tooltipped1" ).tooltip().tooltip( "destroy" ); + element.tooltip().tooltip( "destroy" ); }); // make sure that open tooltips are removed on destroy - $( "#tooltipped1" ).tooltip().tooltip( "open" ).tooltip( "destroy" ); + domEqual( "#tooltipped1", function() { + element + .tooltip() + .tooltip( "open", $.Event( "mouseover", { target: element[0] }) ) + .tooltip( "destroy" ); + }); equal( $( ".ui-tooltip" ).length, 0 ); }); diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index 32aad6487..980b43868 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -317,8 +317,24 @@ $.widget( "ui.tooltip", { }, _destroy: function() { - $.each( this.tooltips, function( id ) { + var that = this; + + // close open tooltips + $.each( this.tooltips, function( id, element ) { + // Delegate to close method to handle common cleanup + var event = $.Event( "blur" ); + event.target = event.currentTarget = element[0]; + that.close( event, true ); + + // Remove immediately; destroying an open tooltip doesn't use the + // hide animation $( "#" + id ).remove(); + + // Restore the title + if ( element.data( "ui-tooltip-title" ) ) { + element.attr( "title", element.data( "ui-tooltip-title" ) ); + element.removeData( "ui-tooltip-title" ); + } }); } }); -- cgit v1.2.3 From ec60dcd186d3ecb4ee400963fb3cc091fe727349 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 5 Oct 2012 14:52:15 -0400 Subject: Updating the master version to 1.9.1pre. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 554dfe061..3625c1f44 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jquery-ui", "title": "jQuery UI", "description": "A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.", - "version": "1.9.0pre", + "version": "1.9.1pre", "homepage": "http://jqueryui.com", "author": { "name": "jQuery Foundation and other contributors", -- cgit v1.2.3 From 77568347cf0a063ee905364dbe32268ab80d6edd Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 8 Oct 2012 17:42:56 -0400 Subject: Demos: Fixed titles. --- demos/position/cycler.html | 2 +- demos/spinner/currency.html | 2 +- demos/tooltip/custom-style.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/position/cycler.html b/demos/position/cycler.html index dc3bbc86e..2c421211f 100644 --- a/demos/position/cycler.html +++ b/demos/position/cycler.html @@ -2,7 +2,7 @@ - jQuery UI Position - Default functionality + jQuery UI Position - Image Cycler diff --git a/demos/spinner/currency.html b/demos/spinner/currency.html index f15511ab7..0b9975808 100644 --- a/demos/spinner/currency.html +++ b/demos/spinner/currency.html @@ -2,7 +2,7 @@ - jQuery UI Spinner - Default functionality + jQuery UI Spinner - Currency diff --git a/demos/tooltip/custom-style.html b/demos/tooltip/custom-style.html index f18522e54..d3546d3b3 100644 --- a/demos/tooltip/custom-style.html +++ b/demos/tooltip/custom-style.html @@ -2,7 +2,7 @@ - jQuery UI Tooltip - Default functionality + jQuery UI Tooltip - Custom Styling @@ -85,7 +85,7 @@ the element with your mouse, the title attribute is displayed in a little box ne ThemeRoller will also style tooltips accordingly.

Tooltips are also useful for form elements, to show some additional information in the context of each field.

-

+

Hover the field to see the tooltip.

-- cgit v1.2.3 From 1e6e4ce4dcd9ac885a7b4088898f61f4930e63a3 Mon Sep 17 00:00:00 2001 From: "Richard D. Worth" Date: Tue, 9 Oct 2012 08:41:18 -0400 Subject: Dialog: add required closing tag . Fixes #8639 - jQuery 1.9.0 dialog on a XHTML page is broken if buttons are defined --- ui/jquery.ui.dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 77424047c..98bd7fcaa 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -364,7 +364,7 @@ $.widget("ui.dialog", { props = $.isFunction( props ) ? { click: props, text: name } : props; - var button = $( "" ) .attr( props, true ) .unbind( "click" ) .click(function() { -- cgit v1.2.3 From fa62f21e5ad09e5368efc3079859730e23a7123b Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 9 Oct 2012 09:06:58 -0400 Subject: Tabs: Handle extraneous list items when using ui-tabs-active to set the initially active tab. Fixes #8568 - jQuery ui tabs: wrong default active li if ul contains extraneous elements. --- ui/jquery.ui.tabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 506ee27d7..baf55d8dc 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -91,7 +91,7 @@ $.widget( "ui.tabs", { // check for a tab marked active via a class if ( active === null ) { - active = this.tabs.filter( ".ui-tabs-active" ).index(); + active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); } // no active tab, set to false -- cgit v1.2.3 From a3f1a34d3b997550a5a8cf4c630e6580cd37cde5 Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 10 Oct 2012 11:45:48 -0400 Subject: Remove use of $.browser; add $.ui.ie and $.ui.ie6 temporarily. --- tests/jquery.simulate.js | 2 +- tests/unit/datepicker/datepicker_core.js | 4 ++-- ui/jquery.ui.core.js | 8 +++++++- ui/jquery.ui.datepicker.js | 2 +- ui/jquery.ui.dialog.js | 4 ++-- ui/jquery.ui.draggable.js | 2 +- ui/jquery.ui.mouse.js | 2 +- ui/jquery.ui.resizable.js | 4 ++-- ui/jquery.ui.sortable.js | 2 +- 9 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js index e281e2fee..790c88c27 100644 --- a/tests/jquery.simulate.js +++ b/tests/jquery.simulate.js @@ -148,7 +148,7 @@ $.extend( $.simulate.prototype, { } // TODO: can we hook into core's logic? - if ( $.browser.msie || $.browser.opera ) { + if ( $.ui.ie || (({}).toString.call( window.opera ) === "[object Opera]") ) { // TODO: is charCode ever <0 ? Can we just use charCode || keyCode? event.keyCode = (options.charCode > 0) ? options.charCode : options.keyCode; event.charCode = undefined; diff --git a/tests/unit/datepicker/datepicker_core.js b/tests/unit/datepicker/datepicker_core.js index 17cefe157..e17b239e5 100644 --- a/tests/unit/datepicker/datepicker_core.js +++ b/tests/unit/datepicker/datepicker_core.js @@ -59,7 +59,7 @@ test('baseStructure', function() { var header, title, table, thead, week, panel, inl, child, inp = init('#inp').focus(), dp = $('#ui-datepicker-div'), - iframe = ($.browser.msie && parseInt($.browser.version, 10) < 7); + iframe = ($.ui.ie6); ok(dp.is(':visible'), 'Structure - datepicker visible'); ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left'); ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month'); @@ -186,7 +186,7 @@ test('customStructure', function() { inp = init('#inp', $.datepicker.regional.he); inp.data('showButtonPanel.datepicker',true); inp.focus(); - iframe = ($.browser.msie && parseInt($.browser.version, 10) < 7); + iframe = ($.ui.ie6); ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left'); header = dp.children(':first'); ok(header.is('div.ui-datepicker-header'), 'Structure RTL - header division'); diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index bb9411dc9..e569eea42 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -69,7 +69,7 @@ $.fn.extend({ scrollParent: function() { var scrollParent; - if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { scrollParent = this.parents().filter(function() { return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); }).eq(0); @@ -258,6 +258,12 @@ $(function() { // deprecated +(function() { + var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || []; + $.ui.ie = uaMatch.length ? true : false; + $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6; +})(); + $.fn.extend({ disableSelection: function() { return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 9ea36924b..4643af2eb 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -1605,7 +1605,7 @@ $.extend(Datepicker.prototype, { } html += group; } - html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? + html += buttonPanel + ($.ui.ie6 && !inst.inline ? '' : ''); inst._keyEvent = false; return html; diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 98bd7fcaa..8593fff85 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -768,7 +768,7 @@ $.extend( $.ui.dialog.overlay, { var scrollHeight, offsetHeight; // handle IE - if ( $.browser.msie ) { + if ( $.ui.ie ) { scrollHeight = Math.max( document.documentElement.scrollHeight, document.body.scrollHeight @@ -793,7 +793,7 @@ $.extend( $.ui.dialog.overlay, { var scrollWidth, offsetWidth; // handle IE - if ( $.browser.msie ) { + if ( $.ui.ie ) { scrollWidth = Math.max( document.documentElement.scrollWidth, document.body.scrollWidth diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 2e33e3311..e110bd8a4 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -318,7 +318,7 @@ $.widget("ui.draggable", $.ui.mouse, { } if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information - || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix po = { top: 0, left: 0 }; return { diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 30546ffc4..f5069d00c 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -111,7 +111,7 @@ $.widget("ui.mouse", { _mouseMove: function(event) { // IE mouseup check - mouseup happened when mouse was out of window - if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + if ($.ui.ie && !(document.documentMode >= 9) && !event.button) { return this._mouseUp(event); } diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index 724ae9ddf..cc82b8b92 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -466,8 +466,8 @@ $.widget("ui.resizable", $.ui.mouse, { this.helper = this.helper || $('
'); // fix ie6 offset TODO: This seems broken - var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), - pxyoffset = ( ie6 ? 2 : -1 ); + var ie6offset = ($.ui.ie6 ? 1 : 0), + pxyoffset = ( $.ui.ie6 ? 2 : -1 ); this.helper.addClass(this._helper).css({ width: this.element.outerWidth() + pxyoffset, diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 070dff6cd..920e645d4 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -822,7 +822,7 @@ $.widget("ui.sortable", $.ui.mouse, { } if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information - || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix po = { top: 0, left: 0 }; return { -- cgit v1.2.3 From 77a4aaf47abe08f11eb4e0eabdb2a1c026c0f221 Mon Sep 17 00:00:00 2001 From: John Chen Date: Wed, 12 Sep 2012 17:37:04 +0800 Subject: Sortable: Fix a bug of removing an item while iterating an array. Fixes #8571 - Out of range problem in when dragging a nested sortable. --- ui/jquery.ui.sortable.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 920e645d4..0768fdf6e 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -562,14 +562,13 @@ $.widget("ui.sortable", $.ui.mouse, { var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); - for (var i=0; i < this.items.length; i++) { - + this.items = $.grep(this.items, function (item) { for (var j=0; j < list.length; j++) { - if(list[j] == this.items[i].item[0]) - this.items.splice(i,1); + if(list[j] == item.item[0]) + return false; }; - - }; + return true; + }); }, -- cgit v1.2.3 From 20e6064711abca6f540e18ec9feca8ece3720324 Mon Sep 17 00:00:00 2001 From: John Chen Date: Thu, 13 Sep 2012 12:10:01 +0800 Subject: Draggable: Fix a bug when dragging into nested sortables there are duplicated placeholders. Fixes #7777 - Draggable and Nested Sortables bug. --- ui/jquery.ui.draggable.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index e110bd8a4..5d91a3d94 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -571,13 +571,29 @@ $.ui.plugin.add("draggable", "connectToSortable", { $.each(inst.sortables, function(i) { + var innermostIntersecting = false; + var thisSortable = this; //Copy over some variables to allow calling the sortable's native _intersectsWith this.instance.positionAbs = inst.positionAbs; this.instance.helperProportions = inst.helperProportions; this.instance.offset.click = inst.offset.click; if(this.instance._intersectsWith(this.instance.containerCache)) { + innermostIntersecting = true; + $.each(inst.sortables, function () { + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + if (this != thisSortable + && this.instance._intersectsWith(this.instance.containerCache) + && $.ui.contains(thisSortable.instance.element[0], this.instance.element[0])) + innermostIntersecting = false; + return innermostIntersecting; + }); + } + + if(innermostIntersecting) { //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once if(!this.instance.isOver) { -- cgit v1.2.3 From bae06d2b1ef6bbc946dce9fae91f68cc41abccda Mon Sep 17 00:00:00 2001 From: John Chen Date: Fri, 17 Aug 2012 16:20:45 +0800 Subject: Sortable: Calculating item distance and direction using a more robust algorithm to better support sorting among nested sortables. Fixes #8572 - Wrong placeholder positions. Fixes #8573 - Can't drag an item out of an inner sortable. Fixes #8574 - Hard to put an item between two inner sortables. Use the item which has the least distance between the mouse pointer and one of its borders to rearrange, with direction being determined by the nearest border. Also we use this algorithm to rearrange even when currentContainer is not changed to override the defective rearrangment in _mouseDrag --- ui/jquery.ui.sortable.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 0768fdf6e..a2132a9bd 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -734,16 +734,26 @@ $.widget("ui.sortable", $.ui.mouse, { if(this.containers.length === 1) { this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); this.containers[innermostIndex].containerCache.over = 1; - } else if(this.currentContainer != this.containers[innermostIndex]) { + } else { //When entering a new container, we will find the item with the least distance and append our item near it - var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top']; + var dist = 10000; var itemWithLeastDistance = null; + var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top'; + var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height'; + var base = this.positionAbs[posProperty] + this.offset.click[posProperty]; for (var j = this.items.length - 1; j >= 0; j--) { if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; - var cur = this.containers[innermostIndex].floating ? this.items[j].item.offset().left : this.items[j].item.offset().top; + if(this.items[j].item[0] == this.currentItem[0]) continue; + var cur = this.items[j].item.offset()[posProperty]; + var nearBottom = false; + if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ + nearBottom = true; + cur += this.items[j][sizeProperty]; + } + if(Math.abs(cur - base) < dist) { dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; - this.direction = (cur - base > 0) ? 'down' : 'up'; + this.direction = nearBottom ? "up": "down"; } } -- cgit v1.2.3 From cb57f223e0390266de5cad356477178e9112df41 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 11 Oct 2012 10:36:11 -0400 Subject: Theme: Apply color to default link style in ui-state-hover. Fixes #7648 - Accordion Collapsed Color Issue. --- themes/base/jquery.ui.theme.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base/jquery.ui.theme.css b/themes/base/jquery.ui.theme.css index 12a39fb86..d70b9df90 100644 --- a/themes/base/jquery.ui.theme.css +++ b/themes/base/jquery.ui.theme.css @@ -27,7 +27,7 @@ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; } +.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121/*{fcHover}*/; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; } -- cgit v1.2.3 From 4d5197b7b446be3a4ff680302c80e98b6b809756 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 11 Oct 2012 13:21:36 -0400 Subject: Whitespace. --- themes/base/jquery.ui.autocomplete.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base/jquery.ui.autocomplete.css b/themes/base/jquery.ui.autocomplete.css index cc85c5a4e..499d2e3ae 100644 --- a/themes/base/jquery.ui.autocomplete.css +++ b/themes/base/jquery.ui.autocomplete.css @@ -8,7 +8,7 @@ * * http://docs.jquery.com/UI/Autocomplete#theming */ -.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete { position: absolute; cursor: default; } /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ -- cgit v1.2.3 From a50516f77e82206f2d1f4188c9f5a242442ace09 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 11 Oct 2012 14:53:45 -0400 Subject: Datepicker demo: Fixed date range restriction when clearing dates. Fixes #5473 - Datepicker: Date range demo bug when clearing date. --- demos/datepicker/date-range.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/datepicker/date-range.html b/demos/datepicker/date-range.html index 284b6b3be..7fd8f321c 100644 --- a/demos/datepicker/date-range.html +++ b/demos/datepicker/date-range.html @@ -15,7 +15,7 @@ defaultDate: "+1w", changeMonth: true, numberOfMonths: 3, - onSelect: function( selectedDate ) { + onClose: function( selectedDate ) { $( "#to" ).datepicker( "option", "minDate", selectedDate ); } }); @@ -23,7 +23,7 @@ defaultDate: "+1w", changeMonth: true, numberOfMonths: 3, - onSelect: function( selectedDate ) { + onClose: function( selectedDate ) { $( "#from" ).datepicker( "option", "maxDate", selectedDate ); } }); -- cgit v1.2.3 From 916c2252d75900a0efd35b3216c52070a0823a77 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Thu, 11 Oct 2012 16:35:57 -0400 Subject: Update AUTHORS.txt based on CLA responses. --- AUTHORS.txt | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 892e2ec76..a53bc9dc2 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -4,14 +4,14 @@ A list of current team members is available at http://jqueryui.com/about Paul Bakaus Richard Worth Yehuda Katz -Sean Catchpole +Sean Catchpole John Resig -Tane Piper +Tane Piper Dmitri Gaskin Klaus Hartl Stefan Petre Gilles van den Hoven -Micheil Smith +Micheil Bryan Smith Jörn Zaefferer Marc Grabanski Keith Wood @@ -81,9 +81,9 @@ Khaled AlHourani Marian Rudzynski Jean-Francois Remy Doug Blood -Filippo Cavallarin +Filippo Cavallarin Heiko Henning -Aliaxandr Rahalevich +Aliaksandr Rahalevich Mario Visic Xavi Ramirez Max Schnur @@ -92,7 +92,7 @@ Corey Frang Aaron Peterson Ivan Peters Mohamed Cherif Bouchelaghem -Marcos Sousa +Marcos Sousa Michael DellaNoce George Marshall Tobias Brunner @@ -114,8 +114,8 @@ Hans Hillen Mark Johnson Trey Hunner Shane Whittet -Edward Faulkner -Adam Baratz +Edward A Faulkner +Adam Baratz Kato Kazuyoshi Eike Send Kris Borchers @@ -125,27 +125,27 @@ Carson McDonald Jason Davies Garrison Locke David Murdoch -Ben Boyle +Benjamin Scott Boyle Jesse Baird Jonathan Vingiano Dylan Just -Tomy Kaira +Hiroshi Tomita Glenn Goodrich -Ashek Elahi +Tarafder Ashek-E-Elahi Ryan Neufeld Marc Neuwirth Philip Graham Benjamin Sterling -Wesley Walser +Wesley Walser Kouhei Sutou -Karl Kirch +Karl Kirch Chris Kelly Jay Oster -Alex Polomoshnov +Alexander Polomoshnov David Leal -igor milla +Igor Milla Dave Methvin -Florian Gutmann +Florian Gutmann Marwan Al Jubeh Milan Broum Sebastian Sauer @@ -157,7 +157,7 @@ David Soms David De Sloovere Michael P. Jung Shannon Pekary -Matthew Hutton +Matthew Edward Hutton James Khoury Rob Loach Alberto Monteiro @@ -168,7 +168,7 @@ Genie <386@mail.com> Rick Waldron Ian Simpson Lev Kitsis -TJ VanToll +Ted VanToll Justin Domnitz Douglas Cerna Bert ter Heide @@ -189,11 +189,11 @@ Eneko Illarramendi EungJun Yi Courtland Allen Viktar Varvanovich -Danny Trunk +Danny Trunk Pavel Stetina -Mike Stay +Michael Stay Steven Roussey -Mike Hollis +Michael Hollis Lee Rowlands Timmy Willison Karl Swedberg -- cgit v1.2.3 From 1ee090ea9e03c800a764d992506869384409bdb6 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 11 Oct 2012 19:06:54 -0400 Subject: Autocomplete: Set the top position of the menu so that the menu doesn't affect layout. Fixes #8656 - Initial position of autocomplete is incorrect. --- themes/base/jquery.ui.autocomplete.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themes/base/jquery.ui.autocomplete.css b/themes/base/jquery.ui.autocomplete.css index 499d2e3ae..05ae3108f 100644 --- a/themes/base/jquery.ui.autocomplete.css +++ b/themes/base/jquery.ui.autocomplete.css @@ -8,7 +8,11 @@ * * http://docs.jquery.com/UI/Autocomplete#theming */ -.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete { + position: absolute; + top: 0; /* #8656 */ + cursor: default; +} /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ -- cgit v1.2.3 From 94221c4e5b11496ef927889e1541d84b5746fb31 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 12 Oct 2012 11:07:04 -0400 Subject: Tabs: Use aria-controls instead of the anchor's href to match against location.hash. Fixes #8660 - Tabs: Set initial active tab from location hash for ajax tabs. --- tests/unit/tabs/tabs_options.js | 8 +++++++- ui/jquery.ui.tabs.js | 9 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index 5a90ff895..1b468f2b6 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -7,7 +7,7 @@ var disabled = TestHelpers.tabs.disabled, module( "tabs: options" ); test( "{ active: default }", function() { - expect( 4 ); + expect( 6 ); var element = $( "#tabs1" ).tabs(); equal( element.tabs( "option", "active" ), 0, "should be 0 by default" ); @@ -19,6 +19,12 @@ test( "{ active: default }", function() { equal( element.tabs( "option", "active" ), 2, "should be 2 based on URL" ); state( element, 0, 0, 1 ); element.tabs( "destroy" ); + + location.hash = "#custom-id"; + element = $( "#tabs2" ).tabs(); + equal( element.tabs( "option", "active" ), 3, "should be 3 based on URL" ); + state( element, 0, 0, 0, 1, 0 ); + element.tabs( "destroy" ); location.hash = "#"; }); diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index baf55d8dc..7d38fb46e 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -51,7 +51,8 @@ $.widget( "ui.tabs", { var panel, that = this, options = this.options, - active = options.active; + active = options.active, + locationHash = location.hash.substring( 1 ); this.running = false; @@ -80,9 +81,9 @@ $.widget( "ui.tabs", { if ( active === null ) { // check the fragment identifier in the URL - if ( location.hash ) { - this.anchors.each(function( i, anchor ) { - if ( anchor.hash === location.hash ) { + if ( locationHash ) { + this.tabs.each(function( i, tab ) { + if ( $( tab ).attr( "aria-controls" ) === locationHash ) { active = i; return false; } -- cgit v1.2.3