@@ -984,6 +984,8 @@ module.exports = function( grunt ) {
"qunit/qunit.js": "qunit/qunit/qunit.js",
"qunit/qunit.css": "qunit/qunit/qunit.css",
"qunit/MIT-LICENSE.txt": "qunit/MIT-LICENSE.txt",
"qunit-assert-classes/qunit-assert-classes.js": "qunit-assert-classes/qunit-assert-classes.js",
"qunit-assert-classes/LICENSE.txt": "qunit-assert-classes/LICENSE",
"jshint/jshint.js": "jshint/dist/jshint.js"
}
},
@@ -20,6 +20,7 @@
"devDependencies": {
"requirejs": "2.1.2",
"qunit": "1.14.0",
"qunit-assert-classes": "0.1.5",
"jshint": "2.4.0",
"requirejs-text": "2.0.3",
"requirejs-plugins": "millermedeiros/requirejs-plugins#34330a5d735474ac0b518eb1eb270c9e5505a537"
@@ -1,5 +1,4 @@
Copyright 2007, 2014 jQuery Foundation and other contributors,
https://jquery.org/
Copyright jQuery Foundation and other contributors, https://jquery.org/

This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
@@ -2,12 +2,17 @@
* jQuery UI Accordion button-classes
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/accordion/
*/

//>>label: Accordion
//>>group: Widgets
//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
//>>docs: http://api.jqueryui.com/accordion/
//>>demos: http://jqueryui.com/accordion/

(function( factory ) {
if ( typeof define === "function" && define.amd ) {

@@ -283,9 +288,9 @@ return $.widget( "ui.accordion", {

this.active = this._findActive( options.active );
this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" )
._removeClass( this.active, "ui-accordion-header-collapsed" )
._addClass( this.active.next(), "ui-accordion-content-active" )
.active.next().show();
._removeClass( this.active, "ui-accordion-header-collapsed" );
this._addClass( this.active.next(), "ui-accordion-content-active" );
this.active.next().show();

this.headers
.attr( "role", "tab" )
@@ -404,10 +409,9 @@ return $.widget( "ui.accordion", {
},

_eventHandler: function( event ) {
var options = this.options,
var activeChildren, clickedChildren,
options = this.options,
active = this.active,
activeChildren = null,
clickedChildren = null,
clicked = $( event.currentTarget ),
clickedIsActive = clicked[ 0 ] === active[ 0 ],
collapsing = clickedIsActive && options.collapsible,
@@ -479,7 +483,10 @@ return $.widget( "ui.accordion", {
toHide.attr({
"aria-hidden": "true"
});
toHide.prev().attr( "aria-selected", "false" );
toHide.prev().attr({
"aria-selected": "false",
"aria-expanded": "false"
});
// if we're switching panels, remove the old header from the tab order
// if we're opening from collapsed state, remove the previous header from the tab order
// if we're collapsing, then keep the collapsing header in the tab order
@@ -490,7 +497,7 @@ return $.widget( "ui.accordion", {
});
} else if ( toShow.length ) {
this.headers.filter(function() {
return $( this ).attr( "tabIndex" ) === 0;
return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
})
.attr( "tabIndex", -1 );
}
@@ -500,8 +507,8 @@ return $.widget( "ui.accordion", {
.prev()
.attr({
"aria-selected": "true",
tabIndex: 0,
"aria-expanded": "true"
"aria-expanded": "true",
tabIndex: 0
});
},

@@ -564,8 +571,8 @@ return $.widget( "ui.accordion", {
var toHide = data.oldPanel,
prev = toHide.prev();

this._removeClass( toHide, "ui-accordion-content-active" )
._removeClass( prev, "ui-accordion-header-active" )
this._removeClass( toHide, "ui-accordion-content-active" );
this._removeClass( prev, "ui-accordion-header-active" )
._addClass( prev, "ui-accordion-header-collapsed" );

// Work around for rendering bug in IE (#5421)
@@ -2,12 +2,17 @@
* jQuery UI Button button-classes
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/button/
*/

//>>label: Button
//>>group: Widgets
//>>description: Enhances a form with themeable buttons.
//>>docs: http://api.jqueryui.com/button/
//>>demos: http://jqueryui.com/button/

(function( factory ) {
if ( typeof define === "function" && define.amd ) {

@@ -26,16 +31,21 @@

var formResetHandler = function() {
var form = $( this );

// Wait for the form reset to actually happen before refreshing
setTimeout(function() {
// We find .ui-button first then filer by :ui-button because doing a

// We find .ui-button first then filter by :ui-button because doing a
// widget pseudo selectors are very very slow but we need to filter out
// css only buttons
form.find( ".ui-button" ).filter( ":ui-button" ).button( "refresh" );
});
};
},
buttonCount = 0;

$.widget( "ui.button", {
version: "button-classes",
classes: {},
defaultElement: "<button>",
options: {
disabled: null,
@@ -53,13 +63,13 @@ $.widget( "ui.button", {
options = this._super() || {};

this.isInput = this.element.is( "input" );
this.originalLabel = this.isInput ? this.element.val() : this.element.html();

disabled = this.element[ 0 ].disabled;
if ( disabled != null ) {
options.disabled = disabled;
}

this.originalLabel = this.isInput ? this.element.val() : this.element.html();
if ( this.originalLabel ) {
options.label = this.originalLabel;
}
@@ -68,13 +78,17 @@ $.widget( "ui.button", {
},

_create: function() {
var formElement = $( this.element[ 0 ].form );
this.formElement = $( this.element[ 0 ].form );

// We don't use _on and _off here because we want all the checkboxes in the same form to use
// single handler which handles all the checkboxradio widgets in the form
formElement.off( "reset" + this.eventNamespace, formResetHandler );
formElement.on( "reset" + this.eventNamespace, formResetHandler );
// We don't use _on and _off here because we want all the buttons in the same form to use
// single handler which handles all the button widgets in the form
this.formElement.off( "reset." + this.widgetFullName, formResetHandler );
this.formElement.on( "reset." + this.widgetFullName, formResetHandler );
buttonCount++;

// We have to check the option again here even though we did in _getCreateOptions
// because null may have been passed on init which would override what was set in
// _getCreateOptions
if ( this.options.disabled == null ) {
this.options.disabled = this.element[ 0 ].disabled || false;
}
@@ -86,7 +100,8 @@ $.widget( "ui.button", {
this._on({
"keyup": function( event ) {
if ( event.keyCode === $.ui.keyCode.SPACE ) {
this.element[0].click();
event.preventDefault();
this.element[ 0 ].click();
}
}
});
@@ -121,20 +136,30 @@ $.widget( "ui.button", {
},

_updateIcon: function( icon ) {
var prepend =
( this.options.iconPosition === "top" || this.options.iconPosition === "beginning" ),
displayBlock =
( this.options.iconPosition === "top" ||
this.options.iconPosition === "bottom" );
if ( !this.icon ) {
this.icon = $( "<span>" );
this.iconSpace = $( "<span> </span>" );

this._addClass( this.icon, "ui-button-icon", " ui-icon" );

if ( !this.options.showLabel ) {
this._addClass( "ui-button-icon-only" );
} else {
this._addClass( null, "ui-icon-" + this.options.iconPosition );
} else if ( displayBlock ) {
this._addClass( this.icon, null, "ui-icon-display-block" );
}
} else {
this._removeClass( this.icon, null, this.options.icon );
}
this._addClass( this.icon, null, icon );
this.icon.appendTo( this.element );
this.icon[ prepend ? "prependTo" : "appendTo" ]( this.element );
if ( !displayBlock ) {
this.icon[ prepend ? "after" : "before" ]( this.iconSpace );
}
return this;
},

@@ -143,50 +168,64 @@ $.widget( "ui.button", {

if ( this.icon ) {
this.icon.remove();
this.iconSpace.remove();
}
if ( !this.hasTitle ) {
this.element.removeAttr( "title" );
}
buttonCount--;
if ( buttonCount === 0 ) {
this.formElement.off( "reset." + this.widgetFullName, formResetHandler );
}
},

_setOption: function( key, value ) {
var iconGroup,
prepend = ( this.options.iconPosition === "top" || this.options.iconPosition === "beginning" );

if ( key === "icon" ) {
if ( value !== null ) {
this._updateIcon( value );
} else {
this.icon.remove();
this.iconSpace.remove();
this._removeClass( "ui-button-icon", " ui-icon-" + this.options.iconPosition );
}
}

// Make sure we can't end up with a button that has no text nor icon
if ( key === "showLabel" ) {
if ( ( !value && this.options.icon ) || value ) {
this._toggleClass( this._classes( "ui-button-icon-only" ), null, !value )
._toggleClass( null, this.options.iconPosition, value );
this._toggleClass( this._classes( "ui-button-icon-only" ), null, !value );
this._updateTooltip();
} else {
value = true;
}
}
if ( key === "iconPosition" && this.options.icon ) {
this._addClass( null, value )
._removeClass( null, this.options.iconPosition );
this._addClass( null, value );
}
if ( key === "label" ) {
if ( this.isInput ) {
this.element.val( value );
} else {

// If there us an icon append it else nothing then append the value
// If there is an icon, append it, else nothing then append the value
// this avoids removal of the icon when setting label text
this.element.html( !!this.icon ? "" : this.icon ).append( value );
this.element.html( value );
if ( !!this.icon ) {
iconGroup = this.icon.add( this.iconSpace );
this.element[ prepend ? "prepend" : "append" ]( iconGroup );
}
}
}
this._super( key, value );
if ( key === "disabled" ) {
this._toggleClass( null, "ui-state-disabled", value ).element[ 0 ].disabled = value;
this.element.blur();
this._toggleClass( null, "ui-state-disabled", value );
this.element[ 0 ].disabled = value;
if ( value ) {
this.element.blur();
}
}
},

@@ -242,7 +281,8 @@ if ( $.uiBackCompat !== false ) {

_setOption: function( key, value ) {
if ( key === "text" ) {
this._setOption( "showLabel", value );
this._super( "showLabel", value );
return;
}
if ( key === "showLabel" ) {
this.options.text = value;
@@ -252,19 +292,19 @@ if ( $.uiBackCompat !== false ) {
}
if ( key === "icons" ) {
if ( value.primary ) {
this._setOption( "icon", value.primary );
this._setOption( "iconPosition", "beginning" );
this._super( "icon", value.primary );
this._super( "iconPosition", "beginning" );
} else if ( value.secondary ) {
this._setOption( "icon", value.secondary );
this._setOption( "iconPosition", "end" );
this._super( "icon", value.secondary );
this._super( "iconPosition", "end" );
}
}
this._superApply( arguments );
}
});
$.fn.button = (function( orig ) {
return function() {
if ( this.length > 0 && this[ 0 ].tagName === "INPUT" &&
if ( this.length && this[ 0 ].tagName === "INPUT" &&
( this.attr( "type") === "checkbox" || this.attr( "type" ) === "radio" ) ) {
if ( $.ui.checkboxradio ) {
if ( arguments.length === 0 ) {