Update of multiple frontend libs.
This commit is contained in:
parent
de261dbde5
commit
a9c6ddc03b
276 changed files with 41257 additions and 19300 deletions
308
app/bower_components/jquery/src/css.js
vendored
308
app/bower_components/jquery/src/css.js
vendored
|
@ -1,87 +1,107 @@
|
|||
define([
|
||||
define( [
|
||||
"./core",
|
||||
"./var/pnum",
|
||||
"./core/access",
|
||||
"./css/var/rmargin",
|
||||
"./var/document",
|
||||
"./var/rcssNum",
|
||||
"./css/var/rnumnonpx",
|
||||
"./css/var/cssExpand",
|
||||
"./css/var/isHidden",
|
||||
"./css/var/getStyles",
|
||||
"./css/var/swap",
|
||||
"./css/curCSS",
|
||||
"./css/defaultDisplay",
|
||||
"./css/adjustCSS",
|
||||
"./css/addGetHookIf",
|
||||
"./css/support",
|
||||
"./data/var/data_priv",
|
||||
|
||||
"./core/init",
|
||||
"./css/swap",
|
||||
"./core/ready",
|
||||
"./selector" // contains
|
||||
], function( jQuery, pnum, access, rmargin, rnumnonpx, cssExpand, isHidden,
|
||||
getStyles, curCSS, defaultDisplay, addGetHookIf, support, data_priv ) {
|
||||
], function( jQuery, pnum, access, rmargin, document, rcssNum, rnumnonpx, cssExpand,
|
||||
getStyles, swap, curCSS, adjustCSS, addGetHookIf, support ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var
|
||||
// Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
|
||||
|
||||
// Swappable if display is none or starts with table
|
||||
// except "table", "table-cell", or "table-caption"
|
||||
// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
||||
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
||||
rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
|
||||
rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
|
||||
|
||||
rcustomProp = /^--/,
|
||||
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
||||
cssNormalTransform = {
|
||||
letterSpacing: "0",
|
||||
fontWeight: "400"
|
||||
},
|
||||
|
||||
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
|
||||
cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
||||
emptyStyle = document.createElement( "div" ).style;
|
||||
|
||||
// Return a css property mapped to a potentially vendor prefixed property
|
||||
function vendorPropName( style, name ) {
|
||||
function vendorPropName( name ) {
|
||||
|
||||
// Shortcut for names that are not vendor prefixed
|
||||
if ( name in style ) {
|
||||
if ( name in emptyStyle ) {
|
||||
return name;
|
||||
}
|
||||
|
||||
// Check for vendor prefixed names
|
||||
var capName = name[0].toUpperCase() + name.slice(1),
|
||||
origName = name,
|
||||
var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
|
||||
i = cssPrefixes.length;
|
||||
|
||||
while ( i-- ) {
|
||||
name = cssPrefixes[ i ] + capName;
|
||||
if ( name in style ) {
|
||||
if ( name in emptyStyle ) {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return origName;
|
||||
// Return a property mapped along what jQuery.cssProps suggests or to
|
||||
// a vendor prefixed property.
|
||||
function finalPropName( name ) {
|
||||
var ret = jQuery.cssProps[ name ];
|
||||
if ( !ret ) {
|
||||
ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function setPositiveNumber( elem, value, subtract ) {
|
||||
var matches = rnumsplit.exec( value );
|
||||
|
||||
// Any relative (+/-) values have already been
|
||||
// normalized at this point
|
||||
var matches = rcssNum.exec( value );
|
||||
return matches ?
|
||||
|
||||
// Guard against undefined "subtract", e.g., when used as in cssHooks
|
||||
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
|
||||
Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
|
||||
value;
|
||||
}
|
||||
|
||||
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
|
||||
var i = extra === ( isBorderBox ? "border" : "content" ) ?
|
||||
// If we already have the right measurement, avoid augmentation
|
||||
4 :
|
||||
// Otherwise initialize for horizontal or vertical properties
|
||||
name === "width" ? 1 : 0,
|
||||
|
||||
var i,
|
||||
val = 0;
|
||||
|
||||
// If we already have the right measurement, avoid augmentation
|
||||
if ( extra === ( isBorderBox ? "border" : "content" ) ) {
|
||||
i = 4;
|
||||
|
||||
// Otherwise initialize for horizontal or vertical properties
|
||||
} else {
|
||||
i = name === "width" ? 1 : 0;
|
||||
}
|
||||
|
||||
for ( ; i < 4; i += 2 ) {
|
||||
|
||||
// Both box models exclude margin, so add it if we want it
|
||||
if ( extra === "margin" ) {
|
||||
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
|
||||
}
|
||||
|
||||
if ( isBorderBox ) {
|
||||
|
||||
// border-box includes padding, so remove it if we want content
|
||||
if ( extra === "content" ) {
|
||||
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
||||
|
@ -92,6 +112,7 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
|
|||
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
||||
}
|
||||
} else {
|
||||
|
||||
// At this point, extra isn't content, so add padding
|
||||
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
||||
|
||||
|
@ -107,36 +128,31 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
|
|||
|
||||
function getWidthOrHeight( elem, name, extra ) {
|
||||
|
||||
// Start with offset property, which is equivalent to the border-box value
|
||||
var valueIsBorderBox = true,
|
||||
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
||||
// Start with computed style
|
||||
var valueIsBorderBox,
|
||||
styles = getStyles( elem ),
|
||||
val = curCSS( elem, name, styles ),
|
||||
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
||||
|
||||
// Some non-html elements return undefined for offsetWidth, so check for null/undefined
|
||||
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
|
||||
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
|
||||
if ( val <= 0 || val == null ) {
|
||||
// Fall back to computed then uncomputed css if necessary
|
||||
val = curCSS( elem, name, styles );
|
||||
if ( val < 0 || val == null ) {
|
||||
val = elem.style[ name ];
|
||||
}
|
||||
|
||||
// Computed unit is not pixels. Stop here and return.
|
||||
if ( rnumnonpx.test(val) ) {
|
||||
return val;
|
||||
}
|
||||
|
||||
// Check for style in case a browser which returns unreliable values
|
||||
// for getComputedStyle silently falls back to the reliable elem.style
|
||||
valueIsBorderBox = isBorderBox &&
|
||||
( support.boxSizingReliable() || val === elem.style[ name ] );
|
||||
|
||||
// Normalize "", auto, and prepare for extra
|
||||
val = parseFloat( val ) || 0;
|
||||
// Computed unit is not pixels. Stop here and return.
|
||||
if ( rnumnonpx.test( val ) ) {
|
||||
return val;
|
||||
}
|
||||
|
||||
// Check for style in case a browser which returns unreliable values
|
||||
// for getComputedStyle silently falls back to the reliable elem.style
|
||||
valueIsBorderBox = isBorderBox &&
|
||||
( support.boxSizingReliable() || val === elem.style[ name ] );
|
||||
|
||||
// Fall back to offsetWidth/Height when value is "auto"
|
||||
// This happens for inline elements with no explicit setting (gh-3571)
|
||||
if ( val === "auto" ) {
|
||||
val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ];
|
||||
}
|
||||
|
||||
// Normalize "", auto, and prepare for extra
|
||||
val = parseFloat( val ) || 0;
|
||||
|
||||
// Use the active box-sizing model to add/subtract irrelevant styles
|
||||
return ( val +
|
||||
augmentWidthOrHeight(
|
||||
|
@ -149,58 +165,7 @@ function getWidthOrHeight( elem, name, extra ) {
|
|||
) + "px";
|
||||
}
|
||||
|
||||
function showHide( elements, show ) {
|
||||
var display, elem, hidden,
|
||||
values = [],
|
||||
index = 0,
|
||||
length = elements.length;
|
||||
|
||||
for ( ; index < length; index++ ) {
|
||||
elem = elements[ index ];
|
||||
if ( !elem.style ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
values[ index ] = data_priv.get( elem, "olddisplay" );
|
||||
display = elem.style.display;
|
||||
if ( show ) {
|
||||
// Reset the inline display of this element to learn if it is
|
||||
// being hidden by cascaded rules or not
|
||||
if ( !values[ index ] && display === "none" ) {
|
||||
elem.style.display = "";
|
||||
}
|
||||
|
||||
// Set elements which have been overridden with display: none
|
||||
// in a stylesheet to whatever the default browser style is
|
||||
// for such an element
|
||||
if ( elem.style.display === "" && isHidden( elem ) ) {
|
||||
values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
|
||||
}
|
||||
} else {
|
||||
hidden = isHidden( elem );
|
||||
|
||||
if ( display !== "none" || !hidden ) {
|
||||
data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the display of most of the elements in a second loop
|
||||
// to avoid the constant reflow
|
||||
for ( index = 0; index < length; index++ ) {
|
||||
elem = elements[ index ];
|
||||
if ( !elem.style ) {
|
||||
continue;
|
||||
}
|
||||
if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
|
||||
elem.style.display = show ? values[ index ] || "" : "none";
|
||||
}
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
||||
jQuery.extend({
|
||||
jQuery.extend( {
|
||||
|
||||
// Add in style property hooks for overriding the default
|
||||
// behavior of getting and setting a style property
|
||||
|
@ -219,6 +184,7 @@ jQuery.extend({
|
|||
|
||||
// Don't automatically add "px" to these possibly-unitless properties
|
||||
cssNumber: {
|
||||
"animationIterationCount": true,
|
||||
"columnCount": true,
|
||||
"fillOpacity": true,
|
||||
"flexGrow": true,
|
||||
|
@ -250,9 +216,15 @@ jQuery.extend({
|
|||
// Make sure that we're working with the right name
|
||||
var ret, type, hooks,
|
||||
origName = jQuery.camelCase( name ),
|
||||
isCustomProp = rcustomProp.test( name ),
|
||||
style = elem.style;
|
||||
|
||||
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
|
||||
// Make sure that we're working with the right name. We don't
|
||||
// want to query the value if it is a CSS custom property
|
||||
// since they are user-defined.
|
||||
if ( !isCustomProp ) {
|
||||
name = finalPropName( origName );
|
||||
}
|
||||
|
||||
// Gets hook for the prefixed version, then unprefixed version
|
||||
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
|
||||
|
@ -262,8 +234,9 @@ jQuery.extend({
|
|||
type = typeof value;
|
||||
|
||||
// Convert "+=" or "-=" to relative numbers (#7345)
|
||||
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
|
||||
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
|
||||
if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
|
||||
value = adjustCSS( elem, name, ret );
|
||||
|
||||
// Fixes bug #9237
|
||||
type = "number";
|
||||
}
|
||||
|
@ -273,25 +246,33 @@ jQuery.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
// If a number, add 'px' to the (except for certain CSS properties)
|
||||
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
|
||||
value += "px";
|
||||
// If a number was passed in, add the unit (except for certain CSS properties)
|
||||
if ( type === "number" ) {
|
||||
value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
|
||||
}
|
||||
|
||||
// Support: IE9-11+
|
||||
// background-* props affect original clone's values
|
||||
if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
|
||||
style[ name ] = "inherit";
|
||||
}
|
||||
|
||||
// If a hook was provided, use that value, otherwise just set the specified value
|
||||
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
|
||||
style[ name ] = value;
|
||||
if ( !hooks || !( "set" in hooks ) ||
|
||||
( value = hooks.set( elem, value, extra ) ) !== undefined ) {
|
||||
|
||||
if ( isCustomProp ) {
|
||||
style.setProperty( name, value );
|
||||
} else {
|
||||
style[ name ] = value;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// If a hook was provided get the non-computed value from there
|
||||
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
|
||||
if ( hooks && "get" in hooks &&
|
||||
( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -302,10 +283,15 @@ jQuery.extend({
|
|||
|
||||
css: function( elem, name, extra, styles ) {
|
||||
var val, num, hooks,
|
||||
origName = jQuery.camelCase( name );
|
||||
origName = jQuery.camelCase( name ),
|
||||
isCustomProp = rcustomProp.test( name );
|
||||
|
||||
// Make sure that we're working with the right name
|
||||
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
|
||||
// Make sure that we're working with the right name. We don't
|
||||
// want to modify the value if it is a CSS custom property
|
||||
// since they are user-defined.
|
||||
if ( !isCustomProp ) {
|
||||
name = finalPropName( origName );
|
||||
}
|
||||
|
||||
// Try prefixed name followed by the unprefixed name
|
||||
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
|
||||
|
@ -328,54 +314,75 @@ jQuery.extend({
|
|||
// Make numeric if forced or a qualifier was provided and val looks numeric
|
||||
if ( extra === "" || extra ) {
|
||||
num = parseFloat( val );
|
||||
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
|
||||
return extra === true || isFinite( num ) ? num || 0 : val;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
jQuery.each([ "height", "width" ], function( i, name ) {
|
||||
jQuery.each( [ "height", "width" ], function( i, name ) {
|
||||
jQuery.cssHooks[ name ] = {
|
||||
get: function( elem, computed, extra ) {
|
||||
if ( computed ) {
|
||||
|
||||
// Certain elements can have dimension info if we invisibly show them
|
||||
// but it must have a current display style that would benefit
|
||||
return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
|
||||
jQuery.swap( elem, cssShow, function() {
|
||||
return getWidthOrHeight( elem, name, extra );
|
||||
}) :
|
||||
getWidthOrHeight( elem, name, extra );
|
||||
return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
|
||||
|
||||
// Support: Safari 8+
|
||||
// Table columns in Safari have non-zero offsetWidth & zero
|
||||
// getBoundingClientRect().width unless display is changed.
|
||||
// Support: IE <=11 only
|
||||
// Running getBoundingClientRect on a disconnected node
|
||||
// in IE throws an error.
|
||||
( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
|
||||
swap( elem, cssShow, function() {
|
||||
return getWidthOrHeight( elem, name, extra );
|
||||
} ) :
|
||||
getWidthOrHeight( elem, name, extra );
|
||||
}
|
||||
},
|
||||
|
||||
set: function( elem, value, extra ) {
|
||||
var styles = extra && getStyles( elem );
|
||||
return setPositiveNumber( elem, value, extra ?
|
||||
augmentWidthOrHeight(
|
||||
var matches,
|
||||
styles = extra && getStyles( elem ),
|
||||
subtract = extra && augmentWidthOrHeight(
|
||||
elem,
|
||||
name,
|
||||
extra,
|
||||
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
||||
styles
|
||||
) : 0
|
||||
);
|
||||
);
|
||||
|
||||
// Convert to pixels if value adjustment is needed
|
||||
if ( subtract && ( matches = rcssNum.exec( value ) ) &&
|
||||
( matches[ 3 ] || "px" ) !== "px" ) {
|
||||
|
||||
elem.style[ name ] = value;
|
||||
value = jQuery.css( elem, name );
|
||||
}
|
||||
|
||||
return setPositiveNumber( elem, value, subtract );
|
||||
}
|
||||
};
|
||||
});
|
||||
} );
|
||||
|
||||
// Support: Android 2.3
|
||||
jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
|
||||
jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
|
||||
function( elem, computed ) {
|
||||
if ( computed ) {
|
||||
return jQuery.swap( elem, { "display": "inline-block" },
|
||||
curCSS, [ elem, "marginRight" ] );
|
||||
return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
|
||||
elem.getBoundingClientRect().left -
|
||||
swap( elem, { marginLeft: 0 }, function() {
|
||||
return elem.getBoundingClientRect().left;
|
||||
} )
|
||||
) + "px";
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// These hooks are used by animate to expand properties
|
||||
jQuery.each({
|
||||
jQuery.each( {
|
||||
margin: "",
|
||||
padding: "",
|
||||
border: "Width"
|
||||
|
@ -386,7 +393,7 @@ jQuery.each({
|
|||
expanded = {},
|
||||
|
||||
// Assumes a single number if not a string
|
||||
parts = typeof value === "string" ? value.split(" ") : [ value ];
|
||||
parts = typeof value === "string" ? value.split( " " ) : [ value ];
|
||||
|
||||
for ( ; i < 4; i++ ) {
|
||||
expanded[ prefix + cssExpand[ i ] + suffix ] =
|
||||
|
@ -400,16 +407,16 @@ jQuery.each({
|
|||
if ( !rmargin.test( prefix ) ) {
|
||||
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
jQuery.fn.extend({
|
||||
jQuery.fn.extend( {
|
||||
css: function( name, value ) {
|
||||
return access( this, function( elem, name, value ) {
|
||||
var styles, len,
|
||||
map = {},
|
||||
i = 0;
|
||||
|
||||
if ( jQuery.isArray( name ) ) {
|
||||
if ( Array.isArray( name ) ) {
|
||||
styles = getStyles( elem );
|
||||
len = name.length;
|
||||
|
||||
|
@ -424,27 +431,8 @@ jQuery.fn.extend({
|
|||
jQuery.style( elem, name, value ) :
|
||||
jQuery.css( elem, name );
|
||||
}, name, value, arguments.length > 1 );
|
||||
},
|
||||
show: function() {
|
||||
return showHide( this, true );
|
||||
},
|
||||
hide: function() {
|
||||
return showHide( this );
|
||||
},
|
||||
toggle: function( state ) {
|
||||
if ( typeof state === "boolean" ) {
|
||||
return state ? this.show() : this.hide();
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
if ( isHidden( this ) ) {
|
||||
jQuery( this ).show();
|
||||
} else {
|
||||
jQuery( this ).hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
||||
return jQuery;
|
||||
});
|
||||
} );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue