" )
.css({
position: "absolute",
width: iframe.outerwidth(),
height: iframe.outerheight()
})
.appendto( iframe.parent() )
.offset( iframe.offset() )[0];
});
},
_unblockframes: function() {
if ( this.iframeblocks ) {
this.iframeblocks.remove();
delete this.iframeblocks;
}
},
_allowinteraction: function( event ) {
if ( $( event.target ).closest( ".ui-dialog" ).length ) {
return true;
}
// todo: remove hack when datepicker implements
// the .ui-front logic (#8989)
return !!$( event.target ).closest( ".ui-datepicker" ).length;
},
_createoverlay: function() {
if ( !this.options.modal ) {
return;
}
// we use a delay in case the overlay is created from an
// event that we're going to be cancelling (#2804)
var isopening = true;
this._delay(function() {
isopening = false;
});
if ( !this.document.data( "ui-dialog-overlays" ) ) {
// prevent use of anchors and inputs
// using _on() for an event handler shared across many instances is
// safe because the dialogs stack and must be closed in reverse order
this._on( this.document, {
focusin: function( event ) {
if ( isopening ) {
return;
}
if ( !this._allowinteraction( event ) ) {
event.preventdefault();
this._trackinginstances()[ 0 ]._focustabbable();
}
}
});
}
this.overlay = $( "
" )
.addclass( "ui-widget-overlay ui-front" )
.appendto( this._appendto() );
this._on( this.overlay, {
mousedown: "_keepfocus"
});
this.document.data( "ui-dialog-overlays",
(this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
},
_destroyoverlay: function() {
if ( !this.options.modal ) {
return;
}
if ( this.overlay ) {
var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
if ( !overlays ) {
this.document
.unbind( "focusin" )
.removedata( "ui-dialog-overlays" );
} else {
this.document.data( "ui-dialog-overlays", overlays );
}
this.overlay.remove();
this.overlay = null;
}
}
});
/*!
* jquery ui droppable 1.11.3
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/droppable/
*/
$.widget( "ui.droppable", {
version: "1.11.3",
widgeteventprefix: "drop",
options: {
accept: "*",
activeclass: false,
addclasses: true,
greedy: false,
hoverclass: false,
scope: "default",
tolerance: "intersect",
// callbacks
activate: null,
deactivate: null,
drop: null,
out: null,
over: null
},
_create: function() {
var proportions,
o = this.options,
accept = o.accept;
this.isover = false;
this.isout = true;
this.accept = $.isfunction( accept ) ? accept : function( d ) {
return d.is( accept );
};
this.proportions = function( /* valuetowrite */ ) {
if ( arguments.length ) {
// store the droppable's proportions
proportions = arguments[ 0 ];
} else {
// retrieve or derive the droppable's proportions
return proportions ?
proportions :
proportions = {
width: this.element[ 0 ].offsetwidth,
height: this.element[ 0 ].offsetheight
};
}
};
this._addtomanager( o.scope );
o.addclasses && this.element.addclass( "ui-droppable" );
},
_addtomanager: function( scope ) {
// add the reference and positions to the manager
$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
$.ui.ddmanager.droppables[ scope ].push( this );
},
_splice: function( drop ) {
var i = 0;
for ( ; i < drop.length; i++ ) {
if ( drop[ i ] === this ) {
drop.splice( i, 1 );
}
}
},
_destroy: function() {
var drop = $.ui.ddmanager.droppables[ this.options.scope ];
this._splice( drop );
this.element.removeclass( "ui-droppable ui-droppable-disabled" );
},
_setoption: function( key, value ) {
if ( key === "accept" ) {
this.accept = $.isfunction( value ) ? value : function( d ) {
return d.is( value );
};
} else if ( key === "scope" ) {
var drop = $.ui.ddmanager.droppables[ this.options.scope ];
this._splice( drop );
this._addtomanager( value );
}
this._super( key, value );
},
_activate: function( event ) {
var draggable = $.ui.ddmanager.current;
if ( this.options.activeclass ) {
this.element.addclass( this.options.activeclass );
}
if ( draggable ){
this._trigger( "activate", event, this.ui( draggable ) );
}
},
_deactivate: function( event ) {
var draggable = $.ui.ddmanager.current;
if ( this.options.activeclass ) {
this.element.removeclass( this.options.activeclass );
}
if ( draggable ){
this._trigger( "deactivate", event, this.ui( draggable ) );
}
},
_over: function( event ) {
var draggable = $.ui.ddmanager.current;
// bail if draggable and droppable are same element
if ( !draggable || ( draggable.currentitem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
return;
}
if ( this.accept.call( this.element[ 0 ], ( draggable.currentitem || draggable.element ) ) ) {
if ( this.options.hoverclass ) {
this.element.addclass( this.options.hoverclass );
}
this._trigger( "over", event, this.ui( draggable ) );
}
},
_out: function( event ) {
var draggable = $.ui.ddmanager.current;
// bail if draggable and droppable are same element
if ( !draggable || ( draggable.currentitem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
return;
}
if ( this.accept.call( this.element[ 0 ], ( draggable.currentitem || draggable.element ) ) ) {
if ( this.options.hoverclass ) {
this.element.removeclass( this.options.hoverclass );
}
this._trigger( "out", event, this.ui( draggable ) );
}
},
_drop: function( event, custom ) {
var draggable = custom || $.ui.ddmanager.current,
childrenintersection = false;
// bail if draggable and droppable are same element
if ( !draggable || ( draggable.currentitem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
return false;
}
this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
var inst = $( this ).droppable( "instance" );
if (
inst.options.greedy &&
!inst.options.disabled &&
inst.options.scope === draggable.options.scope &&
inst.accept.call( inst.element[ 0 ], ( draggable.currentitem || draggable.element ) ) &&
$.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
) { childrenintersection = true; return false; }
});
if ( childrenintersection ) {
return false;
}
if ( this.accept.call( this.element[ 0 ], ( draggable.currentitem || draggable.element ) ) ) {
if ( this.options.activeclass ) {
this.element.removeclass( this.options.activeclass );
}
if ( this.options.hoverclass ) {
this.element.removeclass( this.options.hoverclass );
}
this._trigger( "drop", event, this.ui( draggable ) );
return this.element;
}
return false;
},
ui: function( c ) {
return {
draggable: ( c.currentitem || c.element ),
helper: c.helper,
position: c.position,
offset: c.positionabs
};
}
});
$.ui.intersect = (function() {
function isoveraxis( x, reference, size ) {
return ( x >= reference ) && ( x < ( reference + size ) );
}
return function( draggable, droppable, tolerancemode, event ) {
if ( !droppable.offset ) {
return false;
}
var x1 = ( draggable.positionabs || draggable.position.absolute ).left + draggable.margins.left,
y1 = ( draggable.positionabs || draggable.position.absolute ).top + draggable.margins.top,
x2 = x1 + draggable.helperproportions.width,
y2 = y1 + draggable.helperproportions.height,
l = droppable.offset.left,
t = droppable.offset.top,
r = l + droppable.proportions().width,
b = t + droppable.proportions().height;
switch ( tolerancemode ) {
case "fit":
return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
case "intersect":
return ( l < x1 + ( draggable.helperproportions.width / 2 ) && // right half
x2 - ( draggable.helperproportions.width / 2 ) < r && // left half
t < y1 + ( draggable.helperproportions.height / 2 ) && // bottom half
y2 - ( draggable.helperproportions.height / 2 ) < b ); // top half
case "pointer":
return isoveraxis( event.pagey, t, droppable.proportions().height ) && isoveraxis( event.pagex, l, droppable.proportions().width );
case "touch":
return (
( y1 >= t && y1 <= b ) || // top edge touching
( y2 >= t && y2 <= b ) || // bottom edge touching
( y1 < t && y2 > b ) // surrounded vertically
) && (
( x1 >= l && x1 <= r ) || // left edge touching
( x2 >= l && x2 <= r ) || // right edge touching
( x1 < l && x2 > r ) // surrounded horizontally
);
default:
return false;
}
};
})();
/*
this manager tracks offsets of draggables and droppables
*/
$.ui.ddmanager = {
current: null,
droppables: { "default": [] },
prepareoffsets: function( t, event ) {
var i, j,
m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
type = event ? event.type : null, // workaround for #2317
list = ( t.currentitem || t.element ).find( ":data(ui-droppable)" ).addback();
droppablesloop: for ( i = 0; i < m.length; i++ ) {
// no disabled and non-accepted
if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentitem || t.element ) ) ) ) {
continue;
}
// filter out elements in the current dragged item
for ( j = 0; j < list.length; j++ ) {
if ( list[ j ] === m[ i ].element[ 0 ] ) {
m[ i ].proportions().height = 0;
continue droppablesloop;
}
}
m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
if ( !m[ i ].visible ) {
continue;
}
// activate the droppable if used directly from draggables
if ( type === "mousedown" ) {
m[ i ]._activate.call( m[ i ], event );
}
m[ i ].offset = m[ i ].element.offset();
m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetwidth, height: m[ i ].element[ 0 ].offsetheight });
}
},
drop: function( draggable, event ) {
var dropped = false;
// create a copy of the droppables in case the list changes during the drop (#9116)
$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
if ( !this.options ) {
return;
}
if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
dropped = this._drop.call( this, event ) || dropped;
}
if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentitem || draggable.element ) ) ) {
this.isout = true;
this.isover = false;
this._deactivate.call( this, event );
}
});
return dropped;
},
dragstart: function( draggable, event ) {
// listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
draggable.element.parentsuntil( "body" ).bind( "scroll.droppable", function() {
if ( !draggable.options.refreshpositions ) {
$.ui.ddmanager.prepareoffsets( draggable, event );
}
});
},
drag: function( draggable, event ) {
// if you have a highly dynamic page, you might try this option. it renders positions every time you move the mouse.
if ( draggable.options.refreshpositions ) {
$.ui.ddmanager.prepareoffsets( draggable, event );
}
// run through all droppables and check their positions based on specific tolerance options
$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
if ( this.options.disabled || this.greedychild || !this.visible ) {
return;
}
var parentinstance, scope, parent,
intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
if ( !c ) {
return;
}
if ( this.options.greedy ) {
// find droppable parents with same scope
scope = this.options.scope;
parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
return $( this ).droppable( "instance" ).options.scope === scope;
});
if ( parent.length ) {
parentinstance = $( parent[ 0 ] ).droppable( "instance" );
parentinstance.greedychild = ( c === "isover" );
}
}
// we just moved into a greedy child
if ( parentinstance && c === "isover" ) {
parentinstance.isover = false;
parentinstance.isout = true;
parentinstance._out.call( parentinstance, event );
}
this[ c ] = true;
this[c === "isout" ? "isover" : "isout"] = false;
this[c === "isover" ? "_over" : "_out"].call( this, event );
// we just moved out of a greedy child
if ( parentinstance && c === "isout" ) {
parentinstance.isout = false;
parentinstance.isover = true;
parentinstance._over.call( parentinstance, event );
}
});
},
dragstop: function( draggable, event ) {
draggable.element.parentsuntil( "body" ).unbind( "scroll.droppable" );
// call prepareoffsets one final time since ie does not fire return scroll events when overflow was caused by drag (see #5003)
if ( !draggable.options.refreshpositions ) {
$.ui.ddmanager.prepareoffsets( draggable, event );
}
}
};
var droppable = $.ui.droppable;
/*!
* jquery ui effects 1.11.3
* 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.3",
// 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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.3
* 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();
});
};
/*!
* jquery ui progressbar 1.11.3
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/progressbar/
*/
var progressbar = $.widget( "ui.progressbar", {
version: "1.11.3",
options: {
max: 100,
value: 0,
change: null,
complete: null
},
min: 0,
_create: function() {
// constrain initial value
this.oldvalue = this.options.value = this._constrainedvalue();
this.element
.addclass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
.attr({
// only set static values, aria-valuenow and aria-valuemax are
// set inside _refreshvalue()
role: "progressbar",
"aria-valuemin": this.min
});
this.valuediv = $( "" )
.appendto( this.element );
this._refreshvalue();
},
_destroy: function() {
this.element
.removeclass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
.removeattr( "role" )
.removeattr( "aria-valuemin" )
.removeattr( "aria-valuemax" )
.removeattr( "aria-valuenow" );
this.valuediv.remove();
},
value: function( newvalue ) {
if ( newvalue === undefined ) {
return this.options.value;
}
this.options.value = this._constrainedvalue( newvalue );
this._refreshvalue();
},
_constrainedvalue: function( newvalue ) {
if ( newvalue === undefined ) {
newvalue = this.options.value;
}
this.indeterminate = newvalue === false;
// sanitize value
if ( typeof newvalue !== "number" ) {
newvalue = 0;
}
return this.indeterminate ? false :
math.min( this.options.max, math.max( this.min, newvalue ) );
},
_setoptions: function( options ) {
// ensure "value" option is set after other values (like max)
var value = options.value;
delete options.value;
this._super( options );
this.options.value = this._constrainedvalue( value );
this._refreshvalue();
},
_setoption: function( key, value ) {
if ( key === "max" ) {
// don't allow a max less than min
value = math.max( this.min, value );
}
if ( key === "disabled" ) {
this.element
.toggleclass( "ui-state-disabled", !!value )
.attr( "aria-disabled", value );
}
this._super( key, value );
},
_percentage: function() {
return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
},
_refreshvalue: function() {
var value = this.options.value,
percentage = this._percentage();
this.valuediv
.toggle( this.indeterminate || value > this.min )
.toggleclass( "ui-corner-right", value === this.options.max )
.width( percentage.tofixed(0) + "%" );
this.element.toggleclass( "ui-progressbar-indeterminate", this.indeterminate );
if ( this.indeterminate ) {
this.element.removeattr( "aria-valuenow" );
if ( !this.overlaydiv ) {
this.overlaydiv = $( "
" ).appendto( this.valuediv );
}
} else {
this.element.attr({
"aria-valuemax": this.options.max,
"aria-valuenow": value
});
if ( this.overlaydiv ) {
this.overlaydiv.remove();
this.overlaydiv = null;
}
}
if ( this.oldvalue !== value ) {
this.oldvalue = value;
this._trigger( "change" );
}
if ( value === this.options.max ) {
this._trigger( "complete" );
}
}
});
/*!
* jquery ui selectable 1.11.3
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/selectable/
*/
var selectable = $.widget("ui.selectable", $.ui.mouse, {
version: "1.11.3",
options: {
appendto: "body",
autorefresh: true,
distance: 0,
filter: "*",
tolerance: "touch",
// callbacks
selected: null,
selecting: null,
start: null,
stop: null,
unselected: null,
unselecting: null
},
_create: function() {
var selectees,
that = this;
this.element.addclass("ui-selectable");
this.dragged = false;
// cache selectee children based on filter
this.refresh = function() {
selectees = $(that.options.filter, that.element[0]);
selectees.addclass("ui-selectee");
selectees.each(function() {
var $this = $(this),
pos = $this.offset();
$.data(this, "selectable-item", {
element: this,
$element: $this,
left: pos.left,
top: pos.top,
right: pos.left + $this.outerwidth(),
bottom: pos.top + $this.outerheight(),
startselected: false,
selected: $this.hasclass("ui-selected"),
selecting: $this.hasclass("ui-selecting"),
unselecting: $this.hasclass("ui-unselecting")
});
});
};
this.refresh();
this.selectees = selectees.addclass("ui-selectee");
this._mouseinit();
this.helper = $("
");
},
_destroy: function() {
this.selectees
.removeclass("ui-selectee")
.removedata("selectable-item");
this.element
.removeclass("ui-selectable ui-selectable-disabled");
this._mousedestroy();
},
_mousestart: function(event) {
var that = this,
options = this.options;
this.opos = [ event.pagex, event.pagey ];
if (this.options.disabled) {
return;
}
this.selectees = $(options.filter, this.element[0]);
this._trigger("start", event);
$(options.appendto).append(this.helper);
// position helper (lasso)
this.helper.css({
"left": event.pagex,
"top": event.pagey,
"width": 0,
"height": 0
});
if (options.autorefresh) {
this.refresh();
}
this.selectees.filter(".ui-selected").each(function() {
var selectee = $.data(this, "selectable-item");
selectee.startselected = true;
if (!event.metakey && !event.ctrlkey) {
selectee.$element.removeclass("ui-selected");
selectee.selected = false;
selectee.$element.addclass("ui-unselecting");
selectee.unselecting = true;
// selectable unselecting callback
that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
});
$(event.target).parents().addback().each(function() {
var doselect,
selectee = $.data(this, "selectable-item");
if (selectee) {
doselect = (!event.metakey && !event.ctrlkey) || !selectee.$element.hasclass("ui-selected");
selectee.$element
.removeclass(doselect ? "ui-unselecting" : "ui-selected")
.addclass(doselect ? "ui-selecting" : "ui-unselecting");
selectee.unselecting = !doselect;
selectee.selecting = doselect;
selectee.selected = doselect;
// selectable (un)selecting callback
if (doselect) {
that._trigger("selecting", event, {
selecting: selectee.element
});
} else {
that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
return false;
}
});
},
_mousedrag: function(event) {
this.dragged = true;
if (this.options.disabled) {
return;
}
var tmp,
that = this,
options = this.options,
x1 = this.opos[0],
y1 = this.opos[1],
x2 = event.pagex,
y2 = event.pagey;
if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
this.selectees.each(function() {
var selectee = $.data(this, "selectable-item"),
hit = false;
//prevent helper from being selected if appendto: selectable
if (!selectee || selectee.element === that.element[0]) {
return;
}
if (options.tolerance === "touch") {
hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
} else if (options.tolerance === "fit") {
hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
}
if (hit) {
// select
if (selectee.selected) {
selectee.$element.removeclass("ui-selected");
selectee.selected = false;
}
if (selectee.unselecting) {
selectee.$element.removeclass("ui-unselecting");
selectee.unselecting = false;
}
if (!selectee.selecting) {
selectee.$element.addclass("ui-selecting");
selectee.selecting = true;
// selectable selecting callback
that._trigger("selecting", event, {
selecting: selectee.element
});
}
} else {
// unselect
if (selectee.selecting) {
if ((event.metakey || event.ctrlkey) && selectee.startselected) {
selectee.$element.removeclass("ui-selecting");
selectee.selecting = false;
selectee.$element.addclass("ui-selected");
selectee.selected = true;
} else {
selectee.$element.removeclass("ui-selecting");
selectee.selecting = false;
if (selectee.startselected) {
selectee.$element.addclass("ui-unselecting");
selectee.unselecting = true;
}
// selectable unselecting callback
that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
}
if (selectee.selected) {
if (!event.metakey && !event.ctrlkey && !selectee.startselected) {
selectee.$element.removeclass("ui-selected");
selectee.selected = false;
selectee.$element.addclass("ui-unselecting");
selectee.unselecting = true;
// selectable unselecting callback
that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
}
}
});
return false;
},
_mousestop: function(event) {
var that = this;
this.dragged = false;
$(".ui-unselecting", this.element[0]).each(function() {
var selectee = $.data(this, "selectable-item");
selectee.$element.removeclass("ui-unselecting");
selectee.unselecting = false;
selectee.startselected = false;
that._trigger("unselected", event, {
unselected: selectee.element
});
});
$(".ui-selecting", this.element[0]).each(function() {
var selectee = $.data(this, "selectable-item");
selectee.$element.removeclass("ui-selecting").addclass("ui-selected");
selectee.selecting = false;
selectee.selected = true;
selectee.startselected = true;
that._trigger("selected", event, {
selected: selectee.element
});
});
this._trigger("stop", event);
this.helper.remove();
return false;
}
});
/*!
* jquery ui selectmenu 1.11.3
* http://jqueryui.com
*
* copyright jquery foundation and other contributors
* released under the mit license.
* http://jquery.org/license
*
* http://api.jqueryui.com/selectmenu
*/
var selectmenu = $.widget( "ui.selectmenu", {
version: "1.11.3",
defaultelement: "