" )
.attr( "id", id )
.addclass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
.data( "ui-tabs-destroy", true );
},
_setupdisabled: function( disabled ) {
if ( $.isarray( disabled ) ) {
if ( !disabled.length ) {
disabled = false;
} else if ( disabled.length === this.anchors.length ) {
disabled = true;
}
}
// disable tabs
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;
},
_setupevents: function( event ) {
var events = {};
if ( event ) {
$.each( event.split(" "), function( index, eventname ) {
events[ eventname ] = "_eventhandler";
});
}
this._off( this.anchors.add( this.tabs ).add( this.panels ) );
// always prevent the default action, even when disabled
this._on( true, this.anchors, {
click: function( event ) {
event.preventdefault();
}
});
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 ) {
var maxheight,
parent = this.element.parent();
if ( heightstyle === "fill" ) {
maxheight = parent.height();
maxheight -= this.element.outerheight() - this.element.height();
this.element.siblings( ":visible" ).each(function() {
var elem = $( this ),
position = elem.css( "position" );
if ( position === "absolute" || position === "fixed" ) {
return;
}
maxheight -= elem.outerheight( true );
});
this.element.children().not( this.panels ).each(function() {
maxheight -= $( this ).outerheight( true );
});
this.panels.each(function() {
$( this ).height( math.max( 0, maxheight -
$( this ).innerheight() + $( this ).height() ) );
})
.css( "overflow", "auto" );
} else if ( heightstyle === "auto" ) {
maxheight = 0;
this.panels.each(function() {
maxheight = math.max( maxheight, $( this ).height( "" ).height() );
}).height( maxheight );
}
},
_eventhandler: function( event ) {
var options = this.options,
active = this.active,
anchor = $( event.currenttarget ),
tab = anchor.closest( "li" ),
clickedisactive = tab[ 0 ] === active[ 0 ],
collapsing = clickedisactive && options.collapsible,
toshow = collapsing ? $() : this._getpanelfortab( tab ),
tohide = !active.length ? $() : this._getpanelfortab( active ),
eventdata = {
oldtab: active,
oldpanel: tohide,
newtab: collapsing ? $() : tab,
newpanel: toshow
};
event.preventdefault();
if ( tab.hasclass( "ui-state-disabled" ) ||
// tab is already loading
tab.hasclass( "ui-tabs-loading" ) ||
// can't switch durning an animation
this.running ||
// click on active header, but not collapsible
( clickedisactive && !options.collapsible ) ||
// allow canceling activation
( this._trigger( "beforeactivate", event, eventdata ) === false ) ) {
return;
}
options.active = collapsing ? false : this.tabs.index( tab );
this.active = clickedisactive ? $() : tab;
if ( this.xhr ) {
this.xhr.abort();
}
if ( !tohide.length && !toshow.length ) {
$.error( "jquery ui tabs: mismatching fragment identifier." );
}
if ( toshow.length ) {
this.load( this.tabs.index( tab ), event );
}
this._toggle( event, eventdata );
},
// handles show/hide for selecting tabs
_toggle: function( event, eventdata ) {
var that = this,
toshow = eventdata.newpanel,
tohide = eventdata.oldpanel;
this.running = true;
function complete() {
that.running = false;
that._trigger( "activate", event, eventdata );
}
function show() {
eventdata.newtab.closest( "li" ).addclass( "ui-tabs-active ui-state-active" );
if ( toshow.length && that.options.show ) {
that._show( toshow, that.options.show, complete );
} else {
toshow.show();
complete();
}
}
// start out by hiding, then showing, then completing
if ( tohide.length && this.options.hide ) {
this._hide( tohide, this.options.hide, function() {
eventdata.oldtab.closest( "li" ).removeclass( "ui-tabs-active ui-state-active" );
show();
});
} else {
eventdata.oldtab.closest( "li" ).removeclass( "ui-tabs-active ui-state-active" );
tohide.hide();
show();
}
tohide.attr( "aria-hidden", "true" );
eventdata.oldtab.attr({
"aria-selected": "false",
"aria-expanded": "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-hidden", "false" );
eventdata.newtab.attr({
"aria-selected": "true",
"aria-expanded": "true",
tabindex: 0
});
},
_activate: function( index ) {
var anchor,
active = this._findactive( index );
// trying to activate the already active panel
if ( active[ 0 ] === this.active[ 0 ] ) {
return;
}
// trying to collapse, simulate a click on the current active header
if ( !active.length ) {
active = this.active;
}
anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
this._eventhandler({
target: anchor,
currenttarget: anchor,
preventdefault: $.noop
});
},
_findactive: function( index ) {
return index === false ? $() : this.tabs.eq( index );
},
_getindex: function( index ) {
// meta-function to give users option to provide a href string instead of a numerical index.
if ( typeof index === "string" ) {
index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
}
return index;
},
_destroy: function() {
if ( this.xhr ) {
this.xhr.abort();
}
this.element.removeclass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
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" )
.removeattr( "role" )
.removeattr( "tabindex" )
.removeuniqueid();
this.tablist.unbind( this.eventnamespace );
this.tabs.add( this.panels ).each(function() {
if ( $.data( this, "ui-tabs-destroy" ) ) {
$( this ).remove();
} else {
$( 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.tabs.each(function() {
var li = $( this ),
prev = li.data( "ui-tabs-aria-controls" );
if ( prev ) {
li
.attr( "aria-controls", prev )
.removedata( "ui-tabs-aria-controls" );
} else {
li.removeattr( "aria-controls" );
}
});
this.panels.show();
if ( this.options.heightstyle !== "content" ) {
this.panels.css( "height", "" );
}
},
enable: function( index ) {
var disabled = this.options.disabled;
if ( disabled === false ) {
return;
}
if ( index === undefined ) {
disabled = false;
} else {
index = this._getindex( index );
if ( $.isarray( disabled ) ) {
disabled = $.map( disabled, function( num ) {
return num !== index ? num : null;
});
} else {
disabled = $.map( this.tabs, function( li, num ) {
return num !== index ? num : null;
});
}
}
this._setupdisabled( disabled );
},
disable: function( index ) {
var disabled = this.options.disabled;
if ( disabled === true ) {
return;
}
if ( index === undefined ) {
disabled = true;
} else {
index = this._getindex( index );
if ( $.inarray( index, disabled ) !== -1 ) {
return;
}
if ( $.isarray( disabled ) ) {
disabled = $.merge( [ index ], disabled ).sort();
} else {
disabled = [ index ];
}
}
this._setupdisabled( disabled );
},
load: function( index, event ) {
index = this._getindex( index );
var that = this,
tab = this.tabs.eq( index ),
anchor = tab.find( ".ui-tabs-anchor" ),
panel = this._getpanelfortab( tab ),
eventdata = {
tab: tab,
panel: panel
},
complete = function( jqxhr, status ) {
if ( status === "abort" ) {
that.panels.stop( false, true );
}
tab.removeclass( "ui-tabs-loading" );
panel.removeattr( "aria-busy" );
if ( jqxhr === that.xhr ) {
delete that.xhr;
}
};
// not remote
if ( this._islocal( anchor[ 0 ] ) ) {
return;
}
this.xhr = $.ajax( this._ajaxsettings( anchor, event, eventdata ) );
// support: jquery <1.8
// jquery <1.8 returns false if the request is canceled in beforesend,
// 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
.done(function( response, status, jqxhr ) {
// support: jquery <1.8
// http://bugs.jquery.com/ticket/11778
settimeout(function() {
panel.html( response );
that._trigger( "load", event, eventdata );
complete( jqxhr, status );
}, 1 );
})
.fail(function( jqxhr, status ) {
// support: jquery <1.8
// http://bugs.jquery.com/ticket/11778
settimeout(function() {
complete( jqxhr, status );
}, 1 );
});
}
},
_ajaxsettings: function( anchor, event, eventdata ) {
var that = this;
return {
url: anchor.attr( "href" ),
beforesend: function( jqxhr, settings ) {
return that._trigger( "beforeload", event,
$.extend( { jqxhr: jqxhr, ajaxsettings: settings }, eventdata ) );
}
};
},
_getpanelfortab: function( tab ) {
var id = $( tab ).attr( "aria-controls" );
return this.element.find( this._sanitizeselector( "#" + id ) );
}
});
/*!
* jquery ui effects 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/effects-core/
*/
var dataspace = "ui-effects-",
// create a local jquery because jquery color relies on it and the
// global may not exist with amd and a custom build (#10199)
jquery = $;
$.effects = {
effect: {}
};
/*!
* jquery color animations v2.1.2
* https://github.com/jquery/jquery-color
*
* copyright 2014 jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* date: wed jan 16 08:47:09 2013 -0600
*/
(function( jquery, undefined ) {
var stephooks = "backgroundcolor borderbottomcolor borderleftcolor borderrightcolor bordertopcolor color columnrulecolor outlinecolor textdecorationcolor textemphasiscolor",
// 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( "
" )[ 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 = [];
// 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 ) {
var cache = space.cache;
each( space.props, function( key, prop ) {
// 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 );
});
// everything defined but alpha?
if ( inst[ cache ] && jquery.inarray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
// use the default of 1
inst[ cache ][ 3 ] = 1;
if ( space.from ) {
inst._rgba = space.from( inst[ cache ] );
}
}
});
}
return this;
}
},
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 ) {
// 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;
}
// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
if ( diff === 0 ) {
s = 0;
} 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;
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 csshook and .fx.step function for each named hook.
// accept a space separated string of properties
color.hook = function( hook ) {
var hooks = hook.split( " " );
each( hooks, function( i, hook ) {
jquery.csshooks[ hook ] = {
set: function( elem, value ) {
var parsed, curelem,
backgroundcolor = "";
if ( value !== "transparent" && ( jquery.type( value ) !== "string" || ( parsed = stringparse( value ) ) ) ) {
value = color( parsed || value );
if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
curelem = hook === "backgroundcolor" ? elem.parentnode : elem;
while (
(backgroundcolor === "" || backgroundcolor === "transparent") &&
curelem && curelem.style
) {
try {
backgroundcolor = jquery.css( curelem, "backgroundcolor" );
curelem = curelem.parentnode;
} catch ( e ) {
}
}
value = value.blend( backgroundcolor && backgroundcolor !== "transparent" ?
backgroundcolor :
"_default" );
}
value = value.torgbastring();
}
try {
elem.style[ hook ] = value;
} catch ( e ) {
// 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 ) );
};
});
};
color.hook( stephooks );
jquery.csshooks.bordercolor = {
expand: function( value ) {
var expanded = {};
each( [ "top", "right", "bottom", "left" ], function( i, part ) {
expanded[ "border" + part + "color" ] = value;
});
return expanded;
}
};
// basic color names only.
// usage of any of the other color names requires adding yourself or including
// jquery.color.svg-names.js.
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( elem ) {
var key, len,
style = elem.ownerdocument.defaultview ?
elem.ownerdocument.defaultview.getcomputedstyle( elem, null ) :
elem.currentstyle,
styles = {};
if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
len = style.length;
while ( len-- ) {
key = style[ len ];
if ( typeof style[ key ] === "string" ) {
styles[ $.camelcase( key ) ] = style[ key ];
}
}
// support: opera, ie <9
} else {
for ( key in style ) {
if ( typeof style[ key ] === "string" ) {
styles[ key ] = style[ key ];
}
}
}
return styles;
}
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;
}
// support: jquery <1.8
if ( !$.fn.addback ) {
$.fn.addback = function( selector ) {
return this.add( selector == null ?
this.prevobject : this.prevobject.filter( selector )
);
};
}
$.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( "*" ).addback() : animated;
// map the animated objects to store the original styles.
allanimations = allanimations.map(function() {
var el = $( this );
return {
el: el,
start: getelementstyles( 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( 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 = $.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: (function( orig ) {
return function( classnames, speed, easing, callback ) {
return speed ?
$.effects.animateclass.call( this,
{ add: classnames }, speed, easing, callback ) :
orig.apply( this, arguments );
};
})( $.fn.addclass ),
removeclass: (function( orig ) {
return function( classnames, speed, easing, callback ) {
return arguments.length > 1 ?
$.effects.animateclass.call( this,
{ remove: classnames }, speed, easing, callback ) :
orig.apply( this, arguments );
};
})( $.fn.removeclass ),
toggleclass: (function( orig ) {
return function( classnames, force, speed, easing, callback ) {
if ( typeof force === "boolean" || force === undefined ) {
if ( !speed ) {
// without speed parameter
return orig.apply( this, arguments );
} else {
return $.effects.animateclass.call( this,
(force ? { add: classnames } : { remove: classnames }),
speed, easing, callback );
}
} else {
// without force parameter
return $.effects.animateclass.call( this,
{ toggle: classnames }, force, speed, easing );
}
};
})( $.fn.toggleclass ),
switchclass: function( remove, add, speed, easing, callback) {
return $.effects.animateclass.call( this, {
add: add,
remove: remove
}, speed, easing, callback );
}
});
})();
/******************************************************************************/
/*********************************** effects **********************************/
/******************************************************************************/
(function() {
$.extend( $.effects, {
version: "1.11.4",
// 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 = $( "
" )
.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 options as the first parameter
if ( $.isplainobject( effect ) ) {
options = effect;
effect = effect.effect;
}
// convert to an object
effect = { effect: effect };
// catch (effect, null, ...)
if ( options == null ) {
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 standardanimationoption( option ) {
// valid standard speeds (nothing, number, named speed)
if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
return true;
}
// invalid strings - treat as "normal" speed
if ( typeof option === "string" && !$.effects.effect[ option ] ) {
return true;
}
// complete callback
if ( $.isfunction( option ) ) {
return true;
}
// options hash (but not naming an effect)
if ( typeof option === "object" && !option.effect ) {
return true;
}
// didn't match any standard api
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 ];
if ( $.fx.off || !effectmethod ) {
// 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 already has the correct final state, delegate to
// the core methods so the internal tracking of "olddisplay" works.
if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
elem[ mode ]();
done();
} else {
effectmethod.call( elem[0], args, done );
}
}
return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
},
show: (function( orig ) {
return function( option ) {
if ( standardanimationoption( option ) ) {
return orig.apply( this, arguments );
} else {
var args = _normalizearguments.apply( this, arguments );
args.mode = "show";
return this.effect.call( this, args );
}
};
})( $.fn.show ),
hide: (function( orig ) {
return function( option ) {
if ( standardanimationoption( option ) ) {
return orig.apply( this, arguments );
} else {
var args = _normalizearguments.apply( this, arguments );
args.mode = "hide";
return this.effect.call( this, args );
}
};
})( $.fn.hide ),
toggle: (function( orig ) {
return function( option ) {
if ( standardanimationoption( option ) || typeof option === "boolean" ) {
return orig.apply( this, arguments );
} else {
var args = _normalizearguments.apply( this, arguments );
args.mode = "toggle";
return this.effect.call( this, args );
}
};
})( $.fn.toggle ),
// 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;
};
});
})();
var effect = $.effects;
/*!
* jquery ui effects blind 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/blind-effect/
*/
var effectblind = $.effects.effect.blind = function( o, done ) {
// create element
var el = $( this ),
rvertical = /up|down|vertical/,
rpositivemotion = /up|left|vertical|horizontal/,
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
mode = $.effects.setmode( el, o.mode || "hide" ),
direction = o.direction || "up",
vertical = rvertical.test( direction ),
ref = vertical ? "height" : "width",
ref2 = vertical ? "top" : "left",
motion = rpositivemotion.test( direction ),
animation = {},
show = mode === "show",
wrapper, distance, margin;
// if already wrapped, the wrapper's properties are my property. #6245
if ( el.parent().is( ".ui-effects-wrapper" ) ) {
$.effects.save( el.parent(), props );
} else {
$.effects.save( el, props );
}
el.show();
wrapper = $.effects.createwrapper( el ).css({
overflow: "hidden"
});
distance = wrapper[ ref ]();
margin = parsefloat( wrapper.css( ref2 ) ) || 0;
animation[ ref ] = show ? distance : 0;
if ( !motion ) {
el
.css( vertical ? "bottom" : "right", 0 )
.css( vertical ? "top" : "left", "auto" )
.css({ position: "absolute" });
animation[ ref2 ] = show ? margin : distance + margin;
}
// start at 0 if we are showing
if ( show ) {
wrapper.css( ref, 0 );
if ( !motion ) {
wrapper.css( ref2, margin + distance );
}
}
// animate
wrapper.animate( animation, {
duration: o.duration,
easing: o.easing,
queue: false,
complete: function() {
if ( mode === "hide" ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removewrapper( el );
done();
}
});
};
/*!
* jquery ui effects bounce 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/bounce-effect/
*/
var effectbounce = $.effects.effect.bounce = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
// defaults:
mode = $.effects.setmode( el, o.mode || "effect" ),
hide = mode === "hide",
show = mode === "show",
direction = o.direction || "up",
distance = o.distance,
times = o.times || 5,
// number of internal animations
anims = times * 2 + ( show || hide ? 1 : 0 ),
speed = o.duration / anims,
easing = o.easing,
// utility:
ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
motion = ( direction === "up" || direction === "left" ),
i,
upanim,
downanim,
// we will need to re-assemble the queue to stack our animations in place
queue = el.queue(),
queuelen = queue.length;
// avoid touching opacity to prevent cleartype and png issues in ie
if ( show || hide ) {
props.push( "opacity" );
}
$.effects.save( el, props );
el.show();
$.effects.createwrapper( el ); // create wrapper
// default distance for the biggest bounce is the outer distance / 3
if ( !distance ) {
distance = el[ ref === "top" ? "outerheight" : "outerwidth" ]() / 3;
}
if ( show ) {
downanim = { opacity: 1 };
downanim[ ref ] = 0;
// if we are showing, force opacity 0 and set the initial position
// then do the "first" animation
el.css( "opacity", 0 )
.css( ref, motion ? -distance * 2 : distance * 2 )
.animate( downanim, speed, easing );
}
// start at the smallest distance if we are hiding
if ( hide ) {
distance = distance / math.pow( 2, times - 1 );
}
downanim = {};
downanim[ ref ] = 0;
// bounces up/down/left/right then back to 0 -- times * 2 animations happen here
for ( i = 0; i < times; i++ ) {
upanim = {};
upanim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
el.animate( upanim, speed, easing )
.animate( downanim, speed, easing );
distance = hide ? distance * 2 : distance / 2;
}
// last bounce when hiding
if ( hide ) {
upanim = { opacity: 0 };
upanim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
el.animate( upanim, speed, easing );
}
el.queue(function() {
if ( hide ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removewrapper( el );
done();
});
// inject all the animations we just queued to be first in line (after "inprogress")
if ( queuelen > 1) {
queue.splice.apply( queue,
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
}
el.dequeue();
};
/*!
* jquery ui effects clip 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/clip-effect/
*/
var effectclip = $.effects.effect.clip = function( o, done ) {
// create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
mode = $.effects.setmode( el, o.mode || "hide" ),
show = mode === "show",
direction = o.direction || "vertical",
vert = direction === "vertical",
size = vert ? "height" : "width",
position = vert ? "top" : "left",
animation = {},
wrapper, animate, distance;
// save & show
$.effects.save( el, props );
el.show();
// create wrapper
wrapper = $.effects.createwrapper( el ).css({
overflow: "hidden"
});
animate = ( el[0].tagname === "img" ) ? wrapper : el;
distance = animate[ size ]();
// shift
if ( show ) {
animate.css( size, 0 );
animate.css( position, distance / 2 );
}
// create animation object:
animation[ size ] = show ? distance : 0;
animation[ position ] = show ? 0 : distance / 2;
// animate
animate.animate( animation, {
queue: false,
duration: o.duration,
easing: o.easing,
complete: function() {
if ( !show ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removewrapper( el );
done();
}
});
};
/*!
* jquery ui effects drop 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/drop-effect/
*/
var effectdrop = $.effects.effect.drop = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
mode = $.effects.setmode( el, o.mode || "hide" ),
show = mode === "show",
direction = o.direction || "left",
ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
animation = {
opacity: show ? 1 : 0
},
distance;
// adjust
$.effects.save( el, props );
el.show();
$.effects.createwrapper( el );
distance = o.distance || el[ ref === "top" ? "outerheight" : "outerwidth" ]( true ) / 2;
if ( show ) {
el
.css( "opacity", 0 )
.css( ref, motion === "pos" ? -distance : distance );
}
// animation
animation[ ref ] = ( show ?
( motion === "pos" ? "+=" : "-=" ) :
( motion === "pos" ? "-=" : "+=" ) ) +
distance;
// animate
el.animate( animation, {
queue: false,
duration: o.duration,
easing: o.easing,
complete: function() {
if ( mode === "hide" ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removewrapper( el );
done();
}
});
};
/*!
* jquery ui effects explode 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/explode-effect/
*/
var effectexplode = $.effects.effect.explode = function( o, done ) {
var rows = o.pieces ? math.round( math.sqrt( o.pieces ) ) : 3,
cells = rows,
el = $( this ),
mode = $.effects.setmode( el, o.mode || "hide" ),
show = mode === "show",
// show and then visibility:hidden the element before calculating offset
offset = el.show().css( "visibility", "hidden" ).offset(),
// width and height of a piece
width = math.ceil( el.outerwidth() / cells ),
height = math.ceil( el.outerheight() / rows ),
pieces = [],
// loop
i, j, left, top, mx, my;
// children animate complete:
function childcomplete() {
pieces.push( this );
if ( pieces.length === rows * cells ) {
animcomplete();
}
}
// clone the element for each row and cell.
for ( i = 0; i < rows ; i++ ) { // ===>
top = offset.top + i * height;
my = i - ( rows - 1 ) / 2 ;
for ( j = 0; j < cells ; j++ ) { // |||
left = offset.left + j * width;
mx = j - ( cells - 1 ) / 2 ;
// create a clone of the now hidden main element that will be absolute positioned
// within a wrapper div off the -left and -top equal to size of our pieces
el
.clone()
.appendto( "body" )
.wrap( "
" )
.css({
position: "absolute",
visibility: "visible",
left: -j * width,
top: -i * height
})
// select the wrapper - make it overflow: hidden and absolute positioned based on
// where the original was located +left and +top equal to the size of pieces
.parent()
.addclass( "ui-effects-explode" )
.css({
position: "absolute",
overflow: "hidden",
width: width,
height: height,
left: left + ( show ? mx * width : 0 ),
top: top + ( show ? my * height : 0 ),
opacity: show ? 0 : 1
}).animate({
left: left + ( show ? 0 : mx * width ),
top: top + ( show ? 0 : my * height ),
opacity: show ? 1 : 0
}, o.duration || 500, o.easing, childcomplete );
}
}
function animcomplete() {
el.css({
visibility: "visible"
});
$( pieces ).remove();
if ( !show ) {
el.hide();
}
done();
}
};
/*!
* jquery ui effects fade 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/fade-effect/
*/
var effectfade = $.effects.effect.fade = function( o, done ) {
var el = $( this ),
mode = $.effects.setmode( el, o.mode || "toggle" );
el.animate({
opacity: mode
}, {
queue: false,
duration: o.duration,
easing: o.easing,
complete: done
});
};
/*!
* jquery ui effects fold 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/fold-effect/
*/
var effectfold = $.effects.effect.fold = function( o, done ) {
// create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
mode = $.effects.setmode( el, o.mode || "hide" ),
show = mode === "show",
hide = mode === "hide",
size = o.size || 15,
percent = /([0-9]+)%/.exec( size ),
horizfirst = !!o.horizfirst,
widthfirst = show !== horizfirst,
ref = widthfirst ? [ "width", "height" ] : [ "height", "width" ],
duration = o.duration / 2,
wrapper, distance,
animation1 = {},
animation2 = {};
$.effects.save( el, props );
el.show();
// create wrapper
wrapper = $.effects.createwrapper( el ).css({
overflow: "hidden"
});
distance = widthfirst ?
[ wrapper.width(), wrapper.height() ] :
[ wrapper.height(), wrapper.width() ];
if ( percent ) {
size = parseint( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
}
if ( show ) {
wrapper.css( horizfirst ? {
height: 0,
width: size
} : {
height: size,
width: 0
});
}
// animation
animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
// animate
wrapper
.animate( animation1, duration, o.easing )
.animate( animation2, duration, o.easing, function() {
if ( hide ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removewrapper( el );
done();
});
};
/*!
* jquery ui effects highlight 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/highlight-effect/
*/
var effecthighlight = $.effects.effect.highlight = function( o, done ) {
var elem = $( this ),
props = [ "backgroundimage", "backgroundcolor", "opacity" ],
mode = $.effects.setmode( elem, o.mode || "show" ),
animation = {
backgroundcolor: elem.css( "backgroundcolor" )
};
if (mode === "hide") {
animation.opacity = 0;
}
$.effects.save( elem, props );
elem
.show()
.css({
backgroundimage: "none",
backgroundcolor: o.color || "#ffff99"
})
.animate( animation, {
queue: false,
duration: o.duration,
easing: o.easing,
complete: function() {
if ( mode === "hide" ) {
elem.hide();
}
$.effects.restore( elem, props );
done();
}
});
};
/*!
* jquery ui effects size 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/size-effect/
*/
var effectsize = $.effects.effect.size = function( o, done ) {
// create element
var original, baseline, factor,
el = $( this ),
props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
// always restore
props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
// copy for children
props2 = [ "width", "height", "overflow" ],
cprops = [ "fontsize" ],
vprops = [ "bordertopwidth", "borderbottomwidth", "paddingtop", "paddingbottom" ],
hprops = [ "borderleftwidth", "borderrightwidth", "paddingleft", "paddingright" ],
// set options
mode = $.effects.setmode( el, o.mode || "effect" ),
restore = o.restore || mode !== "effect",
scale = o.scale || "both",
origin = o.origin || [ "middle", "center" ],
position = el.css( "position" ),
props = restore ? props0 : props1,
zero = {
height: 0,
width: 0,
outerheight: 0,
outerwidth: 0
};
if ( mode === "show" ) {
el.show();
}
original = {
height: el.height(),
width: el.width(),
outerheight: el.outerheight(),
outerwidth: el.outerwidth()
};
if ( o.mode === "toggle" && mode === "show" ) {
el.from = o.to || zero;
el.to = o.from || original;
} else {
el.from = o.from || ( mode === "show" ? zero : original );
el.to = o.to || ( mode === "hide" ? zero : original );
}
// set scaling factor
factor = {
from: {
y: el.from.height / original.height,
x: el.from.width / original.width
},
to: {
y: el.to.height / original.height,
x: el.to.width / original.width
}
};
// scale the css box
if ( scale === "box" || scale === "both" ) {
// vertical props scaling
if ( factor.from.y !== factor.to.y ) {
props = props.concat( vprops );
el.from = $.effects.settransition( el, vprops, factor.from.y, el.from );
el.to = $.effects.settransition( el, vprops, factor.to.y, el.to );
}
// horizontal props scaling
if ( factor.from.x !== factor.to.x ) {
props = props.concat( hprops );
el.from = $.effects.settransition( el, hprops, factor.from.x, el.from );
el.to = $.effects.settransition( el, hprops, factor.to.x, el.to );
}
}
// scale the content
if ( scale === "content" || scale === "both" ) {
// vertical props scaling
if ( factor.from.y !== factor.to.y ) {
props = props.concat( cprops ).concat( props2 );
el.from = $.effects.settransition( el, cprops, factor.from.y, el.from );
el.to = $.effects.settransition( el, cprops, factor.to.y, el.to );
}
}
$.effects.save( el, props );
el.show();
$.effects.createwrapper( el );
el.css( "overflow", "hidden" ).css( el.from );
// adjust
if (origin) { // calculate baseline shifts
baseline = $.effects.getbaseline( origin, original );
el.from.top = ( original.outerheight - el.outerheight() ) * baseline.y;
el.from.left = ( original.outerwidth - el.outerwidth() ) * baseline.x;
el.to.top = ( original.outerheight - el.to.outerheight ) * baseline.y;
el.to.left = ( original.outerwidth - el.to.outerwidth ) * baseline.x;
}
el.css( el.from ); // set top & left
// animate
if ( scale === "content" || scale === "both" ) { // scale the children
// add margins/font-size
vprops = vprops.concat([ "margintop", "marginbottom" ]).concat(cprops);
hprops = hprops.concat([ "marginleft", "marginright" ]);
props2 = props0.concat(vprops).concat(hprops);
el.find( "*[width]" ).each( function() {
var child = $( this ),
c_original = {
height: child.height(),
width: child.width(),
outerheight: child.outerheight(),
outerwidth: child.outerwidth()
};
if (restore) {
$.effects.save(child, props2);
}
child.from = {
height: c_original.height * factor.from.y,
width: c_original.width * factor.from.x,
outerheight: c_original.outerheight * factor.from.y,
outerwidth: c_original.outerwidth * factor.from.x
};
child.to = {
height: c_original.height * factor.to.y,
width: c_original.width * factor.to.x,
outerheight: c_original.height * factor.to.y,
outerwidth: c_original.width * factor.to.x
};
// vertical props scaling
if ( factor.from.y !== factor.to.y ) {
child.from = $.effects.settransition( child, vprops, factor.from.y, child.from );
child.to = $.effects.settransition( child, vprops, factor.to.y, child.to );
}
// horizontal props scaling
if ( factor.from.x !== factor.to.x ) {
child.from = $.effects.settransition( child, hprops, factor.from.x, child.from );
child.to = $.effects.settransition( child, hprops, factor.to.x, child.to );
}
// animate children
child.css( child.from );
child.animate( child.to, o.duration, o.easing, function() {
// restore children
if ( restore ) {
$.effects.restore( child, props2 );
}
});
});
}
// animate
el.animate( el.to, {
queue: false,
duration: o.duration,
easing: o.easing,
complete: function() {
if ( el.to.opacity === 0 ) {
el.css( "opacity", el.from.opacity );
}
if ( mode === "hide" ) {
el.hide();
}
$.effects.restore( el, props );
if ( !restore ) {
// we need to calculate our new positioning based on the scaling
if ( position === "static" ) {
el.css({
position: "relative",
top: el.to.top,
left: el.to.left
});
} else {
$.each([ "top", "left" ], function( idx, pos ) {
el.css( pos, function( _, str ) {
var val = parseint( str, 10 ),
toref = idx ? el.to.left : el.to.top;
// if original was "auto", recalculate the new value from wrapper
if ( str === "auto" ) {
return toref + "px";
}
return val + toref + "px";
});
});
}
}
$.effects.removewrapper( el );
done();
}
});
};
/*!
* jquery ui effects scale 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/scale-effect/
*/
var effectscale = $.effects.effect.scale = function( o, done ) {
// create element
var el = $( this ),
options = $.extend( true, {}, o ),
mode = $.effects.setmode( el, o.mode || "effect" ),
percent = parseint( o.percent, 10 ) ||
( parseint( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
direction = o.direction || "both",
origin = o.origin,
original = {
height: el.height(),
width: el.width(),
outerheight: el.outerheight(),
outerwidth: el.outerwidth()
},
factor = {
y: direction !== "horizontal" ? (percent / 100) : 1,
x: direction !== "vertical" ? (percent / 100) : 1
};
// we are going to pass this effect to the size effect:
options.effect = "size";
options.queue = false;
options.complete = done;
// set default origin and restore for show/hide
if ( mode !== "effect" ) {
options.origin = origin || [ "middle", "center" ];
options.restore = true;
}
options.from = o.from || ( mode === "show" ? {
height: 0,
width: 0,
outerheight: 0,
outerwidth: 0
} : original );
options.to = {
height: original.height * factor.y,
width: original.width * factor.x,
outerheight: original.outerheight * factor.y,
outerwidth: original.outerwidth * factor.x
};
// fade option to support puff
if ( options.fade ) {
if ( mode === "show" ) {
options.from.opacity = 0;
options.to.opacity = 1;
}
if ( mode === "hide" ) {
options.from.opacity = 1;
options.to.opacity = 0;
}
}
// animate
el.effect( options );
};
/*!
* jquery ui effects puff 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/puff-effect/
*/
var effectpuff = $.effects.effect.puff = function( o, done ) {
var elem = $( this ),
mode = $.effects.setmode( elem, o.mode || "hide" ),
hide = mode === "hide",
percent = parseint( o.percent, 10 ) || 150,
factor = percent / 100,
original = {
height: elem.height(),
width: elem.width(),
outerheight: elem.outerheight(),
outerwidth: elem.outerwidth()
};
$.extend( o, {
effect: "scale",
queue: false,
fade: true,
mode: mode,
complete: done,
percent: hide ? percent : 100,
from: hide ?
original :
{
height: original.height * factor,
width: original.width * factor,
outerheight: original.outerheight * factor,
outerwidth: original.outerwidth * factor
}
});
elem.effect( o );
};
/*!
* jquery ui effects pulsate 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/pulsate-effect/
*/
var effectpulsate = $.effects.effect.pulsate = function( o, done ) {
var elem = $( this ),
mode = $.effects.setmode( elem, o.mode || "show" ),
show = mode === "show",
hide = mode === "hide",
showhide = ( show || mode === "hide" ),
// showing or hiding leaves of the "last" animation
anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
duration = o.duration / anims,
animateto = 0,
queue = elem.queue(),
queuelen = queue.length,
i;
if ( show || !elem.is(":visible")) {
elem.css( "opacity", 0 ).show();
animateto = 1;
}
// anims - 1 opacity "toggles"
for ( i = 1; i < anims; i++ ) {
elem.animate({
opacity: animateto
}, duration, o.easing );
animateto = 1 - animateto;
}
elem.animate({
opacity: animateto
}, duration, o.easing);
elem.queue(function() {
if ( hide ) {
elem.hide();
}
done();
});
// we just queued up "anims" animations, we need to put them next in the queue
if ( queuelen > 1 ) {
queue.splice.apply( queue,
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
}
elem.dequeue();
};
/*!
* jquery ui effects shake 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/shake-effect/
*/
var effectshake = $.effects.effect.shake = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
mode = $.effects.setmode( el, o.mode || "effect" ),
direction = o.direction || "left",
distance = o.distance || 20,
times = o.times || 3,
anims = times * 2 + 1,
speed = math.round( o.duration / anims ),
ref = (direction === "up" || direction === "down") ? "top" : "left",
positivemotion = (direction === "up" || direction === "left"),
animation = {},
animation1 = {},
animation2 = {},
i,
// we will need to re-assemble the queue to stack our animations in place
queue = el.queue(),
queuelen = queue.length;
$.effects.save( el, props );
el.show();
$.effects.createwrapper( el );
// animation
animation[ ref ] = ( positivemotion ? "-=" : "+=" ) + distance;
animation1[ ref ] = ( positivemotion ? "+=" : "-=" ) + distance * 2;
animation2[ ref ] = ( positivemotion ? "-=" : "+=" ) + distance * 2;
// animate
el.animate( animation, speed, o.easing );
// shakes
for ( i = 1; i < times; i++ ) {
el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
}
el
.animate( animation1, speed, o.easing )
.animate( animation, speed / 2, o.easing )
.queue(function() {
if ( mode === "hide" ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removewrapper( el );
done();
});
// inject all the animations we just queued to be first in line (after "inprogress")
if ( queuelen > 1) {
queue.splice.apply( queue,
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
}
el.dequeue();
};
/*!
* jquery ui effects slide 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/slide-effect/
*/
var effectslide = $.effects.effect.slide = function( o, done ) {
// create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
mode = $.effects.setmode( el, o.mode || "show" ),
show = mode === "show",
direction = o.direction || "left",
ref = (direction === "up" || direction === "down") ? "top" : "left",
positivemotion = (direction === "up" || direction === "left"),
distance,
animation = {};
// adjust
$.effects.save( el, props );
el.show();
distance = o.distance || el[ ref === "top" ? "outerheight" : "outerwidth" ]( true );
$.effects.createwrapper( el ).css({
overflow: "hidden"
});
if ( show ) {
el.css( ref, positivemotion ? (isnan(distance) ? "-" + distance : -distance) : distance );
}
// animation
animation[ ref ] = ( show ?
( positivemotion ? "+=" : "-=") :
( positivemotion ? "-=" : "+=")) +
distance;
// animate
el.animate( animation, {
queue: false,
duration: o.duration,
easing: o.easing,
complete: function() {
if ( mode === "hide" ) {
el.hide();
}
$.effects.restore( el, props );
$.effects.removewrapper( el );
done();
}
});
};
/*!
* jquery ui effects transfer 1.11.4
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/transfer-effect/
*/
var effecttransfer = $.effects.effect.transfer = function( o, done ) {
var elem = $( this ),
target = $( o.to ),
targetfixed = target.css( "position" ) === "fixed",
body = $("body"),
fixtop = targetfixed ? body.scrolltop() : 0,
fixleft = targetfixed ? body.scrollleft() : 0,
endposition = target.offset(),
animation = {
top: endposition.top - fixtop,
left: endposition.left - fixleft,
height: target.innerheight(),
width: target.innerwidth()
},
startposition = elem.offset(),
transfer = $( "
" )
.appendto( document.body )
.addclass( o.classname )
.css({
top: startposition.top - fixtop,
left: startposition.left - fixleft,
height: elem.innerheight(),
width: elem.innerwidth(),
position: targetfixed ? "fixed" : "absolute"
})
.animate( animation, o.duration, o.easing, function() {
transfer.remove();
done();
});
};
}));