aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-07-12 23:57:55 +0200
committerFelix Nagel <info@felixnagel.com>2012-07-12 23:57:55 +0200
commit5092d0296a010280ee9d004f2fe06afbf1c45db5 (patch)
treeac6b97b4551b4aebf8d90cc35add82fc7088e0a3
parent39532f0a8e70e21e33aab03f08136f662d03a4a1 (diff)
parente054e28836e616ed03561d5a8195bbea525866d1 (diff)
downloadjquery-ui-5092d0296a010280ee9d004f2fe06afbf1c45db5.tar.gz
jquery-ui-5092d0296a010280ee9d004f2fe06afbf1c45db5.zip
Merge branch 'master' into selectmenu
-rw-r--r--AUTHORS.txt11
-rw-r--r--MIT-LICENSE.txt3
-rw-r--r--build/tasks/build.js188
-rw-r--r--build/tasks/testswarm.js74
-rw-r--r--demos/addClass/default.html2
-rw-r--r--demos/animate/default.html2
-rw-r--r--demos/datepicker/animation.html14
-rw-r--r--demos/dialog/animated.html6
-rw-r--r--demos/dialog/modal-form.html2
-rw-r--r--demos/droppable/shopping-cart.html12
-rw-r--r--demos/effect/default.html28
-rw-r--r--demos/effect/easing.html2
-rw-r--r--demos/hide/default.html24
-rw-r--r--demos/index.html26
-rw-r--r--demos/menu/default.html19
-rw-r--r--demos/menu/index.html6
-rw-r--r--demos/menu/navigationmenu.html19
-rw-r--r--demos/menu/topalignmenu.html15
-rw-r--r--demos/removeClass/default.html2
-rw-r--r--demos/show/default.html24
-rw-r--r--demos/spinner/currency.html2
-rw-r--r--demos/spinner/decimal.html2
-rw-r--r--demos/spinner/default.html2
-rw-r--r--demos/spinner/latlong.html2
-rw-r--r--demos/spinner/overflow.html2
-rw-r--r--demos/spinner/time.html2
-rw-r--r--demos/switchClass/default.html2
-rw-r--r--demos/tabs/cookie.html57
-rw-r--r--demos/tabs/index.html1
-rw-r--r--demos/toggle/default.html24
-rw-r--r--demos/toggleClass/default.html2
-rw-r--r--demos/tooltip/custom-animation.html4
-rw-r--r--demos/tooltip/tracking.html19
-rw-r--r--demos/tooltip/video-player.html4
-rw-r--r--demos/widget/default.html6
-rw-r--r--external/jquery.mousewheel.js (renamed from external/jquery.mousewheel-3.0.4.js)34
-rw-r--r--external/qunit.css41
-rw-r--r--external/qunit.js437
-rw-r--r--grunt.js270
-rw-r--r--package.json42
-rw-r--r--tests/jquery.simulate.js3
-rw-r--r--tests/unit/accordion/accordion_core.js34
-rw-r--r--tests/unit/button/button_core.js6
-rw-r--r--tests/unit/button/button_methods.js11
-rw-r--r--tests/unit/button/button_options.js9
-rw-r--r--tests/unit/button/button_tickets.js5
-rw-r--r--tests/unit/core/core.js26
-rw-r--r--tests/unit/core/selector.js4
-rw-r--r--tests/unit/datepicker/datepicker_core.js6
-rw-r--r--tests/unit/datepicker/datepicker_events.js1
-rw-r--r--tests/unit/datepicker/datepicker_methods.js2
-rw-r--r--tests/unit/datepicker/datepicker_options.js19
-rw-r--r--tests/unit/datepicker/datepicker_tickets.js4
-rw-r--r--tests/unit/dialog/dialog_core.js1
-rw-r--r--tests/unit/dialog/dialog_methods.js11
-rw-r--r--tests/unit/dialog/dialog_options.js9
-rw-r--r--tests/unit/dialog/dialog_tickets.js2
-rw-r--r--tests/unit/effects/effects.html28
-rw-r--r--tests/unit/effects/effects_core.js15
-rw-r--r--tests/unit/effects/effects_scale.js15
-rw-r--r--tests/unit/menu/menu.html8
-rw-r--r--tests/unit/menu/menu_common.js3
-rw-r--r--tests/unit/menu/menu_core.js41
-rw-r--r--tests/unit/menu/menu_events.js453
-rw-r--r--tests/unit/menu/menu_methods.js103
-rw-r--r--tests/unit/menu/menu_options.js121
-rw-r--r--tests/unit/menu/menu_test_helpers.js25
-rw-r--r--tests/unit/position/position_core.js2
-rw-r--r--tests/unit/position/position_deprecated.js1
-rw-r--r--tests/unit/progressbar/progressbar_options.js5
-rw-r--r--tests/unit/spinner/spinner.html2
-rw-r--r--tests/unit/spinner/spinner_common.js4
-rw-r--r--tests/unit/spinner/spinner_events.js1
-rw-r--r--tests/unit/spinner/spinner_options.js19
-rw-r--r--tests/unit/tabs/tabs_core.js525
-rw-r--r--tests/unit/tabs/tabs_methods.js21
-rw-r--r--tests/unit/tabs/tabs_options.js52
-rw-r--r--tests/unit/testsuite.js31
-rw-r--r--tests/unit/tooltip/tooltip_common.js1
-rw-r--r--tests/unit/tooltip/tooltip_core.js5
-rw-r--r--tests/unit/tooltip/tooltip_methods.js5
-rw-r--r--tests/unit/tooltip/tooltip_options.js3
-rw-r--r--tests/unit/widget/widget_core.js138
-rw-r--r--tests/visual/addClass/queue.html2
-rw-r--r--tests/visual/effects/all.html28
-rw-r--r--tests/visual/effects/scale.html4
-rw-r--r--tests/visual/menu/menu.html5
-rw-r--r--tests/visual/tooltip/animations.html10
-rw-r--r--themes/base/jquery.ui.accordion.css3
-rw-r--r--themes/base/jquery.ui.all.css3
-rw-r--r--themes/base/jquery.ui.autocomplete.css3
-rw-r--r--themes/base/jquery.ui.base.css3
-rw-r--r--themes/base/jquery.ui.button.css6
-rw-r--r--themes/base/jquery.ui.core.css3
-rw-r--r--themes/base/jquery.ui.datepicker.css5
-rw-r--r--themes/base/jquery.ui.dialog.css3
-rw-r--r--themes/base/jquery.ui.menu.css3
-rw-r--r--themes/base/jquery.ui.progressbar.css3
-rw-r--r--themes/base/jquery.ui.resizable.css3
-rw-r--r--themes/base/jquery.ui.selectable.css3
-rw-r--r--themes/base/jquery.ui.slider.css3
-rw-r--r--themes/base/jquery.ui.spinner.css3
-rw-r--r--themes/base/jquery.ui.tabs.css5
-rw-r--r--themes/base/jquery.ui.theme.css3
-rw-r--r--themes/base/jquery.ui.tooltip.css3
-rw-r--r--ui/i18n/jquery.ui.datepicker-ar.js2
-rw-r--r--ui/jquery.effects.core.js739
-rw-r--r--ui/jquery.ui.accordion.js12
-rw-r--r--ui/jquery.ui.autocomplete.js25
-rw-r--r--ui/jquery.ui.button.js37
-rw-r--r--ui/jquery.ui.core.js18
-rw-r--r--ui/jquery.ui.datepicker.js75
-rw-r--r--ui/jquery.ui.dialog.js11
-rw-r--r--ui/jquery.ui.draggable.js11
-rw-r--r--ui/jquery.ui.droppable.js3
-rw-r--r--ui/jquery.ui.effect-blind.js (renamed from ui/jquery.effects.blind.js)5
-rw-r--r--ui/jquery.ui.effect-bounce.js (renamed from ui/jquery.effects.bounce.js)5
-rw-r--r--ui/jquery.ui.effect-clip.js (renamed from ui/jquery.effects.clip.js)5
-rw-r--r--ui/jquery.ui.effect-drop.js (renamed from ui/jquery.effects.drop.js)5
-rw-r--r--ui/jquery.ui.effect-explode.js (renamed from ui/jquery.effects.explode.js)5
-rw-r--r--ui/jquery.ui.effect-fade.js (renamed from ui/jquery.effects.fade.js)20
-rw-r--r--ui/jquery.ui.effect-fold.js (renamed from ui/jquery.effects.fold.js)5
-rw-r--r--ui/jquery.ui.effect-highlight.js (renamed from ui/jquery.effects.highlight.js)5
-rw-r--r--ui/jquery.ui.effect-pulsate.js (renamed from ui/jquery.effects.pulsate.js)5
-rw-r--r--ui/jquery.ui.effect-scale.js (renamed from ui/jquery.effects.scale.js)5
-rw-r--r--ui/jquery.ui.effect-shake.js (renamed from ui/jquery.effects.shake.js)5
-rw-r--r--ui/jquery.ui.effect-slide.js (renamed from ui/jquery.effects.slide.js)5
-rw-r--r--ui/jquery.ui.effect-transfer.js (renamed from ui/jquery.effects.transfer.js)5
-rw-r--r--ui/jquery.ui.effect.js1248
-rw-r--r--ui/jquery.ui.menu.js156
-rw-r--r--ui/jquery.ui.mouse.js3
-rw-r--r--ui/jquery.ui.position.js3
-rw-r--r--ui/jquery.ui.progressbar.js3
-rw-r--r--ui/jquery.ui.resizable.js6
-rw-r--r--ui/jquery.ui.selectable.js3
-rw-r--r--ui/jquery.ui.slider.js5
-rw-r--r--ui/jquery.ui.sortable.js11
-rw-r--r--ui/jquery.ui.spinner.js15
-rw-r--r--ui/jquery.ui.tabs.js420
-rw-r--r--ui/jquery.ui.tooltip.js65
-rw-r--r--ui/jquery.ui.widget.js40
141 files changed, 4128 insertions, 2184 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt
index d7cb18d16..c2947b2b7 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -42,7 +42,7 @@ Adam Sontag <ajpiano@ajpiano.com>
Carl Fürstenberg <carl@excito.com>
Kevin Dalman <development@allpro.net>
Alberto Fernández Capel <afcapel@gmail.com>
-Jacek Jędrzejewski <jacek.jedrzejewski@gmail.com>
+Jacek Jędrzejewski (http://jacek.jedrzejewski.name)
Ting Kuei <ting@kuei.com>
Samuel Cormier-Iijima <sam@chide.it>
Jon Palmer <jonspalmer@gmail.com>
@@ -170,7 +170,7 @@ Ian Simpson <spoonlikesham@gmail.com>
Lev Kitsis <spam4lev@gmail.com>
TJ VanToll <tj.vantoll@gmail.com>
Justin Domnitz <jdomnitz@gmail.com>
-Douglas Cerna <replaceafill@system76.(none)>
+Douglas Cerna <douglascerna@yahoo.com>
Bert ter Heide <bertjh@hotmail.com>
Jasvir Nagra <jasvir@gmail.com>
Petr Hromadko <yuriy@tokyoscale.com>
@@ -187,3 +187,10 @@ Jason Moon <jmoon@socialcast.com>
Martin Frost <martinf55@hotmail.com>
Eneko Illarramendi <eneko@illarra.com>
EungJun Yi <semtlenori@gmail.com>
+Courtland Allen <courtlandallen@gmail.com>
+Viktar Varvanovich <non4eg@gmail.com>
+Danny Trunk <dtrunk90@googlemail.com>
+Pavel Stetina <pavel.stetina@nangu.tv>
+Mike Stay <metaweta@gmail.com>
+Steven Roussey <sroussey@gmail.com>
+Mike Hollis <hollis21@gmail.com>
diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt
index 29652242a..741585591 100644
--- a/MIT-LICENSE.txt
+++ b/MIT-LICENSE.txt
@@ -1,4 +1,5 @@
-Copyright (c) 2012 Paul Bakaus, http://jqueryui.com/
+Copyright 2012 jQuery Foundation and other contributors,
+http://jqueryui.com/
This software consists of voluntary contributions made by many
individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
diff --git a/build/tasks/build.js b/build/tasks/build.js
new file mode 100644
index 000000000..06a4b98a2
--- /dev/null
+++ b/build/tasks/build.js
@@ -0,0 +1,188 @@
+module.exports = function( grunt ) {
+
+var path = require( "path" );
+
+grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {
+ function replaceVersion( source ) {
+ return source.replace( /@VERSION/g, grunt.config( "pkg.version" ) );
+ }
+ function copyFile( src, dest ) {
+ if ( /(js|css)$/.test( src ) ) {
+ grunt.file.copy( src, dest, {
+ process: replaceVersion
+ });
+ } else {
+ grunt.file.copy( src, dest );
+ }
+ }
+ var files = grunt.file.expandFiles( this.file.src ),
+ target = this.file.dest + "/",
+ strip = this.data.strip,
+ renameCount = 0,
+ fileName;
+ if ( typeof strip === "string" ) {
+ strip = new RegExp( "^" + grunt.template.process( strip, grunt.config() ).replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ) );
+ }
+ files.forEach(function( fileName ) {
+ var targetFile = strip ? fileName.replace( strip, "" ) : fileName;
+ copyFile( fileName, target + targetFile );
+ });
+ grunt.log.writeln( "Copied " + files.length + " files." );
+ for ( fileName in this.data.renames ) {
+ renameCount += 1;
+ copyFile( fileName, target + grunt.template.process( this.data.renames[ fileName ], grunt.config() ) );
+ }
+ if ( renameCount ) {
+ grunt.log.writeln( "Renamed " + renameCount + " files." );
+ }
+});
+
+
+grunt.registerMultiTask( "zip", "Create a zip file for release", function() {
+ // TODO switch back to adm-zip for better cross-platform compability once it actually works
+ // 0.1.3 works, but result can't be unzipped
+ // its also a lot slower then zip program, probably due to how its used...
+ // var files = grunt.file.expandFiles( "dist/" + this.file.src + "/**/*" );
+ // grunt.log.writeln( "Creating zip file " + this.file.dest );
+
+ //var AdmZip = require( "adm-zip" );
+ //var zip = new AdmZip();
+ //files.forEach(function( file ) {
+ // grunt.verbose.writeln( "Zipping " + file );
+ // // rewrite file names from dist folder (created by build), drop the /dist part
+ // zip.addFile(file.replace(/^dist/, "" ), fs.readFileSync( file ) );
+ //});
+ //zip.writeZip( "dist/" + this.file.dest );
+ //grunt.log.writeln( "Wrote " + files.length + " files to " + this.file.dest );
+
+ var done = this.async(),
+ dest = this.file.dest,
+ src = grunt.template.process( this.file.src, grunt.config() );
+ grunt.utils.spawn({
+ cmd: "zip",
+ args: [ "-r", dest, src ],
+ opts: {
+ cwd: 'dist'
+ }
+ }, function( err, result ) {
+ if ( err ) {
+ grunt.log.error( err );
+ done();
+ return;
+ }
+ grunt.log.writeln( "Zipped " + dest );
+ done();
+ });
+});
+
+grunt.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", function() {
+ // remove dest file before creating it, to make sure itself is not included
+ if ( path.existsSync( this.file.dest ) ) {
+ fs.unlinkSync( this.file.dest );
+ }
+ var crypto = require( "crypto" ),
+ dir = this.file.src + "/",
+ hashes = [];
+ grunt.file.expandFiles( dir + "**/*" ).forEach(function( fileName ) {
+ var hash = crypto.createHash( "md5" );
+ hash.update( grunt.file.read( fileName, "ascii" ) );
+ hashes.push( fileName.replace( dir, "" ) + " " + hash.digest( "hex" ) );
+ });
+ grunt.file.write( this.file.dest, hashes.join( "\n" ) + "\n" );
+ grunt.log.writeln( "Wrote " + this.file.dest + " with " + hashes.length + " hashes" );
+});
+
+// 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
+ 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 );
+ });
+
+ // copy minified base theme from regular release
+ files = grunt.file.expandFiles( distFolder + "/themes/base/**/*" );
+ files.forEach(function( fileName ) {
+ grunt.file.copy( fileName, target + fileName.replace( distFolder, "" ) );
+ });
+});
+
+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
new file mode 100644
index 000000000..c0244ebad
--- /dev/null
+++ b/build/tasks/testswarm.js
@@ -0,0 +1,74 @@
+/*jshint node: true */
+module.exports = function( grunt ) {
+
+var 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",
+ "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",
+ "Spinner": "spinner/spinner.html",
+ "Tabs": "tabs/tabs.html",
+ "Tabs_deprecated": "tabs/tabs_deprecated.html",
+ "Tooltip": "tooltip/tooltip.html",
+ "Widget": "widget/widget.html"
+};
+
+function submit( commit, tests, configFile, done ) {
+ var test,
+ testswarm = require( "testswarm" ),
+ config = grunt.file.readJSON( configFile ).jqueryui,
+ testBase = config.testUrl + commit + "/tests/unit/",
+ testUrls = [];
+ for ( test in tests ) {
+ testUrls.push( testBase + tests[ test ] );
+ }
+ testswarm({
+ url: config.swarmUrl,
+ pollInterval: 10000,
+ timeout: 1000 * 60 * 30,
+ done: done
+ }, {
+ authUsername: config.authUsername,
+ authToken: config.authToken,
+ jobName: 'jQuery UI commit #<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
+ runMax: config.runMax,
+ "runNames[]": Object.keys(tests),
+ "runUrls[]": testUrls,
+ "browserSets[]": ["popular"]
+ });
+}
+
+grunt.registerTask( "testswarm", function( commit, configFile ) {
+ var test,
+ latestTests = {};
+ for ( test in tests ) {
+ latestTests[ test ] = tests[ test ] + "?nojshint=true";
+ }
+ submit( commit, latestTests, configFile, this.async() );
+});
+
+grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile ) {
+ var allTests = {};
+ "1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.7 1.7.1 1.7.2 git".split(" ").forEach(function( version ) {
+ for ( var test in tests ) {
+ allTests[ test + "-" + version ] = tests[ test ] + "?nojshint=true&jquery=" + version;
+ }
+ });
+ submit( commit, allTests, configFile, this.async() );
+});
+
+};
diff --git a/demos/addClass/default.html b/demos/addClass/default.html
index 98f7c8c50..9d4b71455 100644
--- a/demos/addClass/default.html
+++ b/demos/addClass/default.html
@@ -5,7 +5,7 @@
<title>jQuery UI Effects - addClass demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler { width: 500px; height: 200px; position: relative; }
diff --git a/demos/animate/default.html b/demos/animate/default.html
index 307d030a6..b4488bd17 100644
--- a/demos/animate/default.html
+++ b/demos/animate/default.html
@@ -5,7 +5,7 @@
<title>jQuery UI Effects - Animate demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler { width: 500px; height: 200px; position: relative; }
diff --git a/demos/datepicker/animation.html b/demos/datepicker/animation.html
index f2e6452f7..3185b6718 100644
--- a/demos/datepicker/animation.html
+++ b/demos/datepicker/animation.html
@@ -7,13 +7,13 @@
<script src="../../jquery-1.7.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
- <script src="../../ui/jquery.effects.blind.js"></script>
- <script src="../../ui/jquery.effects.bounce.js"></script>
- <script src="../../ui/jquery.effects.clip.js"></script>
- <script src="../../ui/jquery.effects.drop.js"></script>
- <script src="../../ui/jquery.effects.fold.js"></script>
- <script src="../../ui/jquery.effects.slide.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
+ <script src="../../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../../ui/jquery.ui.effect-bounce.js"></script>
+ <script src="../../ui/jquery.ui.effect-clip.js"></script>
+ <script src="../../ui/jquery.ui.effect-drop.js"></script>
+ <script src="../../ui/jquery.ui.effect-fold.js"></script>
+ <script src="../../ui/jquery.ui.effect-slide.js"></script>
<script src="../../ui/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
diff --git a/demos/dialog/animated.html b/demos/dialog/animated.html
index 4124ae400..610d38d69 100644
--- a/demos/dialog/animated.html
+++ b/demos/dialog/animated.html
@@ -13,9 +13,9 @@
<script src="../../ui/jquery.ui.position.js"></script>
<script src="../../ui/jquery.ui.resizable.js"></script>
<script src="../../ui/jquery.ui.dialog.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
- <script src="../../ui/jquery.effects.blind.js"></script>
- <script src="../../ui/jquery.effects.explode.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
+ <script src="../../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../../ui/jquery.ui.effect-explode.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
// increase the default animation speed to exaggerate the effect
diff --git a/demos/dialog/modal-form.html b/demos/dialog/modal-form.html
index 553335227..fc0b0e1ef 100644
--- a/demos/dialog/modal-form.html
+++ b/demos/dialog/modal-form.html
@@ -14,7 +14,7 @@
<script src="../../ui/jquery.ui.position.js"></script>
<script src="../../ui/jquery.ui.resizable.js"></script>
<script src="../../ui/jquery.ui.dialog.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
body { font-size: 62.5%; }
diff --git a/demos/droppable/shopping-cart.html b/demos/droppable/shopping-cart.html
index 8a08f576b..f3a881fc4 100644
--- a/demos/droppable/shopping-cart.html
+++ b/demos/droppable/shopping-cart.html
@@ -16,7 +16,7 @@
<style>
h1 { padding: .2em; margin: 0; }
#products { float:left; width: 500px; margin-right: 2em; }
- #cart { width: 200px; float: left; }
+ #cart { width: 200px; float: left; margin-top: 1em; }
/* style the list to maximize the droppable hitarea */
#cart ol { margin: 0; padding: 1em 0 1em 3em; }
</style>
@@ -49,11 +49,11 @@
<body>
<div class="demo">
-
+
<div id="products">
- <h1 class="ui-widget-header">Products</h1>
+ <h1 class="ui-widget-header">Products</h1>
<div id="catalog">
- <h3><a href="#">T-Shirts</a></h3>
+ <h2><a href="#">T-Shirts</a></h2>
<div>
<ul>
<li>Lolcat Shirt</li>
@@ -61,7 +61,7 @@
<li>Buckit Shirt</li>
</ul>
</div>
- <h3><a href="#">Bags</a></h3>
+ <h2><a href="#">Bags</a></h2>
<div>
<ul>
<li>Zebra Striped</li>
@@ -69,7 +69,7 @@
<li>Alligator Leather</li>
</ul>
</div>
- <h3><a href="#">Gadgets</a></h3>
+ <h2><a href="#">Gadgets</a></h2>
<div>
<ul>
<li>iPhone</li>
diff --git a/demos/effect/default.html b/demos/effect/default.html
index deffa6da2..b8251d5be 100644
--- a/demos/effect/default.html
+++ b/demos/effect/default.html
@@ -5,20 +5,20 @@
<title>jQuery UI Effects - Effect demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
- <script src="../../ui/jquery.effects.blind.js"></script>
- <script src="../../ui/jquery.effects.bounce.js"></script>
- <script src="../../ui/jquery.effects.clip.js"></script>
- <script src="../../ui/jquery.effects.drop.js"></script>
- <script src="../../ui/jquery.effects.explode.js"></script>
- <script src="../../ui/jquery.effects.fade.js"></script>
- <script src="../../ui/jquery.effects.fold.js"></script>
- <script src="../../ui/jquery.effects.highlight.js"></script>
- <script src="../../ui/jquery.effects.pulsate.js"></script>
- <script src="../../ui/jquery.effects.scale.js"></script>
- <script src="../../ui/jquery.effects.shake.js"></script>
- <script src="../../ui/jquery.effects.slide.js"></script>
- <script src="../../ui/jquery.effects.transfer.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
+ <script src="../../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../../ui/jquery.ui.effect-bounce.js"></script>
+ <script src="../../ui/jquery.ui.effect-clip.js"></script>
+ <script src="../../ui/jquery.ui.effect-drop.js"></script>
+ <script src="../../ui/jquery.ui.effect-explode.js"></script>
+ <script src="../../ui/jquery.ui.effect-fade.js"></script>
+ <script src="../../ui/jquery.ui.effect-fold.js"></script>
+ <script src="../../ui/jquery.ui.effect-highlight.js"></script>
+ <script src="../../ui/jquery.ui.effect-pulsate.js"></script>
+ <script src="../../ui/jquery.ui.effect-scale.js"></script>
+ <script src="../../ui/jquery.ui.effect-shake.js"></script>
+ <script src="../../ui/jquery.ui.effect-slide.js"></script>
+ <script src="../../ui/jquery.ui.effect-transfer.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler { width: 500px; height: 200px; position: relative; }
diff --git a/demos/effect/easing.html b/demos/effect/easing.html
index 610e30208..0d90cf0b6 100644
--- a/demos/effect/easing.html
+++ b/demos/effect/easing.html
@@ -5,7 +5,7 @@
<title>jQuery UI Effects - Easing demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.graph {
diff --git a/demos/hide/default.html b/demos/hide/default.html
index 75ec1eb38..03bb75bc1 100644
--- a/demos/hide/default.html
+++ b/demos/hide/default.html
@@ -5,18 +5,18 @@
<title>jQuery UI Effects - Hide Demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
- <script src="../../ui/jquery.effects.blind.js"></script>
- <script src="../../ui/jquery.effects.bounce.js"></script>
- <script src="../../ui/jquery.effects.clip.js"></script>
- <script src="../../ui/jquery.effects.drop.js"></script>
- <script src="../../ui/jquery.effects.explode.js"></script>
- <script src="../../ui/jquery.effects.fold.js"></script>
- <script src="../../ui/jquery.effects.highlight.js"></script>
- <script src="../../ui/jquery.effects.pulsate.js"></script>
- <script src="../../ui/jquery.effects.scale.js"></script>
- <script src="../../ui/jquery.effects.shake.js"></script>
- <script src="../../ui/jquery.effects.slide.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
+ <script src="../../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../../ui/jquery.ui.effect-bounce.js"></script>
+ <script src="../../ui/jquery.ui.effect-clip.js"></script>
+ <script src="../../ui/jquery.ui.effect-drop.js"></script>
+ <script src="../../ui/jquery.ui.effect-explode.js"></script>
+ <script src="../../ui/jquery.ui.effect-fold.js"></script>
+ <script src="../../ui/jquery.ui.effect-highlight.js"></script>
+ <script src="../../ui/jquery.ui.effect-pulsate.js"></script>
+ <script src="../../ui/jquery.ui.effect-scale.js"></script>
+ <script src="../../ui/jquery.ui.effect-shake.js"></script>
+ <script src="../../ui/jquery.ui.effect-slide.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler { width: 500px; height: 200px; }
diff --git a/demos/index.html b/demos/index.html
index 059bf42cb..44cbefa39 100644
--- a/demos/index.html
+++ b/demos/index.html
@@ -29,19 +29,19 @@
<script src="../ui/jquery.ui.spinner.js"></script>
<script src="../ui/jquery.ui.tabs.js"></script>
<script src="../ui/jquery.ui.tooltip.js"></script>
- <script src="../ui/jquery.effects.core.js"></script>
- <script src="../ui/jquery.effects.blind.js"></script>
- <script src="../ui/jquery.effects.bounce.js"></script>
- <script src="../ui/jquery.effects.clip.js"></script>
- <script src="../ui/jquery.effects.drop.js"></script>
- <script src="../ui/jquery.effects.explode.js"></script>
- <script src="../ui/jquery.effects.fold.js"></script>
- <script src="../ui/jquery.effects.highlight.js"></script>
- <script src="../ui/jquery.effects.pulsate.js"></script>
- <script src="../ui/jquery.effects.scale.js"></script>
- <script src="../ui/jquery.effects.shake.js"></script>
- <script src="../ui/jquery.effects.slide.js"></script>
- <script src="../ui/jquery.effects.transfer.js"></script>
+ <script src="../ui/jquery.ui.effect.js"></script>
+ <script src="../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../ui/jquery.ui.effect-bounce.js"></script>
+ <script src="../ui/jquery.ui.effect-clip.js"></script>
+ <script src="../ui/jquery.ui.effect-drop.js"></script>
+ <script src="../ui/jquery.ui.effect-explode.js"></script>
+ <script src="../ui/jquery.ui.effect-fold.js"></script>
+ <script src="../ui/jquery.ui.effect-highlight.js"></script>
+ <script src="../ui/jquery.ui.effect-pulsate.js"></script>
+ <script src="../ui/jquery.ui.effect-scale.js"></script>
+ <script src="../ui/jquery.ui.effect-shake.js"></script>
+ <script src="../ui/jquery.ui.effect-slide.js"></script>
+ <script src="../ui/jquery.ui.effect-transfer.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-af.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ar.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ar-DZ.js"></script>
diff --git a/demos/menu/default.html b/demos/menu/default.html
index b1c0b9fbb..b5a0689fb 100644
--- a/demos/menu/default.html
+++ b/demos/menu/default.html
@@ -1,28 +1,25 @@
-<!DOCTYPE html>
+<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
- <title>jQuery UI Menu - Default demo</title>
- <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
+ <title>jQuery UI Menu - Default functionality</title>
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.menu.js"></script>
- <link href="../demos.css" rel="stylesheet" />
+ <link rel="stylesheet" href="../demos.css">
<script>
$(function() {
- $(".demo ul").menu();
+ $( "#menu" ).menu();
});
</script>
- <style>
-
- </style>
</head>
<body>
<div class="demo">
- <ul>
+ <ul id="menu">
<li><a href="#Aberdeen">Aberdeen</a></li>
<li><a href="#Ada">Ada</a></li>
<li><a href="#Adamsville">Adamsville</a></li>
@@ -44,11 +41,9 @@
<div class="demo-description">
-<p>A menu with the default configuration. A list is transformed, adding themeing, mouse and keyboard navigation support. Try to tab to the menu and use the cursor keys to navigate.</p>
+<p>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.</p>
</div><!-- End demo-description -->
-
-
</body>
</html>
diff --git a/demos/menu/index.html b/demos/menu/index.html
index b5bdb43fd..f5a49799a 100644
--- a/demos/menu/index.html
+++ b/demos/menu/index.html
@@ -1,9 +1,9 @@
-<!DOCTYPE html>
+<!doctype html>
<html lang="en">
<head>
- <meta charset="UTF-8" />
+ <meta charset="utf-8">
<title>jQuery UI Menu Demos</title>
- <link href="../demos.css" rel="stylesheet" />
+ <link rel="stylesheet" href="../demos.css">
</head>
<body>
<div class="demos-nav">
diff --git a/demos/menu/navigationmenu.html b/demos/menu/navigationmenu.html
index 8c7b2b993..94dc1b8fa 100644
--- a/demos/menu/navigationmenu.html
+++ b/demos/menu/navigationmenu.html
@@ -1,18 +1,18 @@
-<!DOCTYPE html>
+<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
- <title>jQuery UI Menu - Navigation Menu demo</title>
- <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
+ <title>jQuery UI Menu - Navigation Menu</title>
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.position.js"></script>
<script src="../../ui/jquery.ui.menu.js"></script>
- <link href="../demos.css" rel="stylesheet" />
+ <link rel="stylesheet" href="../demos.css">
<script>
$(function() {
- $("#navMenu").menu({
+ $( "#menu" ).menu({
select: function( event, ui ) {
var link = ui.item.children( "a:first" );
if ( link.attr( "target" ) || event.metaKey || event.shiftKey || event.ctrlKey ) {
@@ -24,15 +24,14 @@
});
</script>
<style>
- body { font-size:62.5%; }
- .ui-menu { width: 200px; margin-bottom: 2em; }
+ .ui-menu { width: 200px; margin-bottom: 2em; }
</style>
</head>
<body>
<div class="demo">
- <ul id="navMenu">
+ <ul id="menu">
<li><a href="?Aberdeen">Aberdeen</a></li>
<li><a href="?Ada">Ada</a></li>
<li><a href="?Adamsville">Adamsville</a></li>
@@ -74,11 +73,9 @@
<div class="demo-description">
-<p>A navigation menu. A list is transformed, adding themeing, mouse and keyboard navigation support. Try to tab to the menu and use the cursor keys to navigate.</p>
+<p>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.</p>
</div><!-- End demo-description -->
-
-
</body>
</html>
diff --git a/demos/menu/topalignmenu.html b/demos/menu/topalignmenu.html
index 7b7e052e4..a6ac11520 100644
--- a/demos/menu/topalignmenu.html
+++ b/demos/menu/topalignmenu.html
@@ -3,8 +3,8 @@
<head>
<meta charset="utf-8">
<title>Menu Demo: Top-aligned Menu</title>
- <link type="text/css" href="../demos.css" rel="stylesheet" />
- <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
+ <link rel="stylesheet" href="../demos.css">
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
@@ -12,18 +12,21 @@
<script src="../../ui/jquery.ui.menu.js"></script>
<script>
$(function() {
- $("#topMenu").menu({
- position: { of: "ul:has(a.ui-state-focus):last" }
+ $( "#menu" ).menu({
+ position: { of: "ul:has(a.ui-state-focus):last" },
+ icons: {
+ submenu: "ui-icon-carat-1-e"
+ }
});
});
</script>
<style>
- .ui-menu { width: 200px; margin-bottom: 2em; }
+ .ui-menu { width: 200px; margin-bottom: 2em; }
</style>
</head>
<body>
-<ul id="topMenu">
+<ul id="menu">
<li><a href="#">Aberdeen</a></li>
<li><a href="#">Ada</a></li>
<li><a href="#">Adamsville</a></li>
diff --git a/demos/removeClass/default.html b/demos/removeClass/default.html
index a9f7c047d..61d90363a 100644
--- a/demos/removeClass/default.html
+++ b/demos/removeClass/default.html
@@ -5,7 +5,7 @@
<title>jQuery UI Effects - removeClass Demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler { width: 500px; height: 200px; position: relative; }
diff --git a/demos/show/default.html b/demos/show/default.html
index 091a71167..c0d1eeea7 100644
--- a/demos/show/default.html
+++ b/demos/show/default.html
@@ -5,18 +5,18 @@
<title>jQuery UI Effects - Show Demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
- <script src="../../ui/jquery.effects.blind.js"></script>
- <script src="../../ui/jquery.effects.bounce.js"></script>
- <script src="../../ui/jquery.effects.clip.js"></script>
- <script src="../../ui/jquery.effects.drop.js"></script>
- <script src="../../ui/jquery.effects.explode.js"></script>
- <script src="../../ui/jquery.effects.fold.js"></script>
- <script src="../../ui/jquery.effects.highlight.js"></script>
- <script src="../../ui/jquery.effects.pulsate.js"></script>
- <script src="../../ui/jquery.effects.scale.js"></script>
- <script src="../../ui/jquery.effects.shake.js"></script>
- <script src="../../ui/jquery.effects.slide.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
+ <script src="../../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../../ui/jquery.ui.effect-bounce.js"></script>
+ <script src="../../ui/jquery.ui.effect-clip.js"></script>
+ <script src="../../ui/jquery.ui.effect-drop.js"></script>
+ <script src="../../ui/jquery.ui.effect-explode.js"></script>
+ <script src="../../ui/jquery.ui.effect-fold.js"></script>
+ <script src="../../ui/jquery.ui.effect-highlight.js"></script>
+ <script src="../../ui/jquery.ui.effect-pulsate.js"></script>
+ <script src="../../ui/jquery.ui.effect-scale.js"></script>
+ <script src="../../ui/jquery.ui.effect-shake.js"></script>
+ <script src="../../ui/jquery.ui.effect-slide.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler { width: 500px; height: 200px; }
diff --git a/demos/spinner/currency.html b/demos/spinner/currency.html
index 348666143..ff51b0177 100644
--- a/demos/spinner/currency.html
+++ b/demos/spinner/currency.html
@@ -5,7 +5,7 @@
<title>jQuery UI Spinner - Default functionality</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+ <script src="../../external/jquery.mousewheel.js"></script>
<script src="../../external/globalize.js"></script>
<script src="../../external/globalize.culture.de-DE.js"></script>
<script src="../../external/globalize.culture.ja-JP.js"></script>
diff --git a/demos/spinner/decimal.html b/demos/spinner/decimal.html
index 0af4c520c..87e413da8 100644
--- a/demos/spinner/decimal.html
+++ b/demos/spinner/decimal.html
@@ -5,7 +5,7 @@
<title>jQuery UI Spinner - Decimal</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+ <script src="../../external/jquery.mousewheel.js"></script>
<script src="../../external/globalize.js"></script>
<script src="../../external/globalize.culture.de-DE.js"></script>
<script src="../../external/globalize.culture.ja-JP.js"></script>
diff --git a/demos/spinner/default.html b/demos/spinner/default.html
index 1827724b9..b857a9095 100644
--- a/demos/spinner/default.html
+++ b/demos/spinner/default.html
@@ -5,7 +5,7 @@
<title>jQuery UI Spinner - Default functionality</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+ <script src="../../external/jquery.mousewheel.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.button.js"></script>
diff --git a/demos/spinner/latlong.html b/demos/spinner/latlong.html
index f4292c56a..eafbd257f 100644
--- a/demos/spinner/latlong.html
+++ b/demos/spinner/latlong.html
@@ -6,7 +6,7 @@
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+ <script src="../../external/jquery.mousewheel.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.button.js"></script>
diff --git a/demos/spinner/overflow.html b/demos/spinner/overflow.html
index 312853ddb..17d1ca30b 100644
--- a/demos/spinner/overflow.html
+++ b/demos/spinner/overflow.html
@@ -5,7 +5,7 @@
<title>jQuery UI Spinner - Overflow</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+ <script src="../../external/jquery.mousewheel.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.button.js"></script>
diff --git a/demos/spinner/time.html b/demos/spinner/time.html
index 8f8088486..a45a801d5 100644
--- a/demos/spinner/time.html
+++ b/demos/spinner/time.html
@@ -5,7 +5,7 @@
<title>jQuery UI Spinner - Time</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+ <script src="../../external/jquery.mousewheel.js"></script>
<script src="../../external/globalize.js"></script>
<script src="../../external/globalize.culture.de-DE.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
diff --git a/demos/switchClass/default.html b/demos/switchClass/default.html
index 673a19d3b..8b8ecd79b 100644
--- a/demos/switchClass/default.html
+++ b/demos/switchClass/default.html
@@ -5,7 +5,7 @@
<title>jQuery UI Effects - switchClass Demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler { width: 500px; height: 200px; position: relative; }
diff --git a/demos/tabs/cookie.html b/demos/tabs/cookie.html
deleted file mode 100644
index 1b71906e1..000000000
--- a/demos/tabs/cookie.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>jQuery UI Tabs - Default functionality</title>
- <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
- <script src="../../jquery-1.7.2.js"></script>
- <script src="../../external/jquery.cookie.js"></script>
- <script src="../../ui/jquery.ui.core.js"></script>
- <script src="../../ui/jquery.ui.widget.js"></script>
- <script src="../../ui/jquery.ui.tabs.js"></script>
- <link rel="stylesheet" href="../demos.css">
- <script>
- $(function() {
- $( "#tabs" ).tabs({
- cookie: {
- // store cookie for a day, without, it would be a session cookie
- expires: 1
- }
- });
- });
- </script>
-</head>
-<body>
-
-<div class="demo">
-
-<div id="tabs">
- <ul>
- <li><a href="#tabs-1">Nunc tincidunt</a></li>
- <li><a href="#tabs-2">Proin dolor</a></li>
- <li><a href="#tabs-3">Aenean lacinia</a></li>
- </ul>
- <div id="tabs-1">
- <p>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.</p>
- </div>
- <div id="tabs-2">
- <p>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.</p>
- </div>
- <div id="tabs-3">
- <p>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.</p>
- <p>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.</p>
- </div>
-</div>
-
-</div><!-- End demo -->
-
-
-
-<div class="demo-description">
-<p>Looks the same as the default demo, but uses cookie to store the selected tab, and restore it when the page (re)loads.
-The cookie is stored for a day, so tabs will be restored even after closing the browser. Use cookie: {} for using cookies with default options.</p>
-<p>The cookie option requires the cookie plugin, which can be found in the development-bundle > external folder from the download builder.</p>
-</div><!-- End demo-description -->
-
-</body>
-</html>
diff --git a/demos/tabs/index.html b/demos/tabs/index.html
index c0d668435..dbf7fee5a 100644
--- a/demos/tabs/index.html
+++ b/demos/tabs/index.html
@@ -17,7 +17,6 @@
<li><a href="sortable.html">Sortable</a></li>
<li><a href="manipulation.html">Simple manipulation</a></li>
<li><a href="bottom.html">Tabs below content</a></li>
- <li><a href="cookie.html">Cookie persistence</a></li>
</ul>
</div>
diff --git a/demos/toggle/default.html b/demos/toggle/default.html
index 5dcd5eff8..2d1b708b0 100644
--- a/demos/toggle/default.html
+++ b/demos/toggle/default.html
@@ -5,18 +5,18 @@
<title>jQuery UI Effects - Toggle Demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
- <script src="../../ui/jquery.effects.blind.js"></script>
- <script src="../../ui/jquery.effects.bounce.js"></script>
- <script src="../../ui/jquery.effects.clip.js"></script>
- <script src="../../ui/jquery.effects.drop.js"></script>
- <script src="../../ui/jquery.effects.explode.js"></script>
- <script src="../../ui/jquery.effects.fold.js"></script>
- <script src="../../ui/jquery.effects.highlight.js"></script>
- <script src="../../ui/jquery.effects.pulsate.js"></script>
- <script src="../../ui/jquery.effects.scale.js"></script>
- <script src="../../ui/jquery.effects.shake.js"></script>
- <script src="../../ui/jquery.effects.slide.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
+ <script src="../../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../../ui/jquery.ui.effect-bounce.js"></script>
+ <script src="../../ui/jquery.ui.effect-clip.js"></script>
+ <script src="../../ui/jquery.ui.effect-drop.js"></script>
+ <script src="../../ui/jquery.ui.effect-explode.js"></script>
+ <script src="../../ui/jquery.ui.effect-fold.js"></script>
+ <script src="../../ui/jquery.ui.effect-highlight.js"></script>
+ <script src="../../ui/jquery.ui.effect-pulsate.js"></script>
+ <script src="../../ui/jquery.ui.effect-scale.js"></script>
+ <script src="../../ui/jquery.ui.effect-shake.js"></script>
+ <script src="../../ui/jquery.ui.effect-slide.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler {
diff --git a/demos/toggleClass/default.html b/demos/toggleClass/default.html
index a7c100fcc..544c0b95b 100644
--- a/demos/toggleClass/default.html
+++ b/demos/toggleClass/default.html
@@ -5,7 +5,7 @@
<title>jQuery UI Effects - toggleClass Demo</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.7.2.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.toggler { width: 500px; height: 200px; position: relative; }
diff --git a/demos/tooltip/custom-animation.html b/demos/tooltip/custom-animation.html
index 4452a3002..8a55e455d 100644
--- a/demos/tooltip/custom-animation.html
+++ b/demos/tooltip/custom-animation.html
@@ -9,8 +9,8 @@
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.position.js"></script>
<script src="../../ui/jquery.ui.tooltip.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
- <script src="../../ui/jquery.effects.explode.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
+ <script src="../../ui/jquery.ui.effect-explode.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
diff --git a/demos/tooltip/tracking.html b/demos/tooltip/tracking.html
index 9f9ce1752..ab0237da6 100644
--- a/demos/tooltip/tracking.html
+++ b/demos/tooltip/tracking.html
@@ -19,24 +19,7 @@
<script>
$(function() {
$( ".demo" ).tooltip({
- position: {
- my: "left+25 center",
- at: "center"
- },
- open: function( event ) {
- var tooltip = $( ".ui-tooltip" ),
- positionOption = $( this ).tooltip( "option", "position" );
- function position( event ) {
- positionOption.of = event;
- tooltip.position( positionOption );
- }
- $( document ).bind( "mousemove.tooltip-position", position );
- // trigger once to override element-relative positioning
- position( event );
- },
- close: function() {
- $( document ).unbind( "mousemove.tooltip-position" );
- }
+ track: true
});
});
</script>
diff --git a/demos/tooltip/video-player.html b/demos/tooltip/video-player.html
index 55a0f83af..1e17ae163 100644
--- a/demos/tooltip/video-player.html
+++ b/demos/tooltip/video-player.html
@@ -11,8 +11,8 @@
<script src="../../ui/jquery.ui.tooltip.js"></script>
<script src="../../ui/jquery.ui.button.js"></script>
<script src="../../ui/jquery.ui.menu.js"></script>
- <script src="../../ui/jquery.effects.core.js"></script>
- <script src="../../ui/jquery.effects.blind.js"></script>
+ <script src="../../ui/jquery.ui.effect.js"></script>
+ <script src="../../ui/jquery.ui.effect-blind.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.player {
diff --git a/demos/widget/default.html b/demos/widget/default.html
index f39825034..8d08256ce 100644
--- a/demos/widget/default.html
+++ b/demos/widget/default.html
@@ -56,8 +56,8 @@
.button();
// bind click events on the changer button to the random method
- this._bind( this.changer, {
- // _bind won't call random when widget is disabled
+ this._on( this.changer, {
+ // _on won't call random when widget is disabled
click: "random"
});
this._refresh();
@@ -90,7 +90,7 @@
}
},
- // events bound via _bind are removed automatically
+ // events bound via _on are removed automatically
// revert other modifications here
_destroy: function() {
// remove generated elements
diff --git a/external/jquery.mousewheel-3.0.4.js b/external/jquery.mousewheel.js
index dbf8f4b0f..808e12b89 100644
--- a/external/jquery.mousewheel-3.0.4.js
+++ b/external/jquery.mousewheel.js
@@ -1,12 +1,12 @@
-/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
- * Version: 3.0.4
- *
+ * Version: 3.0.6
+ *
* Requires: 1.2.2+
*/
@@ -14,6 +14,12 @@
var types = ['DOMMouseScroll', 'mousewheel'];
+if ($.event.fixHooks) {
+ for ( var i=types.length; i; ) {
+ $.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
+ }
+}
+
$.event.special.mousewheel = {
setup: function() {
if ( this.addEventListener ) {
@@ -24,7 +30,7 @@ $.event.special.mousewheel = {
this.onmousewheel = handler;
}
},
-
+
teardown: function() {
if ( this.removeEventListener ) {
for ( var i=types.length; i; ) {
@@ -40,7 +46,7 @@ $.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
-
+
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
@@ -51,28 +57,28 @@ function handler(event) {
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
-
+
// Old school scrollwheel delta
- if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
- if ( event.detail ) { delta = -event.detail/3; }
-
+ if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
+ if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
+
// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
-
+
// Gecko
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaY = 0;
deltaX = -1*delta;
}
-
+
// Webkit
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
-
+
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
-
- return $.event.handle.apply(this, args);
+
+ return ($.event.dispatch || $.event.handle).apply(this, args);
}
})(jQuery); \ No newline at end of file
diff --git a/external/qunit.css b/external/qunit.css
index 23235ec84..257b224ff 100644
--- a/external/qunit.css
+++ b/external/qunit.css
@@ -1,5 +1,5 @@
/**
- * QUnit v1.6.0 - A JavaScript Unit Testing Framework
+ * QUnit v1.9.0 - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
@@ -38,10 +38,10 @@
line-height: 1em;
font-weight: normal;
- border-radius: 15px 15px 0 0;
- -moz-border-radius: 15px 15px 0 0;
- -webkit-border-top-right-radius: 15px;
- -webkit-border-top-left-radius: 15px;
+ border-radius: 5px 5px 0 0;
+ -moz-border-radius: 5px 5px 0 0;
+ -webkit-border-top-right-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
}
#qunit-header a {
@@ -54,9 +54,9 @@
color: #fff;
}
-#qunit-header label {
+#qunit-testrunner-toolbar label {
display: inline-block;
- padding-left: 0.5em;
+ padding: 0 .5em 0 .1em;
}
#qunit-banner {
@@ -113,13 +113,9 @@
background-color: #fff;
- border-radius: 15px;
- -moz-border-radius: 15px;
- -webkit-border-radius: 15px;
-
- box-shadow: inset 0px 2px 13px #999;
- -moz-box-shadow: inset 0px 2px 13px #999;
- -webkit-box-shadow: inset 0px 2px 13px #999;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
}
#qunit-tests table {
@@ -162,8 +158,7 @@
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
- margin: 0.5em;
- padding: 0.4em 0.5em 0.4em 0.5em;
+ padding: 5px;
background-color: #fff;
border-bottom: none;
list-style-position: inside;
@@ -172,9 +167,9 @@
/*** Passing Styles */
#qunit-tests li li.pass {
- color: #5E740B;
+ color: #3c510c;
background-color: #fff;
- border-left: 26px solid #C6E746;
+ border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
@@ -190,15 +185,15 @@
#qunit-tests li li.fail {
color: #710909;
background-color: #fff;
- border-left: 26px solid #EE5757;
+ border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
- border-radius: 0 0 15px 15px;
- -moz-border-radius: 0 0 15px 15px;
- -webkit-border-bottom-right-radius: 15px;
- -webkit-border-bottom-left-radius: 15px;
+ border-radius: 0 0 5px 5px;
+ -moz-border-radius: 0 0 5px 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
}
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
diff --git a/external/qunit.js b/external/qunit.js
index 2c277fab5..9efedcb44 100644
--- a/external/qunit.js
+++ b/external/qunit.js
@@ -1,5 +1,5 @@
/**
- * QUnit v1.6.0 - A JavaScript Unit Testing Framework
+ * QUnit v1.9.0 - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
@@ -12,7 +12,9 @@
var QUnit,
config,
+ onErrorFnPrev,
testId = 0,
+ fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""),
toString = Object.prototype.toString,
hasOwn = Object.prototype.hasOwnProperty,
defined = {
@@ -29,26 +31,31 @@ var QUnit,
}())
};
-function Test( name, testName, expected, async, callback ) {
- this.name = name;
- this.testName = testName;
- this.expected = expected;
- this.async = async;
- this.callback = callback;
+function Test( settings ) {
+ extend( this, settings );
this.assertions = [];
+ this.testNumber = ++Test.count;
}
+Test.count = 0;
+
Test.prototype = {
init: function() {
- var b, li,
+ var a, b, li,
tests = id( "qunit-tests" );
if ( tests ) {
b = document.createElement( "strong" );
- b.innerHTML = "Running " + this.name;
+ b.innerHTML = this.name;
+
+ // `a` initialized at top of scope
+ a = document.createElement( "a" );
+ a.innerHTML = "Rerun";
+ a.href = QUnit.url({ testNumber: this.testNumber });
li = document.createElement( "li" );
li.appendChild( b );
+ li.appendChild( a );
li.className = "running";
li.id = this.id = "qunit-test-output" + testId++;
@@ -119,14 +126,14 @@ Test.prototype = {
}
if ( config.notrycatch ) {
- this.callback.call( this.testEnvironment );
+ this.callback.call( this.testEnvironment, QUnit.assert );
return;
}
try {
- this.callback.call( this.testEnvironment );
+ this.callback.call( this.testEnvironment, QUnit.assert );
} catch( e ) {
- QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + ": " + e.message, extractStacktrace( e, 1 ) );
+ QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + e.message, extractStacktrace( e, 0 ) );
// else next test will carry the responsibility
saveGlobal();
@@ -152,13 +159,16 @@ Test.prototype = {
},
finish: function() {
config.current = this;
- if ( this.expected != null && this.expected != this.assertions.length ) {
+ if ( config.requireExpects && this.expected == null ) {
+ QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack );
+ } else if ( this.expected != null && this.expected != this.assertions.length ) {
QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack );
} else if ( this.expected == null && !this.assertions.length ) {
QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack );
}
var assertion, a, b, i, li, ol,
+ test = this,
good = 0,
bad = 0,
tests = id( "qunit-tests" );
@@ -203,11 +213,6 @@ Test.prototype = {
b = document.createElement( "strong" );
b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
- // `a` initialized at top of scope
- a = document.createElement( "a" );
- a.innerHTML = "Rerun";
- a.href = QUnit.url({ filter: getText([b]).replace( /\([^)]+\)$/, "" ).replace( /(^\s*|\s*$)/g, "" ) });
-
addEvent(b, "click", function() {
var next = b.nextSibling.nextSibling,
display = next.style.display;
@@ -220,9 +225,7 @@ Test.prototype = {
target = target.parentNode;
}
if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
- window.location = QUnit.url({
- filter: getText([target]).replace( /\([^)]+\)$/, "" ).replace( /(^\s*|\s*$)/g, "" )
- });
+ window.location = QUnit.url({ testNumber: test.testNumber });
}
});
@@ -230,8 +233,9 @@ Test.prototype = {
li = id( this.id );
li.className = bad ? "fail" : "pass";
li.removeChild( li.firstChild );
+ a = li.firstChild;
li.appendChild( b );
- li.appendChild( a );
+ li.appendChild ( a );
li.appendChild( ol );
} else {
@@ -253,6 +257,8 @@ Test.prototype = {
});
QUnit.reset();
+
+ config.current = undefined;
},
queue: function() {
@@ -291,6 +297,7 @@ Test.prototype = {
}
};
+// Root QUnit object.
// `QUnit` initialized at top of scope
QUnit = {
@@ -322,14 +329,21 @@ QUnit = {
name = "<span class='module-name'>" + config.currentModule + "</span>: " + name;
}
- if ( !validTest(config.currentModule + ": " + testName) ) {
+ test = new Test({
+ name: name,
+ testName: testName,
+ expected: expected,
+ async: async,
+ callback: callback,
+ module: config.currentModule,
+ moduleTestEnvironment: config.currentModuleTestEnviroment,
+ stack: sourceFromStacktrace( 2 )
+ });
+
+ if ( !validTest( test ) ) {
return;
}
- test = new Test( name, testName, expected, async, callback );
- test.module = config.currentModule;
- test.moduleTestEnvironment = config.currentModuleTestEnviroment;
- test.stack = sourceFromStacktrace( 2 );
test.queue();
},
@@ -338,8 +352,61 @@ QUnit = {
config.current.expected = asserts;
},
- // Asserts true.
- // @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
+ start: function( count ) {
+ config.semaphore -= count || 1;
+ // don't start until equal number of stop-calls
+ if ( config.semaphore > 0 ) {
+ return;
+ }
+ // ignore if start is called more often then stop
+ if ( config.semaphore < 0 ) {
+ config.semaphore = 0;
+ }
+ // A slight delay, to avoid any current callbacks
+ if ( defined.setTimeout ) {
+ window.setTimeout(function() {
+ if ( config.semaphore > 0 ) {
+ return;
+ }
+ if ( config.timeout ) {
+ clearTimeout( config.timeout );
+ }
+
+ config.blocking = false;
+ process( true );
+ }, 13);
+ } else {
+ config.blocking = false;
+ process( true );
+ }
+ },
+
+ stop: function( count ) {
+ config.semaphore += count || 1;
+ config.blocking = true;
+
+ if ( config.testTimeout && defined.setTimeout ) {
+ clearTimeout( config.timeout );
+ config.timeout = window.setTimeout(function() {
+ QUnit.ok( false, "Test timed out" );
+ config.semaphore = 1;
+ QUnit.start();
+ }, config.testTimeout );
+ }
+ }
+};
+
+// Asssert helpers
+// All of these must call either QUnit.push() or manually do:
+// - runLoggingCallbacks( "log", .. );
+// - config.current.assertions.push({ .. });
+QUnit.assert = {
+ /**
+ * Asserts rough true-ish result.
+ * @name ok
+ * @function
+ * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
+ */
ok: function( result, msg ) {
if ( !config.current ) {
throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) );
@@ -369,46 +436,74 @@ QUnit = {
});
},
- // Checks that the first two arguments are equal, with an optional message. Prints out both actual and expected values.
- // @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes." );
+ /**
+ * Assert that the first two arguments are equal, with an optional message.
+ * Prints out both actual and expected values.
+ * @name equal
+ * @function
+ * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" );
+ */
equal: function( actual, expected, message ) {
QUnit.push( expected == actual, actual, expected, message );
},
+ /**
+ * @name notEqual
+ * @function
+ */
notEqual: function( actual, expected, message ) {
QUnit.push( expected != actual, actual, expected, message );
},
+ /**
+ * @name deepEqual
+ * @function
+ */
deepEqual: function( actual, expected, message ) {
QUnit.push( QUnit.equiv(actual, expected), actual, expected, message );
},
+ /**
+ * @name notDeepEqual
+ * @function
+ */
notDeepEqual: function( actual, expected, message ) {
QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message );
},
+ /**
+ * @name strictEqual
+ * @function
+ */
strictEqual: function( actual, expected, message ) {
QUnit.push( expected === actual, actual, expected, message );
},
+ /**
+ * @name notStrictEqual
+ * @function
+ */
notStrictEqual: function( actual, expected, message ) {
QUnit.push( expected !== actual, actual, expected, message );
},
- raises: function( block, expected, message ) {
+ throws: function( block, expected, message ) {
var actual,
ok = false;
+ // 'expected' is optional
if ( typeof expected === "string" ) {
message = expected;
expected = null;
}
+ config.current.ignoreGlobalErrors = true;
try {
block.call( config.current.testEnvironment );
} catch (e) {
actual = e;
}
+ config.current.ignoreGlobalErrors = false;
if ( actual ) {
// we don't want to validate thrown error
@@ -424,53 +519,35 @@ QUnit = {
} else if ( expected.call( {}, actual ) === true ) {
ok = true;
}
- }
-
- QUnit.ok( ok, message );
- },
-
- start: function( count ) {
- config.semaphore -= count || 1;
- // don't start until equal number of stop-calls
- if ( config.semaphore > 0 ) {
- return;
- }
- // ignore if start is called more often then stop
- if ( config.semaphore < 0 ) {
- config.semaphore = 0;
- }
- // A slight delay, to avoid any current callbacks
- if ( defined.setTimeout ) {
- window.setTimeout(function() {
- if ( config.semaphore > 0 ) {
- return;
- }
- if ( config.timeout ) {
- clearTimeout( config.timeout );
- }
- config.blocking = false;
- process( true );
- }, 13);
+ QUnit.push( ok, actual, null, message );
} else {
- config.blocking = false;
- process( true );
+ QUnit.pushFailure( message, null, 'No exception was thrown.' );
}
- },
+ }
+};
- stop: function( count ) {
- config.semaphore += count || 1;
- config.blocking = true;
+/**
+ * @deprecate since 1.8.0
+ * Kept assertion helpers in root for backwards compatibility
+ */
+extend( QUnit, QUnit.assert );
- if ( config.testTimeout && defined.setTimeout ) {
- clearTimeout( config.timeout );
- config.timeout = window.setTimeout(function() {
- QUnit.ok( false, "Test timed out" );
- config.semaphore = 1;
- QUnit.start();
- }, config.testTimeout );
- }
- }
+/**
+ * @deprecated since 1.9.0
+ * Kept global "raises()" for backwards compatibility
+ */
+QUnit.raises = QUnit.assert.throws;
+
+/**
+ * @deprecated since 1.0.0, replaced with error pushes since 1.3.0
+ * Kept to avoid TypeErrors for undefined methods.
+ */
+QUnit.equals = function() {
+ QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" );
+};
+QUnit.same = function() {
+ QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" );
};
// We want access to the constructor's prototype
@@ -482,17 +559,11 @@ QUnit = {
QUnit.constructor = F;
}());
-// deprecated; still export them to window to provide clear error messages
-// next step: remove entirely
-QUnit.equals = function() {
- QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" );
-};
-QUnit.same = function() {
- QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" );
-};
-
-// Maintain internal state
-// `config` initialized at top of scope
+/**
+ * Config object: Maintain internal state
+ * Later exposed as QUnit.config
+ * `config` initialized at top of scope
+ */
config = {
// The queue of tests to run
queue: [],
@@ -511,7 +582,23 @@ config = {
// by default, modify document.title when suite is done
altertitle: true,
- urlConfig: [ "noglobals", "notrycatch" ],
+ // when enabled, all tests must call expect()
+ requireExpects: false,
+
+ // add checkboxes that are persisted in the query-string
+ // when enabled, the id is set to `true` as a `QUnit.config` property
+ urlConfig: [
+ {
+ id: "noglobals",
+ label: "Check for Globals",
+ tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings."
+ },
+ {
+ id: "notrycatch",
+ label: "No try-catch",
+ tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings."
+ }
+ ],
// logging callback queues
begin: [],
@@ -523,7 +610,7 @@ config = {
moduleDone: []
};
-// Load paramaters
+// Initialize more QUnit.config and QUnit.urlParams
(function() {
var i,
location = window.location || { search: "", protocol: "file:" },
@@ -543,20 +630,30 @@ config = {
}
QUnit.urlParams = urlParams;
+
+ // String search anywhere in moduleName+testName
config.filter = urlParams.filter;
+ // Exact match of the module name
+ config.module = urlParams.module;
+
+ config.testNumber = parseInt( urlParams.testNumber, 10 ) || null;
+
// Figure out if we're running the tests from a server or not
QUnit.isLocal = location.protocol === "file:";
}());
-// Expose the API as global variables, unless an 'exports' object exists,
-// in that case we assume we're in CommonJS - export everything at the end
+// Export global variables, unless an 'exports' object exists,
+// in that case we assume we're in CommonJS (dealt with on the bottom of the script)
if ( typeof exports === "undefined" ) {
extend( window, QUnit );
+
+ // Expose QUnit object
window.QUnit = QUnit;
}
-// define these after exposing globals to keep them in these QUnit namespace only
+// Extend QUnit object,
+// these after set here because they should not be exposed as global functions
extend( QUnit, {
config: config,
@@ -722,22 +819,34 @@ extend( QUnit, {
});
},
- pushFailure: function( message, source ) {
+ pushFailure: function( message, source, actual ) {
+ if ( !config.current ) {
+ throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) );
+ }
+
var output,
details = {
result: false,
message: message
};
- message = escapeInnerText(message ) || "error";
+ message = escapeInnerText( message ) || "error";
message = "<span class='test-message'>" + message + "</span>";
output = message;
+ output += "<table>";
+
+ if ( actual ) {
+ output += "<tr class='test-actual'><th>Result: </th><td><pre>" + escapeInnerText( actual ) + "</pre></td></tr>";
+ }
+
if ( source ) {
details.source = source;
- output += "<table><tr class='test-source'><th>Source: </th><td><pre>" + escapeInnerText( source ) + "</pre></td></tr></table>";
+ output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeInnerText( source ) + "</pre></td></tr>";
}
+ output += "</table>";
+
runLoggingCallbacks( "log", QUnit, details );
config.current.assertions.push({
@@ -764,25 +873,37 @@ extend( QUnit, {
extend: extend,
id: id,
addEvent: addEvent
+ // load, equiv, jsDump, diff: Attached later
});
-// QUnit.constructor is set to the empty F() above so that we can add to it's prototype later
-// Doing this allows us to tell if the following methods have been overwritten on the actual
-// QUnit object, which is a deprecated way of using the callbacks.
+/**
+ * @deprecated: Created for backwards compatibility with test runner that set the hook function
+ * into QUnit.{hook}, instead of invoking it and passing the hook function.
+ * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here.
+ * Doing this allows us to tell if the following methods have been overwritten on the actual
+ * QUnit object.
+ */
extend( QUnit.constructor.prototype, {
+
// Logging callbacks; all receive a single argument with the listed properties
// run test/logs.html for any related changes
begin: registerLoggingCallback( "begin" ),
+
// done: { failed, passed, total, runtime }
done: registerLoggingCallback( "done" ),
+
// log: { result, actual, expected, message }
log: registerLoggingCallback( "log" ),
+
// testStart: { name }
testStart: registerLoggingCallback( "testStart" ),
+
// testDone: { name, failed, passed, total }
testDone: registerLoggingCallback( "testDone" ),
+
// moduleStart: { name }
moduleStart: registerLoggingCallback( "moduleStart" ),
+
// moduleDone: { name, failed, passed, total }
moduleDone: registerLoggingCallback( "moduleDone" )
});
@@ -795,7 +916,7 @@ QUnit.load = function() {
runLoggingCallbacks( "begin", QUnit, {} );
// Initialize the config, saving the execution queue
- var banner, filter, i, label, len, main, ol, toolbar, userAgent, val,
+ var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes,
urlConfigHtml = "",
oldconfig = extend( {}, config );
@@ -808,8 +929,15 @@ QUnit.load = function() {
for ( i = 0; i < len; i++ ) {
val = config.urlConfig[i];
- config[val] = QUnit.urlParams[val];
- urlConfigHtml += "<label><input name='" + val + "' type='checkbox'" + ( config[val] ? " checked='checked'" : "" ) + ">" + val + "</label>";
+ if ( typeof val === "string" ) {
+ val = {
+ id: val,
+ label: val,
+ tooltip: "[no tooltip available]"
+ };
+ }
+ config[ val.id ] = QUnit.urlParams[ val.id ];
+ urlConfigHtml += "<input id='qunit-urlconfig-" + val.id + "' name='" + val.id + "' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) + " title='" + val.tooltip + "'><label for='qunit-urlconfig-" + val.id + "' title='" + val.tooltip + "'>" + val.label + "</label>";
}
// `userAgent` initialized at top of scope
@@ -821,12 +949,7 @@ QUnit.load = function() {
// `banner` initialized at top of scope
banner = id( "qunit-header" );
if ( banner ) {
- banner.innerHTML = "<a href='" + QUnit.url({ filter: undefined }) + "'>" + banner.innerHTML + "</a> " + urlConfigHtml;
- addEvent( banner, "change", function( event ) {
- var params = {};
- params[ event.target.name ] = event.target.checked ? true : undefined;
- window.location = QUnit.url( params );
- });
+ banner.innerHTML = "<a href='" + QUnit.url({ filter: undefined, module: undefined, testNumber: undefined }) + "'>" + banner.innerHTML + "</a> ";
}
// `toolbar` initialized at top of scope
@@ -867,8 +990,18 @@ QUnit.load = function() {
// `label` initialized at top of scope
label = document.createElement( "label" );
label.setAttribute( "for", "qunit-filter-pass" );
+ label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." );
label.innerHTML = "Hide passed tests";
toolbar.appendChild( label );
+
+ urlConfigCheckboxes = document.createElement( 'span' );
+ urlConfigCheckboxes.innerHTML = urlConfigHtml;
+ addEvent( urlConfigCheckboxes, "change", function( event ) {
+ var params = {};
+ params[ event.target.name ] = event.target.checked ? true : undefined;
+ window.location = QUnit.url( params );
+ });
+ toolbar.appendChild( urlConfigCheckboxes );
}
// `main` initialized at top of scope
@@ -884,15 +1017,36 @@ QUnit.load = function() {
addEvent( window, "load", QUnit.load );
-// addEvent(window, "error" ) gives us a useless event object
-window.onerror = function( message, file, line ) {
- if ( QUnit.config.current ) {
- QUnit.pushFailure( message, file + ":" + line );
- } else {
- QUnit.test( "global failure", function() {
- QUnit.pushFailure( message, file + ":" + line );
- });
+// `onErrorFnPrev` initialized at top of scope
+// Preserve other handlers
+onErrorFnPrev = window.onerror;
+
+// Cover uncaught exceptions
+// Returning true will surpress the default browser handler,
+// returning false will let it run.
+window.onerror = function ( error, filePath, linerNr ) {
+ var ret = false;
+ if ( onErrorFnPrev ) {
+ ret = onErrorFnPrev( error, filePath, linerNr );
}
+
+ // Treat return value as window.onerror itself does,
+ // Only do our handling if not surpressed.
+ if ( ret !== true ) {
+ if ( QUnit.config.current ) {
+ if ( QUnit.config.current.ignoreGlobalErrors ) {
+ return true;
+ }
+ QUnit.pushFailure( error, filePath + ":" + linerNr );
+ } else {
+ QUnit.test( "global failure", function() {
+ QUnit.pushFailure( error, filePath + ":" + linerNr );
+ });
+ }
+ return false;
+ }
+
+ return ret;
};
function done() {
@@ -962,39 +1116,46 @@ function done() {
});
}
-function validTest( name ) {
- var not,
- filter = config.filter,
- run = false;
+/** @return Boolean: true if this test should be ran */
+function validTest( test ) {
+ var include,
+ filter = config.filter && config.filter.toLowerCase(),
+ module = config.module && config.module.toLowerCase(),
+ fullName = (test.module + ": " + test.testName).toLowerCase();
- if ( !filter ) {
- return true;
+ if ( config.testNumber ) {
+ return test.testNumber === config.testNumber;
}
- not = filter.charAt( 0 ) === "!";
+ if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) {
+ return false;
+ }
- if ( not ) {
- filter = filter.slice( 1 );
+ if ( !filter ) {
+ return true;
}
- if ( name.indexOf( filter ) !== -1 ) {
- return !not;
+ include = filter.charAt( 0 ) !== "!";
+ if ( !include ) {
+ filter = filter.slice( 1 );
}
- if ( not ) {
- run = true;
+ // If the filter matches, we need to honour include
+ if ( fullName.indexOf( filter ) !== -1 ) {
+ return include;
}
- return run;
+ // Otherwise, do the opposite
+ return !include;
}
// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions)
// Later Safari and IE10 are supposed to support error.stack as well
// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack
function extractStacktrace( e, offset ) {
- offset = offset || 3;
+ offset = offset === undefined ? 3 : offset;
- var stack;
+ var stack, include, i, regex;
if ( e.stacktrace ) {
// Opera
@@ -1005,6 +1166,18 @@ function extractStacktrace( e, offset ) {
if (/^error$/i.test( stack[0] ) ) {
stack.shift();
}
+ if ( fileName ) {
+ include = [];
+ for ( i = offset; i < stack.length; i++ ) {
+ if ( stack[ i ].indexOf( fileName ) != -1 ) {
+ break;
+ }
+ include.push( stack[ i ] );
+ }
+ if ( include.length ) {
+ return include.join( "\n" );
+ }
+ }
return stack[ offset ];
} else if ( e.sourceURL ) {
// Safari, PhantomJS
@@ -1419,11 +1592,11 @@ QUnit.jsDump = (function() {
type = "null";
} else if ( typeof obj === "undefined" ) {
type = "undefined";
- } else if ( QUnit.is( "RegExp", obj) ) {
+ } else if ( QUnit.is( "regexp", obj) ) {
type = "regexp";
- } else if ( QUnit.is( "Date", obj) ) {
+ } else if ( QUnit.is( "date", obj) ) {
type = "date";
- } else if ( QUnit.is( "Function", obj) ) {
+ } else if ( QUnit.is( "function", obj) ) {
type = "function";
} else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) {
type = "window";
diff --git a/grunt.js b/grunt.js
index 5d65fa037..a861be2e0 100644
--- a/grunt.js
+++ b/grunt.js
@@ -16,7 +16,7 @@ var // modules
"jquery.ui.resizable.js",
"jquery.ui.selectable.js",
"jquery.ui.sortable.js",
- "jquery.effects.core.js"
+ "jquery.ui.effect.js"
],
uiFiles = coreFiles.map(function( file ) {
@@ -80,12 +80,14 @@ uiFiles.forEach(function( file ) {
compareFiles[ file ] = [ file, mapMinFile( file ) ];
});
-// csslint and cssmin tasks
+// grunt plugins
grunt.loadNpmTasks( "grunt-css" );
-// file size comparison tasks
-grunt.loadNpmTasks( "grunt-compare-size" );
-// html validation task
grunt.loadNpmTasks( "grunt-html" );
+grunt.loadNpmTasks( "grunt-compare-size" );
+grunt.loadNpmTasks( "grunt-junit" );
+grunt.loadNpmTasks( "grunt-git-authors" );
+// local testswarm and build tasks
+grunt.loadTasks( "build/tasks" );
grunt.registerHelper( "strip_all_banners", function( filepath ) {
return grunt.file.read( filepath ).replace( /^\s*\/\*[\s\S]*?\*\/\s*/g, "" );
@@ -291,7 +293,7 @@ grunt.initConfig({
// TODO remove items from this list once rewritten
return !( /(mouse|datepicker|draggable|droppable|resizable|selectable|sortable)\.js$/ ).test( file );
}),
- grunt: "grunt.js",
+ grunt: [ "grunt.js", "build/tasks/*.js" ],
tests: "tests/unit/**/*.js"
},
csslint: {
@@ -340,262 +342,6 @@ grunt.initConfig({
})()
});
-grunt.registerTask( "testswarm", function( commit, configFile ) {
- var test,
- testswarm = require( "testswarm" ),
- testBase = "http://swarm.jquery.org/git/jquery-ui/" + commit + "/tests/unit/",
- testUrls = [],
- 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",
- "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",
- "Spinner": "spinner/spinner.html",
- "Tabs": "tabs/tabs.html",
- "Tabs_deprecated": "tabs/tabs_deprecated.html",
- "Tooltip": "tooltip/tooltip.html",
- "Widget": "widget/widget.html"
- };
- for ( test in tests ) {
- testUrls.push( testBase + tests[ test ] + "?nojshint=true" );
- }
- testswarm({
- url: "http://swarm.jquery.org/",
- pollInterval: 10000,
- timeout: 1000 * 60 * 30,
- done: this.async()
- }, {
- authUsername: "jqueryui",
- authToken: grunt.file.readJSON( configFile ).jqueryui.authToken,
- jobName: 'jQuery UI commit #<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
- runMax: 3,
- "runNames[]": Object.keys(tests),
- "runUrls[]": testUrls,
- "browserSets[]": ["popular"]
- });
-});
-
-grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {
- function replaceVersion( source ) {
- return source.replace( /@VERSION/g, grunt.config( "pkg.version" ) );
- }
- function copyFile( src, dest ) {
- if ( /(js|css)$/.test( src ) ) {
- grunt.file.copy( src, dest, {
- process: replaceVersion
- });
- } else {
- grunt.file.copy( src, dest );
- }
- }
- var files = grunt.file.expandFiles( this.file.src ),
- target = this.file.dest + "/",
- strip = this.data.strip,
- renameCount = 0,
- fileName;
- if ( typeof strip === "string" ) {
- strip = new RegExp( "^" + grunt.template.process( strip, grunt.config() ).replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ) );
- }
- files.forEach(function( fileName ) {
- var targetFile = strip ? fileName.replace( strip, "" ) : fileName;
- copyFile( fileName, target + targetFile );
- });
- grunt.log.writeln( "Copied " + files.length + " files." );
- for ( fileName in this.data.renames ) {
- renameCount += 1;
- copyFile( fileName, target + grunt.template.process( this.data.renames[ fileName ], grunt.config() ) );
- }
- if ( renameCount ) {
- grunt.log.writeln( "Renamed " + renameCount + " files." );
- }
-});
-
-
-grunt.registerMultiTask( "zip", "Create a zip file for release", function() {
- // TODO switch back to adm-zip for better cross-platform compability once it actually works
- // 0.1.3 works, but result can't be unzipped
- // its also a lot slower then zip program, probably due to how its used...
- // var files = grunt.file.expandFiles( "dist/" + this.file.src + "/**/*" );
- // grunt.log.writeln( "Creating zip file " + this.file.dest );
-
- //var AdmZip = require( "adm-zip" );
- //var zip = new AdmZip();
- //files.forEach(function( file ) {
- // grunt.verbose.writeln( "Zipping " + file );
- // // rewrite file names from dist folder (created by build), drop the /dist part
- // zip.addFile(file.replace(/^dist/, "" ), fs.readFileSync( file ) );
- //});
- //zip.writeZip( "dist/" + this.file.dest );
- //grunt.log.writeln( "Wrote " + files.length + " files to " + this.file.dest );
-
- var done = this.async(),
- dest = this.file.dest,
- src = grunt.template.process( this.file.src, grunt.config() );
- grunt.utils.spawn({
- cmd: "zip",
- args: [ "-r", dest, src ],
- opts: {
- cwd: 'dist'
- }
- }, function( err, result ) {
- if ( err ) {
- grunt.log.error( err );
- done();
- return;
- }
- grunt.log.writeln( "Zipped " + dest );
- done();
- });
-});
-
-grunt.registerMultiTask( "md5", "Create list of md5 hashes for CDN uploads", function() {
- // remove dest file before creating it, to make sure itself is not included
- if ( path.existsSync( this.file.dest ) ) {
- fs.unlinkSync( this.file.dest );
- }
- var crypto = require( "crypto" ),
- dir = this.file.src + "/",
- hashes = [];
- grunt.file.expandFiles( dir + "**/*" ).forEach(function( fileName ) {
- var hash = crypto.createHash( "md5" );
- hash.update( grunt.file.read( fileName, "ascii" ) );
- hashes.push( fileName.replace( dir, "" ) + " " + hash.digest( "hex" ) );
- });
- grunt.file.write( this.file.dest, hashes.join( "\n" ) + "\n" );
- grunt.log.writeln( "Wrote " + this.file.dest + " with " + hashes.length + " hashes" );
-});
-
-// 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
- 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 );
- });
-
- // copy minified base theme from regular release
- files = grunt.file.expandFiles( distFolder + "/themes/base/**/*" );
- files.forEach(function( fileName ) {
- grunt.file.copy( fileName, target + fileName.replace( distFolder, "" ) );
- });
-});
-
-grunt.registerTask( "clean", function() {
- require( "rimraf" ).sync( "dist" );
-});
-
-grunt.registerTask( "authors", function() {
- var done = this.async();
-
- grunt.utils.spawn({
- cmd: "git",
- args: [ "log", "--pretty=%an <%ae>" ]
- }, function( err, result ) {
- if ( err ) {
- grunt.log.error( err );
- return done( false );
- }
-
- var authors,
- tracked = {};
- authors = result.split( "\n" ).reverse().filter(function( author ) {
- var first = !tracked[ author ];
- tracked[ author ] = true;
- return first;
- }).join( "\n" );
- grunt.log.writeln( authors );
- done();
- });
-});
-
grunt.registerTask( "default", "lint csslint htmllint qunit" );
grunt.registerTask( "sizer", "concat:ui min:dist/jquery-ui.min.js compare_size:all" );
grunt.registerTask( "sizer_all", "concat:ui min compare_size" );
diff --git a/package.json b/package.json
index 8a83f3f94..d48520264 100644
--- a/package.json
+++ b/package.json
@@ -3,17 +3,43 @@
"title": "jQuery UI",
"description": "Abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications.",
"version": "1.9.0pre",
- "homepage": "https://github.com/jquery/jquery-ui",
+ "homepage": "http://jqueryui.com",
"author": {
- "name": "AUTHORS.txt"
+ "name": "jQuery Foundation and other contributors",
+ "url": "http://jqueryui.com"
},
+ "maintainers": [
+ {
+ "name": "Scott González",
+ "email": "scott.gonzalez@gmail.com",
+ "url": "http://scottgonzalez.com"
+ },
+ {
+ "name": "Jörn Zaefferer",
+ "email": "joern.zaefferer@gmail.com",
+ "url": "http://bassistance.de"
+ },
+ {
+ "name": "Richard D. Worth",
+ "email": "rdworth@gmail.com",
+ "url": "http://rdworth.org"
+ },
+ {
+ "name": "Kris Borchers",
+ "email": "kris.borchers@gmail.com",
+ "url": "http://krisborchers.com"
+ },
+ {
+ "name": "Corey Frang",
+ "email": "gnarf37@gmail.com",
+ "url": "http://gnarf.net"
+ }
+ ],
"repository": {
"type": "git",
"url": "git://github.com/jquery/jquery-ui.git"
},
- "bugs": {
- "url": "http://bugs.jqueryui.com/"
- },
+ "bugs": "http://bugs.jqueryui.com/",
"licenses": [
{
"type": "MIT",
@@ -26,13 +52,15 @@
],
"dependencies": {},
"devDependencies": {
- "grunt": "0.3.9",
+ "grunt": "~0.3.9",
"grunt-css": "0.2.0",
"grunt-compare-size": "0.1.4",
"grunt-html": "0.1.1",
+ "grunt-junit": "0.1.4",
+ "grunt-git-authors": "1.0.0",
"request": "2.9.153",
"rimraf": "2.0.1",
- "testswarm": "0.2.2"
+ "testswarm": "0.2.3"
},
"keywords": []
}
diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js
index 2dae34c28..874d274cc 100644
--- a/tests/jquery.simulate.js
+++ b/tests/jquery.simulate.js
@@ -1,7 +1,8 @@
/*
* jquery.simulate - simulate browser mouse and keyboard events
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
diff --git a/tests/unit/accordion/accordion_core.js b/tests/unit/accordion/accordion_core.js
index 7a1d56c18..101cb83b1 100644
--- a/tests/unit/accordion/accordion_core.js
+++ b/tests/unit/accordion/accordion_core.js
@@ -48,31 +48,31 @@ test( "accessibility", function () {
equal( headers.eq( 1 ).attr( "aria-selected" ), "true", "active tab has aria-selected=true" );
equal( headers.eq( 1 ).next().attr( "aria-expanded" ), "true", "active tabpanel has aria-expanded=true" );
equal( headers.eq( 1 ).next().attr( "aria-hidden" ), "false", "active tabpanel has aria-hidden=false" );
- equal( headers.eq( 0 ).attr( "tabindex" ), -1, "active header has tabindex=-1" );
- equal( headers.eq( 0 ).attr( "aria-selected" ), "false", "active tab has aria-selected=false" );
- equal( headers.eq( 0 ).next().attr( "aria-expanded" ), "false", "active tabpanel has aria-expanded=false" );
- equal( headers.eq( 0 ).next().attr( "aria-hidden" ), "true", "active tabpanel has aria-hidden=true" );
- equal( headers.eq( 2 ).attr( "tabindex" ), -1, "active header has tabindex=-1" );
- equal( headers.eq( 2 ).attr( "aria-selected" ), "false", "active tab has aria-selected=false" );
- equal( headers.eq( 2 ).next().attr( "aria-expanded" ), "false", "active tabpanel has aria-expanded=false" );
- equal( headers.eq( 2 ).next().attr( "aria-hidden" ), "true", "active tabpanel has aria-hidden=true" );
+ equal( headers.eq( 0 ).attr( "tabindex" ), -1, "inactive header has tabindex=-1" );
+ equal( headers.eq( 0 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected=false" );
+ equal( headers.eq( 0 ).next().attr( "aria-expanded" ), "false", "inactive tabpanel has aria-expanded=false" );
+ equal( headers.eq( 0 ).next().attr( "aria-hidden" ), "true", "inactive tabpanel has aria-hidden=true" );
+ equal( headers.eq( 2 ).attr( "tabindex" ), -1, "inactive header has tabindex=-1" );
+ equal( headers.eq( 2 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected=false" );
+ equal( headers.eq( 2 ).next().attr( "aria-expanded" ), "false", "inactive tabpanel has aria-expanded=false" );
+ equal( headers.eq( 2 ).next().attr( "aria-hidden" ), "true", "inactive tabpanel has aria-hidden=true" );
element.accordion( "option", "active", 0 );
equal( headers.eq( 0 ).attr( "tabindex" ), 0, "active header has tabindex=0" );
equal( headers.eq( 0 ).attr( "aria-selected" ), "true", "active tab has aria-selected=true" );
equal( headers.eq( 0 ).next().attr( "aria-expanded" ), "true", "active tabpanel has aria-expanded=true" );
equal( headers.eq( 0 ).next().attr( "aria-hidden" ), "false", "active tabpanel has aria-hidden=false" );
- equal( headers.eq( 1 ).attr( "tabindex" ), -1, "active header has tabindex=-1" );
- equal( headers.eq( 1 ).attr( "aria-selected" ), "false", "active tab has aria-selected=false" );
- equal( headers.eq( 1 ).next().attr( "aria-expanded" ), "false", "active tabpanel has aria-expanded=false" );
- equal( headers.eq( 1 ).next().attr( "aria-hidden" ), "true", "active tabpanel has aria-hidden=true" );
- equal( headers.eq( 2 ).attr( "tabindex" ), -1, "active header has tabindex=-1" );
- equal( headers.eq( 2 ).attr( "aria-selected" ), "false", "active tab has aria-selected=false" );
- equal( headers.eq( 2 ).next().attr( "aria-expanded" ), "false", "active tabpanel has aria-expanded=false" );
- equal( headers.eq( 2 ).next().attr( "aria-hidden" ), "true", "active tabpanel has aria-hidden=true" );
+ equal( headers.eq( 1 ).attr( "tabindex" ), -1, "inactive header has tabindex=-1" );
+ equal( headers.eq( 1 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected=false" );
+ equal( headers.eq( 1 ).next().attr( "aria-expanded" ), "false", "inactive tabpanel has aria-expanded=false" );
+ equal( headers.eq( 1 ).next().attr( "aria-hidden" ), "true", "inactive tabpanel has aria-hidden=true" );
+ equal( headers.eq( 2 ).attr( "tabindex" ), -1, "inactive header has tabindex=-1" );
+ equal( headers.eq( 2 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected=false" );
+ equal( headers.eq( 2 ).next().attr( "aria-expanded" ), "false", "inactive tabpanel has aria-expanded=false" );
+ equal( headers.eq( 2 ).next().attr( "aria-hidden" ), "true", "inactive tabpanel has aria-hidden=true" );
});
-asyncTest( "keybaord support", function() {
+asyncTest( "keyboard support", function() {
expect( 13 );
var element = $( "#list1" ).accordion(),
headers = element.find( ".ui-accordion-header" ),
diff --git a/tests/unit/button/button_core.js b/tests/unit/button/button_core.js
index c274a8473..f3c50d840 100644
--- a/tests/unit/button/button_core.js
+++ b/tests/unit/button/button_core.js
@@ -8,6 +8,7 @@
module("button: core");
test("checkbox", function() {
+ expect( 4 );
var input = $("#check"),
label = $("label[for=check]");
ok( input.is(":visible") );
@@ -18,6 +19,7 @@ test("checkbox", function() {
});
test("radios", function() {
+ expect( 4 );
var inputs = $("#radio0 input"),
labels = $("#radio0 label");
ok( inputs.is(":visible") );
@@ -34,6 +36,7 @@ function assert(noForm, form1, form2) {
}
test("radio groups", function() {
+ expect( 12 );
$("input[type=radio]").button();
assert(":eq(0)", ":eq(1)", ":eq(2)");
@@ -51,6 +54,7 @@ test("radio groups", function() {
});
test("input type submit, don't create child elements", function() {
+ expect( 2 );
var input = $("#submit");
deepEqual( input.children().length, 0 );
input.button();
@@ -58,6 +62,7 @@ test("input type submit, don't create child elements", function() {
});
test("buttonset", function() {
+ expect( 6 );
var set = $("#radio1").buttonset();
ok( set.is(".ui-buttonset") );
deepEqual( set.children(".ui-button").length, 3 );
@@ -68,6 +73,7 @@ test("buttonset", function() {
});
test("buttonset (rtl)", function() {
+ expect( 6 );
var set,
parent = $("#radio1").parent();
// Set to rtl
diff --git a/tests/unit/button/button_methods.js b/tests/unit/button/button_methods.js
index 347806d4e..6a305d654 100644
--- a/tests/unit/button/button_methods.js
+++ b/tests/unit/button/button_methods.js
@@ -7,13 +7,10 @@
module("button: methods");
test("destroy", function() {
- var beforeHtml = $("#button").parent().html(),
- afterHtml = $("#button").button().button("destroy").parent().html();
- // Opera 9 outputs role="" instead of removing the attribute like everyone else
- if ($.browser.opera) {
- afterHtml = afterHtml.replace(/ role=""/g, "");
- }
- equal( afterHtml, beforeHtml );
+ expect( 1 );
+ domEqual( "#button", function() {
+ $( "#button" ).button().button( "destroy" );
+ });
});
})(jQuery);
diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js
index 3dd361ac9..eeb6e5527 100644
--- a/tests/unit/button/button_options.js
+++ b/tests/unit/button/button_options.js
@@ -6,6 +6,7 @@
module("button: options");
test("disabled, explicit value", function() {
+ expect( 4 );
$("#radio01").button({ disabled: false });
deepEqual(false, $("#radio01").button("option", "disabled"),
"disabled option set to false");
@@ -18,6 +19,7 @@ test("disabled, explicit value", function() {
});
test("disabled, null", function() {
+ expect( 4 );
$("#radio01").button({ disabled: null });
deepEqual(false, $("#radio01").button("option", "disabled"),
"disabled option set to false");
@@ -30,6 +32,7 @@ test("disabled, null", function() {
});
test("text false without icon", function() {
+ expect( 1 );
$("#button").button({
text: false
});
@@ -39,6 +42,7 @@ test("text false without icon", function() {
});
test("text false with icon", function() {
+ expect( 1 );
$("#button").button({
text: false,
icons: {
@@ -51,6 +55,7 @@ test("text false with icon", function() {
});
test("label, default", function() {
+ expect( 2 );
$("#button").button();
deepEqual( $("#button").text(), "Label" );
deepEqual( $( "#button").button( "option", "label" ), "Label" );
@@ -59,6 +64,7 @@ test("label, default", function() {
});
test("label", function() {
+ expect( 2 );
$("#button").button({
label: "xxx"
});
@@ -69,11 +75,13 @@ test("label", function() {
});
test("label default with input type submit", function() {
+ expect( 2 );
deepEqual( $("#submit").button().val(), "Label" );
deepEqual( $("#submit").button( "option", "label" ), "Label" );
});
test("label with input type submit", function() {
+ expect( 2 );
var label = $("#submit").button({
label: "xxx"
}).val();
@@ -82,6 +90,7 @@ test("label with input type submit", function() {
});
test("icons", function() {
+ expect( 1 );
$("#button").button({
text: false,
icons: {
diff --git a/tests/unit/button/button_tickets.js b/tests/unit/button/button_tickets.js
index fe0d82fd6..846ca7ef4 100644
--- a/tests/unit/button/button_tickets.js
+++ b/tests/unit/button/button_tickets.js
@@ -6,6 +6,7 @@
module( "button: tickets" );
test( "#5946 - buttonset should ignore buttons that are not :visible", function() {
+ expect( 2 );
$( "#radio01" ).next().andSelf().hide();
var set = $( "#radio0" ).buttonset({ items: "input[type=radio]:visible" });
ok( set.find( "label:eq(0)" ).is( ":not(.ui-button):not(.ui-corner-left)" ) );
@@ -13,6 +14,7 @@ test( "#5946 - buttonset should ignore buttons that are not :visible", function(
});
test( "#6262 - buttonset not applying ui-corner to invisible elements", function() {
+ expect( 3 );
$( "#radio0" ).hide();
var set = $( "#radio0" ).buttonset();
ok( set.find( "label:eq(0)" ).is( ".ui-button.ui-corner-left" ) );
@@ -21,6 +23,7 @@ test( "#6262 - buttonset not applying ui-corner to invisible elements", function
});
test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard Navigation", function() {
+ expect( 2 );
var check = $( "#check" ).button(),
label = $( "label[for='check']" );
ok( !label.is( ".ui-state-focus" ) );
@@ -29,6 +32,7 @@ test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard
});
test( "#7092 - button creation that requires a matching label does not find label in all cases", function() {
+ expect( 5 );
var group = $( "<span><label for='t7092a'></label><input type='checkbox' id='t7092a'></span>" );
group.find( "input[type=checkbox]" ).button();
ok( group.find( "label" ).is( ".ui-button" ) );
@@ -51,6 +55,7 @@ test( "#7092 - button creation that requires a matching label does not find labe
});
test( "#7534 - Button label selector works for ids with \":\"", function() {
+ expect( 1 );
var group = $( "<span><input type='checkbox' id='check:7534'><label for='check:7534'>Label</label></span>" );
group.find( "input" ).button();
ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );
diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js
index 1026c5b0b..5ebb9e9f4 100644
--- a/tests/unit/core/core.js
+++ b/tests/unit/core/core.js
@@ -2,7 +2,7 @@
module( "core - jQuery extensions" );
-TestHelpers.testJshint( "ui.core" );
+TestHelpers.testJshint( "core" );
test( "focus - original functionality", function() {
expect( 1 );
@@ -28,6 +28,7 @@ asyncTest( "focus", function() {
});
test( "zIndex", function() {
+ expect( 7 );
var el = $( "#zIndexAutoWithParent" ),
parent = el.parent();
equal( el.zIndex(), 100, "zIndex traverses up to find value" );
@@ -46,6 +47,7 @@ test( "zIndex", function() {
});
test( "innerWidth - getter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
equal( el.innerWidth(), 122, "getter passthru" );
@@ -54,6 +56,7 @@ test( "innerWidth - getter", function() {
});
test( "innerWidth - setter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
el.innerWidth( 120 );
@@ -64,6 +67,7 @@ test( "innerWidth - setter", function() {
});
test( "innerHeight - getter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
equal( el.innerHeight(), 70, "getter passthru" );
@@ -72,6 +76,7 @@ test( "innerHeight - getter", function() {
});
test( "innerHeight - setter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
el.innerHeight( 60 );
@@ -82,6 +87,7 @@ test( "innerHeight - setter", function() {
});
test( "outerWidth - getter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
equal( el.outerWidth(), 140, "getter passthru" );
@@ -90,6 +96,7 @@ test( "outerWidth - getter", function() {
});
test( "outerWidth - setter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
el.outerWidth( 130 );
@@ -100,6 +107,7 @@ test( "outerWidth - setter", function() {
});
test( "outerWidth(true) - getter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
equal( el.outerWidth(true), 154, "getter passthru w/ margin" );
@@ -108,6 +116,7 @@ test( "outerWidth(true) - getter", function() {
});
test( "outerWidth(true) - setter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
el.outerWidth( 130, true );
@@ -118,6 +127,7 @@ test( "outerWidth(true) - setter", function() {
});
test( "outerHeight - getter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
equal( el.outerHeight(), 86, "getter passthru" );
@@ -126,6 +136,7 @@ test( "outerHeight - getter", function() {
});
test( "outerHeight - setter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
el.outerHeight( 80 );
@@ -136,6 +147,7 @@ test( "outerHeight - setter", function() {
});
test( "outerHeight(true) - getter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
equal( el.outerHeight(true), 98, "getter passthru w/ margin" );
@@ -144,6 +156,7 @@ test( "outerHeight(true) - getter", function() {
});
test( "outerHeight(true) - setter", function() {
+ expect( 2 );
var el = $( "#dimensions" );
el.outerHeight( 90, true );
@@ -154,13 +167,20 @@ test( "outerHeight(true) - setter", function() {
});
test( "uniqueId / removeUniqueId", function() {
+ expect( 3 );
var el = $( "img" ).eq( 0 );
- equal( el.attr( "id" ), undefined, "element has no initial id" );
+ // support: jQuery <1.6.2
+ // support: IE <8
+ // We should use strictEqual( id, undefined ) when dropping jQuery 1.6.1 support (or IE6/7)
+ ok( !el.attr( "id" ), "element has no initial id" );
el.uniqueId();
ok( /ui-id-\d+$/.test( el.attr( "id" ) ), "element has generated id" );
el.removeUniqueId();
- equal( el.attr( "id" ), undefined, "unique id has been removed from element" );
+ // support: jQuery <1.6.2
+ // support: IE <8
+ // see above
+ ok( !el.attr( "id" ), "unique id has been removed from element" );
});
})( jQuery );
diff --git a/tests/unit/core/selector.js b/tests/unit/core/selector.js
index 4309289c9..7876cdd07 100644
--- a/tests/unit/core/selector.js
+++ b/tests/unit/core/selector.js
@@ -150,6 +150,8 @@ test("focusable - not natively focusable with various tabindex", function() {
});
test("focusable - area elements", function() {
+ expect( 3 );
+
isFocusable('#areaCoordsHref', 'coords and href');
isFocusable('#areaNoCoordsHref', 'href but no coords');
isNotFocusable('#areaNoImg', 'not associated with an image');
@@ -227,6 +229,8 @@ test("tabbable - not natively tabbable with various tabindex", function() {
});
test("tabbable - area elements", function() {
+ expect( 3 );
+
isTabbable('#areaCoordsHref', 'coords and href');
isTabbable('#areaNoCoordsHref', 'href but no coords');
isNotTabbable('#areaNoImg', 'not associated with an image');
diff --git a/tests/unit/datepicker/datepicker_core.js b/tests/unit/datepicker/datepicker_core.js
index 4bf04d83e..17cefe157 100644
--- a/tests/unit/datepicker/datepicker_core.js
+++ b/tests/unit/datepicker/datepicker_core.js
@@ -43,16 +43,19 @@ var PROP_NAME = 'datepicker';
module("datepicker: core");
test( "widget method - empty collection", function() {
+ expect( 1 );
$( "#nonExist" ).datepicker(); // should create nothing
ok( !$( "#ui-datepicker-div" ).length, "Non init on empty collection" );
});
test("widget method", function() {
+ expect( 1 );
var actual = $("#inp").datepicker().datepicker("widget")[0];
deepEqual($("body > #ui-datepicker-div:last-child")[0], actual);
});
test('baseStructure', function() {
+ expect( 59 );
var header, title, table, thead, week, panel, inl, child,
inp = init('#inp').focus(),
dp = $('#ui-datepicker-div'),
@@ -176,6 +179,7 @@ test('baseStructure', function() {
});
test('customStructure', function() {
+ expect( 20 );
var iframe, header, panel, title, thead,
dp = $('#ui-datepicker-div'),
// Check right-to-left localisation
@@ -233,6 +237,7 @@ test('customStructure', function() {
});
test('keystrokes', function() {
+ expect( 26 );
var inp = init('#inp'),
date = new Date();
inp.val('').datepicker('show').
@@ -367,6 +372,7 @@ test('keystrokes', function() {
});
test('mouse', function() {
+ expect( 15 );
var inl,
inp = init('#inp'),
dp = $('#ui-datepicker-div'),
diff --git a/tests/unit/datepicker/datepicker_events.js b/tests/unit/datepicker/datepicker_events.js
index b3e6704ef..e35be62ce 100644
--- a/tests/unit/datepicker/datepicker_events.js
+++ b/tests/unit/datepicker/datepicker_events.js
@@ -22,6 +22,7 @@ function callback2(year, month, inst) {
}
test('events', function() {
+ expect( 26 );
var dateStr, newMonthYear, inp2,
inp = init('#inp', {onSelect: callback}),
date = new Date();
diff --git a/tests/unit/datepicker/datepicker_methods.js b/tests/unit/datepicker/datepicker_methods.js
index 603427440..e7aa7602e 100644
--- a/tests/unit/datepicker/datepicker_methods.js
+++ b/tests/unit/datepicker/datepicker_methods.js
@@ -6,6 +6,7 @@
module("datepicker: methods");
test('destroy', function() {
+ expect( 33 );
var inl,
inp = init('#inp');
ok(inp.is('.hasDatepicker'), 'Default - marker class set');
@@ -63,6 +64,7 @@ test('destroy', function() {
});
test('enableDisable', function() {
+ expect( 33 );
var inl, dp,
inp = init('#inp');
ok(!inp.datepicker('isDisabled'), 'Enable/disable - initially marked as enabled');
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js
index 3e200ecaa..a01b9c7e0 100644
--- a/tests/unit/datepicker/datepicker_options.js
+++ b/tests/unit/datepicker/datepicker_options.js
@@ -7,6 +7,7 @@
module("datepicker: options");
test('setDefaults', function() {
+ expect( 3 );
var inp = init('#inp');
equal($.datepicker._defaults.showOn, 'focus', 'Initial showOn');
$.datepicker.setDefaults({showOn: 'button'});
@@ -16,6 +17,7 @@ test('setDefaults', function() {
});
test('option', function() {
+ expect( 17 );
var inp = init('#inp'),
inst = $.data(inp[0], PROP_NAME);
// Set option
@@ -47,6 +49,7 @@ test('option', function() {
});
test('change', function() {
+ expect( 12 );
var inp = init('#inp'),
inst = $.data(inp[0], PROP_NAME);
equal(inst.settings.showOn, null, 'Initial setting showOn');
@@ -67,6 +70,7 @@ test('change', function() {
});
test('invocation', function() {
+ expect( 29 );
var button, image,
inp = init('#inp'),
dp = $('#ui-datepicker-div'),
@@ -138,6 +142,7 @@ test('invocation', function() {
});
test('otherMonths', function() {
+ expect( 8 );
var inp = init('#inp'),
pop = $('#ui-datepicker-div');
inp.val('06/01/2009').datepicker('show');
@@ -159,6 +164,7 @@ test('otherMonths', function() {
});
test('defaultDate', function() {
+ expect( 17 );
var inp = init('#inp'),
date = new Date();
inp.val('').datepicker('show').
@@ -253,6 +259,7 @@ test('defaultDate', function() {
});
test('miscellaneous', function() {
+ expect( 19 );
var curYear, longNames, shortNames, date,
dp = $('#ui-datepicker-div'),
inp = init('#inp');
@@ -314,6 +321,7 @@ test('miscellaneous', function() {
});
test('minMax', function() {
+ expect( 17 );
var date,
inp = init('#inp'),
lastYear = new Date(2007, 6 - 1, 4),
@@ -398,6 +406,7 @@ test('minMax', function() {
});
test('setDate', function() {
+ expect( 24 );
var inl, alt, minDate, maxDate, dateAndTimeToSet, dateAndTimeClone,
inp = init('#inp'),
date1 = new Date(2008, 6 - 1, 4),
@@ -477,6 +486,7 @@ test('setDate', function() {
});
test('altField', function() {
+ expect( 10 );
var inp = init('#inp'),
alt = $('#alt');
// No alternate field set
@@ -515,6 +525,7 @@ test('altField', function() {
});
test('autoSize', function() {
+ expect( 15 );
var inp = init('#inp');
equal(inp.prop('size'), 20, 'Auto size - default');
inp.datepicker('option', 'autoSize', true);
@@ -550,6 +561,7 @@ test('autoSize', function() {
});
test('daylightSaving', function() {
+ expect( 25 );
var inp = init('#inp'),
dp = $('#ui-datepicker-div');
ok(true, 'Daylight saving - ' + new Date());
@@ -664,6 +676,7 @@ function calcWeek(date) {
}
test('callbacks', function() {
+ expect( 13 );
// Before show
var dp, day20, day21,
inp = init('#inp', {beforeShow: beforeAll}),
@@ -693,6 +706,7 @@ test('callbacks', function() {
});
test('localisation', function() {
+ expect( 24 );
var dp, month, day, date,
inp = init('#inp', $.datepicker.regional.fr);
inp.datepicker('option', {dateFormat: 'DD, d MM yy', showButtonPanel:true, changeMonth:true, changeYear:true}).val('').datepicker('show');
@@ -722,6 +736,7 @@ test('localisation', function() {
});
test('noWeekends', function() {
+ expect( 31 );
var i, date;
for (i = 1; i <= 31; i++) {
date = new Date(2001, 1 - 1, i);
@@ -731,6 +746,7 @@ test('noWeekends', function() {
});
test('iso8601Week', function() {
+ expect( 12 );
var date = new Date(2000, 12 - 1, 31);
equal($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date);
date = new Date(2001, 1 - 1, 1);
@@ -758,6 +774,7 @@ test('iso8601Week', function() {
});
test('parseDate', function() {
+ expect( 26 );
init('#inp');
var currentYear, gmtDate, fr, settings, zh;
ok($.datepicker.parseDate('d m y', '') == null, 'Parse date empty');
@@ -822,6 +839,7 @@ test('parseDate', function() {
});
test('parseDateErrors', function() {
+ expect( 17 );
init('#inp');
var fr, settings;
function expectError(expr, value, error) {
@@ -874,6 +892,7 @@ test('parseDateErrors', function() {
});
test('formatDate', function() {
+ expect( 16 );
init('#inp');
var gmtDate, fr, settings;
equal($.datepicker.formatDate('d m y', new Date(2001, 2 - 1, 3)),
diff --git a/tests/unit/datepicker/datepicker_tickets.js b/tests/unit/datepicker/datepicker_tickets.js
index 105be63a6..e1b882a89 100644
--- a/tests/unit/datepicker/datepicker_tickets.js
+++ b/tests/unit/datepicker/datepicker_tickets.js
@@ -7,6 +7,7 @@ module("datepicker: tickets");
// http://forum.jquery.com/topic/several-breaking-changes-in-jquery-ui-1-8rc1
test('beforeShowDay-getDate', function() {
+ expect( 3 );
var inp = init('#inp', {beforeShowDay: function(date) { inp.datepicker('getDate'); return [true, '']; }}),
dp = $('#ui-datepicker-div');
inp.val('01/01/2010').datepicker('show');
@@ -25,6 +26,7 @@ test('beforeShowDay-getDate', function() {
});
test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){
+ expect( 3 );
var inp = init('#inp',{
beforeShow: function(){
return false;
@@ -58,11 +60,13 @@ test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler'
});
test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){
+ expect( 1 );
var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
equal(time, "089");
});
test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() {
+ expect( 4 );
var date;
try{
date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881');
diff --git a/tests/unit/dialog/dialog_core.js b/tests/unit/dialog/dialog_core.js
index 636b957e8..e0a5c8701 100644
--- a/tests/unit/dialog/dialog_core.js
+++ b/tests/unit/dialog/dialog_core.js
@@ -116,6 +116,7 @@ test("ARIA", function() {
});
test("widget method", function() {
+ expect( 1 );
var dialog = $("<div>").appendTo("#main").dialog();
deepEqual(dialog.parent()[0], dialog.dialog("widget")[0]);
});
diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js
index 1f84cd6b5..ba0c2bd41 100644
--- a/tests/unit/dialog/dialog_methods.js
+++ b/tests/unit/dialog/dialog_methods.js
@@ -34,6 +34,8 @@ test("init", function() {
});
test("destroy", function() {
+ expect( 4 );
+
$("<div></div>").appendTo('body').dialog().dialog("destroy").remove();
ok(true, '.dialog("destroy") called on element');
@@ -49,6 +51,8 @@ test("destroy", function() {
});
test("enable", function() {
+ expect( 3 );
+
var expected = $('<div></div>').dialog(),
actual = expected.dialog('enable');
equal(actual, expected, 'enable is chainable');
@@ -60,6 +64,8 @@ test("enable", function() {
});
test("disable", function() {
+ expect( 3 );
+
var expected = $('<div></div>').dialog(),
actual = expected.dialog('disable');
equal(actual, expected, 'disable is chainable');
@@ -71,6 +77,8 @@ test("disable", function() {
});
test("close", function() {
+ expect( 3 );
+
var expected = $('<div></div>').dialog(),
actual = expected.dialog('close');
equal(actual, expected, 'close is chainable');
@@ -98,6 +106,8 @@ test("isOpen", function() {
});
test("moveToTop", function() {
+ expect( 3 );
+
var d1, d2, dlg1, dlg2,
expected = $('<div></div>').dialog(),
actual = expected.dialog('moveToTop');
@@ -117,6 +127,7 @@ test("moveToTop", function() {
});
test("open", function() {
+ expect( 3 );
var expected = $('<div></div>').dialog(),
actual = expected.dialog('open');
equal(actual, expected, 'open is chainable');
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index c071c1b09..ba217c6f4 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -106,6 +106,7 @@ test("buttons - advanced", function() {
});
test("closeOnEscape", function() {
+ expect( 6 );
el = $('<div></div>').dialog({ closeOnEscape: false });
ok(true, 'closeOnEscape: false');
ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open before ESC');
@@ -276,6 +277,7 @@ test("minWidth", function() {
});
test("position, default center on window", function() {
+ expect( 2 );
var el = $('<div></div>').dialog(),
dialog = el.dialog('widget'),
offset = dialog.offset();
@@ -285,6 +287,7 @@ test("position, default center on window", function() {
});
test("position, top on window", function() {
+ expect( 2 );
var el = $('<div></div>').dialog({ position: "top" }),
dialog = el.dialog('widget'),
offset = dialog.offset();
@@ -294,6 +297,7 @@ test("position, top on window", function() {
});
test("position, left on window", function() {
+ expect( 2 );
var el = $('<div></div>').dialog({ position: "left" }),
dialog = el.dialog('widget'),
offset = dialog.offset();
@@ -303,6 +307,7 @@ test("position, left on window", function() {
});
test("position, right bottom on window", function() {
+ expect( 2 );
var el = $('<div></div>').dialog({ position: "right bottom" }),
dialog = el.dialog('widget'),
offset = dialog.offset();
@@ -312,6 +317,7 @@ test("position, right bottom on window", function() {
});
test("position, right bottom on window w/array", function() {
+ expect( 2 );
var el = $('<div></div>').dialog({ position: ["right", "bottom"] }),
dialog = el.dialog('widget'),
offset = dialog.offset();
@@ -321,6 +327,7 @@ test("position, right bottom on window w/array", function() {
});
test("position, offset from top left w/array", function() {
+ expect( 2 );
var el = $('<div></div>').dialog({ position: [10, 10] }),
dialog = el.dialog('widget'),
offset = dialog.offset();
@@ -330,6 +337,7 @@ test("position, offset from top left w/array", function() {
});
test("position, right bottom at right bottom via ui.position args", function() {
+ expect( 2 );
var el = $('<div></div>').dialog({
position: {
my: "right bottom",
@@ -345,6 +353,7 @@ test("position, right bottom at right bottom via ui.position args", function() {
});
test("position, at another element", function() {
+ expect( 4 );
var parent = $('<div></div>').css({
position: 'absolute',
top: 400,
diff --git a/tests/unit/dialog/dialog_tickets.js b/tests/unit/dialog/dialog_tickets.js
index 98983cf33..201ea3a87 100644
--- a/tests/unit/dialog/dialog_tickets.js
+++ b/tests/unit/dialog/dialog_tickets.js
@@ -71,6 +71,7 @@ test("#5184: isOpen in dialogclose event is true", function() {
});
test("#5531: dialog width should be at least minWidth on creation", function () {
+ expect( 4 );
el = $('<div></div>').dialog({
width: 200,
minWidth: 300
@@ -192,6 +193,7 @@ test("#6966: Escape key closes all dialogs, not the top one", function(){
});
test("#4980: Destroy should place element back in original DOM position", function(){
+ expect( 2 );
container = $('<div id="container"><div id="modal">Content</div></div>');
modal = container.find('#modal');
modal.dialog();
diff --git a/tests/unit/effects/effects.html b/tests/unit/effects/effects.html
index 1fd94182d..9305fcd21 100644
--- a/tests/unit/effects/effects.html
+++ b/tests/unit/effects/effects.html
@@ -15,20 +15,20 @@
<script>
TestHelpers.loadResources({
js: [
- "ui/jquery.effects.core.js",
- "ui/jquery.effects.blind.js",
- "ui/jquery.effects.bounce.js",
- "ui/jquery.effects.clip.js",
- "ui/jquery.effects.drop.js",
- "ui/jquery.effects.explode.js",
- "ui/jquery.effects.fade.js",
- "ui/jquery.effects.fold.js",
- "ui/jquery.effects.highlight.js",
- "ui/jquery.effects.pulsate.js",
- "ui/jquery.effects.scale.js",
- "ui/jquery.effects.shake.js",
- "ui/jquery.effects.slide.js",
- "ui/jquery.effects.transfer.js"
+ "ui/jquery.ui.effect.js",
+ "ui/jquery.ui.effect-blind.js",
+ "ui/jquery.ui.effect-bounce.js",
+ "ui/jquery.ui.effect-clip.js",
+ "ui/jquery.ui.effect-drop.js",
+ "ui/jquery.ui.effect-explode.js",
+ "ui/jquery.ui.effect-fade.js",
+ "ui/jquery.ui.effect-fold.js",
+ "ui/jquery.ui.effect-highlight.js",
+ "ui/jquery.ui.effect-pulsate.js",
+ "ui/jquery.ui.effect-scale.js",
+ "ui/jquery.ui.effect-shake.js",
+ "ui/jquery.ui.effect-slide.js",
+ "ui/jquery.ui.effect-transfer.js"
]
});
</script>
diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js
index 955e6f799..9b4787a57 100644
--- a/tests/unit/effects/effects_core.js
+++ b/tests/unit/effects/effects_core.js
@@ -90,16 +90,16 @@ asyncTest( "animateClass works with colors", function() {
});
asyncTest( "animateClass calls step option", 1, function() {
- var test = jQuery("div.animateClass"),
- done = function() {
- done = jQuery.noop;
+ var test = jQuery( "div.animateClass" ),
+ step = function( fx ) {
+ ok( true, "Step Function Called" );
test.stop();
start();
+ step = $.noop;
};
test.toggleClass( "testChangeBackground", {
- step: function( fx ) {
- ok( true, "Step Function Called" );
- setTimeout( done, 0 );
+ step: function() {
+ step();
}
});
});
@@ -153,6 +153,7 @@ asyncTest( "animateClass clears style properties when stopped", function() {
});
asyncTest( "animateClass: css and class changes during animation are not lost (#7106)", function() {
+ expect( 2 );
var test = $( "div.ticket7106" );
// ensure the class stays and that the css property stays
@@ -174,7 +175,7 @@ $.each( $.effects.effect, function( effect ) {
// puff and size are defined inside scale
if ( effect !== "puff" && effect !== "size" ) {
- TestHelpers.testJshint( "effects." + effect );
+ TestHelpers.testJshint( "effect-" + effect );
}
if ( effect === "transfer" ) {
diff --git a/tests/unit/effects/effects_scale.js b/tests/unit/effects/effects_scale.js
index df61d9e91..6abbcb538 100644
--- a/tests/unit/effects/effects_scale.js
+++ b/tests/unit/effects/effects_scale.js
@@ -4,6 +4,7 @@ module( "effect.scale: Scale" );
function run( position, v, h, vo, ho ) {
var desc = "End Position Correct: " + position + " (" + v + "," + h + ") - origin: (" + vo + "," + ho + ")";
asyncTest( desc, function() {
+ expect( 2 );
function complete() {
equal( parseInt( test.css( h ), 10 ), target[ h ], "Horizontal Position Correct " + desc );
equal( parseInt( test.css( v ), 10 ), target[ v ], "Vertical Position Correct " + desc );
@@ -53,13 +54,13 @@ function suite( position ) {
$(function() {
suite( "absolute" );
suite( "relative" );
- var fixed = $.support.fixedPosition;
- // jQuery < 1.7 uses $.offset.supportsFixedPosition
- if ( fixed === undefined ) {
- $.offset.initialize();
- fixed = $.offset.supportsFixedPosition;
- }
- if ( fixed ) {
+ var fixedElem = $( "<div>" )
+ .css({
+ position: "fixed",
+ top: 10
+ })
+ .appendTo( "body" );
+ if ( fixedElem.offset().top === 10 ) {
suite( "fixed" );
}
});
diff --git a/tests/unit/menu/menu.html b/tests/unit/menu/menu.html
index 31c29a924..ed376232e 100644
--- a/tests/unit/menu/menu.html
+++ b/tests/unit/menu/menu.html
@@ -44,11 +44,7 @@
</head>
<body>
-<h1 id="qunit-header">jQuery UI Menu Test Suite</h1>
-<h2 id="qunit-banner"></h2>
-<div id="qunit-testrunner-toolbar"></div>
-<h2 id="qunit-userAgent"></h2>
-<ol id="qunit-tests"></ol>
+<div id="qunit">jQuery UI Menu Test Suite</div>
<div id="qunit-fixture">
<ul class="foo" id="menu1">
@@ -268,8 +264,6 @@
<li class="foo"><a class="foo" href="#">Saarland</a></li>
</ul>
-<div id="log"></div>
-
</div>
</body>
</html>
diff --git a/tests/unit/menu/menu_common.js b/tests/unit/menu/menu_common.js
index 07295f1af..4a89a947a 100644
--- a/tests/unit/menu/menu_common.js
+++ b/tests/unit/menu/menu_common.js
@@ -1,6 +1,9 @@
TestHelpers.commonWidgetTests( "menu", {
defaults: {
disabled: false,
+ icons: {
+ submenu: "ui-icon-carat-1-e"
+ },
menus: "ul",
position: {
my: "left top",
diff --git a/tests/unit/menu/menu_core.js b/tests/unit/menu/menu_core.js
index 7732fd7b7..5ee28c14a 100644
--- a/tests/unit/menu/menu_core.js
+++ b/tests/unit/menu/menu_core.js
@@ -1,29 +1,30 @@
-/*
- * menu_core.js
- */
+(function( $ ) {
+module( "menu: core" );
-(function($) {
+test( "markup structure", function() {
+ expect( 6 );
+ var element = $( "#menu1" ).menu();
+ ok( element.hasClass( "ui-menu" ), "main element is .ui-menu" );
+ element.children().each(function( index ) {
+ ok( $( this ).hasClass( "ui-menu-item" ), "child " + index + " is .ui-menu-item" );
+ });
+});
-module("menu: core");
+test( "accessibility", function () {
+ expect( 4 );
+ var element = $( "#menu1" ).menu();
-test("accessibility", function () {
- expect(5);
- var item,
- menu = $('#menu1').menu(),
- item0 = $("li:eq(0) a");
+ equal( element.attr( "role" ), "menu", "main role" );
+ ok( !element.attr( "aria-activedescendant" ), "aria-activedescendant not set" );
- ok( menu.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all"), "menu class");
- equal( menu.attr("role"), "menu", "main role");
- ok( !menu.attr("aria-activedescendant"), "aria attribute not yet active");
+ element.menu( "focus", $.Event(), element.children().eq( -2 ) );
+ equal( element.attr( "aria-activedescendant" ), "testID1", "aria-activedescendant from existing id" );
- item = menu.find( "li:first" ).find( "a" ).attr( "id", "xid" ).end();
- menu.menu( "focus", $.Event(), item );
- equal( menu.attr("aria-activedescendant"), "xid", "aria attribute, id from dom");
+ element.menu( "focus", $.Event(), element.children().eq( 0 ) );
+ ok( /^ui-id-\d+$/.test( element.attr( "aria-activedescendant" ) ), "aria-activedescendant from generated id" );
- item = menu.find( "li:last" );
- menu.menu( "focus", $.Event(), item );
- ok( /^ui-id-\d+$/.test( menu.attr( "aria-activedescendant" ) ), "aria attribute, generated id");
+ // Item roles are tested in the role option tests
});
-})(jQuery);
+})( jQuery );
diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js
index 2132ff764..8eb8ee8c6 100644
--- a/tests/unit/menu/menu_events.js
+++ b/tests/unit/menu/menu_events.js
@@ -1,50 +1,52 @@
-/*
- * menu_events.js
- */
-(function($) {
+(function( $ ) {
var log = TestHelpers.menu.log,
+ logOutput = TestHelpers.menu.logOutput,
click = TestHelpers.menu.click;
-module("menu: events");
+module( "menu: events", {
+ setup: function() {
+ TestHelpers.menu.clearLog();
+ }
+});
-test("handle click on menu", function() {
- expect(1);
- var menu = $('#menu1').menu({
- select: function(event, ui) {
+test( "handle click on menu", function() {
+ expect( 1 );
+ var element = $( "#menu1" ).menu({
+ select: function( event, ui ) {
log();
}
});
- log("click",true);
- click($('#menu1'),"1");
- log("afterclick");
- click( menu,"2");
- click($('#menu1'),"3");
- click( menu,"1");
- equal( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid.");
+ log( "click", true );
+ click( $( "#menu1" ), "1" );
+ log( "afterclick" );
+ click( element, "2" );
+ click( $( "#menu1" ), "3" );
+ click( element, "1" );
+ equal( logOutput(), "click,1,afterclick,2,3,1", "Click order not valid." );
});
-test("handle click on custom item menu", function() {
- expect(1);
- var menu = $('#menu5').menu({
- select: function(event, ui) {
+test( "handle click on custom item menu", function() {
+ expect( 1 );
+ var element = $( "#menu5" ).menu({
+ select: function( event, ui ) {
log();
},
menus: "div"
});
- log("click",true);
- click($('#menu5'),"1");
- log("afterclick");
- click( menu,"2");
- click($('#menu5'),"3");
- click( menu,"1");
- equal( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid.");
+ log( "click", true );
+ click( $( "#menu5" ), "1" );
+ log( "afterclick" );
+ click( element, "2" );
+ click( $( "#menu5" ), "3" );
+ click( element, "1" );
+ equal( logOutput(), "click,1,afterclick,2,3,1", "Click order not valid." );
});
asyncTest( "handle blur", function() {
expect( 1 );
var blurHandled = false,
- $menu = $( "#menu1" ).menu({
+ element = $( "#menu1" ).menu({
blur: function( event, ui ) {
// Ignore duplicate blur event fired by IE
if ( !blurHandled ) {
@@ -54,17 +56,17 @@ asyncTest( "handle blur", function() {
}
});
- click( $menu, "1" );
+ click( element, "1" );
setTimeout( function() {
- $menu.blur();
+ element.blur();
start();
- }, 350);
+ }, 350 );
});
asyncTest( "handle blur on click", function() {
expect( 1 );
var blurHandled = false,
- $menu = $( "#menu1" ).menu({
+ element = $( "#menu1" ).menu({
blur: function( event, ui ) {
// Ignore duplicate blur event fired by IE
if ( !blurHandled ) {
@@ -74,12 +76,11 @@ asyncTest( "handle blur on click", function() {
}
});
- click( $menu, "1" );
+ click( element, "1" );
setTimeout( function() {
- $( "<a>", { id: "remove"} ).appendTo("body").trigger( "click" );
- $("#remove").remove();
+ $( "<a>", { id: "remove"} ).appendTo( "body" ).trigger( "click" );
start();
- }, 350);
+ }, 350 );
});
test( "handle focus of menu with active item", function() {
@@ -95,226 +96,225 @@ test( "handle focus of menu with active item", function() {
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.focus();
- equal( $("#log").html(), "2,2,1,0,focus,", "current active item remains active");
+ equal( logOutput(), "focus,0,1,2,2", "current active item remains active" );
});
asyncTest( "handle submenu auto collapse: mouseleave", function() {
expect( 4 );
- var $menu = $( "#menu2" ).menu(),
+ var element = $( "#menu2" ).menu(),
event = $.Event( "mouseenter" );
function menumouseleave1() {
- equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "first submenu expanded" );
- $menu.menu( "focus", event, $menu.find( "li:nth-child(7) li:first" ) );
+ equal( element.find( "ul[aria-expanded='true']" ).length, 1, "first submenu expanded" );
+ element.menu( "focus", event, element.find( "li:nth-child(7) li:first" ) );
setTimeout( menumouseleave2, 350 );
}
function menumouseleave2() {
- equal( $menu.find( "ul[aria-expanded='true']" ).length, 2, "second submenu expanded" );
- $menu.find( "ul[aria-expanded='true']:first" ).trigger( "mouseleave" );
+ equal( element.find( "ul[aria-expanded='true']" ).length, 2, "second submenu expanded" );
+ element.find( "ul[aria-expanded='true']:first" ).trigger( "mouseleave" );
setTimeout( menumouseleave3, 350 );
}
function menumouseleave3() {
- equal( $menu.find( "ul[aria-expanded='true']" ).length, 1, "second submenu collapsed" );
- $menu.trigger( "mouseleave" );
+ equal( element.find( "ul[aria-expanded='true']" ).length, 1, "second submenu collapsed" );
+ element.trigger( "mouseleave" );
setTimeout( menumouseleave4, 350 );
}
function menumouseleave4() {
- equal( $menu.find( "ul[aria-expanded='true']" ).length, 0, "first submenu collapsed" );
+ equal( element.find( "ul[aria-expanded='true']" ).length, 0, "first submenu collapsed" );
start();
}
- $menu.find( "li:nth-child(7)" ).trigger( "mouseenter" );
+ element.find( "li:nth-child(7)" ).trigger( "mouseenter" );
setTimeout( menumouseleave1, 350 );
});
asyncTest( "handle submenu auto collapse: mouseleave", function() {
expect( 4 );
- var $menu = $( "#menu5" ).menu( { menus: "div" } ),
+ var element = $( "#menu5" ).menu({ menus: "div" }),
event = $.Event( "mouseenter" );
function menumouseleave1() {
- equal( $menu.find( "div[aria-expanded='true']" ).length, 1, "first submenu expanded" );
- $menu.menu( "focus", event, $menu.find( ":nth-child(7)" ).find( "div" ).eq( 0 ).children().eq( 0 ) );
+ equal( element.find( "div[aria-expanded='true']" ).length, 1, "first submenu expanded" );
+ element.menu( "focus", event, element.find( ":nth-child(7)" ).find( "div" ).eq( 0 ).children().eq( 0 ) );
setTimeout( menumouseleave2, 350 );
}
function menumouseleave2() {
- equal( $menu.find( "div[aria-expanded='true']" ).length, 2, "second submenu expanded" );
- $menu.find( "div[aria-expanded='true']:first" ).trigger( "mouseleave" );
+ equal( element.find( "div[aria-expanded='true']" ).length, 2, "second submenu expanded" );
+ element.find( "div[aria-expanded='true']:first" ).trigger( "mouseleave" );
setTimeout( menumouseleave3, 350 );
}
function menumouseleave3() {
- equal( $menu.find( "div[aria-expanded='true']" ).length, 1, "second submenu collapsed" );
- $menu.trigger( "mouseleave" );
+ equal( element.find( "div[aria-expanded='true']" ).length, 1, "second submenu collapsed" );
+ element.trigger( "mouseleave" );
setTimeout( menumouseleave4, 350 );
}
function menumouseleave4() {
- equal( $menu.find( "div[aria-expanded='true']" ).length, 0, "first submenu collapsed" );
+ equal( element.find( "div[aria-expanded='true']" ).length, 0, "first submenu collapsed" );
start();
}
- $menu.find( ":nth-child(7)" ).trigger( "mouseenter" );
+ element.find( ":nth-child(7)" ).trigger( "mouseenter" );
setTimeout( menumouseleave1, 350 );
-
});
-test("handle keyboard navigation on menu without scroll and without submenus", function() {
- expect(12);
- var element = $('#menu1').menu({
- select: function(event, ui) {
- log($(ui.item[0]).text());
+test( "handle keyboard navigation on menu without scroll and without submenus", function() {
+ expect( 12 );
+ var element = $( "#menu1" ).menu({
+ select: function( event, ui ) {
+ log( $( ui.item[0] ).text() );
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
}
});
- log("keydown",true);
+ log( "keydown", true );
element.focus();
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
- equal( $("#log").html(), "2,1,0,keydown,", "Keydown DOWN");
+ equal( logOutput(), "keydown,0,1,2", "Keydown DOWN" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
- equal( $("#log").html(), "1,keydown,", "Keydown UP");
+ equal( logOutput(), "keydown,1", "Keydown UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
- equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+ equal( logOutput(), "keydown", "Keydown LEFT (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
- equal( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)");
+ equal( logOutput(), "keydown", "Keydown RIGHT (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "4,keydown,", "Keydown PAGE_DOWN");
+ equal( logOutput(), "keydown,4", "Keydown PAGE_DOWN" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
+ equal( logOutput(), "keydown", "Keydown PAGE_DOWN (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
+ equal( logOutput(), "keydown,0", "Keydown PAGE_UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
+ equal( logOutput(), "keydown", "Keydown PAGE_UP (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
- equal( $("#log").html(), "4,keydown,", "Keydown END");
+ equal( logOutput(), "keydown,4", "Keydown END" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
- equal( $("#log").html(), "0,keydown,", "Keydown HOME");
+ equal( logOutput(), "keydown,0", "Keydown HOME" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
- equal( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)");
+ equal( logOutput(), "keydown", "Keydown ESCAPE (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
- equal( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER");
+ equal( logOutput(), "keydown,Aberdeen", "Keydown ENTER" );
});
-asyncTest("handle keyboard navigation on menu without scroll and with submenus", function() {
- expect(16);
- var element = $('#menu2').menu({
- select: function(event, ui) {
- log($(ui.item[0]).text());
+asyncTest( "handle keyboard navigation on menu without scroll and with submenus", function() {
+ expect( 16 );
+ var element = $( "#menu2" ).menu({
+ select: function( event, ui ) {
+ log( $( ui.item[0] ).text() );
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ log( $( event.target ).find( ".ui-state-focus" ).parent().index() );
}
});
- log("keydown",true);
+ log( "keydown", true );
element.one( "menufocus", function( event, ui ) {
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
- equal( $("#log").html(), "2,1,keydown,", "Keydown DOWN");
+ equal( logOutput(), "keydown,1,2", "Keydown DOWN" );
setTimeout( menukeyboard1, 50 );
});
element.focus();
function menukeyboard1() {
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
- equal( $("#log").html(), "0,1,keydown,", "Keydown UP");
+ equal( logOutput(), "keydown,1,0", "Keydown UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
- equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+ equal( logOutput(), "keydown", "Keydown LEFT (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
- setTimeout( function() {
- equal( $("#log").html(), "0,4,3,2,1,keydown,", "Keydown RIGHT (open submenu)");
- }, 50);
- setTimeout( menukeyboard2, 50 );
+ setTimeout(function() {
+ equal( logOutput(), "keydown,1,2,3,4,0", "Keydown RIGHT (open submenu)" );
+ setTimeout( menukeyboard2, 50 );
+ }, 50 );
}
function menukeyboard2() {
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
- equal( $("#log").html(), "4,keydown,", "Keydown LEFT (close submenu)");
+ equal( logOutput(), "keydown,4", "Keydown LEFT (close submenu)" );
- //re-open submenu
+ // re-open submenu
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
setTimeout( menukeyboard3, 50 );
}
function menukeyboard3() {
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "2,keydown,", "Keydown PAGE_DOWN");
+ equal( logOutput(), "keydown,2", "Keydown PAGE_DOWN" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
+ equal( logOutput(), "keydown", "Keydown PAGE_DOWN (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
+ equal( logOutput(), "keydown,0", "Keydown PAGE_UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
+ equal( logOutput(), "keydown", "Keydown PAGE_UP (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
- equal( $("#log").html(), "2,keydown,", "Keydown END");
+ equal( logOutput(), "keydown,2", "Keydown END" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
- equal( $("#log").html(), "0,keydown,", "Keydown HOME");
+ equal( logOutput(), "keydown,0", "Keydown HOME" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
- equal( $("#log").html(), "4,keydown,", "Keydown ESCAPE (close submenu)");
+ equal( logOutput(), "keydown,4", "Keydown ESCAPE (close submenu)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.SPACE } );
setTimeout( menukeyboard4, 50 );
}
function menukeyboard4() {
- equal( $("#log").html(), "0,keydown,", "Keydown SPACE (open submenu)");
+ equal( logOutput(), "keydown,0", "Keydown SPACE (open submenu)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
- equal( $("#log").html(), "4,keydown,", "Keydown ESCAPE (close submenu)");
+ equal( logOutput(), "keydown,4", "Keydown ESCAPE (close submenu)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
@@ -325,9 +325,9 @@ asyncTest("handle keyboard navigation on menu without scroll and with submenus",
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
- equal( $("#log").html(), "0,4,2,0,1,0,6,5,keydown,", "Keydown skip dividers and items without anchors");
+ equal( logOutput(), "keydown,5,6,0,1,0,2,4,0", "Keydown skip dividers and items without anchors" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
setTimeout( menukeyboard6, 50 );
}, 50 );
@@ -335,232 +335,229 @@ asyncTest("handle keyboard navigation on menu without scroll and with submenus",
}
function menukeyboard6() {
- equal( $("#log").html(), "Ada,keydown,", "Keydown ENTER (open submenu)");
-
+ equal( logOutput(), "keydown,Ada", "Keydown ENTER (open submenu)" );
start();
}
});
-test("handle keyboard navigation on menu with scroll and without submenus", function() {
- expect(14);
- var element = $('#menu3').menu({
- select: function(event, ui) {
- log($(ui.item[0]).text());
+test( "handle keyboard navigation on menu with scroll and without submenus", function() {
+ expect( 14 );
+ var element = $( "#menu3" ).menu({
+ select: function( event, ui ) {
+ log( $( ui.item[0] ).text() );
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ log( $( event.target ).find( ".ui-state-focus" ).parent().index());
}
});
- log("keydown",true);
+ log( "keydown", true );
element.focus();
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
- equal( $("#log").html(), "2,1,0,keydown,", "Keydown DOWN");
+ equal( logOutput(), "keydown,0,1,2", "Keydown DOWN" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
- equal( $("#log").html(), "0,1,keydown,", "Keydown UP");
+ equal( logOutput(), "keydown,1,0", "Keydown UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
- equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+ equal( logOutput(), "keydown", "Keydown LEFT (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
- equal( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)");
+ equal( logOutput(), "keydown", "Keydown RIGHT (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN");
+ equal( logOutput(), "keydown,10", "Keydown PAGE_DOWN" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN");
+ equal( logOutput(), "keydown,20", "Keydown PAGE_DOWN" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "10,keydown,", "Keydown PAGE_UP");
+ equal( logOutput(), "keydown,10", "Keydown PAGE_UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
+ equal( logOutput(), "keydown,0", "Keydown PAGE_UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
+ equal( logOutput(), "keydown", "Keydown PAGE_UP (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
- equal( $("#log").html(), "37,keydown,", "Keydown END");
+ equal( logOutput(), "keydown,37", "Keydown END" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
+ equal( logOutput(), "keydown", "Keydown PAGE_DOWN (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
- equal( $("#log").html(), "0,keydown,", "Keydown HOME");
+ equal( logOutput(), "keydown,0", "Keydown HOME" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
- equal( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)");
+ equal( logOutput(), "keydown", "Keydown ESCAPE (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
- equal( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER");
+ equal( logOutput(), "keydown,Aberdeen", "Keydown ENTER" );
});
-asyncTest("handle keyboard navigation on menu with scroll and with submenus", function() {
- expect(14);
- var element = $('#menu4').menu({
- select: function(event, ui) {
- log($(ui.item[0]).text());
+asyncTest( "handle keyboard navigation on menu with scroll and with submenus", function() {
+ expect( 14 );
+ var element = $( "#menu4" ).menu({
+ select: function( event, ui ) {
+ log( $( ui.item[0] ).text() );
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ log( $( event.target ).find( ".ui-state-focus" ).parent().index());
}
});
- log("keydown",true);
+ log( "keydown", true );
element.one( "menufocus", function( event, ui ) {
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
- equal( $("#log").html(), "2,1,keydown,", "Keydown DOWN");
+ equal( logOutput(), "keydown,1,2", "Keydown DOWN" );
setTimeout( menukeyboard1, 50 );
});
element.focus();
-
function menukeyboard1() {
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
- equal( $("#log").html(), "0,1,keydown,", "Keydown UP");
+ equal( logOutput(), "keydown,1,0", "Keydown UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
- equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+ equal( logOutput(), "keydown", "Keydown LEFT (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
setTimeout( function() {
- equal( $("#log").html(), "0,1,keydown,", "Keydown RIGHT (open submenu)");
- }, 50);
+ equal( logOutput(), "keydown,1,0", "Keydown RIGHT (open submenu)" );
+ }, 50 );
setTimeout( menukeyboard2, 50 );
}
function menukeyboard2() {
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
- equal( $("#log").html(), "1,keydown,", "Keydown LEFT (close submenu)");
+ equal( logOutput(), "keydown,1", "Keydown LEFT (close submenu)" );
- //re-open submenu
+ // re-open submenu
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
setTimeout( menukeyboard3, 50 );
}
function menukeyboard3() {
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN");
+ equal( logOutput(), "keydown,10", "Keydown PAGE_DOWN" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
- equal( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN");
+ equal( logOutput(), "keydown,20", "Keydown PAGE_DOWN" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "10,keydown,", "Keydown PAGE_UP");
+ equal( logOutput(), "keydown,10", "Keydown PAGE_UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
+ equal( logOutput(), "keydown,0", "Keydown PAGE_UP" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
- equal( $("#log").html(), "27,keydown,", "Keydown END");
+ equal( logOutput(), "keydown,27", "Keydown END" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
- equal( $("#log").html(), "0,keydown,", "Keydown HOME");
+ equal( logOutput(), "keydown,0", "Keydown HOME" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
- equal( $("#log").html(), "1,keydown,", "Keydown ESCAPE (close submenu)");
+ equal( logOutput(), "keydown,1", "Keydown ESCAPE (close submenu)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
setTimeout( menukeyboard4, 50 );
}
function menukeyboard4() {
- equal( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)");
+ equal( logOutput(), "keydown,0", "Keydown ENTER (open submenu)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
- equal( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER (select item)");
+ equal( logOutput(), "keydown,Aberdeen", "Keydown ENTER (select item)" );
start();
}
});
-asyncTest("handle keyboard navigation and mouse click on menu with disabled items", function() {
- expect(6);
- var element = $('#menu6').menu({
- select: function(event, ui) {
- log($(ui.item[0]).text());
+asyncTest( "handle keyboard navigation and mouse click on menu with disabled items", function() {
+ expect( 6 );
+ var element = $( "#menu6" ).menu({
+ select: function( event, ui ) {
+ log( $( ui.item[0] ).text() );
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ log( $( event.target ).find( ".ui-state-focus" ).parent().index());
}
});
- log("keydown",true);
+ log( "keydown", true );
element.one( "menufocus", function( event, ui ) {
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
- equal( $("#log").html(), "1,keydown,", "Keydown focus but not select disabled item");
+ equal( logOutput(), "keydown,1", "Keydown focus but not select disabled item" );
setTimeout( menukeyboard1, 50 );
});
element.focus();
-
function menukeyboard1() {
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
- equal( $("#log").html(), "4,3,2,keydown,", "Keydown focus disabled item with submenu");
+ equal( logOutput(), "keydown,2,3,4", "Keydown focus disabled item with submenu" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
- equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
+ equal( logOutput(), "keydown", "Keydown LEFT (no effect)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
setTimeout( function() {
- equal( $("#log").html(), "keydown,", "Keydown RIGHT (no effect on disabled sub-menu)");
+ equal( logOutput(), "keydown", "Keydown RIGHT (no effect on disabled sub-menu)" );
- log("keydown",true);
+ log( "keydown", true );
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
setTimeout( function() {
- equal( $("#log").html(), "keydown,", "Keydown ENTER (no effect on disabled sub-menu)");
- log("click",true);
+ equal( logOutput(), "keydown", "Keydown ENTER (no effect on disabled sub-menu)" );
+ log( "click", true );
click( element, "1" );
- equal( $("#log").html(), "click,", "Click disabled item (no effect)");
+ equal( logOutput(), "click", "Click disabled item (no effect)" );
start();
- }, 50);
- }, 50);
+ }, 50 );
+ }, 50 );
}
});
-test("handle keyboard navigation with spelling of menu items", function() {
+test( "handle keyboard navigation with spelling of menu items", function() {
expect( 2 );
var element = $( "#menu2" ).menu({
focus: function( event, ui ) {
@@ -573,14 +570,14 @@ test("handle keyboard navigation with spelling of menu items", function() {
element.simulate( "keydown", { keyCode: 65 } );
element.simulate( "keydown", { keyCode: 68 } );
element.simulate( "keydown", { keyCode: 68 } );
- equal( $("#log").html(), "3,1,0,keydown,", "Keydown focus Addyston by spelling the first 3 letters");
+ equal( logOutput(), "keydown,0,1,3", "Keydown focus Addyston by spelling the first 3 letters" );
element.simulate( "keydown", { keyCode: 68 } );
- equal( $("#log").html(), "4,3,1,0,keydown,", "Keydown focus Delphi by repeating the 'd' again");
+ equal( logOutput(), "keydown,0,1,3,4", "Keydown focus Delphi by repeating the 'd' again" );
});
element.focus();
});
-asyncTest("handle page up and page down before the menu has focus", function() {
+asyncTest( "handle page up and page down before the menu has focus", function() {
expect( 1 );
var element = $( "#menu1" ).menu({
focus: function( event, ui ) {
@@ -593,9 +590,9 @@ asyncTest("handle page up and page down before the menu has focus", function() {
element.blur();
setTimeout( function() {
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
- equal( $("#log").html(), "0,0,keydown,", "Page Up and Page Down bring initial focus to first item");
+ equal( logOutput(), "keydown,0,0", "Page Up and Page Down bring initial focus to first item" );
start();
- }, 500);
+ }, 500 );
});
-})(jQuery);
+})( jQuery );
diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js
index c17986816..510ddb1d7 100644
--- a/tests/unit/menu/menu_methods.js
+++ b/tests/unit/menu/menu_methods.js
@@ -1,58 +1,87 @@
-/*
- * menu_methods.js
- */
-(function($) {
+(function( $ ) {
var log = TestHelpers.menu.log,
+ logOutput = TestHelpers.menu.logOutput,
click = TestHelpers.menu.click;
-module("menu: methods");
+module( "menu: methods", {
+ setup: function() {
+ TestHelpers.menu.clearLog();
+ }
+});
test( "enable/disable", function() {
expect( 3 );
- var menu = $( "#menu1" ).menu({
- select: function(event, ui) {
+ var element = $( "#menu1" ).menu({
+ select: function( event, ui ) {
log();
}
});
- menu.menu("disable");
- ok(menu.is(".ui-state-disabled"),"Missing ui-state-disabled class");
- log("click",true);
- click(menu,"1");
- log("afterclick");
- menu.menu("enable");
- ok(menu.not(".ui-state-disabled"),"Has ui-state-disabled class");
- log("click");
- click(menu,"1");
- log("afterclick");
- equal( $("#log").html(), "afterclick,1,click,afterclick,click,", "Click order not valid.");
+ element.menu( "disable" );
+ ok( element.is( ".ui-state-disabled" ), "Missing ui-state-disabled class" );
+ log( "click", true );
+ click( element, "1" );
+ log( "afterclick" );
+ element.menu( "enable" );
+ ok( element.not( ".ui-state-disabled" ), "Has ui-state-disabled class" );
+ log( "click" );
+ click( element, "1" );
+ log( "afterclick" );
+ equal( logOutput(), "click,afterclick,click,1,afterclick", "Click order not valid." );
});
test( "refresh", function() {
expect( 5 );
- var menu = $( "#menu1" ).menu();
- equal(menu.find(".ui-menu-item").length,5,"Incorrect number of menu items");
- menu.append("<li><a href='#'>test item</a></li>").menu("refresh");
- equal(menu.find(".ui-menu-item").length,6,"Incorrect number of menu items");
- menu.find(".ui-menu-item:last").remove().end().menu("refresh");
- equal(menu.find(".ui-menu-item").length,5,"Incorrect number of menu items");
- menu.append("<li>---</li>").menu("refresh");
- equal(menu.find(".ui-menu-item").length,5,"Incorrect number of menu items");
- menu.children(":last").remove().end().menu("refresh");
- equal(menu.find(".ui-menu-item").length,5,"Incorrect number of menu items");
+ var element = $( "#menu1" ).menu();
+ equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" );
+ element.append( "<li><a href='#'>test item</a></li>" ).menu( "refresh" );
+ equal( element.find( ".ui-menu-item" ).length, 6, "Incorrect number of menu items" );
+ element.find( ".ui-menu-item:last" ).remove().end().menu( "refresh" );
+ equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" );
+ element.append( "<li>---</li>" ).menu( "refresh" );
+ equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" );
+ element.children( ":last" ).remove().end().menu( "refresh" );
+ equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" );
});
-test("destroy", function() {
- domEqual("#menu1", function() {
- $("#menu1").menu().menu("destroy");
+// TODO: test focus method
+
+// TODO: test blur method
+
+// TODO: test collapseAll method
+
+// TODO: test collapse method
+
+// TODO: test expand method
+
+// TODO: test next method
+
+// TODO: test prev method
+
+// TODO: test isFirstItem method
+
+// TODO: test isLastItem method
+
+// TODO: test nextPage method
+
+// TODO: test prevPage method
+
+// TODO: test select method
+
+test( "destroy", function() {
+ expect( 4 );
+ domEqual( "#menu1", function() {
+ $( "#menu1" ).menu().menu( "destroy" );
+ });
+ domEqual( "#menu2", function() {
+ $( "#menu2" ).menu().menu( "destroy" );
});
- domEqual("#menu5", function() {
- $("#menu5").menu().menu("destroy");
+ domEqual( "#menu5", function() {
+ $( "#menu5").menu().menu( "destroy" );
});
- domEqual("#menu6", function() {
- $("#menu6").menu().menu("destroy");
+ domEqual( "#menu6", function() {
+ $( "#menu6" ).menu().menu( "destroy" );
});
});
-
-})(jQuery);
+})( jQuery );
diff --git a/tests/unit/menu/menu_options.js b/tests/unit/menu/menu_options.js
index 306f575ea..a8b029201 100644
--- a/tests/unit/menu/menu_options.js
+++ b/tests/unit/menu/menu_options.js
@@ -1,67 +1,112 @@
-/*
- * menu_options.js
- */
-(function($) {
+(function( $ ) {
var log = TestHelpers.menu.log,
+ logOutput = TestHelpers.menu.logOutput,
click = TestHelpers.menu.click;
-module("menu: options");
+module( "menu: options", {
+ setup: function() {
+ TestHelpers.menu.clearLog();
+ }
+});
test( "{ disabled: true }", function() {
expect( 2 );
- var menu = $( "#menu1" ).menu({
+ var element = $( "#menu1" ).menu({
disabled: true,
select: function(event, ui) {
log();
}
});
- ok(menu.is(".ui-state-disabled"),"Missing ui-state-disabled class");
- log("click",true);
- click(menu,"1");
- log("afterclick");
- equal( $("#log").html(), "afterclick,click,", "Click order not valid.");
+ ok( element.hasClass( "ui-state-disabled" ), "Missing ui-state-disabled class" );
+ log( "click", true );
+ click( element, "1" );
+ log( "afterclick" );
+ equal( logOutput(), "click,afterclick", "Click order not valid." );
});
test( "{ disabled: false }", function() {
expect( 2 );
- var menu = $( "#menu1" ).menu({
+ var element = $( "#menu1" ).menu({
disabled: false,
- select: function(event, ui) {
+ select: function( event, ui ) {
log();
}
});
- ok(menu.not(".ui-state-disabled"),"Has ui-state-disabled class");
- log("click",true);
- click(menu,"1");
- log("afterclick");
- equal( $("#log").html(), "afterclick,1,click,", "Click order not valid.");
+ ok( !element.hasClass( "ui-state-disabled" ), "Has ui-state-disabled class" );
+ log( "click", true );
+ click( element, "1" );
+ log( "afterclick" );
+ equal( logOutput(), "click,1,afterclick", "Click order not valid." );
+});
+
+test( "{ icons: default }", function() {
+ expect( 1 );
+ var element = $( "#menu2" ).menu();
+ equal( element.find( ".ui-menu-icon" ).attr( "class" ), "ui-menu-icon ui-icon ui-icon-carat-1-e" );
+});
+
+test( "{ icons: { submenu: 'custom' } }", function() {
+ expect( 1 );
+ var element = $( "#menu2" ).menu({
+ icons: {
+ submenu: "custom-class"
+ }
+ });
+ equal( element.find( ".ui-menu-icon" ).attr( "class" ), "ui-menu-icon ui-icon custom-class" );
});
-test("{ role: 'menu' } ", function () {
- var menu = $('#menu1').menu();
- expect(2 + 5 * $("li", menu).length);
- equal( menu.attr( "role" ), "menu" );
- ok( $("li", menu).length > 0, "number of menu items");
- $("li", menu).each(function(item) {
- ok( $(this).hasClass("ui-menu-item"), "menu item ("+ item + ") class for item");
- equal( $(this).attr("role"), "presentation", "menu item ("+ item + ") role");
- equal( $("a", this).attr("role"), "menuitem", "menu item ("+ item + ") role");
- ok( $("a",this).hasClass("ui-corner-all"), "a element class for menu item ("+ item + ") ");
- equal( $("a",this).attr("tabindex"), "-1", "a element tabindex for menu item ("+ item + ") ");
+// TODO: test menus option
+
+// TODO: test position option
+
+test( "{ role: 'menu' } ", function() {
+ var element = $( "#menu1" ).menu(),
+ items = element.find( "li" );
+ expect( 2 + 5 * items.length );
+ equal( element.attr( "role" ), "menu" );
+ ok( items.length > 0, "number of menu items" );
+ items.each(function( item ) {
+ ok( $( this ).hasClass( "ui-menu-item" ), "menu item ("+ item + ") class for item" );
+ equal( $( this ).attr( "role" ), "presentation", "menu item ("+ item + ") role" );
+ equal( $( "a", this ).attr( "role" ), "menuitem", "menu item ("+ item + ") role" );
+ ok( $( "a", this ).hasClass( "ui-corner-all" ), "a element class for menu item ("+ item + ")" );
+ equal( $( "a", this ).attr( "tabindex" ), "-1", "a element tabindex for menu item ("+ item + ")" );
});
});
-test("{ role: 'listbox' } ", function () {
- var menu = $('#menu1').menu({
- role: "listbox"
+test( "{ role: 'listbox' } ", function() {
+ var element = $( "#menu1" ).menu({
+ role: "listbox"
+ }),
+ items = element.find( "li" );
+ expect( 2 + 5 * items.length );
+ equal( element.attr( "role" ), "listbox" );
+ ok( items.length > 0, "number of menu items" );
+ items.each(function( item ) {
+ ok( $( this ).hasClass( "ui-menu-item" ), "menu item ("+ item + ") class for item" );
+ equal( $( this ).attr( "role" ), "presentation", "menu item ("+ item + ") role" );
+ equal( $( "a", this ).attr( "role" ), "option", "menu item ("+ item + ") role" );
+ ok( $( "a", this ).hasClass( "ui-corner-all" ), "a element class for menu item ("+ item + ")" );
+ equal( $( "a", this ).attr( "tabindex" ), "-1", "a element tabindex for menu item ("+ item + ")" );
});
- expect(2 + $("li", menu).length);
- equal( menu.attr( "role" ), "listbox" );
- ok( ($("li", menu).length > 0 ), "number of menu items");
- $("li", menu).each(function(item) {
- equal( $("a", this).attr("role"), "option", "menu item ("+ item + ") role");
+});
+
+test( "{ role: null }", function() {
+ var element = $( "#menu1" ).menu({
+ role: null
+ }),
+ items = element.find( "li" );
+ expect( 2 + 5 * items.length );
+ strictEqual( element.attr( "role" ), undefined );
+ ok( items.length > 0, "number of menu items" );
+ items.each(function( item ) {
+ ok( $( this ).hasClass( "ui-menu-item" ), "menu item ("+ item + ") class for item" );
+ equal( $( this ).attr( "role" ), "presentation", "menu item ("+ item + ") role" );
+ equal( $( "a", this ).attr( "role" ), undefined, "menu item ("+ item + ") role" );
+ ok( $( "a", this ).hasClass( "ui-corner-all" ), "a element class for menu item ("+ item + ")" );
+ equal( $( "a", this ).attr( "tabindex" ), "-1", "a element tabindex for menu item ("+ item + ")" );
});
});
-})(jQuery);
+})( jQuery );
diff --git a/tests/unit/menu/menu_test_helpers.js b/tests/unit/menu/menu_test_helpers.js
index a576af19a..b6c09ad7a 100644
--- a/tests/unit/menu/menu_test_helpers.js
+++ b/tests/unit/menu/menu_test_helpers.js
@@ -1,16 +1,31 @@
+(function() {
+
+var lastItem,
+ log = [];
+
TestHelpers.menu = {
log: function( message, clear ) {
if ( clear ) {
- $( "#log" ).empty();
+ log.length = 0;
}
if ( message === undefined ) {
- message = $( "#log" ).data( "lastItem" );
+ message = lastItem;
}
- $( "#log" ).prepend( $.trim( message ) + "," );
+ log.push( $.trim( message ) );
+ },
+
+ logOutput: function() {
+ return log.join( "," );
+ },
+
+ clearLog: function() {
+ log.length = 0;
},
click: function( menu, item ) {
- $( "#log" ).data( "lastItem", item );
+ lastItem = item;
menu.children( ":eq(" + item + ")" ).find( "a:first" ).trigger( "click" );
}
-}; \ No newline at end of file
+};
+
+})();
diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js
index 4a2240311..3b749a218 100644
--- a/tests/unit/position/position_core.js
+++ b/tests/unit/position/position_core.js
@@ -16,7 +16,7 @@ module( "position", {
}
});
-TestHelpers.testJshint( "ui.position" );
+TestHelpers.testJshint( "position" );
test( "my, at, of", function() {
expect( 4 );
diff --git a/tests/unit/position/position_deprecated.js b/tests/unit/position/position_deprecated.js
index 9a3164246..789d4e608 100644
--- a/tests/unit/position/position_deprecated.js
+++ b/tests/unit/position/position_deprecated.js
@@ -1,6 +1,7 @@
(function( $ ) {
test( "offset", function() {
+ expect( 3 );
$( "#elx" ).position({
my: "left top",
at: "left bottom",
diff --git a/tests/unit/progressbar/progressbar_options.js b/tests/unit/progressbar/progressbar_options.js
index f050fc5da..fd5988ebd 100644
--- a/tests/unit/progressbar/progressbar_options.js
+++ b/tests/unit/progressbar/progressbar_options.js
@@ -1,6 +1,7 @@
module( "progressbar: options" );
test( "{ value : 0 }, default", function() {
+ expect( 1 );
$( "#progressbar" ).progressbar();
equal( 0, $( "#progressbar" ).progressbar( "value" ) );
});
@@ -28,6 +29,7 @@ test( "value: visibility of valueDiv", function() {
});
test( "{ value : 5 }", function() {
+ expect( 1 );
$( "#progressbar" ).progressbar({
value: 5
});
@@ -35,6 +37,7 @@ test( "{ value : 5 }", function() {
});
test( "{ value : -5 }", function() {
+ expect( 1 );
$( "#progressbar" ).progressbar({
value: -5
});
@@ -42,6 +45,7 @@ test( "{ value : -5 }", function() {
});
test( "{ value : 105 }", function() {
+ expect( 1 );
$( "#progressbar" ).progressbar({
value: 105
});
@@ -49,6 +53,7 @@ test( "{ value : 105 }", function() {
});
test( "{ max : 5, value : 10 }", function() {
+ expect( 1 );
$("#progressbar").progressbar({
max: 5,
value: 10
diff --git a/tests/unit/spinner/spinner.html b/tests/unit/spinner/spinner.html
index b7f4a532a..1d09bbc38 100644
--- a/tests/unit/spinner/spinner.html
+++ b/tests/unit/spinner/spinner.html
@@ -5,7 +5,7 @@
<title>jQuery UI Spinner Test Suite</title>
<script src="../../jquery.js"></script>
- <script src="../../../external/jquery.mousewheel-3.0.4.js"></script>
+ <script src="../../../external/jquery.mousewheel.js"></script>
<script src="../../../external/globalize.js"></script>
<script src="../../../external/globalize.culture.ja-JP.js"></script>
<link rel="stylesheet" href="../../../external/qunit.css">
diff --git a/tests/unit/spinner/spinner_common.js b/tests/unit/spinner/spinner_common.js
index 4f05b1e63..b494e3ca3 100644
--- a/tests/unit/spinner/spinner_common.js
+++ b/tests/unit/spinner/spinner_common.js
@@ -2,6 +2,10 @@ TestHelpers.commonWidgetTests( "spinner", {
defaults: {
culture: null,
disabled: false,
+ icons: {
+ down: "ui-icon-triangle-1-s",
+ up: "ui-icon-triangle-1-n"
+ },
incremental: true,
max: null,
min: null,
diff --git a/tests/unit/spinner/spinner_events.js b/tests/unit/spinner/spinner_events.js
index 72b185528..64f510de0 100644
--- a/tests/unit/spinner/spinner_events.js
+++ b/tests/unit/spinner/spinner_events.js
@@ -220,6 +220,7 @@ asyncTest( "change", function() {
shouldChange( false, "min, value not changed" );
element.spinner( "option", "min", 200 );
+ shouldChange( true, "cleanup" );
start();
});
});
diff --git a/tests/unit/spinner/spinner_options.js b/tests/unit/spinner/spinner_options.js
index e21852630..1f6646a33 100644
--- a/tests/unit/spinner/spinner_options.js
+++ b/tests/unit/spinner/spinner_options.js
@@ -6,6 +6,25 @@ module( "spinner: options" );
// culture is tested after numberFormat, since it depends on numberFormat
+test( "icons: default ", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 0 ).spinner().spinner( "widget" );
+ equal( element.find( ".ui-icon:first" ).attr( "class" ), "ui-icon ui-icon-triangle-1-n" );
+ equal( element.find( ".ui-icon:last" ).attr( "class" ), "ui-icon ui-icon-triangle-1-s" );
+});
+
+test( "icons: custom ", function() {
+ expect( 2 );
+ var element = $( "#spin" ).val( 0 ).spinner({
+ icons: {
+ down: "custom-down",
+ up: "custom-up"
+ }
+ }).spinner( "widget" );
+ equal( element.find( ".ui-icon:first" ).attr( "class" ), "ui-icon custom-up" );
+ equal( element.find( ".ui-icon:last" ).attr( "class" ), "ui-icon custom-down" );
+});
+
test( "incremental, false", function() {
expect( 100 );
diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js
index fb3c306e6..f1a2d72c1 100644
--- a/tests/unit/tabs/tabs_core.js
+++ b/tests/unit/tabs/tabs_core.js
@@ -63,8 +63,529 @@ test( "aria-controls", function() {
});
test( "accessibility", function() {
- // TODO: add tests
- expect( 0 );
+ expect( 49 );
+ var element = $( "#tabs1" ).tabs({
+ active: 1,
+ disabled: [ 2 ]
+ }),
+ tabs = element.find( ".ui-tabs-nav li" ),
+ anchors = tabs.find( ".ui-tabs-anchor" ),
+ panels = element.find( ".ui-tabs-panel" );
+
+ equal( element.find( ".ui-tabs-nav" ).attr( "role" ), "tablist", "tablist role" );
+ tabs.each(function( index ) {
+ var tab = tabs.eq( index ),
+ anchor = anchors.eq( index ),
+ anchorId = anchor.attr( "id" ),
+ panel = panels.eq( index );
+ equal( tab.attr( "role" ), "tab", "tab " + index + " role" );
+ equal( tab.attr( "aria-labelledby" ), anchorId, "tab " + index + " aria-labelledby" );
+ equal( anchor.attr( "role" ), "presentation", "anchor " + index + " role" );
+ equal( anchor.attr( "tabindex" ), -1, "anchor " + index + " tabindex" );
+ equal( panel.attr( "role" ), "tabpanel", "panel " + index + " role" );
+ equal( panel.attr( "aria-labelledby" ), anchorId, "panel " + index + " aria-labelledby" );
+ });
+
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "true", "active tab has aria-selected=true" );
+ equal( tabs.eq( 1 ).attr( "tabindex" ), 0, "active tab has tabindex=0" );
+ equal( tabs.eq( 1 ).attr( "aria-disabled" ), null, "enabled tab does not have aria-disabled" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "true", "active panel has aria-expanded=true" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "false", "active panel has aria-hidden=false" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected=false" );
+ equal( tabs.eq( 0 ).attr( "tabindex" ), -1, "inactive tab has tabindex=-1" );
+ equal( tabs.eq( 0 ).attr( "aria-disabled" ), null, "enabled tab does not have aria-disabled" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "false", "inactive panel has aria-expanded=false" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "true", "inactive panel has aria-hidden=true" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected=false" );
+ equal( tabs.eq( 2 ).attr( "tabindex" ), -1, "inactive tab has tabindex=-1" );
+ equal( tabs.eq( 2 ).attr( "aria-disabled" ), "true", "disabled tab has aria-disabled=true" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "inactive panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "inactive panel has aria-hidden=true" );
+
+ element.tabs( "option", "active", 0 );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "active tab has aria-selected=true" );
+ equal( tabs.eq( 0 ).attr( "tabindex" ), 0, "active tab has tabindex=0" );
+ equal( tabs.eq( 0 ).attr( "aria-disabled" ), null, "enabled tab does not have aria-disabled" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "active panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "active panel has aria-hidden=false" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected=false" );
+ equal( tabs.eq( 1 ).attr( "tabindex" ), -1, "inactive tab has tabindex=-1" );
+ equal( tabs.eq( 1 ).attr( "aria-disabled" ), null, "enabled tab does not have aria-disabled" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "inactive panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "inactive panel has aria-hidden=true" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected=false" );
+ equal( tabs.eq( 2 ).attr( "tabindex" ), -1, "inactive tab has tabindex=-1" );
+ equal( tabs.eq( 2 ).attr( "aria-disabled" ), "true", "disabled tab has aria-disabled=true" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "inactive panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "inactive panel has aria-hidden=true" );
+});
+
+asyncTest( "accessibility - ajax", function() {
+ expect( 4 );
+ var element = $( "#tabs2" ).tabs(),
+ tab = element.find( ".ui-tabs-nav li" ).eq( 3 ),
+ panel = $( "#custom-id" );
+
+ equal( panel.attr( "aria-live" ), "polite", "remote panel has aria-live" );
+ equal( panel.attr( "aria-busy" ), null, "does not have aria-busy on init" );
+ element.tabs( "option", "active", 3 );
+ equal( panel.attr( "aria-busy" ), "true", "panel has aria-busy during load" );
+ element.one( "tabsload", function() {
+ setTimeout(function() {
+ equal( panel.attr( "aria-busy" ), null, "panel does not have aria-busy after load" );
+ start();
+ }, 1 );
+ });
+});
+
+asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER", function() {
+ expect( 92 );
+ var element = $( "#tabs1" ).tabs({
+ collapsible: true
+ }),
+ tabs = element.find( ".ui-tabs-nav li" ),
+ panels = element.find( ".ui-tabs-panel" ),
+ keyCode = $.ui.keyCode;
+
+ element.data( "tabs" ).delay = 50;
+
+ equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" );
+ tabs.eq( 0 ).simulate( "focus" );
+
+ // down, right, down (wrap), up (wrap)
+ function step1() {
+ ok( tabs.eq( 0 ).is( ".ui-state-focus" ), "first tab has focus" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+
+ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.DOWN } );
+ ok( tabs.eq( 1 ).is( ".ui-state-focus" ), "DOWN moves focus to next tab" );
+ ok( !tabs.eq( 0 ).is( ".ui-state-focus" ), "first tab is no longer focused" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "true", "second tab has aria-selected=true" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "first tab has aria-selected=false" );
+ ok( panels.eq( 1 ).is( ":hidden" ), "second panel is still hidden" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "second panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "second panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ tabs.eq( 1 ).simulate( "keydown", { keyCode: keyCode.RIGHT } );
+ ok( tabs.eq( 2 ).is( ".ui-state-focus" ), "RIGHT moves focus to next tab" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "false", "second tab has aria-selected=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is still hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ tabs.eq( 2 ).simulate( "keydown", { keyCode: keyCode.DOWN } );
+ ok( tabs.eq( 0 ).is( ".ui-state-focus" ), "DOWN wraps focus to first tab" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "third tab has aria-selected=false" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.UP } );
+ ok( tabs.eq( 2 ).is( ".ui-state-focus" ), "UP wraps focus to last tab" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "first tab has aria-selected=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is still hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ setTimeout( step2, 100 );
+ }
+
+ // left, home, space
+ function step2() {
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "first tab has aria-selected=false" );
+ ok( panels.eq( 2 ).is( ":visible" ), "third panel is visible" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "true", "third panel has aria-expanded=true" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "false", "third panel has aria-hidden=false" );
+ ok( panels.eq( 0 ).is( ":hidden" ), "first panel is hidden" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "false", "first panel has aria-expanded=false" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "true", "first panel has aria-hidden=true" );
+
+ tabs.eq( 2 ).simulate( "keydown", { keyCode: keyCode.LEFT } );
+ ok( tabs.eq( 1 ).is( ".ui-state-focus" ), "LEFT moves focus to previous tab" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "true", "second tab has aria-selected=true" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "third tab has aria-selected=false" );
+ ok( panels.eq( 1 ).is( ":hidden" ), "second panel is still hidden" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "second panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "second panel has aria-hidden=true" );
+ ok( panels.eq( 2 ).is( ":visible" ), "third panel is still visible" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "true", "third panel has aria-expanded=true" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "false", "third panel has aria-hidden=false" );
+
+ tabs.eq( 1 ).simulate( "keydown", { keyCode: keyCode.HOME } );
+ ok( tabs.eq( 0 ).is( ".ui-state-focus" ), "HOME moves focus to first tab" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "false", "second tab has aria-selected=false" );
+ ok( panels.eq( 0 ).is( ":hidden" ), "first panel is still hidden" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "false", "first panel has aria-expanded=false" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "true", "first panel has aria-hidden=true" );
+ ok( panels.eq( 2 ).is( ":visible" ), "third panel is still visible" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "true", "third panel has aria-expanded=true" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "false", "third panel has aria-hidden=false" );
+
+ // SPACE activates, cancels delay
+ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.SPACE } );
+ setTimeout( step3, 1 );
+ }
+
+ // end, enter
+ function step3() {
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "third tab has aria-selected=false" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+
+ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.END } );
+ ok( tabs.eq( 2 ).is( ".ui-state-focus" ), "END moves focus to last tab" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "first tab has aria-selected=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is still hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ // ENTER activates, cancels delay
+ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.ENTER } );
+ setTimeout( step4, 1 );
+ }
+
+ // enter (collapse)
+ function step4() {
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
+ ok( panels.eq( 2 ).is( ":visible" ), "third panel is visible" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "true", "third panel has aria-expanded=true" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "false", "third panel has aria-hidden=false" );
+ ok( panels.eq( 0 ).is( ":hidden" ), "first panel is hidden" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "false", "first panel has aria-expanded=false" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "true", "first panel has aria-hidden=true" );
+
+ // ENTER collapses if active
+ tabs.eq( 2 ).simulate( "keydown", { keyCode: keyCode.ENTER } );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "third tab has aria-selected=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+
+ // support: Firefox 12
+ // Firefox <13 passes arguments so we can't use setTimeout( start, 1 )
+ setTimeout(function() {
+ start();
+ }, 1 );
+ }
+
+ setTimeout( step1, 1 );
+});
+
+asyncTest( "keyboard support - CTRL navigation", function() {
+ expect( 115 );
+ var element = $( "#tabs1" ).tabs(),
+ tabs = element.find( ".ui-tabs-nav li" ),
+ panels = element.find( ".ui-tabs-panel" ),
+ keyCode = $.ui.keyCode;
+
+ element.data( "tabs" ).delay = 50;
+
+ equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" );
+ tabs.eq( 0 ).simulate( "focus" );
+
+ // down
+ function step1() {
+ ok( tabs.eq( 0 ).is( ".ui-state-focus" ), "first tab has focus" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+
+ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.DOWN, ctrlKey: true } );
+ ok( tabs.eq( 1 ).is( ".ui-state-focus" ), "DOWN moves focus to next tab" );
+ ok( !tabs.eq( 0 ).is( ".ui-state-focus" ), "first tab is no longer focused" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "false", "second tab has aria-selected=false" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 1 ).is( ":hidden" ), "second panel is still hidden" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "second panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "second panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ setTimeout( step2, 100 );
+ }
+
+ // right
+ function step2() {
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+ ok( panels.eq( 1 ).is( ":hidden" ), "second panel is hidden" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "second panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "second panel has aria-hidden=true" );
+
+ tabs.eq( 1 ).simulate( "keydown", { keyCode: keyCode.RIGHT, ctrlKey: true } );
+ ok( tabs.eq( 2 ).is( ".ui-state-focus" ), "RIGHT moves focus to next tab" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "third tab has aria-selected=false" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is still hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ setTimeout( step3, 100 );
+ }
+
+ // down (wrap)
+ function step3() {
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+
+ tabs.eq( 2 ).simulate( "keydown", { keyCode: keyCode.DOWN, ctrlKey: true } );
+ ok( tabs.eq( 0 ).is( ".ui-state-focus" ), "DOWN wraps focus to first tab" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ setTimeout( step4, 100 );
+ }
+
+ // up (wrap)
+ function step4() {
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.UP, ctrlKey: true } );
+ ok( tabs.eq( 2 ).is( ".ui-state-focus" ), "UP wraps focus to last tab" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "third tab has aria-selected=false" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is still hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ setTimeout( step5, 100 );
+ }
+
+ // left
+ function step5() {
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+
+ tabs.eq( 2 ).simulate( "keydown", { keyCode: keyCode.LEFT, ctrlKey: true } );
+ ok( tabs.eq( 1 ).is( ".ui-state-focus" ), "LEFT moves focus to previous tab" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "false", "second tab has aria-selected=false" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 1 ).is( ":hidden" ), "second panel is still hidden" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "second panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "second panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ setTimeout( step6, 100 );
+ }
+
+ // home
+ function step6() {
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+ ok( panels.eq( 1 ).is( ":hidden" ), "second panel is hidden" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "second panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "second panel has aria-hidden=true" );
+
+ tabs.eq( 1 ).simulate( "keydown", { keyCode: keyCode.HOME, ctrlKey: true } );
+ ok( tabs.eq( 0 ).is( ".ui-state-focus" ), "HOME moves focus to first tab" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "false", "second tab has aria-selected=false" );
+ ok( panels.eq( 1 ).is( ":hidden" ), "second panel is still hidden" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "second panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "second panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ setTimeout( step7, 100 );
+ }
+
+ // end
+ function step7() {
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.END, ctrlKey: true } );
+ ok( tabs.eq( 2 ).is( ".ui-state-focus" ), "END moves focus to last tab" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "third tab has aria-selected=false" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is still hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is still visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+
+ setTimeout( step8, 100 );
+ }
+
+ // space
+ function step8() {
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+
+ tabs.eq( 2 ).simulate( "keydown", { keyCode: keyCode.SPACE } );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "first tab has aria-selected=false" );
+ ok( panels.eq( 2 ).is( ":visible" ), "third panel is visible" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "true", "third panel has aria-expanded=true" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "false", "third panel has aria-hidden=false" );
+ ok( panels.eq( 0 ).is( ":hidden" ), "first panel is hidden" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "false", "first panel has aria-expanded=false" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "true", "first panel has aria-hidden=true" );
+
+ // support: Firefox 12
+ // Firefox <13 passes arguments so we can't use setTimeout( start, 1 )
+ setTimeout(function() {
+ start();
+ }, 1 );
+ }
+
+ setTimeout( step1, 1 );
+});
+
+asyncTest( "keyboard support - CTRL+UP, ALT+PAGE_DOWN, ALT+PAGE_UP", function() {
+ expect( 50 );
+ var element = $( "#tabs1" ).tabs(),
+ tabs = element.find( ".ui-tabs-nav li" ),
+ panels = element.find( ".ui-tabs-panel" ),
+ keyCode = $.ui.keyCode;
+
+ equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" );
+ panels.attr( "tabindex", -1 );
+ panels.eq( 0 ).simulate( "focus" );
+
+ function step1() {
+ strictEqual( document.activeElement, panels[ 0 ], "first panel is activeElement" );
+
+ panels.eq( 0 ).simulate( "keydown", { keyCode: keyCode.PAGE_DOWN, altKey: true } );
+ strictEqual( document.activeElement, tabs[ 1 ], "second tab is activeElement" );
+ ok( tabs.eq( 1 ).is( ".ui-state-focus" ), "ALT+PAGE_DOWN moves focus to next tab" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "true", "second tab has aria-selected=true" );
+ ok( panels.eq( 1 ).is( ":visible" ), "second panel is visible" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "true", "second panel has aria-expanded=true" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "false", "second panel has aria-hidden=false" );
+ ok( panels.eq( 0 ).is( ":hidden" ), "first panel is hidden" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "false", "first panel has aria-expanded=false" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "true", "first panel has aria-hidden=true" );
+
+ tabs.eq( 1 ).simulate( "keydown", { keyCode: keyCode.PAGE_DOWN, altKey: true } );
+ strictEqual( document.activeElement, tabs[ 2 ], "third tab is activeElement" );
+ ok( tabs.eq( 2 ).is( ".ui-state-focus" ), "ALT+PAGE_DOWN moves focus to next tab" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
+ ok( panels.eq( 2 ).is( ":visible" ), "third panel is visible" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "true", "third panel has aria-expanded=true" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "false", "third panel has aria-hidden=false" );
+ ok( panels.eq( 1 ).is( ":hidden" ), "second panel is hidden" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "false", "second panel has aria-expanded=false" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "true", "second panel has aria-hidden=true" );
+
+ tabs.eq( 2 ).simulate( "keydown", { keyCode: keyCode.PAGE_DOWN, altKey: true } );
+ strictEqual( document.activeElement, tabs[ 0 ], "first tab is activeElement" );
+ ok( tabs.eq( 0 ).is( ".ui-state-focus" ), "ALT+PAGE_DOWN wraps focus to first tab" );
+ equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "true", "first panel has aria-expanded=true" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "false", "first panel has aria-hidden=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+
+ panels.eq( 0 ).simulate( "focus" );
+ setTimeout( step2, 1 );
+ }
+
+ function step2() {
+ strictEqual( document.activeElement, panels[ 0 ], "first panel is activeElement" );
+
+ panels.eq( 0 ).simulate( "keydown", { keyCode: keyCode.PAGE_UP, altKey: true } );
+ strictEqual( document.activeElement, tabs[ 2 ], "third tab is activeElement" );
+ ok( tabs.eq( 2 ).is( ".ui-state-focus" ), "ALT+PAGE_UP wraps focus to last tab" );
+ equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
+ ok( panels.eq( 2 ).is( ":visible" ), "third panel is visible" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "true", "third panel has aria-expanded=true" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "false", "third panel has aria-hidden=false" );
+ ok( panels.eq( 0 ).is( ":hidden" ), "first panel is hidden" );
+ equal( panels.eq( 0 ).attr( "aria-expanded" ), "false", "first panel has aria-expanded=false" );
+ equal( panels.eq( 0 ).attr( "aria-hidden" ), "true", "first panel has aria-hidden=true" );
+
+ tabs.eq( 2 ).simulate( "keydown", { keyCode: keyCode.PAGE_UP, altKey: true } );
+ strictEqual( document.activeElement, tabs[ 1 ], "second tab is activeElement" );
+ ok( tabs.eq( 1 ).is( ".ui-state-focus" ), "ALT+PAGE_UP moves focus to previous tab" );
+ equal( tabs.eq( 1 ).attr( "aria-selected" ), "true", "second tab has aria-selected=true" );
+ ok( panels.eq( 1 ).is( ":visible" ), "second panel is visible" );
+ equal( panels.eq( 1 ).attr( "aria-expanded" ), "true", "second panel has aria-expanded=true" );
+ equal( panels.eq( 1 ).attr( "aria-hidden" ), "false", "second panel has aria-hidden=false" );
+ ok( panels.eq( 2 ).is( ":hidden" ), "third panel is hidden" );
+ equal( panels.eq( 2 ).attr( "aria-expanded" ), "false", "third panel has aria-expanded=false" );
+ equal( panels.eq( 2 ).attr( "aria-hidden" ), "true", "third panel has aria-hidden=true" );
+
+ panels.eq( 1 ).simulate( "focus" );
+ setTimeout( step3, 1 );
+ }
+
+ function step3() {
+ strictEqual( document.activeElement, panels[ 1 ], "second panel is activeElement" );
+
+ panels.eq( 1 ).simulate( "keydown", { keyCode: keyCode.UP, ctrlKey: true } );
+ strictEqual( document.activeElement, tabs[ 1 ], "second tab is activeElement" );
+
+ // support: Firefox 12
+ // Firefox <13 passes arguments so we can't use setTimeout( start, 1 )
+ setTimeout(function() {
+ start();
+ }, 1 );
+ }
+
+ setTimeout( step1, 1 );
});
test( "#3627 - Ajax tab with url containing a fragment identifier fails to load", function() {
diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js
index ed3e73745..a41d7069d 100644
--- a/tests/unit/tabs/tabs_methods.js
+++ b/tests/unit/tabs/tabs_methods.js
@@ -6,6 +6,7 @@ var disabled = TestHelpers.tabs.disabled,
module( "tabs: methods" );
test( "destroy", function() {
+ expect( 1 );
domEqual( "#tabs1", function() {
$( "#tabs1" ).tabs().tabs( "destroy" );
});
@@ -148,6 +149,26 @@ test( "refresh", function() {
disabled( element, false );
});
+test( "refresh - looping", function() {
+ expect( 6 );
+
+ var element = $( "#tabs1" ).tabs({
+ disabled: [ 0 ],
+ active: 1
+ });
+ state( element, 0, 1, 0 );
+ disabled( element, [ 0 ] );
+
+ // remove active, jump to previous
+ // previous is disabled, just back one more
+ // reached first tab, move to end
+ // activate last tab
+ element.find( ".ui-tabs-nav li" ).eq( 2 ).remove();
+ element.tabs( "refresh" );
+ state( element, 0, 1 );
+ disabled( element, [ 0 ] );
+});
+
asyncTest( "load", function() {
expect( 30 );
diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js
index 8365a42d7..5a90ff895 100644
--- a/tests/unit/tabs/tabs_options.js
+++ b/tests/unit/tabs/tabs_options.js
@@ -69,6 +69,8 @@ test( "{ active: Number }", function() {
if ( $.uiBackCompat === false ) {
test( "{ active: -Number }", function() {
+ expect( 8 );
+
var element = $( "#tabs1" ).tabs({
active: -1
});
@@ -278,6 +280,54 @@ test( "{ heightStyle: 'fill' } with multiple siblings", function() {
equalHeight( element, 335 );
});
-// TODO: add animation tests
+test( "hide and show: false", function() {
+ expect( 3 );
+ var element = $( "#tabs1" ).tabs({
+ show: false,
+ hide: false
+ }),
+ widget = element.data( "tabs" ),
+ panels = element.find( ".ui-tabs-panel" );
+ widget._show = function() {
+ ok( false, "_show() called" );
+ };
+ widget._hide = function() {
+ ok( false, "_hide() called" );
+ };
+
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel visible" );
+ element.tabs( "option", "active", 1 );
+ ok( panels.eq( 0 ).is( ":hidden" ), "first panel hidden" );
+ ok( panels.eq( 1 ).is( ":visible" ), "second panel visible" );
+});
+
+asyncTest( "hide and show - animation", function() {
+ expect( 5 );
+ var element = $( "#tabs1" ).tabs({
+ show: "drop",
+ hide: 2000
+ }),
+ widget = element.data( "tabs" ),
+ panels = element.find( ".ui-tabs-panel" );
+ widget._show = function( element, options, callback ) {
+ strictEqual( element[ 0 ], panels[ 1 ], "correct element in _show()" );
+ equal( options, "drop", "correct options in _show()" );
+ setTimeout(function() {
+ callback();
+ }, 1 );
+ };
+ widget._hide = function( element, options, callback ) {
+ strictEqual( element[ 0 ], panels[ 0 ], "correct element in _hide()" );
+ equal( options, 2000, "correct options in _hide()" );
+ setTimeout(function() {
+ callback();
+ start();
+ }, 1 );
+ };
+
+ ok( panels.eq( 0 ).is( ":visible" ), "first panel visible" );
+ element.tabs( "option", "active", 1 );
+});
+
}( jQuery ) );
diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js
index 3c8ec04c4..26f46138a 100644
--- a/tests/unit/testsuite.js
+++ b/tests/unit/testsuite.js
@@ -10,7 +10,14 @@ function includeScript( url ) {
document.write( "<script src='../../../" + url + "'></script>" );
}
-QUnit.config.urlConfig.push( "min" );
+QUnit.config.requireExpects = true;
+
+QUnit.config.urlConfig.push({
+ id: "min",
+ label: "Minified source",
+ tooltip: "Load minified source files instead of the regular unminified ones."
+});
+
TestHelpers.loadResources = QUnit.urlParams.min ?
function() {
// TODO: proper include with theme images
@@ -26,7 +33,12 @@ TestHelpers.loadResources = QUnit.urlParams.min ?
});
};
-QUnit.config.urlConfig.push( "nojshint" );
+QUnit.config.urlConfig.push({
+ id: "nojshint",
+ label: "Skip JSHint",
+ tooltip: "Skip running JSHint, e.g. within TestSwarm, where Jenkins runs it already"
+});
+
var jshintLoaded = false;
TestHelpers.testJshint = function( module ) {
if ( QUnit.urlParams.nojshint ) {
@@ -47,7 +59,7 @@ TestHelpers.testJshint = function( module ) {
dataType: "json"
}),
$.ajax({
- url: "../../../ui/jquery." + module + ".js",
+ url: "../../../ui/jquery.ui." + module + ".js",
dataType: "text"
})
).done(function( hintArgs, srcArgs ) {
@@ -76,7 +88,9 @@ function testWidgetDefaults( widget, defaults ) {
// ensure that all defaults have the correct value
test( "defined defaults", function() {
+ var count = 0;
$.each( defaults, function( key, val ) {
+ expect( ++count );
if ( $.isFunction( val ) ) {
ok( $.isFunction( pluginDefaults[ key ] ), key );
return;
@@ -87,7 +101,9 @@ function testWidgetDefaults( widget, defaults ) {
// ensure that all defaults were tested
test( "tested defaults", function() {
+ var count = 0;
$.each( pluginDefaults, function( key, val ) {
+ expect( ++count );
ok( key in defaults, key );
});
});
@@ -96,6 +112,7 @@ function testWidgetDefaults( widget, defaults ) {
function testWidgetOverrides( widget ) {
if ( $.uiBackCompat === false ) {
test( "$.widget overrides", function() {
+ expect( 4 );
$.each([
"_createWidget",
"destroy",
@@ -111,6 +128,8 @@ function testWidgetOverrides( widget ) {
function testBasicUsage( widget ) {
test( "basic usage", function() {
+ expect( 3 );
+
var defaultElement = $.ui[ widget ].prototype.defaultElement;
$( defaultElement ).appendTo( "body" )[ widget ]().remove();
ok( true, "initialized on element" );
@@ -126,11 +145,12 @@ function testBasicUsage( widget ) {
TestHelpers.commonWidgetTests = function( widget, settings ) {
module( widget + ": common widget" );
- TestHelpers.testJshint( "ui." + widget );
+ TestHelpers.testJshint( widget );
testWidgetDefaults( widget, settings.defaults );
testWidgetOverrides( widget );
testBasicUsage( widget );
test( "version", function() {
+ expect( 1 );
ok( "version" in $.ui[ widget ].prototype, "version property exists" );
});
};
@@ -188,6 +208,9 @@ window.domEqual = function( selector, modifier, message ) {
var value = elem.attr( attr );
result[ attr ] = value !== undefined ? value : "";
});
+ result.events = $._data( elem[ 0 ], "events" );
+ result.data = $.extend( {}, elem.data() );
+ delete result.data[ $.expando ];
children = elem.children();
if ( children.length ) {
result.children = elem.children().map(function( ind ) {
diff --git a/tests/unit/tooltip/tooltip_common.js b/tests/unit/tooltip/tooltip_common.js
index d12ee9519..6d503aecd 100644
--- a/tests/unit/tooltip/tooltip_common.js
+++ b/tests/unit/tooltip/tooltip_common.js
@@ -11,6 +11,7 @@ TestHelpers.commonWidgetTests( "tooltip", {
},
show: true,
tooltipClass: null,
+ track: false,
// callbacks
close: null,
diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js
index 1c8817aa8..2b39253a2 100644
--- a/tests/unit/tooltip/tooltip_core.js
+++ b/tests/unit/tooltip/tooltip_core.js
@@ -34,7 +34,10 @@ test( "accessibility", function() {
equal( element.attr( "aria-describedby" ), "fixture-span " + tooltipId,
"multiple describedby when open" );
// strictEqual to distinguish between .removeAttr( "title" ) and .attr( "title", "" )
- strictEqual( element.attr( "title" ), undefined, "no title when open" );
+ // support: jQuery <1.6.2
+ // support: IE <8
+ // We should use strictEqual( ..., undefined ) when dropping jQuery 1.6.1 support (or IE6/7)
+ ok( !element.attr( "title" ), "no title when open" );
element.tooltip( "close" );
equal( element.attr( "aria-describedby" ), "fixture-span",
"correct describedby when closed" );
diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js
index 1b8cd2bf2..ef783cbd3 100644
--- a/tests/unit/tooltip/tooltip_methods.js
+++ b/tests/unit/tooltip/tooltip_methods.js
@@ -42,7 +42,10 @@ test( "enable/disable", function() {
element.tooltip( "disable" );
equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" );
- equal( tooltip.attr( "title" ), undefined, "title removed on disable" );
+ // support: jQuery <1.6.2
+ // support: IE <8
+ // We should use strictEqual( ..., undefined ) when dropping jQuery 1.6.1 support (or IE6/7)
+ ok( !tooltip.attr( "title" ), "title removed on disable" );
element.tooltip( "open" );
equal( $( ".ui-tooltip" ).length, 0, "open does nothing when disabled" );
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index a4ef9f472..771da6da7 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -3,11 +3,13 @@
module( "tooltip: options" );
test( "content: default", function() {
+ expect( 1 );
var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );
deepEqual( $( "#" + element.data( "ui-tooltip-id" ) ).text(), "anchortitle" );
});
test( "content: return string", function() {
+ expect( 1 );
var element = $( "#tooltipped1" ).tooltip({
content: function() {
return "customstring";
@@ -17,6 +19,7 @@ test( "content: return string", function() {
});
test( "content: return jQuery", function() {
+ expect( 1 );
var element = $( "#tooltipped1" ).tooltip({
content: function() {
return $( "<div>" ).html( "cu<b>s</b>tomstring" );
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js
index aa70e2425..5efd91268 100644
--- a/tests/unit/widget/widget_core.js
+++ b/tests/unit/widget/widget_core.js
@@ -8,9 +8,10 @@ module( "widget factory", {
}
});
-TestHelpers.testJshint( "ui.widget" );
+TestHelpers.testJshint( "widget" );
test( "widget creation", function() {
+ expect( 5 );
var myPrototype = {
_create: function() {},
creationTest: function() {}
@@ -78,10 +79,11 @@ test( "element normalization", function() {
});
test( "custom selector expression", function() {
+ expect( 1 );
var elem = $( "<div>" ).appendTo( "#qunit-fixture" );
$.widget( "ui.testWidget", {} );
elem.testWidget();
- deepEqual( $( ":ui-testWidget" )[0], elem[0] );
+ deepEqual( $( ":ui-testwidget" )[0], elem[0] );
elem.testWidget( "destroy" );
});
@@ -300,6 +302,7 @@ test( "._getCreateEventData()", function() {
});
test( "re-init", function() {
+ expect( 3 );
var div = $( "<div>" ),
actions = [];
@@ -329,6 +332,7 @@ test( "re-init", function() {
});
test( "inheritance - options", function() {
+ expect( 4 );
// #5830 - Widget: Using inheritance overwrites the base classes options
$.widget( "ui.testWidgetBase", {
options: {
@@ -441,6 +445,7 @@ test( "._superApply()", function() {
});
test( ".option() - getter", function() {
+ expect( 6 );
$.widget( "ui.testWidget", {
_create: function() {}
});
@@ -472,6 +477,7 @@ test( ".option() - getter", function() {
});
test( ".option() - deep option getter", function() {
+ expect( 5 );
$.widget( "ui.testWidget", {} );
var div = $( "<div>" ).testWidget({
foo: {
@@ -490,6 +496,7 @@ test( ".option() - deep option getter", function() {
});
test( ".option() - delegate to ._setOptions()", function() {
+ expect( 2 );
var div,
calls = [];
$.widget( "ui.testWidget", {
@@ -514,6 +521,7 @@ test( ".option() - delegate to ._setOptions()", function() {
});
test( ".option() - delegate to ._setOption()", function() {
+ expect( 2 );
var div,
calls = [];
$.widget( "ui.testWidget", {
@@ -544,6 +552,7 @@ test( ".option() - delegate to ._setOption()", function() {
});
test( ".option() - deep option setter", function() {
+ expect( 6 );
$.widget( "ui.testWidget", {} );
var div = $( "<div>" ).testWidget();
function deepOption( from, to, msg ) {
@@ -592,6 +601,7 @@ test( ".disable()", function() {
});
test( ".widget() - base", function() {
+ expect( 1 );
$.widget( "ui.testWidget", {
_create: function() {}
});
@@ -600,6 +610,7 @@ test( ".widget() - base", function() {
});
test( ".widget() - overriden", function() {
+ expect( 1 );
var wrapper = $( "<div>" );
$.widget( "ui.testWidget", {
_create: function() {},
@@ -610,13 +621,13 @@ test( ".widget() - overriden", function() {
deepEqual( wrapper[0], $( "<div>" ).testWidget().testWidget( "widget" )[0] );
});
-test( "._bind() to element (default)", function() {
+test( "._on() to element (default)", function() {
expect( 12 );
var that, widget;
$.widget( "ui.testWidget", {
_create: function() {
that = this;
- this._bind({
+ this._on({
keyup: this.keyup,
keydown: "keydown"
});
@@ -650,13 +661,13 @@ test( "._bind() to element (default)", function() {
.trigger( "keydown" );
});
-test( "._bind() to descendent", function() {
+test( "._on() to descendent", function() {
expect( 12 );
var that, widget, descendant;
$.widget( "ui.testWidget", {
_create: function() {
that = this;
- this._bind( this.element.find( "strong" ), {
+ this._on( this.element.find( "strong" ), {
keyup: this.keyup,
keydown: "keydown"
});
@@ -707,13 +718,14 @@ test( "._bind() to descendent", function() {
.trigger( "keydown" );
});
-test( "_bind() with delegate", function() {
+test( "_on() with delegate", function() {
expect( 8 );
$.widget( "ui.testWidget", {
_create: function() {
+ var uuid = this.uuid;
this.element = {
bind: function( event, handler ) {
- equal( event, "click.testWidget" );
+ equal( event, "click.testWidget" + uuid );
ok( $.isFunction(handler) );
},
trigger: $.noop
@@ -722,12 +734,12 @@ test( "_bind() with delegate", function() {
return {
delegate: function( selector, event, handler ) {
equal( selector, "a" );
- equal( event, "click.testWidget" );
+ equal( event, "click.testWidget" + uuid );
ok( $.isFunction(handler) );
}
};
};
- this._bind({
+ this._on({
"click": "handler",
"click a": "handler"
});
@@ -735,12 +747,12 @@ test( "_bind() with delegate", function() {
return {
delegate: function( selector, event, handler ) {
equal( selector, "form fieldset > input" );
- equal( event, "change.testWidget" );
+ equal( event, "change.testWidget" + uuid );
ok( $.isFunction(handler) );
}
};
};
- this._bind({
+ this._on({
"change form fieldset > input": "handler"
});
}
@@ -748,7 +760,103 @@ test( "_bind() with delegate", function() {
$.ui.testWidget();
});
+test( "_on() to common element", function() {
+ expect( 1 );
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ this._on( this.document, {
+ "customevent": "_handler"
+ });
+ },
+ _handler: function() {
+ ok( true, "handler triggered" );
+ }
+ });
+ var widget = $( "#widget" ).testWidget().data( "testWidget" );
+ $( "#widget-wrapper" ).testWidget();
+ widget.destroy();
+ $( document ).trigger( "customevent" );
+});
+
+test( "_off() - single event", function() {
+ expect( 3 );
+
+ $.widget( "ui.testWidget", {} );
+ var shouldTriggerWidget, shouldTriggerOther,
+ element = $( "#widget" ),
+ widget = element.testWidget().data( "testWidget" );
+ widget._on( element, { foo: function() {
+ ok( shouldTriggerWidget, "foo called from _on" );
+ }});
+ element.bind( "foo", function() {
+ ok( shouldTriggerOther, "foo called from bind" );
+ });
+ shouldTriggerWidget = true;
+ shouldTriggerOther = true;
+ element.trigger( "foo" );
+ shouldTriggerWidget = false;
+ widget._off( element, "foo" );
+ element.trigger( "foo" );
+});
+
+test( "_off() - multiple events", function() {
+ expect( 6 );
+
+ $.widget( "ui.testWidget", {} );
+ var shouldTriggerWidget, shouldTriggerOther,
+ element = $( "#widget" ),
+ widget = element.testWidget().data( "testWidget" );
+ widget._on( element, {
+ foo: function() {
+ ok( shouldTriggerWidget, "foo called from _on" );
+ },
+ bar: function() {
+ ok( shouldTriggerWidget, "bar called from _on" );
+ }
+ });
+ element.bind( "foo bar", function( event ) {
+ ok( shouldTriggerOther, event.type + " called from bind" );
+ });
+ shouldTriggerWidget = true;
+ shouldTriggerOther = true;
+ element.trigger( "foo" );
+ element.trigger( "bar" );
+ shouldTriggerWidget = false;
+ widget._off( element, "foo bar" );
+ element.trigger( "foo" );
+ element.trigger( "bar" );
+});
+
+test( "_off() - all events", function() {
+ expect( 6 );
+
+ $.widget( "ui.testWidget", {} );
+ var shouldTriggerWidget, shouldTriggerOther,
+ element = $( "#widget" ),
+ widget = element.testWidget().data( "testWidget" );
+ widget._on( element, {
+ foo: function() {
+ ok( shouldTriggerWidget, "foo called from _on" );
+ },
+ bar: function() {
+ ok( shouldTriggerWidget, "bar called from _on" );
+ }
+ });
+ element.bind( "foo bar", function( event ) {
+ ok( shouldTriggerOther, event.type + " called from bind" );
+ });
+ shouldTriggerWidget = true;
+ shouldTriggerOther = true;
+ element.trigger( "foo" );
+ element.trigger( "bar" );
+ shouldTriggerWidget = false;
+ widget._off( element );
+ element.trigger( "foo" );
+ element.trigger( "bar" );
+});
+
test( "._hoverable()", function() {
+ expect( 10 );
$.widget( "ui.testWidget", {
_create: function() {
this._hoverable( this.element.children() );
@@ -780,10 +888,11 @@ test( "._hoverable()", function() {
});
test( "._focusable()", function() {
+ expect( 10 );
$.widget( "ui.testWidget", {
_create: function() {
- this._focusable( this.element.children() );
- }
+ this._focusable( this.element.children() );
+ }
});
var div = $( "#widget" ).testWidget().children();
@@ -863,6 +972,7 @@ test( "._trigger() - cancelled event", function() {
});
test( "._trigger() - cancelled callback", function() {
+ expect( 1 );
$.widget( "ui.testWidget", {
_create: function() {}
});
diff --git a/tests/visual/addClass/queue.html b/tests/visual/addClass/queue.html
index 21f4cc1cb..0b7a43656 100644
--- a/tests/visual/addClass/queue.html
+++ b/tests/visual/addClass/queue.html
@@ -5,7 +5,7 @@
<title>addClass Visual Test : Queue</title>
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css">
<script src="../../../jquery-1.7.2.js"></script>
- <script src="../../../ui/jquery.effects.core.js"></script>
+ <script src="../../../ui/jquery.ui.effect.js"></script>
<style>
.box {
width: 100px;
diff --git a/tests/visual/effects/all.html b/tests/visual/effects/all.html
index 15bfcd254..1797c5715 100644
--- a/tests/visual/effects/all.html
+++ b/tests/visual/effects/all.html
@@ -5,20 +5,20 @@
<title>jQuery UI Effects Test Suite</title>
<link rel="stylesheet" href="effects.css">
<script src="../../../jquery-1.7.2.js"></script>
- <script src="../../../ui/jquery.effects.core.js"></script>
- <script src="../../../ui/jquery.effects.blind.js"></script>
- <script src="../../../ui/jquery.effects.bounce.js"></script>
- <script src="../../../ui/jquery.effects.clip.js"></script>
- <script src="../../../ui/jquery.effects.drop.js"></script>
- <script src="../../../ui/jquery.effects.explode.js"></script>
- <script src="../../../ui/jquery.effects.fade.js"></script>
- <script src="../../../ui/jquery.effects.fold.js"></script>
- <script src="../../../ui/jquery.effects.highlight.js"></script>
- <script src="../../../ui/jquery.effects.pulsate.js"></script>
- <script src="../../../ui/jquery.effects.scale.js"></script>
- <script src="../../../ui/jquery.effects.shake.js"></script>
- <script src="../../../ui/jquery.effects.slide.js"></script>
- <script src="../../../ui/jquery.effects.transfer.js"></script>
+ <script src="../../../ui/jquery.ui.effect.js"></script>
+ <script src="../../../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../../../ui/jquery.ui.effect-bounce.js"></script>
+ <script src="../../../ui/jquery.ui.effect-clip.js"></script>
+ <script src="../../../ui/jquery.ui.effect-drop.js"></script>
+ <script src="../../../ui/jquery.ui.effect-explode.js"></script>
+ <script src="../../../ui/jquery.ui.effect-fade.js"></script>
+ <script src="../../../ui/jquery.ui.effect-fold.js"></script>
+ <script src="../../../ui/jquery.ui.effect-highlight.js"></script>
+ <script src="../../../ui/jquery.ui.effect-pulsate.js"></script>
+ <script src="../../../ui/jquery.ui.effect-scale.js"></script>
+ <script src="../../../ui/jquery.ui.effect-shake.js"></script>
+ <script src="../../../ui/jquery.ui.effect-slide.js"></script>
+ <script src="../../../ui/jquery.ui.effect-transfer.js"></script>
<script src="effects.js"></script>
</head>
<body>
diff --git a/tests/visual/effects/scale.html b/tests/visual/effects/scale.html
index add2ba01c..bca21a45f 100644
--- a/tests/visual/effects/scale.html
+++ b/tests/visual/effects/scale.html
@@ -5,8 +5,8 @@
<title>jQuery UI Effects Test Suite</title>
<link rel="stylesheet" href="effects.css">
<script src="../../../jquery-1.7.2.js"></script>
- <script src="../../../ui/jquery.effects.core.js"></script>
- <script src="../../../ui/jquery.effects.scale.js"></script>
+ <script src="../../../ui/jquery.ui.effect.js"></script>
+ <script src="../../../ui/jquery.ui.effect-scale.js"></script>
<script>
$(function() {
var test = $( "#testBox" ),
diff --git a/tests/visual/menu/menu.html b/tests/visual/menu/menu.html
index 5bda32eae..205cb10c9 100644
--- a/tests/visual/menu/menu.html
+++ b/tests/visual/menu/menu.html
@@ -26,7 +26,8 @@
$( "#menu6" ).menu({
menus: ".menuElement",
- select: logger
+ select: logger,
+ icon: "ui-icon-carat-1-s"
});
});
</script>
@@ -212,7 +213,7 @@
</blockquote>
</div>
-<h2>Menu with custom markup, multi-line items</h2>
+<h2>Menu with custom markup, multi-line items and a custom submenu icon</h2>
<div class="menuElement" id="menu6">
<div class="address-item">
<a href="#">
diff --git a/tests/visual/tooltip/animations.html b/tests/visual/tooltip/animations.html
index 24fe02905..15badb618 100644
--- a/tests/visual/tooltip/animations.html
+++ b/tests/visual/tooltip/animations.html
@@ -9,11 +9,11 @@
<script src="../../../ui/jquery.ui.widget.js"></script>
<script src="../../../ui/jquery.ui.position.js"></script>
<script src="../../../ui/jquery.ui.tooltip.js"></script>
- <script src="../../../ui/jquery.effects.core.js"></script>
- <script src="../../../ui/jquery.effects.blind.js"></script>
- <script src="../../../ui/jquery.effects.bounce.js"></script>
- <script src="../../../ui/jquery.effects.drop.js"></script>
- <script src="../../../ui/jquery.effects.explode.js"></script>
+ <script src="../../../ui/jquery.ui.effect.js"></script>
+ <script src="../../../ui/jquery.ui.effect-blind.js"></script>
+ <script src="../../../ui/jquery.ui.effect-bounce.js"></script>
+ <script src="../../../ui/jquery.ui.effect-drop.js"></script>
+ <script src="../../../ui/jquery.ui.effect-explode.js"></script>
<style>
pre {
width: 250px;
diff --git a/themes/base/jquery.ui.accordion.css b/themes/base/jquery.ui.accordion.css
index 32c1a7242..71319ac28 100644
--- a/themes/base/jquery.ui.accordion.css
+++ b/themes/base/jquery.ui.accordion.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Accordion @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.all.css b/themes/base/jquery.ui.all.css
index e2310973a..958dac4be 100644
--- a/themes/base/jquery.ui.all.css
+++ b/themes/base/jquery.ui.all.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI CSS Framework @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.autocomplete.css b/themes/base/jquery.ui.autocomplete.css
index 5e331b63d..e1b127470 100644
--- a/themes/base/jquery.ui.autocomplete.css
+++ b/themes/base/jquery.ui.autocomplete.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Autocomplete @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.base.css b/themes/base/jquery.ui.base.css
index b9ce0ad01..87d2bfd30 100644
--- a/themes/base/jquery.ui.base.css
+++ b/themes/base/jquery.ui.base.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI CSS Framework @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.button.css b/themes/base/jquery.ui.button.css
index 87340658a..f5453fb9f 100644
--- a/themes/base/jquery.ui.button.css
+++ b/themes/base/jquery.ui.button.css
@@ -1,13 +1,15 @@
/*!
* jQuery UI Button @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
-.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
.ui-button-icons-only { width: 3.4em; }
diff --git a/themes/base/jquery.ui.core.css b/themes/base/jquery.ui.core.css
index dc27c564a..33a6c96be 100644
--- a/themes/base/jquery.ui.core.css
+++ b/themes/base/jquery.ui.core.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI CSS Framework @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.datepicker.css b/themes/base/jquery.ui.datepicker.css
index 393d86377..0f4e71562 100644
--- a/themes/base/jquery.ui.datepicker.css
+++ b/themes/base/jquery.ui.datepicker.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Datepicker @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -56,8 +57,6 @@
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
- display: none; /*sorry for IE5*/
- display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
diff --git a/themes/base/jquery.ui.dialog.css b/themes/base/jquery.ui.dialog.css
index 0ee0d4dd5..22523c82c 100644
--- a/themes/base/jquery.ui.dialog.css
+++ b/themes/base/jquery.ui.dialog.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Dialog @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.menu.css b/themes/base/jquery.ui.menu.css
index b96d439ab..85c387387 100644
--- a/themes/base/jquery.ui.menu.css
+++ b/themes/base/jquery.ui.menu.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Menu @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.progressbar.css b/themes/base/jquery.ui.progressbar.css
index d198bb4a3..877666589 100644
--- a/themes/base/jquery.ui.progressbar.css
+++ b/themes/base/jquery.ui.progressbar.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Progressbar @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.resizable.css b/themes/base/jquery.ui.resizable.css
index 0bb688d5b..bca140eda 100644
--- a/themes/base/jquery.ui.resizable.css
+++ b/themes/base/jquery.ui.resizable.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Resizable @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.selectable.css b/themes/base/jquery.ui.selectable.css
index 2aa7319aa..0fa8942aa 100644
--- a/themes/base/jquery.ui.selectable.css
+++ b/themes/base/jquery.ui.selectable.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Selectable @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.slider.css b/themes/base/jquery.ui.slider.css
index 94d883a44..39d15b034 100644
--- a/themes/base/jquery.ui.slider.css
+++ b/themes/base/jquery.ui.slider.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Slider @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.spinner.css b/themes/base/jquery.ui.spinner.css
index 50d8e19b7..41ffe539c 100644
--- a/themes/base/jquery.ui.spinner.css
+++ b/themes/base/jquery.ui.spinner.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Spinner @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.tabs.css b/themes/base/jquery.ui.tabs.css
index 6a5c455f9..a2efae8b0 100644
--- a/themes/base/jquery.ui.tabs.css
+++ b/themes/base/jquery.ui.tabs.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Tabs @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -9,7 +10,7 @@
*/
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
diff --git a/themes/base/jquery.ui.theme.css b/themes/base/jquery.ui.theme.css
index 3a9cfae82..86da8a295 100644
--- a/themes/base/jquery.ui.theme.css
+++ b/themes/base/jquery.ui.theme.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI CSS Framework @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/themes/base/jquery.ui.tooltip.css b/themes/base/jquery.ui.tooltip.css
index d144b0a7f..ed29c137a 100644
--- a/themes/base/jquery.ui.tooltip.css
+++ b/themes/base/jquery.ui.tooltip.css
@@ -1,7 +1,8 @@
/*!
* jQuery UI Tooltip @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
diff --git a/ui/i18n/jquery.ui.datepicker-ar.js b/ui/i18n/jquery.ui.datepicker-ar.js
index f24b3ff5a..f0d009667 100644
--- a/ui/i18n/jquery.ui.datepicker-ar.js
+++ b/ui/i18n/jquery.ui.datepicker-ar.js
@@ -12,7 +12,7 @@ jQuery(function($){
monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
- dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+ dayNamesMin: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
weekHeader: 'أسبوع',
dateFormat: 'dd/mm/yy',
firstDay: 6,
diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js
deleted file mode 100644
index 1bb1415a9..000000000
--- a/ui/jquery.effects.core.js
+++ /dev/null
@@ -1,739 +0,0 @@
-/*!
- * jQuery UI Effects @VERSION
- *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/
- */
-;(jQuery.effects || (function($, undefined) {
-
-var backCompat = $.uiBackCompat !== false,
- // prefix used for storing data on .data()
- dataSpace = "ui-effects-";
-
-$.effects = {
- effect: {}
-};
-
-/******************************************************************************/
-/****************************** COLOR ANIMATIONS ******************************/
-/******************************************************************************/
-(function() {
-
-// override the animation for color styles
-$.each(["backgroundColor", "borderBottomColor", "borderLeftColor",
- "borderRightColor", "borderTopColor", "borderColor", "color", "outlineColor"],
-function(i, attr) {
- $.fx.step[attr] = function(fx) {
- if (!fx.colorInit) {
- fx.start = getColor(fx.elem, attr);
- fx.end = getRGB(fx.end);
- fx.colorInit = true;
- }
-
- fx.elem.style[attr] = "rgb(" +
- Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + "," +
- Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + "," +
- Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ")";
- };
-});
-
-// Color Conversion functions from highlightFade
-// By Blair Mitchelmore
-// http://jquery.offput.ca/highlightFade/
-
-// Parse strings looking for color tuples [255,255,255]
-function getRGB(color) {
- var result;
-
- // Check if we're already dealing with an array of colors
- if ( color && color.constructor === Array && color.length === 3 ) {
- return color;
- }
-
- // Look for rgb(num,num,num)
- if ( (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) ) {
- return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
- }
-
- // Look for rgb(num%,num%,num%)
- if ( (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) ) {
- return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
- }
-
- // Look for #a0b1c2
- if ( (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) ) {
- return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
- }
-
- // Look for #fff
- if ( (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) ) {
- return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
- }
-
- // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
- if ( (result = /rgba\(0, 0, 0, 0\)/.exec(color)) ) {
- return colors.transparent;
- }
-
- // Otherwise, we're most likely dealing with a named color
- return colors[$.trim(color).toLowerCase()];
-}
-
-function getColor(elem, attr) {
- var color;
-
- do {
- color = $.css(elem, attr);
-
- // Keep going until we find an element that has color, or we hit the body
- if ( color && color !== "transparent" || $.nodeName(elem, "body") ) {
- break;
- }
-
- attr = "backgroundColor";
- } while ( (elem = elem.parentNode) );
-
- return getRGB(color);
-}
-
-// Some named colors to work with
-// From Interface by Stefan Petre
-// http://interface.eyecon.ro/
-
-var colors = {
- aqua:[0,255,255],
- azure:[240,255,255],
- beige:[245,245,220],
- black:[0,0,0],
- blue:[0,0,255],
- brown:[165,42,42],
- cyan:[0,255,255],
- darkblue:[0,0,139],
- darkcyan:[0,139,139],
- darkgrey:[169,169,169],
- darkgreen:[0,100,0],
- darkkhaki:[189,183,107],
- darkmagenta:[139,0,139],
- darkolivegreen:[85,107,47],
- darkorange:[255,140,0],
- darkorchid:[153,50,204],
- darkred:[139,0,0],
- darksalmon:[233,150,122],
- darkviolet:[148,0,211],
- fuchsia:[255,0,255],
- gold:[255,215,0],
- green:[0,128,0],
- indigo:[75,0,130],
- khaki:[240,230,140],
- lightblue:[173,216,230],
- lightcyan:[224,255,255],
- lightgreen:[144,238,144],
- lightgrey:[211,211,211],
- lightpink:[255,182,193],
- lightyellow:[255,255,224],
- lime:[0,255,0],
- magenta:[255,0,255],
- maroon:[128,0,0],
- navy:[0,0,128],
- olive:[128,128,0],
- orange:[255,165,0],
- pink:[255,192,203],
- purple:[128,0,128],
- violet:[128,0,128],
- red:[255,0,0],
- silver:[192,192,192],
- white:[255,255,255],
- yellow:[255,255,0],
- transparent: [255,255,255]
-};
-
-})();
-
-/******************************************************************************/
-/****************************** CLASS ANIMATIONS ******************************/
-/******************************************************************************/
-(function() {
-
-var classAnimationActions = [ "add", "remove", "toggle" ],
- shorthandStyles = {
- border: 1,
- borderBottom: 1,
- borderColor: 1,
- borderLeft: 1,
- borderRight: 1,
- borderTop: 1,
- borderWidth: 1,
- margin: 1,
- padding: 1
- };
-
-$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
- $.fx.step[ prop ] = function( fx ) {
- if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
- jQuery.style( fx.elem, prop, fx.end );
- fx.setAttr = true;
- }
- };
-});
-
-function getElementStyles() {
- var style = this.ownerDocument.defaultView ?
- this.ownerDocument.defaultView.getComputedStyle( this, null ) :
- this.currentStyle,
- newStyle = {},
- key,
- camelCase,
- len;
-
- // webkit enumerates style porperties
- if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
- len = style.length;
- while ( len-- ) {
- key = style[ len ];
- if ( typeof style[ key ] === "string" ) {
- newStyle[ $.camelCase( key ) ] = style[ key ];
- }
- }
- } else {
- for ( key in style ) {
- if ( typeof style[ key ] === "string" ) {
- newStyle[ key ] = style[ key ];
- }
- }
- }
-
- return newStyle;
-}
-
-
-function styleDifference( oldStyle, newStyle ) {
- var diff = {},
- name, value;
-
- for ( name in newStyle ) {
- value = newStyle[ name ];
- if ( oldStyle[ name ] !== value ) {
- if ( !shorthandStyles[ name ] ) {
- if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
- diff[ name ] = value;
- }
- }
- }
- }
-
- return diff;
-}
-
-$.effects.animateClass = function( value, duration, easing, callback ) {
- var o = $.speed( duration, easing, callback );
-
- return this.queue( function() {
- var animated = $( this ),
- baseClass = animated.attr( "class" ) || "",
- applyClassChange,
- allAnimations = o.children ? animated.find( "*" ).andSelf() : animated;
-
- // map the animated objects to store the original styles.
- allAnimations = allAnimations.map(function() {
- var el = $( this );
- return {
- el: el,
- start: getElementStyles.call( this )
- };
- });
-
- // apply class change
- applyClassChange = function() {
- $.each( classAnimationActions, function(i, action) {
- if ( value[ action ] ) {
- animated[ action + "Class" ]( value[ action ] );
- }
- });
- };
- applyClassChange();
-
- // map all animated objects again - calculate new styles and diff
- allAnimations = allAnimations.map(function() {
- this.end = getElementStyles.call( this.el[ 0 ] );
- this.diff = styleDifference( this.start, this.end );
- return this;
- });
-
- // apply original class
- animated.attr( "class", baseClass );
-
- // map all animated objects again - this time collecting a promise
- allAnimations = allAnimations.map(function() {
- var styleInfo = this,
- dfd = $.Deferred(),
- opts = jQuery.extend({}, o, {
- queue: false,
- complete: function() {
- dfd.resolve( styleInfo );
- }
- });
-
- this.el.animate( this.diff, opts );
- return dfd.promise();
- });
-
- // once all animations have completed:
- $.when.apply( $, allAnimations.get() ).done(function() {
-
- // set the final class
- applyClassChange();
-
- // for each animated element,
- // clear all css properties that were animated
- $.each( arguments, function() {
- var el = this.el;
- $.each( this.diff, function(key) {
- el.css( key, '' );
- });
- });
-
- // this is guarnteed to be there if you use jQuery.speed()
- // it also handles dequeuing the next anim...
- o.complete.call( animated[ 0 ] );
- });
- });
-};
-
-$.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);
- },
-
- _removeClass: $.fn.removeClass,
- removeClass: function( classNames, speed, easing, callback ) {
- return speed ?
- $.effects.animateClass.apply( 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;
- return this._toggleClass( classNames, force );
- } else {
- return $.effects.animateClass.apply( this, [( force ? { add:classNames } : { remove:classNames }), speed, easing, callback ]);
- }
- } else {
- // without force parameter;
- return $.effects.animateClass.apply( 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 ]);
- }
-});
-
-})();
-
-/******************************************************************************/
-/*********************************** EFFECTS **********************************/
-/******************************************************************************/
-
-(function() {
-
-$.extend( $.effects, {
- version: "@VERSION",
-
- // Saves a set of properties in a data storage
- save: function( element, set ) {
- for( var i=0; i < set.length; i++ ) {
- if ( set[ i ] !== null ) {
- element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
- }
- }
- },
-
- // Restores a set of previously saved properties from a data storage
- restore: function( element, set ) {
- for( var i=0; i < set.length; i++ ) {
- if ( set[ i ] !== null ) {
- element.css( set[ i ], element.data( dataSpace + set[ i ] ) );
- }
- }
- },
-
- setMode: function( el, mode ) {
- if (mode === "toggle") {
- mode = el.is( ":hidden" ) ? "show" : "hide";
- }
- return mode;
- },
-
- // Translates a [top,left] array into a baseline value
- // this should be a little more flexible in the future to handle a string & hash
- getBaseline: function( origin, original ) {
- var y, x;
- switch ( origin[ 0 ] ) {
- case "top": y = 0; break;
- case "middle": y = 0.5; break;
- case "bottom": y = 1; break;
- default: y = origin[ 0 ] / original.height;
- }
- switch ( origin[ 1 ] ) {
- case "left": x = 0; break;
- case "center": x = 0.5; break;
- case "right": x = 1; break;
- default: x = origin[ 1 ] / original.width;
- }
- return {
- x: x,
- y: y
- };
- },
-
- // Wraps the element around a wrapper that copies position properties
- createWrapper: function( element ) {
-
- // if the element is already wrapped, return it
- if ( element.parent().is( ".ui-effects-wrapper" )) {
- return element.parent();
- }
-
- // wrap the element
- var props = {
- width: element.outerWidth(true),
- height: element.outerHeight(true),
- "float": element.css( "float" )
- },
- wrapper = $( "<div></div>" )
- .addClass( "ui-effects-wrapper" )
- .css({
- fontSize: "100%",
- background: "transparent",
- border: "none",
- margin: 0,
- padding: 0
- }),
- // Store the size in case width/height are defined in % - Fixes #5245
- size = {
- width: element.width(),
- height: element.height()
- },
- active = document.activeElement;
-
- // support: Firefox
- // Firefox incorrectly exposes anonymous content
- // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
- try {
- active.id;
- } catch( e ) {
- active = document.body;
- }
-
- element.wrap( wrapper );
-
- // Fixes #7595 - Elements lose focus when wrapped.
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
- $( active ).focus();
- }
-
- wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
-
- // transfer positioning properties to the wrapper
- if ( element.css( "position" ) === "static" ) {
- wrapper.css({ position: "relative" });
- element.css({ position: "relative" });
- } else {
- $.extend( props, {
- position: element.css( "position" ),
- zIndex: element.css( "z-index" )
- });
- $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
- props[ pos ] = element.css( pos );
- if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
- props[ pos ] = "auto";
- }
- });
- element.css({
- position: "relative",
- top: 0,
- left: 0,
- right: "auto",
- bottom: "auto"
- });
- }
- element.css(size);
-
- return wrapper.css( props ).show();
- },
-
- removeWrapper: function( element ) {
- var active = document.activeElement;
-
- if ( element.parent().is( ".ui-effects-wrapper" ) ) {
- element.parent().replaceWith( element );
-
- // Fixes #7595 - Elements lose focus when wrapped.
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
- $( active ).focus();
- }
- }
-
-
- return element;
- },
-
- setTransition: function( element, list, factor, value ) {
- value = value || {};
- $.each( list, function( i, x ) {
- var unit = element.cssUnit( x );
- if ( unit[ 0 ] > 0 ) {
- value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
- }
- });
- return value;
- }
-});
-
-// return an effect options object for the given parameters:
-function _normalizeArguments( effect, options, speed, callback ) {
-
- // allow passing all optinos as the first parameter
- if ( $.isPlainObject( effect ) ) {
- options = effect;
- effect = effect.effect;
- }
-
- // convert to an object
- effect = { effect: effect };
-
- // catch (effect)
- if ( options === undefined ) {
- options = {};
- }
-
- // catch (effect, callback)
- if ( $.isFunction( options ) ) {
- callback = options;
- speed = null;
- options = {};
- }
-
- // catch (effect, speed, ?)
- if ( typeof options === "number" || $.fx.speeds[ options ] ) {
- callback = speed;
- speed = options;
- options = {};
- }
-
- // catch (effect, options, callback)
- if ( $.isFunction( speed ) ) {
- callback = speed;
- speed = null;
- }
-
- // add options to effect
- if ( options ) {
- $.extend( effect, options );
- }
-
- speed = speed || options.duration;
- effect.duration = $.fx.off ? 0 :
- typeof speed === "number" ? speed :
- speed in $.fx.speeds ? $.fx.speeds[ speed ] :
- $.fx.speeds._default;
-
- effect.complete = callback || options.complete;
-
- return effect;
-}
-
-function standardSpeed( speed ) {
- // valid standard speeds
- if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
- return true;
- }
-
- // 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;
-}
-
-$.fn.extend({
- effect: function( effect, options, speed, callback ) {
- var args = _normalizeArguments.apply( this, arguments ),
- mode = args.mode,
- queue = args.queue,
- effectMethod = $.effects.effect[ args.effect ],
-
- // DEPRECATED: remove in 2.0 (#7115)
- oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ];
-
- if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {
- // delegate to the original method (e.g., .show()) if possible
- if ( mode ) {
- return this[ mode ]( args.duration, args.complete );
- } else {
- return this.each( function() {
- if ( args.complete ) {
- args.complete.call( this );
- }
- });
- }
- }
-
- function run( next ) {
- var elem = $( this ),
- complete = args.complete,
- mode = args.mode;
-
- function done() {
- if ( $.isFunction( complete ) ) {
- complete.call( elem[0] );
- }
- if ( $.isFunction( next ) ) {
- next();
- }
- }
-
- // if the element is hiddden and mode is hide,
- // or element is visible and mode is show
- if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
- done();
- } else {
- effectMethod.call( elem[0], args, done );
- }
- }
-
- // 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
- });
- }
- },
-
- _show: $.fn.show,
- show: function( speed ) {
- if ( standardSpeed( speed ) ) {
- return this._show.apply( this, arguments );
- } else {
- var args = _normalizeArguments.apply( this, arguments );
- args.mode = "show";
- return this.effect.call( this, args );
- }
- },
-
- _hide: $.fn.hide,
- hide: function( speed ) {
- if ( standardSpeed( speed ) ) {
- return this._hide.apply( this, arguments );
- } else {
- var args = _normalizeArguments.apply( this, arguments );
- args.mode = "hide";
- return this.effect.call( this, args );
- }
- },
-
- // jQuery core overloads toggle and creates _toggle
- __toggle: $.fn.toggle,
- toggle: function( speed ) {
- if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {
- return this.__toggle.apply( this, arguments );
- } else {
- var args = _normalizeArguments.apply( this, arguments );
- args.mode = "toggle";
- return this.effect.call( this, args );
- }
- },
-
- // helper functions
- cssUnit: function(key) {
- var style = this.css( key ),
- val = [];
-
- $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
- if ( style.indexOf( unit ) > 0 ) {
- val = [ parseFloat( style ), unit ];
- }
- });
- return val;
- }
-});
-
-})();
-
-/******************************************************************************/
-/*********************************** EASING ***********************************/
-/******************************************************************************/
-
-(function() {
-
-// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
-
-var baseEasings = {};
-
-$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
- baseEasings[ name ] = function( p ) {
- return Math.pow( p, i + 2 );
- };
-});
-
-$.extend( baseEasings, {
- Sine: function ( p ) {
- return 1 - Math.cos( p * Math.PI / 2 );
- },
- Circ: function ( p ) {
- return 1 - Math.sqrt( 1 - p * p );
- },
- Elastic: function( p ) {
- return p === 0 || p === 1 ? p :
- -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
- },
- Back: function( p ) {
- return p * p * ( 3 * p - 2 );
- },
- Bounce: function ( p ) {
- var pow2,
- bounce = 4;
-
- while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
- return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
- }
-});
-
-$.each( baseEasings, function( name, easeIn ) {
- $.easing[ "easeIn" + name ] = easeIn;
- $.easing[ "easeOut" + name ] = function( p ) {
- return 1 - easeIn( 1 - p );
- };
- $.easing[ "easeInOut" + name ] = function( p ) {
- return p < 0.5 ?
- easeIn( p * 2 ) / 2 :
- 1 - easeIn( p * -2 + 2 ) / 2;
- };
-});
-
-})();
-
-})(jQuery));
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index 856b3ba4b..7d98886e7 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Accordion @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -137,8 +138,8 @@ $.widget( "ui.accordion", {
});
}
- this._bind( this.headers, { keydown: "_keydown" });
- this._bind( this.headers.next(), { keydown: "_panelKeyDown" });
+ this._on( this.headers, { keydown: "_keydown" });
+ this._on( this.headers.next(), { keydown: "_panelKeyDown" });
this._setupEvents( options.event );
},
@@ -219,8 +220,7 @@ $.widget( "ui.accordion", {
if ( key === "event" ) {
if ( this.options.event ) {
- this.headers.unbind(
- this.options.event.split( " " ).join( ".accordion " ) + ".accordion" );
+ this._off( this.headers, this.options.event );
}
this._setupEvents( value );
}
@@ -376,7 +376,7 @@ $.widget( "ui.accordion", {
$.each( event.split(" "), function( index, eventName ) {
events[ eventName ] = "_eventHandler";
});
- this._bind( this.headers, events );
+ this._on( this.headers, events );
},
_eventHandler: function( event ) {
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 2fb7e395c..25d909f8d 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Autocomplete @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -55,7 +56,7 @@ $.widget( "ui.autocomplete", {
// search term. #7799
var suppressKeyPress, suppressKeyPressRepeat, suppressInput;
- this.isMultiLine = this.element.is( "textarea,[contenteditable]" );
+ this.isMultiLine = this._isMultiLine();
this.valueMethod = this.element[ this.element.is( "input,textarea" ) ? "val" : "text" ];
this.isNewMenu = true;
@@ -63,7 +64,7 @@ $.widget( "ui.autocomplete", {
.addClass( "ui-autocomplete-input" )
.attr( "autocomplete", "off" );
- this._bind({
+ this._on({
keydown: function( event ) {
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
@@ -190,7 +191,7 @@ $.widget( "ui.autocomplete", {
.zIndex( this.element.zIndex() + 1 )
.hide()
.data( "menu" );
- this._bind( this.menu.element, {
+ this._on( this.menu.element, {
mousedown: function( event ) {
// prevent moving focus out of the text field
event.preventDefault();
@@ -297,7 +298,7 @@ $.widget( "ui.autocomplete", {
// turning off autocomplete prevents the browser from remembering the
// value when navigating through history, so we re-enable autocomplete
// if the page is unloaded before the widget is destroyed. #7790
- this._bind( this.window, {
+ this._on( this.window, {
beforeunload: function() {
this.element.removeAttr( "autocomplete" );
}
@@ -326,6 +327,20 @@ $.widget( "ui.autocomplete", {
}
},
+ _isMultiLine: function() {
+ // Textareas are always multi-line
+ if ( this.element.is( "textarea" ) ) {
+ return true;
+ }
+ // Inputs are always single-line, even if inside a contentEditable element
+ // IE also treats inputs as contentEditable
+ if ( this.element.is( "input" ) ) {
+ return false;
+ }
+ // All other element types are determined by whether or not they're contentEditable
+ return this.element.prop( "isContentEditable" );
+ },
+
_initSource: function() {
var array, url,
that = this;
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index 810191775..1aa44abdd 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Button @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -54,8 +55,8 @@ $.widget( "ui.button", {
},
_create: function() {
this.element.closest( "form" )
- .unbind( "reset.button" )
- .bind( "reset.button", formResetHandler );
+ .unbind( "reset" + this.eventNamespace )
+ .bind( "reset" + this.eventNamespace, formResetHandler );
if ( typeof this.options.disabled !== "boolean" ) {
this.options.disabled = !!this.element.prop( "disabled" );
@@ -79,7 +80,7 @@ $.widget( "ui.button", {
this.buttonElement
.addClass( baseClasses )
.attr( "role", "button" )
- .bind( "mouseenter.button", function() {
+ .bind( "mouseenter" + this.eventNamespace, function() {
if ( options.disabled ) {
return;
}
@@ -88,13 +89,13 @@ $.widget( "ui.button", {
$( this ).addClass( "ui-state-active" );
}
})
- .bind( "mouseleave.button", function() {
+ .bind( "mouseleave" + this.eventNamespace, function() {
if ( options.disabled ) {
return;
}
$( this ).removeClass( hoverClass );
})
- .bind( "click.button", function( event ) {
+ .bind( "click" + this.eventNamespace, function( event ) {
if ( options.disabled ) {
event.preventDefault();
event.stopImmediatePropagation();
@@ -102,16 +103,16 @@ $.widget( "ui.button", {
});
this.element
- .bind( "focus.button", function() {
+ .bind( "focus" + this.eventNamespace, function() {
// no need to check disabled, focus won't be triggered anyway
that.buttonElement.addClass( focusClass );
})
- .bind( "blur.button", function() {
+ .bind( "blur" + this.eventNamespace, function() {
that.buttonElement.removeClass( focusClass );
});
if ( toggleButton ) {
- this.element.bind( "change.button", function() {
+ this.element.bind( "change" + this.eventNamespace, function() {
if ( clickDragged ) {
return;
}
@@ -121,7 +122,7 @@ $.widget( "ui.button", {
// prevents issue where button state changes but checkbox/radio checked state
// does not in Firefox (see ticket #6970)
this.buttonElement
- .bind( "mousedown.button", function( event ) {
+ .bind( "mousedown" + this.eventNamespace, function( event ) {
if ( options.disabled ) {
return;
}
@@ -129,7 +130,7 @@ $.widget( "ui.button", {
startXPos = event.pageX;
startYPos = event.pageY;
})
- .bind( "mouseup.button", function( event ) {
+ .bind( "mouseup" + this.eventNamespace, function( event ) {
if ( options.disabled ) {
return;
}
@@ -140,7 +141,7 @@ $.widget( "ui.button", {
}
if ( this.type === "checkbox" ) {
- this.buttonElement.bind( "click.button", function() {
+ this.buttonElement.bind( "click" + this.eventNamespace, function() {
if ( options.disabled || clickDragged ) {
return false;
}
@@ -148,7 +149,7 @@ $.widget( "ui.button", {
that.buttonElement.attr( "aria-pressed", that.element[0].checked );
});
} else if ( this.type === "radio" ) {
- this.buttonElement.bind( "click.button", function() {
+ this.buttonElement.bind( "click" + this.eventNamespace, function() {
if ( options.disabled || clickDragged ) {
return false;
}
@@ -166,7 +167,7 @@ $.widget( "ui.button", {
});
} else {
this.buttonElement
- .bind( "mousedown.button", function() {
+ .bind( "mousedown" + this.eventNamespace, function() {
if ( options.disabled ) {
return false;
}
@@ -176,13 +177,13 @@ $.widget( "ui.button", {
lastActive = null;
});
})
- .bind( "mouseup.button", function() {
+ .bind( "mouseup" + this.eventNamespace, function() {
if ( options.disabled ) {
return false;
}
$( this ).removeClass( "ui-state-active" );
})
- .bind( "keydown.button", function(event) {
+ .bind( "keydown" + this.eventNamespace, function(event) {
if ( options.disabled ) {
return false;
}
@@ -190,7 +191,7 @@ $.widget( "ui.button", {
$( this ).addClass( "ui-state-active" );
}
})
- .bind( "keyup.button", function() {
+ .bind( "keyup" + this.eventNamespace, function() {
$( this ).removeClass( "ui-state-active" );
});
@@ -344,7 +345,7 @@ $.widget( "ui.button", {
buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
if ( !this.hasTitle ) {
- buttonElement.attr( "title", buttonText );
+ buttonElement.attr( "title", $.trim( buttonText ) );
}
}
} else {
diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js
index a511de24b..3e102f181 100644
--- a/ui/jquery.ui.core.js
+++ b/ui/jquery.ui.core.js
@@ -1,7 +1,8 @@
/*!
- * jQuery UI @VERSION
+ * jQuery UI Core @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -215,9 +216,16 @@ function visible( element ) {
}
$.extend( $.expr[ ":" ], {
- data: function( elem, i, match ) {
- return !!$.data( elem, match[ 3 ] );
- },
+ data: $.expr.createPseudo ?
+ $.expr.createPseudo(function( dataName ) {
+ return function( elem ) {
+ return !!$.data( elem, dataName );
+ };
+ }) :
+ // support: jQuery <1.8
+ function( elem, i, match ) {
+ return !!$.data( elem, match[ 3 ] );
+ },
focusable: function( element ) {
return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index a92c9fafa..06db79ba7 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Datepicker @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -665,10 +666,6 @@ $.extend(Datepicker.prototype, {
isFixed |= $(this).css('position') == 'fixed';
return !isFixed;
});
- if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
- $.datepicker._pos[0] -= document.documentElement.scrollLeft;
- $.datepicker._pos[1] -= document.documentElement.scrollTop;
- }
var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
$.datepicker._pos = null;
//to avoid flashes on Firefox
@@ -715,6 +712,7 @@ $.extend(Datepicker.prototype, {
var borders = $.datepicker._getBorders(inst.dpDiv);
instActive = inst; // for delegate hover events
inst.dpDiv.empty().append(this._generateHTML(inst));
+ this._attachHandlers(inst);
var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6
cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
@@ -1408,6 +1406,43 @@ $.extend(Datepicker.prototype, {
return startDate;
},
+ /* Attach the onxxx handlers. These are declared statically so
+ * they work with static code transformers like Caja.
+ */
+ _attachHandlers: function(inst) {
+ var stepMonths = this._get(inst, 'stepMonths');
+ var id = '#' + inst.id;
+ inst.dpDiv.find('[data-handler]').map(function () {
+ var handler = {
+ prev: function () {
+ window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, -stepMonths, 'M');
+ },
+ next: function () {
+ window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, +stepMonths, 'M');
+ },
+ hide: function () {
+ window['DP_jQuery_' + dpuuid].datepicker._hideDatepicker();
+ },
+ today: function () {
+ window['DP_jQuery_' + dpuuid].datepicker._gotoToday(id);
+ },
+ selectDay: function () {
+ window['DP_jQuery_' + dpuuid].datepicker._selectDay(id, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this);
+ return false;
+ },
+ selectMonth: function () {
+ window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'M');
+ return false;
+ },
+ selectYear: function () {
+ window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'Y');
+ return false;
+ }
+ };
+ $(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]);
+ });
+ },
+
/* Generate the HTML for the current state of the date picker. */
_generateHTML: function(inst) {
var today = new Date();
@@ -1450,8 +1485,7 @@ $.extend(Datepicker.prototype, {
this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
this._getFormatConfig(inst)));
var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
- '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + dpuuid +
- '.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
+ '<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click"' +
' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
(hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>'));
var nextText = this._get(inst, 'nextText');
@@ -1459,19 +1493,17 @@ $.extend(Datepicker.prototype, {
this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
this._getFormatConfig(inst)));
var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
- '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + dpuuid +
- '.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
+ '<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click"' +
' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
(hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>'));
var currentText = this._get(inst, 'currentText');
var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
currentText = (!navigationAsDateFormat ? currentText :
this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
- var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
- '.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
+ var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">' +
+ this._get(inst, 'closeText') + '</button>' : '');
var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
- (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
- '.datepicker._gotoToday(\'#' + inst.id + '\');"' +
+ (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click"' +
'>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
var firstDay = parseInt(this._get(inst, 'firstDay'),10);
firstDay = (isNaN(firstDay) ? 0 : firstDay);
@@ -1550,8 +1582,7 @@ $.extend(Datepicker.prototype, {
(printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day
(printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
- (unselectable ? '' : ' onclick="DP_jQuery_' + dpuuid + '.datepicker._selectDay(\'#' +
- inst.id + '\',' + printDate.getMonth() + ',' + printDate.getFullYear() + ', this);return false;"') + '>' + // actions
+ (unselectable ? '' : ' data-handler="selectDay" data-event="click" data-month="' + printDate.getMonth() + '" data-year="' + printDate.getFullYear() + '"') + '>' + // actions
(otherMonth && !showOtherMonths ? '&#xa0;' : // display for other months
(unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
(printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
@@ -1594,9 +1625,7 @@ $.extend(Datepicker.prototype, {
else {
var inMinYear = (minDate && minDate.getFullYear() == drawYear);
var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
- monthHtml += '<select class="ui-datepicker-month" ' +
- 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
- '>';
+ monthHtml += '<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';
for (var month = 0; month < 12; month++) {
if ((!inMinYear || month >= minDate.getMonth()) &&
(!inMaxYear || month <= maxDate.getMonth()))
@@ -1627,9 +1656,7 @@ $.extend(Datepicker.prototype, {
var endYear = Math.max(year, determineYear(years[1] || ''));
year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
- inst.yearshtml += '<select class="ui-datepicker-year" ' +
- 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
- '>';
+ inst.yearshtml += '<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';
for (; year <= endYear; year++) {
inst.yearshtml += '<option value="' + year + '"' +
(year == drawYear ? ' selected="selected"' : '') +
@@ -1774,12 +1801,6 @@ function extendRemove(target, props) {
return target;
};
-/* Determine whether an object is an array. */
-function isArray(a) {
- return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
- (a.constructor && a.constructor.toString().match(/\Array\(\)/))));
-};
-
/* Invoke the datepicker functionality.
@param options string - a command, optionally followed by additional parameters or
Object - settings for attaching new datepicker functionality
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 4ef8a20cb..85e4b3e2b 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Dialog @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -224,7 +225,7 @@ $.widget("ui.dialog", {
if ( this.overlay ) {
this.overlay.destroy();
}
- this.uiDialog.unbind( "keypress.ui-dialog" );
+ this._off( this.uiDialog, "keypress" );
if ( this.options.hide ) {
this.uiDialog.hide( this.options.hide, function() {
@@ -310,12 +311,12 @@ $.widget("ui.dialog", {
// prevent tabbing out of modal dialogs
if ( options.modal ) {
- uiDialog.bind( "keydown.ui-dialog", function( event ) {
+ this._on( uiDialog, { keydown: function( event ) {
if ( event.keyCode !== $.ui.keyCode.TAB ) {
return;
}
- var tabbables = $( ":tabbable", this ),
+ var tabbables = $( ":tabbable", uiDialog ),
first = tabbables.filter( ":first" ),
last = tabbables.filter( ":last" );
@@ -326,7 +327,7 @@ $.widget("ui.dialog", {
last.focus( 1 );
return false;
}
- });
+ }});
}
// set focus to the first tabbable element in the content area or the first button
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index 1845f0891..2f05ad6a4 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Draggable @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -400,13 +401,13 @@ $.widget("ui.draggable", $.ui.mouse, {
pos.top // The absolute mouse position
+ this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
),
left: (
pos.left // The absolute mouse position
+ this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
)
};
@@ -460,14 +461,14 @@ $.widget("ui.draggable", $.ui.mouse, {
- this.offset.click.top // Click offset (relative to the element)
- this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
),
left: (
pageX // The absolute mouse position
- this.offset.click.left // Click offset (relative to the element)
- this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
)
};
diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js
index e2ad221e1..17a56787a 100644
--- a/ui/jquery.ui.droppable.js
+++ b/ui/jquery.ui.droppable.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Droppable @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/ui/jquery.effects.blind.js b/ui/jquery.ui.effect-blind.js
index 005b59ad6..7cc353525 100644
--- a/ui/jquery.effects.blind.js
+++ b/ui/jquery.ui.effect-blind.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Blind @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Blind
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.bounce.js b/ui/jquery.ui.effect-bounce.js
index 934fb16ef..0a93bda08 100644
--- a/ui/jquery.effects.bounce.js
+++ b/ui/jquery.ui.effect-bounce.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Bounce @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Bounce
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.clip.js b/ui/jquery.ui.effect-clip.js
index 861508cd0..6539acf24 100644
--- a/ui/jquery.effects.clip.js
+++ b/ui/jquery.ui.effect-clip.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Clip @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Clip
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.drop.js b/ui/jquery.ui.effect-drop.js
index ea8d242d5..3246c09b0 100644
--- a/ui/jquery.effects.drop.js
+++ b/ui/jquery.ui.effect-drop.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Drop @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Drop
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.explode.js b/ui/jquery.ui.effect-explode.js
index ae3efb21e..1048b0a42 100644
--- a/ui/jquery.effects.explode.js
+++ b/ui/jquery.ui.effect-explode.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Explode @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Explode
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.fade.js b/ui/jquery.ui.effect-fade.js
index 66029b51c..ee031fcd8 100644
--- a/ui/jquery.effects.fade.js
+++ b/ui/jquery.ui.effect-fade.js
@@ -1,36 +1,30 @@
/*!
* jQuery UI Effects Fade @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Fade
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
$.effects.effect.fade = function( o, done ) {
var el = $( this ),
- mode = $.effects.setMode( el, o.mode || "toggle" ),
- hide = mode === "hide";
+ mode = $.effects.setMode( el, o.mode || "toggle" );
- el.show();
el.animate({
- opacity: hide ? 0 : 1
+ opacity: mode
}, {
queue: false,
duration: o.duration,
easing: o.easing,
- complete: function() {
- if ( hide ) {
- el.hide();
- }
- done();
- }
+ complete: done
});
};
-})(jQuery);
+})( jQuery );
diff --git a/ui/jquery.effects.fold.js b/ui/jquery.ui.effect-fold.js
index 17aa9a36b..7619285c2 100644
--- a/ui/jquery.effects.fold.js
+++ b/ui/jquery.ui.effect-fold.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Fold @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Fold
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.highlight.js b/ui/jquery.ui.effect-highlight.js
index ac6c269e5..f6868d136 100644
--- a/ui/jquery.effects.highlight.js
+++ b/ui/jquery.ui.effect-highlight.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Highlight @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Highlight
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.pulsate.js b/ui/jquery.ui.effect-pulsate.js
index 5b27bb324..543f6310d 100644
--- a/ui/jquery.effects.pulsate.js
+++ b/ui/jquery.ui.effect-pulsate.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Pulsate @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Pulsate
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.scale.js b/ui/jquery.ui.effect-scale.js
index 5352bde77..5e1dc8540 100644
--- a/ui/jquery.effects.scale.js
+++ b/ui/jquery.ui.effect-scale.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Scale @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Scale
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.shake.js b/ui/jquery.ui.effect-shake.js
index 700c6df3d..51d8e1129 100644
--- a/ui/jquery.effects.shake.js
+++ b/ui/jquery.ui.effect-shake.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Shake @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Shake
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.slide.js b/ui/jquery.ui.effect-slide.js
index ae25a187e..d61047b8b 100644
--- a/ui/jquery.effects.slide.js
+++ b/ui/jquery.ui.effect-slide.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Slide @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Slide
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.effects.transfer.js b/ui/jquery.ui.effect-transfer.js
index 3368fb18e..7d6c10933 100644
--- a/ui/jquery.effects.transfer.js
+++ b/ui/jquery.ui.effect-transfer.js
@@ -1,14 +1,15 @@
/*!
* jQuery UI Effects Transfer @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/Transfer
*
* Depends:
- * jquery.effects.core.js
+ * jquery.ui.effect.js
*/
(function( $, undefined ) {
diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js
new file mode 100644
index 000000000..7cabe5849
--- /dev/null
+++ b/ui/jquery.ui.effect.js
@@ -0,0 +1,1248 @@
+/*!
+ * jQuery UI Effects @VERSION
+ * http://jqueryui.com
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/
+ */
+;(jQuery.effects || (function($, undefined) {
+
+var backCompat = $.uiBackCompat !== false,
+ // prefix used for storing data on .data()
+ dataSpace = "ui-effects-";
+
+$.effects = {
+ effect: {}
+};
+
+/*!
+ * jQuery Color Animations
+ * http://jquery.com/
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ */
+(function( jQuery, undefined ) {
+
+ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),
+
+ // plusequals test for += 100 -= 100
+ rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
+ // a set of RE's that can match strings and generate color tuples.
+ stringParsers = [{
+ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ],
+ execResult[ 2 ],
+ execResult[ 3 ],
+ execResult[ 4 ]
+ ];
+ }
+ }, {
+ re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ] * 2.55,
+ execResult[ 2 ] * 2.55,
+ execResult[ 3 ] * 2.55,
+ execResult[ 4 ]
+ ];
+ }
+ }, {
+ // this regex ignores A-F because it's compared against an already lowercased string
+ re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
+ parse: function( execResult ) {
+ return [
+ parseInt( execResult[ 1 ], 16 ),
+ parseInt( execResult[ 2 ], 16 ),
+ parseInt( execResult[ 3 ], 16 )
+ ];
+ }
+ }, {
+ // this regex ignores A-F because it's compared against an already lowercased string
+ re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
+ parse: function( execResult ) {
+ return [
+ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
+ parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
+ parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
+ ];
+ }
+ }, {
+ re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
+ space: "hsla",
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ],
+ execResult[ 2 ] / 100,
+ execResult[ 3 ] / 100,
+ execResult[ 4 ]
+ ];
+ }
+ }],
+
+ // jQuery.Color( )
+ color = jQuery.Color = function( color, green, blue, alpha ) {
+ return new jQuery.Color.fn.parse( color, green, blue, alpha );
+ },
+ spaces = {
+ rgba: {
+ props: {
+ red: {
+ idx: 0,
+ type: "byte"
+ },
+ green: {
+ idx: 1,
+ type: "byte"
+ },
+ blue: {
+ idx: 2,
+ type: "byte"
+ }
+ }
+ },
+
+ hsla: {
+ props: {
+ hue: {
+ idx: 0,
+ type: "degrees"
+ },
+ saturation: {
+ idx: 1,
+ type: "percent"
+ },
+ lightness: {
+ idx: 2,
+ type: "percent"
+ }
+ }
+ }
+ },
+ propTypes = {
+ "byte": {
+ floor: true,
+ max: 255
+ },
+ "percent": {
+ max: 1
+ },
+ "degrees": {
+ mod: 360,
+ floor: true
+ }
+ },
+ support = color.support = {},
+
+ // element for support tests
+ supportElem = jQuery( "<p>" )[ 0 ],
+
+ // colors = jQuery.Color.names
+ colors,
+
+ // local aliases of functions called often
+ each = jQuery.each;
+
+// determine rgba support immediately
+supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
+support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
+
+// define cache name and alpha properties
+// for rgba and hsla spaces
+each( spaces, function( spaceName, space ) {
+ space.cache = "_" + spaceName;
+ space.props.alpha = {
+ idx: 3,
+ type: "percent",
+ def: 1
+ };
+});
+
+function clamp( value, prop, allowEmpty ) {
+ var type = propTypes[ prop.type ] || {};
+
+ if ( value == null ) {
+ return (allowEmpty || !prop.def) ? null : prop.def;
+ }
+
+ // ~~ is an short way of doing floor for positive numbers
+ value = type.floor ? ~~value : parseFloat( value );
+
+ // IE will pass in empty strings as value for alpha,
+ // which will hit this case
+ if ( isNaN( value ) ) {
+ return prop.def;
+ }
+
+ if ( type.mod ) {
+ // we add mod before modding to make sure that negatives values
+ // get converted properly: -10 -> 350
+ return (value + type.mod) % type.mod;
+ }
+
+ // for now all property types without mod have min and max
+ return 0 > value ? 0 : type.max < value ? type.max : value;
+}
+
+function stringParse( string ) {
+ var inst = color(),
+ rgba = inst._rgba = [];
+
+ string = string.toLowerCase();
+
+ each( stringParsers, function( i, parser ) {
+ var parsed,
+ match = parser.re.exec( string ),
+ values = match && parser.parse( match ),
+ spaceName = parser.space || "rgba";
+
+ if ( values ) {
+ parsed = inst[ spaceName ]( values );
+
+ // if this was an rgba parse the assignment might happen twice
+ // oh well....
+ inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
+ rgba = inst._rgba = parsed._rgba;
+
+ // exit each( stringParsers ) here because we matched
+ return false;
+ }
+ });
+
+ // Found a stringParser that handled it
+ if ( rgba.length ) {
+
+ // if this came from a parsed string, force "transparent" when alpha is 0
+ // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
+ if ( rgba.join() === "0,0,0,0" ) {
+ jQuery.extend( rgba, colors.transparent );
+ }
+ return inst;
+ }
+
+ // named colors
+ return colors[ string ];
+}
+
+color.fn = jQuery.extend( color.prototype, {
+ parse: function( red, green, blue, alpha ) {
+ if ( red === undefined ) {
+ this._rgba = [ null, null, null, null ];
+ return this;
+ }
+ if ( red.jquery || red.nodeType ) {
+ red = jQuery( red ).css( green );
+ green = undefined;
+ }
+
+ var inst = this,
+ type = jQuery.type( red ),
+ rgba = this._rgba = [],
+ source;
+
+ // more than 1 argument specified - assume ( red, green, blue, alpha )
+ if ( green !== undefined ) {
+ red = [ red, green, blue, alpha ];
+ type = "array";
+ }
+
+ if ( type === "string" ) {
+ return this.parse( stringParse( red ) || colors._default );
+ }
+
+ if ( type === "array" ) {
+ each( spaces.rgba.props, function( key, prop ) {
+ rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
+ });
+ return this;
+ }
+
+ if ( type === "object" ) {
+ if ( red instanceof color ) {
+ each( spaces, function( spaceName, space ) {
+ if ( red[ space.cache ] ) {
+ inst[ space.cache ] = red[ space.cache ].slice();
+ }
+ });
+ } else {
+ each( spaces, function( spaceName, space ) {
+ 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 ) {
+
+ // if the value was null, we don't need to copy it
+ // if the key was alpha, we don't need to copy it either
+ if ( key === "alpha" || red[ key ] == null ) {
+ return;
+ }
+ inst[ cache ] = space.to( inst._rgba );
+ }
+
+ // this is the only case where we allow nulls for ALL properties.
+ // call clamp with alwaysAllowEmpty
+ inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
+ });
+ });
+ }
+ return this;
+ }
+ },
+ is: function( compare ) {
+ var is = color( compare ),
+ same = true,
+ inst = this;
+
+ each( spaces, function( _, space ) {
+ var localCache,
+ isCache = is[ space.cache ];
+ if (isCache) {
+ localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
+ each( space.props, function( _, prop ) {
+ if ( isCache[ prop.idx ] != null ) {
+ same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
+ return same;
+ }
+ });
+ }
+ return same;
+ });
+ return same;
+ },
+ _space: function() {
+ var used = [],
+ inst = this;
+ each( spaces, function( spaceName, space ) {
+ if ( inst[ space.cache ] ) {
+ used.push( spaceName );
+ }
+ });
+ return used.pop();
+ },
+ transition: function( other, distance ) {
+ var end = color( other ),
+ spaceName = end._space(),
+ space = spaces[ spaceName ],
+ startColor = this.alpha() === 0 ? color( "transparent" ) : this,
+ start = startColor[ space.cache ] || space.to( startColor._rgba ),
+ result = start.slice();
+
+ end = end[ space.cache ];
+ each( space.props, function( key, prop ) {
+ var index = prop.idx,
+ startValue = start[ index ],
+ endValue = end[ index ],
+ type = propTypes[ prop.type ] || {};
+
+ // if null, don't override start value
+ if ( endValue === null ) {
+ return;
+ }
+ // if null - use end
+ if ( startValue === null ) {
+ result[ index ] = endValue;
+ } else {
+ if ( type.mod ) {
+ if ( endValue - startValue > type.mod / 2 ) {
+ startValue += type.mod;
+ } else if ( startValue - endValue > type.mod / 2 ) {
+ startValue -= type.mod;
+ }
+ }
+ result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
+ }
+ });
+ return this[ spaceName ]( result );
+ },
+ blend: function( opaque ) {
+ // if we are already opaque - return ourself
+ if ( this._rgba[ 3 ] === 1 ) {
+ return this;
+ }
+
+ var rgb = this._rgba.slice(),
+ a = rgb.pop(),
+ blend = color( opaque )._rgba;
+
+ return color( jQuery.map( rgb, function( v, i ) {
+ return ( 1 - a ) * blend[ i ] + a * v;
+ }));
+ },
+ toRgbaString: function() {
+ var prefix = "rgba(",
+ rgba = jQuery.map( this._rgba, function( v, i ) {
+ return v == null ? ( i > 2 ? 1 : 0 ) : v;
+ });
+
+ if ( rgba[ 3 ] === 1 ) {
+ rgba.pop();
+ prefix = "rgb(";
+ }
+
+ return prefix + rgba.join() + ")";
+ },
+ toHslaString: function() {
+ var prefix = "hsla(",
+ hsla = jQuery.map( this.hsla(), function( v, i ) {
+ if ( v == null ) {
+ v = i > 2 ? 1 : 0;
+ }
+
+ // catch 1 and 2
+ if ( i && i < 3 ) {
+ v = Math.round( v * 100 ) + "%";
+ }
+ return v;
+ });
+
+ if ( hsla[ 3 ] === 1 ) {
+ hsla.pop();
+ prefix = "hsl(";
+ }
+ return prefix + hsla.join() + ")";
+ },
+ toHexString: function( includeAlpha ) {
+ var rgba = this._rgba.slice(),
+ alpha = rgba.pop();
+
+ if ( includeAlpha ) {
+ rgba.push( ~~( alpha * 255 ) );
+ }
+
+ return "#" + jQuery.map( rgba, function( v, i ) {
+
+ // default to 0 when nulls exist
+ v = ( v || 0 ).toString( 16 );
+ return v.length === 1 ? "0" + v : v;
+ }).join("");
+ },
+ toString: function() {
+ return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
+ }
+});
+color.fn.parse.prototype = color.fn;
+
+// hsla conversions adapted from:
+// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
+
+function hue2rgb( p, q, h ) {
+ h = ( h + 1 ) % 1;
+ if ( h * 6 < 1 ) {
+ return p + (q - p) * h * 6;
+ }
+ if ( h * 2 < 1) {
+ return q;
+ }
+ if ( h * 3 < 2 ) {
+ return p + (q - p) * ((2/3) - h) * 6;
+ }
+ return p;
+}
+
+spaces.hsla.to = function ( rgba ) {
+ if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
+ return [ null, null, null, rgba[ 3 ] ];
+ }
+ var r = rgba[ 0 ] / 255,
+ g = rgba[ 1 ] / 255,
+ b = rgba[ 2 ] / 255,
+ a = rgba[ 3 ],
+ max = Math.max( r, g, b ),
+ min = Math.min( r, g, b ),
+ diff = max - min,
+ add = max + min,
+ l = add * 0.5,
+ h, s;
+
+ if ( min === max ) {
+ h = 0;
+ } else if ( r === max ) {
+ h = ( 60 * ( g - b ) / diff ) + 360;
+ } else if ( g === max ) {
+ h = ( 60 * ( b - r ) / diff ) + 120;
+ } else {
+ h = ( 60 * ( r - g ) / diff ) + 240;
+ }
+
+ if ( l === 0 || l === 1 ) {
+ s = l;
+ } else if ( l <= 0.5 ) {
+ s = diff / add;
+ } else {
+ s = diff / ( 2 - add );
+ }
+ return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
+};
+
+spaces.hsla.from = function ( hsla ) {
+ if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
+ return [ null, null, null, hsla[ 3 ] ];
+ }
+ var h = hsla[ 0 ] / 360,
+ s = hsla[ 1 ],
+ l = hsla[ 2 ],
+ a = hsla[ 3 ],
+ q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
+ p = 2 * l - q,
+ r, g, b;
+
+ return [
+ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
+ Math.round( hue2rgb( p, q, h ) * 255 ),
+ Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
+ a
+ ];
+};
+
+
+each( spaces, function( spaceName, space ) {
+ var props = space.props,
+ cache = space.cache,
+ to = space.to,
+ from = space.from;
+
+ // makes rgba() and hsla()
+ color.fn[ spaceName ] = function( value ) {
+
+ // generate a cache for this space if it doesn't exist
+ if ( to && !this[ cache ] ) {
+ this[ cache ] = to( this._rgba );
+ }
+ if ( value === undefined ) {
+ return this[ cache ].slice();
+ }
+
+ var ret,
+ type = jQuery.type( value ),
+ arr = ( type === "array" || type === "object" ) ? value : arguments,
+ local = this[ cache ].slice();
+
+ each( props, function( key, prop ) {
+ var val = arr[ type === "object" ? key : prop.idx ];
+ if ( val == null ) {
+ val = local[ prop.idx ];
+ }
+ local[ prop.idx ] = clamp( val, prop );
+ });
+
+ if ( from ) {
+ ret = color( from( local ) );
+ ret[ cache ] = local;
+ return ret;
+ } else {
+ return color( local );
+ }
+ };
+
+ // makes red() green() blue() alpha() hue() saturation() lightness()
+ each( props, function( key, prop ) {
+ // alpha is included in more than one space
+ if ( color.fn[ key ] ) {
+ return;
+ }
+ color.fn[ key ] = function( value ) {
+ var vtype = jQuery.type( value ),
+ fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
+ local = this[ fn ](),
+ cur = local[ prop.idx ],
+ match;
+
+ if ( vtype === "undefined" ) {
+ return cur;
+ }
+
+ if ( vtype === "function" ) {
+ value = value.call( this, cur );
+ vtype = jQuery.type( value );
+ }
+ if ( value == null && prop.empty ) {
+ return this;
+ }
+ if ( vtype === "string" ) {
+ match = rplusequals.exec( value );
+ if ( match ) {
+ value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
+ }
+ }
+ local[ prop.idx ] = value;
+ return this[ fn ]( local );
+ };
+ });
+});
+
+// add .fx.step functions
+each( stepHooks, function( i, hook ) {
+ jQuery.cssHooks[ hook ] = {
+ set: function( elem, value ) {
+ var parsed, backgroundColor, curElem;
+
+ 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
+ );
+
+ value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
+ backgroundColor :
+ "_default" );
+ }
+
+ value = value.toRgbaString();
+ }
+ try {
+ elem.style[ hook ] = value;
+ } catch( value ) {
+ // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
+ }
+ }
+ };
+ jQuery.fx.step[ hook ] = function( fx ) {
+ if ( !fx.colorInit ) {
+ fx.start = color( fx.elem, hook );
+ fx.end = color( fx.end );
+ fx.colorInit = true;
+ }
+ jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
+ };
+});
+
+// Basic color names only.
+// Usage of any of the other color names requires adding yourself or including
+// jquery.color.svg-names.js.
+colors = jQuery.Color.names = {
+ // 4.1. Basic color keywords
+ aqua: "#00ffff",
+ black: "#000000",
+ blue: "#0000ff",
+ fuchsia: "#ff00ff",
+ gray: "#808080",
+ green: "#008000",
+ lime: "#00ff00",
+ maroon: "#800000",
+ navy: "#000080",
+ olive: "#808000",
+ purple: "#800080",
+ red: "#ff0000",
+ silver: "#c0c0c0",
+ teal: "#008080",
+ white: "#ffffff",
+ yellow: "#ffff00",
+
+ // 4.2.3. ‘transparent’ color keyword
+ transparent: [ null, null, null, 0 ],
+
+ _default: "#ffffff"
+};
+
+})( jQuery );
+
+
+
+/******************************************************************************/
+/****************************** CLASS ANIMATIONS ******************************/
+/******************************************************************************/
+(function() {
+
+var classAnimationActions = [ "add", "remove", "toggle" ],
+ shorthandStyles = {
+ border: 1,
+ borderBottom: 1,
+ borderColor: 1,
+ borderLeft: 1,
+ borderRight: 1,
+ borderTop: 1,
+ borderWidth: 1,
+ margin: 1,
+ padding: 1
+ };
+
+$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
+ $.fx.step[ prop ] = function( fx ) {
+ if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
+ jQuery.style( fx.elem, prop, fx.end );
+ fx.setAttr = true;
+ }
+ };
+});
+
+function getElementStyles() {
+ var style = this.ownerDocument.defaultView ?
+ this.ownerDocument.defaultView.getComputedStyle( this, null ) :
+ this.currentStyle,
+ newStyle = {},
+ key,
+ camelCase,
+ len;
+
+ // webkit enumerates style porperties
+ if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
+ len = style.length;
+ while ( len-- ) {
+ key = style[ len ];
+ if ( typeof style[ key ] === "string" ) {
+ newStyle[ $.camelCase( key ) ] = style[ key ];
+ }
+ }
+ } else {
+ for ( key in style ) {
+ if ( typeof style[ key ] === "string" ) {
+ newStyle[ key ] = style[ key ];
+ }
+ }
+ }
+
+ return newStyle;
+}
+
+
+function styleDifference( oldStyle, newStyle ) {
+ var diff = {},
+ name, value;
+
+ for ( name in newStyle ) {
+ value = newStyle[ name ];
+ if ( oldStyle[ name ] !== value ) {
+ if ( !shorthandStyles[ name ] ) {
+ if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
+ diff[ name ] = value;
+ }
+ }
+ }
+ }
+
+ return diff;
+}
+
+$.effects.animateClass = function( value, duration, easing, callback ) {
+ var o = $.speed( duration, easing, callback );
+
+ return this.queue( function() {
+ var animated = $( this ),
+ baseClass = animated.attr( "class" ) || "",
+ applyClassChange,
+ allAnimations = o.children ? animated.find( "*" ).andSelf() : animated;
+
+ // map the animated objects to store the original styles.
+ allAnimations = allAnimations.map(function() {
+ var el = $( this );
+ return {
+ el: el,
+ start: getElementStyles.call( this )
+ };
+ });
+
+ // apply class change
+ applyClassChange = function() {
+ $.each( classAnimationActions, function(i, action) {
+ if ( value[ action ] ) {
+ animated[ action + "Class" ]( value[ action ] );
+ }
+ });
+ };
+ applyClassChange();
+
+ // map all animated objects again - calculate new styles and diff
+ allAnimations = allAnimations.map(function() {
+ this.end = getElementStyles.call( this.el[ 0 ] );
+ this.diff = styleDifference( this.start, this.end );
+ return this;
+ });
+
+ // apply original class
+ animated.attr( "class", baseClass );
+
+ // map all animated objects again - this time collecting a promise
+ allAnimations = allAnimations.map(function() {
+ var styleInfo = this,
+ dfd = $.Deferred(),
+ opts = jQuery.extend({}, o, {
+ queue: false,
+ complete: function() {
+ dfd.resolve( styleInfo );
+ }
+ });
+
+ this.el.animate( this.diff, opts );
+ return dfd.promise();
+ });
+
+ // once all animations have completed:
+ $.when.apply( $, allAnimations.get() ).done(function() {
+
+ // set the final class
+ applyClassChange();
+
+ // for each animated element,
+ // clear all css properties that were animated
+ $.each( arguments, function() {
+ var el = this.el;
+ $.each( this.diff, function(key) {
+ el.css( key, '' );
+ });
+ });
+
+ // this is guarnteed to be there if you use jQuery.speed()
+ // it also handles dequeuing the next anim...
+ o.complete.call( animated[ 0 ] );
+ });
+ });
+};
+
+$.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);
+ },
+
+ _removeClass: $.fn.removeClass,
+ removeClass: function( classNames, speed, easing, callback ) {
+ return speed ?
+ $.effects.animateClass.apply( 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;
+ return this._toggleClass( classNames, force );
+ } else {
+ return $.effects.animateClass.apply( this, [( force ? { add:classNames } : { remove:classNames }), speed, easing, callback ]);
+ }
+ } else {
+ // without force parameter;
+ return $.effects.animateClass.apply( 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 ]);
+ }
+});
+
+})();
+
+/******************************************************************************/
+/*********************************** EFFECTS **********************************/
+/******************************************************************************/
+
+(function() {
+
+$.extend( $.effects, {
+ version: "@VERSION",
+
+ // Saves a set of properties in a data storage
+ save: function( element, set ) {
+ for( var i=0; i < set.length; i++ ) {
+ if ( set[ i ] !== null ) {
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
+ }
+ }
+ },
+
+ // Restores a set of previously saved properties from a data storage
+ restore: function( element, set ) {
+ var val, i;
+ for( i=0; i < set.length; i++ ) {
+ if ( set[ i ] !== null ) {
+ val = element.data( dataSpace + set[ i ] );
+ // support: jQuery 1.6.2
+ // http://bugs.jquery.com/ticket/9917
+ // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
+ // We can't differentiate between "" and 0 here, so we just assume
+ // empty string since it's likely to be a more common value...
+ if ( val === undefined ) {
+ val = "";
+ }
+ element.css( set[ i ], val );
+ }
+ }
+ },
+
+ setMode: function( el, mode ) {
+ if (mode === "toggle") {
+ mode = el.is( ":hidden" ) ? "show" : "hide";
+ }
+ return mode;
+ },
+
+ // Translates a [top,left] array into a baseline value
+ // this should be a little more flexible in the future to handle a string & hash
+ getBaseline: function( origin, original ) {
+ var y, x;
+ switch ( origin[ 0 ] ) {
+ case "top": y = 0; break;
+ case "middle": y = 0.5; break;
+ case "bottom": y = 1; break;
+ default: y = origin[ 0 ] / original.height;
+ }
+ switch ( origin[ 1 ] ) {
+ case "left": x = 0; break;
+ case "center": x = 0.5; break;
+ case "right": x = 1; break;
+ default: x = origin[ 1 ] / original.width;
+ }
+ return {
+ x: x,
+ y: y
+ };
+ },
+
+ // Wraps the element around a wrapper that copies position properties
+ createWrapper: function( element ) {
+
+ // if the element is already wrapped, return it
+ if ( element.parent().is( ".ui-effects-wrapper" )) {
+ return element.parent();
+ }
+
+ // wrap the element
+ var props = {
+ width: element.outerWidth(true),
+ height: element.outerHeight(true),
+ "float": element.css( "float" )
+ },
+ wrapper = $( "<div></div>" )
+ .addClass( "ui-effects-wrapper" )
+ .css({
+ fontSize: "100%",
+ background: "transparent",
+ border: "none",
+ margin: 0,
+ padding: 0
+ }),
+ // Store the size in case width/height are defined in % - Fixes #5245
+ size = {
+ width: element.width(),
+ height: element.height()
+ },
+ active = document.activeElement;
+
+ // support: Firefox
+ // Firefox incorrectly exposes anonymous content
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
+ try {
+ active.id;
+ } catch( e ) {
+ active = document.body;
+ }
+
+ element.wrap( wrapper );
+
+ // Fixes #7595 - Elements lose focus when wrapped.
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+ $( active ).focus();
+ }
+
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
+
+ // transfer positioning properties to the wrapper
+ if ( element.css( "position" ) === "static" ) {
+ wrapper.css({ position: "relative" });
+ element.css({ position: "relative" });
+ } else {
+ $.extend( props, {
+ position: element.css( "position" ),
+ zIndex: element.css( "z-index" )
+ });
+ $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
+ props[ pos ] = element.css( pos );
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
+ props[ pos ] = "auto";
+ }
+ });
+ element.css({
+ position: "relative",
+ top: 0,
+ left: 0,
+ right: "auto",
+ bottom: "auto"
+ });
+ }
+ element.css(size);
+
+ return wrapper.css( props ).show();
+ },
+
+ removeWrapper: function( element ) {
+ var active = document.activeElement;
+
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
+ element.parent().replaceWith( element );
+
+ // Fixes #7595 - Elements lose focus when wrapped.
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+ $( active ).focus();
+ }
+ }
+
+
+ return element;
+ },
+
+ setTransition: function( element, list, factor, value ) {
+ value = value || {};
+ $.each( list, function( i, x ) {
+ var unit = element.cssUnit( x );
+ if ( unit[ 0 ] > 0 ) {
+ value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
+ }
+ });
+ return value;
+ }
+});
+
+// return an effect options object for the given parameters:
+function _normalizeArguments( effect, options, speed, callback ) {
+
+ // allow passing all optinos as the first parameter
+ if ( $.isPlainObject( effect ) ) {
+ options = effect;
+ effect = effect.effect;
+ }
+
+ // convert to an object
+ effect = { effect: effect };
+
+ // catch (effect)
+ if ( options === undefined ) {
+ options = {};
+ }
+
+ // catch (effect, callback)
+ if ( $.isFunction( options ) ) {
+ callback = options;
+ speed = null;
+ options = {};
+ }
+
+ // catch (effect, speed, ?)
+ if ( typeof options === "number" || $.fx.speeds[ options ] ) {
+ callback = speed;
+ speed = options;
+ options = {};
+ }
+
+ // catch (effect, options, callback)
+ if ( $.isFunction( speed ) ) {
+ callback = speed;
+ speed = null;
+ }
+
+ // add options to effect
+ if ( options ) {
+ $.extend( effect, options );
+ }
+
+ speed = speed || options.duration;
+ effect.duration = $.fx.off ? 0 :
+ typeof speed === "number" ? speed :
+ speed in $.fx.speeds ? $.fx.speeds[ speed ] :
+ $.fx.speeds._default;
+
+ effect.complete = callback || options.complete;
+
+ return effect;
+}
+
+function standardSpeed( speed ) {
+ // valid standard speeds
+ if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
+ return true;
+ }
+
+ // 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;
+}
+
+$.fn.extend({
+ effect: function( effect, options, speed, callback ) {
+ var args = _normalizeArguments.apply( this, arguments ),
+ mode = args.mode,
+ queue = args.queue,
+ effectMethod = $.effects.effect[ args.effect ],
+
+ // DEPRECATED: remove in 2.0 (#7115)
+ oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ];
+
+ if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {
+ // delegate to the original method (e.g., .show()) if possible
+ if ( mode ) {
+ return this[ mode ]( args.duration, args.complete );
+ } else {
+ return this.each( function() {
+ if ( args.complete ) {
+ args.complete.call( this );
+ }
+ });
+ }
+ }
+
+ function run( next ) {
+ var elem = $( this ),
+ complete = args.complete,
+ mode = args.mode;
+
+ function done() {
+ if ( $.isFunction( complete ) ) {
+ complete.call( elem[0] );
+ }
+ if ( $.isFunction( next ) ) {
+ next();
+ }
+ }
+
+ // if the element is hiddden and mode is hide,
+ // or element is visible and mode is show
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
+ done();
+ } else {
+ effectMethod.call( elem[0], args, done );
+ }
+ }
+
+ // 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
+ });
+ }
+ },
+
+ _show: $.fn.show,
+ show: function( speed ) {
+ if ( standardSpeed( speed ) ) {
+ return this._show.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "show";
+ return this.effect.call( this, args );
+ }
+ },
+
+ _hide: $.fn.hide,
+ hide: function( speed ) {
+ if ( standardSpeed( speed ) ) {
+ return this._hide.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "hide";
+ return this.effect.call( this, args );
+ }
+ },
+
+ // jQuery core overloads toggle and creates _toggle
+ __toggle: $.fn.toggle,
+ toggle: function( speed ) {
+ if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {
+ return this.__toggle.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "toggle";
+ return this.effect.call( this, args );
+ }
+ },
+
+ // helper functions
+ cssUnit: function(key) {
+ var style = this.css( key ),
+ val = [];
+
+ $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
+ if ( style.indexOf( unit ) > 0 ) {
+ val = [ parseFloat( style ), unit ];
+ }
+ });
+ return val;
+ }
+});
+
+})();
+
+/******************************************************************************/
+/*********************************** EASING ***********************************/
+/******************************************************************************/
+
+(function() {
+
+// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
+
+var baseEasings = {};
+
+$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
+ baseEasings[ name ] = function( p ) {
+ return Math.pow( p, i + 2 );
+ };
+});
+
+$.extend( baseEasings, {
+ Sine: function ( p ) {
+ return 1 - Math.cos( p * Math.PI / 2 );
+ },
+ Circ: function ( p ) {
+ return 1 - Math.sqrt( 1 - p * p );
+ },
+ Elastic: function( p ) {
+ return p === 0 || p === 1 ? p :
+ -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
+ },
+ Back: function( p ) {
+ return p * p * ( 3 * p - 2 );
+ },
+ Bounce: function ( p ) {
+ var pow2,
+ bounce = 4;
+
+ while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
+ return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
+ }
+});
+
+$.each( baseEasings, function( name, easeIn ) {
+ $.easing[ "easeIn" + name ] = easeIn;
+ $.easing[ "easeOut" + name ] = function( p ) {
+ return 1 - easeIn( 1 - p );
+ };
+ $.easing[ "easeInOut" + name ] = function( p ) {
+ return p < 0.5 ?
+ easeIn( p * 2 ) / 2 :
+ 1 - easeIn( p * -2 + 2 ) / 2;
+ };
+});
+
+})();
+
+})(jQuery));
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index 54a85abf5..81fef2e7c 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Menu @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -10,8 +11,9 @@
* Depends:
* jquery.ui.core.js
* jquery.ui.widget.js
+ * jquery.ui.position.js
*/
-(function($) {
+(function( $, undefined ) {
var currentEventTarget = null;
@@ -20,6 +22,9 @@ $.widget( "ui.menu", {
defaultElement: "<ul>",
delay: 300,
options: {
+ icons: {
+ submenu: "ui-icon-carat-1-e"
+ },
menus: "ul",
position: {
my: "left top",
@@ -32,6 +37,7 @@ $.widget( "ui.menu", {
focus: null,
select: null
},
+
_create: function() {
this.activeMenu = this.element;
this.element
@@ -43,8 +49,8 @@ $.widget( "ui.menu", {
tabIndex: 0
})
// need to catch all clicks on disabled menu
- // not possible through _bind
- .bind( "click.menu", $.proxy(function( event ) {
+ // not possible through _on
+ .bind( "click" + this.eventNamespace, $.proxy(function( event ) {
if ( this.options.disabled ) {
event.preventDefault();
}
@@ -56,7 +62,7 @@ $.widget( "ui.menu", {
.attr( "aria-disabled", "true" );
}
- this._bind({
+ this._on({
// Prevent focus from sticking to links inside menu after clicking
// them (focus should always stay on UL during navigation).
"mousedown .ui-menu-item > a": function( event ) {
@@ -69,7 +75,10 @@ $.widget( "ui.menu", {
var target = $( event.target );
if ( target[0] !== currentEventTarget ) {
currentEventTarget = target[0];
- target.one( "click.menu", function( event ) {
+ // TODO: What are we trying to accomplish with this check?
+ // Clicking a menu item twice results in a select event with
+ // an empty ui.item.
+ target.one( "click" + this.eventNamespace, function( event ) {
currentEventTarget = null;
});
// Don't select disabled menu items
@@ -94,20 +103,11 @@ $.widget( "ui.menu", {
mouseleave: "collapseAll",
"mouseleave .ui-menu": "collapseAll",
focus: function( event ) {
- var menu = this.element,
- firstItem = menu.children( ".ui-menu-item" ).eq( 0 );
- if ( this._hasScroll() && !this.active ) {
- menu.children().each(function() {
- var currentItem = $( this );
- if ( currentItem.offset().top - menu.offset().top >= 0 ) {
- firstItem = currentItem;
- return false;
- }
- });
- } else if ( this.active ) {
- firstItem = this.active;
- }
- this.focus( event, firstItem );
+ // 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 );
},
blur: function( event ) {
this._delay(function() {
@@ -121,9 +121,8 @@ $.widget( "ui.menu", {
this.refresh();
- // TODO: We probably shouldn't bind to document for each menu.
- // TODO: This isn't being cleaned up on destroy.
- this._bind( this.document, {
+ // Clicks outside of a menu collapse any open menus
+ this._on( this.document, {
click: function( event ) {
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
this.collapseAll( event );
@@ -133,11 +132,11 @@ $.widget( "ui.menu", {
},
_destroy: function() {
- // destroy (sub)menus
+ // Destroy (sub)menus
this.element
.removeAttr( "aria-activedescendant" )
.find( ".ui-menu" ).andSelf()
- .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
+ .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
.removeAttr( "role" )
.removeAttr( "tabIndex" )
.removeAttr( "aria-labelledby" )
@@ -147,7 +146,7 @@ $.widget( "ui.menu", {
.removeUniqueId()
.show();
- // destroy menu items
+ // Destroy menu items
this.element.find( ".ui-menu-item" )
.removeClass( "ui-menu-item" )
.removeAttr( "role" )
@@ -158,16 +157,22 @@ $.widget( "ui.menu", {
.removeAttr( "tabIndex" )
.removeAttr( "role" )
.removeAttr( "aria-haspopup" )
- // TODO: is this correct? Don't these exist in the original markup?
- .children( ".ui-icon" )
- .remove();
+ .children().each( function() {
+ var elem = $( this );
+ if ( elem.data( "ui-menu-submenu-carat" ) ) {
+ elem.remove();
+ }
+ });
- // unbind currentEventTarget click event handler
- $( currentEventTarget ).unbind( "click.menu" );
+ // Destroy menu dividers
+ this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
+
+ // Unbind currentEventTarget click event handler
+ this._off( $( currentEventTarget ), "click" );
},
_keydown: function( event ) {
- var match, prev, character, skip,
+ var match, prev, character, skip, regex,
preventDefault = true;
function escape( value ) {
@@ -202,8 +207,6 @@ $.widget( "ui.menu", {
}
break;
case $.ui.keyCode.ENTER:
- this._activate( event );
- break;
case $.ui.keyCode.SPACE:
this._activate( event );
break;
@@ -224,20 +227,21 @@ $.widget( "ui.menu", {
character = prev + character;
}
+ regex = new RegExp( "^" + escape( character ), "i" );
match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
- return new RegExp( "^" + escape( character ), "i" )
- .test( $( this ).children( "a" ).text() );
+ return regex.test( $( this ).children( "a" ).text() );
});
match = skip && match.index( this.active.next() ) !== -1 ?
this.active.nextAll( ".ui-menu-item" ) :
match;
- // TODO: document what's going on here, character is reset to the original value
+ // If no matches on the current filter, reset to the last character pressed
+ // to move down the menu to the first item that starts with that character
if ( !match.length ) {
character = String.fromCharCode( event.keyCode );
+ regex = new RegExp( "^" + escape( character ), "i" );
match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {
- return new RegExp( "^" + escape(character), "i" )
- .test( $( this ).children( "a" ).text() );
+ return regex.test( $( this ).children( "a" ).text() );
});
}
@@ -272,8 +276,9 @@ $.widget( "ui.menu", {
},
refresh: function() {
- // initialize nested menus
+ // 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()
@@ -283,10 +288,10 @@ $.widget( "ui.menu", {
"aria-expanded": "false"
});
- // don't refresh list items that are already adapted
+ // Don't refresh list items that are already adapted
menus = submenus.add( this.element );
- menus.children( ":not( .ui-menu-item ):has( a )" )
+ menus.children( ":not(.ui-menu-item):has(a)" )
.addClass( "ui-menu-item" )
.attr( "role", "presentation" )
.children( "a" )
@@ -297,25 +302,28 @@ $.widget( "ui.menu", {
role: this._itemRole()
});
- // initialize unlinked menu-items containing spaces and/or dashes only as dividers
- menus.children( ":not(.ui-menu-item)" ).each( function() {
+ // Initialize unlinked menu-items containing spaces and/or dashes only as dividers
+ menus.children( ":not(.ui-menu-item)" ).each(function() {
var item = $( this );
- // hypen, em dash, en dash
+ // hyphen, em dash, en dash
if ( !/[^\-—–\s]/.test( item.text() ) ) {
item.addClass( "ui-widget-content ui-menu-divider" );
}
});
- // add aria-disabled attribute to any disabled menu item
+ // 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" );
+ item = menu.prev( "a" ),
+ submenuCarat = $( "<span>" )
+ .addClass( "ui-menu-icon ui-icon " + icon )
+ .data( "ui-menu-submenu-carat", true );
item
.attr( "aria-haspopup", "true" )
- .prepend( '<span class="ui-menu-icon ui-icon ui-icon-carat-1-e"></span>' );
+ .prepend( submenuCarat );
menu.attr( "aria-labelledby", item.attr( "id" ) );
});
},
@@ -335,13 +343,13 @@ $.widget( "ui.menu", {
this.active = item.first();
focused = this.active.children( "a" ).addClass( "ui-state-focus" );
- // only update aria-activedescendant if there's a role
+ // Only update aria-activedescendant if there's a role
// otherwise we assume focus is managed elsewhere
if ( this.options.role ) {
this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
}
- // highlight active parent menu item, if any
+ // Highlight active parent menu item, if any
this.active
.parent()
.closest( ".ui-menu-item" )
@@ -356,7 +364,7 @@ $.widget( "ui.menu", {
}, this.delay );
}
- nested = $( "> .ui-menu", item );
+ nested = item.children( ".ui-menu" );
if ( nested.length && ( /^mouse/.test( event.type ) ) ) {
this._startOpening(nested);
}
@@ -416,13 +424,10 @@ $.widget( "ui.menu", {
_open: function( submenu ) {
var position = $.extend({
of: this.active
- }, $.type( this.options.position ) === "function" ?
- this.options.position( this.active ) :
- this.options.position
- );
+ }, this.options.position );
clearTimeout( this.timer );
- this.element.find( ".ui-menu" ).not( submenu.parents() )
+ this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
.hide()
.attr( "aria-hidden", "true" );
@@ -436,11 +441,11 @@ $.widget( "ui.menu", {
collapseAll: function( event, all ) {
clearTimeout( this.timer );
this.timer = this._delay(function() {
- // if we were passed an event, look for the submenu that contains the event
+ // If we were passed an event, look for the submenu that contains the event
var currentMenu = all ? this.element :
$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
- // if we found no valid submenu ancestor, use the main menu to close all sub menus anyway
+ // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
if ( !currentMenu.length ) {
currentMenu = this.element;
}
@@ -475,7 +480,6 @@ $.widget( "ui.menu", {
if ( newItem && newItem.length ) {
this._close();
this.focus( event, newItem );
- return true;
}
},
@@ -489,11 +493,10 @@ $.widget( "ui.menu", {
if ( newItem && newItem.length ) {
this._open( newItem.parent() );
- // timeout so Firefox will not hide activedescendant change in expanding submenu from AT
+ // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
this._delay(function() {
this.focus( event, newItem );
}, 20 );
- return true;
}
},
@@ -534,23 +537,24 @@ $.widget( "ui.menu", {
},
nextPage: function( event ) {
+ var item, base, height;
+
if ( !this.active ) {
- this._move( "next", "first", event );
+ this.next( event );
return;
}
if ( this.isLastItem() ) {
return;
}
if ( this._hasScroll() ) {
- var base = this.active.offset().top,
- height = this.element.height(),
- result;
+ base = this.active.offset().top;
+ height = this.element.height();
this.active.nextAll( ".ui-menu-item" ).each(function() {
- result = $( this );
- return $( this ).offset().top - base - height < 0;
+ item = $( this );
+ return item.offset().top - base - height < 0;
});
- this.focus( event, result );
+ this.focus( event, item );
} else {
this.focus( event, this.activeMenu.children( ".ui-menu-item" )
[ !this.active ? "first" : "last" ]() );
@@ -558,23 +562,23 @@ $.widget( "ui.menu", {
},
previousPage: function( event ) {
+ var item, base, height;
if ( !this.active ) {
- this._move( "next", "first", event );
+ this.next( event );
return;
}
if ( this.isFirstItem() ) {
return;
}
if ( this._hasScroll() ) {
- var base = this.active.offset().top,
- height = this.element.height(),
- result;
+ base = this.active.offset().top;
+ height = this.element.height();
this.active.prevAll( ".ui-menu-item" ).each(function() {
- result = $( this );
- return $(this).offset().top - base + height > 0;
+ item = $( this );
+ return item.offset().top - base + height > 0;
});
- this.focus( event, result );
+ this.focus( event, item );
} else {
this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
}
@@ -585,7 +589,7 @@ $.widget( "ui.menu", {
},
select: function( event ) {
- // save active reference before collapseAll triggers blur
+ // Save active reference before collapseAll triggers blur
var ui = {
item: this.active
};
diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js
index e2e06897c..6f95765f2 100644
--- a/ui/jquery.ui.mouse.js
+++ b/ui/jquery.ui.mouse.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Mouse @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index bd7bfb015..2802b2ce0 100644
--- a/ui/jquery.ui.position.js
+++ b/ui/jquery.ui.position.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Position @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js
index 68cccc554..74a2d6923 100644
--- a/ui/jquery.ui.progressbar.js
+++ b/ui/jquery.ui.progressbar.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Progressbar @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js
index f9330e843..be174dd7e 100644
--- a/ui/jquery.ui.resizable.js
+++ b/ui/jquery.ui.resizable.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Resizable @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -446,9 +447,6 @@ $.widget("ui.resizable", $.ui.mouse, {
});
}
- if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
- continue;
-
prel.css({
height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js
index 2db9a8886..1da7fffa3 100644
--- a/ui/jquery.ui.selectable.js
+++ b/ui/jquery.ui.selectable.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Selectable @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index c302bfe8b..adceb356c 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Slider @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -114,7 +115,7 @@ $.widget( "ui.slider", $.ui.mouse, {
$( this ).data( "ui-slider-handle-index", i );
});
- this._bind( this.handles, {
+ this._on( this.handles, {
keydown: function( event ) {
var allowed, curVal, newVal, step,
index = $( event.target ).data( "ui-slider-handle-index" );
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 88c8aa374..7e5875200 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Sortable @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -887,13 +888,13 @@ $.widget("ui.sortable", $.ui.mouse, {
pos.top // The absolute mouse position
+ this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
),
left: (
pos.left // The absolute mouse position
+ this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
)
};
@@ -944,14 +945,14 @@ $.widget("ui.sortable", $.ui.mouse, {
- this.offset.click.top // Click offset (relative to the element)
- this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
),
left: (
pageX // The absolute mouse position
- this.offset.click.left // Click offset (relative to the element)
- this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
)
};
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index b01feec9a..ead3b17be 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Spinner @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -31,6 +32,10 @@ $.widget( "ui.spinner", {
widgetEventPrefix: "spin",
options: {
culture: null,
+ icons: {
+ down: "ui-icon-triangle-1-s",
+ up: "ui-icon-triangle-1-n"
+ },
incremental: true,
max: null,
min: null,
@@ -54,13 +59,13 @@ $.widget( "ui.spinner", {
this._value( this.element.val(), true );
this._draw();
- this._bind( this._events );
+ this._on( this._events );
this._refresh();
// turning off autocomplete prevents the browser from remembering the
// value when navigating through history, so we re-enable autocomplete
// if the page is unloaded before the widget is destroyed. #7790
- this._bind( this.window, {
+ this._on( this.window, {
beforeunload: function() {
this.element.removeAttr( "autocomplete" );
}
@@ -243,10 +248,10 @@ $.widget( "ui.spinner", {
_buttonHtml: function() {
return "" +
"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
- "<span class='ui-icon ui-icon-triangle-1-n'>&#9650;</span>" +
+ "<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
"</a>" +
"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
- "<span class='ui-icon ui-icon-triangle-1-s'>&#9660;</span>" +
+ "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
"</a>";
},
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index a64dca6e4..588b8cdb2 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Tabs @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -30,6 +31,7 @@ function isLocal( anchor ) {
$.widget( "ui.tabs", {
version: "@VERSION",
+ delay: 300,
options: {
active: null,
collapsible: false,
@@ -53,7 +55,26 @@ $.widget( "ui.tabs", {
this.running = false;
- this.element.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" );
+ this.element
+ .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
+ .toggleClass( "ui-tabs-collapsible", options.collapsible )
+ // Prevent users from focusing disabled tabs via click
+ .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) {
+ if ( $( this ).is( ".ui-state-disabled" ) ) {
+ event.preventDefault();
+ }
+ })
+ // support: IE <9
+ // Preventing the default action in mousedown doesn't prevent IE
+ // from focusing the element, so if the anchor gets focused, blur.
+ // We don't have to worry about focusing the previously focused
+ // element since clicking on a non-focusable element should focus
+ // the body anyway.
+ .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
+ if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
+ this.blur();
+ }
+ });
this._processTabs();
@@ -70,18 +91,18 @@ $.widget( "ui.tabs", {
// check for a tab marked active via a class
if ( active === null ) {
- active = this.lis.filter( ".ui-tabs-active" ).index();
+ active = this.tabs.filter( ".ui-tabs-active" ).index();
}
// no active tab, set to false
if ( active === null || active === -1 ) {
- active = this.lis.length ? 0 : false;
+ active = this.tabs.length ? 0 : false;
}
}
// handle numbers: negative, out of range
if ( active !== false ) {
- active = this.lis.eq( active ).index();
+ active = this.tabs.eq( active ).index();
if ( active === -1 ) {
active = options.collapsible ? false : 0;
}
@@ -97,28 +118,24 @@ $.widget( "ui.tabs", {
// into account and update option properly.
if ( $.isArray( options.disabled ) ) {
options.disabled = $.unique( options.disabled.concat(
- $.map( this.lis.filter( ".ui-state-disabled" ), function( li ) {
- return that.lis.index( li );
+ $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
+ return that.tabs.index( li );
})
) ).sort();
}
- this._refresh();
-
- // highlight selected tab
- this.panels.hide();
- this.lis.removeClass( "ui-tabs-active ui-state-active" );
// check for length avoids error when initializing empty list
- if ( options.active !== false && this.anchors.length ) {
- this.active = this._findActive( options.active );
- panel = this._getPanelForTab( this.active );
-
- panel.show();
- this.lis.eq( options.active ).addClass( "ui-tabs-active ui-state-active" );
- this.load( options.active );
+ if ( this.options.active !== false && this.anchors.length ) {
+ this.active = this._findActive( this.options.active );
} else {
this.active = $();
}
+
+ this._refresh();
+
+ if ( this.active.length ) {
+ this.load( options.active );
+ }
},
_getCreateEventData: function() {
@@ -128,6 +145,117 @@ $.widget( "ui.tabs", {
};
},
+ _tabKeydown: function( event ) {
+ var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
+ selectedIndex = this.tabs.index( focusedTab ),
+ goingForward = true;
+
+ if ( this._handlePageNav( event ) ) {
+ return;
+ }
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.RIGHT:
+ case $.ui.keyCode.DOWN:
+ selectedIndex++;
+ break;
+ case $.ui.keyCode.UP:
+ case $.ui.keyCode.LEFT:
+ goingForward = false;
+ selectedIndex--;
+ break;
+ case $.ui.keyCode.END:
+ selectedIndex = this.anchors.length - 1;
+ break;
+ case $.ui.keyCode.HOME:
+ selectedIndex = 0;
+ break;
+ case $.ui.keyCode.SPACE:
+ // Activate only, no collapsing
+ event.preventDefault();
+ clearTimeout( this.activating );
+ this._activate( selectedIndex );
+ return;
+ case $.ui.keyCode.ENTER:
+ // Toggle (cancel delayed activation, allow collapsing)
+ event.preventDefault();
+ clearTimeout( this.activating );
+ // Determine if we should collapse or activate
+ this._activate( selectedIndex === this.options.active ? false : selectedIndex );
+ return;
+ default:
+ return;
+ }
+
+ // Focus the appropriate tab, based on which key was pressed
+ event.preventDefault();
+ clearTimeout( this.activating );
+ selectedIndex = this._focusNextTab( selectedIndex, goingForward );
+
+ // Navigating with control key will prevent automatic activation
+ if ( !event.ctrlKey ) {
+ // Update aria-selected immediately so that AT think the tab is already selected.
+ // Otherwise AT may confuse the user by stating that they need to activate the tab,
+ // but the tab will already be activated by the time the announcement finishes.
+ focusedTab.attr( "aria-selected", "false" );
+ this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
+
+ this.activating = this._delay(function() {
+ this.option( "active", selectedIndex );
+ }, this.delay );
+ }
+ },
+
+ _panelKeydown: function( event ) {
+ if ( this._handlePageNav( event ) ) {
+ return;
+ }
+
+ // Ctrl+up moves focus to the current tab
+ if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
+ event.preventDefault();
+ this.active.focus();
+ }
+ },
+
+ // Alt+page up/down moves focus to the previous/next tab (and activates)
+ _handlePageNav: function( event ) {
+ if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
+ this._activate( this._focusNextTab( this.options.active - 1, false ) );
+ return true;
+ }
+ if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
+ this._activate( this._focusNextTab( this.options.active + 1, true ) );
+ return true;
+ }
+ },
+
+ _findNextTab: function( index, goingForward ) {
+ var lastTabIndex = this.tabs.length - 1;
+
+ function constrain() {
+ if ( index > lastTabIndex ) {
+ index = 0;
+ }
+ if ( index < 0 ) {
+ index = lastTabIndex;
+ }
+ return index;
+ }
+
+ while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
+ index = goingForward ? index + 1 : index - 1;
+ }
+
+ return index;
+ },
+
+ _focusNextTab: function( index, goingForward ) {
+ index = this._findNextTab( index, goingForward );
+ this.tabs.eq( index ).focus();
+ return index;
+ },
+
_setOption: function( key, value ) {
if ( key === "active" ) {
// _activate() will handle invalid values and update this.options
@@ -143,9 +271,12 @@ $.widget( "ui.tabs", {
this._super( key, value);
- // setting collapsible: false while collapsed; open first panel
- if ( key === "collapsible" && !value && this.options.active === false ) {
- this._activate( 0 );
+ if ( key === "collapsible" ) {
+ this.element.toggleClass( "ui-tabs-collapsible", value );
+ // Setting collapsible: false while collapsed; open first panel
+ if ( !value && this.options.active === false ) {
+ this._activate( 0 );
+ }
}
if ( key === "event" ) {
@@ -168,7 +299,7 @@ $.widget( "ui.tabs", {
refresh: function() {
var next,
options = this.options,
- lis = this.list.children( ":has(a[href])" );
+ lis = this.tablist.children( ":has(a[href])" );
// get disabled tabs from class attribute from HTML
// this will get converted to a boolean if needed in _refresh()
@@ -177,80 +308,128 @@ $.widget( "ui.tabs", {
});
this._processTabs();
- this._refresh();
- this.panels.not( this._getPanelForTab( this.active ) ).hide();
// was collapsed or no tabs
if ( options.active === false || !this.anchors.length ) {
options.active = false;
this.active = $();
// was active, but active tab is gone
- } else if ( this.active.length && !$.contains( this.list[ 0 ], this.active[ 0 ] ) ) {
+ } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
+ // all remaining tabs are disabled
+ if ( this.tabs.length === options.disabled.length ) {
+ options.active = false;
+ this.active = $();
// activate previous tab
- next = options.active - 1;
- this._activate( next >= 0 ? next : 0 );
+ } else {
+ this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
+ }
// was active, active tab still exists
} else {
// make sure active index is correct
- options.active = this.lis.index( this.active );
+ options.active = this.tabs.index( this.active );
}
+
+ this._refresh();
},
_refresh: function() {
- var options = this.options;
-
- this.element.toggleClass( "ui-tabs-collapsible", options.collapsible );
- this.list.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
- this.lis.addClass( "ui-state-default ui-corner-top" );
- this.anchors.addClass( "ui-tabs-anchor" );
- this.panels.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" );
-
- this._setupDisabled( options.disabled );
- this._setupEvents( options.event );
- this._setupHeightStyle( options.heightStyle );
-
- // remove all handlers, may run on existing tabs
- this.lis.unbind( ".tabs" );
- this._focusable( this.lis );
- this._hoverable( this.lis );
+ this._setupDisabled( this.options.disabled );
+ this._setupEvents( this.options.event );
+ this._setupHeightStyle( this.options.heightStyle );
+
+ this.tabs.not( this.active ).attr({
+ "aria-selected": "false",
+ tabIndex: -1
+ });
+ this.panels.not( this._getPanelForTab( this.active ) )
+ .hide()
+ .attr({
+ "aria-expanded": "false",
+ "aria-hidden": "true"
+ });
+
+ // Make sure one tab is in the tab order
+ if ( !this.active.length ) {
+ this.tabs.eq( 0 ).attr( "tabIndex", 0 );
+ } else {
+ this.active
+ .addClass( "ui-tabs-active ui-state-active" )
+ .attr({
+ "aria-selected": "true",
+ tabIndex: 0
+ });
+ this._getPanelForTab( this.active )
+ .show()
+ .attr({
+ "aria-expanded": "true",
+ "aria-hidden": "false"
+ });
+ }
},
_processTabs: function() {
var that = this;
- this.list = this._getList();
- this.lis = this.list.find( "> li:has(a[href])" );
- this.anchors = this.lis.map(function() {
- return $( "a", this )[ 0 ];
- });
+ this.tablist = this._getList()
+ .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
+ .attr( "role", "tablist" );
+
+ this.tabs = this.tablist.find( "> li:has(a[href])" )
+ .addClass( "ui-state-default ui-corner-top" )
+ .attr({
+ role: "tab",
+ tabIndex: -1
+ });
+
+ this.anchors = this.tabs.map(function() {
+ return $( "a", this )[ 0 ];
+ })
+ .addClass( "ui-tabs-anchor" )
+ .attr({
+ role: "presentation",
+ tabIndex: -1
+ });
+
this.panels = $();
- this.anchors.each(function( i, a ) {
- var selector, panel, id,
- tab = $( a ).closest( "li" );
+ this.anchors.each(function( i, anchor ) {
+ var selector, panel, panelId,
+ anchorId = $( anchor ).uniqueId().attr( "id" ),
+ tab = $( anchor ).closest( "li" ),
+ originalAriaControls = tab.attr( "aria-controls" );
// inline tab
- if ( isLocal( a ) ) {
- selector = a.hash;
+ if ( isLocal( anchor ) ) {
+ selector = anchor.hash;
panel = that.element.find( that._sanitizeSelector( selector ) );
// remote tab
} else {
- id = that._tabId( tab );
- selector = "#" + id;
+ panelId = that._tabId( tab );
+ selector = "#" + panelId;
panel = that.element.find( selector );
if ( !panel.length ) {
- panel = that._createPanel( id );
- panel.insertAfter( that.panels[ i - 1 ] || that.list );
+ panel = that._createPanel( panelId );
+ panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
}
+ panel.attr( "aria-live", "polite" );
}
if ( panel.length) {
that.panels = that.panels.add( panel );
}
- tab
- .data( "ui-tabs-aria-controls", tab.attr( "aria-controls" ) )
- .attr( "aria-controls", selector.substring( 1 ) );
+ if ( originalAriaControls ) {
+ tab.data( "ui-tabs-aria-controls", originalAriaControls );
+ }
+ tab.attr({
+ "aria-controls": selector.substring( 1 ),
+ "aria-labelledby": anchorId
+ });
+ panel.attr( "aria-labelledby", anchorId );
});
+
+ this.panels
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .attr( "role", "tabpanel" );
},
// allow overriding how to find the list for rare usage scenarios (#7715)
@@ -275,9 +454,16 @@ $.widget( "ui.tabs", {
}
// disable tabs
- for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) {
- $( li ).toggleClass( "ui-state-disabled",
- ( disabled === true || $.inArray( i, disabled ) !== -1 ) );
+ for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
+ if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
+ $( li )
+ .addClass( "ui-state-disabled" )
+ .attr( "aria-disabled", "true" );
+ } else {
+ $( li )
+ .removeClass( "ui-state-disabled" )
+ .removeAttr( "aria-disabled" );
+ }
}
this.options.disabled = disabled;
@@ -294,8 +480,14 @@ $.widget( "ui.tabs", {
events[ eventName ] = "_eventHandler";
});
}
- this.anchors.unbind( ".tabs" );
- this._bind( this.anchors, events );
+
+ this._off( this.anchors.add( this.tabs ).add( this.panels ) );
+ this._on( this.anchors, events );
+ this._on( this.tabs, { keydown: "_tabKeydown" } );
+ this._on( this.panels, { keydown: "_panelKeydown" } );
+
+ this._focusable( this.tabs );
+ this._hoverable( this.tabs );
},
_setupHeightStyle: function( heightStyle ) {
@@ -372,7 +564,7 @@ $.widget( "ui.tabs", {
return;
}
- options.active = collapsing ? false : this.lis.index( tab );
+ options.active = collapsing ? false : this.tabs.index( tab );
this.active = clickedIsActive ? $() : tab;
if ( this.xhr ) {
@@ -384,8 +576,7 @@ $.widget( "ui.tabs", {
}
if ( toShow.length ) {
- // TODO make passing in node possible
- this.load( this.lis.index( tab ), event );
+ this.load( this.tabs.index( tab ), event );
}
this._toggle( event, eventData );
},
@@ -425,6 +616,32 @@ $.widget( "ui.tabs", {
toHide.hide();
show();
}
+
+ toHide.attr({
+ "aria-expanded": "false",
+ "aria-hidden": "true"
+ });
+ eventData.oldTab.attr( "aria-selected", "false" );
+ // If we're switching tabs, remove the old tab from the tab order.
+ // If we're opening from collapsed state, remove the previous tab from the tab order.
+ // If we're collapsing, then keep the collapsing tab in the tab order.
+ if ( toShow.length && toHide.length ) {
+ eventData.oldTab.attr( "tabIndex", -1 );
+ } else if ( toShow.length ) {
+ this.tabs.filter(function() {
+ return $( this ).attr( "tabIndex" ) === 0;
+ })
+ .attr( "tabIndex", -1 );
+ }
+
+ toShow.attr({
+ "aria-expanded": "true",
+ "aria-hidden": "false"
+ });
+ eventData.newTab.attr({
+ "aria-selected": "true",
+ tabIndex: 0
+ });
},
_activate: function( index ) {
@@ -450,7 +667,7 @@ $.widget( "ui.tabs", {
},
_findActive: function( index ) {
- return index === false ? $() : this.lis.eq( index );
+ return index === false ? $() : this.tabs.eq( index );
},
_getIndex: function( index ) {
@@ -469,32 +686,37 @@ $.widget( "ui.tabs", {
this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
- this.list.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
+ this.tablist
+ .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
+ .removeAttr( "role" );
this.anchors
.removeClass( "ui-tabs-anchor" )
- .unbind( ".tabs" )
+ .removeAttr( "role" )
+ .removeAttr( "tabIndex" )
.removeData( "href.tabs" )
- .removeData( "load.tabs" );
+ .removeData( "load.tabs" )
+ .removeUniqueId();
- this.lis.unbind( ".tabs" ).add( this.panels ).each(function() {
+ this.tabs.add( this.panels ).each(function() {
if ( $.data( this, "ui-tabs-destroy" ) ) {
$( this ).remove();
} else {
- $( this ).removeClass([
- "ui-state-default",
- "ui-corner-top",
- "ui-tabs-active",
- "ui-state-active",
- "ui-state-disabled",
- "ui-tabs-panel",
- "ui-widget-content",
- "ui-corner-bottom"
- ].join( " " ) );
+ $( this )
+ .removeClass( "ui-state-default ui-state-active ui-state-disabled " +
+ "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "aria-live" )
+ .removeAttr( "aria-busy" )
+ .removeAttr( "aria-selected" )
+ .removeAttr( "aria-labelledby" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "role" );
}
});
- this.lis.each(function() {
+ this.tabs.each(function() {
var li = $( this ),
prev = li.data( "ui-tabs-aria-controls" );
if ( prev ) {
@@ -507,8 +729,6 @@ $.widget( "ui.tabs", {
if ( this.options.heightStyle !== "content" ) {
this.panels.css( "height", "" );
}
-
- return this;
},
enable: function( index ) {
@@ -526,7 +746,7 @@ $.widget( "ui.tabs", {
return num !== index ? num : null;
});
} else {
- disabled = $.map( this.lis, function( li, num ) {
+ disabled = $.map( this.tabs, function( li, num ) {
return num !== index ? num : null;
});
}
@@ -559,7 +779,7 @@ $.widget( "ui.tabs", {
load: function( index, event ) {
index = this._getIndex( index );
var that = this,
- tab = this.lis.eq( index ),
+ tab = this.tabs.eq( index ),
anchor = tab.find( ".ui-tabs-anchor" ),
panel = this._getPanelForTab( tab ),
eventData = {
@@ -585,6 +805,7 @@ $.widget( "ui.tabs", {
// but as of 1.8, $.ajax() always returns a jqXHR object.
if ( this.xhr && this.xhr.statusText !== "canceled" ) {
tab.addClass( "ui-tabs-loading" );
+ panel.attr( "aria-busy", "true" );
this.xhr
.success(function( response ) {
@@ -604,6 +825,7 @@ $.widget( "ui.tabs", {
}
tab.removeClass( "ui-tabs-loading" );
+ panel.removeAttr( "aria-busy" );
if ( jqXHR === that.xhr ) {
delete that.xhr;
@@ -650,7 +872,7 @@ if ( $.uiBackCompat !== false ) {
var that = this;
- this.element.bind( "tabsbeforeload.tabs", function( event, ui ) {
+ this._on({ tabsbeforeload: function( event, ui ) {
// tab is already cached
if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) {
event.preventDefault();
@@ -675,7 +897,7 @@ if ( $.uiBackCompat !== false ) {
$.data( ui.tab[ 0 ], "cache.tabs", true );
}
});
- });
+ }});
},
_setOption: function( key, value ) {
@@ -713,7 +935,7 @@ if ( $.uiBackCompat !== false ) {
},
_create: function() {
this._super();
- this._bind({
+ this._on({
tabsbeforeload: function( event, ui ) {
if ( !this.options.spinner ) {
return;
@@ -795,7 +1017,7 @@ if ( $.uiBackCompat !== false ) {
li.addClass( "ui-state-default ui-corner-top" ).data( "ui-tabs-destroy", true );
li.attr( "aria-controls", id );
- doInsertAfter = index >= this.lis.length;
+ doInsertAfter = index >= this.tabs.length;
// try to find an existing element before creating a new one
panel = this.element.find( "#" + id );
@@ -814,9 +1036,9 @@ if ( $.uiBackCompat !== false ) {
panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ).hide();
if ( doInsertAfter ) {
- li.appendTo( this.list );
+ li.appendTo( this.tablist );
} else {
- li.insertBefore( this.lis[ index ] );
+ li.insertBefore( this.tabs[ index ] );
}
options.disabled = $.map( options.disabled, function( n ) {
@@ -824,7 +1046,7 @@ if ( $.uiBackCompat !== false ) {
});
this.refresh();
- if ( this.lis.length === 1 && options.active === false ) {
+ if ( this.tabs.length === 1 && options.active === false ) {
this.option( "active", 0 );
}
@@ -835,7 +1057,7 @@ if ( $.uiBackCompat !== false ) {
remove: function( index ) {
index = this._getIndex( index );
var options = this.options,
- tab = this.lis.eq( index ).remove(),
+ tab = this.tabs.eq( index ).remove(),
panel = this._getPanelForTab( tab ).remove();
// If selected tab was removed focus tab to the right or
@@ -981,7 +1203,7 @@ if ( $.uiBackCompat !== false ) {
return;
}
}
- this.anchors.eq( index ).trigger( this.options.event + ".tabs" );
+ this.anchors.eq( index ).trigger( this.options.event + this.eventNamespace );
}
});
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index 1892d6555..8bfe78c05 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Tooltip @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -54,6 +55,7 @@ $.widget( "ui.tooltip", {
},
show: true,
tooltipClass: null,
+ track: false,
// callbacks
close: null,
@@ -61,7 +63,7 @@ $.widget( "ui.tooltip", {
},
_create: function() {
- this._bind({
+ this._on({
mouseover: "open",
focusin: "open"
});
@@ -117,8 +119,18 @@ $.widget( "ui.tooltip", {
target = $( event ? event.target : this.element )
.closest( this.options.items );
- // if ui-tooltip-id exists, then the tooltip is already open
- if ( !target.length || target.data( "ui-tooltip-id" ) ) {
+ // No element to show a tooltip for
+ if ( !target.length ) {
+ return;
+ }
+
+ // If the tooltip is open and we're tracking then reposition the tooltip.
+ // This makes sure that a tracking tooltip doesn't obscure a focused element
+ // if the user was hovering when the element gained focused.
+ if ( this.options.track && target.data( "ui-tooltip-id" ) ) {
+ this._find( target ).position( $.extend({
+ of: target
+ }, this.options.position ) );
return;
}
@@ -145,10 +157,19 @@ $.widget( "ui.tooltip", {
},
_open: function( event, target, content ) {
+ var tooltip, positionOption;
if ( !content ) {
return;
}
+ // Content can be updated multiple times. If the tooltip already
+ // exists, then just update the content and bail.
+ tooltip = this._find( target );
+ if ( tooltip.length ) {
+ tooltip.find( ".ui-tooltip-content" ).html( content );
+ return;
+ }
+
// if we have a title, clear it to prevent the native tooltip
// we have to check first to avoid defining a title if none exists
// (we don't want to cause an element to start matching [title])
@@ -164,25 +185,34 @@ $.widget( "ui.tooltip", {
}
}
- // ajaxy tooltip can update an existing one
- var tooltip = this._find( target );
- if ( !tooltip.length ) {
- tooltip = this._tooltip( target );
- addDescribedBy( target, tooltip.attr( "id" ) );
- }
+ tooltip = this._tooltip( target );
+ addDescribedBy( target, tooltip.attr( "id" ) );
tooltip.find( ".ui-tooltip-content" ).html( content );
- tooltip
- .stop( true )
- .position( $.extend({
+
+ function position( event ) {
+ positionOption.of = event;
+ tooltip.position( positionOption );
+ }
+ if ( this.options.track && /^mouse/.test( event.originalEvent.type ) ) {
+ positionOption = $.extend( {}, this.options.position );
+ this._on( this.document, {
+ mousemove: position
+ });
+ // trigger once to override element-relative positioning
+ position( event );
+ } else {
+ tooltip.position( $.extend({
of: target
- }, this.options.position ) )
- .hide();
+ }, this.options.position ) );
+ }
+
+ tooltip.hide();
this._show( tooltip, this.options.show );
this._trigger( "open", event, { tooltip: tooltip } );
- this._bind( target, {
+ this._on( target, {
mouseleave: "close",
focusout: "close",
keyup: function( event ) {
@@ -230,7 +260,8 @@ $.widget( "ui.tooltip", {
});
target.removeData( "tooltip-open" );
- target.unbind( "mouseleave.tooltip focusout.tooltip keyup.tooltip" );
+ this._off( target, "mouseleave focusout keyup" );
+ this._off( this.document, "mousemove" );
this.closing = true;
this._trigger( "close", event, { tooltip: tooltip } );
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 3e3723398..b5dfaa344 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -1,7 +1,8 @@
/*!
* jQuery UI Widget @VERSION
+ * http://jqueryui.com
*
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Copyright 2012 jQuery Foundation and other contributors
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -9,7 +10,8 @@
*/
(function( $, undefined ) {
-var slice = Array.prototype.slice,
+var uuid = 0,
+ slice = Array.prototype.slice,
_cleanData = $.cleanData;
$.cleanData = function( elems ) {
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
@@ -34,7 +36,7 @@ $.widget = function( name, base, prototype ) {
}
// create selector for plugin
- $.expr[ ":" ][ fullName ] = function( elem ) {
+ $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
@@ -210,6 +212,8 @@ $.Widget.prototype = {
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
+ this.uuid = uuid++;
+ this.eventNamespace = "." + this.widgetName + this.uuid;
this.options = $.widget.extend( {},
this.options,
this._getCreateOptions(),
@@ -224,7 +228,7 @@ $.Widget.prototype = {
// TODO remove dual storage
$.data( element, this.widgetName, this );
$.data( element, this.widgetFullName, this );
- this._bind({ remove: "destroy" });
+ this._on({ remove: "destroy" });
this.document = $( element.style ?
// element within the document
element.ownerDocument :
@@ -245,22 +249,25 @@ $.Widget.prototype = {
destroy: function() {
this._destroy();
// we can probably remove the unbind calls in 2.0
- // all event bindings should go through this._bind()
+ // all event bindings should go through this._on()
this.element
- .unbind( "." + this.widgetName )
+ .unbind( this.eventNamespace )
// 1.9 BC for #7810
// TODO remove dual storage
.removeData( this.widgetName )
- .removeData( this.widgetFullName );
+ .removeData( this.widgetFullName )
+ // support: jquery <1.6.3
+ // http://bugs.jquery.com/ticket/9413
+ .removeData( $.camelCase( this.widgetFullName ) );
this.widget()
- .unbind( "." + this.widgetName )
+ .unbind( this.eventNamespace )
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetFullName + "-disabled " +
"ui-state-disabled" );
// clean up events and states
- this.bindings.unbind( "." + this.widgetName );
+ this.bindings.unbind( this.eventNamespace );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
},
@@ -339,7 +346,7 @@ $.Widget.prototype = {
return this._setOption( "disabled", true );
},
- _bind: function( element, handlers ) {
+ _on: function( element, handlers ) {
// no element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
@@ -367,11 +374,11 @@ $.Widget.prototype = {
// copy the guid so direct unbinding works
if ( typeof handler !== "string" ) {
handlerProxy.guid = handler.guid =
- handler.guid || handlerProxy.guid || jQuery.guid++;
+ handler.guid || handlerProxy.guid || $.guid++;
}
var match = event.match( /^(\w+)\s*(.*)$/ ),
- eventName = match[1] + "." + instance.widgetName,
+ eventName = match[1] + instance.eventNamespace,
selector = match[2];
if ( selector ) {
instance.widget().delegate( selector, eventName, handlerProxy );
@@ -381,6 +388,11 @@ $.Widget.prototype = {
});
},
+ _off: function( element, eventName ) {
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
+ element.unbind( eventName ).undelegate( eventName );
+ },
+
_delay: function( handler, delay ) {
function handlerProxy() {
return ( typeof handler === "string" ? instance[ handler ] : handler )
@@ -392,7 +404,7 @@ $.Widget.prototype = {
_hoverable: function( element ) {
this.hoverable = this.hoverable.add( element );
- this._bind( element, {
+ this._on( element, {
mouseenter: function( event ) {
$( event.currentTarget ).addClass( "ui-state-hover" );
},
@@ -404,7 +416,7 @@ $.Widget.prototype = {
_focusable: function( element ) {
this.focusable = this.focusable.add( element );
- this._bind( element, {
+ this._on( element, {
focusin: function( event ) {
$( event.currentTarget ).addClass( "ui-state-focus" );
},