diff --git a/.editorconfig b/.editorconfig index 7dd83491e..1ba4f5faa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,13 +1,16 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://EditorConfig.org +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org root = true -[grunt.js] +[*] indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true -[ui/**.js] -indent_style = tab - -[tests/unit/**.js] -indent_style = tab +[external/**] +trim_trailing_whitespace = false +insert_final_newline = varies +end_of_line = varies diff --git a/.jshintrc b/.jshintrc index 99161bd4e..d6966c51d 100644 --- a/.jshintrc +++ b/.jshintrc @@ -3,10 +3,10 @@ "eqnull": true, "eqeqeq": true, "expr": true, - "latedef": true, "noarg": true, + "node": true, "onevar": true, - "smarttabs": true, "trailing": true, - "undef": true + "undef": true, + "unused": true } diff --git a/AUTHORS.txt b/AUTHORS.txt index 194d5cb60..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,14 +189,22 @@ 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 Baoju Yuan Maciej Mroziński Luis Dalmolin +Mark Aaron Shirley +Martin Hoch +Jiayi Yang +Philipp Benjamin Köppchen +Sindre Sorhus +Bernhard Sirlinger +Jared A. Scheel +Rafael Xavier de Souza diff --git a/GPL-LICENSE.txt b/GPL-LICENSE.txt deleted file mode 100644 index 11dddd00e..000000000 --- a/GPL-LICENSE.txt +++ /dev/null @@ -1,278 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. diff --git a/build/core.json b/build/core.json index deeb2e118..a9cac173a 100644 --- a/build/core.json +++ b/build/core.json @@ -62,6 +62,7 @@ "abstraction", "state", "factory" - ] + ], + "docs": "http://api.jqueryui.com/jQuery.widget/" } } diff --git a/build/release/changelog-shell b/build/release/changelog-shell index 9e4fbd7e4..9f0f9b436 100644 --- a/build/release/changelog-shell +++ b/build/release/changelog-shell @@ -10,70 +10,100 @@ Move all commit notes to the appropriate section. - If there is no ticket number, search Trac for the relevant ticket. - If there is no ticket, create one (if needed), or leave just the commit link. -Double check that "XXXX" does not appear anywhere in the changelog. +Double check that "TICKETREF" does not appear anywhere in the changelog. -Post this changelog at: CHANGELOG_URL +Add this changelog to jqueryui.com. DELETE EVERYTHING ABOVE THE FOLLOWING LINE ------------------------------------------ + -= Summary = -This is the final release of jQuery UI 1.8. --- OR -- -This is the second maintenance release for [[UI/Changelog/1.8|jQuery UI 1.8]]. +## Build -= Build = -= Core & Utilities = +## Core & Utilities -=== UI Core === +### UI Core -=== Mouse === -=== Widget Factory === +### Mouse -=== Position === -= Interactions = +### Widget Factory -=== Draggable === -=== Droppable === +### Position -=== Resizable === -=== Selectable === +## Interactions -=== Sortable === +### Draggable -= Widgets = -=== Accordion === +### Droppable -=== Autocomplete === -=== Button === +### Resizable -=== Datepicker === -=== Dialog === +### Selectable -=== Progressbar === -=== Slider === +### Sortable -=== Tabs === -= Effects = +## Widgets -=== Individual effects === +### Accordion -= CSS Framework = -= Demos = +### Autocomplete -= Website = -=== Download Builder === +### Button + + +### Datepicker + + +### Dialog + + +### Menu + + +### Progressbar + + +### Slider + + +### Spinner + + +### Tabs + + +### Tooltip + + +## Effects + + +### Individual effects + + +## CSS Framework + + +## Demos + + +## Website + + +### Download Builder diff --git a/build/release/release.js b/build/release/release.js index 7dada78c5..0e41702e9 100644 --- a/build/release/release.js +++ b/build/release/release.js @@ -1,4 +1,7 @@ #!/usr/bin/env node +/*global cat:true cd:true echo:true exec:true exit:true*/ + +"use strict"; var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime, fs = require( "fs" ), @@ -43,6 +46,8 @@ walk([ section( "updating trac" ), updateTrac, confirm + + // TODO: upload release zip to GitHub ]); @@ -62,6 +67,9 @@ function cloneRepo() { if ( exec( "npm install" ).code !== 0 ) { abort( "Error installing dependencies." ); } + if ( exec( "npm install download.jqueryui.com" ).code !== 0 ) { + abort( "Error installing dependencies." ); + } echo(); } @@ -101,10 +109,12 @@ function getVersions() { major = parseInt( parts[ 0 ], 10 ); minor = parseInt( parts[ 1 ], 10 ); patch = parseInt( parts[ 2 ], 10 ); + // TODO: handle 2.0.0 if ( minor === 0 ) { abort( "This script is not smart enough to handle the 2.0.0 release." ); } + prevVersion = patch === 0 ? [ major, minor - 1, 0 ].join( "." ) : [ major, minor, patch - 1 ].join( "." ); @@ -128,6 +138,7 @@ function buildRelease() { echo( "Updating package.json..." ); pkg = readPackage(); pkg.version = newVersion; + pkg.author.url = pkg.author.url.replace( "master", newVersion ); pkg.licenses.forEach(function( license ) { license.url = license.url.replace( "master", newVersion ); }); @@ -140,17 +151,13 @@ function buildRelease() { echo(); echo( "Building release..." ); - if ( exec( "grunt release" ).code !== 0 ) { + if ( exec( "grunt release_cdn" ).code !== 0 ) { abort( "Error building release." ); } echo(); - // TODO: Build themes - - // TODO: Move build out of dist/ echo( "Committing release artifacts..." ); git( "add *.jquery.json", "Error adding manifest files to git." ); - // TODO: Add built files git( "commit -am 'Tagging the " + newVersion + " release.'", "Error committing release changes." ); echo(); @@ -190,7 +197,9 @@ function generateChangelog() { var commits, changelogPath = baseDir + "/changelog", changelog = cat( "build/release/changelog-shell" ) + "\n", - fullFormat = "* %s (TICKETREF, [http://github.com/jquery/jquery-ui/commit/%H %h])"; + fullFormat = "* %s (TICKETREF, [%h](http://github.com/jquery/jquery-ui/commit/%H))"; + + changelog = changelog.replace( "{title}", "jQuery UI " + newVersion + " Changelog" ); echo ( "Adding commits..." ); commits = gitLog( fullFormat ); @@ -205,7 +214,7 @@ function generateChangelog() { }); return tickets.length ? commit.replace( "TICKETREF", tickets.map(function( ticket ) { - return "[http://bugs.jqueryui.com/ticket/" + ticket + " #" + ticket + "]"; + return "[#" + ticket + "](http://bugs.jqueryui.com/ticket/" + ticket + ")"; }).join( ", " ) ) : // Leave TICKETREF token in place so it's easy to find commits without tickets commit; @@ -244,7 +253,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" ) ); @@ -341,8 +350,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(); }); @@ -385,7 +394,7 @@ function abort( msg ) { function walk( methods ) { var method = methods.shift(); - function next( error ) { + function next() { if ( methods.length ) { walk( methods ); } diff --git a/build/tasks/build.js b/build/tasks/build.js index bbe63da2c..18e427a56 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -1,6 +1,9 @@ module.exports = function( grunt ) { -var path = require( "path" ); +"use strict"; + +var path = require( "path" ), + fs = require( "fs" ); grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() { var pkg = grunt.config( "pkg" ), @@ -143,7 +146,7 @@ grunt.registerMultiTask( "zip", "Create a zip file for release", function() { opts: { cwd: 'dist' } - }, function( err, result ) { + }, function( err ) { if ( err ) { grunt.log.error( err ); done(); @@ -171,97 +174,68 @@ grunt.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", fun grunt.log.writeln( "Wrote " + this.file.dest + " with " + hashes.length + " hashes" ); }); -// only needed for 1.8 -grunt.registerTask( "download_docs", function() { - function capitalize(value) { - return value[0].toUpperCase() + value.slice(1); - } - // should be grunt.config("pkg.version")? - var version = "1.8", - docsDir = "dist/docs", - files = "draggable droppable resizable selectable sortable accordion autocomplete button datepicker dialog progressbar slider tabs position" - .split(" ").map(function(widget) { - return { - url: "http://docs.jquery.com/action/render/UI/API/" + version + "/" + capitalize(widget), - dest: docsDir + '/' + widget + '.html' - }; - }); - files = files.concat("animate addClass effect hide removeClass show switchClass toggle toggleClass".split(" ").map(function(widget) { - return { - url: "http://docs.jquery.com/action/render/UI/Effects/" + widget, - dest: docsDir + '/' + widget + '.html' - }; - })); - files = files.concat("Blind Clip Drop Explode Fade Fold Puff Slide Scale Bounce Highlight Pulsate Shake Size Transfer".split(" ").map(function(widget) { - return { - url: "http://docs.jquery.com/action/render/UI/Effects/" + widget, - dest: docsDir + '/effect-' + widget.toLowerCase() + '.html' - }; - })); - grunt.file.mkdir( "dist/docs" ); - grunt.utils.async.forEach( files, function( file, done ) { - var out = fs.createWriteStream( file.dest ); - out.on( "close", done ); - request( file.url ).pipe( out ); - }, this.async() ); -}); - -grunt.registerTask( "download_themes", function() { - // var AdmZip = require('adm-zip'); - var done = this.async(), - themes = grunt.file.read( "build/themes" ).split(","), - requests = 0; - grunt.file.mkdir( "dist/tmp" ); - themes.forEach(function( theme, index ) { - requests += 1; - grunt.file.mkdir( "dist/tmp/" + index ); - var zipFileName = "dist/tmp/" + index + ".zip", - out = fs.createWriteStream( zipFileName ); - out.on( "close", function() { - grunt.log.writeln( "done downloading " + zipFileName ); - // TODO AdmZip produces "crc32 checksum failed", need to figure out why - // var zip = new AdmZip(zipFileName); - // zip.extractAllTo('dist/tmp/' + index + '/'); - // until then, using cli unzip... - grunt.utils.spawn({ - cmd: "unzip", - args: [ "-d", "dist/tmp/" + index, zipFileName ] - }, function( err, result ) { - grunt.log.writeln( "Unzipped " + zipFileName + ", deleting it now" ); - fs.unlinkSync( zipFileName ); - requests -= 1; - if (requests === 0) { - done(); - } - }); - }); - request( "http://ui-dev.jquery.com/download/?" + theme ).pipe( out ); - }); -}); - -grunt.registerTask( "copy_themes", function() { - // each package includes the base theme, ignore that - var filter = /themes\/base/, - files = grunt.file.expandFiles( "dist/tmp/*/development-bundle/themes/**/*" ).filter(function( file ) { - return !filter.test( file ); - }), - // TODO the grunt.template.process call shouldn't be necessary +grunt.registerTask( "generate_themes", function() { + var download, files, done, target = "dist/" + grunt.template.process( grunt.config( "files.themes" ), grunt.config() ) + "/", distFolder = "dist/" + grunt.template.process( grunt.config( "files.dist" ), grunt.config() ); - files.forEach(function( fileName ) { - var targetFile = fileName.replace( /dist\/tmp\/\d+\/development-bundle\//, "" ).replace( "jquery-ui-.custom", "jquery-ui" ); - grunt.file.copy( fileName, target + targetFile ); + try { + require.resolve( "download.jqueryui.com" ); + } 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 + grunt.file.expandFiles( distFolder + "/**" ).forEach(function( file ) { + grunt.file.copy( file, "node_modules/download.jqueryui.com/release/" + file.replace(/^dist/, "") ); }); - // copy minified base theme from regular release + download = new ( require( "download.jqueryui.com" ) )(); + files = grunt.file.expandFiles( distFolder + "/themes/base/**/*" ); files.forEach(function( fileName ) { grunt.file.copy( fileName, target + fileName.replace( distFolder, "" ) ); }); + + done = this.async(); + grunt.utils.async.forEach( download.themeroller.gallery(), function( theme, done ) { + var folderName = theme.folderName(), + concatTarget = "css-" + folderName, + cssContent = theme.css(), + cssFolderName = target + "themes/" + folderName + "/", + cssFileName = cssFolderName + "jquery.ui.theme.css", + cssFiles = grunt.config.get( "concat.css.src" )[ 1 ].slice(); + + grunt.file.write( cssFileName, cssContent ); + + // get css components, replace the last file with the current theme + cssFiles.splice(-1); + cssFiles.push( "" ); + grunt.config.get( "concat" )[ concatTarget ] = { + src: [ "", cssFiles ], + dest: cssFolderName + "jquery-ui.css" + }; + grunt.task.run( "concat:" + concatTarget ); + + theme.fetchImages(function( err, files ) { + if ( err ) { + done( err ); + return; + } + files.forEach(function( file ) { + grunt.file.write( cssFolderName + "images/" + file.path, file.data ); + }); + done(); + }); + }, function( err ) { + if ( err ) { + grunt.log.error( err ); + } + done( !err ); + }); }); grunt.registerTask( "clean", function() { require( "rimraf" ).sync( "dist" ); }); -}; \ No newline at end of file +}; diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index 759dfcb35..c3fbdbf9a 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -1,33 +1,32 @@ -/*jshint node: true */ module.exports = function( grunt ) { +"use strict"; + var versions = { "git": "git", + "1.8": "1.8.0 1.8.1 1.8.2", "1.7": "1.7 1.7.1 1.7.2", "1.6": "1.6 1.6.1 1.6.2 1.6.3 1.6.4" }, tests = { "Accordion": "accordion/accordion.html", - "Accordion_deprecated": "accordion/accordion_deprecated.html", "Autocomplete": "autocomplete/autocomplete.html", "Button": "button/button.html", "Core": "core/core.html", - //"datepicker/datepicker.html", - //"dialog/dialog.html", - //"draggable/draggable.html", - //"droppable/droppable.html", + //"Datepicker": "datepicker/datepicker.html", + //"Dialog": "dialog/dialog.html", + "Draggable": "draggable/draggable.html", + "Droppable": "droppable/droppable.html", "Effects": "effects/effects.html", "Menu": "menu/menu.html", "Position": "position/position.html", - "Position_deprecated": "position/position_deprecated.html", "Progressbar": "progressbar/progressbar.html", - //"resizable/resizable.html", - //"selectable/selectable.html", - //"slider/slider.html", - //"sortable/sortable.html", + "Resizable": "resizable/resizable.html", + "Selectable": "selectable/selectable.html", + //"Slider": "slider/slider.html", + "Sortable": "sortable/sortable.html", "Spinner": "spinner/spinner.html", "Tabs": "tabs/tabs.html", - "Tabs_deprecated": "tabs/tabs_deprecated.html", "Tooltip": "tooltip/tooltip.html", "Widget": "widget/widget.html" }; @@ -41,19 +40,20 @@ function submit( commit, tests, configFile, version, done ) { for ( test in tests ) { testUrls.push( testBase + tests[ test ] ); } + version = version ? ( version + " " ) : ""; testswarm({ url: config.swarmUrl, pollInterval: 10000, - timeout: 1000 * 60 * 30, + timeout: 1000 * 60 * 45, done: 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), + "runNames[]": Object.keys( tests ), "runUrls[]": testUrls, - "browserSets[]": ["popular"] + "browserSets[]": [ "popular-no-ie6" ] }); } @@ -73,7 +73,7 @@ grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, mino allTests[ test + "-" + version ] = tests[ test ] + "?nojshint=true&jquery=" + version; } }); - submit( commit, allTests, configFile, minor + " core ", this.async() ); + submit( commit, allTests, configFile, minor + " core", this.async() ); }); }; diff --git a/demos/accordion/collapsible.html b/demos/accordion/collapsible.html index e2e2d52a0..5fa3ba9a5 100644 --- a/demos/accordion/collapsible.html +++ b/demos/accordion/collapsible.html @@ -1,10 +1,10 @@ - + jQuery UI Accordion - Collapse content - + @@ -19,8 +19,6 @@ -
-

Section 1

@@ -45,13 +43,8 @@
-
- - -

By default, accordions always keep one section open. To allow for all sections to be be collapsible, set the collapsible option to true. Click on the currently open section to collapse its content pane.

-
- + diff --git a/demos/accordion/custom-icons.html b/demos/accordion/custom-icons.html index 02344bd12..660f1e198 100644 --- a/demos/accordion/custom-icons.html +++ b/demos/accordion/custom-icons.html @@ -1,10 +1,10 @@ - + jQuery UI Accordion - Customize icons - + @@ -31,8 +31,6 @@ -
-

Section 1

@@ -59,13 +57,8 @@ -
- - -

Customize the header icons with the icons option, which accepts classes for the header's default and active (open) state. Use any class from the UI CSS framework, or create custom classes with background images.

-
- +
diff --git a/demos/accordion/default.html b/demos/accordion/default.html index 681fbdcaf..28fe7cc6d 100644 --- a/demos/accordion/default.html +++ b/demos/accordion/default.html @@ -1,10 +1,10 @@ - + jQuery UI Accordion - Default functionality - + @@ -17,8 +17,6 @@ -
-

Section 1

@@ -68,8 +66,6 @@
-
-

Click headers to expand/collapse content that is broken into logical sections, much like tabs. @@ -79,7 +75,6 @@ Optionally, toggle sections open/closed on mouseover. The underlying HTML markup is a series of headers (H3 tags) and content divs so the content is usable without JavaScript.

-
- +
diff --git a/demos/accordion/fillspace.html b/demos/accordion/fillspace.html index ca2c5a0eb..bdc2939c5 100644 --- a/demos/accordion/fillspace.html +++ b/demos/accordion/fillspace.html @@ -1,16 +1,23 @@ - + jQuery UI Accordion - Fill space - + + + + @@ -19,8 +19,6 @@ -
-

Section 1

@@ -45,13 +43,8 @@
-
- - -

Setting heightStyle: "content" allows the accordion panels to keep their native height.

-
- + diff --git a/demos/accordion/sortable.html b/demos/accordion/sortable.html index fda6ae7ca..70841b3f2 100644 --- a/demos/accordion/sortable.html +++ b/demos/accordion/sortable.html @@ -1,10 +1,10 @@ - + jQuery UI Accordion - Sortable - + @@ -35,8 +35,6 @@ -
-

Section 1

@@ -69,13 +67,8 @@
-
- - -

Drag the header to re-order panels.

-
- + diff --git a/demos/addClass/default.html b/demos/addClass/default.html index 9d4b71455..ad3a1058d 100644 --- a/demos/addClass/default.html +++ b/demos/addClass/default.html @@ -1,10 +1,10 @@ - + jQuery UI Effects - addClass demo - + + @@ -37,8 +37,6 @@ -
-
@@ -49,14 +47,9 @@
-
- - -

The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.

The datasource is a server-side script which returns JSON data, specified via a simple URL for the source-option. In addition, the minLength-option is set to 2 to avoid queries that would return too many results and the select-event is used to display some feedback.

-
- + diff --git a/demos/autocomplete/xml.html b/demos/autocomplete/xml.html index 973d656cc..059c33d67 100644 --- a/demos/autocomplete/xml.html +++ b/demos/autocomplete/xml.html @@ -1,10 +1,10 @@ - + jQuery UI Autocomplete - XML data parsed once - + @@ -48,8 +48,6 @@ -
-
@@ -60,14 +58,9 @@
-
- - -

This demo shows how to retrieve some XML data, parse it using jQuery's methods, then provide it to the autocomplete as the datasource.

This should also serve as a reference on how to parse a remote XML datasource - the parsing would just happen for each request within the source-callback.

-
- + diff --git a/demos/button/checkbox.html b/demos/button/checkbox.html index dffc9bf93..4d597049a 100644 --- a/demos/button/checkbox.html +++ b/demos/button/checkbox.html @@ -1,10 +1,10 @@ - + jQuery UI Button - Checkboxes - + @@ -21,8 +21,6 @@ -
-
@@ -31,14 +29,9 @@
-
- - -

A checkbox is styled as a toggle button with the button widget. The label element associated with the checkbox is used for the button text.

This demo also demonstrates three checkboxes styled as a button set by calling .buttonset() on a common container.

-
- + diff --git a/demos/button/default.html b/demos/button/default.html index 90369f816..2423aa1a2 100644 --- a/demos/button/default.html +++ b/demos/button/default.html @@ -1,38 +1,34 @@ - + jQuery UI Button - Default functionality - + -
- An anchor -
- - -

Examples of the markup that can be used for buttons: A button element, an input of type submit and an anchor.

-
- + diff --git a/demos/button/icons.html b/demos/button/icons.html index b6cd4c599..78f01d707 100644 --- a/demos/button/icons.html +++ b/demos/button/icons.html @@ -1,56 +1,49 @@ - + jQuery UI Button - Icons - + -
- -
- - -
-

Some buttons with various combinations of text and icons, here specified via metadata.

-
- +

Some buttons with various combinations of text and icons.

+ diff --git a/demos/button/index.html b/demos/button/index.html index 23977c820..79560595b 100644 --- a/demos/button/index.html +++ b/demos/button/index.html @@ -1,23 +1,19 @@ - + jQuery UI Button Demos - - + diff --git a/demos/button/radio.html b/demos/button/radio.html index 2f0dc8fb8..763a50385 100644 --- a/demos/button/radio.html +++ b/demos/button/radio.html @@ -1,10 +1,10 @@ - + jQuery UI Button - Radios - + @@ -17,8 +17,6 @@ -
-
@@ -27,13 +25,8 @@
-
- - -

A set of three radio buttons transformed into a button set.

-
- + diff --git a/demos/button/splitbutton.html b/demos/button/splitbutton.html index abd99e42f..5b6493de5 100644 --- a/demos/button/splitbutton.html +++ b/demos/button/splitbutton.html @@ -1,10 +1,10 @@ - + jQuery UI Button - Split button - + @@ -49,30 +49,21 @@ -
- +
-
- - -
- + +
- -
- - + +
-

An example of a split button built with two buttons: A plain button with just text, one with only a primary icon and no text. Both are grouped together in a set.

- -
- + diff --git a/demos/button/toolbar.html b/demos/button/toolbar.html index 2902b8110..342ac8401 100644 --- a/demos/button/toolbar.html +++ b/demos/button/toolbar.html @@ -1,10 +1,10 @@ - + jQuery UI Button - Toolbar - + @@ -86,8 +86,6 @@ -
- @@ -95,9 +93,9 @@ - + - + @@ -105,16 +103,11 @@ -
- - -

A mediaplayer toolbar. Take a look at the underlying markup: A few button elements, an input of type checkbox for the Shuffle button, and three inputs of type radio for the Repeat options.

-
- + diff --git a/demos/datepicker/alt-field.html b/demos/datepicker/alt-field.html index 6323cf316..2599cd145 100644 --- a/demos/datepicker/alt-field.html +++ b/demos/datepicker/alt-field.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Populate alternate field - + @@ -20,17 +20,10 @@ -
-

Date:  

-
- - -

Populate an alternate field with its own date format whenever a date is selected using the altField and altFormat options. This feature could be used to present a human-friendly date for user selection, while passing a more computer-friendly date through for further processing.

-
- + diff --git a/demos/datepicker/animation.html b/demos/datepicker/animation.html index 3185b6718..8e170ad8e 100644 --- a/demos/datepicker/animation.html +++ b/demos/datepicker/animation.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Animations - + @@ -27,8 +27,6 @@ -
-

Date:

Animations:
@@ -46,13 +44,8 @@

-
- - -

Use different animations when opening or closing the datepicker. Choose an animation from the dropdown, then click on the input to see its effect. You can use one of the three standard animations or any of the UI Effects.

-
- + diff --git a/demos/datepicker/buttonbar.html b/demos/datepicker/buttonbar.html index 20c729266..b0b4650bb 100644 --- a/demos/datepicker/buttonbar.html +++ b/demos/datepicker/buttonbar.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Display button bar - + @@ -19,17 +19,10 @@ -
-

Date:

-
- - -

Display a button for selecting Today's date and a Done button for closing the calendar with the boolean showButtonPanel option. Each button is enabled by default when the bar is displayed, but can be turned off with additional options. Button text is customizable.

-
- + diff --git a/demos/datepicker/date-formats.html b/demos/datepicker/date-formats.html index 35a5e6bba..b50a92172 100644 --- a/demos/datepicker/date-formats.html +++ b/demos/datepicker/date-formats.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Format date - + @@ -20,8 +20,6 @@ -
-

Date:

Format options:
@@ -35,13 +33,8 @@

-
- - -

Display date feedback in a variety of ways. Choose a date format from the dropdown, then click on the input and select a date to see it in that format.

-
- + diff --git a/demos/datepicker/date-range.html b/demos/datepicker/date-range.html index 09ebba842..7fd8f321c 100644 --- a/demos/datepicker/date-range.html +++ b/demos/datepicker/date-range.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Select a Date Range - + @@ -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 ); } }); @@ -32,20 +32,13 @@ -
- -
- - -

Select the date range to search for.

-
- + diff --git a/demos/datepicker/default.html b/demos/datepicker/default.html index 869c4e99a..5a51a538c 100644 --- a/demos/datepicker/default.html +++ b/demos/datepicker/default.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Default functionality - + @@ -17,17 +17,10 @@ -
-

Date:

-
- - -

The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.

-
- + diff --git a/demos/datepicker/dropdown-month-year.html b/demos/datepicker/dropdown-month-year.html index eed1dfea9..ea4600a6f 100644 --- a/demos/datepicker/dropdown-month-year.html +++ b/demos/datepicker/dropdown-month-year.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Display month & year menus - + @@ -20,17 +20,10 @@ -
-

Date:

-
- - -

Show month and year dropdowns in place of the static month/year header to facilitate navigation through large timeframes. Add the boolean changeMonth and changeYear options.

-
- + diff --git a/demos/datepicker/icon-trigger.html b/demos/datepicker/icon-trigger.html index 3ec339ff8..9fca9b790 100644 --- a/demos/datepicker/icon-trigger.html +++ b/demos/datepicker/icon-trigger.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Icon trigger - + @@ -21,17 +21,10 @@ -
-

Date:

-
- - -

Click the icon next to the input field to show the datepicker. Set the datepicker to open on focus (default behavior), on icon click, or both.

-
- + diff --git a/demos/datepicker/index.html b/demos/datepicker/index.html index ed2477402..eb903a220 100644 --- a/demos/datepicker/index.html +++ b/demos/datepicker/index.html @@ -1,31 +1,27 @@ - + jQuery UI Datepicker Demos - - + diff --git a/demos/datepicker/inline.html b/demos/datepicker/inline.html index f32915082..ec01533ee 100644 --- a/demos/datepicker/inline.html +++ b/demos/datepicker/inline.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Display inline - + @@ -17,17 +17,10 @@ -
- Date:
-
- - -

Display the datepicker embedded in the page instead of in an overlay. Simply call .datepicker() on a div instead of an input.

-
- + diff --git a/demos/datepicker/localization.html b/demos/datepicker/localization.html index e7bb42c16..4fd7a1c46 100644 --- a/demos/datepicker/localization.html +++ b/demos/datepicker/localization.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Localize calendar - + @@ -90,8 +90,6 @@ -
-

Date:  

-
- - -

Localize the datepicker calendar language and format (English / Western formatting is the default). The datepicker includes built-in support for languages that read right-to-left, such as Arabic and Hebrew.

-
- + diff --git a/demos/datepicker/min-max.html b/demos/datepicker/min-max.html index cc1fbda42..cc28a7583 100644 --- a/demos/datepicker/min-max.html +++ b/demos/datepicker/min-max.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Restrict date range - + @@ -17,17 +17,10 @@ -
-

Date:

-
- - -

Restrict the range of selectable dates with the minDate and maxDate options. Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)), as a numeric offset from today (-20), or as a string of periods and units ('+1M +10D'). For the last, use 'D' for days, 'W' for weeks, 'M' for months, or 'Y' for years.

-
- + diff --git a/demos/datepicker/multiple-calendars.html b/demos/datepicker/multiple-calendars.html index 9ebd63c34..1a8b7e0eb 100644 --- a/demos/datepicker/multiple-calendars.html +++ b/demos/datepicker/multiple-calendars.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Display multiple months - + @@ -20,17 +20,10 @@ -
-

Date:

-
- - -

Set the numberOfMonths option to an integer of 2 or more to show multiple months in a single datepicker.

-
- + diff --git a/demos/datepicker/other-months.html b/demos/datepicker/other-months.html index e6b035801..e735385ec 100644 --- a/demos/datepicker/other-months.html +++ b/demos/datepicker/other-months.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Dates in other months - + @@ -20,18 +20,11 @@ -
-

Date:

-
- - -

The datepicker can show dates that come from other than the main month being displayed. These other dates can also be made selectable.

-
- + diff --git a/demos/datepicker/show-week.html b/demos/datepicker/show-week.html index eee2dd0ac..931e85be8 100644 --- a/demos/datepicker/show-week.html +++ b/demos/datepicker/show-week.html @@ -1,10 +1,10 @@ - + jQuery UI Datepicker - Show week of the year - + @@ -20,20 +20,13 @@ -
-

Date:

-
- - -

The datepicker can show the week of the year. The default calculation follows the ISO 8601 definition: the week starts on Monday, the first week of the year contains the first Thursday of the year. This means that some days from one year may be placed into weeks 'belonging' to another year.

-
- + diff --git a/demos/demos.css b/demos/demos.css index 807d025b5..da9ad833a 100644 --- a/demos/demos.css +++ b/demos/demos.css @@ -1,335 +1,19 @@ body { font-size: 62.5%; + font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"; } table { font-size: 1em; } -/* Site - -------------------------------- */ - -body { - font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; -} - -/* Layout - -------------------------------- */ - -.layout-grid { - width: 960px; - border-spacing: 0; - border-collapse: collapse; -} - -.layout-grid td { - vertical-align: top; -} - -.layout-grid td.left-nav { - width: 140px; -} - -.layout-grid td.normal { - border-left: 1px solid #eee; - padding: 20px 24px; - font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; -} - -.layout-grid td.demos { - background: url('/images/demos_bg.jpg') no-repeat; - height: 337px; - overflow: hidden; -} - -/* Normal - -------------------------------- */ - -.normal h3, -.normal h4 { - margin: 0; - font-weight: normal; -} - -.normal h3 { - padding: 0 0 9px; - font-size: 1.8em; -} - -.normal h4 { - padding-bottom: 21px; - border-bottom: 1px dashed #999; - font-size: 1.2em; - font-weight: bold; -} - -.normal p { - font-size: 1.2em; -} - -/* Demos */ - -.demos-nav, .demos-nav dt, .demos-nav dd, .demos-nav ul, .demos-nav li { - margin: 0; - padding: 0 -} - -.demos-nav { - float: left; - width: 170px; - font-size: 1.3em; -} - -.demos-nav dt, -.demos-nav h4 { - margin: 0; - padding: 0; - font: normal 1.1em "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; - color: #e87b10; -} - -.demos-nav dt, -.demos-nav h4 { - margin-top: 1.5em; - margin-bottom: 0; - padding-left: 8px; - padding-bottom:5px; - line-height: 1.2em; - border-bottom: 1px solid #F4F4F4; -} - -.demos-nav dd a, -.demos-nav li a { - border-bottom: 1px solid #F4F4F4; - display:block; - padding: 4px 3px 4px 8px; - font-size: 90%; - text-decoration: none; - color: #555 ; - margin:2px 0; - height:13px; -} - -.demos-nav dd a:hover, -.demos-nav dd a:focus, -.demos-nav dd a:hover, -.demos-nav dd a:focus { - background: #f3f3f3; - color:#000; - -moz-border-radius: 5px; -webkit-border-radius: 5px; -} - .demos-nav dd a.selected { - background: #555; - color:#ffffff; - -moz-border-radius: 5px; -webkit-border-radius: 5px; -} - - -/* new styles for demo pages, added by Filament 12.29.08 -eventually we should convert the font sizes to ems -- using px for now to minimize style conflicts -*/ - -.normal h3.demo-header { font-size:32px; padding:0 0 5px; border-bottom:1px solid #eee; text-transform: capitalize; } -.normal h4.demo-subheader { font-size:10px; text-transform: uppercase; color:#999; padding:8px 0 3px; border:0; margin:0; } -#demo-notes a, #demo-link a, #demo-source a { color:#1b75bb; text-decoration:none; } -.normal a:hover, -.normal a:active { color:#0b559b; } - -#demo-config { padding:20px 0 0; } - -#demo-frame { float:left; width:540px; height:380px; border:1px solid #ddd; overflow: auto; position: relative; } -#demo-frame h3, #demo-frame h4 { padding: 0; font-weight: bold; font-size: 1em; } - -#demo-config-menu { float:right; width:180px; } -#demo-config-menu h4 { font-size:13px; color:#666; font-weight:normal; border:0; padding-left:18px; } - -#demo-config-menu ul { list-style: none; padding: 0; margin: 0; } - -#demo-config-menu li { font-size:12px; padding:0 0 0 10px; margin:3px 0; zoom: 1; } - -#demo-config-menu li a:link, -#demo-config-menu li a:visited { display:block; padding:1px 8px 4px; border-bottom:1px dotted #b3b3b3; } -* html #demo-config-menu li a:link, -* html #demo-config-menu li a:visited { padding:1px 8px 2px; } -#demo-config-menu li a:hover, -#demo-config-menu li a:active { background-color:#f6f6f6; } - -#demo-config-menu li.demo-config-on { background: url(images/demo-config-on-tile.gif) repeat-x left center; } - -#demo-config-menu li.demo-config-on a:link, -#demo-config-menu li.demo-config-on a:visited, -#demo-config-menu li.demo-config-on a:hover, -#demo-config-menu li.demo-config-on a:active { background: url(images/demo-config-on.gif) no-repeat left; padding-left:18px; color:#fff; border:0; margin-left:-10px; margin-top: 0px; margin-bottom: 0px; } - -#demo-source, #demo-notes { +.demo-description { clear: both; - padding: 20px 0 0; - font-size: 1.3em; -} - -#demo-notes { width:520px; color:#333; font-size: 1em; } -#demo-notes p code, .demo-description p code { padding: 0; font-weight: bold; } -#demo-source pre, #demo-source code { padding: 0; } -code, pre { padding:8px 0 8px 20px ; font-size: 1.2em; line-height:130%; } - -#demo-source a:link, -#demo-source a:visited, -#demo-source a:hover, -#demo-source a:active { font-size:12px; padding-left:13px; background-position: left center; background-repeat: no-repeat; } - -#demo-source a.source-open:link, -#demo-source a.source-open:visited, -#demo-source a.source-open:hover, -#demo-source a.source-open:active { background-image: url(images/demo-spindown-open.gif); } - -#demo-source a.source-closed:link, -#demo-source a.source-closed:visited, -#demo-source a.source-closed:hover, -#demo-source a.source-closed:active { background-image: url(images/demo-spindown-closed.gif); } - -div.demo { - padding:12px; - font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"; -} - -div.demo h3.docs { clear:left; font-size:12px; font-weight:normal; padding:0 0 1em; margin:0; } - -div.demo-description { - clear:both; - padding:12px; - font-family: "Trebuchet MS", "Arial", "Helvetica", "Verdana", "sans-serif"; + padding: 12px; font-size: 1.3em; line-height: 1.4em; } .ui-draggable, .ui-droppable { - background-position: top left; + background-position: top; } - -.left-nav .demos-nav { - padding-right: 10px; -} - -#demo-link { font-size:11px; padding-top: 6px; clear: both; overflow: hidden; } -#demo-link a span.ui-icon { float:left; margin-right:3px; } - -/* Component containers -----------------------------------*/ -#widget-docs .ui-widget { font-family: Trebuchet MS,Verdana,Arial,sans-serif; font-size: 1em; } -#widget-docs .ui-widget input, #widget-docs .ui-widget select, #widget-docs .ui-widget textarea, #widget-docs .ui-widget button { font-family: Trebuchet MS,Verdana,Arial,sans-serif; font-size: 1em; } -#widget-docs .ui-widget-header { border: 1px solid #ffffff; background: #464646 url(images/464646_40x100_textures_01_flat_100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -#widget-docs .ui-widget-header a { color: #ffffff; } -#widget-docs .ui-widget-content { border: 1px solid #ffffff; background: #ffffff url(images/ffffff_40x100_textures_01_flat_75.png) 50% 50% repeat-x; color: #222222; } -#widget-docs .ui-widget-content a { color: #222222; } - -/* Interaction states -----------------------------------*/ -#widget-docs .ui-state-default, #widget-docs .ui-widget-content #widget-docs .ui-state-default { border: 1px solid #666666; background: #555555 url(images/555555_40x100_textures_03_highlight_soft_75.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } -#widget-docs .ui-state-default a { color: #ffffff; text-decoration: none; outline: none; } -#widget-docs .ui-state-hover, #widget-docs .ui-widget-content #widget-docs .ui-state-hover, #widget-docs .ui-state-focus, #widget-docs .ui-widget-content #widget-docs .ui-state-focus { border: 1px solid #666666; background: #444444 url(images/444444_40x100_textures_03_highlight_soft_60.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; outline: none; } -#widget-docs .ui-state-hover a { color: #ffffff; text-decoration: none; outline: none; } -#widget-docs .ui-state-active, #widget-docs .ui-widget-content #widget-docs .ui-state-active { border: 1px solid #666666; background: #ffffff url(images/ffffff_40x100_textures_01_flat_65.png) 50% 50% repeat-x; font-weight: normal; color: #F6921E; outline: none; } -#widget-docs .ui-state-active a { color: #F6921E; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -#widget-docs .ui-state-highlight, #widget-docs .ui-widget-content #widget-docs .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/fbf9ee_40x100_textures_02_glass_55.png) 50% 50% repeat-x; color: #363636; } -#widget-docs .ui-state-error, #widget-docs .ui-widget-content #widget-docs .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/fef1ec_40x100_textures_05_inset_soft_95.png) 50% bottom repeat-x; color: #cd0a0a; } -#widget-docs .ui-state-error-text, #widget-docs .ui-widget-content #widget-docs .ui-state-error-text { color: #cd0a0a; } -#widget-docs .ui-state-disabled, #widget-docs .ui-widget-content #widget-docs .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -#widget-docs .ui-priority-primary, #widget-docs .ui-widget-content #widget-docs .ui-priority-primary { font-weight: bold; } -#widget-docs .ui-priority-secondary, #widget-docs .ui-widget-content #widget-docs .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -#demo-frame-wrapper .ui-icon, #widget-docs .ui-icon { width: 16px; height: 16px; background-image: url(images/222222_256x240_icons_icons.png); } -#widget-docs .ui-widget-content .ui-icon {background-image: url(images/222222_256x240_icons_icons.png); } -#widget-docs .ui-widget-header .ui-icon {background-image: url(images/222222_256x240_icons_icons.png); } -#widget-docs .ui-state-default .ui-icon { background-image: url(images/888888_256x240_icons_icons.png); } -#widget-docs .ui-state-hover .ui-icon, #widget-docs .ui-state-focus .ui-icon {background-image: url(images/454545_256x240_icons_icons.png); } -#widget-docs .ui-state-active .ui-icon {background-image: url(images/454545_256x240_icons_icons.png); } -#widget-docs .ui-state-highlight .ui-icon {background-image: url(images/2e83ff_256x240_icons_icons.png); } -#widget-docs .ui-state-error .ui-icon, #widget-docs .ui-state-error-text .ui-icon {background-image: url(images/cd0a0a_256x240_icons_icons.png); } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -#widget-docs .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } -#widget-docs .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -#widget-docs .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -#widget-docs .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -#widget-docs .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -#widget-docs .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -#widget-docs .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -#widget-docs .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -#widget-docs .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } - -/* Overlays */ -#widget-docs .ui-widget-overlay { background: #aaaaaa url(images/aaaaaa_40x100_textures_01_flat_0.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -#widget-docs .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/aaaaaa_40x100_textures_01_flat_0.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; } - -/* -----------------------------------*/ - -#widget-docs { margin:20px 0 0; border: none; } - -#widget-docs h2, #widget-docs h3, #widget-docs h4, #widget-docs p, #widget-docs ul, #widget-docs code { margin:0; padding:0; } -#widget-docs code { display:block; color:#444; font-size:.9em; margin:0 0 1em; } -#widget-docs code strong { color:#000; } -#widget-docs p { margin:0 3em 1.2em 0; } -#widget-docs p.intro { font-size:13px; color:#666; line-height:1.3; } -#widget-docs ul { list-style-type: none; } - -#widget-docs h2 { font-size:16px; margin:1.2em 0 .5em; } -#widget-docs h3 { font-size:14px; color:#e6820E; margin:1.5em 0 .5em; } -.normal #widget-docs h4 { font-size:12px; color:#000; border:0; margin:0 0 .5em; } - -#docs-overview-main { width:400px; } -#docs-overview-sidebar { float:right; width:200px; } -#docs-overview-sidebar a span { color:#666; } -#widget-docs #docs-overview-main p { margin-right:0; } -#widget-docs #docs-overview-sidebar h4 { padding-left:0; } - -.docs-list-header { float:left; width:100%; margin:10px 0 0; border-bottom:1px solid #eee; } -#widget-docs .docs-list-header h2 { float:left; margin:0; } -#widget-docs .docs-list-header p { float:right; margin:5px 0; font-size:11px; } - -.docs-list { float:left; width:100%; padding:0 0 10px; } -.docs-list .param-header { float:left; clear:left; width:100%; padding:8px 0; border-top:1px solid #eee; } -#widget-docs .param-header h3, #widget-docs .param-header p { margin:0; float:left; } -#widget-docs .param-header h3 { width:50%; } -#widget-docs .param-header h3 span { background: url(images/demo-spindown-closed.gif) no-repeat left; padding-left:13px; } -#widget-docs .param-open .param-header h3 span { background: url(images/demo-spindown-open.gif) no-repeat left; } -#widget-docs .param-header p { width:24%; } -#widget-docs .param-header p.param-type span { background: url(images/icon-docs-info.gif) no-repeat left; cursor:pointer; border-bottom:1px dashed #ccc; padding-left:15px; } - -.param-details { padding-left:13px; } -.param-args { margin:0 0 1.5em; border-top:1px dotted #ccc;} -.param-args td { padding:3px 30px 3px 5px; border-bottom:1px dotted #ccc; } - - -/* overrides for ui-tab styles */ -#widget-docs ul.ui-tabs-nav { padding:0 0 0 8px; } -#widget-docs .ui-tabs-nav li { margin:5px 5px 0 0; } - -#widget-docs .ui-tabs-nav li a:link, -#widget-docs .ui-tabs-nav li a:visited, -#widget-docs .ui-tabs-nav li a:hover, -#widget-docs .ui-tabs-nav li a:active { font-size:14px; padding:4px 1.2em 3px; color:#fff; } - -#widget-docs .ui-tabs-nav li.ui-tabs-active a:link, -#widget-docs .ui-tabs-nav li.ui-tabs-active a:visited, -#widget-docs .ui-tabs-nav li.ui-tabs-active a:hover, -#widget-docs .ui-tabs-nav li.ui-tabs-active a:active { color:#e6820E; } - -#widget-docs .ui-tabs-panel { padding:20px 9px; font-size:12px; line-height:1.4; color:#000; } - -#widget-docs .ui-widget-content a:link, -#widget-docs .ui-widget-content a:visited { color:#1b75bb; text-decoration:none; } -#widget-docs .ui-widget-content a:hover, -#widget-docs .ui-widget-content a:active { color:#0b559b; } - diff --git a/demos/dialog/animated.html b/demos/dialog/animated.html index 610d38d69..92d7b642d 100644 --- a/demos/dialog/animated.html +++ b/demos/dialog/animated.html @@ -1,11 +1,10 @@ - + jQuery UI Dialog - Animation - - + @@ -18,39 +17,35 @@ -
-

This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.

-
- - -

Dialogs may be animated by specifying an effect for the show and/or hide properties. You must include the individual effects file for any effects you would like to use.

-
- + diff --git a/demos/dialog/default.html b/demos/dialog/default.html index bd976a168..19cf912e2 100644 --- a/demos/dialog/default.html +++ b/demos/dialog/default.html @@ -1,11 +1,10 @@ - + jQuery UI Dialog - Default functionality - - + @@ -22,33 +21,12 @@ -
-

This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.

- -
-

Sed vel diam id libero rutrum convallis. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.

-
-
- checkbox
- radio
-

-
-
-
- -
- - -

The basic dialog window is an overlay positioned within the viewport and is protected from page content (like select elements) shining through with an iframe. It has a title bar and a content area, and can be moved, resized and closed with the 'x' icon by default.

-
- + diff --git a/demos/dialog/index.html b/demos/dialog/index.html index 460e4fb36..6aaa3ecb5 100644 --- a/demos/dialog/index.html +++ b/demos/dialog/index.html @@ -1,23 +1,19 @@ - + jQuery UI Dialog Demos - - + diff --git a/demos/dialog/modal-confirmation.html b/demos/dialog/modal-confirmation.html index f0b70b7d6..b9bf6396f 100644 --- a/demos/dialog/modal-confirmation.html +++ b/demos/dialog/modal-confirmation.html @@ -1,11 +1,10 @@ - + jQuery UI Dialog - Modal confirmation - - + @@ -16,9 +15,6 @@ - + @@ -30,9 +29,6 @@ - + @@ -17,9 +16,6 @@ - + @@ -16,9 +15,6 @@ + @@ -16,6 +16,7 @@ #draggable { cursor: n-resize; } #draggable2 { cursor: e-resize; } #containment-wrapper { width: 95%; height:150px; border:2px solid #ccc; padding: 10px; } + h3 { clear: left; } + @@ -56,8 +56,6 @@ -
-

I will always stick to the center (relative to the pointer)

@@ -66,13 +64,8 @@

My cursor position is always at the top

- - - -

The beforeStart callback allows you to position the draggable element in order to adjust where the draggable movements will be calculated from. In this example, we adjust the position to control where the element is relative to the pointer during the drag.

-
- + diff --git a/demos/draggable/default.html b/demos/draggable/default.html index 1f8e59b66..72d6c306b 100644 --- a/demos/draggable/default.html +++ b/demos/draggable/default.html @@ -1,10 +1,10 @@ - + jQuery UI Draggable - Default functionality - + @@ -21,19 +21,12 @@ -
-

Drag me around

-
- - -

Enable draggable functionality on any DOM element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport.

-
- + diff --git a/demos/draggable/delay-start.html b/demos/draggable/delay-start.html index 76e91b914..fe74e908f 100644 --- a/demos/draggable/delay-start.html +++ b/demos/draggable/delay-start.html @@ -1,10 +1,10 @@ - + jQuery UI Draggable - Delay start - + @@ -23,8 +23,6 @@ -
-

Only if you drag me by 20 pixels, the dragging will start

@@ -33,13 +31,8 @@

Regardless of the distance, you have to drag and wait for 1000ms before dragging starts

- - - -

Delay the start of dragging for a number of milliseconds with the delay option; prevent dragging until the cursor is held down and dragged a specifed number of pixels with the distance option.

-
- + diff --git a/demos/draggable/events.html b/demos/draggable/events.html index 46fb7048c..6925cff6a 100644 --- a/demos/draggable/events.html +++ b/demos/draggable/events.html @@ -1,10 +1,10 @@ - + jQuery UI Draggable - Events - + @@ -45,8 +45,6 @@ -
-

Drag me to trigger the chain of events.

@@ -58,13 +56,8 @@
-
- - -

Layer functionality onto the draggable using the start, drag, and stop events. Start is fired at the start of the drag; drag during the drag; and stop when dragging stops.

-
- + diff --git a/demos/draggable/handle.html b/demos/draggable/handle.html index e6a402ee4..c7229e990 100644 --- a/demos/draggable/handle.html +++ b/demos/draggable/handle.html @@ -1,10 +1,10 @@ - + jQuery UI Draggable - Handles - + @@ -36,8 +36,6 @@ -
-

I can be dragged only by this handle

@@ -47,14 +45,9 @@

…but you can't drag me by this element.

- - - -

Allow dragging only when the cursor is over a specific part of the draggable. Use the handle option to specify the jQuery selector of an element (or group of elements) used to drag the object.

Or prevent dragging when the cursor is over a specific element (or group of elements) within the draggable. Use the cancel option to specify a jQuery selector over which to "cancel" draggable functionality.

-
- + diff --git a/demos/draggable/index.html b/demos/draggable/index.html index 1c57161fa..9a63a5ff3 100644 --- a/demos/draggable/index.html +++ b/demos/draggable/index.html @@ -1,29 +1,25 @@ - + jQuery UI Draggable Demos - - + diff --git a/demos/draggable/map.html b/demos/draggable/map.html index d89b385a8..e57ea24db 100644 --- a/demos/draggable/map.html +++ b/demos/draggable/map.html @@ -1,11 +1,11 @@ - + jQuery UI Draggable - Draggable Map - + @@ -62,19 +62,12 @@ -
- -
- -
- -
- - +
+ +

Drag the map around inside the viewport. Works with touch devices. The container is kept small for the demo to work.

-
- + diff --git a/demos/draggable/revert.html b/demos/draggable/revert.html index b5bd9bd5a..b64586295 100644 --- a/demos/draggable/revert.html +++ b/demos/draggable/revert.html @@ -1,10 +1,10 @@ - + jQuery UI Draggable - Revert position - + @@ -35,8 +35,6 @@ -
-

Revert the original

@@ -45,13 +43,8 @@

Revert the helper

- - - -

The stop callback can be used to perform an action after the user finishing dragging the element. For example, if you want to return the draggable (or it's helper) to its original location when dragging stops, you can do so in the stop callback.

-
- + diff --git a/demos/draggable/scroll.html b/demos/draggable/scroll.html index 8e3c789fb..c4498096c 100644 --- a/demos/draggable/scroll.html +++ b/demos/draggable/scroll.html @@ -1,10 +1,10 @@ - + jQuery UI Draggable - Auto-scroll - + @@ -23,8 +23,6 @@ -
-

Scroll set to true, default settings

@@ -39,13 +37,8 @@
-
- - -

Automatically scroll the document when the draggable is moved beyond the viewport. Set the scroll option to true to enable auto-scrolling, and fine-tune when scrolling is triggered and its speed with the scrollSensitivity and scrollSpeed options.

-
- + diff --git a/demos/draggable/snap-to.html b/demos/draggable/snap-to.html index a0f38f866..33feb68d4 100644 --- a/demos/draggable/snap-to.html +++ b/demos/draggable/snap-to.html @@ -1,10 +1,10 @@ - + jQuery UI Draggable - Snap to element or grid - + @@ -27,8 +27,6 @@ -
-

I'm a snap target

@@ -55,14 +53,9 @@

I snap to a 80 x 80 grid

- - - -

Snap the draggable to the inner or outer boundaries of a DOM element. Use the snap, snapMode (inner, outer, both), and snapTolerance (distance in pixels the draggable must be from the element when snapping is invoked) options.

Or snap the draggable to a grid. Set the dimensions of grid cells (height and width in pixels) with the grid option.

-
- + diff --git a/demos/draggable/sortable.html b/demos/draggable/sortable.html index 75b15b968..55bfd591f 100644 --- a/demos/draggable/sortable.html +++ b/demos/draggable/sortable.html @@ -1,10 +1,10 @@ - + jQuery UI Draggable + Sortable - + @@ -12,8 +12,8 @@ + @@ -31,9 +31,7 @@ -
- -

With helpers:

+

With helpers:

Original

@@ -47,7 +45,8 @@

Custom helper

-

Stacked:

+

Stacked:

+

We are draggables..

@@ -62,13 +61,8 @@
-
- - -

Provide feedback to users as they drag an element in the form of a helper. The helper option accepts the values false/null (the draggable element moves with the cursor), true (a clone of the draggable moves with the cursor), or a function that returns a DOM element or jQuery object (that element is shown near the cursor during drag).

-
- + diff --git a/demos/droppable/accepted-elements.html b/demos/droppable/accepted-elements.html index 7e8451571..455e8bd5f 100644 --- a/demos/droppable/accepted-elements.html +++ b/demos/droppable/accepted-elements.html @@ -1,10 +1,10 @@ - + jQuery UI Droppable - Accept - + @@ -34,8 +34,6 @@ -
-

I'm draggable but can't be dropped

@@ -48,13 +46,8 @@

accept: '#draggable'

- - - -

Specify using the accept option which element (or group of elements) is accepted by the target droppable.

-
- + diff --git a/demos/droppable/default.html b/demos/droppable/default.html index be945ae58..d9d828271 100644 --- a/demos/droppable/default.html +++ b/demos/droppable/default.html @@ -1,10 +1,10 @@ - + jQuery UI Droppable - Default functionality - + @@ -31,8 +31,6 @@ -
-

Drag me to my target

@@ -41,13 +39,8 @@

Drop here

- - - -

Enable any DOM element to be droppable, a target for draggable elements.

-
- + diff --git a/demos/droppable/index.html b/demos/droppable/index.html index 13ae9855e..deca6e4bc 100644 --- a/demos/droppable/index.html +++ b/demos/droppable/index.html @@ -1,24 +1,20 @@ - + jQuery UI Droppable Demos - - + diff --git a/demos/droppable/photo-manager.html b/demos/droppable/photo-manager.html index d3586e62e..7da5f5370 100644 --- a/demos/droppable/photo-manager.html +++ b/demos/droppable/photo-manager.html @@ -1,10 +1,10 @@ - + jQuery UI Droppable - Simple photo manager - + @@ -15,7 +15,7 @@ + @@ -25,15 +25,15 @@ #button { padding: .5em 1em; text-decoration: none; } #effect { width: 240px; height: 135px; padding: 0.4em; position: relative; } #effect h3 { margin: 0; padding: 0.4em; text-align: center; } - .ui-effects-transfer { border: 2px dotted gray; } + .ui-effects-transfer { border: 2px dotted gray; } + - +
- -

A menu with the default configuration. A list is transformed, adding theming, mouse and keyboard navigation support. Try to tab to the menu then use the cursor keys to navigate.

- -
- +

A menu with the default configuration, disabled items and nested menus. A list is transformed, adding theming, mouse and keyboard navigation support. Try to tab to the menu then use the cursor keys to navigate.

+ diff --git a/demos/menu/icons.html b/demos/menu/icons.html new file mode 100644 index 000000000..56cf242f3 --- /dev/null +++ b/demos/menu/icons.html @@ -0,0 +1,44 @@ + + + + + jQuery UI Menu - Icons + + + + + + + + + + + + + + +
+

A menu with the default configuration, showing how to use a menu with icons.

+
+ + diff --git a/demos/menu/index.html b/demos/menu/index.html index f5a49799a..40e9e0b54 100644 --- a/demos/menu/index.html +++ b/demos/menu/index.html @@ -3,16 +3,13 @@ jQuery UI Menu Demos - - + + + diff --git a/demos/menu/navigationmenu.html b/demos/menu/navigationmenu.html deleted file mode 100644 index 94dc1b8fa..000000000 --- a/demos/menu/navigationmenu.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - jQuery UI Menu - Navigation Menu - - - - - - - - - - - - -
- - - -
- -
- -

A navigation menu. A list is transformed, adding theming, mouse and keyboard navigation support. Try to tab to the menu then use the cursor keys to navigate.

- -
- - - diff --git a/demos/menu/topalignmenu.html b/demos/menu/topalignmenu.html deleted file mode 100644 index a6ac11520..000000000 --- a/demos/menu/topalignmenu.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - Menu Demo: Top-aligned Menu - - - - - - - - - - - - - - - - diff --git a/demos/position/cycler.html b/demos/position/cycler.html index 490d88fcb..dc9c8a0bd 100644 --- a/demos/position/cycler.html +++ b/demos/position/cycler.html @@ -1,92 +1,82 @@ - + - jQuery UI Position - Default functionality + jQuery UI Position - Image Cycler - + - + + @@ -48,7 +48,6 @@ of: $( "#parent" ), my: $( "#my_horizontal" ).val() + " " + $( "#my_vertical" ).val(), at: $( "#at_horizontal" ).val() + " " + $( "#at_vertical" ).val(), - offset: $( "#offset" ).val(), collision: $( "#collision_horizontal" ).val() + " " + $( "#collision_vertical" ).val() }); } @@ -67,8 +66,6 @@ -
-

This is the position parent element. @@ -115,10 +112,6 @@

-
- offset: - -
collision: -
- - -

Display only an outline of the element while resizing by setting the helper option to a CSS class.

-
- +
diff --git a/demos/resizable/visual-feedback.html b/demos/resizable/visual-feedback.html index 06765defe..3577c7556 100644 --- a/demos/resizable/visual-feedback.html +++ b/demos/resizable/visual-feedback.html @@ -1,10 +1,10 @@ - + jQuery UI Resizable - Visual feedback - + @@ -25,19 +25,12 @@ -
-

Ghost

-
- - -

Instead of showing the actual element during resize, set the ghost option to true to show a semi-transparent part of the element.

-
- + diff --git a/demos/selectable/default.html b/demos/selectable/default.html index 91cc3d0cf..da39ffe84 100644 --- a/demos/selectable/default.html +++ b/demos/selectable/default.html @@ -1,16 +1,16 @@ - + jQuery UI Selectable - Default functionality - + - + + - + + - + - + + - + - + - + + - - - - - - - - - - - - -
- -
- -
- -
-

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

-
-
-

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

-
-
-

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.

-

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.

-
-
- -
- - - -
-

Control tabs with a slider.

-
- - - diff --git a/demos/sortable/connect-lists-through-tabs.html b/demos/sortable/connect-lists-through-tabs.html index ff69d5d97..92ebb7e6f 100644 --- a/demos/sortable/connect-lists-through-tabs.html +++ b/demos/sortable/connect-lists-through-tabs.html @@ -1,10 +1,10 @@ - + jQuery UI Sortable - Connect lists with Tabs - + @@ -39,7 +39,6 @@ -
    @@ -66,13 +65,8 @@
- - - -

Sort items from one list into another and vice versa, by dropping the list item on the appropriate tab above.

-
- + diff --git a/demos/sortable/connect-lists.html b/demos/sortable/connect-lists.html index 275859e0e..1ed6165da 100644 --- a/demos/sortable/connect-lists.html +++ b/demos/sortable/connect-lists.html @@ -1,10 +1,10 @@ - + jQuery UI Sortable - Connect lists - + @@ -23,7 +23,6 @@ -
  • Item 1
  • @@ -41,10 +40,6 @@
  • Item 5
-
- - -

Sort items from one list into another and vice versa, by passing a selector into @@ -52,7 +47,6 @@ group all related lists with a CSS class, and then pass that class into the sortable function (i.e., connectWith: '.myclass').

-
- + diff --git a/demos/sortable/default.html b/demos/sortable/default.html index 3590de17f..9fc4afabe 100644 --- a/demos/sortable/default.html +++ b/demos/sortable/default.html @@ -1,10 +1,10 @@ - + jQuery UI Sortable - Default functionality - + @@ -23,7 +23,6 @@ -
  • Item 1
  • @@ -35,17 +34,12 @@
  • Item 7
-
- - -

Enable a group of DOM elements to be sortable. Click on and drag an element to a new spot within the list, and the other items will adjust to fit. By default, sortable items share draggable properties.

-
- + diff --git a/demos/sortable/delay-start.html b/demos/sortable/delay-start.html index 6096e9a5c..3afe83ae0 100644 --- a/demos/sortable/delay-start.html +++ b/demos/sortable/delay-start.html @@ -1,10 +1,10 @@ - + jQuery UI Sortable - Delay start - + @@ -19,7 +19,7 @@ $( "#sortable1" ).sortable({ delay: 300 }); - + $( "#sortable2" ).sortable({ distance: 15 }); @@ -29,7 +29,6 @@ -

Time delay of 300ms:

@@ -49,10 +48,6 @@
  • Item 4
  • -
    - - -

    Prevent accidental sorting either by delay (time) or distance. Set a number of @@ -61,7 +56,6 @@ needs to be dragged before sorting starts with the distance option.

    -
    - + diff --git a/demos/sortable/display-grid.html b/demos/sortable/display-grid.html index a9287d204..e471a58b0 100644 --- a/demos/sortable/display-grid.html +++ b/demos/sortable/display-grid.html @@ -1,17 +1,17 @@ - + jQuery UI Sortable - Display as grid - + -
    • 1
    • @@ -39,16 +38,11 @@
    • 12
    -
    - - -

    To arrange sortable items as a grid, give them identical dimensions and float them using CSS.

    -
    - + diff --git a/demos/sortable/empty-lists.html b/demos/sortable/empty-lists.html index 87b581844..4d5d425b7 100644 --- a/demos/sortable/empty-lists.html +++ b/demos/sortable/empty-lists.html @@ -1,10 +1,10 @@ - + jQuery UI Sortable - Handle empty lists - + @@ -30,7 +30,6 @@ -
    • Can be dropped..
    • @@ -51,11 +50,7 @@
      -
      - -
    - - +

    @@ -63,7 +58,6 @@ using the dropOnEmpty option set to false. By default, sortable items can be dropped on empty lists.

    -
    - + diff --git a/demos/sortable/index.html b/demos/sortable/index.html index b307ef777..66b0b5ced 100644 --- a/demos/sortable/index.html +++ b/demos/sortable/index.html @@ -1,26 +1,22 @@ - + jQuery UI Sortable Demos - - + diff --git a/demos/sortable/items.html b/demos/sortable/items.html index 07a2ca963..7ecc616ae 100644 --- a/demos/sortable/items.html +++ b/demos/sortable/items.html @@ -1,10 +1,10 @@ - + jQuery UI Sortable - Include / exclude items - + @@ -29,7 +29,6 @@ -

    Specify which items are sortable:

    @@ -49,10 +48,6 @@
  • Item 4
  • -
    - - -

    Specify which items are eligible to sort by passing a jQuery selector into @@ -64,7 +59,6 @@ cancel option. Cancelled items remain valid sort targets for others.

    -
    - + diff --git a/demos/sortable/placeholder.html b/demos/sortable/placeholder.html index 4aa07ce15..158226672 100644 --- a/demos/sortable/placeholder.html +++ b/demos/sortable/placeholder.html @@ -1,10 +1,10 @@ - + jQuery UI Sortable - Drop placeholder - + @@ -26,7 +26,6 @@ -
    • Item 1
    • @@ -38,10 +37,6 @@
    • Item 7
    -
    - - -

    When dragging a sortable item to a new location, other items will make room @@ -50,7 +45,6 @@ be visible. Use the boolean forcePlaceholderSize option to set dimensions on the placeholder.

    -
    - + diff --git a/demos/sortable/portlets.html b/demos/sortable/portlets.html index a932dbc1a..545c4df59 100644 --- a/demos/sortable/portlets.html +++ b/demos/sortable/portlets.html @@ -1,10 +1,10 @@ - + jQuery UI Sortable - Portlets - + @@ -42,7 +42,6 @@ -
    @@ -50,7 +49,7 @@
    Feeds
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit
    - +
    News
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit
    @@ -73,7 +72,7 @@
    Links
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit
    - +
    Images
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit
    @@ -81,16 +80,11 @@
    -
    - - -

    Enable portlets (styled divs) as sortables and use the connectWith option to allow sorting between columns.

    -
    - + diff --git a/demos/spinner/currency.html b/demos/spinner/currency.html index a52f187c1..0b9975808 100644 --- a/demos/spinner/currency.html +++ b/demos/spinner/currency.html @@ -2,9 +2,9 @@ - jQuery UI Spinner - Default functionality + jQuery UI Spinner - Currency - + @@ -32,8 +32,6 @@ -
    -

    -
    - - -

    Example of a donation form, with currency selection and amount spinner.

    -
    - + diff --git a/demos/spinner/decimal.html b/demos/spinner/decimal.html index 87e413da8..3ab3ea073 100644 --- a/demos/spinner/decimal.html +++ b/demos/spinner/decimal.html @@ -4,7 +4,7 @@ jQuery UI Spinner - Decimal - + @@ -31,8 +31,6 @@ -
    -

    @@ -46,10 +44,6 @@

    -
    - - -

    Example of a decimal spinner. Step is set to 0.01. @@ -57,7 +51,6 @@ then changes the culture, then sets the value again, resulting in an updated formatting, based on the new culture.

    -
    - + diff --git a/demos/spinner/default.html b/demos/spinner/default.html index b857a9095..a79f4d45d 100644 --- a/demos/spinner/default.html +++ b/demos/spinner/default.html @@ -4,7 +4,7 @@ jQuery UI Spinner - Default functionality - + @@ -42,8 +42,6 @@ -
    -

    @@ -59,13 +57,8 @@

    -
    - - -

    Default spinner.

    -
    - + diff --git a/demos/spinner/index.html b/demos/spinner/index.html index 594fd9399..f3c74d0b1 100644 --- a/demos/spinner/index.html +++ b/demos/spinner/index.html @@ -3,21 +3,17 @@ jQuery UI Spinner Demos - -
    -

    Examples

    - -
    + diff --git a/demos/spinner/latlong.html b/demos/spinner/latlong.html index eafbd257f..4a662b42e 100644 --- a/demos/spinner/latlong.html +++ b/demos/spinner/latlong.html @@ -5,7 +5,7 @@ jQuery UI Spinner - Map - + @@ -42,8 +42,6 @@ -
    -
    @@ -52,13 +50,8 @@
    -
    - - -

    Google Maps integration, using spinners to change latidude and longitude.

    -
    - + diff --git a/demos/spinner/overflow.html b/demos/spinner/overflow.html index 17d1ca30b..6889f5feb 100644 --- a/demos/spinner/overflow.html +++ b/demos/spinner/overflow.html @@ -4,7 +4,7 @@ jQuery UI Spinner - Overflow - + @@ -29,23 +29,16 @@ -
    -

    -
    - - -

    Overflowing spinner restricted to a range of -10 to 10. For anything above 10, it'll overflow to -10, and the other way round.

    -
    - + diff --git a/demos/spinner/time.html b/demos/spinner/time.html index a45a801d5..155a04fe9 100644 --- a/demos/spinner/time.html +++ b/demos/spinner/time.html @@ -4,7 +4,7 @@ jQuery UI Spinner - Time - + @@ -51,7 +51,6 @@ -

    @@ -63,9 +62,6 @@

    -
    - -

    @@ -73,7 +69,6 @@ a timestamp, with custom step and page options. Cursor up/down spins minutes, page up/down spins hours.

    -
    - + diff --git a/demos/switchClass/default.html b/demos/switchClass/default.html index 8b8ecd79b..a2162103b 100644 --- a/demos/switchClass/default.html +++ b/demos/switchClass/default.html @@ -1,16 +1,16 @@ - + jQuery UI Effects - switchClass Demo - + @@ -19,15 +19,13 @@ $( "#button" ).click(function(){ $( ".newClass" ).switchClass( "newClass", "anotherNewClass", 1000 ); $( ".anotherNewClass" ).switchClass( "anotherNewClass", "newClass", 1000 ); - return false; + return false; }); }); -
    -
    Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. @@ -35,13 +33,8 @@
    Run Effect -
    - - -

    Click the button above to preview the effect.

    -
    - +
    diff --git a/demos/switchClass/index.html b/demos/switchClass/index.html index f5bd6a0e4..3620fd7c5 100644 --- a/demos/switchClass/index.html +++ b/demos/switchClass/index.html @@ -1,18 +1,14 @@ - + jQuery UI Effects Demos - -
    -

    Examples

    - -
    + diff --git a/demos/tabs/ajax.html b/demos/tabs/ajax.html index 7bdab5ec5..a7146c7af 100644 --- a/demos/tabs/ajax.html +++ b/demos/tabs/ajax.html @@ -1,10 +1,10 @@ - + jQuery UI Tabs - Content via Ajax - + @@ -25,8 +25,6 @@ -
    -
    - - - -

    Fetch external content via Ajax for the tabs by setting an href value in the tab links. While the Ajax request is waiting for a response, the tab label changes to say "Loading...", then returns to the normal label once loaded.

    Tabs 3 and 4 demonstrate slow-loading and broken AJAX tabs, and how to handle serverside errors in those cases. Note: These two require a webserver to interpret PHP. They won't work from the filesystem.

    -
    - + diff --git a/demos/tabs/bottom.html b/demos/tabs/bottom.html index 204a70190..1618166d3 100644 --- a/demos/tabs/bottom.html +++ b/demos/tabs/bottom.html @@ -1,10 +1,10 @@ - + jQuery UI Tabs - Tabs at bottom - + @@ -32,8 +32,6 @@ -
    -
    - - - -

    With some additional CSS (for positioning) and JS (to put the right classes on elements) the tabs can be placed below their content.

    -
    - + diff --git a/demos/tabs/collapsible.html b/demos/tabs/collapsible.html index ad4769ea1..7faac574d 100644 --- a/demos/tabs/collapsible.html +++ b/demos/tabs/collapsible.html @@ -1,10 +1,10 @@ - + jQuery UI Tabs - Collapse content - + @@ -19,8 +19,6 @@ -
    -
    - - - -

    Click the selected tab to toggle its content closed/open. To enable this functionality, set the collapsible option to true.

    collapsible: true
     
    -
    - + diff --git a/demos/tabs/default.html b/demos/tabs/default.html index 1d2f6f2a1..5b95757ea 100644 --- a/demos/tabs/default.html +++ b/demos/tabs/default.html @@ -1,10 +1,10 @@ - + jQuery UI Tabs - Default functionality - + @@ -17,8 +17,6 @@ -
    -
    - - - -

    Click tabs to swap between content that is broken into logical sections.

    -
    - + diff --git a/demos/tabs/index.html b/demos/tabs/index.html index dbf7fee5a..779dfd2da 100644 --- a/demos/tabs/index.html +++ b/demos/tabs/index.html @@ -1,24 +1,20 @@ - + jQuery UI Tabs Demos - - + diff --git a/demos/tabs/manipulation.html b/demos/tabs/manipulation.html index 085d42c43..67ed3d304 100644 --- a/demos/tabs/manipulation.html +++ b/demos/tabs/manipulation.html @@ -1,10 +1,10 @@ - + jQuery UI Tabs - Simple manipulation - + @@ -85,37 +85,30 @@ -
    +
    +
    +
    + + + + +
    +
    +
    -
    -
    -
    - - - - -
    -
    + + +
    + +
    +

    Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

    - - - -
    - -
    -

    Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

    -
    -
    - -
    - - +

    Simple tabs adding and removing.

    -
    - +
    diff --git a/demos/tabs/mouseover.html b/demos/tabs/mouseover.html index 0b8370e6a..631fd84c0 100644 --- a/demos/tabs/mouseover.html +++ b/demos/tabs/mouseover.html @@ -1,10 +1,10 @@ - + jQuery UI Tabs - Open on mouseover - + @@ -19,8 +19,6 @@ -
    -
    - - - -

    Toggle sections open/closed on mouseover with the event option. The default value for event is "click."

    -
    event: 'mouseover'
    -
    -
    - + diff --git a/demos/tabs/sortable.html b/demos/tabs/sortable.html index 577c05286..59a0ba963 100644 --- a/demos/tabs/sortable.html +++ b/demos/tabs/sortable.html @@ -1,10 +1,10 @@ - + jQuery UI Tabs - Sortable - + @@ -25,8 +25,6 @@ -
    -
    - - - -

    Drag the tabs above to re-order them.

    -

    -Making tabs sortable is as simple as calling -.sortable() -on the -.ui-tabs-nav -element. -

    -
    - +

    Making tabs sortable is as simple as calling .sortable() on the .ui-tabs-nav element.

    + diff --git a/demos/tabs/vertical.html b/demos/tabs/vertical.html index bcf22ac4b..b68ec50c8 100644 --- a/demos/tabs/vertical.html +++ b/demos/tabs/vertical.html @@ -1,10 +1,10 @@ - + jQuery UI Tabs - Vertical Tabs functionality - + @@ -26,8 +26,6 @@ -
    -
    - - - -

    Click tabs to swap between content that is broken into logical sections.

    -
    - + diff --git a/demos/toggle/default.html b/demos/toggle/default.html index 2d1b708b0..6801d9deb 100644 --- a/demos/toggle/default.html +++ b/demos/toggle/default.html @@ -4,7 +4,7 @@ jQuery UI Effects - Toggle Demo - + @@ -69,8 +69,6 @@ -
    -

    Toggle

    @@ -97,13 +95,9 @@ Run Effect -
    - -

    Click the button above to preview the effect.

    -
    - +
    diff --git a/demos/toggle/index.html b/demos/toggle/index.html index f5bd6a0e4..3620fd7c5 100644 --- a/demos/toggle/index.html +++ b/demos/toggle/index.html @@ -1,18 +1,14 @@ - + jQuery UI Effects Demos - -
    -

    Examples

    - -
    + diff --git a/demos/toggleClass/default.html b/demos/toggleClass/default.html index 544c0b95b..073b1b11f 100644 --- a/demos/toggleClass/default.html +++ b/demos/toggleClass/default.html @@ -1,10 +1,10 @@ - + jQuery UI Effects - toggleClass Demo - + + @@ -12,7 +12,7 @@ + @@ -12,7 +12,7 @@ + @@ -23,11 +23,6 @@ text-align: center; line-height: 300px; } - /* TODO load from jquery.ui.popup.css */ - .ui-popup { - position: absolute; - z-index: 5000; - } .ui-tooltip { border: 1px solid white; background: rgba(20, 20, 20, 1); @@ -84,7 +79,7 @@ items: "button" }); - $( ".demo" ).tooltip({ + $( document ).tooltip({ position: { my: "center top", at: "center bottom+5", @@ -101,8 +96,6 @@ -
    -
    Here Be Video (HTML5?)
    @@ -117,13 +110,8 @@
    -
    - - -

    A fake video player with like/share/stats button, each with a custom-styled tooltip.

    -
    - +
    diff --git a/demos/widget/default.html b/demos/widget/default.html index 8d08256ce..5959bccdb 100644 --- a/demos/widget/default.html +++ b/demos/widget/default.html @@ -1,10 +1,10 @@ - + jQuery UI Widget - Default functionality - + @@ -162,8 +162,6 @@ -
    -
    color me
    color me
    @@ -172,15 +170,9 @@
    -
    - - -

    This demo shows a simple custom widget built using the widget factory (jquery.ui.widget.js).

    The three boxes are initialized in different ways. Clicking them changes their background color. View source to see how it works, its heavily commented

    -

    For more details on the widget factory, visit the jQuery UI planning wiki.

    -
    - + diff --git a/demos/widget/index.html b/demos/widget/index.html index 1ecb4feea..d518b070d 100644 --- a/demos/widget/index.html +++ b/demos/widget/index.html @@ -1,18 +1,14 @@ - + jQuery UI Widget Demo - -
    -

    Examples

    - -
    + diff --git a/external/jquery.bgiframe-2.1.2.js b/external/jquery.bgiframe-2.1.2.js deleted file mode 100644 index 5cd38bb1d..000000000 --- a/external/jquery.bgiframe-2.1.2.js +++ /dev/null @@ -1,39 +0,0 @@ -/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) - * Licensed under the MIT License (LICENSE.txt). - * - * Version 2.1.2 - */ - -(function($){ - -$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) { - s = $.extend({ - top : 'auto', // auto == .currentStyle.borderTopWidth - left : 'auto', // auto == .currentStyle.borderLeftWidth - width : 'auto', // auto == offsetWidth - height : 'auto', // auto == offsetHeight - opacity : true, - src : 'javascript:false;' - }, s); - var html = '' : ''); + html += buttonPanel; inst._keyEvent = false; return html; }, @@ -1666,7 +1647,7 @@ $.extend(Datepicker.prototype, { '>' + year + ''; } inst.yearshtml += ''; - + html += inst.yearshtml; inst.yearshtml = null; } @@ -1777,7 +1758,7 @@ $.extend(Datepicker.prototype, { * Bind hover events for datepicker elements. * Done via delegate so the binding only occurs once in the lifetime of the parent div. * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. - */ + */ function bindHover(dpDiv) { var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; return dpDiv.delegate(selector, 'mouseout', function() { @@ -1809,16 +1790,16 @@ function extendRemove(target, props) { Object - settings for attaching new datepicker functionality @return jQuery object */ $.fn.datepicker = function(options){ - + /* Verify an empty collection wasn't passed - Fixes #6976 */ if ( !this.length ) { return this; } - + /* Initialise the date picker. */ if (!$.datepicker.initialized) { $(document).mousedown($.datepicker._checkExternalClick). - find('body').append($.datepicker.dpDiv); + find(document.body).append($.datepicker.dpDiv); $.datepicker.initialized = true; } diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 85e4b3e2b..203618fc2 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Dialog + * http://api.jqueryui.com/dialog/ * * Depends: * jquery.ui.core.js @@ -19,7 +19,7 @@ */ (function( $, undefined ) { -var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ", +var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ", sizeRelatedOptions = { buttons: true, height: true, @@ -67,10 +67,8 @@ $.widget("ui.dialog", { }, resizable: true, show: null, - stack: true, title: "", - width: 300, - zIndex: 1000 + width: 300 }, _create: function() { @@ -88,14 +86,15 @@ $.widget("ui.dialog", { options = this.options, title = options.title || " ", + uiDialog, + uiDialogTitlebar, + uiDialogTitlebarClose, + uiDialogTitle, + uiDialogButtonPane; uiDialog = ( this.uiDialog = $( "
    " ) ) .addClass( uiDialogClasses + options.dialogClass ) - .css({ - display: "none", - outline: 0, // TODO: move to stylesheet - zIndex: options.zIndex - }) + .hide() // setting tabIndex makes the div focusable .attr( "tabIndex", -1) .keydown(function( event ) { @@ -106,20 +105,24 @@ $.widget("ui.dialog", { } }) .mousedown(function( event ) { - that.moveToTop( false, event ); + that.moveToTop( event ); }) - .appendTo( "body" ), + .appendTo( this.document[ 0 ].body ); - uiDialogContent = this.element + this.element .show() .removeAttr( "title" ) .addClass( "ui-dialog-content ui-widget-content" ) - .appendTo( uiDialog ), + .appendTo( uiDialog ); uiDialogTitlebar = ( this.uiDialogTitlebar = $( "
    " ) ) .addClass( "ui-dialog-titlebar ui-widget-header " + "ui-corner-all ui-helper-clearfix" ) - .prependTo( uiDialog ), + .bind( "mousedown", function() { + // Dialog isn't getting focus when dragging (#8063) + uiDialog.focus(); + }) + .prependTo( uiDialog ); uiDialogTitlebarClose = $( "" ) .addClass( "ui-dialog-titlebar-close ui-corner-all" ) @@ -128,23 +131,23 @@ $.widget("ui.dialog", { event.preventDefault(); that.close( event ); }) - .appendTo( uiDialogTitlebar ), + .appendTo( uiDialogTitlebar ); - uiDialogTitlebarCloseText = ( this.uiDialogTitlebarCloseText = $( "" ) ) + ( this.uiDialogTitlebarCloseText = $( "" ) ) .addClass( "ui-icon ui-icon-closethick" ) .text( options.closeText ) - .appendTo( uiDialogTitlebarClose ), + .appendTo( uiDialogTitlebarClose ); uiDialogTitle = $( "" ) .uniqueId() .addClass( "ui-dialog-title" ) .html( title ) - .prependTo( uiDialogTitlebar ), + .prependTo( uiDialogTitlebar ); uiDialogButtonPane = ( this.uiDialogButtonPane = $( "
    " ) ) - .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ), + .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ); - uiButtonSet = ( this.uiButtonSet = $( "
    " ) ) + ( this.uiButtonSet = $( "
    " ) ) .addClass( "ui-dialog-buttonset" ) .appendTo( uiDialogButtonPane ); @@ -167,9 +170,24 @@ $.widget("ui.dialog", { this._createButtons( options.buttons ); this._isOpen = false; - if ( $.fn.bgiframe ) { - uiDialog.bgiframe(); - } + // prevent tabbing out of dialogs + this._on( uiDialog, { keydown: function( event ) { + if ( event.keyCode !== $.ui.keyCode.TAB ) { + return; + } + + var tabbables = $( ":tabbable", uiDialog ), + first = tabbables.filter( ":first" ), + last = tabbables.filter( ":last" ); + + if ( ( event.target === last[ 0 ] || event.target === uiDialog[ 0 ] ) && !event.shiftKey ) { + first.focus( 1 ); + return false; + } else if ( ( event.target === first[ 0 ] || event.target === uiDialog[ 0 ] ) && event.shiftKey ) { + last.focus( 1 ); + return false; + } + }}); }, _init: function() { @@ -197,7 +215,8 @@ $.widget("ui.dialog", { } next = oldPosition.parent.children().eq( oldPosition.index ); - if ( next.length ) { + // Don't try to place the dialog next to itself (#8613) + if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { next.before( this.element ); } else { oldPosition.parent.append( this.element ); @@ -209,8 +228,7 @@ $.widget("ui.dialog", { }, close: function( event ) { - var that = this, - maxZ, thisZ; + var that = this; if ( !this._isOpen ) { return; @@ -225,73 +243,28 @@ $.widget("ui.dialog", { if ( this.overlay ) { this.overlay.destroy(); } - this._off( this.uiDialog, "keypress" ); - if ( this.options.hide ) { - this.uiDialog.hide( this.options.hide, function() { - that._trigger( "close", event ); - }); - } else { - this.uiDialog.hide(); - this._trigger( "close", event ); + if ( !this.opener.filter( ":focusable" ).focus().length ) { + // Hiding a focused element doesn't trigger blur in WebKit + // so in case we have nothing to focus on, explicitly blur the active element + // https://bugs.webkit.org/show_bug.cgi?id=47182 + $( this.document[ 0 ].activeElement ).blur(); } - $.ui.dialog.overlay.resize(); - - // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) - if ( this.options.modal ) { - maxZ = 0; - $( ".ui-dialog" ).each(function() { - if ( this !== that.uiDialog[0] ) { - thisZ = $( this ).css( "z-index" ); - if ( !isNaN( thisZ ) ) { - maxZ = Math.max( maxZ, thisZ ); - } - } - }); - $.ui.dialog.maxZ = maxZ; - } - - return this; + this._hide( this.uiDialog, this.options.hide, function() { + that._trigger( "close", event ); + }); }, isOpen: function() { return this._isOpen; }, - // the force parameter allows us to move modal dialogs to their correct - // position on open - moveToTop: function( force, event ) { - var options = this.options, - saveScroll; - - if ( ( options.modal && !force ) || - ( !options.stack && !options.modal ) ) { - return this._trigger( "focus", event ); + moveToTop: function( event, silent ) { + var moved = this.uiDialog.nextAll( ":visible" ).insertBefore( this.uiDialog ); + if ( !silent && moved.length ) { + this._trigger( "focus", event ); } - - if ( options.zIndex > $.ui.dialog.maxZ ) { - $.ui.dialog.maxZ = options.zIndex; - } - if ( this.overlay ) { - $.ui.dialog.maxZ += 1; - $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; - this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); - } - - // Save and then restore scroll - // Opera 9.5+ resets when parent z-index is changed. - // http://bugs.jqueryui.com/ticket/3193 - saveScroll = { - scrollTop: this.element.scrollTop(), - scrollLeft: this.element.scrollLeft() - }; - $.ui.dialog.maxZ += 1; - this.uiDialog.css( "z-index", $.ui.dialog.maxZ ); - this.element.attr( saveScroll ); - this._trigger( "focus", event ); - - return this; }, open: function() { @@ -303,32 +276,13 @@ $.widget("ui.dialog", { options = this.options, uiDialog = this.uiDialog; + this.opener = $( this.document[ 0 ].activeElement ); + this._size(); this._position( options.position ); - uiDialog.show( options.show ); this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null; - this.moveToTop( true ); - - // prevent tabbing out of modal dialogs - if ( options.modal ) { - this._on( uiDialog, { keydown: function( event ) { - if ( event.keyCode !== $.ui.keyCode.TAB ) { - return; - } - - var tabbables = $( ":tabbable", uiDialog ), - first = tabbables.filter( ":first" ), - last = tabbables.filter( ":last" ); - - if ( event.target === last[0] && !event.shiftKey ) { - first.focus( 1 ); - return false; - } else if ( event.target === first[0] && event.shiftKey ) { - last.focus( 1 ); - return false; - } - }}); - } + this.moveToTop( null, true ); + this._show( uiDialog, options.show ); // set focus to the first tabbable element in the content area or the first button // if there are no tabbable elements, set focus on the dialog itself @@ -343,13 +297,30 @@ $.widget("ui.dialog", { this._isOpen = true; this._trigger( "open" ); + this._trigger( "focus" ); return this; }, + _keepFocus: function( event ) { + function checkFocus() { + var activeElement = this.document[ 0 ].activeElement, + isActive = this.uiDialog[ 0 ] === activeElement || + $.contains( this.uiDialog[ 0 ], activeElement ); + if ( !isActive ) { + this.uiDialog.focus(); + } + } + event.preventDefault(); + checkFocus.call( this ); + // support: IE + // IE <= 8 doesn't prevent moving focus even with event.preventDefault() + // so we check again later + this._delay( checkFocus ); + }, + _createButtons: function( buttons ) { - var uiDialogButtonPane, uiButtonSet, - that = this, + var that = this, hasButtons = false; // if we already have a button pane, remove it @@ -363,15 +334,18 @@ $.widget("ui.dialog", { } if ( hasButtons ) { $.each( buttons, function( name, props ) { + var button, click; props = $.isFunction( props ) ? { click: props, text: name } : props; - var button = $( "", props ) .appendTo( that.uiButtonSet ); if ( $.fn.button ) { button.button(); @@ -415,7 +389,6 @@ $.widget("ui.dialog", { $( this ) .removeClass( "ui-dialog-dragging" ); that._trigger( "dragStop", event, filteredUi( ui ) ); - $.ui.dialog.overlay.resize(); } }); }, @@ -461,7 +434,6 @@ $.widget("ui.dialog", { options.height = $( this ).height(); options.width = $( this ).width(); that._trigger( "resizeStop", event, filteredUi( ui ) ); - $.ui.dialog.overlay.resize(); } }) .css( "position", position ) @@ -503,9 +475,9 @@ $.widget("ui.dialog", { }); position = { - my: myAt.join( " " ), - at: myAt.join( " " ), - offset: offset.join( " " ) + my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " + + myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]), + at: myAt.join( " " ) }; } @@ -614,12 +586,11 @@ $.widget("ui.dialog", { }, _size: function() { - /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content - * divs will both have width and height set, so we need to reset them - */ - var nonContentHeight, minContentHeight, autoHeight, - options = this.options, - isVisible = this.uiDialog.is( ":visible" ); + + // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content + // divs will both have width and height set, so we need to reset them + var nonContentHeight, minContentHeight, + options = this.options; // reset content sizing this.element.show().css({ @@ -642,20 +613,10 @@ $.widget("ui.dialog", { minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); if ( options.height === "auto" ) { - // only needed for IE6 support - if ( $.support.minHeight ) { - this.element.css({ - minHeight: minContentHeight, - height: "auto" - }); - } else { - this.uiDialog.show(); - autoHeight = this.element.css( "height", "auto" ).height(); - if ( !isVisible ) { - this.uiDialog.hide(); - } - this.element.height( Math.max( autoHeight, minContentHeight ) ); - } + this.element.css({ + minHeight: minContentHeight, + height: "auto" + }); } else { this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); } @@ -668,7 +629,6 @@ $.widget("ui.dialog", { $.extend($.ui.dialog, { uuid: 0, - maxZ: 0, getTitleId: function($el) { var id = $el.attr( "id" ); @@ -688,66 +648,22 @@ $.extend( $.ui.dialog.overlay, { instances: [], // reuse old instances due to IE memory leak with alpha transparency (see #5185) oldInstances: [], - maxZ: 0, - events: $.map( - "focus,mousedown,mouseup,keydown,keypress,click".split( "," ), - function( event ) { - return event + ".dialog-overlay"; - } - ).join( " " ), create: function( dialog ) { - if ( this.instances.length === 0 ) { - // prevent use of anchors and inputs - // we use a setTimeout in case the overlay is created from an - // event that we're going to be cancelling (see #2804) - setTimeout(function() { - // handle $(el).dialog().dialog('close') (see #4065) - if ( $.ui.dialog.overlay.instances.length ) { - $( document ).bind( $.ui.dialog.overlay.events, function( event ) { - // stop events if the z-index of the target is < the z-index of the overlay - // we cannot return true when we don't want to cancel the event (#3523) - if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { - return false; - } - }); - } - }, 1 ); - // handle window resize - $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); - } + var $el = ( this.oldInstances.pop() || $( "
    " ).addClass( "ui-widget-overlay ui-front" ) ); - var $el = ( this.oldInstances.pop() || $( "
    " ).addClass( "ui-widget-overlay" ) ); + $el.appendTo( document.body ); - // allow closing by pressing the escape key - $( document ).bind( "keydown.dialog-overlay", function( event ) { - var instances = $.ui.dialog.overlay.instances; - // only react to the event if we're the top overlay - if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el && - dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE ) { - - dialog.close( event ); - event.preventDefault(); - } + $el.bind( "mousedown", function( event ) { + dialog._keepFocus( event ); }); - $el.appendTo( document.body ).css({ - width: this.width(), - height: this.height() - }); - - if ( $.fn.bgiframe ) { - $el.bgiframe(); - } - this.instances.push( $el ); return $el; }, destroy: function( $el ) { - var indexOf = $.inArray( $el, this.instances ), - maxZ = 0; + var indexOf = $.inArray( $el, this.instances ); if ( indexOf !== -1 ) { this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] ); @@ -757,86 +673,7 @@ $.extend( $.ui.dialog.overlay, { $( [ document, window ] ).unbind( ".dialog-overlay" ); } - $el.height( 0 ).width( 0 ).remove(); - - // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) - $.each( this.instances, function() { - maxZ = Math.max( maxZ, this.css( "z-index" ) ); - }); - this.maxZ = maxZ; - }, - - height: function() { - var scrollHeight, - offsetHeight; - // handle IE - if ( $.browser.msie ) { - scrollHeight = Math.max( - document.documentElement.scrollHeight, - document.body.scrollHeight - ); - offsetHeight = Math.max( - document.documentElement.offsetHeight, - document.body.offsetHeight - ); - - if ( scrollHeight < offsetHeight ) { - return $( window ).height() + "px"; - } else { - return scrollHeight + "px"; - } - // handle "good" browsers - } else { - return $( document ).height() + "px"; - } - }, - - width: function() { - var scrollWidth, - offsetWidth; - // handle IE - if ( $.browser.msie ) { - scrollWidth = Math.max( - document.documentElement.scrollWidth, - document.body.scrollWidth - ); - offsetWidth = Math.max( - document.documentElement.offsetWidth, - document.body.offsetWidth - ); - - if ( scrollWidth < offsetWidth ) { - return $( window ).width() + "px"; - } else { - return scrollWidth + "px"; - } - // handle "good" browsers - } else { - return $( document ).width() + "px"; - } - }, - - resize: function() { - /* If the dialog is draggable and the user drags it past the - * right edge of the window, the document becomes wider so we - * need to stretch the overlay. If the user then drags the - * dialog back to the left, the document will become narrower, - * so we need to shrink the overlay to the appropriate size. - * This is handled by shrinking the overlay before setting it - * to the full document size. - */ - var $overlays = $( [] ); - $.each( $.ui.dialog.overlay.instances, function() { - $overlays = $overlays.add( this ); - }); - - $overlays.css({ - width: 0, - height: 0 - }).css({ - width: $.ui.dialog.overlay.width(), - height: $.ui.dialog.overlay.height() - }); + $el.remove(); } }); diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 6fea6e75c..e9b472199 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -403,11 +403,11 @@ $.widget( "ui.draggable", $.ui.draggable, { offset = container.offset(), left = offset.left + - (parseFloat( $.curCSS( container[0], "borderLeftWidth", true ) ) || 0) + - (parseFloat( $.curCSS( container[0], "paddingLeft", true ) ) || 0); + (parseFloat( $.css( container[0], "borderLeftWidth", true ) ) || 0) + + (parseFloat( $.css( container[0], "paddingLeft", true ) ) || 0); top = offset.top + - (parseFloat( $.curCSS( container[0], "borderTopWidth", true ) ) || 0) + - (parseFloat( $.curCSS( container[0], "paddingTop", true ) ) || 0); + (parseFloat( $.css( container[0], "borderTopWidth", true ) ) || 0) + + (parseFloat( $.css( container[0], "paddingTop", true ) ) || 0); this.containment = { left: left, diff --git a/ui/jquery.ui.effect-blind.js b/ui/jquery.ui.effect-blind.js index a5c41325c..0ee31c078 100644 --- a/ui/jquery.ui.effect-blind.js +++ b/ui/jquery.ui.effect-blind.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Blind + * http://api.jqueryui.com/blind-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-bounce.js b/ui/jquery.ui.effect-bounce.js index 0a93bda08..d36b0660f 100644 --- a/ui/jquery.ui.effect-bounce.js +++ b/ui/jquery.ui.effect-bounce.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Bounce + * http://api.jqueryui.com/bounce-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-clip.js b/ui/jquery.ui.effect-clip.js index 6539acf24..ce4402b52 100644 --- a/ui/jquery.ui.effect-clip.js +++ b/ui/jquery.ui.effect-clip.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Clip + * http://api.jqueryui.com/clip-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-drop.js b/ui/jquery.ui.effect-drop.js index 674ef41ec..bd196ec73 100644 --- a/ui/jquery.ui.effect-drop.js +++ b/ui/jquery.ui.effect-drop.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Drop + * http://api.jqueryui.com/drop-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-explode.js b/ui/jquery.ui.effect-explode.js index 1048b0a42..b31efc8c1 100644 --- a/ui/jquery.ui.effect-explode.js +++ b/ui/jquery.ui.effect-explode.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Explode + * http://api.jqueryui.com/explode-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-fade.js b/ui/jquery.ui.effect-fade.js index ee031fcd8..00d823260 100644 --- a/ui/jquery.ui.effect-fade.js +++ b/ui/jquery.ui.effect-fade.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Fade + * http://api.jqueryui.com/fade-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-fold.js b/ui/jquery.ui.effect-fold.js index 7619285c2..893a27e2c 100644 --- a/ui/jquery.ui.effect-fold.js +++ b/ui/jquery.ui.effect-fold.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Fold + * http://api.jqueryui.com/fold-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-highlight.js b/ui/jquery.ui.effect-highlight.js index f6868d136..99c41de2f 100644 --- a/ui/jquery.ui.effect-highlight.js +++ b/ui/jquery.ui.effect-highlight.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Highlight + * http://api.jqueryui.com/highlight-effect/ * * Depends: * jquery.ui.effect.js @@ -26,7 +26,7 @@ $.effects.effect.highlight = function( o, done ) { } $.effects.save( elem, props ); - + elem .show() .css({ diff --git a/ui/jquery.ui.effect-pulsate.js b/ui/jquery.ui.effect-pulsate.js index 543f6310d..de78894be 100644 --- a/ui/jquery.ui.effect-pulsate.js +++ b/ui/jquery.ui.effect-pulsate.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Pulsate + * http://api.jqueryui.com/pulsate-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-scale.js b/ui/jquery.ui.effect-scale.js index 5e1dc8540..7fa04bed6 100644 --- a/ui/jquery.ui.effect-scale.js +++ b/ui/jquery.ui.effect-scale.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Scale + * http://api.jqueryui.com/scale-effect/ * * Depends: * jquery.ui.effect.js @@ -102,8 +102,9 @@ $.effects.effect.scale = function( o, done ) { $.effects.effect.size = function( o, done ) { // Create element - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], + var original, baseline, factor, + el = $( this ), + props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], // Always restore props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ], @@ -119,8 +120,12 @@ $.effects.effect.size = function( o, done ) { restore = o.restore || mode !== "effect", scale = o.scale || "both", origin = o.origin || [ "middle", "center" ], - original, baseline, factor, - position = el.css( "position" ); + position = el.css( "position" ), + props = restore ? props0 : props1, + zero = { + height: 0, + width: 0 + }; if ( mode === "show" ) { el.show(); @@ -132,8 +137,13 @@ $.effects.effect.size = function( o, done ) { outerWidth: el.outerWidth() }; - el.from = o.from || original; - el.to = o.to || original; + if ( o.mode === "toggle" && mode === "show" ) { + el.from = o.to || zero; + el.to = o.from || original; + } else { + el.from = o.from || ( mode === "show" ? zero : original ); + el.to = o.to || ( mode === "hide" ? zero : original ); + } // Set scaling factor factor = { @@ -170,13 +180,13 @@ $.effects.effect.size = function( o, done ) { // Vertical props scaling if ( factor.from.y !== factor.to.y ) { - props = props.concat( cProps ); + props = props.concat( cProps ).concat( props2 ); el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from ); el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to ); } } - $.effects.save( el, restore ? props : props1 ); + $.effects.save( el, props ); el.show(); $.effects.createWrapper( el ); el.css( "overflow", "hidden" ).css( el.from ); @@ -197,7 +207,7 @@ $.effects.effect.size = function( o, done ) { // Add margins/font-size vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps); hProps = hProps.concat([ "marginLeft", "marginRight" ]); - props2 = props.concat(vProps).concat(hProps); + props2 = props0.concat(vProps).concat(hProps); el.find( "*[width]" ).each( function(){ var child = $( this ), @@ -254,7 +264,7 @@ $.effects.effect.size = function( o, done ) { if( mode === "hide" ) { el.hide(); } - $.effects.restore( el, restore ? props : props1 ); + $.effects.restore( el, props ); if ( !restore ) { // we need to calculate our new positioning based on the scaling diff --git a/ui/jquery.ui.effect-shake.js b/ui/jquery.ui.effect-shake.js index 51d8e1129..4c2f9817e 100644 --- a/ui/jquery.ui.effect-shake.js +++ b/ui/jquery.ui.effect-shake.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Shake + * http://api.jqueryui.com/shake-effect/ * * Depends: * jquery.ui.effect.js @@ -22,7 +22,7 @@ $.effects.effect.shake = function( o, done ) { distance = o.distance || 20, times = o.times || 3, anims = times * 2 + 1, - speed = o.duration, + speed = Math.round(o.duration/anims), ref = (direction === "up" || direction === "down") ? "top" : "left", positiveMotion = (direction === "up" || direction === "left"), animation = {}, diff --git a/ui/jquery.ui.effect-slide.js b/ui/jquery.ui.effect-slide.js index 134b058c7..5037256e0 100644 --- a/ui/jquery.ui.effect-slide.js +++ b/ui/jquery.ui.effect-slide.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Slide + * http://api.jqueryui.com/slide-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect-transfer.js b/ui/jquery.ui.effect-transfer.js index 7d6c10933..0bfffd7fb 100644 --- a/ui/jquery.ui.effect-transfer.js +++ b/ui/jquery.ui.effect-transfer.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/Transfer + * http://api.jqueryui.com/transfer-effect/ * * Depends: * jquery.ui.effect.js diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js index 7cabe5849..5cd33886f 100644 --- a/ui/jquery.ui.effect.js +++ b/ui/jquery.ui.effect.js @@ -3,28 +3,28 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Effects/ + * http://api.jqueryui.com/category/effects-core/ */ ;(jQuery.effects || (function($, undefined) { -var backCompat = $.uiBackCompat !== false, - // prefix used for storing data on .data() - dataSpace = "ui-effects-"; +var dataSpace = "ui-effects-"; $.effects = { effect: {} }; /*! - * jQuery Color Animations + * jQuery Color Animations v2.0.0 * http://jquery.com/ * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license + * + * Date: Mon Aug 13 13:41:02 2012 -0500 */ (function( jQuery, undefined ) { @@ -243,8 +243,7 @@ color.fn = jQuery.extend( color.prototype, { var inst = this, type = jQuery.type( red ), - rgba = this._rgba = [], - source; + rgba = this._rgba = []; // more than 1 argument specified - assume ( red, green, blue, alpha ) if ( green !== undefined ) { @@ -272,8 +271,8 @@ color.fn = jQuery.extend( color.prototype, { }); } else { each( spaces, function( spaceName, space ) { + var cache = space.cache; each( space.props, function( key, prop ) { - var cache = space.cache; // if the cache doesn't exist, and we know how to convert if ( !inst[ cache ] && space.to ) { @@ -290,6 +289,15 @@ color.fn = jQuery.extend( color.prototype, { // call clamp with alwaysAllowEmpty inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); }); + + // everything defined but alpha? + if ( inst[ cache ] && $.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { + // use the default of 1 + inst[ cache ][ 3 ] = 1; + if ( space.from ) { + inst._rgba = space.from( inst[ cache ] ); + } + } }); } return this; @@ -416,7 +424,7 @@ color.fn = jQuery.extend( color.prototype, { rgba.push( ~~( alpha * 255 ) ); } - return "#" + jQuery.map( rgba, function( v, i ) { + return "#" + jQuery.map( rgba, function( v ) { // default to 0 when nulls exist v = ( v || 0 ).toString( 16 ); @@ -490,8 +498,7 @@ spaces.hsla.from = function ( hsla ) { l = hsla[ 2 ], a = hsla[ 3 ], q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, - p = 2 * l - q, - r, g, b; + p = 2 * l - q; return [ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), @@ -581,19 +588,23 @@ each( spaces, function( spaceName, space ) { each( stepHooks, function( i, hook ) { jQuery.cssHooks[ hook ] = { set: function( elem, value ) { - var parsed, backgroundColor, curElem; + var parsed, curElem, + backgroundColor = ""; if ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) { value = color( parsed || value ); if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { curElem = hook === "backgroundColor" ? elem.parentNode : elem; - do { - backgroundColor = jQuery.css( curElem, "backgroundColor" ); - } while ( - ( backgroundColor === "" || backgroundColor === "transparent" ) && - ( curElem = curElem.parentNode ) && - curElem.style - ); + while ( + (backgroundColor === "" || backgroundColor === "transparent") && + curElem && curElem.style + ) { + try { + backgroundColor = jQuery.css( curElem, "backgroundColor" ); + curElem = curElem.parentNode; + } catch ( e ) { + } + } value = value.blend( backgroundColor && backgroundColor !== "transparent" ? backgroundColor : @@ -604,7 +615,7 @@ each( stepHooks, function( i, hook ) { } try { elem.style[ hook ] = value; - } catch( value ) { + } catch( error ) { // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' } } @@ -619,6 +630,17 @@ each( stepHooks, function( i, hook ) { }; }); +jQuery.cssHooks.borderColor = { + expand: function( value ) { + var expanded = {}; + + each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { + expanded[ "border" + part + "Color" ] = value; + }); + return expanded; + } +}; + // Basic color names only. // Usage of any of the other color names requires adding yourself or including // jquery.color.svg-names.js. @@ -641,7 +663,7 @@ colors = jQuery.Color.names = { white: "#ffffff", yellow: "#ffff00", - // 4.2.3. ‘transparent’ color keyword + // 4.2.3. "transparent" color keyword transparent: [ null, null, null, 0 ], _default: "#ffffff" @@ -684,7 +706,6 @@ function getElementStyles() { this.currentStyle, newStyle = {}, key, - camelCase, len; // webkit enumerates style porperties @@ -805,37 +826,42 @@ $.fn.extend({ _addClass: $.fn.addClass, addClass: function( classNames, speed, easing, callback ) { return speed ? - $.effects.animateClass.apply( this, [{ add: classNames }, speed, easing, callback ]) : - this._addClass(classNames); + $.effects.animateClass.call( this, + { add: classNames }, speed, easing, callback ) : + this._addClass( classNames ); }, _removeClass: $.fn.removeClass, removeClass: function( classNames, speed, easing, callback ) { return speed ? - $.effects.animateClass.apply( this, [{ remove: classNames }, speed, easing, callback ]) : - this._removeClass(classNames); + $.effects.animateClass.call( this, + { remove: classNames }, speed, easing, callback ) : + this._removeClass( classNames ); }, _toggleClass: $.fn.toggleClass, toggleClass: function( classNames, force, speed, easing, callback ) { if ( typeof force === "boolean" || force === undefined ) { if ( !speed ) { - // without speed parameter; + // without speed parameter return this._toggleClass( classNames, force ); } else { - return $.effects.animateClass.apply( this, [( force ? { add:classNames } : { remove:classNames }), speed, easing, callback ]); + return $.effects.animateClass.call( this, + (force ? { add: classNames } : { remove: classNames }), + speed, easing, callback ); } } else { - // without force parameter; - return $.effects.animateClass.apply( this, [{ toggle: classNames }, force, speed, easing ]); + // without force parameter + return $.effects.animateClass.call( this, + { toggle: classNames }, force, speed, easing ); } }, switchClass: function( remove, add, speed, easing, callback) { - return $.effects.animateClass.apply( this, [{ - add: add, - remove: remove - }, speed, easing, callback ]); + return $.effects.animateClass.call( this, { + add: add, + remove: remove + }, speed, easing, callback ); } }); @@ -1014,7 +1040,7 @@ $.extend( $.effects, { // return an effect options object for the given parameters: function _normalizeArguments( effect, options, speed, callback ) { - // allow passing all optinos as the first parameter + // allow passing all options as the first parameter if ( $.isPlainObject( effect ) ) { options = effect; effect = effect.effect; @@ -1023,8 +1049,8 @@ function _normalizeArguments( effect, options, speed, callback ) { // convert to an object effect = { effect: effect }; - // catch (effect) - if ( options === undefined ) { + // catch (effect, null, ...) + if ( options == null ) { options = {}; } @@ -1071,28 +1097,17 @@ function standardSpeed( speed ) { } // invalid strings - treat as "normal" speed - if ( typeof speed === "string" && !$.effects.effect[ speed ] ) { - // TODO: remove in 2.0 (#7115) - if ( backCompat && $.effects[ speed ] ) { - return false; - } - return true; - } - - return false; + return typeof speed === "string" && !$.effects.effect[ speed ]; } $.fn.extend({ - effect: function( effect, options, speed, callback ) { + effect: function( /* effect, options, speed, callback */ ) { var args = _normalizeArguments.apply( this, arguments ), mode = args.mode, queue = args.queue, - effectMethod = $.effects.effect[ args.effect ], + effectMethod = $.effects.effect[ args.effect ]; - // DEPRECATED: remove in 2.0 (#7115) - oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ]; - - if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) { + if ( $.fx.off || !effectMethod ) { // delegate to the original method (e.g., .show()) if possible if ( mode ) { return this[ mode ]( args.duration, args.complete ); @@ -1128,18 +1143,7 @@ $.fn.extend({ } } - // TODO: remove this check in 2.0, effectMethod will always be true - if ( effectMethod ) { - return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); - } else { - // DEPRECATED: remove in 2.0 (#7115) - return oldEffectMethod.call(this, { - options: args, - duration: args.duration, - callback: args.complete, - mode: args.mode - }); - } + return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); }, _show: $.fn.show, diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index 75cfac40b..45c1ec2e4 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Menu + * http://api.jqueryui.com/menu/ * * Depends: * jquery.ui.core.js @@ -72,14 +72,23 @@ $.widget( "ui.menu", { event.preventDefault(); }, "click .ui-menu-item:has(a)": function( event ) { - var target = $( event.target ); - if ( !mouseHandled && target.closest( ".ui-menu-item" ).not( ".ui-state-disabled" ).length ) { + var target = $( event.target ).closest( ".ui-menu-item" ); + if ( !mouseHandled && target.not( ".ui-state-disabled" ).length ) { mouseHandled = true; this.select( event ); - // Redirect focus to the menu - if ( !this.element.is(":focus") ) { - this.element.focus(); + // Open submenu on click + if ( target.has( ".ui-menu" ).length ) { + this.expand( event ); + } else if ( !this.element.is( ":focus" ) ) { + // Redirect focus to the menu + this.element.trigger( "focus", [ true ] ); + + // If the active item is on the top level, let it stay active. + // Otherwise, blur the active item since it is no longer visible. + if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { + clearTimeout( this.timer ); + } } } }, @@ -92,12 +101,14 @@ $.widget( "ui.menu", { }, mouseleave: "collapseAll", "mouseleave .ui-menu": "collapseAll", - focus: function( event ) { + focus: function( event, keepActiveItem ) { // If there's already an active item, keep it active // If not, activate the first item var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 ); - this.focus( event, item ); + if ( !keepActiveItem ) { + this.focus( event, item ); + } }, blur: function( event ) { this._delay(function() { @@ -192,7 +203,7 @@ $.widget( "ui.menu", { this.collapse( event ); break; case $.ui.keyCode.RIGHT: - if ( !this.active.is( ".ui-state-disabled" ) ) { + if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { this.expand( event ); } break; @@ -266,21 +277,35 @@ $.widget( "ui.menu", { }, refresh: function() { - // Initialize nested menus var menus, icon = this.options.icons.submenu, - submenus = this.element.find( this.options.menus + ":not(.ui-menu)" ) - .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) - .hide() - .attr({ - role: this.options.role, - "aria-hidden": "true", - "aria-expanded": "false" - }); + submenus = this.element.find( this.options.menus ); + + // Initialize nested menus + submenus.filter( ":not(.ui-menu)" ) + .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) + .hide() + .attr({ + role: this.options.role, + "aria-hidden": "true", + "aria-expanded": "false" + }) + .each(function() { + var menu = $( this ), + item = menu.prev( "a" ), + submenuCarat = $( "" ) + .addClass( "ui-menu-icon ui-icon " + icon ) + .data( "ui-menu-submenu-carat", true ); + + item + .attr( "aria-haspopup", "true" ) + .prepend( submenuCarat ); + menu.attr( "aria-labelledby", item.attr( "id" ) ); + }); - // Don't refresh list items that are already adapted menus = submenus.add( this.element ); + // Don't refresh list items that are already adapted menus.children( ":not(.ui-menu-item):has(a)" ) .addClass( "ui-menu-item" ) .attr( "role", "presentation" ) @@ -304,18 +329,10 @@ $.widget( "ui.menu", { // Add aria-disabled attribute to any disabled menu item menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); - submenus.each(function() { - var menu = $( this ), - item = menu.prev( "a" ), - submenuCarat = $( "" ) - .addClass( "ui-menu-icon ui-icon " + icon ) - .data( "ui-menu-submenu-carat", true ); - - item - .attr( "aria-haspopup", "true" ) - .prepend( submenuCarat ); - menu.attr( "aria-labelledby", item.attr( "id" ) ); - }); + // If the active item has been removed, blur the menu + if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + this.blur(); + } }, _itemRole: function() { @@ -579,12 +596,13 @@ $.widget( "ui.menu", { }, select: function( event ) { - // Save active reference before collapseAll triggers blur - var ui = { - // Selecting a menu item removes the active item causing multiple clicks to be missing an item - item: this.active || $( event.target ).closest( ".ui-menu-item" ) - }; - this.collapseAll( event, true ); + // TODO: It should never be possible to not have an active item at this + // point, but the tests don't trigger mouseenter before click. + this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); + var ui = { item: this.active }; + if ( !this.active.has( ".ui-menu" ).length ) { + this.collapseAll( event, true ); + } this._trigger( "select", event, ui ); } }); diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 6f95765f2..cdc063f91 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Mouse + * http://api.jqueryui.com/mouse/ * * Depends: * jquery.ui.widget.js @@ -47,9 +47,11 @@ $.widget("ui.mouse", { // other instances of mouse _mouseDestroy: function() { this.element.unbind('.'+this.widgetName); - $(document) - .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) - .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + if ( this._mouseMoveDelegate ) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + } }, _mouseDown: function(event) { @@ -102,14 +104,14 @@ $.widget("ui.mouse", { .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); event.preventDefault(); - + mouseHandled = true; return true; }, _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.position.js b/ui/jquery.ui.position.js index 2802b2ce0..a5dc31834 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Position + * http://api.jqueryui.com/position/ */ (function( $, undefined ) { @@ -230,10 +230,6 @@ $.fn.position = function( options ) { } }); - if ( $.fn.bgiframe ) { - elem.bgiframe(); - } - if ( options.using ) { // adds feedback as second argument to using callback, if present using = function( props ) { @@ -360,7 +356,7 @@ $.ui.position = { var within = data.within, withinOffset = within.offset.left + within.scrollLeft, outerWidth = within.width, - offsetLeft = within.isWindow ? 0 : within.offset.left, + offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = collisionPosLeft - offsetLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, @@ -395,7 +391,7 @@ $.ui.position = { var within = data.within, withinOffset = within.offset.top + within.scrollTop, outerHeight = within.height, - offsetTop = within.isWindow ? 0 : within.offset.top, + offsetTop = within.isWindow ? within.scrollTop : within.offset.top, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = collisionPosTop - offsetTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, @@ -478,40 +474,4 @@ $.ui.position = { testElementParent.removeChild( testElement ); })(); -// DEPRECATED -if ( $.uiBackCompat !== false ) { - // offset option - (function( $ ) { - var _position = $.fn.position; - $.fn.position = function( options ) { - if ( !options || !options.offset ) { - return _position.call( this, options ); - } - var offset = options.offset.split( " " ), - at = options.at.split( " " ); - if ( offset.length === 1 ) { - offset[ 1 ] = offset[ 0 ]; - } - if ( /^\d/.test( offset[ 0 ] ) ) { - offset[ 0 ] = "+" + offset[ 0 ]; - } - if ( /^\d/.test( offset[ 1 ] ) ) { - offset[ 1 ] = "+" + offset[ 1 ]; - } - if ( at.length === 1 ) { - if ( /left|center|right/.test( at[ 0 ] ) ) { - at[ 1 ] = "center"; - } else { - at[ 1 ] = at[ 0 ]; - at[ 0 ] = "center"; - } - } - return _position.call( this, $.extend( options, { - at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ], - offset: undefined - } ) ); - }; - }( jQuery ) ); -} - }( jQuery ) ); diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js index 74a2d6923..cb561ebc6 100644 --- a/ui/jquery.ui.progressbar.js +++ b/ui/jquery.ui.progressbar.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Progressbar + * http://api.jqueryui.com/progressbar/ * * Depends: * jquery.ui.core.js diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index be174dd7e..c2ad28716 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Resizables + * http://api.jqueryui.com/resizable/ * * Depends: * jquery.ui.core.js @@ -15,6 +15,16 @@ */ (function( $, undefined ) { +/*jshint onevar: false, curly: false, eqeqeq: false, funcscope: true, loopfunc: true */ + +function num(v) { + return parseInt(v, 10) || 0; +} + +function isNumber(value) { + return !isNaN(parseInt(value, 10)); +} + $.widget("ui.resizable", $.ui.mouse, { version: "@VERSION", widgetEventPrefix: "resize", @@ -106,7 +116,7 @@ $.widget("ui.resizable", $.ui.mouse, { //TODO : What's going on here? if ('se' == handle) { axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); - }; + } //Insert into internal handles object and append to element this.handles[handle] = '.ui-resizable-'+handle; @@ -204,15 +214,14 @@ $.widget("ui.resizable", $.ui.mouse, { if (this.elementIsWrapper) { _destroy(this.element); var wrapper = this.element; - wrapper.after( - this.originalElement.css({ - position: wrapper.css('position'), - width: wrapper.outerWidth(), - height: wrapper.outerHeight(), - top: wrapper.css('top'), - left: wrapper.css('left') - }) - ).remove(); + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }).insertAfter( wrapper ); + wrapper.remove(); } this.originalElement.css('resize', this.originalResizeStyle); @@ -222,14 +231,15 @@ $.widget("ui.resizable", $.ui.mouse, { }, _mouseCapture: function(event) { - var handle = false; + var capture = false; for (var i in this.handles) { - if ($(this.handles[i])[0] == event.target) { - handle = true; + var handle = $(this.handles[i])[0]; + if (handle == event.target || $.contains(handle, event.target)) { + capture = true; } } - return !this.options.disabled && handle; + return !this.options.disabled && capture; }, _mouseStart: function(event) { @@ -276,8 +286,8 @@ $.widget("ui.resizable", $.ui.mouse, { _mouseDrag: function(event) { //Increase performance, avoid regex - var el = this.helper, o = this.options, props = {}, - that = this, smp = this.originalMousePosition, a = this.axis; + var el = this.helper, + smp = this.originalMousePosition, a = this.axis; var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; var trigger = this._change[a]; @@ -373,7 +383,6 @@ $.widget("ui.resizable", $.ui.mouse, { }, _updateCache: function(data) { - var o = this.options; this.offset = this.helper.offset(); if (isNumber(data.left)) this.position.left = data.left; if (isNumber(data.top)) this.position.top = data.top; @@ -381,9 +390,9 @@ $.widget("ui.resizable", $.ui.mouse, { if (isNumber(data.width)) this.size.width = data.width; }, - _updateRatio: function(data, event) { + _updateRatio: function( data ) { - var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + var cpos = this.position, csize = this.size, a = this.axis; if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); @@ -400,11 +409,11 @@ $.widget("ui.resizable", $.ui.mouse, { return data; }, - _respectSize: function(data, event) { + _respectSize: function( data ) { - var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, - ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), - isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + var o = this._vBoundaries, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); if (isminw) data.width = o.minWidth; if (isminh) data.height = o.minHeight; @@ -429,7 +438,6 @@ $.widget("ui.resizable", $.ui.mouse, { _proportionallyResize: function() { - var o = this.options; if (!this._proportionallyResizeElements.length) return; var element = this.helper || this.element; @@ -452,7 +460,7 @@ $.widget("ui.resizable", $.ui.mouse, { width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 }); - }; + } }, @@ -465,16 +473,12 @@ $.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 ); - this.helper.addClass(this._helper).css({ - width: this.element.outerWidth() + pxyoffset, - height: this.element.outerHeight() + pxyoffset, + width: this.element.outerWidth() - 1, + height: this.element.outerHeight() - 1, position: 'absolute', - left: this.elementOffset.left - ie6offset +'px', - top: this.elementOffset.top - ie6offset +'px', + left: this.elementOffset.left +'px', + top: this.elementOffset.top +'px', zIndex: ++o.zIndex //TODO: Don't modify option }); @@ -489,15 +493,15 @@ $.widget("ui.resizable", $.ui.mouse, { }, _change: { - e: function(event, dx, dy) { + e: function(event, dx) { return { width: this.originalSize.width + dx }; }, - w: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; + w: function(event, dx) { + var cs = this.originalSize, sp = this.originalPosition; return { left: sp.left + dx, width: cs.width - dx }; }, n: function(event, dx, dy) { - var o = this.options, cs = this.originalSize, sp = this.originalPosition; + var cs = this.originalSize, sp = this.originalPosition; return { top: sp.top + dy, height: cs.height - dy }; }, s: function(event, dx, dy) { @@ -544,7 +548,7 @@ $.widget("ui.resizable", $.ui.mouse, { $.ui.plugin.add("resizable", "alsoResize", { - start: function (event, ui) { + start: function () { var that = $(this).data("resizable"), o = that.options; var _store = function (exp) { @@ -575,7 +579,7 @@ $.ui.plugin.add("resizable", "alsoResize", { _alsoResize = function (exp, c) { $(exp).each(function() { - var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; $.each(css, function (i, prop) { @@ -595,14 +599,14 @@ $.ui.plugin.add("resizable", "alsoResize", { } }, - stop: function (event, ui) { + stop: function () { $(this).removeData("resizable-alsoresize"); } }); $.ui.plugin.add("resizable", "animate", { - stop: function(event, ui) { + stop: function( event ) { var that = $(this).data("resizable"), o = that.options; var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), @@ -641,7 +645,7 @@ $.ui.plugin.add("resizable", "animate", { $.ui.plugin.add("resizable", "containment", { - start: function(event, ui) { + start: function() { var that = $(this).data("resizable"), o = that.options, el = that.element; var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; if (!ce) return; @@ -676,10 +680,10 @@ $.ui.plugin.add("resizable", "containment", { } }, - resize: function(event, ui) { + resize: function( event ) { var that = $(this).data("resizable"), o = that.options, - ps = that.containerSize, co = that.containerOffset, cs = that.size, cp = that.position, - pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; + co = that.containerOffset, cp = that.position, + pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement; if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; @@ -717,8 +721,8 @@ $.ui.plugin.add("resizable", "containment", { } }, - stop: function(event, ui){ - var that = $(this).data("resizable"), o = that.options, cp = that.position, + stop: function(){ + var that = $(this).data("resizable"), o = that.options, co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement; var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; @@ -734,13 +738,13 @@ $.ui.plugin.add("resizable", "containment", { $.ui.plugin.add("resizable", "ghost", { - start: function(event, ui) { + start: function() { var that = $(this).data("resizable"), o = that.options, cs = that.size; that.ghost = that.originalElement.clone(); that.ghost - .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .css({ opacity: 0.25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) .addClass('ui-resizable-ghost') .addClass(typeof o.ghost == 'string' ? o.ghost : ''); @@ -748,13 +752,13 @@ $.ui.plugin.add("resizable", "ghost", { }, - resize: function(event, ui){ - var that = $(this).data("resizable"), o = that.options; + resize: function(){ + var that = $(this).data("resizable"); if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width }); }, - stop: function(event, ui){ - var that = $(this).data("resizable"), o = that.options; + stop: function() { + var that = $(this).data("resizable"); if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0)); } @@ -762,8 +766,8 @@ $.ui.plugin.add("resizable", "ghost", { $.ui.plugin.add("resizable", "grid", { - resize: function(event, ui) { - var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, ratio = o._aspectRatio || event.shiftKey; + resize: function() { + var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis; o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); @@ -791,12 +795,4 @@ $.ui.plugin.add("resizable", "grid", { }); -var num = function(v) { - return parseInt(v, 10) || 0; -}; - -var isNumber = function(value) { - return !isNaN(parseInt(value, 10)); -}; - })(jQuery); diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js index 1da7fffa3..a9b15b20b 100644 --- a/ui/jquery.ui.selectable.js +++ b/ui/jquery.ui.selectable.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Selectables + * http://api.jqueryui.com/selectable/ * * Depends: * jquery.ui.core.js @@ -25,20 +25,20 @@ $.widget("ui.selectable", $.ui.mouse, { tolerance: 'touch' }, _create: function() { - var that = this; + var selectees, + that = this; this.element.addClass("ui-selectable"); this.dragged = false; // cache selectee children based on filter - var selectees; this.refresh = function() { selectees = $(that.options.filter, that.element[0]); selectees.addClass("ui-selectee"); selectees.each(function() { - var $this = $(this); - var pos = $this.offset(); + var $this = $(this), + pos = $this.offset(); $.data(this, "selectable-item", { element: this, $element: $this, @@ -72,14 +72,14 @@ $.widget("ui.selectable", $.ui.mouse, { }, _mouseStart: function(event) { - var that = this; + var that = this, + options = this.options; this.opos = [event.pageX, event.pageY]; - if (this.options.disabled) + if (this.options.disabled) { return; - - var options = this.options; + } this.selectees = $(options.filter, this.element[0]); @@ -114,9 +114,10 @@ $.widget("ui.selectable", $.ui.mouse, { }); $(event.target).parents().andSelf().each(function() { - var selectee = $.data(this, "selectable-item"); + var doSelect, + selectee = $.data(this, "selectable-item"); if (selectee) { - var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); + doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); selectee.$element .removeClass(doSelect ? "ui-unselecting" : "ui-selected") .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); @@ -140,28 +141,37 @@ $.widget("ui.selectable", $.ui.mouse, { }, _mouseDrag: function(event) { - var that = this; + this.dragged = true; - if (this.options.disabled) + if (this.options.disabled) { return; + } - var options = this.options; + var tmp, + that = this, + options = this.options, + x1 = this.opos[0], + y1 = this.opos[1], + x2 = event.pageX, + y2 = event.pageY; - var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY; - if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } - if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; } this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); this.selectees.each(function() { - var selectee = $.data(this, "selectable-item"); + var selectee = $.data(this, "selectable-item"), + hit = false; + //prevent helper from being selected if appendTo: selectable - if (!selectee || selectee.element == that.element[0]) + if (!selectee || selectee.element === that.element[0]) { return; - var hit = false; - if (options.tolerance == 'touch') { + } + + if (options.tolerance === 'touch') { hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); - } else if (options.tolerance == 'fit') { + } else if (options.tolerance === 'fit') { hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); } @@ -228,8 +238,6 @@ $.widget("ui.selectable", $.ui.mouse, { this.dragged = false; - var options = this.options; - $('.ui-unselecting', this.element[0]).each(function() { var selectee = $.data(this, "selectable-item"); selectee.$element.removeClass('ui-unselecting'); diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index adceb356c..18f7113d4 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Slider + * http://api.jqueryui.com/slider/ * * Depends: * jquery.ui.core.js @@ -36,11 +36,10 @@ $.widget( "ui.slider", $.ui.mouse, { }, _create: function() { - var i, + var i, handleCount, o = this.options, existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), handle = "", - handleCount = ( o.values && o.values.length ) || 1, handles = []; this._keySliding = false; @@ -79,6 +78,8 @@ $.widget( "ui.slider", $.ui.mouse, { ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); } + handleCount = ( o.values && o.values.length ) || 1; + for ( i = existingHandles.length; i < handleCount; i++ ) { handles.push( handle ); } @@ -277,7 +278,7 @@ $.widget( "ui.slider", $.ui.mouse, { return true; }, - _mouseStart: function( event ) { + _mouseStart: function() { return true; }, @@ -509,6 +510,12 @@ $.widget( "ui.slider", $.ui.mouse, { } this._animateOff = false; break; + case "min": + case "max": + this._animateOff = true; + this._refreshValue(); + this._animateOff = false; + break; } }, @@ -584,7 +591,7 @@ $.widget( "ui.slider", $.ui.mouse, { _set = {}; if ( this.options.values && this.options.values.length ) { - this.handles.each(function( i, j ) { + this.handles.each(function( i ) { valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100; _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index db24fed38..a95c80c68 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Sortables + * http://api.jqueryui.com/sortable/ * * Depends: * jquery.ui.core.js @@ -15,6 +15,7 @@ */ (function( $, undefined ) { +/*jshint onevar: false, curly: false, eqeqeq: false, laxbreak: true, shadow: true, loopfunc: true */ $.widget("ui.sortable", $.ui.mouse, { version: "@VERSION", widgetEventPrefix: "sort", @@ -62,7 +63,7 @@ $.widget("ui.sortable", $.ui.mouse, { this._mouseInit(); //We're ready to go - this.ready = true + this.ready = true; }, @@ -101,7 +102,9 @@ $.widget("ui.sortable", $.ui.mouse, { this._refreshItems(event); //Find out if the clicked node (or one of its parents) is a actual item in this.items - var currentItem = null, nodes = $(event.target).parents().each(function() { + var currentItem = null; + + $(event.target).parents().each(function() { if($.data(this, that.widgetName + '-item') == that) { currentItem = $(this); return false; @@ -221,7 +224,7 @@ $.widget("ui.sortable", $.ui.mouse, { //Post 'activate' events to possible containers if(!noActivation) { - for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); } + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); } } //Prepare possible droppables @@ -296,7 +299,16 @@ $.widget("ui.sortable", $.ui.mouse, { var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); if (!intersection) continue; - if(itemElement != this.currentItem[0] //cannot intersect with itself + // Only put the placeholder inside the current Container, skip all + // items form other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this moving items in "sub-sortables" can cause the placeholder to jitter + // beetween the outer and inner container. + if (item.instance !== this.currentContainer) continue; + + if (itemElement != this.currentItem[0] //cannot intersect with itself && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true) @@ -409,7 +421,7 @@ $.widget("ui.sortable", $.ui.mouse, { var str = []; o = o || {}; $(items).each(function() { - var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[\-=_](.+)/)); if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); }); @@ -449,7 +461,7 @@ $.widget("ui.sortable", $.ui.mouse, { var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; - if( this.options.tolerance == "pointer" + if (this.options.tolerance == "pointer" || this.options.forcePointerForContainers || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) ) { @@ -498,12 +510,12 @@ $.widget("ui.sortable", $.ui.mouse, { _getDragVerticalDirection: function() { var delta = this.positionAbs.top - this.lastPositionAbs.top; - return delta != 0 && (delta > 0 ? "down" : "up"); + return delta !== 0 && (delta > 0 ? "down" : "up"); }, _getDragHorizontalDirection: function() { var delta = this.positionAbs.left - this.lastPositionAbs.left; - return delta != 0 && (delta > 0 ? "right" : "left"); + return delta !== 0 && (delta > 0 ? "right" : "left"); }, refresh: function(event) { @@ -533,8 +545,8 @@ $.widget("ui.sortable", $.ui.mouse, { if(inst && inst != this && !inst.options.disabled) { queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); } - }; - }; + } + } } queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); @@ -543,7 +555,7 @@ $.widget("ui.sortable", $.ui.mouse, { queries[i][0].each(function() { items.push(this); }); - }; + } return $(items); @@ -553,14 +565,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; + }); }, @@ -581,8 +592,8 @@ $.widget("ui.sortable", $.ui.mouse, { queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); this.containers.push(inst); } - }; - }; + } + } } for (var i = queries.length - 1; i >= 0; i--) { @@ -600,8 +611,8 @@ $.widget("ui.sortable", $.ui.mouse, { width: 0, height: 0, left: 0, top: 0 }); - }; - }; + } + } }, @@ -629,7 +640,7 @@ $.widget("ui.sortable", $.ui.mouse, { var p = t.offset(); item.left = p.left; item.top = p.top; - }; + } if(this.options.custom && this.options.custom.refreshContainers) { this.options.custom.refreshContainers.call(this); @@ -640,7 +651,7 @@ $.widget("ui.sortable", $.ui.mouse, { this.containers[i].containerCache.top = p.top; this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); - }; + } } return this; @@ -671,8 +682,8 @@ $.widget("ui.sortable", $.ui.mouse, { if(className && !o.forcePlaceholderSize) return; //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item - if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); }; - if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); }; + if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); } + if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); } } }; } @@ -726,16 +737,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"; } } @@ -768,8 +789,8 @@ $.widget("ui.sortable", $.ui.mouse, { if(helper[0] == this.currentItem[0]) this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; - if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); - if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + if(!helper[0].style.width || o.forceHelperSize) helper.width(this.currentItem.width()); + if(!helper[0].style.height || o.forceHelperSize) helper.height(this.currentItem.height()); return helper; @@ -813,7 +834,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 { @@ -881,7 +902,7 @@ $.widget("ui.sortable", $.ui.mouse, { if(!pos) pos = this.position; var mod = d == "absolute" ? 1 : -1; - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); return { top: ( @@ -931,10 +952,10 @@ $.widget("ui.sortable", $.ui.mouse, { if(o.grid) { var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; - pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; - pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; } } @@ -999,15 +1020,17 @@ $.widget("ui.sortable", $.ui.mouse, { if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed - if(!$.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element - if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); - for (var i = this.containers.length - 1; i >= 0; i--){ - if($.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) { - delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i])); - delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i])); - } - }; - }; + + // Check if the items Container has Changed and trigger appropriate + // events. + if (this !== this.currentContainer) { + if(!noPropagation) { + delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + } + } + //Post events to containers for (var i = this.containers.length - 1; i >= 0; i--){ @@ -1027,7 +1050,9 @@ $.widget("ui.sortable", $.ui.mouse, { if(this.cancelHelperRemoval) { if(!noPropagation) { this._trigger("beforeStop", event, this._uiHash()); - for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + for (var i=0; i < delayedTriggers.length; i++) { + delayedTriggers[i].call(this, event); + } //Trigger all delayed events this._trigger("stop", event, this._uiHash()); } @@ -1043,7 +1068,9 @@ $.widget("ui.sortable", $.ui.mouse, { if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; if(!noPropagation) { - for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + for (var i=0; i < delayedTriggers.length; i++) { + delayedTriggers[i].call(this, event); + } //Trigger all delayed events this._trigger("stop", event, this._uiHash()); } diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index ead3b17be..406eefb91 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Spinner + * http://api.jqueryui.com/spinner/ * * Depends: * jquery.ui.core.js @@ -94,7 +94,6 @@ $.widget( "ui.spinner", { }, keyup: "_stop", focus: function() { - this.uiSpinner.addClass( "ui-state-active" ); this.previous = this.element.val(); }, blur: function( event ) { @@ -104,7 +103,6 @@ $.widget( "ui.spinner", { } this._refresh(); - this.uiSpinner.removeClass( "ui-state-active" ); if ( this.previous !== this.element.val() ) { this._trigger( "change", event ); } @@ -196,7 +194,6 @@ $.widget( "ui.spinner", { .parent() // add buttons .append( this._buttonHtml() ); - this._hoverable( uiSpinner ); this.element.attr( "role", "spinbutton" ); @@ -242,7 +239,7 @@ $.widget( "ui.spinner", { }, _uiSpinnerHtml: function() { - return ""; + return ""; }, _buttonHtml: function() { diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 588b8cdb2..f81771434 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Tabs + * http://api.jqueryui.com/tabs/ * * Depends: * jquery.ui.core.js @@ -22,9 +22,6 @@ function getNextTabId() { } function isLocal( anchor ) { - // clone the node to work around IE 6 not normalizing the href property - // if it's manually set, i.e., a.href = "#foo" kills the normalization - anchor = anchor.cloneNode( false ); return anchor.hash.length > 1 && anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" ); } @@ -48,10 +45,10 @@ $.widget( "ui.tabs", { }, _create: function() { - var panel, - that = this, + var that = this, options = this.options, - active = options.active; + active = options.active, + locationHash = location.hash.substring( 1 ); this.running = false; @@ -80,9 +77,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; } @@ -91,7 +88,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 @@ -102,7 +99,7 @@ $.widget( "ui.tabs", { // handle numbers: negative, out of range if ( active !== false ) { - active = this.tabs.eq( active ).index(); + active = this.tabs.index( this.tabs.eq( active ) ); if ( active === -1 ) { active = options.collapsible ? false : 0; } @@ -297,8 +294,7 @@ $.widget( "ui.tabs", { }, refresh: function() { - var next, - options = this.options, + var options = this.options, lis = this.tablist.children( ":has(a[href])" ); // get disabled tabs from class attribute from HTML @@ -491,18 +487,10 @@ $.widget( "ui.tabs", { }, _setupHeightStyle: function( heightStyle ) { - var maxHeight, overflow, + var maxHeight, parent = this.element.parent(); if ( heightStyle === "fill" ) { - // IE 6 treats height like minHeight, so we need to turn off overflow - // in order to get a reliable height - // we use the minHeight support test because we assume that only - // browsers that don't support minHeight will treat height as minHeight - if ( !$.support.minHeight ) { - overflow = parent.css( "overflow" ); - parent.css( "overflow", "hidden"); - } maxHeight = parent.height(); this.element.siblings( ":visible" ).each(function() { var elem = $( this ), @@ -513,9 +501,6 @@ $.widget( "ui.tabs", { } maxHeight -= elem.outerHeight( true ); }); - if ( overflow ) { - parent.css( "overflow", overflow ); - } this.element.children().not( this.panels ).each(function() { maxHeight -= $( this ).outerHeight( true ); @@ -792,13 +777,7 @@ $.widget( "ui.tabs", { return; } - this.xhr = $.ajax({ - url: anchor.attr( "href" ), - beforeSend: function( jqXHR, settings ) { - return that._trigger( "beforeLoad", event, - $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) ); - } - }); + this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); // support: jQuery <1.8 // jQuery <1.8 returns false if the request is canceled in beforeSend, @@ -835,511 +814,21 @@ $.widget( "ui.tabs", { } }, + _ajaxSettings: function( anchor, event, eventData ) { + var that = this; + return { + url: anchor.attr( "href" ), + beforeSend: function( jqXHR, settings ) { + return that._trigger( "beforeLoad", event, + $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) ); + } + }; + }, + _getPanelForTab: function( tab ) { var id = $( tab ).attr( "aria-controls" ); return this.element.find( this._sanitizeSelector( "#" + id ) ); } }); -// DEPRECATED -if ( $.uiBackCompat !== false ) { - - // helper method for a lot of the back compat extensions - $.ui.tabs.prototype._ui = function( tab, panel ) { - return { - tab: tab, - panel: panel, - index: this.anchors.index( tab ) - }; - }; - - // url method - $.widget( "ui.tabs", $.ui.tabs, { - url: function( index, url ) { - this.anchors.eq( index ).attr( "href", url ); - } - }); - - // ajaxOptions and cache options - $.widget( "ui.tabs", $.ui.tabs, { - options: { - ajaxOptions: null, - cache: false - }, - - _create: function() { - this._super(); - - var that = this; - - this._on({ tabsbeforeload: function( event, ui ) { - // tab is already cached - if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) { - event.preventDefault(); - return; - } - - $.extend( ui.ajaxSettings, that.options.ajaxOptions, { - error: function( xhr, s, e ) { - try { - // Passing index avoid a race condition when this method is - // called after the user has selected another tab. - // Pass the anchor that initiated this request allows - // loadError to manipulate the tab content panel via $(a.hash) - that.options.ajaxOptions.error( xhr, s, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] ); - } - catch ( e ) {} - } - }); - - ui.jqXHR.success(function() { - if ( that.options.cache ) { - $.data( ui.tab[ 0 ], "cache.tabs", true ); - } - }); - }}); - }, - - _setOption: function( key, value ) { - // reset cache if switching from cached to not cached - if ( key === "cache" && value === false ) { - this.anchors.removeData( "cache.tabs" ); - } - this._super( key, value ); - }, - - _destroy: function() { - this.anchors.removeData( "cache.tabs" ); - this._super(); - }, - - url: function( index, url ){ - this.anchors.eq( index ).removeData( "cache.tabs" ); - this._superApply( arguments ); - } - }); - - // abort method - $.widget( "ui.tabs", $.ui.tabs, { - abort: function() { - if ( this.xhr ) { - this.xhr.abort(); - } - } - }); - - // spinner - $.widget( "ui.tabs", $.ui.tabs, { - options: { - spinner: "Loading…" - }, - _create: function() { - this._super(); - this._on({ - tabsbeforeload: function( event, ui ) { - if ( !this.options.spinner ) { - return; - } - - var span = ui.tab.find( "span" ), - html = span.html(); - span.html( this.options.spinner ); - ui.jqXHR.complete(function() { - span.html( html ); - }); - } - }); - } - }); - - // enable/disable events - $.widget( "ui.tabs", $.ui.tabs, { - options: { - enable: null, - disable: null - }, - - enable: function( index ) { - var options = this.options, - trigger; - - if ( index && options.disabled === true || - ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) !== -1 ) ) { - trigger = true; - } - - this._superApply( arguments ); - - if ( trigger ) { - this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - } - }, - - disable: function( index ) { - var options = this.options, - trigger; - - if ( index && options.disabled === false || - ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) === -1 ) ) { - trigger = true; - } - - this._superApply( arguments ); - - if ( trigger ) { - this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - } - } - }); - - // add/remove methods and events - $.widget( "ui.tabs", $.ui.tabs, { - options: { - add: null, - remove: null, - tabTemplate: "
  • #{label}
  • " - }, - - add: function( url, label, index ) { - if ( index === undefined ) { - index = this.anchors.length; - } - - var doInsertAfter, panel, - options = this.options, - li = $( options.tabTemplate - .replace( /#\{href\}/g, url ) - .replace( /#\{label\}/g, label ) ), - id = !url.indexOf( "#" ) ? - url.replace( "#", "" ) : - this._tabId( li ); - - li.addClass( "ui-state-default ui-corner-top" ).data( "ui-tabs-destroy", true ); - li.attr( "aria-controls", id ); - - doInsertAfter = index >= this.tabs.length; - - // try to find an existing element before creating a new one - panel = this.element.find( "#" + id ); - if ( !panel.length ) { - panel = this._createPanel( id ); - if ( doInsertAfter ) { - if ( index > 0 ) { - panel.insertAfter( this.panels.eq( -1 ) ); - } else { - panel.appendTo( this.element ); - } - } else { - panel.insertBefore( this.panels[ index ] ); - } - } - panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ).hide(); - - if ( doInsertAfter ) { - li.appendTo( this.tablist ); - } else { - li.insertBefore( this.tabs[ index ] ); - } - - options.disabled = $.map( options.disabled, function( n ) { - return n >= index ? ++n : n; - }); - - this.refresh(); - if ( this.tabs.length === 1 && options.active === false ) { - this.option( "active", 0 ); - } - - this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); - return this; - }, - - remove: function( index ) { - index = this._getIndex( index ); - var options = this.options, - tab = this.tabs.eq( index ).remove(), - panel = this._getPanelForTab( tab ).remove(); - - // If selected tab was removed focus tab to the right or - // in case the last tab was removed the tab to the left. - // We check for more than 2 tabs, because if there are only 2, - // then when we remove this tab, there will only be one tab left - // so we don't need to detect which tab to activate. - if ( tab.hasClass( "ui-tabs-active" ) && this.anchors.length > 2 ) { - this._activate( index + ( index + 1 < this.anchors.length ? 1 : -1 ) ); - } - - options.disabled = $.map( - $.grep( options.disabled, function( n ) { - return n !== index; - }), - function( n ) { - return n >= index ? --n : n; - }); - - this.refresh(); - - this._trigger( "remove", null, this._ui( tab.find( "a" )[ 0 ], panel[ 0 ] ) ); - return this; - } - }); - - // length method - $.widget( "ui.tabs", $.ui.tabs, { - length: function() { - return this.anchors.length; - } - }); - - // panel ids (idPrefix option + title attribute) - $.widget( "ui.tabs", $.ui.tabs, { - options: { - idPrefix: "ui-tabs-" - }, - - _tabId: function( tab ) { - var a = tab.is( "li" ) ? tab.find( "a[href]" ) : tab; - a = a[0]; - return $( a ).closest( "li" ).attr( "aria-controls" ) || - a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF\-]/g, "" ) || - this.options.idPrefix + getNextTabId(); - } - }); - - // _createPanel method - $.widget( "ui.tabs", $.ui.tabs, { - options: { - panelTemplate: "
    " - }, - - _createPanel: function( id ) { - return $( this.options.panelTemplate ) - .attr( "id", id ) - .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) - .data( "ui-tabs-destroy", true ); - } - }); - - // selected option - $.widget( "ui.tabs", $.ui.tabs, { - _create: function() { - var options = this.options; - if ( options.active === null && options.selected !== undefined ) { - options.active = options.selected === -1 ? false : options.selected; - } - this._super(); - options.selected = options.active; - if ( options.selected === false ) { - options.selected = -1; - } - }, - - _setOption: function( key, value ) { - if ( key !== "selected" ) { - return this._super( key, value ); - } - - var options = this.options; - this._super( "active", value === -1 ? false : value ); - options.selected = options.active; - if ( options.selected === false ) { - options.selected = -1; - } - }, - - _eventHandler: function( event ) { - this._superApply( arguments ); - this.options.selected = this.options.active; - if ( this.options.selected === false ) { - this.options.selected = -1; - } - } - }); - - // show and select event - $.widget( "ui.tabs", $.ui.tabs, { - options: { - show: null, - select: null - }, - _create: function() { - this._super(); - if ( this.options.active !== false ) { - this._trigger( "show", null, this._ui( - this.active.find( ".ui-tabs-anchor" )[ 0 ], - this._getPanelForTab( this.active )[ 0 ] ) ); - } - }, - _trigger: function( type, event, data ) { - var ret = this._superApply( arguments ); - if ( !ret ) { - return false; - } - if ( type === "beforeActivate" && data.newTab.length ) { - ret = this._super( "select", event, { - tab: data.newTab.find( ".ui-tabs-anchor" )[ 0], - panel: data.newPanel[ 0 ], - index: data.newTab.closest( "li" ).index() - }); - } else if ( type === "activate" && data.newTab.length ) { - ret = this._super( "show", event, { - tab: data.newTab.find( ".ui-tabs-anchor" )[ 0 ], - panel: data.newPanel[ 0 ], - index: data.newTab.closest( "li" ).index() - }); - } - return ret; - } - }); - - // select method - $.widget( "ui.tabs", $.ui.tabs, { - select: function( index ) { - index = this._getIndex( index ); - if ( index === -1 ) { - if ( this.options.collapsible && this.options.selected !== -1 ) { - index = this.options.selected; - } else { - return; - } - } - this.anchors.eq( index ).trigger( this.options.event + this.eventNamespace ); - } - }); - - // cookie option - (function() { - - var listId = 0; - - $.widget( "ui.tabs", $.ui.tabs, { - options: { - cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } - }, - _create: function() { - var options = this.options, - active; - if ( options.active == null && options.cookie ) { - active = parseInt( this._cookie(), 10 ); - if ( active === -1 ) { - active = false; - } - options.active = active; - } - this._super(); - }, - _cookie: function( active ) { - var cookie = [ this.cookie || - ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ]; - if ( arguments.length ) { - cookie.push( active === false ? -1 : active ); - cookie.push( this.options.cookie ); - } - return $.cookie.apply( null, cookie ); - }, - _refresh: function() { - this._super(); - if ( this.options.cookie ) { - this._cookie( this.options.active, this.options.cookie ); - } - }, - _eventHandler: function( event ) { - this._superApply( arguments ); - if ( this.options.cookie ) { - this._cookie( this.options.active, this.options.cookie ); - } - }, - _destroy: function() { - this._super(); - if ( this.options.cookie ) { - this._cookie( null, this.options.cookie ); - } - } - }); - - })(); - - // load event - $.widget( "ui.tabs", $.ui.tabs, { - _trigger: function( type, event, data ) { - var _data = $.extend( {}, data ); - if ( type === "load" ) { - _data.panel = _data.panel[ 0 ]; - _data.tab = _data.tab.find( ".ui-tabs-anchor" )[ 0 ]; - } - return this._super( type, event, _data ); - } - }); - - // fx option - // The new animation options (show, hide) conflict with the old show callback. - // The old fx option wins over show/hide anyway (always favor back-compat). - // If a user wants to use the new animation API, they must give up the old API. - $.widget( "ui.tabs", $.ui.tabs, { - options: { - fx: null // e.g. { height: "toggle", opacity: "toggle", duration: 200 } - }, - - _getFx: function() { - var hide, show, - fx = this.options.fx; - - if ( fx ) { - if ( $.isArray( fx ) ) { - hide = fx[ 0 ]; - show = fx[ 1 ]; - } else { - hide = show = fx; - } - } - - return fx ? { show: show, hide: hide } : null; - }, - - _toggle: function( event, eventData ) { - var that = this, - toShow = eventData.newPanel, - toHide = eventData.oldPanel, - fx = this._getFx(); - - if ( !fx ) { - return this._super( event, eventData ); - } - - that.running = true; - - function complete() { - that.running = false; - that._trigger( "activate", event, eventData ); - } - - function show() { - eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" ); - - if ( toShow.length && fx.show ) { - toShow - .animate( fx.show, fx.show.duration, function() { - complete(); - }); - } else { - toShow.show(); - complete(); - } - } - - // start out by hiding, then showing, then completing - if ( toHide.length && fx.hide ) { - toHide.animate( fx.hide, fx.hide.duration, function() { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - show(); - }); - } else { - eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" ); - toHide.hide(); - show(); - } - } - }); -} - })( jQuery ); diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index 8bfe78c05..5145884a3 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -3,9 +3,11 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * + * http://api.jqueryui.com/tooltip/ + * * Depends: * jquery.ui.core.js * jquery.ui.widget.js @@ -47,11 +49,12 @@ $.widget( "ui.tooltip", { return $( this ).attr( "title" ); }, hide: true, - items: "[title]", + // Disabled elements have inconsistent behavior across browsers (#8661) + items: "[title]:not([disabled])", position: { - my: "left+15 center", - at: "right center", - collision: "flipfit flipfit" + my: "left top+15", + at: "left bottom", + collision: "flipfit flip" }, show: true, tooltipClass: null, @@ -70,16 +73,31 @@ $.widget( "ui.tooltip", { // IDs of generated tooltips, needed for destroy this.tooltips = {}; + // IDs of parent tooltips where we removed the title attribute + this.parents = {}; + + if ( this.options.disabled ) { + this._disable(); + } }, _setOption: function( key, value ) { + var that = this; + if ( key === "disabled" ) { this[ value ? "_disable" : "_enable" ](); this.options[ key ] = value; // disable element style changes return; } + this._super( key, value ); + + if ( key === "content" ) { + $.each( this.tooltips, function( id, element ) { + that._updateContent( element ); + }); + } }, _disable: function() { @@ -114,9 +132,10 @@ $.widget( "ui.tooltip", { }, open: function( event ) { - var content, - that = this, + var that = this, target = $( event ? event.target : this.element ) + // we need closest here due to mouseover bubbling, + // but always pointing at the same event target .closest( this.options.items ); // No element to show a tooltip for @@ -131,6 +150,8 @@ $.widget( "ui.tooltip", { this._find( target ).position( $.extend({ of: target }, this.options.position ) ); + // Stop tracking (#8622) + this._off( this.document, "mousemove" ); return; } @@ -138,26 +159,61 @@ $.widget( "ui.tooltip", { target.data( "ui-tooltip-title", target.attr( "title" ) ); } - target.data( "tooltip-open", true ); + target.data( "ui-tooltip-open", true ); - content = this.options.content.call( target[0], function( response ) { + // kill parent tooltips, custom or native, for hover + if ( event && event.type === "mouseover" ) { + target.parents().each(function() { + var parent = $( this ), + blurEvent; + if ( parent.data( "ui-tooltip-open" ) ) { + blurEvent = $.Event( "blur" ); + blurEvent.target = blurEvent.currentTarget = this; + that.close( blurEvent, true ); + } + if ( parent.attr( "title" ) ) { + parent.uniqueId(); + that.parents[ this.id ] = { + element: this, + title: parent.attr( "title" ) + }; + parent.attr( "title", "" ); + } + }); + } + + this._updateContent( target, event ); + }, + + _updateContent: function( target, event ) { + var content, + contentOption = this.options.content, + that = this; + + if ( typeof contentOption === "string" ) { + return this._open( event, target, contentOption ); + } + + content = contentOption.call( target[0], function( response ) { // ignore async response if tooltip was closed already - if ( !target.data( "tooltip-open" ) ) { + if ( !target.data( "ui-tooltip-open" ) ) { return; } // IE may instantly serve a cached response for ajax requests // delay this call to _open so the other call to _open runs first - setTimeout(function() { - that._open( event, target, response ); - }, 1 ); + that._delay(function() { + this._open( event, target, response ); + }); }); if ( content ) { - that._open( event, target, content ); + this._open( event, target, content ); } }, _open: function( event, target, content ) { - var tooltip, positionOption; + var tooltip, events, delayedShow, + positionOption = $.extend( {}, this.options.position ); + if ( !content ) { return; } @@ -191,10 +247,12 @@ $.widget( "ui.tooltip", { function position( event ) { positionOption.of = event; + if ( tooltip.is( ":hidden" ) ) { + return; + } tooltip.position( positionOption ); } - if ( this.options.track && /^mouse/.test( event.originalEvent.type ) ) { - positionOption = $.extend( {}, this.options.position ); + if ( this.options.track && event && /^mouse/.test( event.type ) ) { this._on( this.document, { mousemove: position }); @@ -209,23 +267,42 @@ $.widget( "ui.tooltip", { tooltip.hide(); this._show( tooltip, this.options.show ); + // Handle tracking tooltips that are shown with a delay (#8644). As soon + // as the tooltip is visible, position the tooltip using the most recent + // event. + if ( this.options.show && this.options.show.delay ) { + delayedShow = setInterval(function() { + if ( tooltip.is( ":visible" ) ) { + position( positionOption.of ); + clearInterval( delayedShow ); + } + }, $.fx.interval ); + } this._trigger( "open", event, { tooltip: tooltip } ); - this._on( target, { - mouseleave: "close", - focusout: "close", + events = { keyup: function( event ) { if ( event.keyCode === $.ui.keyCode.ESCAPE ) { var fakeEvent = $.Event(event); fakeEvent.currentTarget = target[0]; this.close( fakeEvent, true ); } + }, + remove: function() { + this._removeTooltip( tooltip ); } - }); + }; + if ( !event || event.type === "mouseover" ) { + events.mouseleave = "close"; + } + if ( !event || event.type === "focusin" ) { + events.focusout = "close"; + } + this._on( target, events ); }, - close: function( event, force ) { + close: function( event ) { var that = this, target = $( event ? event.currentTarget : this.element ), tooltip = this._find( target ); @@ -236,16 +313,6 @@ $.widget( "ui.tooltip", { return; } - // don't close if the element has focus - // this prevents the tooltip from closing if you hover while focused - // - // we have to check the event type because tabbing out of the document - // may leave the element as the activeElement - if ( !force && event && event.type !== "focusout" && - this.document[0].activeElement === target[0] ) { - return; - } - // only set title if we had one before (see comment in _open()) if ( target.data( "ui-tooltip-title" ) ) { target.attr( "title", target.data( "ui-tooltip-title" ) ); @@ -255,14 +322,24 @@ $.widget( "ui.tooltip", { tooltip.stop( true ); this._hide( tooltip, this.options.hide, function() { - $( this ).remove(); - delete that.tooltips[ this.id ]; + that._removeTooltip( $( this ) ); }); - target.removeData( "tooltip-open" ); + target.removeData( "ui-tooltip-open" ); this._off( target, "mouseleave focusout keyup" ); + // Remove 'remove' binding only on delegated targets + if ( target[0] !== this.element[0] ) { + this._off( target, "remove" ); + } this._off( this.document, "mousemove" ); + if ( event && event.type === "mouseleave" ) { + $.each( this.parents, function( id, parent ) { + $( parent.element ).attr( "title", parent.title ); + delete that.parents[ id ]; + }); + } + this.closing = true; this._trigger( "close", event, { tooltip: tooltip } ); this.closing = false; @@ -281,9 +358,6 @@ $.widget( "ui.tooltip", { .addClass( "ui-tooltip-content" ) .appendTo( tooltip ); tooltip.appendTo( this.document[0].body ); - if ( $.fn.bgiframe ) { - tooltip.bgiframe(); - } this.tooltips[ id ] = element; return tooltip; }, @@ -293,9 +367,30 @@ $.widget( "ui.tooltip", { return id ? $( "#" + id ) : $(); }, + _removeTooltip: function( tooltip ) { + tooltip.remove(); + delete this.tooltips[ tooltip.attr( "id" ) ]; + }, + _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" ); + } }); } }); diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index b5dfaa344..00f36fe67 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -3,10 +3,10 @@ * http://jqueryui.com * * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Widget + * http://api.jqueryui.com/jQuery.widget/ */ (function( $, undefined ) { @@ -101,13 +101,11 @@ $.widget = function( name, base, prototype ) { // TODO: remove support for widgetEventPrefix // always use the name + a colon as the prefix, e.g., draggable:start // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: name + widgetEventPrefix: basePrototype.widgetEventPrefix || name }, prototype, { constructor: constructor, namespace: namespace, widgetName: name, - // TODO remove widgetBaseClass, see #8155 - widgetBaseClass: fullName, widgetFullName: fullName }); @@ -142,8 +140,17 @@ $.widget.extend = function( target ) { for ( ; inputIndex < inputLength; inputIndex++ ) { for ( key in input[ inputIndex ] ) { value = input[ inputIndex ][ key ]; - if (input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { - target[ key ] = $.isPlainObject( value ) ? $.widget.extend( {}, target[ key ], value ) : value; + if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { + // Clone objects + if ( $.isPlainObject( value ) ) { + target[ key ] = $.isPlainObject( target[ key ] ) ? + $.widget.extend( {}, target[ key ], value ) : + // Don't extend strings, arrays, etc. with objects + $.widget.extend( {}, value ); + // Copy everything else by reference + } else { + target[ key ] = value; + } } } } @@ -196,7 +203,7 @@ $.widget.bridge = function( name, object ) { }; }; -$.Widget = function( options, element ) {}; +$.Widget = function( /* options, element */ ) {}; $.Widget._childConstructors = []; $.Widget.prototype = { @@ -228,7 +235,13 @@ $.Widget.prototype = { // TODO remove dual storage $.data( element, this.widgetName, this ); $.data( element, this.widgetFullName, this ); - this._on({ remove: "destroy" }); + this._on( this.element, { + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } + } + }); this.document = $( element.style ? // element within the document element.ownerDocument : @@ -347,17 +360,19 @@ $.Widget.prototype = { }, _on: function( element, handlers ) { + var delegateElement, + instance = this; // no element argument, shuffle and use this.element if ( !handlers ) { handlers = element; element = this.element; + delegateElement = this.widget(); } else { // accept selectors, DOM elements - element = $( element ); + element = delegateElement = $( element ); this.bindings = this.bindings.add( element ); } - var instance = this; $.each( handlers, function( event, handler ) { function handlerProxy() { // allow widgets to customize the disabled handling @@ -381,7 +396,7 @@ $.Widget.prototype = { eventName = match[1] + instance.eventNamespace, selector = match[2]; if ( selector ) { - instance.widget().delegate( selector, eventName, handlerProxy ); + delegateElement.delegate( selector, eventName, handlerProxy ); } else { element.bind( eventName, handlerProxy ); } @@ -476,7 +491,7 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { if ( options.delay ) { element.delay( options.delay ); } - if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) { + if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { element[ method ]( options ); } else if ( effectName !== method && element[ effectName ] ) { element[ effectName ]( options.duration, options.easing, callback ); @@ -492,11 +507,4 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { }; }); -// DEPRECATED -if ( $.uiBackCompat !== false ) { - $.Widget.prototype._getCreateOptions = function() { - return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; - }; -} - })( jQuery );