aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-06-28 05:45:25 -0700
committerScott González <scott.gonzalez@gmail.com>2012-06-28 05:45:25 -0700
commit730446edcaae94549e4a33cd7b791e22db278763 (patch)
treea9e3874e023776a644f646d91a4a21b811d0ed6e /ui
parent7ce30694fde16073cdea071237c2474fdba22abb (diff)
downloadjquery-ui-730446edcaae94549e4a33cd7b791e22db278763.tar.gz
jquery-ui-730446edcaae94549e4a33cd7b791e22db278763.zip
Effects: Update jquery-color.
Diffstat (limited to 'ui')
-rw-r--r--ui/.jshintrc1
-rw-r--r--ui/jquery.ui.effect.js26
2 files changed, 11 insertions, 16 deletions
diff --git a/ui/.jshintrc b/ui/.jshintrc
index eaa9f4b0b..415d69e90 100644
--- a/ui/.jshintrc
+++ b/ui/.jshintrc
@@ -1,5 +1,4 @@
{
- "boss": true,
"browser": true,
"curly": true,
"eqnull": true,
diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js
index 366c2d190..b4e0787da 100644
--- a/ui/jquery.ui.effect.js
+++ b/ui/jquery.ui.effect.js
@@ -21,7 +21,7 @@ $.effects = {
* jQuery Color Animations
* http://jquery.org/
*
- * Copyright 2011 John Resig
+ * Copyright 2012 John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
@@ -149,7 +149,6 @@ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightCo
floor: true
}
},
- rgbaspace = spaces.rgba.props,
support = color.support = {},
// colors = jQuery.Color.names
@@ -158,11 +157,11 @@ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightCo
// local aliases of functions called often
each = jQuery.each;
-spaces.hsla.props.alpha = rgbaspace.alpha;
+spaces.hsla.props.alpha = spaces.rgba.props.alpha;
function clamp( value, prop, alwaysAllowEmpty ) {
var type = propTypes[ prop.type ] || {},
- allowEmpty = prop.empty || alwaysAllowEmpty;
+ allowEmpty = alwaysAllowEmpty || prop.empty;
if ( allowEmpty && value == null ) {
return null;
@@ -179,7 +178,7 @@ function clamp( value, prop, alwaysAllowEmpty ) {
return prop.def;
}
if ( type.mod ) {
- value = value % type.mod;
+ value %= type.mod;
// -10 -> 350
return value < 0 ? type.mod + value : value;
}
@@ -226,21 +225,18 @@ function stringParse( string ) {
return inst;
}
- // named colors / default - filter back through parse function
- if ( string = colors[ string ] ) {
- return string;
- }
+ // named colors
+ return colors[ string ];
}
-color.fn = color.prototype = {
- constructor: color,
+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 instanceof jQuery || red.nodeType ) {
- red = red instanceof jQuery ? red.css( green ) : jQuery( red ).css( green );
+ if ( red.jquery || red.nodeType ) {
+ red = jQuery( red ).css( green );
green = undefined;
}
@@ -260,7 +256,7 @@ color.fn = color.prototype = {
}
if ( type === "array" ) {
- each( rgbaspace, function( key, prop ) {
+ each( spaces.rgba.props, function( key, prop ) {
rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
});
return this;
@@ -428,7 +424,7 @@ color.fn = color.prototype = {
toString: function() {
return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
}
-};
+});
color.fn.parse.prototype = color.fn;
// hsla conversions adapted from: