foundation-sites
Advanced tools
Comparing version 6.2.3 to 6.2.4-rc1
@@ -22,5 +22,4 @@ 'use strict'; | ||
*/ | ||
function Abide(element) { | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -27,0 +26,0 @@ _classCallCheck(this, Abide); |
@@ -24,3 +24,2 @@ 'use strict'; | ||
*/ | ||
function Accordion(element, options) { | ||
@@ -93,11 +92,4 @@ _classCallCheck(this, Accordion); | ||
$elem.children('a').off('click.zf.accordion keydown.zf.accordion').on('click.zf.accordion', function (e) { | ||
// $(this).children('a').on('click.zf.accordion', function(e) { | ||
e.preventDefault(); | ||
if ($elem.hasClass('is-active')) { | ||
if (_this.options.allowAllClosed || $elem.siblings().hasClass('is-active')) { | ||
_this.up($tabContent); | ||
} | ||
} else { | ||
_this.down($tabContent); | ||
} | ||
_this.toggle($tabContent); | ||
}).on('keydown.zf.accordion', function (e) { | ||
@@ -132,3 +124,3 @@ Foundation.Keyboard.handleKey(e, 'Accordion', { | ||
* Toggles the selected content pane's open/close state. | ||
* @param {jQuery} $target - jQuery object of the pane to toggle. | ||
* @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`). | ||
* @function | ||
@@ -141,7 +133,3 @@ */ | ||
if ($target.parent().hasClass('is-active')) { | ||
if (this.options.allowAllClosed || $target.parent().siblings().hasClass('is-active')) { | ||
this.up($target); | ||
} else { | ||
return; | ||
} | ||
this.up($target); | ||
} else { | ||
@@ -154,3 +142,3 @@ this.down($target); | ||
* Opens the accordion tab defined by `$target`. | ||
* @param {jQuery} $target - Accordion pane to open. | ||
* @param {jQuery} $target - Accordion pane to open (`.accordion-content`). | ||
* @param {Boolean} firstTime - flag to determine if reflow should happen. | ||
@@ -166,11 +154,11 @@ * @fires Accordion#down | ||
$target.attr('aria-hidden', false).parent('[data-tab-content]').addBack().parent().addClass('is-active'); | ||
if (!this.options.multiExpand && !firstTime) { | ||
var $currentActive = this.$element.children('.is-active').children('[data-tab-content]'); | ||
if ($currentActive.length) { | ||
this.up($currentActive); | ||
this.up($currentActive.not($target)); | ||
} | ||
} | ||
$target.attr('aria-hidden', false).parent('[data-tab-content]').addBack().parent().addClass('is-active'); | ||
$target.slideDown(this.options.slideSpeed, function () { | ||
@@ -192,3 +180,3 @@ /** | ||
* Closes the tab defined by `$target`. | ||
* @param {jQuery} $target - Accordion tab to close. | ||
* @param {jQuery} $target - Accordion tab to close (`.accordion-content`). | ||
* @fires Accordion#up | ||
@@ -203,5 +191,4 @@ * @function | ||
_this = this; | ||
var canClose = this.options.multiExpand ? $aunts.hasClass('is-active') : $target.parent().hasClass('is-active'); | ||
if (!this.options.allowAllClosed && !canClose) { | ||
if (!this.options.allowAllClosed && !$aunts.hasClass('is-active') || !$target.parent().hasClass('is-active')) { | ||
return; | ||
@@ -208,0 +195,0 @@ } |
@@ -25,3 +25,2 @@ 'use strict'; | ||
*/ | ||
function AccordionMenu(element, options) { | ||
@@ -45,5 +44,3 @@ _classCallCheck(this, AccordionMenu); | ||
'ARROW_LEFT': 'close', | ||
'ESCAPE': 'closeAll', | ||
'TAB': 'down', | ||
'SHIFT_TAB': 'up' | ||
'ESCAPE': 'closeAll' | ||
}); | ||
@@ -148,2 +145,3 @@ } | ||
}); | ||
Foundation.Keyboard.handleKey(e, 'AccordionMenu', { | ||
@@ -167,7 +165,7 @@ open: function () { | ||
up: function () { | ||
$prevElement.attr('tabindex', -1).focus(); | ||
$prevElement.focus(); | ||
return true; | ||
}, | ||
down: function () { | ||
$nextElement.attr('tabindex', -1).focus(); | ||
$nextElement.focus(); | ||
return true; | ||
@@ -174,0 +172,0 @@ }, |
@@ -5,3 +5,3 @@ !function ($) { | ||
var FOUNDATION_VERSION = '6.2.2'; | ||
var FOUNDATION_VERSION = '6.2.4-rc1'; | ||
@@ -8,0 +8,0 @@ // Global Foundation object |
@@ -24,3 +24,2 @@ 'use strict'; | ||
*/ | ||
function Drilldown(element, options) { | ||
@@ -89,3 +88,3 @@ _classCallCheck(this, Drilldown); | ||
} | ||
$link.data('savedHref', $link.attr('href')).removeAttr('href'); | ||
$link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0); | ||
$link.children('[data-submenu]').attr({ | ||
@@ -214,2 +213,3 @@ 'aria-hidden': true, | ||
}); | ||
return true; | ||
} else if ($element.is(_this.$submenuAnchors)) { | ||
@@ -220,4 +220,4 @@ _this._show($element.parent('li')); | ||
}); | ||
return true; | ||
} | ||
return true; | ||
}, | ||
@@ -270,2 +270,8 @@ handled: function (preventDefault) { | ||
_this._hide($elem); | ||
// If there is a parent submenu, call show | ||
var parentSubMenu = $elem.parent('li').parent('ul').parent('li'); | ||
if (parentSubMenu.length) { | ||
_this._show(parentSubMenu); | ||
} | ||
}); | ||
@@ -302,3 +308,4 @@ } | ||
value: function _show($elem) { | ||
$elem.children('[data-submenu]').addClass('is-active'); | ||
$elem.attr('aria-expanded', true); | ||
$elem.children('[data-submenu]').addClass('is-active').attr('aria-hidden', false); | ||
/** | ||
@@ -322,3 +329,4 @@ * Fires when the submenu has opened. | ||
var _this = this; | ||
$elem.addClass('is-closing').one(Foundation.transitionend($elem), function () { | ||
$elem.parent('li').attr('aria-expanded', false); | ||
$elem.attr('aria-hidden', true).addClass('is-closing').one(Foundation.transitionend($elem), function () { | ||
$elem.removeClass('is-active is-closing'); | ||
@@ -344,10 +352,11 @@ $elem.blur(); | ||
value: function _getMaxDims() { | ||
var max = 0, | ||
result = {}; | ||
this.$submenus.add(this.$element).each(function () { | ||
var numOfElems = $(this).children('li').length; | ||
max = numOfElems > max ? numOfElems : max; | ||
var biggest = 0; | ||
var result = {}; | ||
this.$submenus.add(this.$element).each(function (i, elem) { | ||
var height = elem.getBoundingClientRect().height; | ||
if (height > biggest) biggest = height; | ||
}); | ||
result['min-height'] = max * this.$menuItems[0].getBoundingClientRect().height + 'px'; | ||
result['min-height'] = biggest + 'px'; | ||
result['max-width'] = this.$element[0].getBoundingClientRect().width + 'px'; | ||
@@ -374,2 +383,3 @@ | ||
var $link = $(this); | ||
$link.removeAttr('tabindex'); | ||
if ($link.data('savedHref')) { | ||
@@ -376,0 +386,0 @@ $link.attr('href', $link.data('savedHref')).removeData('savedHref'); |
@@ -25,3 +25,2 @@ 'use strict'; | ||
*/ | ||
function Dropdown(element, options) { | ||
@@ -56,3 +55,3 @@ _classCallCheck(this, Dropdown); | ||
this.$anchor = $('[data-toggle="' + $id + '"]') || $('[data-open="' + $id + '"]'); | ||
this.$anchor = $('[data-toggle="' + $id + '"]').length ? $('[data-toggle="' + $id + '"]') : $('[data-open="' + $id + '"]'); | ||
this.$anchor.attr({ | ||
@@ -90,5 +89,6 @@ 'aria-controls': $id, | ||
verticalPosition = verticalPosition ? verticalPosition[0] : ''; | ||
var horizontalPosition = /float-(\S+)\s/.exec(this.$anchor[0].className); | ||
var horizontalPosition = /float-(\S+)/.exec(this.$anchor[0].className); | ||
horizontalPosition = horizontalPosition ? horizontalPosition[1] : ''; | ||
var position = horizontalPosition ? horizontalPosition + ' ' + verticalPosition : verticalPosition; | ||
return position; | ||
@@ -194,7 +194,9 @@ } | ||
this.$anchor.off('mouseenter.zf.dropdown mouseleave.zf.dropdown').on('mouseenter.zf.dropdown', function () { | ||
clearTimeout(_this.timeout); | ||
_this.timeout = setTimeout(function () { | ||
_this.open(); | ||
_this.$anchor.data('hover', true); | ||
}, _this.options.hoverDelay); | ||
if ($('body[data-whatinput="mouse"]').is('*')) { | ||
clearTimeout(_this.timeout); | ||
_this.timeout = setTimeout(function () { | ||
_this.open(); | ||
_this.$anchor.data('hover', true); | ||
}, _this.options.hoverDelay); | ||
} | ||
}).on('mouseleave.zf.dropdown', function () { | ||
@@ -201,0 +203,0 @@ clearTimeout(_this.timeout); |
@@ -25,3 +25,2 @@ 'use strict'; | ||
*/ | ||
function DropdownMenu(element, options) { | ||
@@ -106,6 +105,9 @@ _classCallCheck(this, DropdownMenu); | ||
e.stopImmediatePropagation(); | ||
_this._show($elem.children('.is-dropdown-submenu')); | ||
_this._show($sub); | ||
$elem.add($elem.parentsUntil(_this.$element, '.' + parClass)).attr('data-is-click', true); | ||
} | ||
} else { | ||
if (_this.options.closeOnClickInside) { | ||
_this._hide($elem); | ||
} | ||
return; | ||
@@ -428,2 +430,8 @@ } | ||
/** | ||
* Allow clicks on leaf anchor links to close any open submenus. | ||
* @option | ||
* @example true | ||
*/ | ||
closeOnClickInside: true, | ||
/** | ||
* Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class. | ||
@@ -430,0 +438,0 @@ * @option |
@@ -12,2 +12,4 @@ 'use strict'; | ||
* @module foundation.equalizer | ||
* @requires foundation.util.mediaQuery | ||
* @requires foundation.util.timerAndImageLoader if equalizer contains images | ||
*/ | ||
@@ -23,3 +25,2 @@ | ||
*/ | ||
function Equalizer(element, options) { | ||
@@ -349,3 +350,3 @@ _classCallCheck(this, Equalizer); | ||
*/ | ||
equalizeOnStack: true, | ||
equalizeOnStack: false, | ||
/** | ||
@@ -352,0 +353,0 @@ * Enable height equalization row by row. |
@@ -24,3 +24,2 @@ 'use strict'; | ||
*/ | ||
function Interchange(element, options) { | ||
@@ -168,3 +167,3 @@ _classCallCheck(this, Interchange); | ||
if (this.$element[0].nodeName === 'IMG') { | ||
this.$element.attr('src', path).load(function () { | ||
this.$element.attr('src', path).on('load', function () { | ||
_this.currentPath = path; | ||
@@ -171,0 +170,0 @@ }).trigger(trigger); |
@@ -22,3 +22,2 @@ 'use strict'; | ||
*/ | ||
function Magellan(element, options) { | ||
@@ -127,2 +126,6 @@ _classCallCheck(this, Magellan); | ||
value: function scrollToLoc(loc) { | ||
// Do nothing if target does not exist to prevent errors | ||
if (!$(loc).length) { | ||
return false; | ||
} | ||
var scrollPos = Math.round($(loc).offset().top - this.options.threshold / 2 - this.options.barOffset); | ||
@@ -172,3 +175,3 @@ | ||
this.$active.removeClass(this.options.activeClass); | ||
this.$active = this.$links.eq(curIdx).addClass(this.options.activeClass); | ||
this.$active = this.$links.filter('[href="#' + this.$targets.eq(curIdx).data('magellan-target') + '"]').addClass(this.options.activeClass); | ||
@@ -175,0 +178,0 @@ if (this.options.deepLinking) { |
@@ -25,3 +25,2 @@ 'use strict'; | ||
*/ | ||
function OffCanvas(element, options) { | ||
@@ -39,2 +38,5 @@ _classCallCheck(this, OffCanvas); | ||
Foundation.registerPlugin(this, 'OffCanvas'); | ||
Foundation.Keyboard.register('OffCanvas', { | ||
'ESCAPE': 'close' | ||
}); | ||
} | ||
@@ -220,9 +222,12 @@ | ||
if (this.options.autoFocus) { | ||
this.$element.one(Foundation.transitionend(this.$element), function () { | ||
_this.$element.find('a, button').eq(0).focus(); | ||
}); | ||
this.$element.attr('tabindex', '-1'); | ||
this.$element.focus(); | ||
/*this.$element.one(Foundation.transitionend(this.$element), function() { | ||
_this.$element.focus(); | ||
});*/ | ||
} | ||
if (this.options.trapFocus) { | ||
$('[data-off-canvas-content]').attr('tabindex', '-1'); | ||
this.$element.attr('tabindex', '-1'); | ||
this._trapFocus(); | ||
@@ -245,12 +250,11 @@ } | ||
focusable.off('.zf.offcanvas').on('keydown.zf.offcanvas', function (e) { | ||
if (e.which === 9 || e.keycode === 9) { | ||
if (e.target === last[0] && !e.shiftKey) { | ||
e.preventDefault(); | ||
first.focus(); | ||
} | ||
if (e.target === first[0] && e.shiftKey) { | ||
e.preventDefault(); | ||
last.focus(); | ||
} | ||
var key = Foundation.Keyboard.parseKey(e); | ||
if (key === 'TAB' && e.target === last[0]) { | ||
e.preventDefault(); | ||
first.focus(); | ||
} | ||
if (key === 'SHIFT_TAB' && e.target === first[0]) { | ||
e.preventDefault(); | ||
last.focus(); | ||
} | ||
}); | ||
@@ -346,9 +350,16 @@ } | ||
key: '_handleKeyboard', | ||
value: function _handleKeyboard(event) { | ||
if (event.which !== 27) return; | ||
value: function _handleKeyboard(e) { | ||
var _this2 = this; | ||
event.stopPropagation(); | ||
event.preventDefault(); | ||
this.close(); | ||
this.$lastTrigger.focus(); | ||
Foundation.Keyboard.handleKey(e, 'OffCanvas', { | ||
close: function () { | ||
_this2.close(); | ||
_this2.$lastTrigger.focus(); | ||
return true; | ||
}, | ||
handled: function () { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
} | ||
}); | ||
} | ||
@@ -419,3 +430,3 @@ | ||
/** | ||
* Force focus to the offcanvas on open. If true, will focus the opening trigger on close. | ||
* Force focus to the offcanvas on open. If true, will focus the opening trigger on close. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes. | ||
* @option | ||
@@ -422,0 +433,0 @@ * @example true |
@@ -25,3 +25,2 @@ 'use strict'; | ||
*/ | ||
function Orbit(element, options) { | ||
@@ -253,19 +252,21 @@ _classCallCheck(this, Orbit); | ||
this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) { | ||
// handle keyboard event with keyboard util | ||
Foundation.Keyboard.handleKey(e, 'Orbit', { | ||
next: function () { | ||
_this.changeSlide(true); | ||
}, | ||
previous: function () { | ||
_this.changeSlide(false); | ||
}, | ||
handled: function () { | ||
// if bullet is focused, make sure focus moves | ||
if ($(e.target).is(_this.$bullets)) { | ||
_this.$bullets.filter('.is-active').focus(); | ||
if (this.options.accessible) { | ||
this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) { | ||
// handle keyboard event with keyboard util | ||
Foundation.Keyboard.handleKey(e, 'Orbit', { | ||
next: function () { | ||
_this.changeSlide(true); | ||
}, | ||
previous: function () { | ||
_this.changeSlide(false); | ||
}, | ||
handled: function () { | ||
// if bullet is focused, make sure focus moves | ||
if ($(e.target).is(_this.$bullets)) { | ||
_this.$bullets.filter('.is-active').focus(); | ||
} | ||
} | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
@@ -305,6 +306,12 @@ } | ||
} else { | ||
$newSlide = chosenSlide; | ||
} | ||
$newSlide = chosenSlide; | ||
} | ||
if ($newSlide.length) { | ||
/** | ||
* Triggers before the next slide starts animating in and only if a next slide has been found. | ||
* @event Orbit#beforeslidechange | ||
*/ | ||
this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]); | ||
if (this.options.bullets) { | ||
@@ -328,8 +335,8 @@ idx = idx || this.$slides.index($newSlide); //grab index to update bullets | ||
} else { | ||
$curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide(); | ||
$newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show(); | ||
if (this.options.autoPlay && !this.timer.isPaused) { | ||
this.timer.restart(); | ||
} | ||
$curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide(); | ||
$newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show(); | ||
if (this.options.autoPlay && !this.timer.isPaused) { | ||
this.timer.restart(); | ||
} | ||
} | ||
/** | ||
@@ -336,0 +343,0 @@ * Triggers when the slide has finished animating in. |
@@ -27,3 +27,2 @@ 'use strict'; | ||
*/ | ||
function ResponsiveMenu(element, options) { | ||
@@ -30,0 +29,0 @@ _classCallCheck(this, ResponsiveMenu); |
@@ -23,3 +23,2 @@ 'use strict'; | ||
*/ | ||
function ResponsiveToggle(element, options) { | ||
@@ -26,0 +25,0 @@ _classCallCheck(this, ResponsiveToggle); |
@@ -26,3 +26,2 @@ 'use strict'; | ||
*/ | ||
function Reveal(element, options) { | ||
@@ -180,3 +179,3 @@ _classCallCheck(this, Reveal); | ||
this.$overlay.off('.zf.reveal').on('click.zf.reveal', function (e) { | ||
if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { | ||
if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target) || !$.contains(document, e.target)) { | ||
return; | ||
@@ -268,3 +267,2 @@ } | ||
}).focus(); | ||
console.log('focus'); | ||
}; | ||
@@ -304,3 +302,3 @@ | ||
if (this.isMobile) { | ||
this.originalScrollPos = window.pageYOffset; | ||
//this.originalScrollPos = window.pageYOffset; | ||
$('html, body').addClass('is-reveal-open'); | ||
@@ -329,3 +327,3 @@ } else { | ||
$('body').on('click.zf.reveal', function (e) { | ||
if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { | ||
if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target) || !$.contains(document, e.target)) { | ||
return; | ||
@@ -356,2 +354,3 @@ } | ||
tab_forward: function () { | ||
_this.focusableElements = Foundation.Keyboard.findFocusable(_this.$element); | ||
if (_this.$element.find(':focus').is(_this.focusableElements.eq(-1))) { | ||
@@ -368,2 +367,3 @@ // left modal downwards, setting focus to first element | ||
tab_backward: function () { | ||
_this.focusableElements = Foundation.Keyboard.findFocusable(_this.$element); | ||
if (_this.$element.find(':focus').is(_this.focusableElements.eq(0)) || _this.$element.is(':focus')) { | ||
@@ -454,6 +454,6 @@ // left modal upwards, setting focus to last element | ||
$('html, body').removeClass('is-reveal-open'); | ||
if (_this.originalScrollPos) { | ||
$('body').scrollTop(_this.originalScrollPos); | ||
_this.originalScrollPos = null; | ||
} | ||
//if(_this.originalScrollPos) { | ||
// $('body').scrollTop(_this.originalScrollPos); | ||
// _this.originalScrollPos = null; | ||
//} | ||
} else { | ||
@@ -460,0 +460,0 @@ $('body').removeClass('is-reveal-open'); |
@@ -25,3 +25,2 @@ 'use strict'; | ||
*/ | ||
function Slider(element, options) { | ||
@@ -187,3 +186,3 @@ _classCallCheck(this, Slider); | ||
//percentage w/h of the handle compared to the slider bar | ||
handlePct = ~ ~(percent(handleDim, elemDim) * 100); | ||
handlePct = ~~(percent(handleDim, elemDim) * 100); | ||
//if left handle, the math is slightly different than if it's the right handle, and the left/top property needs to be changed for the fill bar | ||
@@ -201,8 +200,8 @@ if (isLeftHndl) { | ||
} else { | ||
//just caching the value of the left/bottom handle's left/top property | ||
var handlePos = parseFloat(this.$handle[0].style[lOrT]); | ||
//calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0 | ||
//based on the percentage of movement of the handle being manipulated, less the opposing handle's left/top position, plus the percentage w/h of the handle itself | ||
dim = movement - (isNaN(handlePos) ? this.options.initialStart / ((this.options.end - this.options.start) / 100) : handlePos) + handlePct; | ||
} | ||
//just caching the value of the left/bottom handle's left/top property | ||
var handlePos = parseFloat(this.$handle[0].style[lOrT]); | ||
//calculate the new min-height/width for the fill bar. Use isNaN to prevent false positives for numbers <= 0 | ||
//based on the percentage of movement of the handle being manipulated, less the opposing handle's left/top position, plus the percentage w/h of the handle itself | ||
dim = movement - (isNaN(handlePos) ? this.options.initialStart / ((this.options.end - this.options.start) / 100) : handlePos) + handlePct; | ||
} | ||
// assign the min-height/width to our css object | ||
@@ -334,3 +333,3 @@ css['min-' + hOrW] = dim + '%'; | ||
} | ||
offsetPct = percent(barXY, barDim); | ||
var offsetPct = percent(barXY, barDim); | ||
@@ -337,0 +336,0 @@ value = (this.options.end - this.options.start) * offsetPct + this.options.start; |
@@ -23,3 +23,2 @@ 'use strict'; | ||
*/ | ||
function Sticky(element, options) { | ||
@@ -61,2 +60,6 @@ _classCallCheck(this, Sticky); | ||
$(window).one('load.zf.sticky', function () { | ||
//We calculate the container height to have correct values for anchor points offset calculation. | ||
_this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height; | ||
_this.$container.css('height', _this.containerHeight); | ||
_this.elemHeight = _this.containerHeight; | ||
if (_this.options.anchor !== '') { | ||
@@ -299,3 +302,5 @@ _this.$anchor = $('#' + _this.options.anchor); | ||
if (!this.canStick) { | ||
cb(); | ||
if (cb && typeof cb === 'function') { | ||
cb(); | ||
} | ||
} | ||
@@ -329,6 +334,11 @@ var _this = this, | ||
this.$element.css({ "left": this.$container.offset().left + parseInt(comp['padding-left'], 10) }); | ||
} else { | ||
if (this.$element.hasClass('is-at-bottom')) { | ||
var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight; | ||
this.$element.css('top', anchorPt); | ||
} | ||
} | ||
this._setBreakPoints(newContainerHeight, function () { | ||
if (cb) { | ||
if (cb && typeof cb === 'function') { | ||
cb(); | ||
@@ -350,3 +360,3 @@ } | ||
if (!this.canStick) { | ||
if (cb) { | ||
if (cb && typeof cb === 'function') { | ||
cb(); | ||
@@ -379,3 +389,3 @@ } else { | ||
if (cb) { | ||
if (cb && typeof cb === 'function') { | ||
cb(); | ||
@@ -382,0 +392,0 @@ } |
@@ -24,3 +24,2 @@ 'use strict'; | ||
*/ | ||
function Tabs(element, options) { | ||
@@ -27,0 +26,0 @@ _classCallCheck(this, Tabs); |
@@ -24,3 +24,2 @@ 'use strict'; | ||
*/ | ||
function Toggler(element, options) { | ||
@@ -27,0 +26,0 @@ _classCallCheck(this, Toggler); |
@@ -13,2 +13,3 @@ 'use strict'; | ||
* @requires foundation.util.box | ||
* @requires foundation.util.mediaQuery | ||
* @requires foundation.util.triggers | ||
@@ -25,3 +26,2 @@ */ | ||
*/ | ||
function Tooltip(element, options) { | ||
@@ -63,3 +63,3 @@ _classCallCheck(this, Tooltip); | ||
'data-resize': elemId | ||
}).addClass(this.triggerClass); | ||
}).addClass(this.options.triggerClass); | ||
@@ -292,7 +292,7 @@ //helper variables to track movement on collisions | ||
} else { | ||
_this.isClick = true; | ||
if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) { | ||
_this.show(); | ||
} | ||
_this.isClick = true; | ||
if ((_this.options.disableHover || !_this.$element.attr('tabindex')) && !_this.isActive) { | ||
_this.show(); | ||
} | ||
} | ||
}); | ||
@@ -299,0 +299,0 @@ } else { |
@@ -179,3 +179,3 @@ 'use strict'; | ||
return { | ||
left: $anchorDims.offset.left - ($eleDims.width + hOffset), | ||
left: $anchorDims.offset.left, | ||
top: $anchorDims.offset.top + $anchorDims.height | ||
@@ -192,3 +192,3 @@ }; | ||
return { | ||
left: Foundation.rtl() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width : $anchorDims.offset.left, | ||
left: Foundation.rtl() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width : $anchorDims.offset.left + hOffset, | ||
top: $anchorDims.offset.top + $anchorDims.height + vOffset | ||
@@ -195,0 +195,0 @@ }; |
@@ -63,5 +63,5 @@ /******************************************* | ||
} else { | ||
// merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa | ||
if (Foundation.rtl()) cmds = $.extend({}, commandList.ltr, commandList.rtl);else cmds = $.extend({}, commandList.rtl, commandList.ltr); | ||
} | ||
// merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa | ||
if (Foundation.rtl()) cmds = $.extend({}, commandList.ltr, commandList.rtl);else cmds = $.extend({}, commandList.rtl, commandList.ltr); | ||
} | ||
command = cmds[keyCode]; | ||
@@ -68,0 +68,0 @@ |
@@ -148,3 +148,3 @@ 'use strict'; | ||
script.parentNode.insertBefore(style, script); | ||
script && script.parentNode && script.parentNode.insertBefore(style, script); | ||
@@ -151,0 +151,0 @@ // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers |
@@ -7,3 +7,3 @@ 'use strict'; | ||
Feather: function (menu) { | ||
var type = arguments.length <= 1 || arguments[1] === undefined ? 'zf' : arguments[1]; | ||
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf'; | ||
@@ -50,3 +50,3 @@ menu.attr('role', 'menubar'); | ||
menu.find('*').removeClass(subMenuClass + ' ' + subItemClass + ' ' + hasSubClass + ' is-submenu-item submenu is-active').removeAttr('data-submenu').css('display', ''); | ||
menu.find('>li, .menu, .menu > li').removeClass(subMenuClass + ' ' + subItemClass + ' ' + hasSubClass + ' is-submenu-item submenu is-active').removeAttr('data-submenu').css('display', ''); | ||
@@ -53,0 +53,0 @@ // console.log( menu.find('.' + subMenuClass + ', .' + subItemClass + ', .has-submenu, .is-submenu-item, .submenu, [data-submenu]') |
@@ -33,3 +33,5 @@ 'use strict'; | ||
} | ||
cb(); | ||
if (cb && typeof cb === 'function') { | ||
cb(); | ||
} | ||
}, remain); | ||
@@ -36,0 +38,0 @@ elem.trigger('timerstart.zf.' + nameSpace); |
@@ -65,3 +65,3 @@ 'use strict'; | ||
*/ | ||
$(window).load(function () { | ||
$(window).on('load', function () { | ||
checkListeners(); | ||
@@ -68,0 +68,0 @@ }); |
@@ -79,12 +79,4 @@ 'use strict'; | ||
.on('click.zf.accordion', function(e) { | ||
// $(this).children('a').on('click.zf.accordion', function(e) { | ||
e.preventDefault(); | ||
if ($elem.hasClass('is-active')) { | ||
if(_this.options.allowAllClosed || $elem.siblings().hasClass('is-active')){ | ||
_this.up($tabContent); | ||
} | ||
} | ||
else { | ||
_this.down($tabContent); | ||
} | ||
_this.toggle($tabContent); | ||
}).on('keydown.zf.accordion', function(e){ | ||
@@ -119,3 +111,3 @@ Foundation.Keyboard.handleKey(e, 'Accordion', { | ||
* Toggles the selected content pane's open/close state. | ||
* @param {jQuery} $target - jQuery object of the pane to toggle. | ||
* @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`). | ||
* @function | ||
@@ -125,5 +117,3 @@ */ | ||
if($target.parent().hasClass('is-active')) { | ||
if(this.options.allowAllClosed || $target.parent().siblings().hasClass('is-active')){ | ||
this.up($target); | ||
} else { return; } | ||
this.up($target); | ||
} else { | ||
@@ -136,3 +126,3 @@ this.down($target); | ||
* Opens the accordion tab defined by `$target`. | ||
* @param {jQuery} $target - Accordion pane to open. | ||
* @param {jQuery} $target - Accordion pane to open (`.accordion-content`). | ||
* @param {Boolean} firstTime - flag to determine if reflow should happen. | ||
@@ -143,9 +133,2 @@ * @fires Accordion#down | ||
down($target, firstTime) { | ||
if (!this.options.multiExpand && !firstTime) { | ||
var $currentActive = this.$element.children('.is-active').children('[data-tab-content]'); | ||
if($currentActive.length){ | ||
this.up($currentActive); | ||
} | ||
} | ||
$target | ||
@@ -157,2 +140,9 @@ .attr('aria-hidden', false) | ||
if (!this.options.multiExpand && !firstTime) { | ||
var $currentActive = this.$element.children('.is-active').children('[data-tab-content]'); | ||
if ($currentActive.length) { | ||
this.up($currentActive.not($target)); | ||
} | ||
} | ||
$target.slideDown(this.options.slideSpeed, () => { | ||
@@ -174,3 +164,3 @@ /** | ||
* Closes the tab defined by `$target`. | ||
* @param {jQuery} $target - Accordion tab to close. | ||
* @param {jQuery} $target - Accordion tab to close (`.accordion-content`). | ||
* @fires Accordion#up | ||
@@ -182,5 +172,4 @@ * @function | ||
_this = this; | ||
var canClose = this.options.multiExpand ? $aunts.hasClass('is-active') : $target.parent().hasClass('is-active'); | ||
if(!this.options.allowAllClosed && !canClose) { | ||
if((!this.options.allowAllClosed && !$aunts.hasClass('is-active')) || !$target.parent().hasClass('is-active')) { | ||
return; | ||
@@ -187,0 +176,0 @@ } |
@@ -37,5 +37,3 @@ 'use strict'; | ||
'ARROW_LEFT': 'close', | ||
'ESCAPE': 'closeAll', | ||
'TAB': 'down', | ||
'SHIFT_TAB': 'up' | ||
'ESCAPE': 'closeAll' | ||
}); | ||
@@ -131,2 +129,3 @@ } | ||
}); | ||
Foundation.Keyboard.handleKey(e, 'AccordionMenu', { | ||
@@ -148,7 +147,7 @@ open: function() { | ||
up: function() { | ||
$prevElement.attr('tabindex', -1).focus(); | ||
$prevElement.focus(); | ||
return true; | ||
}, | ||
down: function() { | ||
$nextElement.attr('tabindex', -1).focus(); | ||
$nextElement.focus(); | ||
return true; | ||
@@ -155,0 +154,0 @@ }, |
@@ -5,3 +5,3 @@ !function($) { | ||
var FOUNDATION_VERSION = '6.2.2'; | ||
var FOUNDATION_VERSION = '6.2.4-rc1'; | ||
@@ -8,0 +8,0 @@ // Global Foundation object |
@@ -74,3 +74,3 @@ 'use strict'; | ||
} | ||
$link.data('savedHref', $link.attr('href')).removeAttr('href'); | ||
$link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0); | ||
$link.children('[data-submenu]') | ||
@@ -192,2 +192,3 @@ .attr({ | ||
}); | ||
return true; | ||
} else if ($element.is(_this.$submenuAnchors)) { | ||
@@ -198,4 +199,4 @@ _this._show($element.parent('li')); | ||
}); | ||
return true; | ||
} | ||
return true; | ||
}, | ||
@@ -243,2 +244,8 @@ handled: function(preventDefault) { | ||
_this._hide($elem); | ||
// If there is a parent submenu, call show | ||
let parentSubMenu = $elem.parent('li').parent('ul').parent('li'); | ||
if (parentSubMenu.length) { | ||
_this._show(parentSubMenu); | ||
} | ||
}); | ||
@@ -271,3 +278,4 @@ } | ||
_show($elem) { | ||
$elem.children('[data-submenu]').addClass('is-active'); | ||
$elem.attr('aria-expanded', true); | ||
$elem.children('[data-submenu]').addClass('is-active').attr('aria-hidden', false); | ||
/** | ||
@@ -288,3 +296,4 @@ * Fires when the submenu has opened. | ||
var _this = this; | ||
$elem.addClass('is-closing') | ||
$elem.parent('li').attr('aria-expanded', false); | ||
$elem.attr('aria-hidden', true).addClass('is-closing') | ||
.one(Foundation.transitionend($elem), function(){ | ||
@@ -308,9 +317,11 @@ $elem.removeClass('is-active is-closing'); | ||
_getMaxDims() { | ||
var max = 0, result = {}; | ||
this.$submenus.add(this.$element).each(function(){ | ||
var numOfElems = $(this).children('li').length; | ||
max = numOfElems > max ? numOfElems : max; | ||
var biggest = 0 | ||
var result = {}; | ||
this.$submenus.add(this.$element).each((i, elem) => { | ||
var height = elem.getBoundingClientRect().height; | ||
if (height > biggest) biggest = height; | ||
}); | ||
result['min-height'] = `${max * this.$menuItems[0].getBoundingClientRect().height}px`; | ||
result['min-height'] = `${biggest}px`; | ||
result['max-width'] = `${this.$element[0].getBoundingClientRect().width}px`; | ||
@@ -337,2 +348,3 @@ | ||
var $link = $(this); | ||
$link.removeAttr('tabindex'); | ||
if($link.data('savedHref')){ | ||
@@ -339,0 +351,0 @@ $link.attr('href', $link.data('savedHref')).removeData('savedHref'); |
@@ -44,3 +44,3 @@ 'use strict'; | ||
this.$anchor = $(`[data-toggle="${$id}"]`) || $(`[data-open="${$id}"]`); | ||
this.$anchor = $(`[data-toggle="${$id}"]`).length ? $(`[data-toggle="${$id}"]`) : $(`[data-open="${$id}"]`); | ||
this.$anchor.attr({ | ||
@@ -75,5 +75,6 @@ 'aria-controls': $id, | ||
verticalPosition = verticalPosition ? verticalPosition[0] : ''; | ||
var horizontalPosition = /float-(\S+)\s/.exec(this.$anchor[0].className); | ||
var horizontalPosition = /float-(\S+)/.exec(this.$anchor[0].className); | ||
horizontalPosition = horizontalPosition ? horizontalPosition[1] : ''; | ||
var position = horizontalPosition ? horizontalPosition + ' ' + verticalPosition : verticalPosition; | ||
return position; | ||
@@ -173,8 +174,10 @@ } | ||
this.$anchor.off('mouseenter.zf.dropdown mouseleave.zf.dropdown') | ||
.on('mouseenter.zf.dropdown', function(){ | ||
clearTimeout(_this.timeout); | ||
_this.timeout = setTimeout(function(){ | ||
_this.open(); | ||
_this.$anchor.data('hover', true); | ||
}, _this.options.hoverDelay); | ||
.on('mouseenter.zf.dropdown', function(){ | ||
if($('body[data-whatinput="mouse"]').is('*')) { | ||
clearTimeout(_this.timeout); | ||
_this.timeout = setTimeout(function(){ | ||
_this.open(); | ||
_this.$anchor.data('hover', true); | ||
}, _this.options.hoverDelay); | ||
} | ||
}).on('mouseleave.zf.dropdown', function(){ | ||
@@ -181,0 +184,0 @@ clearTimeout(_this.timeout); |
@@ -90,6 +90,11 @@ 'use strict'; | ||
e.stopImmediatePropagation(); | ||
_this._show($elem.children('.is-dropdown-submenu')); | ||
_this._show($sub); | ||
$elem.add($elem.parentsUntil(_this.$element, `.${parClass}`)).attr('data-is-click', true); | ||
} | ||
} else { return; } | ||
} else { | ||
if(_this.options.closeOnClickInside){ | ||
_this._hide($elem); | ||
} | ||
return; | ||
} | ||
}; | ||
@@ -383,2 +388,8 @@ | ||
/** | ||
* Allow clicks on leaf anchor links to close any open submenus. | ||
* @option | ||
* @example true | ||
*/ | ||
closeOnClickInside: true, | ||
/** | ||
* Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class. | ||
@@ -385,0 +396,0 @@ * @option |
@@ -8,2 +8,4 @@ 'use strict'; | ||
* @module foundation.equalizer | ||
* @requires foundation.util.mediaQuery | ||
* @requires foundation.util.timerAndImageLoader if equalizer contains images | ||
*/ | ||
@@ -289,3 +291,3 @@ | ||
*/ | ||
equalizeOnStack: true, | ||
equalizeOnStack: false, | ||
/** | ||
@@ -292,0 +294,0 @@ * Enable height equalization row by row. |
@@ -142,3 +142,3 @@ 'use strict'; | ||
if (this.$element[0].nodeName === 'IMG') { | ||
this.$element.attr('src', path).load(function() { | ||
this.$element.attr('src', path).on('load', function() { | ||
_this.currentPath = path; | ||
@@ -145,0 +145,0 @@ }) |
@@ -106,2 +106,4 @@ 'use strict'; | ||
scrollToLoc(loc) { | ||
// Do nothing if target does not exist to prevent errors | ||
if (!$(loc).length) {return false;} | ||
var scrollPos = Math.round($(loc).offset().top - this.options.threshold / 2 - this.options.barOffset); | ||
@@ -143,3 +145,3 @@ | ||
this.$active.removeClass(this.options.activeClass); | ||
this.$active = this.$links.eq(curIdx).addClass(this.options.activeClass); | ||
this.$active = this.$links.filter('[href="#' + this.$targets.eq(curIdx).data('magellan-target') + '"]').addClass(this.options.activeClass); | ||
@@ -146,0 +148,0 @@ if(this.options.deepLinking){ |
@@ -30,3 +30,7 @@ 'use strict'; | ||
Foundation.registerPlugin(this, 'OffCanvas'); | ||
Foundation.registerPlugin(this, 'OffCanvas') | ||
Foundation.Keyboard.register('OffCanvas', { | ||
'ESCAPE': 'close' | ||
}); | ||
} | ||
@@ -197,9 +201,12 @@ | ||
if (this.options.autoFocus) { | ||
this.$element.one(Foundation.transitionend(this.$element), function() { | ||
_this.$element.find('a, button').eq(0).focus(); | ||
}); | ||
this.$element.attr('tabindex', '-1'); | ||
this.$element.focus(); | ||
/*this.$element.one(Foundation.transitionend(this.$element), function() { | ||
_this.$element.focus(); | ||
});*/ | ||
} | ||
if (this.options.trapFocus) { | ||
$('[data-off-canvas-content]').attr('tabindex', '-1'); | ||
this.$element.attr('tabindex', '-1'); | ||
this._trapFocus(); | ||
@@ -219,12 +226,11 @@ } | ||
focusable.off('.zf.offcanvas').on('keydown.zf.offcanvas', function(e) { | ||
if (e.which === 9 || e.keycode === 9) { | ||
if (e.target === last[0] && !e.shiftKey) { | ||
e.preventDefault(); | ||
first.focus(); | ||
} | ||
if (e.target === first[0] && e.shiftKey) { | ||
e.preventDefault(); | ||
last.focus(); | ||
} | ||
var key = Foundation.Keyboard.parseKey(e); | ||
if (key === 'TAB' && e.target === last[0]) { | ||
e.preventDefault(); | ||
first.focus(); | ||
} | ||
if (key === 'SHIFT_TAB' && e.target === first[0]) { | ||
e.preventDefault(); | ||
last.focus(); | ||
} | ||
}); | ||
@@ -310,9 +316,14 @@ } | ||
*/ | ||
_handleKeyboard(event) { | ||
if (event.which !== 27) return; | ||
event.stopPropagation(); | ||
event.preventDefault(); | ||
this.close(); | ||
this.$lastTrigger.focus(); | ||
_handleKeyboard(e) { | ||
Foundation.Keyboard.handleKey(e, 'OffCanvas', { | ||
close: () => { | ||
this.close(); | ||
this.$lastTrigger.focus(); | ||
return true; | ||
}, | ||
handled: () => { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
} | ||
}); | ||
} | ||
@@ -377,3 +388,3 @@ | ||
/** | ||
* Force focus to the offcanvas on open. If true, will focus the opening trigger on close. | ||
* Force focus to the offcanvas on open. If true, will focus the opening trigger on close. Sets tabindex of [data-off-canvas-content] to -1 for accessibility purposes. | ||
* @option | ||
@@ -380,0 +391,0 @@ * @example true |
@@ -219,19 +219,21 @@ 'use strict'; | ||
} | ||
this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function(e) { | ||
// handle keyboard event with keyboard util | ||
Foundation.Keyboard.handleKey(e, 'Orbit', { | ||
next: function() { | ||
_this.changeSlide(true); | ||
}, | ||
previous: function() { | ||
_this.changeSlide(false); | ||
}, | ||
handled: function() { // if bullet is focused, make sure focus moves | ||
if ($(e.target).is(_this.$bullets)) { | ||
_this.$bullets.filter('.is-active').focus(); | ||
if (this.options.accessible) { | ||
this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function(e) { | ||
// handle keyboard event with keyboard util | ||
Foundation.Keyboard.handleKey(e, 'Orbit', { | ||
next: function() { | ||
_this.changeSlide(true); | ||
}, | ||
previous: function() { | ||
_this.changeSlide(false); | ||
}, | ||
handled: function() { // if bullet is focused, make sure focus moves | ||
if ($(e.target).is(_this.$bullets)) { | ||
_this.$bullets.filter('.is-active').focus(); | ||
} | ||
} | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
@@ -270,2 +272,8 @@ } | ||
if ($newSlide.length) { | ||
/** | ||
* Triggers before the next slide starts animating in and only if a next slide has been found. | ||
* @event Orbit#beforeslidechange | ||
*/ | ||
this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]); | ||
if (this.options.bullets) { | ||
@@ -272,0 +280,0 @@ idx = idx || this.$slides.index($newSlide); //grab index to update bullets |
@@ -160,3 +160,7 @@ 'use strict'; | ||
this.$overlay.off('.zf.reveal').on('click.zf.reveal', function(e) { | ||
if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { return; } | ||
if (e.target === _this.$element[0] || | ||
$.contains(_this.$element[0], e.target) || | ||
!$.contains(document, e.target)) { | ||
return; | ||
} | ||
_this.close(); | ||
@@ -242,3 +246,2 @@ }); | ||
.focus(); | ||
console.log('focus'); | ||
} | ||
@@ -276,3 +279,3 @@ if (this.options.overlay) { | ||
if (this.isMobile) { | ||
this.originalScrollPos = window.pageYOffset; | ||
//this.originalScrollPos = window.pageYOffset; | ||
$('html, body').addClass('is-reveal-open'); | ||
@@ -299,3 +302,5 @@ } | ||
$('body').on('click.zf.reveal', function(e) { | ||
if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { return; } | ||
if (e.target === _this.$element[0] || | ||
$.contains(_this.$element[0], e.target) || | ||
!$.contains(document, e.target)) { return; } | ||
_this.close(); | ||
@@ -324,2 +329,3 @@ }); | ||
tab_forward: function() { | ||
_this.focusableElements = Foundation.Keyboard.findFocusable(_this.$element); | ||
if (_this.$element.find(':focus').is(_this.focusableElements.eq(-1))) { // left modal downwards, setting focus to first element | ||
@@ -334,2 +340,3 @@ _this.focusableElements.eq(0).focus(); | ||
tab_backward: function() { | ||
_this.focusableElements = Foundation.Keyboard.findFocusable(_this.$element); | ||
if (_this.$element.find(':focus').is(_this.focusableElements.eq(0)) || _this.$element.is(':focus')) { // left modal upwards, setting focus to last element | ||
@@ -415,6 +422,6 @@ _this.focusableElements.eq(-1).focus(); | ||
$('html, body').removeClass('is-reveal-open'); | ||
if(_this.originalScrollPos) { | ||
$('body').scrollTop(_this.originalScrollPos); | ||
_this.originalScrollPos = null; | ||
} | ||
//if(_this.originalScrollPos) { | ||
// $('body').scrollTop(_this.originalScrollPos); | ||
// _this.originalScrollPos = null; | ||
//} | ||
} | ||
@@ -421,0 +428,0 @@ else { |
@@ -295,3 +295,3 @@ 'use strict'; | ||
} | ||
offsetPct = percent(barXY, barDim); | ||
var offsetPct = percent(barXY, barDim); | ||
@@ -298,0 +298,0 @@ value = (this.options.end - this.options.start) * offsetPct + this.options.start; |
@@ -50,2 +50,6 @@ 'use strict'; | ||
$(window).one('load.zf.sticky', function(){ | ||
//We calculate the container height to have correct values for anchor points offset calculation. | ||
_this.containerHeight = _this.$element.css("display") == "none" ? 0 : _this.$element[0].getBoundingClientRect().height; | ||
_this.$container.css('height', _this.containerHeight); | ||
_this.elemHeight = _this.containerHeight; | ||
if(_this.options.anchor !== ''){ | ||
@@ -267,3 +271,5 @@ _this.$anchor = $('#' + _this.options.anchor); | ||
this.canStick = Foundation.MediaQuery.atLeast(this.options.stickyOn); | ||
if (!this.canStick) { cb(); } | ||
if (!this.canStick) { | ||
if (cb && typeof cb === 'function') { cb(); } | ||
} | ||
var _this = this, | ||
@@ -294,8 +300,13 @@ newElemWidth = this.$container[0].getBoundingClientRect().width, | ||
if (this.isStuck) { | ||
this.$element.css({"left":this.$container.offset().left + parseInt(comp['padding-left'], 10)}); | ||
} | ||
if (this.isStuck) { | ||
this.$element.css({"left":this.$container.offset().left + parseInt(comp['padding-left'], 10)}); | ||
} else { | ||
if (this.$element.hasClass('is-at-bottom')) { | ||
var anchorPt = (this.points ? this.points[1] - this.$container.offset().top : this.anchorHeight) - this.elemHeight; | ||
this.$element.css('top', anchorPt); | ||
} | ||
} | ||
this._setBreakPoints(newContainerHeight, function() { | ||
if (cb) { cb(); } | ||
if (cb && typeof cb === 'function') { cb(); } | ||
}); | ||
@@ -312,3 +323,3 @@ } | ||
if (!this.canStick) { | ||
if (cb) { cb(); } | ||
if (cb && typeof cb === 'function') { cb(); } | ||
else { return false; } | ||
@@ -337,3 +348,3 @@ } | ||
if (cb) { cb(); } | ||
if (cb && typeof cb === 'function') { cb(); } | ||
} | ||
@@ -340,0 +351,0 @@ |
@@ -9,2 +9,3 @@ 'use strict'; | ||
* @requires foundation.util.box | ||
* @requires foundation.util.mediaQuery | ||
* @requires foundation.util.triggers | ||
@@ -53,3 +54,3 @@ */ | ||
'data-resize': elemId | ||
}).addClass(this.triggerClass); | ||
}).addClass(this.options.triggerClass); | ||
@@ -56,0 +57,0 @@ //helper variables to track movement on collisions |
@@ -177,3 +177,3 @@ 'use strict'; | ||
return { | ||
left: $anchorDims.offset.left - ($eleDims.width + hOffset), | ||
left: $anchorDims.offset.left, | ||
top: $anchorDims.offset.top + $anchorDims.height | ||
@@ -190,3 +190,3 @@ }; | ||
return { | ||
left: (Foundation.rtl() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width : $anchorDims.offset.left), | ||
left: (Foundation.rtl() ? $anchorDims.offset.left - $eleDims.width + $anchorDims.width : $anchorDims.offset.left + hOffset), | ||
top: $anchorDims.offset.top + $anchorDims.height + vOffset | ||
@@ -193,0 +193,0 @@ } |
@@ -145,3 +145,3 @@ 'use strict'; | ||
script.parentNode.insertBefore(style, script); | ||
script && script.parentNode && script.parentNode.insertBefore(style, script); | ||
@@ -148,0 +148,0 @@ // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers |
@@ -53,3 +53,3 @@ 'use strict'; | ||
menu | ||
.find('*') | ||
.find('>li, .menu, .menu > li') | ||
.removeClass(`${subMenuClass} ${subItemClass} ${hasSubClass} is-submenu-item submenu is-active`) | ||
@@ -56,0 +56,0 @@ .removeAttr('data-submenu').css('display', ''); |
@@ -32,3 +32,3 @@ 'use strict'; | ||
} | ||
cb(); | ||
if (cb && typeof cb === 'function') { cb(); } | ||
}, remain); | ||
@@ -35,0 +35,0 @@ elem.trigger(`timerstart.zf.${nameSpace}`); |
@@ -66,3 +66,3 @@ 'use strict'; | ||
*/ | ||
$(window).load(() => { | ||
$(window).on('load', () => { | ||
checkListeners(); | ||
@@ -69,0 +69,0 @@ }); |
{ | ||
"name": "foundation-sites", | ||
"version": "6.2.3", | ||
"version": "6.2.4-rc1", | ||
"main": "dist/foundation.js", | ||
@@ -98,2 +98,3 @@ "description": "The most advanced responsive front-end framework in the world.", | ||
"keywords": [ | ||
"eyeglass-module", | ||
"handlebars-helper-rel", | ||
@@ -105,3 +106,4 @@ "handlebars-helper-slugify" | ||
"sassDir": "scss", | ||
"needs": "^0.8.0" | ||
"needs": "^0.8.0", | ||
"exports": false | ||
}, | ||
@@ -117,3 +119,6 @@ "jspm": { | ||
} | ||
}, | ||
"browserify": { | ||
"transform": [["babelify", { "presets": ["es2015"] }]] | ||
} | ||
} |
{ | ||
"name": "jquery", | ||
"version": "2.1.4", | ||
"main": "dist/jquery.js", | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"build", | ||
"dist/cdn", | ||
"speed", | ||
"test", | ||
"*.md", | ||
"AUTHORS.txt", | ||
"Gruntfile.js", | ||
"package.json" | ||
], | ||
"devDependencies": { | ||
"sizzle": "2.1.1-jquery.2.1.2", | ||
"requirejs": "2.1.10", | ||
"qunit": "1.14.0", | ||
"sinon": "1.8.1" | ||
}, | ||
"keywords": [ | ||
"jquery", | ||
"javascript", | ||
"browser", | ||
"library" | ||
], | ||
"homepage": "https://github.com/jquery/jquery-dist", | ||
"version": "2.2.3", | ||
"_release": "2.2.3", | ||
"_release": "2.1.4", | ||
"_resolution": { | ||
"type": "version", | ||
"tag": "2.2.3", | ||
"commit": "af22a351b2ea5801ffb1695abb3bb34d5bed9198" | ||
"tag": "2.1.4", | ||
"commit": "7751e69b615c6eca6f783a81e292a55725af6b85" | ||
}, | ||
"_source": "https://github.com/jquery/jquery-dist.git", | ||
"_target": ">= 2.1.0", | ||
"_target": "~2.1.0", | ||
"_originalSource": "jquery" | ||
} |
@@ -1,15 +0,11 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
"./var/document", | ||
"./var/rnotwhite", | ||
"./ajax/var/location", | ||
"./ajax/var/nonce", | ||
"./ajax/var/rquery", | ||
"./core/init", | ||
"./ajax/parseJSON", | ||
"./ajax/parseXML", | ||
"./event/trigger", | ||
"./deferred" | ||
], function( jQuery, document, rnotwhite, location, nonce, rquery ) { | ||
], function( jQuery, rnotwhite, nonce, rquery ) { | ||
@@ -20,3 +16,2 @@ var | ||
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, | ||
// #7653, #8125, #8152: local protocol detection | ||
@@ -26,2 +21,3 @@ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, | ||
rprotocol = /^\/\//, | ||
rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, | ||
@@ -49,6 +45,8 @@ /* Prefilters | ||
// Anchor tag for parsing the document origin | ||
originAnchor = document.createElement( "a" ); | ||
originAnchor.href = location.href; | ||
// Document location | ||
ajaxLocation = window.location.href, | ||
// Segment location into parts | ||
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; | ||
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport | ||
@@ -70,14 +68,12 @@ function addToPrefiltersOrTransports( structure ) { | ||
if ( jQuery.isFunction( func ) ) { | ||
// For each dataType in the dataTypeExpression | ||
while ( ( dataType = dataTypes[ i++ ] ) ) { | ||
while ( (dataType = dataTypes[i++]) ) { | ||
// Prepend if requested | ||
if ( dataType[ 0 ] === "+" ) { | ||
if ( dataType[0] === "+" ) { | ||
dataType = dataType.slice( 1 ) || "*"; | ||
( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); | ||
(structure[ dataType ] = structure[ dataType ] || []).unshift( func ); | ||
// Otherwise append | ||
} else { | ||
( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); | ||
(structure[ dataType ] = structure[ dataType ] || []).push( func ); | ||
} | ||
@@ -100,5 +96,3 @@ } | ||
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); | ||
if ( typeof dataTypeOrTransport === "string" && | ||
!seekingTransport && !inspected[ dataTypeOrTransport ] ) { | ||
if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { | ||
options.dataTypes.unshift( dataTypeOrTransport ); | ||
@@ -110,3 +104,3 @@ inspect( dataTypeOrTransport ); | ||
} | ||
} ); | ||
}); | ||
return selected; | ||
@@ -127,3 +121,3 @@ } | ||
if ( src[ key ] !== undefined ) { | ||
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; | ||
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; | ||
} | ||
@@ -152,3 +146,3 @@ } | ||
if ( ct === undefined ) { | ||
ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); | ||
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); | ||
} | ||
@@ -171,6 +165,5 @@ } | ||
} else { | ||
// Try convertible dataTypes | ||
for ( type in responses ) { | ||
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { | ||
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { | ||
finalDataType = type; | ||
@@ -183,3 +176,2 @@ break; | ||
} | ||
// Or just use first one | ||
@@ -206,3 +198,2 @@ finalDataType = finalDataType || firstDataType; | ||
converters = {}, | ||
// Work with a copy of dataTypes in case we need to modify it for conversion | ||
@@ -260,3 +251,2 @@ dataTypes = s.dataTypes.slice(); | ||
if ( conv ) { | ||
// Condense equivalence converters | ||
@@ -281,3 +271,3 @@ if ( conv === true ) { | ||
// Unless errors are allowed to bubble, catch and return them | ||
if ( conv && s.throws ) { | ||
if ( conv && s[ "throws" ] ) { | ||
response = conv( response ); | ||
@@ -288,6 +278,3 @@ } else { | ||
} catch ( e ) { | ||
return { | ||
state: "parsererror", | ||
error: conv ? e : "No conversion from " + prev + " to " + current | ||
}; | ||
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; | ||
} | ||
@@ -303,3 +290,3 @@ } | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
@@ -314,5 +301,5 @@ // Counter for holding the number of active queries | ||
ajaxSettings: { | ||
url: location.href, | ||
url: ajaxLocation, | ||
type: "GET", | ||
isLocal: rlocalProtocol.test( location.protocol ), | ||
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), | ||
global: true, | ||
@@ -343,5 +330,5 @@ processData: true, | ||
contents: { | ||
xml: /\bxml\b/, | ||
html: /\bhtml/, | ||
json: /\bjson\b/ | ||
xml: /xml/, | ||
html: /html/, | ||
json: /json/ | ||
}, | ||
@@ -411,51 +398,35 @@ | ||
var transport, | ||
// URL without anti-cache param | ||
cacheURL, | ||
// Response headers | ||
responseHeadersString, | ||
responseHeaders, | ||
// timeout handle | ||
timeoutTimer, | ||
// Url cleanup var | ||
urlAnchor, | ||
// Cross-domain detection vars | ||
parts, | ||
// To know if global events are to be dispatched | ||
fireGlobals, | ||
// Loop variable | ||
i, | ||
// Create the final options object | ||
s = jQuery.ajaxSetup( {}, options ), | ||
// Callbacks context | ||
callbackContext = s.context || s, | ||
// Context for global events is callbackContext if it is a DOM node or jQuery collection | ||
globalEventContext = s.context && | ||
( callbackContext.nodeType || callbackContext.jquery ) ? | ||
jQuery( callbackContext ) : | ||
jQuery.event, | ||
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? | ||
jQuery( callbackContext ) : | ||
jQuery.event, | ||
// Deferreds | ||
deferred = jQuery.Deferred(), | ||
completeDeferred = jQuery.Callbacks( "once memory" ), | ||
completeDeferred = jQuery.Callbacks("once memory"), | ||
// Status-dependent callbacks | ||
statusCode = s.statusCode || {}, | ||
// Headers (they are sent all at once) | ||
requestHeaders = {}, | ||
requestHeadersNames = {}, | ||
// The jqXHR state | ||
state = 0, | ||
// Default abort message | ||
strAbort = "canceled", | ||
// Fake xhr | ||
@@ -471,4 +442,4 @@ jqXHR = { | ||
responseHeaders = {}; | ||
while ( ( match = rheaders.exec( responseHeadersString ) ) ) { | ||
responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; | ||
while ( (match = rheaders.exec( responseHeadersString )) ) { | ||
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; | ||
} | ||
@@ -510,3 +481,2 @@ } | ||
for ( code in map ) { | ||
// Lazy-add the new callback in a way that preserves old ones | ||
@@ -516,3 +486,2 @@ statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; | ||
} else { | ||
// Execute the appropriate callbacks | ||
@@ -545,4 +514,4 @@ jqXHR.always( map[ jqXHR.status ] ); | ||
// We also use the url parameter if available | ||
s.url = ( ( url || s.url || location.href ) + "" ).replace( rhash, "" ) | ||
.replace( rprotocol, location.protocol + "//" ); | ||
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ) | ||
.replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); | ||
@@ -555,22 +524,10 @@ // Alias method option to type as per ticket #12004 | ||
// A cross-domain request is in order when the origin doesn't match the current origin. | ||
// A cross-domain request is in order when we have a protocol:host:port mismatch | ||
if ( s.crossDomain == null ) { | ||
urlAnchor = document.createElement( "a" ); | ||
// Support: IE8-11+ | ||
// IE throws exception if url is malformed, e.g. http://example.com:80x/ | ||
try { | ||
urlAnchor.href = s.url; | ||
// Support: IE8-11+ | ||
// Anchor's host property isn't correctly set when s.url is relative | ||
urlAnchor.href = urlAnchor.href; | ||
s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== | ||
urlAnchor.protocol + "//" + urlAnchor.host; | ||
} catch ( e ) { | ||
// If there is an error parsing the URL, assume it is crossDomain, | ||
// it can be rejected by the transport if it is invalid | ||
s.crossDomain = true; | ||
} | ||
parts = rurl.exec( s.url.toLowerCase() ); | ||
s.crossDomain = !!( parts && | ||
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || | ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== | ||
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) | ||
); | ||
} | ||
@@ -597,3 +554,3 @@ | ||
if ( fireGlobals && jQuery.active++ === 0 ) { | ||
jQuery.event.trigger( "ajaxStart" ); | ||
jQuery.event.trigger("ajaxStart"); | ||
} | ||
@@ -617,3 +574,2 @@ | ||
cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); | ||
// #9682: remove data so that it's not used in an eventual retry | ||
@@ -653,5 +609,4 @@ delete s.data; | ||
"Accept", | ||
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? | ||
s.accepts[ s.dataTypes[ 0 ] ] + | ||
( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : | ||
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? | ||
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : | ||
s.accepts[ "*" ] | ||
@@ -666,5 +621,3 @@ ); | ||
// Allow custom headers/mimetypes and early abort | ||
if ( s.beforeSend && | ||
( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { | ||
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { | ||
// Abort if not done already and return | ||
@@ -695,12 +648,6 @@ return jqXHR.abort(); | ||
} | ||
// If request was aborted inside ajaxSend, stop there | ||
if ( state === 2 ) { | ||
return jqXHR; | ||
} | ||
// Timeout | ||
if ( s.async && s.timeout > 0 ) { | ||
timeoutTimer = window.setTimeout( function() { | ||
jqXHR.abort( "timeout" ); | ||
timeoutTimer = setTimeout(function() { | ||
jqXHR.abort("timeout"); | ||
}, s.timeout ); | ||
@@ -713,7 +660,5 @@ } | ||
} catch ( e ) { | ||
// Propagate exception as error if not done | ||
if ( state < 2 ) { | ||
done( -1, e ); | ||
// Simply rethrow otherwise | ||
@@ -741,3 +686,3 @@ } else { | ||
if ( timeoutTimer ) { | ||
window.clearTimeout( timeoutTimer ); | ||
clearTimeout( timeoutTimer ); | ||
} | ||
@@ -771,7 +716,7 @@ | ||
if ( s.ifModified ) { | ||
modified = jqXHR.getResponseHeader( "Last-Modified" ); | ||
modified = jqXHR.getResponseHeader("Last-Modified"); | ||
if ( modified ) { | ||
jQuery.lastModified[ cacheURL ] = modified; | ||
} | ||
modified = jqXHR.getResponseHeader( "etag" ); | ||
modified = jqXHR.getResponseHeader("etag"); | ||
if ( modified ) { | ||
@@ -798,3 +743,2 @@ jQuery.etag[ cacheURL ] = modified; | ||
} else { | ||
// Extract error from statusText and normalize for non-aborts | ||
@@ -835,6 +779,5 @@ error = statusText; | ||
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); | ||
// Handle the global AJAX counter | ||
if ( !( --jQuery.active ) ) { | ||
jQuery.event.trigger( "ajaxStop" ); | ||
jQuery.event.trigger("ajaxStop"); | ||
} | ||
@@ -854,7 +797,6 @@ } | ||
} | ||
} ); | ||
}); | ||
jQuery.each( [ "get", "post" ], function( i, method ) { | ||
jQuery[ method ] = function( url, data, callback, type ) { | ||
// Shift arguments if data argument was omitted | ||
@@ -867,4 +809,3 @@ if ( jQuery.isFunction( data ) ) { | ||
// The url can be an options object (which then must have .url) | ||
return jQuery.ajax( jQuery.extend( { | ||
return jQuery.ajax({ | ||
url: url, | ||
@@ -875,7 +816,7 @@ type: method, | ||
success: callback | ||
}, jQuery.isPlainObject( url ) && url ) ); | ||
}); | ||
}; | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -12,3 +12,3 @@ "./var/nonce", | ||
// Default jsonp settings | ||
jQuery.ajaxSetup( { | ||
jQuery.ajaxSetup({ | ||
jsonp: "callback", | ||
@@ -20,3 +20,3 @@ jsonpCallback: function() { | ||
} | ||
} ); | ||
}); | ||
@@ -29,6 +29,3 @@ // Detect, normalize options and install callbacks for jsonp requests | ||
"url" : | ||
typeof s.data === "string" && | ||
( s.contentType || "" ) | ||
.indexOf( "application/x-www-form-urlencoded" ) === 0 && | ||
rjsonp.test( s.data ) && "data" | ||
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" | ||
); | ||
@@ -52,3 +49,3 @@ | ||
// Use data converter to retrieve json after script execution | ||
s.converters[ "script json" ] = function() { | ||
s.converters["script json"] = function() { | ||
if ( !responseContainer ) { | ||
@@ -60,3 +57,3 @@ jQuery.error( callbackName + " was not called" ); | ||
// Force json dataType | ||
// force json dataType | ||
s.dataTypes[ 0 ] = "json"; | ||
@@ -71,20 +68,12 @@ | ||
// Clean-up function (fires after converters) | ||
jqXHR.always( function() { | ||
jqXHR.always(function() { | ||
// Restore preexisting value | ||
window[ callbackName ] = overwritten; | ||
// If previous value didn't exist - remove it | ||
if ( overwritten === undefined ) { | ||
jQuery( window ).removeProp( callbackName ); | ||
// Otherwise restore preexisting value | ||
} else { | ||
window[ callbackName ] = overwritten; | ||
} | ||
// Save back as free | ||
if ( s[ callbackName ] ) { | ||
// Make sure that re-using the options doesn't screw things around | ||
// make sure that re-using the options doesn't screw things around | ||
s.jsonpCallback = originalSettings.jsonpCallback; | ||
// Save the callback name for future use | ||
// save the callback name for future use | ||
oldCallbacks.push( callbackName ); | ||
@@ -99,3 +88,3 @@ } | ||
responseContainer = overwritten = undefined; | ||
} ); | ||
}); | ||
@@ -105,4 +94,4 @@ // Delegate to script | ||
} | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -8,3 +8,2 @@ "../core/parseHTML", | ||
"../selector", | ||
// Optional event/alias dependency | ||
@@ -27,5 +26,5 @@ "../event/alias" | ||
self = this, | ||
off = url.indexOf( " " ); | ||
off = url.indexOf(" "); | ||
if ( off > -1 ) { | ||
if ( off >= 0 ) { | ||
selector = jQuery.trim( url.slice( off ) ); | ||
@@ -49,12 +48,10 @@ url = url.slice( 0, off ); | ||
if ( self.length > 0 ) { | ||
jQuery.ajax( { | ||
jQuery.ajax({ | ||
url: url, | ||
// If "type" variable is undefined, then "GET" method will be used. | ||
// Make value of this field explicit since | ||
// user can override it through ajaxSetup method | ||
type: type || "GET", | ||
// if "type" variable is undefined, then "GET" method will be used | ||
type: type, | ||
dataType: "html", | ||
data: params | ||
} ).done( function( responseText ) { | ||
}).done(function( responseText ) { | ||
@@ -68,3 +65,3 @@ // Save response for use in complete callback | ||
// Exclude scripts to avoid IE 'Permission Denied' errors | ||
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : | ||
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : | ||
@@ -74,10 +71,5 @@ // Otherwise use the full result | ||
// If the request succeeds, this function gets "data", "status", "jqXHR" | ||
// but they are ignored because response was set above. | ||
// If it fails, this function gets "jqXHR", "status", "error" | ||
} ).always( callback && function( jqXHR, status ) { | ||
self.each( function() { | ||
callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); | ||
} ); | ||
} ); | ||
}).complete( callback && function( jqXHR, status ) { | ||
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); | ||
}); | ||
} | ||
@@ -88,2 +80,2 @@ | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core" | ||
@@ -13,2 +13,2 @@ ], function( jQuery ) { | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core" | ||
@@ -7,3 +7,3 @@ ], function( jQuery ) { | ||
jQuery.parseXML = function( data ) { | ||
var xml; | ||
var xml, tmp; | ||
if ( !data || typeof data !== "string" ) { | ||
@@ -15,3 +15,4 @@ return null; | ||
try { | ||
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); | ||
tmp = new DOMParser(); | ||
xml = tmp.parseFromString( data, "text/xml" ); | ||
} catch ( e ) { | ||
@@ -29,2 +30,2 @@ xml = undefined; | ||
} ); | ||
}); |
@@ -1,15 +0,13 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/document", | ||
"../ajax" | ||
], function( jQuery, document ) { | ||
], function( jQuery ) { | ||
// Install script dataType | ||
jQuery.ajaxSetup( { | ||
jQuery.ajaxSetup({ | ||
accepts: { | ||
script: "text/javascript, application/javascript, " + | ||
"application/ecmascript, application/x-ecmascript" | ||
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" | ||
}, | ||
contents: { | ||
script: /\b(?:java|ecma)script\b/ | ||
script: /(?:java|ecma)script/ | ||
}, | ||
@@ -22,3 +20,3 @@ converters: { | ||
} | ||
} ); | ||
}); | ||
@@ -33,7 +31,6 @@ // Handle cache's special case and crossDomain | ||
} | ||
} ); | ||
}); | ||
// Bind script tag hack transport | ||
jQuery.ajaxTransport( "script", function( s ) { | ||
// This transport only deals with cross domain requests | ||
@@ -44,6 +41,7 @@ if ( s.crossDomain ) { | ||
send: function( _, complete ) { | ||
script = jQuery( "<script>" ).prop( { | ||
script = jQuery("<script>").prop({ | ||
async: true, | ||
charset: s.scriptCharset, | ||
src: s.url | ||
} ).on( | ||
}).on( | ||
"load error", | ||
@@ -58,4 +56,2 @@ callback = function( evt ) { | ||
); | ||
// Use native DOM manipulation to avoid our domManip AJAX trickery | ||
document.head.appendChild( script[ 0 ] ); | ||
@@ -70,4 +66,4 @@ }, | ||
} | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,5 +0,5 @@ | ||
define( [ | ||
define([ | ||
"../../core" | ||
], function( jQuery ) { | ||
return jQuery.now(); | ||
} ); | ||
}); |
@@ -1,3 +0,3 @@ | ||
define( function() { | ||
return ( /\?/ ); | ||
} ); | ||
define(function() { | ||
return (/\?/); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -9,11 +9,11 @@ "../var/support", | ||
try { | ||
return new window.XMLHttpRequest(); | ||
} catch ( e ) {} | ||
return new XMLHttpRequest(); | ||
} catch( e ) {} | ||
}; | ||
var xhrSuccessStatus = { | ||
// File protocol always yields status code 0, assume 200 | ||
var xhrId = 0, | ||
xhrCallbacks = {}, | ||
xhrSuccessStatus = { | ||
// file protocol always yields status code 0, assume 200 | ||
0: 200, | ||
// Support: IE9 | ||
@@ -25,7 +25,18 @@ // #1450: sometimes IE returns 1223 when it should be 204 | ||
// Support: IE9 | ||
// Open requests must be manually aborted on unload (#5280) | ||
// See https://support.microsoft.com/kb/2856746 for more info | ||
if ( window.attachEvent ) { | ||
window.attachEvent( "onunload", function() { | ||
for ( var key in xhrCallbacks ) { | ||
xhrCallbacks[ key ](); | ||
} | ||
}); | ||
} | ||
support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); | ||
support.ajax = xhrSupported = !!xhrSupported; | ||
jQuery.ajaxTransport( function( options ) { | ||
var callback, errorCallback; | ||
jQuery.ajaxTransport(function( options ) { | ||
var callback; | ||
@@ -37,11 +48,6 @@ // Cross domain only allowed if supported through XMLHttpRequest | ||
var i, | ||
xhr = options.xhr(); | ||
xhr = options.xhr(), | ||
id = ++xhrId; | ||
xhr.open( | ||
options.type, | ||
options.url, | ||
options.async, | ||
options.username, | ||
options.password | ||
); | ||
xhr.open( options.type, options.url, options.async, options.username, options.password ); | ||
@@ -65,4 +71,4 @@ // Apply custom fields if provided | ||
// For same-domain requests, won't change header if already provided. | ||
if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { | ||
headers[ "X-Requested-With" ] = "XMLHttpRequest"; | ||
if ( !options.crossDomain && !headers["X-Requested-With"] ) { | ||
headers["X-Requested-With"] = "XMLHttpRequest"; | ||
} | ||
@@ -79,4 +85,4 @@ | ||
if ( callback ) { | ||
callback = errorCallback = xhr.onload = | ||
xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; | ||
delete xhrCallbacks[ id ]; | ||
callback = xhr.onload = xhr.onerror = null; | ||
@@ -86,16 +92,7 @@ if ( type === "abort" ) { | ||
} else if ( type === "error" ) { | ||
// Support: IE9 | ||
// On a manual native abort, IE9 throws | ||
// errors on any property access that is not readyState | ||
if ( typeof xhr.status !== "number" ) { | ||
complete( 0, "error" ); | ||
} else { | ||
complete( | ||
// File: protocol always yields status 0; see #8605, #14207 | ||
xhr.status, | ||
xhr.statusText | ||
); | ||
} | ||
complete( | ||
// file: protocol always yields status 0; see #8605, #14207 | ||
xhr.status, | ||
xhr.statusText | ||
); | ||
} else { | ||
@@ -105,10 +102,8 @@ complete( | ||
xhr.statusText, | ||
// Support: IE9 only | ||
// IE9 has no XHR2 but throws on binary (trac-11426) | ||
// For XHR2 non-text, let the caller handle it (gh-2498) | ||
( xhr.responseType || "text" ) !== "text" || | ||
typeof xhr.responseText !== "string" ? | ||
{ binary: xhr.response } : | ||
{ text: xhr.responseText }, | ||
// Support: IE9 | ||
// Accessing binary-data responseText throws an exception | ||
// (#11426) | ||
typeof xhr.responseText === "string" ? { | ||
text: xhr.responseText | ||
} : undefined, | ||
xhr.getAllResponseHeaders() | ||
@@ -123,37 +118,11 @@ ); | ||
xhr.onload = callback(); | ||
errorCallback = xhr.onerror = callback( "error" ); | ||
xhr.onerror = callback("error"); | ||
// Support: IE9 | ||
// Use onreadystatechange to replace onabort | ||
// to handle uncaught aborts | ||
if ( xhr.onabort !== undefined ) { | ||
xhr.onabort = errorCallback; | ||
} else { | ||
xhr.onreadystatechange = function() { | ||
// Check readyState before timeout as it changes | ||
if ( xhr.readyState === 4 ) { | ||
// Allow onerror to be called first, | ||
// but that will not handle a native abort | ||
// Also, save errorCallback to a variable | ||
// as xhr.onerror cannot be accessed | ||
window.setTimeout( function() { | ||
if ( callback ) { | ||
errorCallback(); | ||
} | ||
} ); | ||
} | ||
}; | ||
} | ||
// Create the abort callback | ||
callback = callback( "abort" ); | ||
callback = xhrCallbacks[ id ] = callback("abort"); | ||
try { | ||
// Do send the request (this may raise an exception) | ||
xhr.send( options.hasContent && options.data || null ); | ||
} catch ( e ) { | ||
// #14683: Only rethrow if this hasn't been notified as an error yet | ||
@@ -173,4 +142,4 @@ if ( callback ) { | ||
} | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -11,2 +11,2 @@ "./attributes/attr", | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,13 +0,14 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/rnotwhite", | ||
"../var/strundefined", | ||
"../core/access", | ||
"./support", | ||
"../var/rnotwhite", | ||
"../selector" | ||
], function( jQuery, access, support, rnotwhite ) { | ||
], function( jQuery, rnotwhite, strundefined, access, support ) { | ||
var boolHook, | ||
var nodeHook, boolHook, | ||
attrHandle = jQuery.expr.attrHandle; | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
attr: function( name, value ) { | ||
@@ -18,15 +19,15 @@ return access( this, jQuery.attr, name, value, arguments.length > 1 ); | ||
removeAttr: function( name ) { | ||
return this.each( function() { | ||
return this.each(function() { | ||
jQuery.removeAttr( this, name ); | ||
} ); | ||
}); | ||
} | ||
} ); | ||
}); | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
attr: function( elem, name, value ) { | ||
var ret, hooks, | ||
var hooks, ret, | ||
nType = elem.nodeType; | ||
// Don't get/set attributes on text, comment and attribute nodes | ||
if ( nType === 3 || nType === 8 || nType === 2 ) { | ||
// don't get/set attributes on text, comment and attribute nodes | ||
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { | ||
return; | ||
@@ -36,3 +37,3 @@ } | ||
// Fallback to prop when attributes are not supported | ||
if ( typeof elem.getAttribute === "undefined" ) { | ||
if ( typeof elem.getAttribute === strundefined ) { | ||
return jQuery.prop( elem, name, value ); | ||
@@ -46,43 +47,28 @@ } | ||
hooks = jQuery.attrHooks[ name ] || | ||
( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); | ||
( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); | ||
} | ||
if ( value !== undefined ) { | ||
if ( value === null ) { | ||
jQuery.removeAttr( elem, name ); | ||
return; | ||
} | ||
if ( hooks && "set" in hooks && | ||
( ret = hooks.set( elem, value, name ) ) !== undefined ) { | ||
} else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { | ||
return ret; | ||
} else { | ||
elem.setAttribute( name, value + "" ); | ||
return value; | ||
} | ||
elem.setAttribute( name, value + "" ); | ||
return value; | ||
} | ||
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { | ||
} else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { | ||
return ret; | ||
} | ||
ret = jQuery.find.attr( elem, name ); | ||
} else { | ||
ret = jQuery.find.attr( elem, name ); | ||
// Non-existent attributes return null, we normalize to undefined | ||
return ret == null ? undefined : ret; | ||
}, | ||
attrHooks: { | ||
type: { | ||
set: function( elem, value ) { | ||
if ( !support.radioValue && value === "radio" && | ||
jQuery.nodeName( elem, "input" ) ) { | ||
var val = elem.value; | ||
elem.setAttribute( "type", value ); | ||
if ( val ) { | ||
elem.value = val; | ||
} | ||
return value; | ||
} | ||
} | ||
// Non-existent attributes return null, we normalize to undefined | ||
return ret == null ? | ||
undefined : | ||
ret; | ||
} | ||
@@ -97,3 +83,3 @@ }, | ||
if ( attrNames && elem.nodeType === 1 ) { | ||
while ( ( name = attrNames[ i++ ] ) ) { | ||
while ( (name = attrNames[i++]) ) { | ||
propName = jQuery.propFix[ name ] || name; | ||
@@ -103,3 +89,2 @@ | ||
if ( jQuery.expr.match.bool.test( name ) ) { | ||
// Set corresponding property to false | ||
@@ -112,4 +97,20 @@ elem[ propName ] = false; | ||
} | ||
}, | ||
attrHooks: { | ||
type: { | ||
set: function( elem, value ) { | ||
if ( !support.radioValue && value === "radio" && | ||
jQuery.nodeName( elem, "input" ) ) { | ||
var val = elem.value; | ||
elem.setAttribute( "type", value ); | ||
if ( val ) { | ||
elem.value = val; | ||
} | ||
return value; | ||
} | ||
} | ||
} | ||
} | ||
} ); | ||
}); | ||
@@ -120,3 +121,2 @@ // Hooks for boolean attributes | ||
if ( value === false ) { | ||
// Remove boolean attributes when set to false | ||
@@ -136,3 +136,2 @@ jQuery.removeAttr( elem, name ); | ||
if ( !isXML ) { | ||
// Avoid an infinite loop by temporarily removing this function from the getter | ||
@@ -148,4 +147,4 @@ handle = attrHandle[ name ]; | ||
}; | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,36 +0,38 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/rnotwhite", | ||
"../data/var/dataPriv", | ||
"../var/strundefined", | ||
"../data/var/data_priv", | ||
"../core/init" | ||
], function( jQuery, rnotwhite, dataPriv ) { | ||
], function( jQuery, rnotwhite, strundefined, data_priv ) { | ||
var rclass = /[\t\r\n\f]/g; | ||
function getClass( elem ) { | ||
return elem.getAttribute && elem.getAttribute( "class" ) || ""; | ||
} | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
addClass: function( value ) { | ||
var classes, elem, cur, curValue, clazz, j, finalValue, | ||
i = 0; | ||
var classes, elem, cur, clazz, j, finalValue, | ||
proceed = typeof value === "string" && value, | ||
i = 0, | ||
len = this.length; | ||
if ( jQuery.isFunction( value ) ) { | ||
return this.each( function( j ) { | ||
jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); | ||
} ); | ||
return this.each(function( j ) { | ||
jQuery( this ).addClass( value.call( this, j, this.className ) ); | ||
}); | ||
} | ||
if ( typeof value === "string" && value ) { | ||
classes = value.match( rnotwhite ) || []; | ||
if ( proceed ) { | ||
// The disjunction here is for better compressibility (see removeClass) | ||
classes = ( value || "" ).match( rnotwhite ) || []; | ||
while ( ( elem = this[ i++ ] ) ) { | ||
curValue = getClass( elem ); | ||
cur = elem.nodeType === 1 && | ||
( " " + curValue + " " ).replace( rclass, " " ); | ||
for ( ; i < len; i++ ) { | ||
elem = this[ i ]; | ||
cur = elem.nodeType === 1 && ( elem.className ? | ||
( " " + elem.className + " " ).replace( rclass, " " ) : | ||
" " | ||
); | ||
if ( cur ) { | ||
j = 0; | ||
while ( ( clazz = classes[ j++ ] ) ) { | ||
while ( (clazz = classes[j++]) ) { | ||
if ( cur.indexOf( " " + clazz + " " ) < 0 ) { | ||
@@ -41,6 +43,6 @@ cur += clazz + " "; | ||
// Only assign if different to avoid unneeded rendering. | ||
// only assign if different to avoid unneeded rendering. | ||
finalValue = jQuery.trim( cur ); | ||
if ( curValue !== finalValue ) { | ||
elem.setAttribute( "class", finalValue ); | ||
if ( elem.className !== finalValue ) { | ||
elem.className = finalValue; | ||
} | ||
@@ -55,31 +57,28 @@ } | ||
removeClass: function( value ) { | ||
var classes, elem, cur, curValue, clazz, j, finalValue, | ||
i = 0; | ||
var classes, elem, cur, clazz, j, finalValue, | ||
proceed = arguments.length === 0 || typeof value === "string" && value, | ||
i = 0, | ||
len = this.length; | ||
if ( jQuery.isFunction( value ) ) { | ||
return this.each( function( j ) { | ||
jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); | ||
} ); | ||
return this.each(function( j ) { | ||
jQuery( this ).removeClass( value.call( this, j, this.className ) ); | ||
}); | ||
} | ||
if ( proceed ) { | ||
classes = ( value || "" ).match( rnotwhite ) || []; | ||
if ( !arguments.length ) { | ||
return this.attr( "class", "" ); | ||
} | ||
if ( typeof value === "string" && value ) { | ||
classes = value.match( rnotwhite ) || []; | ||
while ( ( elem = this[ i++ ] ) ) { | ||
curValue = getClass( elem ); | ||
for ( ; i < len; i++ ) { | ||
elem = this[ i ]; | ||
// This expression is here for better compressibility (see addClass) | ||
cur = elem.nodeType === 1 && | ||
( " " + curValue + " " ).replace( rclass, " " ); | ||
cur = elem.nodeType === 1 && ( elem.className ? | ||
( " " + elem.className + " " ).replace( rclass, " " ) : | ||
"" | ||
); | ||
if ( cur ) { | ||
j = 0; | ||
while ( ( clazz = classes[ j++ ] ) ) { | ||
while ( (clazz = classes[j++]) ) { | ||
// Remove *all* instances | ||
while ( cur.indexOf( " " + clazz + " " ) > -1 ) { | ||
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { | ||
cur = cur.replace( " " + clazz + " ", " " ); | ||
@@ -90,5 +89,5 @@ } | ||
// Only assign if different to avoid unneeded rendering. | ||
finalValue = jQuery.trim( cur ); | ||
if ( curValue !== finalValue ) { | ||
elem.setAttribute( "class", finalValue ); | ||
finalValue = value ? jQuery.trim( cur ) : ""; | ||
if ( elem.className !== finalValue ) { | ||
elem.className = finalValue; | ||
} | ||
@@ -110,22 +109,16 @@ } | ||
if ( jQuery.isFunction( value ) ) { | ||
return this.each( function( i ) { | ||
jQuery( this ).toggleClass( | ||
value.call( this, i, getClass( this ), stateVal ), | ||
stateVal | ||
); | ||
} ); | ||
return this.each(function( i ) { | ||
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); | ||
}); | ||
} | ||
return this.each( function() { | ||
var className, i, self, classNames; | ||
return this.each(function() { | ||
if ( type === "string" ) { | ||
// Toggle individual class names | ||
i = 0; | ||
self = jQuery( this ); | ||
classNames = value.match( rnotwhite ) || []; | ||
var className, | ||
i = 0, | ||
self = jQuery( this ), | ||
classNames = value.match( rnotwhite ) || []; | ||
while ( ( className = classNames[ i++ ] ) ) { | ||
while ( (className = classNames[ i++ ]) ) { | ||
// Check each className given, space separated list | ||
@@ -140,8 +133,6 @@ if ( self.hasClass( className ) ) { | ||
// Toggle whole class name | ||
} else if ( value === undefined || type === "boolean" ) { | ||
className = getClass( this ); | ||
if ( className ) { | ||
// Store className if set | ||
dataPriv.set( this, "__className__", className ); | ||
} else if ( type === strundefined || type === "boolean" ) { | ||
if ( this.className ) { | ||
// store className if set | ||
data_priv.set( this, "__className__", this.className ); | ||
} | ||
@@ -153,23 +144,13 @@ | ||
// falling back to the empty string if nothing was stored. | ||
if ( this.setAttribute ) { | ||
this.setAttribute( "class", | ||
className || value === false ? | ||
"" : | ||
dataPriv.get( this, "__className__" ) || "" | ||
); | ||
} | ||
this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || ""; | ||
} | ||
} ); | ||
}); | ||
}, | ||
hasClass: function( selector ) { | ||
var className, elem, | ||
i = 0; | ||
className = " " + selector + " "; | ||
while ( ( elem = this[ i++ ] ) ) { | ||
if ( elem.nodeType === 1 && | ||
( " " + getClass( elem ) + " " ).replace( rclass, " " ) | ||
.indexOf( className ) > -1 | ||
) { | ||
var className = " " + selector + " ", | ||
i = 0, | ||
l = this.length; | ||
for ( ; i < l; i++ ) { | ||
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { | ||
return true; | ||
@@ -181,4 +162,4 @@ } | ||
} | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,12 +0,10 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../core/access", | ||
"./support", | ||
"../selector" | ||
"./support" | ||
], function( jQuery, access, support ) { | ||
var rfocusable = /^(?:input|select|textarea|button)$/i, | ||
rclickable = /^(?:a|area)$/i; | ||
var rfocusable = /^(?:input|select|textarea|button)$/i; | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
prop: function( name, value ) { | ||
@@ -17,20 +15,26 @@ return access( this, jQuery.prop, name, value, arguments.length > 1 ); | ||
removeProp: function( name ) { | ||
return this.each( function() { | ||
return this.each(function() { | ||
delete this[ jQuery.propFix[ name ] || name ]; | ||
} ); | ||
}); | ||
} | ||
} ); | ||
}); | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
propFix: { | ||
"for": "htmlFor", | ||
"class": "className" | ||
}, | ||
prop: function( elem, name, value ) { | ||
var ret, hooks, | ||
var ret, hooks, notxml, | ||
nType = elem.nodeType; | ||
// Don't get/set properties on text, comment and attribute nodes | ||
if ( nType === 3 || nType === 8 || nType === 2 ) { | ||
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { | ||
return; | ||
} | ||
if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { | ||
notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); | ||
if ( notxml ) { | ||
// Fix name and attach hooks | ||
@@ -42,15 +46,11 @@ name = jQuery.propFix[ name ] || name; | ||
if ( value !== undefined ) { | ||
if ( hooks && "set" in hooks && | ||
( ret = hooks.set( elem, value, name ) ) !== undefined ) { | ||
return ret; | ||
} | ||
return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? | ||
ret : | ||
( elem[ name ] = value ); | ||
return ( elem[ name ] = value ); | ||
} else { | ||
return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? | ||
ret : | ||
elem[ name ]; | ||
} | ||
if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { | ||
return ret; | ||
} | ||
return elem[ name ]; | ||
}, | ||
@@ -61,31 +61,10 @@ | ||
get: function( elem ) { | ||
// elem.tabIndex doesn't always return the | ||
// correct value when it hasn't been explicitly set | ||
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ | ||
// Use proper attribute retrieval(#12072) | ||
var tabindex = jQuery.find.attr( elem, "tabindex" ); | ||
return tabindex ? | ||
parseInt( tabindex, 10 ) : | ||
rfocusable.test( elem.nodeName ) || | ||
rclickable.test( elem.nodeName ) && elem.href ? | ||
0 : | ||
-1; | ||
return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ? | ||
elem.tabIndex : | ||
-1; | ||
} | ||
} | ||
}, | ||
propFix: { | ||
"for": "htmlFor", | ||
"class": "className" | ||
} | ||
} ); | ||
}); | ||
// Support: IE <=11 only | ||
// Accessing the selectedIndex property | ||
// forces the browser to respect setting selected | ||
// on the option | ||
// The getter ensures a default option is selected | ||
// when in an optgroup | ||
if ( !support.optSelected ) { | ||
@@ -99,12 +78,2 @@ jQuery.propHooks.selected = { | ||
return null; | ||
}, | ||
set: function( elem ) { | ||
var parent = elem.parentNode; | ||
if ( parent ) { | ||
parent.selectedIndex; | ||
if ( parent.parentNode ) { | ||
parent.parentNode.selectedIndex; | ||
} | ||
} | ||
} | ||
@@ -114,3 +83,3 @@ }; | ||
jQuery.each( [ | ||
jQuery.each([ | ||
"tabIndex", | ||
@@ -128,4 +97,4 @@ "readOnly", | ||
jQuery.propFix[ this.toLowerCase() ] = this; | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,7 +0,6 @@ | ||
define( [ | ||
"../var/document", | ||
define([ | ||
"../var/support" | ||
], function( document, support ) { | ||
], function( support ) { | ||
( function() { | ||
(function() { | ||
var input = document.createElement( "input" ), | ||
@@ -32,6 +31,6 @@ select = document.createElement( "select" ), | ||
support.radioValue = input.value === "t"; | ||
} )(); | ||
})(); | ||
return support; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -7,19 +7,14 @@ "./support", | ||
var rreturn = /\r/g, | ||
rspaces = /[\x20\t\r\n\f]+/g; | ||
var rreturn = /\r/g; | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
val: function( value ) { | ||
var hooks, ret, isFunction, | ||
elem = this[ 0 ]; | ||
elem = this[0]; | ||
if ( !arguments.length ) { | ||
if ( elem ) { | ||
hooks = jQuery.valHooks[ elem.type ] || | ||
jQuery.valHooks[ elem.nodeName.toLowerCase() ]; | ||
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; | ||
if ( hooks && | ||
"get" in hooks && | ||
( ret = hooks.get( elem, "value" ) ) !== undefined | ||
) { | ||
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { | ||
return ret; | ||
@@ -31,6 +26,4 @@ } | ||
return typeof ret === "string" ? | ||
// Handle most common string cases | ||
ret.replace( rreturn, "" ) : | ||
ret.replace(rreturn, "") : | ||
// Handle cases where value is null/undef or number | ||
@@ -45,3 +38,3 @@ ret == null ? "" : ret; | ||
return this.each( function( i ) { | ||
return this.each(function( i ) { | ||
var val; | ||
@@ -69,3 +62,3 @@ | ||
return value == null ? "" : value + ""; | ||
} ); | ||
}); | ||
} | ||
@@ -76,23 +69,19 @@ | ||
// If set returns undefined, fall back to normal setting | ||
if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { | ||
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { | ||
this.value = val; | ||
} | ||
} ); | ||
}); | ||
} | ||
} ); | ||
}); | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
valHooks: { | ||
option: { | ||
get: function( elem ) { | ||
var val = jQuery.find.attr( elem, "value" ); | ||
return val != null ? | ||
val : | ||
// Support: IE10-11+ | ||
// option.text throws exceptions (#14686, #14858) | ||
// Strip and collapse whitespace | ||
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace | ||
jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); | ||
jQuery.trim( jQuery.text( elem ) ); | ||
} | ||
@@ -116,10 +105,7 @@ }, | ||
// IE8-9 doesn't update selected after form reset (#2551) | ||
// IE6-9 doesn't update selected after form reset (#2551) | ||
if ( ( option.selected || i === index ) && | ||
// Don't return options that are disabled or in a disabled optgroup | ||
( support.optDisabled ? | ||
!option.disabled : option.getAttribute( "disabled" ) === null ) && | ||
( !option.parentNode.disabled || | ||
!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { | ||
( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) && | ||
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { | ||
@@ -150,5 +136,3 @@ // Get the specific value for the option | ||
option = options[ i ]; | ||
if ( option.selected = | ||
jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 | ||
) { | ||
if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) { | ||
optionSet = true; | ||
@@ -166,10 +150,10 @@ } | ||
} | ||
} ); | ||
}); | ||
// Radios and checkboxes getter/setter | ||
jQuery.each( [ "radio", "checkbox" ], function() { | ||
jQuery.each([ "radio", "checkbox" ], function() { | ||
jQuery.valHooks[ this ] = { | ||
set: function( elem, value ) { | ||
if ( jQuery.isArray( value ) ) { | ||
return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); | ||
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); | ||
} | ||
@@ -180,7 +164,7 @@ } | ||
jQuery.valHooks[ this ].get = function( elem ) { | ||
return elem.getAttribute( "value" ) === null ? "on" : elem.value; | ||
return elem.getAttribute("value") === null ? "on" : elem.value; | ||
}; | ||
} | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -6,8 +6,11 @@ "./var/rnotwhite" | ||
// Convert String-formatted options into Object-formatted ones | ||
// String to Object options format cache | ||
var optionsCache = {}; | ||
// Convert String-formatted options into Object-formatted ones and store in cache | ||
function createOptions( options ) { | ||
var object = {}; | ||
var object = optionsCache[ options ] = {}; | ||
jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { | ||
object[ flag ] = true; | ||
} ); | ||
}); | ||
return object; | ||
@@ -43,100 +46,77 @@ } | ||
options = typeof options === "string" ? | ||
createOptions( options ) : | ||
( optionsCache[ options ] || createOptions( options ) ) : | ||
jQuery.extend( {}, options ); | ||
var // Flag to know if list is currently firing | ||
firing, | ||
// Last fire value for non-forgettable lists | ||
var // Last fire value (for non-forgettable lists) | ||
memory, | ||
// Flag to know if list was already fired | ||
fired, | ||
// Flag to prevent firing | ||
locked, | ||
// Flag to know if list is currently firing | ||
firing, | ||
// First callback to fire (used internally by add and fireWith) | ||
firingStart, | ||
// End of the loop when firing | ||
firingLength, | ||
// Index of currently firing callback (modified by remove if needed) | ||
firingIndex, | ||
// Actual callback list | ||
list = [], | ||
// Queue of execution data for repeatable lists | ||
queue = [], | ||
// Index of currently firing callback (modified by add/remove as needed) | ||
firingIndex = -1, | ||
// Stack of fire calls for repeatable lists | ||
stack = !options.once && [], | ||
// Fire callbacks | ||
fire = function() { | ||
// Enforce single-firing | ||
locked = options.once; | ||
// Execute callbacks for all pending executions, | ||
// respecting firingIndex overrides and runtime changes | ||
fired = firing = true; | ||
for ( ; queue.length; firingIndex = -1 ) { | ||
memory = queue.shift(); | ||
while ( ++firingIndex < list.length ) { | ||
// Run callback and check for early termination | ||
if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && | ||
options.stopOnFalse ) { | ||
// Jump to end and forget the data so .add doesn't re-fire | ||
firingIndex = list.length; | ||
memory = false; | ||
} | ||
fire = function( data ) { | ||
memory = options.memory && data; | ||
fired = true; | ||
firingIndex = firingStart || 0; | ||
firingStart = 0; | ||
firingLength = list.length; | ||
firing = true; | ||
for ( ; list && firingIndex < firingLength; firingIndex++ ) { | ||
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { | ||
memory = false; // To prevent further calls using add | ||
break; | ||
} | ||
} | ||
// Forget the data if we're done with it | ||
if ( !options.memory ) { | ||
memory = false; | ||
} | ||
firing = false; | ||
// Clean up if we're done firing for good | ||
if ( locked ) { | ||
// Keep an empty list if we have data for future add calls | ||
if ( memory ) { | ||
if ( list ) { | ||
if ( stack ) { | ||
if ( stack.length ) { | ||
fire( stack.shift() ); | ||
} | ||
} else if ( memory ) { | ||
list = []; | ||
// Otherwise, this object is spent | ||
} else { | ||
list = ""; | ||
self.disable(); | ||
} | ||
} | ||
}, | ||
// Actual Callbacks object | ||
self = { | ||
// Add a callback or a collection of callbacks to the list | ||
add: function() { | ||
if ( list ) { | ||
// If we have memory from a past run, we should fire after adding | ||
if ( memory && !firing ) { | ||
firingIndex = list.length - 1; | ||
queue.push( memory ); | ||
} | ||
( function add( args ) { | ||
// First, we save the current length | ||
var start = list.length; | ||
(function add( args ) { | ||
jQuery.each( args, function( _, arg ) { | ||
if ( jQuery.isFunction( arg ) ) { | ||
var type = jQuery.type( arg ); | ||
if ( type === "function" ) { | ||
if ( !options.unique || !self.has( arg ) ) { | ||
list.push( arg ); | ||
} | ||
} else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { | ||
} else if ( arg && arg.length && type !== "string" ) { | ||
// Inspect recursively | ||
add( arg ); | ||
} | ||
} ); | ||
} )( arguments ); | ||
if ( memory && !firing ) { | ||
fire(); | ||
}); | ||
})( arguments ); | ||
// Do we need to add the callbacks to the | ||
// current firing batch? | ||
if ( firing ) { | ||
firingLength = list.length; | ||
// With memory, if we're not firing then | ||
// we should call right away | ||
} else if ( memory ) { | ||
firingStart = start; | ||
fire( memory ); | ||
} | ||
@@ -146,69 +126,64 @@ } | ||
}, | ||
// Remove a callback from the list | ||
remove: function() { | ||
jQuery.each( arguments, function( _, arg ) { | ||
var index; | ||
while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { | ||
list.splice( index, 1 ); | ||
// Handle firing indexes | ||
if ( index <= firingIndex ) { | ||
firingIndex--; | ||
if ( list ) { | ||
jQuery.each( arguments, function( _, arg ) { | ||
var index; | ||
while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { | ||
list.splice( index, 1 ); | ||
// Handle firing indexes | ||
if ( firing ) { | ||
if ( index <= firingLength ) { | ||
firingLength--; | ||
} | ||
if ( index <= firingIndex ) { | ||
firingIndex--; | ||
} | ||
} | ||
} | ||
} | ||
} ); | ||
}); | ||
} | ||
return this; | ||
}, | ||
// Check if a given callback is in the list. | ||
// If no argument is given, return whether or not list has callbacks attached. | ||
has: function( fn ) { | ||
return fn ? | ||
jQuery.inArray( fn, list ) > -1 : | ||
list.length > 0; | ||
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); | ||
}, | ||
// Remove all callbacks from the list | ||
empty: function() { | ||
if ( list ) { | ||
list = []; | ||
} | ||
list = []; | ||
firingLength = 0; | ||
return this; | ||
}, | ||
// Disable .fire and .add | ||
// Abort any current/pending executions | ||
// Clear all callbacks and values | ||
// Have the list do nothing anymore | ||
disable: function() { | ||
locked = queue = []; | ||
list = memory = ""; | ||
list = stack = memory = undefined; | ||
return this; | ||
}, | ||
// Is it disabled? | ||
disabled: function() { | ||
return !list; | ||
}, | ||
// Disable .fire | ||
// Also disable .add unless we have memory (since it would have no effect) | ||
// Abort any pending executions | ||
// Lock the list in its current state | ||
lock: function() { | ||
locked = queue = []; | ||
stack = undefined; | ||
if ( !memory ) { | ||
list = memory = ""; | ||
self.disable(); | ||
} | ||
return this; | ||
}, | ||
// Is it locked? | ||
locked: function() { | ||
return !!locked; | ||
return !stack; | ||
}, | ||
// Call all callbacks with the given context and arguments | ||
fireWith: function( context, args ) { | ||
if ( !locked ) { | ||
if ( list && ( !fired || stack ) ) { | ||
args = args || []; | ||
args = [ context, args.slice ? args.slice() : args ]; | ||
queue.push( args ); | ||
if ( !firing ) { | ||
fire(); | ||
if ( firing ) { | ||
stack.push( args ); | ||
} else { | ||
fire( args ); | ||
} | ||
@@ -218,3 +193,2 @@ } | ||
}, | ||
// Call all the callbacks with the given arguments | ||
@@ -225,3 +199,2 @@ fire: function() { | ||
}, | ||
// To know if the callbacks have already been called at least once | ||
@@ -237,2 +210,2 @@ fired: function() { | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,4 +0,3 @@ | ||
define( [ | ||
define([ | ||
"./var/arr", | ||
"./var/document", | ||
"./var/slice", | ||
@@ -12,5 +11,8 @@ "./var/concat", | ||
"./var/support" | ||
], function( arr, document, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) { | ||
], function( arr, slice, concat, push, indexOf, class2type, toString, hasOwn, support ) { | ||
var | ||
// Use the correct document accordingly with window argument (sandbox) | ||
document = window.document, | ||
version = "@VERSION", | ||
@@ -20,3 +22,2 @@ | ||
jQuery = function( selector, context ) { | ||
// The jQuery object is actually just the init constructor 'enhanced' | ||
@@ -41,3 +42,2 @@ // Need init if jQuery is called (just allow error to be thrown if not included) | ||
jQuery.fn = jQuery.prototype = { | ||
// The current version of jQuery being used | ||
@@ -86,10 +86,12 @@ jquery: version, | ||
// Execute a callback for every element in the matched set. | ||
each: function( callback ) { | ||
return jQuery.each( this, callback ); | ||
// (You can seed the arguments with an array of args, but this is | ||
// only used internally.) | ||
each: function( callback, args ) { | ||
return jQuery.each( this, callback, args ); | ||
}, | ||
map: function( callback ) { | ||
return this.pushStack( jQuery.map( this, function( elem, i ) { | ||
return this.pushStack( jQuery.map(this, function( elem, i ) { | ||
return callback.call( elem, i, elem ); | ||
} ) ); | ||
})); | ||
}, | ||
@@ -112,7 +114,7 @@ | ||
j = +i + ( i < 0 ? len : 0 ); | ||
return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); | ||
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); | ||
}, | ||
end: function() { | ||
return this.prevObject || this.constructor(); | ||
return this.prevObject || this.constructor(null); | ||
}, | ||
@@ -129,3 +131,3 @@ | ||
var options, name, src, copy, copyIsArray, clone, | ||
target = arguments[ 0 ] || {}, | ||
target = arguments[0] || {}, | ||
i = 1, | ||
@@ -145,3 +147,3 @@ length = arguments.length, | ||
// Handle case when target is a string or something (possible in deep copy) | ||
if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { | ||
if ( typeof target !== "object" && !jQuery.isFunction(target) ) { | ||
target = {}; | ||
@@ -157,6 +159,4 @@ } | ||
for ( ; i < length; i++ ) { | ||
// Only deal with non-null/undefined values | ||
if ( ( options = arguments[ i ] ) != null ) { | ||
if ( (options = arguments[ i ]) != null ) { | ||
// Extend the base object | ||
@@ -173,11 +173,9 @@ for ( name in options ) { | ||
// Recurse if we're merging plain objects or arrays | ||
if ( deep && copy && ( jQuery.isPlainObject( copy ) || | ||
( copyIsArray = jQuery.isArray( copy ) ) ) ) { | ||
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { | ||
if ( copyIsArray ) { | ||
copyIsArray = false; | ||
clone = src && jQuery.isArray( src ) ? src : []; | ||
clone = src && jQuery.isArray(src) ? src : []; | ||
} else { | ||
clone = src && jQuery.isPlainObject( src ) ? src : {}; | ||
clone = src && jQuery.isPlainObject(src) ? src : {}; | ||
} | ||
@@ -200,4 +198,3 @@ | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
// Unique for each copy of jQuery on the page | ||
@@ -216,3 +213,3 @@ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), | ||
isFunction: function( obj ) { | ||
return jQuery.type( obj ) === "function"; | ||
return jQuery.type(obj) === "function"; | ||
}, | ||
@@ -227,3 +224,2 @@ | ||
isNumeric: function( obj ) { | ||
// parseFloat NaNs numeric-cast false positives (null|true|false|"") | ||
@@ -233,9 +229,6 @@ // ...but misinterprets leading-number strings, particularly hex literals ("0x...") | ||
// adding 1 corrects loss of precision from parseFloat (#15100) | ||
var realStringObj = obj && obj.toString(); | ||
return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; | ||
return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; | ||
}, | ||
isPlainObject: function( obj ) { | ||
var key; | ||
// Not plain objects: | ||
@@ -249,14 +242,10 @@ // - Any object or value whose internal [[Class]] property is not "[object Object]" | ||
// Not own constructor property must be Object | ||
if ( obj.constructor && | ||
!hasOwn.call( obj, "constructor" ) && | ||
!hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) { | ||
!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { | ||
return false; | ||
} | ||
// Own properties are enumerated firstly, so to speed up, | ||
// if last one is own, then all properties are own | ||
for ( key in obj ) {} | ||
return key === undefined || hasOwn.call( obj, key ); | ||
// If the function hasn't returned already, we're confident that | ||
// |obj| is a plain object, created by {} or constructed with new Object | ||
return true; | ||
}, | ||
@@ -276,6 +265,5 @@ | ||
} | ||
// Support: Android<4.0, iOS<6 (functionish RegExp) | ||
return typeof obj === "object" || typeof obj === "function" ? | ||
class2type[ toString.call( obj ) ] || "object" : | ||
class2type[ toString.call(obj) ] || "object" : | ||
typeof obj; | ||
@@ -292,15 +280,12 @@ }, | ||
if ( code ) { | ||
// If the code includes a valid, prologue position | ||
// strict mode pragma, execute code by injecting a | ||
// script tag into the document. | ||
if ( code.indexOf( "use strict" ) === 1 ) { | ||
script = document.createElement( "script" ); | ||
if ( code.indexOf("use strict") === 1 ) { | ||
script = document.createElement("script"); | ||
script.text = code; | ||
document.head.appendChild( script ).parentNode.removeChild( script ); | ||
} else { | ||
// Otherwise, avoid the DOM node creation, insertion | ||
// and removal by using an indirect global eval | ||
// Otherwise, avoid the DOM node creation, insertion | ||
// and removal by using an indirect global eval | ||
indirect( code ); | ||
@@ -322,17 +307,46 @@ } | ||
each: function( obj, callback ) { | ||
var length, i = 0; | ||
// args is for internal usage only | ||
each: function( obj, callback, args ) { | ||
var value, | ||
i = 0, | ||
length = obj.length, | ||
isArray = isArraylike( obj ); | ||
if ( isArrayLike( obj ) ) { | ||
length = obj.length; | ||
for ( ; i < length; i++ ) { | ||
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { | ||
break; | ||
if ( args ) { | ||
if ( isArray ) { | ||
for ( ; i < length; i++ ) { | ||
value = callback.apply( obj[ i ], args ); | ||
if ( value === false ) { | ||
break; | ||
} | ||
} | ||
} else { | ||
for ( i in obj ) { | ||
value = callback.apply( obj[ i ], args ); | ||
if ( value === false ) { | ||
break; | ||
} | ||
} | ||
} | ||
// A special, fast, case for the most common use of each | ||
} else { | ||
for ( i in obj ) { | ||
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { | ||
break; | ||
if ( isArray ) { | ||
for ( ; i < length; i++ ) { | ||
value = callback.call( obj[ i ], i, obj[ i ] ); | ||
if ( value === false ) { | ||
break; | ||
} | ||
} | ||
} else { | ||
for ( i in obj ) { | ||
value = callback.call( obj[ i ], i, obj[ i ] ); | ||
if ( value === false ) { | ||
break; | ||
} | ||
} | ||
} | ||
@@ -356,3 +370,3 @@ } | ||
if ( arr != null ) { | ||
if ( isArrayLike( Object( arr ) ) ) { | ||
if ( isArraylike( Object(arr) ) ) { | ||
jQuery.merge( ret, | ||
@@ -409,9 +423,10 @@ typeof arr === "string" ? | ||
map: function( elems, callback, arg ) { | ||
var length, value, | ||
var value, | ||
i = 0, | ||
length = elems.length, | ||
isArray = isArraylike( elems ), | ||
ret = []; | ||
// Go through the array, translating each of the items to their new values | ||
if ( isArrayLike( elems ) ) { | ||
length = elems.length; | ||
if ( isArray ) { | ||
for ( ; i < length; i++ ) { | ||
@@ -477,21 +492,10 @@ value = callback( elems[ i ], i, arg ); | ||
support: support | ||
} ); | ||
}); | ||
// JSHint would error on this code due to the Symbol not being defined in ES5. | ||
// Defining this global in .jshintrc would create a danger of using the global | ||
// unguarded in another place, it seems safer to just disable JSHint for these | ||
// three lines. | ||
/* jshint ignore: start */ | ||
if ( typeof Symbol === "function" ) { | ||
jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; | ||
} | ||
/* jshint ignore: end */ | ||
// Populate the class2type map | ||
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), | ||
function( i, name ) { | ||
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { | ||
class2type[ "[object " + name + "]" ] = name.toLowerCase(); | ||
} ); | ||
}); | ||
function isArrayLike( obj ) { | ||
function isArraylike( obj ) { | ||
@@ -502,3 +506,3 @@ // Support: iOS 8.2 (not reproducible in simulator) | ||
// regarding Nodelist length in IE | ||
var length = !!obj && "length" in obj && obj.length, | ||
var length = "length" in obj && obj.length, | ||
type = jQuery.type( obj ); | ||
@@ -510,2 +514,6 @@ | ||
if ( obj.nodeType === 1 && length ) { | ||
return true; | ||
} | ||
return type === "array" || length === 0 || | ||
@@ -516,2 +524,2 @@ typeof length === "number" && length > 0 && ( length - 1 ) in obj; | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core" | ||
@@ -7,3 +7,3 @@ ], function( jQuery ) { | ||
// The value/s can optionally be executed if it's a function | ||
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { | ||
var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { | ||
var i = 0, | ||
@@ -17,3 +17,3 @@ len = elems.length, | ||
for ( i in key ) { | ||
access( elems, fn, i, key[ i ], true, emptyGet, raw ); | ||
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); | ||
} | ||
@@ -30,3 +30,2 @@ | ||
if ( bulk ) { | ||
// Bulk operations run against the entire set | ||
@@ -48,7 +47,3 @@ if ( raw ) { | ||
for ( ; i < len; i++ ) { | ||
fn( | ||
elems[ i ], key, raw ? | ||
value : | ||
value.call( elems[ i ], i, fn( elems[ i ], key ) ) | ||
); | ||
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); | ||
} | ||
@@ -64,3 +59,3 @@ } | ||
fn.call( elems ) : | ||
len ? fn( elems[ 0 ], key ) : emptyGet; | ||
len ? fn( elems[0], key ) : emptyGet; | ||
}; | ||
@@ -70,2 +65,2 @@ | ||
} ); | ||
}); |
// Initialize a jQuery object | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/document", | ||
"./var/rsingleTag", | ||
"../traversing/findFilter" | ||
], function( jQuery, document, rsingleTag ) { | ||
], function( jQuery, rsingleTag ) { | ||
@@ -17,3 +16,3 @@ // A central reference to the root jQuery(document) | ||
init = jQuery.fn.init = function( selector, context, root ) { | ||
init = jQuery.fn.init = function( selector, context ) { | ||
var match, elem; | ||
@@ -26,12 +25,5 @@ | ||
// Method init() accepts an alternate rootjQuery | ||
// so migrate can support jQuery.sub (gh-2101) | ||
root = root || rootjQuery; | ||
// Handle HTML strings | ||
if ( typeof selector === "string" ) { | ||
if ( selector[ 0 ] === "<" && | ||
selector[ selector.length - 1 ] === ">" && | ||
selector.length >= 3 ) { | ||
if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { | ||
// Assume that strings that start and end with <> are HTML and skip the regex check | ||
@@ -45,7 +37,7 @@ match = [ null, selector, null ]; | ||
// Match html or make sure no context is specified for #id | ||
if ( match && ( match[ 1 ] || !context ) ) { | ||
if ( match && (match[1] || !context) ) { | ||
// HANDLE: $(html) -> $(array) | ||
if ( match[ 1 ] ) { | ||
context = context instanceof jQuery ? context[ 0 ] : context; | ||
if ( match[1] ) { | ||
context = context instanceof jQuery ? context[0] : context; | ||
@@ -55,3 +47,3 @@ // Option to run scripts is true for back-compat | ||
jQuery.merge( this, jQuery.parseHTML( | ||
match[ 1 ], | ||
match[1], | ||
context && context.nodeType ? context.ownerDocument || context : document, | ||
@@ -62,5 +54,4 @@ true | ||
// HANDLE: $(html, props) | ||
if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { | ||
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { | ||
for ( match in context ) { | ||
// Properties of context are called as methods if possible | ||
@@ -81,3 +72,3 @@ if ( jQuery.isFunction( this[ match ] ) ) { | ||
} else { | ||
elem = document.getElementById( match[ 2 ] ); | ||
elem = document.getElementById( match[2] ); | ||
@@ -87,6 +78,5 @@ // Support: Blackberry 4.6 | ||
if ( elem && elem.parentNode ) { | ||
// Inject the element directly into the jQuery object | ||
this.length = 1; | ||
this[ 0 ] = elem; | ||
this[0] = elem; | ||
} | ||
@@ -101,3 +91,3 @@ | ||
} else if ( !context || context.jquery ) { | ||
return ( context || root ).find( selector ); | ||
return ( context || rootjQuery ).find( selector ); | ||
@@ -112,3 +102,3 @@ // HANDLE: $(expr, context) | ||
} else if ( selector.nodeType ) { | ||
this.context = this[ 0 ] = selector; | ||
this.context = this[0] = selector; | ||
this.length = 1; | ||
@@ -120,5 +110,4 @@ return this; | ||
} else if ( jQuery.isFunction( selector ) ) { | ||
return root.ready !== undefined ? | ||
root.ready( selector ) : | ||
return typeof rootjQuery.ready !== "undefined" ? | ||
rootjQuery.ready( selector ) : | ||
// Execute immediately if ready is not present | ||
@@ -144,2 +133,2 @@ selector( jQuery ); | ||
} ); | ||
}); |
@@ -1,11 +0,9 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/document", | ||
"./var/rsingleTag", | ||
"../manipulation/buildFragment" | ||
], function( jQuery, document, rsingleTag, buildFragment ) { | ||
"../manipulation" // buildFragment | ||
], function( jQuery, rsingleTag ) { | ||
// Argument "data" should be string of html | ||
// context (optional): If specified, the fragment will be created in this context, | ||
// defaults to document | ||
// data: string of html | ||
// context (optional): If specified, the fragment will be created in this context, defaults to document | ||
// keepScripts (optional): If true, will include scripts passed in the html string | ||
@@ -27,6 +25,6 @@ jQuery.parseHTML = function( data, context, keepScripts ) { | ||
if ( parsed ) { | ||
return [ context.createElement( parsed[ 1 ] ) ]; | ||
return [ context.createElement( parsed[1] ) ]; | ||
} | ||
parsed = buildFragment( [ data ], context, scripts ); | ||
parsed = jQuery.buildFragment( [ data ], context, scripts ); | ||
@@ -42,2 +40,2 @@ if ( scripts && scripts.length ) { | ||
} ); | ||
}); |
@@ -1,7 +0,6 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/document", | ||
"../core/init", | ||
"../deferred" | ||
], function( jQuery, document ) { | ||
], function( jQuery ) { | ||
@@ -12,3 +11,2 @@ // The deferred used on DOM ready | ||
jQuery.fn.ready = function( fn ) { | ||
// Add the callback | ||
@@ -20,4 +18,3 @@ jQuery.ready.promise().done( fn ); | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
// Is the DOM ready to be used? Set to true once it occurs. | ||
@@ -64,3 +61,3 @@ isReady: false, | ||
} | ||
} ); | ||
}); | ||
@@ -71,4 +68,4 @@ /** | ||
function completed() { | ||
document.removeEventListener( "DOMContentLoaded", completed ); | ||
window.removeEventListener( "load", completed ); | ||
document.removeEventListener( "DOMContentLoaded", completed, false ); | ||
window.removeEventListener( "load", completed, false ); | ||
jQuery.ready(); | ||
@@ -82,11 +79,8 @@ } | ||
// Catch cases where $(document).ready() is called | ||
// after the browser event has already occurred. | ||
// Support: IE9-10 only | ||
// Older IE sometimes signals "interactive" too soon | ||
if ( document.readyState === "complete" || | ||
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { | ||
// Catch cases where $(document).ready() is called after the browser event has already occurred. | ||
// We once tried to use readyState "interactive" here, but it caused issues like the one | ||
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 | ||
if ( document.readyState === "complete" ) { | ||
// Handle it asynchronously to allow scripts the opportunity to delay ready | ||
window.setTimeout( jQuery.ready ); | ||
setTimeout( jQuery.ready ); | ||
@@ -96,6 +90,6 @@ } else { | ||
// Use the handy event callback | ||
document.addEventListener( "DOMContentLoaded", completed ); | ||
document.addEventListener( "DOMContentLoaded", completed, false ); | ||
// A fallback to window.onload, that will always work | ||
window.addEventListener( "load", completed ); | ||
window.addEventListener( "load", completed, false ); | ||
} | ||
@@ -109,2 +103,2 @@ } | ||
} ); | ||
}); |
@@ -1,5 +0,4 @@ | ||
define( function() { | ||
define(function() { | ||
// Match a standalone tag | ||
return ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); | ||
} ); | ||
return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -6,4 +6,2 @@ "./var/pnum", | ||
"./css/var/rmargin", | ||
"./var/document", | ||
"./var/rcssNum", | ||
"./css/var/rnumnonpx", | ||
@@ -13,22 +11,21 @@ "./css/var/cssExpand", | ||
"./css/var/getStyles", | ||
"./css/var/swap", | ||
"./css/curCSS", | ||
"./css/adjustCSS", | ||
"./css/defaultDisplay", | ||
"./css/addGetHookIf", | ||
"./css/support", | ||
"./data/var/dataPriv", | ||
"./data/var/data_priv", | ||
"./core/init", | ||
"./css/swap", | ||
"./core/ready", | ||
"./selector" // contains | ||
], function( jQuery, pnum, access, rmargin, document, rcssNum, rnumnonpx, cssExpand, isHidden, | ||
getStyles, swap, curCSS, adjustCSS, defaultDisplay, addGetHookIf, support, dataPriv ) { | ||
], function( jQuery, pnum, access, rmargin, rnumnonpx, cssExpand, isHidden, | ||
getStyles, curCSS, defaultDisplay, addGetHookIf, support, data_priv ) { | ||
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" ), | ||
@@ -41,10 +38,9 @@ cssShow = { position: "absolute", visibility: "hidden", display: "block" }, | ||
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], | ||
emptyStyle = document.createElement( "div" ).style; | ||
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; | ||
// Return a css property mapped to a potentially vendor prefixed property | ||
function vendorPropName( name ) { | ||
function vendorPropName( style, name ) { | ||
// Shortcut for names that are not vendor prefixed | ||
if ( name in emptyStyle ) { | ||
if ( name in style ) { | ||
return name; | ||
@@ -54,3 +50,4 @@ } | ||
// Check for vendor prefixed names | ||
var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), | ||
var capName = name[0].toUpperCase() + name.slice(1), | ||
origName = name, | ||
i = cssPrefixes.length; | ||
@@ -60,17 +57,15 @@ | ||
name = cssPrefixes[ i ] + capName; | ||
if ( name in emptyStyle ) { | ||
if ( name in style ) { | ||
return name; | ||
} | ||
} | ||
return origName; | ||
} | ||
function setPositiveNumber( elem, value, subtract ) { | ||
// Any relative (+/-) values have already been | ||
// normalized at this point | ||
var matches = rcssNum.exec( value ); | ||
var matches = rnumsplit.exec( value ); | ||
return matches ? | ||
// Guard against undefined "subtract", e.g., when used as in cssHooks | ||
Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : | ||
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : | ||
value; | ||
@@ -81,6 +76,4 @@ } | ||
var i = extra === ( isBorderBox ? "border" : "content" ) ? | ||
// If we already have the right measurement, avoid augmentation | ||
4 : | ||
// Otherwise initialize for horizontal or vertical properties | ||
@@ -92,3 +85,2 @@ name === "width" ? 1 : 0, | ||
for ( ; i < 4; i += 2 ) { | ||
// Both box models exclude margin, so add it if we want it | ||
@@ -100,3 +92,2 @@ if ( extra === "margin" ) { | ||
if ( isBorderBox ) { | ||
// border-box includes padding, so remove it if we want content | ||
@@ -112,3 +103,2 @@ if ( extra === "content" ) { | ||
} else { | ||
// At this point, extra isn't content, so add padding | ||
@@ -135,15 +125,2 @@ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); | ||
// Support: IE11 only | ||
// In IE 11 fullscreen elements inside of an iframe have | ||
// 100x too small dimensions (gh-1764). | ||
if ( document.msFullscreenElement && window.top !== window ) { | ||
// Support: IE11 only | ||
// Running getBoundingClientRect on a disconnected node | ||
// in IE throws an error. | ||
if ( elem.getClientRects().length ) { | ||
val = Math.round( elem.getBoundingClientRect()[ name ] * 100 ); | ||
} | ||
} | ||
// Some non-html elements return undefined for offsetWidth, so check for null/undefined | ||
@@ -153,3 +130,2 @@ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 | ||
if ( val <= 0 || val == null ) { | ||
// Fall back to computed then uncomputed css if necessary | ||
@@ -162,3 +138,3 @@ val = curCSS( elem, name, styles ); | ||
// Computed unit is not pixels. Stop here and return. | ||
if ( rnumnonpx.test( val ) ) { | ||
if ( rnumnonpx.test(val) ) { | ||
return val; | ||
@@ -200,6 +176,5 @@ } | ||
values[ index ] = dataPriv.get( elem, "olddisplay" ); | ||
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 | ||
@@ -215,7 +190,3 @@ // being hidden by cascaded rules or not | ||
if ( elem.style.display === "" && isHidden( elem ) ) { | ||
values[ index ] = dataPriv.access( | ||
elem, | ||
"olddisplay", | ||
defaultDisplay( elem.nodeName ) | ||
); | ||
values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) ); | ||
} | ||
@@ -226,7 +197,3 @@ } else { | ||
if ( display !== "none" || !hidden ) { | ||
dataPriv.set( | ||
elem, | ||
"olddisplay", | ||
hidden ? display : jQuery.css( elem, "display" ) | ||
); | ||
data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); | ||
} | ||
@@ -251,3 +218,3 @@ } | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
@@ -271,3 +238,2 @@ // Add in style property hooks for overriding the default | ||
cssNumber: { | ||
"animationIterationCount": true, | ||
"columnCount": true, | ||
@@ -306,4 +272,3 @@ "fillOpacity": true, | ||
name = jQuery.cssProps[ origName ] || | ||
( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); | ||
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); | ||
@@ -318,5 +283,4 @@ // Gets hook for the prefixed version, then unprefixed version | ||
// Convert "+=" or "-=" to relative numbers (#7345) | ||
if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { | ||
value = adjustCSS( elem, name, ret ); | ||
if ( type === "string" && (ret = rrelNum.exec( value )) ) { | ||
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); | ||
// Fixes bug #9237 | ||
@@ -331,5 +295,5 @@ type = "number"; | ||
// 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" ); | ||
// If a number, add 'px' to the (except for certain CSS properties) | ||
if ( type === "number" && !jQuery.cssNumber[ origName ] ) { | ||
value += "px"; | ||
} | ||
@@ -344,5 +308,3 @@ | ||
// 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 ) { | ||
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { | ||
style[ name ] = value; | ||
@@ -352,7 +314,4 @@ } | ||
} 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; | ||
@@ -371,4 +330,3 @@ } | ||
// Make sure that we're working with the right name | ||
name = jQuery.cssProps[ origName ] || | ||
( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); | ||
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); | ||
@@ -396,9 +354,9 @@ // Try prefixed name followed by the unprefixed name | ||
num = parseFloat( val ); | ||
return extra === true || isFinite( num ) ? num || 0 : val; | ||
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; | ||
} | ||
return val; | ||
} | ||
} ); | ||
}); | ||
jQuery.each( [ "height", "width" ], function( i, name ) { | ||
jQuery.each([ "height", "width" ], function( i, name ) { | ||
jQuery.cssHooks[ name ] = { | ||
@@ -410,8 +368,7 @@ get: function( elem, computed, extra ) { | ||
// but it must have a current display style that would benefit | ||
return rdisplayswap.test( jQuery.css( elem, "display" ) ) && | ||
elem.offsetWidth === 0 ? | ||
swap( elem, cssShow, function() { | ||
return getWidthOrHeight( elem, name, extra ); | ||
} ) : | ||
getWidthOrHeight( elem, name, extra ); | ||
return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? | ||
jQuery.swap( elem, cssShow, function() { | ||
return getWidthOrHeight( elem, name, extra ); | ||
}) : | ||
getWidthOrHeight( elem, name, extra ); | ||
} | ||
@@ -421,5 +378,5 @@ }, | ||
set: function( elem, value, extra ) { | ||
var matches, | ||
styles = extra && getStyles( elem ), | ||
subtract = extra && augmentWidthOrHeight( | ||
var styles = extra && getStyles( elem ); | ||
return setPositiveNumber( elem, value, extra ? | ||
augmentWidthOrHeight( | ||
elem, | ||
@@ -430,30 +387,8 @@ name, | ||
styles | ||
); | ||
// 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 ); | ||
) : 0 | ||
); | ||
} | ||
}; | ||
} ); | ||
}); | ||
jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, | ||
function( elem, computed ) { | ||
if ( computed ) { | ||
return ( parseFloat( curCSS( elem, "marginLeft" ) ) || | ||
elem.getBoundingClientRect().left - | ||
swap( elem, { marginLeft: 0 }, function() { | ||
return elem.getBoundingClientRect().left; | ||
} ) | ||
) + "px"; | ||
} | ||
} | ||
); | ||
// Support: Android 2.3 | ||
@@ -463,3 +398,3 @@ jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, | ||
if ( computed ) { | ||
return swap( elem, { "display": "inline-block" }, | ||
return jQuery.swap( elem, { "display": "inline-block" }, | ||
curCSS, [ elem, "marginRight" ] ); | ||
@@ -471,3 +406,3 @@ } | ||
// These hooks are used by animate to expand properties | ||
jQuery.each( { | ||
jQuery.each({ | ||
margin: "", | ||
@@ -483,3 +418,3 @@ padding: "", | ||
// Assumes a single number if not a string | ||
parts = typeof value === "string" ? value.split( " " ) : [ value ]; | ||
parts = typeof value === "string" ? value.split(" ") : [ value ]; | ||
@@ -498,5 +433,5 @@ for ( ; i < 4; i++ ) { | ||
} | ||
} ); | ||
}); | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
css: function( name, value ) { | ||
@@ -535,3 +470,3 @@ return access( this, function( elem, name, value ) { | ||
return this.each( function() { | ||
return this.each(function() { | ||
if ( isHidden( this ) ) { | ||
@@ -542,7 +477,7 @@ jQuery( this ).show(); | ||
} | ||
} ); | ||
}); | ||
} | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,5 +0,4 @@ | ||
define( function() { | ||
define(function() { | ||
function addGetHookIf( conditionFn, hookFn ) { | ||
// Define the hook, we'll check on the first run if it's really needed. | ||
@@ -9,3 +8,2 @@ return { | ||
if ( conditionFn() ) { | ||
// Hook not needed (or it's not possible to use it due | ||
@@ -18,3 +16,3 @@ // to missing dependency), remove it. | ||
// Hook needed; redefine it so that the support test is not executed again. | ||
return ( this.get = hookFn ).apply( this, arguments ); | ||
return (this.get = hookFn).apply( this, arguments ); | ||
} | ||
@@ -26,2 +24,2 @@ }; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -6,5 +6,4 @@ "./var/rnumnonpx", | ||
"./var/getStyles", | ||
"./support", | ||
"../selector" // Get jQuery.contains | ||
], function( jQuery, rnumnonpx, rmargin, getStyles, support ) { | ||
"../selector" // contains | ||
], function( jQuery, rnumnonpx, rmargin, getStyles ) { | ||
@@ -16,21 +15,20 @@ function curCSS( elem, name, computed ) { | ||
computed = computed || getStyles( elem ); | ||
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; | ||
// Support: Opera 12.1x only | ||
// Fall back to style even without computed | ||
// computed is undefined for elems on document fragments | ||
if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { | ||
ret = jQuery.style( elem, name ); | ||
} | ||
// Support: IE9 | ||
// getPropertyValue is only needed for .css('filter') (#12537) | ||
if ( computed ) { | ||
ret = computed.getPropertyValue( name ) || computed[ name ]; | ||
} | ||
if ( computed ) { | ||
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { | ||
ret = jQuery.style( elem, name ); | ||
} | ||
// Support: iOS < 6 | ||
// A tribute to the "awesome hack by Dean Edwards" | ||
// Android Browser returns percentage for some values, | ||
// but width seems to be reliably pixels. | ||
// This is against the CSSOM draft spec: | ||
// http://dev.w3.org/csswg/cssom/#resolved-values | ||
if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { | ||
// iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels | ||
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values | ||
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { | ||
@@ -54,4 +52,3 @@ // Remember the original values | ||
return ret !== undefined ? | ||
// Support: IE9-11+ | ||
// Support: IE | ||
// IE returns zIndex value as an integer. | ||
@@ -63,2 +60,2 @@ ret + "" : | ||
return curCSS; | ||
} ); | ||
}); |
@@ -1,16 +0,9 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/document", | ||
"../manipulation" // appendTo | ||
], function( jQuery, document ) { | ||
], function( jQuery ) { | ||
var iframe, | ||
elemdisplay = { | ||
elemdisplay = {}; | ||
// Support: Firefox | ||
// We have to pre-define these values for FF (#10227) | ||
HTML: "block", | ||
BODY: "block" | ||
}; | ||
/** | ||
@@ -21,9 +14,14 @@ * Retrieve the actual display of a element | ||
*/ | ||
// Called only from within defaultDisplay | ||
function actualDisplay( name, doc ) { | ||
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), | ||
var style, | ||
elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), | ||
display = jQuery.css( elem[ 0 ], "display" ); | ||
// getDefaultComputedStyle might be reliably used only on attached element | ||
display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? | ||
// Use of this method is a temporary fix (more like optimization) until something better comes along, | ||
// since it was removed from specification and supported only in FF | ||
style.display : jQuery.css( elem[ 0 ], "display" ); | ||
// We don't have any data stored on the element, | ||
@@ -51,4 +49,3 @@ // so use "detach" method as fast way to get rid of the element | ||
// Use the already-created iframe if possible | ||
iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) | ||
.appendTo( doc.documentElement ); | ||
iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); | ||
@@ -74,2 +71,3 @@ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse | ||
return defaultDisplay; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ |
define( [ |
define([ |
"../core", |
@@ -7,13 +7,10 @@ "../selector" |
jQuery.expr.filters.hidden = function( elem ) { |
return !jQuery.expr.filters.visible( elem ); |
}; |
jQuery.expr.filters.visible = function( elem ) { |
// Support: Opera <= 12.12 |
// Opera reports offsetWidths and offsetHeights less than zero on some elements |
// Use OR instead of AND as the element is not visible if either is true |
// See tickets #10406 and #13132 |
return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0; |
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0; |
}; |
jQuery.expr.filters.visible = function( elem ) { |
return !jQuery.expr.filters.hidden( elem ); |
}; |
} ); |
}); |
@@ -1,14 +0,12 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/document", | ||
"../var/documentElement", | ||
"../var/support" | ||
], function( jQuery, document, documentElement, support ) { | ||
], function( jQuery, support ) { | ||
( function() { | ||
var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, | ||
(function() { | ||
var pixelPositionVal, boxSizingReliableVal, | ||
docElem = document.documentElement, | ||
container = document.createElement( "div" ), | ||
div = document.createElement( "div" ); | ||
// Finish early in limited (non-browser) environments | ||
if ( !div.style ) { | ||
@@ -24,4 +22,4 @@ return; | ||
container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + | ||
"padding:0;margin-top:1px;position:absolute"; | ||
container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" + | ||
"position:absolute"; | ||
container.appendChild( div ); | ||
@@ -31,93 +29,70 @@ | ||
// so they're executed at the same time to save the second computation. | ||
function computeStyleTests() { | ||
function computePixelPositionAndBoxSizingReliable() { | ||
div.style.cssText = | ||
// Support: Firefox<29, Android 2.3 | ||
// Vendor-prefix box-sizing | ||
"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" + | ||
"position:relative;display:block;" + | ||
"margin:auto;border:1px;padding:1px;" + | ||
"top:1%;width:50%"; | ||
"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + | ||
"box-sizing:border-box;display:block;margin-top:1%;top:1%;" + | ||
"border:1px;padding:1px;width:4px;position:absolute"; | ||
div.innerHTML = ""; | ||
documentElement.appendChild( container ); | ||
docElem.appendChild( container ); | ||
var divStyle = window.getComputedStyle( div ); | ||
var divStyle = window.getComputedStyle( div, null ); | ||
pixelPositionVal = divStyle.top !== "1%"; | ||
reliableMarginLeftVal = divStyle.marginLeft === "2px"; | ||
boxSizingReliableVal = divStyle.width === "4px"; | ||
// Support: Android 4.0 - 4.3 only | ||
// Some styles come back with percentage values, even though they shouldn't | ||
div.style.marginRight = "50%"; | ||
pixelMarginRightVal = divStyle.marginRight === "4px"; | ||
documentElement.removeChild( container ); | ||
docElem.removeChild( container ); | ||
} | ||
jQuery.extend( support, { | ||
pixelPosition: function() { | ||
// Support: node.js jsdom | ||
// Don't assume that getComputedStyle is a property of the global object | ||
if ( window.getComputedStyle ) { | ||
jQuery.extend( support, { | ||
pixelPosition: function() { | ||
// This test is executed only once but we still do memoizing | ||
// since we can use the boxSizingReliable pre-computing. | ||
// No need to check if the test was already performed, though. | ||
computeStyleTests(); | ||
return pixelPositionVal; | ||
}, | ||
boxSizingReliable: function() { | ||
if ( boxSizingReliableVal == null ) { | ||
computeStyleTests(); | ||
} | ||
return boxSizingReliableVal; | ||
}, | ||
pixelMarginRight: function() { | ||
// This test is executed only once but we still do memoizing | ||
// since we can use the boxSizingReliable pre-computing. | ||
// No need to check if the test was already performed, though. | ||
computePixelPositionAndBoxSizingReliable(); | ||
return pixelPositionVal; | ||
}, | ||
boxSizingReliable: function() { | ||
if ( boxSizingReliableVal == null ) { | ||
computePixelPositionAndBoxSizingReliable(); | ||
} | ||
return boxSizingReliableVal; | ||
}, | ||
reliableMarginRight: function() { | ||
// Support: Android 4.0-4.3 | ||
// We're checking for boxSizingReliableVal here instead of pixelMarginRightVal | ||
// since that compresses better and they're computed together anyway. | ||
if ( boxSizingReliableVal == null ) { | ||
computeStyleTests(); | ||
} | ||
return pixelMarginRightVal; | ||
}, | ||
reliableMarginLeft: function() { | ||
// Support: Android 2.3 | ||
// Check if div with explicit width and no margin-right incorrectly | ||
// gets computed margin-right based on width of container. (#3333) | ||
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right | ||
// This support function is only executed once so no memoizing is needed. | ||
var ret, | ||
marginDiv = div.appendChild( document.createElement( "div" ) ); | ||
// Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 | ||
if ( boxSizingReliableVal == null ) { | ||
computeStyleTests(); | ||
} | ||
return reliableMarginLeftVal; | ||
}, | ||
reliableMarginRight: function() { | ||
// Reset CSS: box-sizing; display; margin; border; padding | ||
marginDiv.style.cssText = div.style.cssText = | ||
// Support: Firefox<29, Android 2.3 | ||
// Vendor-prefix box-sizing | ||
"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + | ||
"box-sizing:content-box;display:block;margin:0;border:0;padding:0"; | ||
marginDiv.style.marginRight = marginDiv.style.width = "0"; | ||
div.style.width = "1px"; | ||
docElem.appendChild( container ); | ||
// Support: Android 2.3 | ||
// Check if div with explicit width and no margin-right incorrectly | ||
// gets computed margin-right based on width of container. (#3333) | ||
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right | ||
// This support function is only executed once so no memoizing is needed. | ||
var ret, | ||
marginDiv = div.appendChild( document.createElement( "div" ) ); | ||
ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight ); | ||
// Reset CSS: box-sizing; display; margin; border; padding | ||
marginDiv.style.cssText = div.style.cssText = | ||
docElem.removeChild( container ); | ||
div.removeChild( marginDiv ); | ||
// Support: Android 2.3 | ||
// Vendor-prefix box-sizing | ||
"-webkit-box-sizing:content-box;box-sizing:content-box;" + | ||
"display:block;margin:0;border:0;padding:0"; | ||
marginDiv.style.marginRight = marginDiv.style.width = "0"; | ||
div.style.width = "1px"; | ||
documentElement.appendChild( container ); | ||
return ret; | ||
} | ||
}); | ||
} | ||
})(); | ||
ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight ); | ||
documentElement.removeChild( container ); | ||
div.removeChild( marginDiv ); | ||
return ret; | ||
} | ||
} ); | ||
} )(); | ||
return support; | ||
} ); | ||
}); |
@@ -1,3 +0,3 @@ | ||
define( function() { | ||
define(function() { | ||
return [ "Top", "Right", "Bottom", "Left" ]; | ||
} ); | ||
}); |
@@ -1,15 +0,12 @@ | ||
define( function() { | ||
define(function() { | ||
return function( elem ) { | ||
// Support: IE<=11+, Firefox<=30+ (#15098, #14150) | ||
// IE throws on elements created in popups | ||
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle" | ||
var view = elem.ownerDocument.defaultView; | ||
if ( !view || !view.opener ) { | ||
view = window; | ||
if ( elem.ownerDocument.defaultView.opener ) { | ||
return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); | ||
} | ||
return view.getComputedStyle( elem ); | ||
return window.getComputedStyle( elem, null ); | ||
}; | ||
} ); | ||
}); |
@@ -1,5 +0,4 @@ | ||
define( [ | ||
define([ | ||
"../../core", | ||
"../../selector" | ||
// css is assumed | ||
@@ -9,9 +8,7 @@ ], function( jQuery ) { | ||
return function( elem, el ) { | ||
// isHidden might be called from jQuery#filter function; | ||
// in that case, element will be second argument | ||
elem = el || elem; | ||
return jQuery.css( elem, "display" ) === "none" || | ||
!jQuery.contains( elem.ownerDocument, elem ); | ||
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); | ||
}; | ||
} ); | ||
}); |
@@ -1,3 +0,3 @@ | ||
define( function() { | ||
return ( /^margin/ ); | ||
} ); | ||
define(function() { | ||
return (/^margin/); | ||
}); |
@@ -1,5 +0,5 @@ | ||
define( [ | ||
define([ | ||
"../../var/pnum" | ||
], function( pnum ) { | ||
return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); | ||
} ); | ||
}); |
@@ -1,7 +0,8 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
"./var/rnotwhite", | ||
"./core/access", | ||
"./data/var/dataPriv", | ||
"./data/var/dataUser" | ||
], function( jQuery, access, dataPriv, dataUser ) { | ||
"./data/var/data_priv", | ||
"./data/var/data_user" | ||
], function( jQuery, rnotwhite, access, data_priv, data_user ) { | ||
@@ -19,3 +20,3 @@ // Implementation Summary | ||
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, | ||
rmultiDash = /[A-Z]/g; | ||
rmultiDash = /([A-Z])/g; | ||
@@ -28,3 +29,3 @@ function dataAttr( elem, key, data ) { | ||
if ( data === undefined && elem.nodeType === 1 ) { | ||
name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); | ||
name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); | ||
data = elem.getAttribute( name ); | ||
@@ -37,3 +38,2 @@ | ||
data === "null" ? null : | ||
// Only convert to a number if it doesn't change the string | ||
@@ -43,6 +43,6 @@ +data + "" === data ? +data : | ||
data; | ||
} catch ( e ) {} | ||
} catch( e ) {} | ||
// Make sure we set the data so it isn't changed later | ||
dataUser.set( elem, key, data ); | ||
data_user.set( elem, key, data ); | ||
} else { | ||
@@ -55,27 +55,27 @@ data = undefined; | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
hasData: function( elem ) { | ||
return dataUser.hasData( elem ) || dataPriv.hasData( elem ); | ||
return data_user.hasData( elem ) || data_priv.hasData( elem ); | ||
}, | ||
data: function( elem, name, data ) { | ||
return dataUser.access( elem, name, data ); | ||
return data_user.access( elem, name, data ); | ||
}, | ||
removeData: function( elem, name ) { | ||
dataUser.remove( elem, name ); | ||
data_user.remove( elem, name ); | ||
}, | ||
// TODO: Now that all calls to _data and _removeData have been replaced | ||
// with direct calls to dataPriv methods, these can be deprecated. | ||
// with direct calls to data_priv methods, these can be deprecated. | ||
_data: function( elem, name, data ) { | ||
return dataPriv.access( elem, name, data ); | ||
return data_priv.access( elem, name, data ); | ||
}, | ||
_removeData: function( elem, name ) { | ||
dataPriv.remove( elem, name ); | ||
data_priv.remove( elem, name ); | ||
} | ||
} ); | ||
}); | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
data: function( key, value ) { | ||
@@ -89,5 +89,5 @@ var i, name, data, | ||
if ( this.length ) { | ||
data = dataUser.get( elem ); | ||
data = data_user.get( elem ); | ||
if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { | ||
if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { | ||
i = attrs.length; | ||
@@ -101,3 +101,3 @@ while ( i-- ) { | ||
if ( name.indexOf( "data-" ) === 0 ) { | ||
name = jQuery.camelCase( name.slice( 5 ) ); | ||
name = jQuery.camelCase( name.slice(5) ); | ||
dataAttr( elem, name, data[ name ] ); | ||
@@ -107,3 +107,3 @@ } | ||
} | ||
dataPriv.set( elem, "hasDataAttrs", true ); | ||
data_priv.set( elem, "hasDataAttrs", true ); | ||
} | ||
@@ -117,9 +117,10 @@ } | ||
if ( typeof key === "object" ) { | ||
return this.each( function() { | ||
dataUser.set( this, key ); | ||
} ); | ||
return this.each(function() { | ||
data_user.set( this, key ); | ||
}); | ||
} | ||
return access( this, function( value ) { | ||
var data, camelKey; | ||
var data, | ||
camelKey = jQuery.camelCase( key ); | ||
@@ -132,11 +133,5 @@ // The calling jQuery object (element matches) is not empty | ||
if ( elem && value === undefined ) { | ||
// Attempt to get data from the cache | ||
// with the key as-is | ||
data = dataUser.get( elem, key ) || | ||
// Try to find dashed key if it exists (gh-2779) | ||
// This is for 2.2.x only | ||
dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() ); | ||
data = data_user.get( elem, key ); | ||
if ( data !== undefined ) { | ||
@@ -146,7 +141,5 @@ return data; | ||
camelKey = jQuery.camelCase( key ); | ||
// Attempt to get data from the cache | ||
// with the key camelized | ||
data = dataUser.get( elem, camelKey ); | ||
data = data_user.get( elem, camelKey ); | ||
if ( data !== undefined ) { | ||
@@ -168,8 +161,6 @@ return data; | ||
// Set the data... | ||
camelKey = jQuery.camelCase( key ); | ||
this.each( function() { | ||
this.each(function() { | ||
// First, attempt to store a copy or reference of any | ||
// data that might've been store with a camelCased key. | ||
var data = dataUser.get( this, camelKey ); | ||
var data = data_user.get( this, camelKey ); | ||
@@ -179,3 +170,3 @@ // For HTML5 data-* attribute interop, we have to | ||
// This might not apply to all properties...* | ||
dataUser.set( this, camelKey, value ); | ||
data_user.set( this, camelKey, value ); | ||
@@ -185,6 +176,6 @@ // *... In the case of properties that might _actually_ | ||
// unchanged property. | ||
if ( key.indexOf( "-" ) > -1 && data !== undefined ) { | ||
dataUser.set( this, key, value ); | ||
if ( key.indexOf("-") !== -1 && data !== undefined ) { | ||
data_user.set( this, key, value ); | ||
} | ||
} ); | ||
}); | ||
}, null, value, arguments.length > 1, null, true ); | ||
@@ -194,9 +185,9 @@ }, | ||
removeData: function( key ) { | ||
return this.each( function() { | ||
dataUser.remove( this, key ); | ||
} ); | ||
return this.each(function() { | ||
data_user.remove( this, key ); | ||
}); | ||
} | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,8 +0,17 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../var/rnotwhite", | ||
"./var/acceptData" | ||
], function( jQuery, rnotwhite, acceptData ) { | ||
"./accepts" | ||
], function( jQuery, rnotwhite ) { | ||
function Data() { | ||
// Support: Android<4, | ||
// Old WebKit does not have Object.preventExtensions/freeze method, | ||
// return new empty object instead with no [[set]] accessor | ||
Object.defineProperty( this.cache = {}, 0, { | ||
get: function() { | ||
return {}; | ||
} | ||
}); | ||
this.expando = jQuery.expando + Data.uid++; | ||
@@ -12,68 +21,48 @@ } | ||
Data.uid = 1; | ||
Data.accepts = jQuery.acceptData; | ||
Data.prototype = { | ||
register: function( owner, initial ) { | ||
var value = initial || {}; | ||
// If it is a node unlikely to be stringify-ed or looped over | ||
// use plain assignment | ||
if ( owner.nodeType ) { | ||
owner[ this.expando ] = value; | ||
// Otherwise secure it in a non-enumerable, non-writable property | ||
// configurability must be true to allow the property to be | ||
// deleted with the delete operator | ||
} else { | ||
Object.defineProperty( owner, this.expando, { | ||
value: value, | ||
writable: true, | ||
configurable: true | ||
} ); | ||
} | ||
return owner[ this.expando ]; | ||
}, | ||
cache: function( owner ) { | ||
key: function( owner ) { | ||
// We can accept data for non-element nodes in modern browsers, | ||
// but we should not, see #8335. | ||
// Always return an empty object. | ||
if ( !acceptData( owner ) ) { | ||
return {}; | ||
// Always return the key for a frozen object. | ||
if ( !Data.accepts( owner ) ) { | ||
return 0; | ||
} | ||
// Check if the owner object already has a cache | ||
var value = owner[ this.expando ]; | ||
var descriptor = {}, | ||
// Check if the owner object already has a cache key | ||
unlock = owner[ this.expando ]; | ||
// If not, create one | ||
if ( !value ) { | ||
value = {}; | ||
if ( !unlock ) { | ||
unlock = Data.uid++; | ||
// We can accept data for non-element nodes in modern browsers, | ||
// but we should not, see #8335. | ||
// Always return an empty object. | ||
if ( acceptData( owner ) ) { | ||
// Secure it in a non-enumerable, non-writable property | ||
try { | ||
descriptor[ this.expando ] = { value: unlock }; | ||
Object.defineProperties( owner, descriptor ); | ||
// If it is a node unlikely to be stringify-ed or looped over | ||
// use plain assignment | ||
if ( owner.nodeType ) { | ||
owner[ this.expando ] = value; | ||
// Otherwise secure it in a non-enumerable property | ||
// configurable must be true to allow the property to be | ||
// deleted when data is removed | ||
} else { | ||
Object.defineProperty( owner, this.expando, { | ||
value: value, | ||
configurable: true | ||
} ); | ||
} | ||
// Support: Android<4 | ||
// Fallback to a less secure definition | ||
} catch ( e ) { | ||
descriptor[ this.expando ] = unlock; | ||
jQuery.extend( owner, descriptor ); | ||
} | ||
} | ||
return value; | ||
// Ensure the cache object | ||
if ( !this.cache[ unlock ] ) { | ||
this.cache[ unlock ] = {}; | ||
} | ||
return unlock; | ||
}, | ||
set: function( owner, data, value ) { | ||
var prop, | ||
cache = this.cache( owner ); | ||
// There may be an unlock assigned to this node, | ||
// if there is no entry for this "owner", create one inline | ||
// and set the unlock as though an owner entry had always existed | ||
unlock = this.key( owner ), | ||
cache = this.cache[ unlock ]; | ||
@@ -86,6 +75,10 @@ // Handle: [ owner, key, value ] args | ||
} else { | ||
// Copy the properties one-by-one to the cache object | ||
for ( prop in data ) { | ||
cache[ prop ] = data[ prop ]; | ||
// Fresh assignments by object are shallow copied | ||
if ( jQuery.isEmptyObject( cache ) ) { | ||
jQuery.extend( this.cache[ unlock ], data ); | ||
// Otherwise, copy the properties one-by-one to the cache object | ||
} else { | ||
for ( prop in data ) { | ||
cache[ prop ] = data[ prop ]; | ||
} | ||
} | ||
@@ -96,9 +89,13 @@ } | ||
get: function( owner, key ) { | ||
// Either a valid cache is found, or will be created. | ||
// New caches will be created and the unlock returned, | ||
// allowing direct access to the newly created | ||
// empty data object. A valid owner object must be provided. | ||
var cache = this.cache[ this.key( owner ) ]; | ||
return key === undefined ? | ||
this.cache( owner ) : | ||
owner[ this.expando ] && owner[ this.expando ][ key ]; | ||
cache : cache[ key ]; | ||
}, | ||
access: function( owner, key, value ) { | ||
var stored; | ||
// In cases where either: | ||
@@ -116,3 +113,3 @@ // | ||
if ( key === undefined || | ||
( ( key && typeof key === "string" ) && value === undefined ) ) { | ||
((key && typeof key === "string") && value === undefined) ) { | ||
@@ -122,6 +119,6 @@ stored = this.get( owner, key ); | ||
return stored !== undefined ? | ||
stored : this.get( owner, jQuery.camelCase( key ) ); | ||
stored : this.get( owner, jQuery.camelCase(key) ); | ||
} | ||
// When the key is not a string, or both a key and value | ||
// [*]When the key is not a string, or both a key and value | ||
// are specified, set or extend (existing objects) with either: | ||
@@ -140,16 +137,11 @@ // | ||
var i, name, camel, | ||
cache = owner[ this.expando ]; | ||
unlock = this.key( owner ), | ||
cache = this.cache[ unlock ]; | ||
if ( cache === undefined ) { | ||
return; | ||
} | ||
if ( key === undefined ) { | ||
this.register( owner ); | ||
this.cache[ unlock ] = {}; | ||
} else { | ||
// Support array or space separated string of keys | ||
if ( jQuery.isArray( key ) ) { | ||
// If "name" is an array of keys... | ||
@@ -164,3 +156,2 @@ // When data is initially created, via ("key", "val") signature, | ||
camel = jQuery.camelCase( key ); | ||
// Try the string as a key before any manipulation | ||
@@ -170,3 +161,2 @@ if ( key in cache ) { | ||
} else { | ||
// If a key with the spaces exists, use it. | ||
@@ -181,3 +171,2 @@ // Otherwise, create an array by matching non-whitespace | ||
i = name.length; | ||
while ( i-- ) { | ||
@@ -187,20 +176,12 @@ delete cache[ name[ i ] ]; | ||
} | ||
// Remove the expando if there's no more data | ||
if ( key === undefined || jQuery.isEmptyObject( cache ) ) { | ||
// Support: Chrome <= 35-45+ | ||
// Webkit & Blink performance suffers when deleting properties | ||
// from DOM nodes, so set to undefined instead | ||
// https://code.google.com/p/chromium/issues/detail?id=378607 | ||
if ( owner.nodeType ) { | ||
owner[ this.expando ] = undefined; | ||
} else { | ||
delete owner[ this.expando ]; | ||
} | ||
} | ||
}, | ||
hasData: function( owner ) { | ||
var cache = owner[ this.expando ]; | ||
return cache !== undefined && !jQuery.isEmptyObject( cache ); | ||
return !jQuery.isEmptyObject( | ||
this.cache[ owner[ this.expando ] ] || {} | ||
); | ||
}, | ||
discard: function( owner ) { | ||
if ( owner[ this.expando ] ) { | ||
delete this.cache[ owner[ this.expando ] ]; | ||
} | ||
} | ||
@@ -210,2 +191,2 @@ }; | ||
return Data; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -7,11 +7,10 @@ "./var/slice", | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
Deferred: function( func ) { | ||
var tuples = [ | ||
// action, add listener, listener list, final state | ||
[ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], | ||
[ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], | ||
[ "notify", "progress", jQuery.Callbacks( "memory" ) ] | ||
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], | ||
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], | ||
[ "notify", "progress", jQuery.Callbacks("memory") ] | ||
], | ||
@@ -29,26 +28,21 @@ state = "pending", | ||
var fns = arguments; | ||
return jQuery.Deferred( function( newDefer ) { | ||
return jQuery.Deferred(function( newDefer ) { | ||
jQuery.each( tuples, function( i, tuple ) { | ||
var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; | ||
// deferred[ done | fail | progress ] for forwarding actions to newDefer | ||
deferred[ tuple[ 1 ] ]( function() { | ||
deferred[ tuple[1] ](function() { | ||
var returned = fn && fn.apply( this, arguments ); | ||
if ( returned && jQuery.isFunction( returned.promise ) ) { | ||
returned.promise() | ||
.progress( newDefer.notify ) | ||
.done( newDefer.resolve ) | ||
.fail( newDefer.reject ); | ||
.fail( newDefer.reject ) | ||
.progress( newDefer.notify ); | ||
} else { | ||
newDefer[ tuple[ 0 ] + "With" ]( | ||
this === promise ? newDefer.promise() : this, | ||
fn ? [ returned ] : arguments | ||
); | ||
newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); | ||
} | ||
} ); | ||
} ); | ||
}); | ||
}); | ||
fns = null; | ||
} ).promise(); | ||
}).promise(); | ||
}, | ||
// Get a promise for this deferred | ||
@@ -71,8 +65,7 @@ // If obj is provided, the promise aspect is added to the object | ||
// promise[ done | fail | progress ] = list.add | ||
promise[ tuple[ 1 ] ] = list.add; | ||
promise[ tuple[1] ] = list.add; | ||
// Handle state | ||
if ( stateString ) { | ||
list.add( function() { | ||
list.add(function() { | ||
// state = [ resolved | rejected ] | ||
@@ -86,8 +79,8 @@ state = stateString; | ||
// deferred[ resolve | reject | notify ] | ||
deferred[ tuple[ 0 ] ] = function() { | ||
deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); | ||
deferred[ tuple[0] ] = function() { | ||
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); | ||
return this; | ||
}; | ||
deferred[ tuple[ 0 ] + "With" ] = list.fireWith; | ||
} ); | ||
deferred[ tuple[0] + "With" ] = list.fireWith; | ||
}); | ||
@@ -113,7 +106,5 @@ // Make the deferred a promise | ||
// the count of uncompleted subordinates | ||
remaining = length !== 1 || | ||
( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, | ||
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, | ||
// the master Deferred. | ||
// If resolveValues consist of only a single Deferred, just use that. | ||
// the master Deferred. If resolveValues consist of only a single Deferred, just use that. | ||
deferred = remaining === 1 ? subordinate : jQuery.Deferred(), | ||
@@ -144,5 +135,5 @@ | ||
resolveValues[ i ].promise() | ||
.progress( updateFunc( i, progressContexts, progressValues ) ) | ||
.done( updateFunc( i, resolveContexts, resolveValues ) ) | ||
.fail( deferred.reject ); | ||
.fail( deferred.reject ) | ||
.progress( updateFunc( i, progressContexts, progressValues ) ); | ||
} else { | ||
@@ -161,5 +152,5 @@ --remaining; | ||
} | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,32 +0,13 @@ | ||
define( [ | ||
"./core" | ||
define([ | ||
"./core", | ||
"./traversing" | ||
], function( jQuery ) { | ||
jQuery.fn.extend( { | ||
// The number of elements contained in the matched element set | ||
jQuery.fn.size = function() { | ||
return this.length; | ||
}; | ||
bind: function( types, data, fn ) { | ||
return this.on( types, null, data, fn ); | ||
}, | ||
unbind: function( types, fn ) { | ||
return this.off( types, null, fn ); | ||
}, | ||
delegate: function( selector, types, data, fn ) { | ||
return this.on( types, selector, data, fn ); | ||
}, | ||
undelegate: function( selector, types, fn ) { | ||
// ( namespace ) or ( selector, types [, fn] ) | ||
return arguments.length === 1 ? | ||
this.off( selector, "**" ) : | ||
this.off( types, selector || "**", fn ); | ||
}, | ||
size: function() { | ||
return this.length; | ||
} | ||
} ); | ||
jQuery.fn.andSelf = jQuery.fn.addBack; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -9,5 +9,3 @@ "./core/access", | ||
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { | ||
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, | ||
function( defaultExtra, funcName ) { | ||
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { | ||
// Margin is only for outerHeight, outerWidth | ||
@@ -22,3 +20,2 @@ jQuery.fn[ funcName ] = function( margin, value ) { | ||
if ( jQuery.isWindow( elem ) ) { | ||
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there | ||
@@ -44,3 +41,2 @@ // isn't a whole lot we can do. See pull request at this URL for discussion: | ||
return value === undefined ? | ||
// Get width or height on the element, requesting but not forcing parseFloat | ||
@@ -53,6 +49,6 @@ jQuery.css( elem, type, extra ) : | ||
}; | ||
} ); | ||
} ); | ||
}); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,11 +0,8 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
"./var/document", | ||
"./var/rcssNum", | ||
"./var/pnum", | ||
"./css/var/cssExpand", | ||
"./var/rnotwhite", | ||
"./css/var/isHidden", | ||
"./css/adjustCSS", | ||
"./css/defaultDisplay", | ||
"./data/var/dataPriv", | ||
"./data/var/data_priv", | ||
@@ -18,4 +15,3 @@ "./core/init", | ||
"./traversing" | ||
], function( jQuery, document, rcssNum, cssExpand, rnotwhite, | ||
isHidden, adjustCSS, defaultDisplay, dataPriv ) { | ||
], function( jQuery, pnum, cssExpand, isHidden, defaultDisplay, data_priv ) { | ||
@@ -25,9 +21,61 @@ var | ||
rfxtypes = /^(?:toggle|show|hide)$/, | ||
rrun = /queueHooks$/; | ||
rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ), | ||
rrun = /queueHooks$/, | ||
animationPrefilters = [ defaultPrefilter ], | ||
tweeners = { | ||
"*": [ function( prop, value ) { | ||
var tween = this.createTween( prop, value ), | ||
target = tween.cur(), | ||
parts = rfxnum.exec( value ), | ||
unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), | ||
// Starting value computation is required for potential unit mismatches | ||
start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && | ||
rfxnum.exec( jQuery.css( tween.elem, prop ) ), | ||
scale = 1, | ||
maxIterations = 20; | ||
if ( start && start[ 3 ] !== unit ) { | ||
// Trust units reported by jQuery.css | ||
unit = unit || start[ 3 ]; | ||
// Make sure we update the tween properties later on | ||
parts = parts || []; | ||
// Iteratively approximate from a nonzero starting point | ||
start = +target || 1; | ||
do { | ||
// If previous iteration zeroed out, double until we get *something*. | ||
// Use string for doubling so we don't accidentally see scale as unchanged below | ||
scale = scale || ".5"; | ||
// Adjust and apply | ||
start = start / scale; | ||
jQuery.style( tween.elem, prop, start + unit ); | ||
// Update scale, tolerating zero or NaN from tween.cur(), | ||
// break the loop if scale is unchanged or perfect, or if we've just had enough | ||
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); | ||
} | ||
// Update tween properties | ||
if ( parts ) { | ||
start = tween.start = +start || +target || 0; | ||
tween.unit = unit; | ||
// If a +=/-= token was provided, we're doing a relative animation | ||
tween.end = parts[ 1 ] ? | ||
start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : | ||
+parts[ 2 ]; | ||
} | ||
return tween; | ||
} ] | ||
}; | ||
// Animations created synchronously will run synchronously | ||
function createFxNow() { | ||
window.setTimeout( function() { | ||
setTimeout(function() { | ||
fxNow = undefined; | ||
} ); | ||
}); | ||
return ( fxNow = jQuery.now() ); | ||
@@ -59,7 +107,7 @@ } | ||
var tween, | ||
collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), | ||
collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), | ||
index = 0, | ||
length = collection.length; | ||
for ( ; index < length; index++ ) { | ||
if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { | ||
if ( (tween = collection[ index ].call( animation, prop, value )) ) { | ||
@@ -79,3 +127,3 @@ // We're done with this property | ||
hidden = elem.nodeType && isHidden( elem ), | ||
dataShow = dataPriv.get( elem, "fxshow" ); | ||
dataShow = data_priv.get( elem, "fxshow" ); | ||
@@ -96,6 +144,5 @@ // Handle queue: false promises | ||
anim.always( function() { | ||
anim.always(function() { | ||
// Ensure the complete handler is called before this completes | ||
anim.always( function() { | ||
anim.always(function() { | ||
hooks.unqueued--; | ||
@@ -105,4 +152,4 @@ if ( !jQuery.queue( elem, "fx" ).length ) { | ||
} | ||
} ); | ||
} ); | ||
}); | ||
}); | ||
} | ||
@@ -112,3 +159,2 @@ | ||
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { | ||
// Make sure that nothing sneaks out | ||
@@ -126,3 +172,3 @@ // Record all 3 overflow attributes because IE9-10 do not | ||
checkDisplay = display === "none" ? | ||
dataPriv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; | ||
data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; | ||
@@ -136,7 +182,7 @@ if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { | ||
style.overflow = "hidden"; | ||
anim.always( function() { | ||
anim.always(function() { | ||
style.overflow = opts.overflow[ 0 ]; | ||
style.overflowX = opts.overflow[ 1 ]; | ||
style.overflowY = opts.overflow[ 2 ]; | ||
} ); | ||
}); | ||
} | ||
@@ -152,4 +198,3 @@ | ||
// If there is dataShow left over from a stopped hide or show | ||
// and we are going to proceed with show, we should pretend to be hidden | ||
// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden | ||
if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { | ||
@@ -175,3 +220,3 @@ hidden = true; | ||
} else { | ||
dataShow = dataPriv.access( elem, "fxshow", {} ); | ||
dataShow = data_priv.access( elem, "fxshow", {} ); | ||
} | ||
@@ -186,14 +231,14 @@ | ||
} else { | ||
anim.done( function() { | ||
anim.done(function() { | ||
jQuery( elem ).hide(); | ||
} ); | ||
}); | ||
} | ||
anim.done( function() { | ||
anim.done(function() { | ||
var prop; | ||
dataPriv.remove( elem, "fxshow" ); | ||
data_priv.remove( elem, "fxshow" ); | ||
for ( prop in orig ) { | ||
jQuery.style( elem, prop, orig[ prop ] ); | ||
} | ||
} ); | ||
}); | ||
for ( prop in orig ) { | ||
@@ -212,3 +257,3 @@ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); | ||
// If this is a noop like .hide().hide(), restore an overwritten display value | ||
} else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) { | ||
} else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) { | ||
style.display = display; | ||
@@ -259,8 +304,7 @@ } | ||
index = 0, | ||
length = Animation.prefilters.length, | ||
length = animationPrefilters.length, | ||
deferred = jQuery.Deferred().always( function() { | ||
// Don't match elem in the :animated selector | ||
delete tick.elem; | ||
} ), | ||
}), | ||
tick = function() { | ||
@@ -272,3 +316,2 @@ if ( stopped ) { | ||
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), | ||
// Support: Android 2.3 | ||
@@ -285,3 +328,3 @@ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) | ||
deferred.notifyWith( elem, [ animation, percent, remaining ] ); | ||
deferred.notifyWith( elem, [ animation, percent, remaining ]); | ||
@@ -295,9 +338,6 @@ if ( percent < 1 && length ) { | ||
}, | ||
animation = deferred.promise( { | ||
animation = deferred.promise({ | ||
elem: elem, | ||
props: jQuery.extend( {}, properties ), | ||
opts: jQuery.extend( true, { | ||
specialEasing: {}, | ||
easing: jQuery.easing._default | ||
}, options ), | ||
opts: jQuery.extend( true, { specialEasing: {} }, options ), | ||
originalProperties: properties, | ||
@@ -316,3 +356,2 @@ originalOptions: options, | ||
var index = 0, | ||
// If we are going to the end, we want to run all the tweens | ||
@@ -331,3 +370,2 @@ // otherwise we skip this part | ||
if ( gotoEnd ) { | ||
deferred.notifyWith( elem, [ animation, 1, 0 ] ); | ||
deferred.resolveWith( elem, [ animation, gotoEnd ] ); | ||
@@ -339,3 +377,3 @@ } else { | ||
} | ||
} ), | ||
}), | ||
props = animation.props; | ||
@@ -346,8 +384,4 @@ | ||
for ( ; index < length ; index++ ) { | ||
result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); | ||
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); | ||
if ( result ) { | ||
if ( jQuery.isFunction( result.stop ) ) { | ||
jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = | ||
jQuery.proxy( result.stop, result ); | ||
} | ||
return result; | ||
@@ -368,3 +402,3 @@ } | ||
queue: animation.opts.queue | ||
} ) | ||
}) | ||
); | ||
@@ -380,9 +414,2 @@ | ||
jQuery.Animation = jQuery.extend( Animation, { | ||
tweeners: { | ||
"*": [ function( prop, value ) { | ||
var tween = this.createTween( prop, value ); | ||
adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); | ||
return tween; | ||
} ] | ||
}, | ||
@@ -394,3 +421,3 @@ tweener: function( props, callback ) { | ||
} else { | ||
props = props.match( rnotwhite ); | ||
props = props.split(" "); | ||
} | ||
@@ -404,17 +431,15 @@ | ||
prop = props[ index ]; | ||
Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; | ||
Animation.tweeners[ prop ].unshift( callback ); | ||
tweeners[ prop ] = tweeners[ prop ] || []; | ||
tweeners[ prop ].unshift( callback ); | ||
} | ||
}, | ||
prefilters: [ defaultPrefilter ], | ||
prefilter: function( callback, prepend ) { | ||
if ( prepend ) { | ||
Animation.prefilters.unshift( callback ); | ||
animationPrefilters.unshift( callback ); | ||
} else { | ||
Animation.prefilters.push( callback ); | ||
animationPrefilters.push( callback ); | ||
} | ||
} | ||
} ); | ||
}); | ||
@@ -429,5 +454,4 @@ jQuery.speed = function( speed, easing, fn ) { | ||
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? | ||
opt.duration : opt.duration in jQuery.fx.speeds ? | ||
jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; | ||
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : | ||
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; | ||
@@ -455,3 +479,3 @@ // Normalize opt.queue - true/undefined/null -> "fx" | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
fadeTo: function( speed, to, easing, callback ) { | ||
@@ -463,3 +487,3 @@ | ||
// Animate to the value specified | ||
.end().animate( { opacity: to }, speed, easing, callback ); | ||
.end().animate({ opacity: to }, speed, easing, callback ); | ||
}, | ||
@@ -470,3 +494,2 @@ animate: function( prop, speed, easing, callback ) { | ||
doAnimation = function() { | ||
// Operate on a copy of prop so per-property easing won't be lost | ||
@@ -476,3 +499,3 @@ var anim = Animation( this, jQuery.extend( {}, prop ), optall ); | ||
// Empty animations, or finishing resolves immediately | ||
if ( empty || dataPriv.get( this, "finish" ) ) { | ||
if ( empty || data_priv.get( this, "finish" ) ) { | ||
anim.stop( true ); | ||
@@ -503,7 +526,7 @@ } | ||
return this.each( function() { | ||
return this.each(function() { | ||
var dequeue = true, | ||
index = type != null && type + "queueHooks", | ||
timers = jQuery.timers, | ||
data = dataPriv.get( this ); | ||
data = data_priv.get( this ); | ||
@@ -523,5 +546,3 @@ if ( index ) { | ||
for ( index = timers.length; index--; ) { | ||
if ( timers[ index ].elem === this && | ||
( type == null || timers[ index ].queue === type ) ) { | ||
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { | ||
timers[ index ].anim.stop( gotoEnd ); | ||
@@ -539,3 +560,3 @@ dequeue = false; | ||
} | ||
} ); | ||
}); | ||
}, | ||
@@ -546,5 +567,5 @@ finish: function( type ) { | ||
} | ||
return this.each( function() { | ||
return this.each(function() { | ||
var index, | ||
data = dataPriv.get( this ), | ||
data = data_priv.get( this ), | ||
queue = data[ type + "queue" ], | ||
@@ -582,7 +603,7 @@ hooks = data[ type + "queueHooks" ], | ||
delete data.finish; | ||
} ); | ||
}); | ||
} | ||
} ); | ||
}); | ||
jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { | ||
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { | ||
var cssFn = jQuery.fn[ name ]; | ||
@@ -594,9 +615,9 @@ jQuery.fn[ name ] = function( speed, easing, callback ) { | ||
}; | ||
} ); | ||
}); | ||
// Generate shortcuts for custom animations | ||
jQuery.each( { | ||
slideDown: genFx( "show" ), | ||
slideUp: genFx( "hide" ), | ||
slideToggle: genFx( "toggle" ), | ||
jQuery.each({ | ||
slideDown: genFx("show"), | ||
slideUp: genFx("hide"), | ||
slideToggle: genFx("toggle"), | ||
fadeIn: { opacity: "show" }, | ||
@@ -609,3 +630,3 @@ fadeOut: { opacity: "hide" }, | ||
}; | ||
} ); | ||
}); | ||
@@ -622,3 +643,2 @@ jQuery.timers = []; | ||
timer = timers[ i ]; | ||
// Checks the timer has not already been removed | ||
@@ -646,5 +666,6 @@ if ( !timer() && timers[ i ] === timer ) { | ||
jQuery.fx.interval = 13; | ||
jQuery.fx.start = function() { | ||
if ( !timerId ) { | ||
timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); | ||
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); | ||
} | ||
@@ -654,4 +675,3 @@ }; | ||
jQuery.fx.stop = function() { | ||
window.clearInterval( timerId ); | ||
clearInterval( timerId ); | ||
timerId = null; | ||
@@ -663,3 +683,2 @@ }; | ||
fast: 200, | ||
// Default speed | ||
@@ -670,2 +689,2 @@ _default: 400 | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -8,7 +8,7 @@ "../selector", | ||
jQuery.expr.filters.animated = function( elem ) { | ||
return jQuery.grep( jQuery.timers, function( fn ) { | ||
return jQuery.grep(jQuery.timers, function( fn ) { | ||
return elem === fn.elem; | ||
} ).length; | ||
}).length; | ||
}; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -16,3 +16,3 @@ "../css" | ||
this.prop = prop; | ||
this.easing = easing || jQuery.easing._default; | ||
this.easing = easing || "swing"; | ||
this.options = options; | ||
@@ -63,6 +63,4 @@ this.start = this.now = this.cur(); | ||
// Use a property on the element directly when it is not a DOM element, | ||
// or when there is no matching style property that exists. | ||
if ( tween.elem.nodeType !== 1 || | ||
tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { | ||
if ( tween.elem[ tween.prop ] != null && | ||
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { | ||
return tween.elem[ tween.prop ]; | ||
@@ -76,3 +74,2 @@ } | ||
result = jQuery.css( tween.elem, tween.prop, "" ); | ||
// Empty strings, null, undefined and "auto" are converted to 0. | ||
@@ -82,3 +79,2 @@ return !result || result === "auto" ? 0 : result; | ||
set: function( tween ) { | ||
// Use step hook for back compat. | ||
@@ -89,5 +85,3 @@ // Use cssHook if its there. | ||
jQuery.fx.step[ tween.prop ]( tween ); | ||
} else if ( tween.elem.nodeType === 1 && | ||
( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || | ||
jQuery.cssHooks[ tween.prop ] ) ) { | ||
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { | ||
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); | ||
@@ -117,4 +111,3 @@ } else { | ||
return 0.5 - Math.cos( p * Math.PI ) / 2; | ||
}, | ||
_default: "swing" | ||
} | ||
}; | ||
@@ -127,2 +120,2 @@ | ||
} ); | ||
}); |
@@ -1,16 +0,20 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
"./var/document", | ||
"./var/strundefined", | ||
"./var/rnotwhite", | ||
"./var/hasOwn", | ||
"./var/slice", | ||
"./data/var/dataPriv", | ||
"./event/support", | ||
"./data/var/data_priv", | ||
"./core/init", | ||
"./data/accepts", | ||
"./selector" | ||
], function( jQuery, document, rnotwhite, slice, dataPriv ) { | ||
], function( jQuery, strundefined, rnotwhite, hasOwn, slice, support, data_priv ) { | ||
var | ||
rkeyEvent = /^key/, | ||
rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, | ||
rtypenamespace = /^([^.]*)(?:\.(.+)|)/; | ||
rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, | ||
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, | ||
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; | ||
@@ -25,4 +29,2 @@ function returnTrue() { | ||
// Support: IE9 | ||
// See #13393 for more info | ||
function safeActiveElement() { | ||
@@ -34,63 +36,2 @@ try { | ||
function on( elem, types, selector, data, fn, one ) { | ||
var origFn, type; | ||
// Types can be a map of types/handlers | ||
if ( typeof types === "object" ) { | ||
// ( types-Object, selector, data ) | ||
if ( typeof selector !== "string" ) { | ||
// ( types-Object, data ) | ||
data = data || selector; | ||
selector = undefined; | ||
} | ||
for ( type in types ) { | ||
on( elem, type, selector, data, types[ type ], one ); | ||
} | ||
return elem; | ||
} | ||
if ( data == null && fn == null ) { | ||
// ( types, fn ) | ||
fn = selector; | ||
data = selector = undefined; | ||
} else if ( fn == null ) { | ||
if ( typeof selector === "string" ) { | ||
// ( types, selector, fn ) | ||
fn = data; | ||
data = undefined; | ||
} else { | ||
// ( types, data, fn ) | ||
fn = data; | ||
data = selector; | ||
selector = undefined; | ||
} | ||
} | ||
if ( fn === false ) { | ||
fn = returnFalse; | ||
} else if ( !fn ) { | ||
return elem; | ||
} | ||
if ( one === 1 ) { | ||
origFn = fn; | ||
fn = function( event ) { | ||
// Can use an empty set, since event contains the info | ||
jQuery().off( event ); | ||
return origFn.apply( this, arguments ); | ||
}; | ||
// Use same guid so caller can remove using origFn | ||
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); | ||
} | ||
return elem.each( function() { | ||
jQuery.event.add( this, types, fn, data, selector ); | ||
} ); | ||
} | ||
/* | ||
@@ -109,3 +50,3 @@ * Helper functions for managing events -- not part of the public interface. | ||
special, handlers, type, namespaces, origType, | ||
elemData = dataPriv.get( elem ); | ||
elemData = data_priv.get( elem ); | ||
@@ -130,11 +71,10 @@ // Don't attach events to noData or text/comment nodes (but allow plain objects) | ||
// Init the element's event structure and main handler, if this is the first | ||
if ( !( events = elemData.events ) ) { | ||
if ( !(events = elemData.events) ) { | ||
events = elemData.events = {}; | ||
} | ||
if ( !( eventHandle = elemData.handle ) ) { | ||
if ( !(eventHandle = elemData.handle) ) { | ||
eventHandle = elemData.handle = function( e ) { | ||
// Discard the second event of a jQuery.event.trigger() and | ||
// when an event is called after a page has unloaded | ||
return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? | ||
return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? | ||
jQuery.event.dispatch.apply( elem, arguments ) : undefined; | ||
@@ -148,5 +88,5 @@ }; | ||
while ( t-- ) { | ||
tmp = rtypenamespace.exec( types[ t ] ) || []; | ||
type = origType = tmp[ 1 ]; | ||
namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); | ||
tmp = rtypenamespace.exec( types[t] ) || []; | ||
type = origType = tmp[1]; | ||
namespaces = ( tmp[2] || "" ).split( "." ).sort(); | ||
@@ -168,3 +108,3 @@ // There *must* be a type, no attaching namespace-only handlers | ||
// handleObj is passed to all event handlers | ||
handleObj = jQuery.extend( { | ||
handleObj = jQuery.extend({ | ||
type: type, | ||
@@ -177,7 +117,7 @@ origType: origType, | ||
needsContext: selector && jQuery.expr.match.needsContext.test( selector ), | ||
namespace: namespaces.join( "." ) | ||
namespace: namespaces.join(".") | ||
}, handleObjIn ); | ||
// Init the event handler queue if we're the first | ||
if ( !( handlers = events[ type ] ) ) { | ||
if ( !(handlers = events[ type ]) ) { | ||
handlers = events[ type ] = []; | ||
@@ -187,7 +127,5 @@ handlers.delegateCount = 0; | ||
// Only use addEventListener if the special events handler returns false | ||
if ( !special.setup || | ||
special.setup.call( elem, data, namespaces, eventHandle ) === false ) { | ||
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { | ||
if ( elem.addEventListener ) { | ||
elem.addEventListener( type, eventHandle ); | ||
elem.addEventListener( type, eventHandle, false ); | ||
} | ||
@@ -224,5 +162,5 @@ } | ||
special, handlers, type, namespaces, origType, | ||
elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); | ||
elemData = data_priv.hasData( elem ) && data_priv.get( elem ); | ||
if ( !elemData || !( events = elemData.events ) ) { | ||
if ( !elemData || !(events = elemData.events) ) { | ||
return; | ||
@@ -235,5 +173,5 @@ } | ||
while ( t-- ) { | ||
tmp = rtypenamespace.exec( types[ t ] ) || []; | ||
type = origType = tmp[ 1 ]; | ||
namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); | ||
tmp = rtypenamespace.exec( types[t] ) || []; | ||
type = origType = tmp[1]; | ||
namespaces = ( tmp[2] || "" ).split( "." ).sort(); | ||
@@ -251,4 +189,3 @@ // Unbind all events (on this namespace, if provided) for the element | ||
handlers = events[ type ] || []; | ||
tmp = tmp[ 2 ] && | ||
new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); | ||
tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); | ||
@@ -263,4 +200,3 @@ // Remove matching events | ||
( !tmp || tmp.test( handleObj.namespace ) ) && | ||
( !selector || selector === handleObj.selector || | ||
selector === "**" && handleObj.selector ) ) { | ||
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { | ||
handlers.splice( j, 1 ); | ||
@@ -280,5 +216,3 @@ | ||
if ( origCount && !handlers.length ) { | ||
if ( !special.teardown || | ||
special.teardown.call( elem, namespaces, elemData.handle ) === false ) { | ||
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { | ||
jQuery.removeEvent( elem, type, elemData.handle ); | ||
@@ -291,8 +225,141 @@ } | ||
// Remove data and the expando if it's no longer used | ||
// Remove the expando if it's no longer used | ||
if ( jQuery.isEmptyObject( events ) ) { | ||
dataPriv.remove( elem, "handle events" ); | ||
delete elemData.handle; | ||
data_priv.remove( elem, "events" ); | ||
} | ||
}, | ||
trigger: function( event, data, elem, onlyHandlers ) { | ||
var i, cur, tmp, bubbleType, ontype, handle, special, | ||
eventPath = [ elem || document ], | ||
type = hasOwn.call( event, "type" ) ? event.type : event, | ||
namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; | ||
cur = tmp = elem = elem || document; | ||
// Don't do events on text and comment nodes | ||
if ( elem.nodeType === 3 || elem.nodeType === 8 ) { | ||
return; | ||
} | ||
// focus/blur morphs to focusin/out; ensure we're not firing them right now | ||
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { | ||
return; | ||
} | ||
if ( type.indexOf(".") >= 0 ) { | ||
// Namespaced trigger; create a regexp to match event type in handle() | ||
namespaces = type.split("."); | ||
type = namespaces.shift(); | ||
namespaces.sort(); | ||
} | ||
ontype = type.indexOf(":") < 0 && "on" + type; | ||
// Caller can pass in a jQuery.Event object, Object, or just an event type string | ||
event = event[ jQuery.expando ] ? | ||
event : | ||
new jQuery.Event( type, typeof event === "object" && event ); | ||
// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) | ||
event.isTrigger = onlyHandlers ? 2 : 3; | ||
event.namespace = namespaces.join("."); | ||
event.namespace_re = event.namespace ? | ||
new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : | ||
null; | ||
// Clean up the event in case it is being reused | ||
event.result = undefined; | ||
if ( !event.target ) { | ||
event.target = elem; | ||
} | ||
// Clone any incoming data and prepend the event, creating the handler arg list | ||
data = data == null ? | ||
[ event ] : | ||
jQuery.makeArray( data, [ event ] ); | ||
// Allow special events to draw outside the lines | ||
special = jQuery.event.special[ type ] || {}; | ||
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { | ||
return; | ||
} | ||
// Determine event propagation path in advance, per W3C events spec (#9951) | ||
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724) | ||
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { | ||
bubbleType = special.delegateType || type; | ||
if ( !rfocusMorph.test( bubbleType + type ) ) { | ||
cur = cur.parentNode; | ||
} | ||
for ( ; cur; cur = cur.parentNode ) { | ||
eventPath.push( cur ); | ||
tmp = cur; | ||
} | ||
// Only add window if we got to document (e.g., not plain obj or detached DOM) | ||
if ( tmp === (elem.ownerDocument || document) ) { | ||
eventPath.push( tmp.defaultView || tmp.parentWindow || window ); | ||
} | ||
} | ||
// Fire handlers on the event path | ||
i = 0; | ||
while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { | ||
event.type = i > 1 ? | ||
bubbleType : | ||
special.bindType || type; | ||
// jQuery handler | ||
handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); | ||
if ( handle ) { | ||
handle.apply( cur, data ); | ||
} | ||
// Native handler | ||
handle = ontype && cur[ ontype ]; | ||
if ( handle && handle.apply && jQuery.acceptData( cur ) ) { | ||
event.result = handle.apply( cur, data ); | ||
if ( event.result === false ) { | ||
event.preventDefault(); | ||
} | ||
} | ||
} | ||
event.type = type; | ||
// If nobody prevented the default action, do it now | ||
if ( !onlyHandlers && !event.isDefaultPrevented() ) { | ||
if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && | ||
jQuery.acceptData( elem ) ) { | ||
// Call a native DOM method on the target with the same name name as the event. | ||
// Don't do default actions on window, that's where global variables be (#6170) | ||
if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { | ||
// Don't re-trigger an onFOO event when we call its FOO() method | ||
tmp = elem[ ontype ]; | ||
if ( tmp ) { | ||
elem[ ontype ] = null; | ||
} | ||
// Prevent re-triggering of the same event, since we already bubbled it above | ||
jQuery.event.triggered = type; | ||
elem[ type ](); | ||
jQuery.event.triggered = undefined; | ||
if ( tmp ) { | ||
elem[ ontype ] = tmp; | ||
} | ||
} | ||
} | ||
} | ||
return event.result; | ||
}, | ||
dispatch: function( event ) { | ||
@@ -306,7 +373,7 @@ | ||
args = slice.call( arguments ), | ||
handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], | ||
handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], | ||
special = jQuery.event.special[ event.type ] || {}; | ||
// Use the fix-ed jQuery.Event rather than the (read-only) native event | ||
args[ 0 ] = event; | ||
args[0] = event; | ||
event.delegateTarget = this; | ||
@@ -324,12 +391,11 @@ | ||
i = 0; | ||
while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { | ||
while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { | ||
event.currentTarget = matched.elem; | ||
j = 0; | ||
while ( ( handleObj = matched.handlers[ j++ ] ) && | ||
!event.isImmediatePropagationStopped() ) { | ||
while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { | ||
// Triggered event must either 1) have no namespace, or 2) have namespace(s) | ||
// a subset or equal to those in the bound event (both can have no namespace). | ||
if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { | ||
if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { | ||
@@ -339,7 +405,7 @@ event.handleObj = handleObj; | ||
ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || | ||
handleObj.handler ).apply( matched.elem, args ); | ||
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) | ||
.apply( matched.elem, args ); | ||
if ( ret !== undefined ) { | ||
if ( ( event.result = ret ) === false ) { | ||
if ( (event.result = ret) === false ) { | ||
event.preventDefault(); | ||
@@ -367,16 +433,11 @@ event.stopPropagation(); | ||
// Support (at least): Chrome, IE9 | ||
// Find delegate handlers | ||
// Black-hole SVG <use> instance trees (#13180) | ||
// | ||
// Support: Firefox<=42+ | ||
// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) | ||
if ( delegateCount && cur.nodeType && | ||
( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { | ||
// Avoid non-left-click bubbling in Firefox (#3861) | ||
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { | ||
for ( ; cur !== this; cur = cur.parentNode || this ) { | ||
// Don't check non-elements (#13208) | ||
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) | ||
if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { | ||
if ( cur.disabled !== true || event.type !== "click" ) { | ||
matches = []; | ||
@@ -391,3 +452,3 @@ for ( i = 0; i < delegateCount; i++ ) { | ||
matches[ sel ] = handleObj.needsContext ? | ||
jQuery( sel, this ).index( cur ) > -1 : | ||
jQuery( sel, this ).index( cur ) >= 0 : | ||
jQuery.find( sel, this, null, [ cur ] ).length; | ||
@@ -400,3 +461,3 @@ } | ||
if ( matches.length ) { | ||
handlerQueue.push( { elem: cur, handlers: matches } ); | ||
handlerQueue.push({ elem: cur, handlers: matches }); | ||
} | ||
@@ -409,3 +470,3 @@ } | ||
if ( delegateCount < handlers.length ) { | ||
handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); | ||
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); | ||
} | ||
@@ -417,4 +478,3 @@ | ||
// Includes some event props shared by KeyEvent and MouseEvent | ||
props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + | ||
"metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), | ||
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), | ||
@@ -424,3 +484,3 @@ fixHooks: {}, | ||
keyHooks: { | ||
props: "char charCode key keyCode".split( " " ), | ||
props: "char charCode key keyCode".split(" "), | ||
filter: function( event, original ) { | ||
@@ -438,4 +498,3 @@ | ||
mouseHooks: { | ||
props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " + | ||
"screenX screenY toElement" ).split( " " ), | ||
props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), | ||
filter: function( event, original ) { | ||
@@ -451,8 +510,4 @@ var eventDoc, doc, body, | ||
event.pageX = original.clientX + | ||
( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - | ||
( doc && doc.clientLeft || body && body.clientLeft || 0 ); | ||
event.pageY = original.clientY + | ||
( doc && doc.scrollTop || body && body.scrollTop || 0 ) - | ||
( doc && doc.clientTop || body && body.clientTop || 0 ); | ||
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); | ||
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); | ||
} | ||
@@ -514,3 +569,2 @@ | ||
load: { | ||
// Prevent triggered image.load events from bubbling to window.load | ||
@@ -520,3 +574,2 @@ noBubble: true | ||
focus: { | ||
// Fire native event if possible so blur/focus sequence is correct | ||
@@ -541,3 +594,2 @@ trigger: function() { | ||
click: { | ||
// For checkbox, fire native event so checked state will be right | ||
@@ -567,2 +619,25 @@ trigger: function() { | ||
} | ||
}, | ||
simulate: function( type, elem, event, bubble ) { | ||
// Piggyback on a donor event to simulate a different one. | ||
// Fake originalEvent to avoid donor's stopPropagation, but if the | ||
// simulated event prevents default then we do the same on the donor. | ||
var e = jQuery.extend( | ||
new jQuery.Event(), | ||
event, | ||
{ | ||
type: type, | ||
isSimulated: true, | ||
originalEvent: {} | ||
} | ||
); | ||
if ( bubble ) { | ||
jQuery.event.trigger( e, null, elem ); | ||
} else { | ||
jQuery.event.dispatch.call( elem, e ); | ||
} | ||
if ( e.isDefaultPrevented() ) { | ||
event.preventDefault(); | ||
} | ||
} | ||
@@ -572,6 +647,4 @@ }; | ||
jQuery.removeEvent = function( elem, type, handle ) { | ||
// This "if" is needed for plain objects | ||
if ( elem.removeEventListener ) { | ||
elem.removeEventListener( type, handle ); | ||
elem.removeEventListener( type, handle, false ); | ||
} | ||
@@ -581,5 +654,4 @@ }; | ||
jQuery.Event = function( src, props ) { | ||
// Allow instantiation without the 'new' keyword | ||
if ( !( this instanceof jQuery.Event ) ) { | ||
if ( !(this instanceof jQuery.Event) ) { | ||
return new jQuery.Event( src, props ); | ||
@@ -597,3 +669,2 @@ } | ||
src.defaultPrevented === undefined && | ||
// Support: Android<4.0 | ||
@@ -624,3 +695,2 @@ src.returnValue === false ? | ||
jQuery.Event.prototype = { | ||
constructor: jQuery.Event, | ||
isDefaultPrevented: returnFalse, | ||
@@ -635,3 +705,3 @@ isPropagationStopped: returnFalse, | ||
if ( e ) { | ||
if ( e && e.preventDefault ) { | ||
e.preventDefault(); | ||
@@ -645,3 +715,3 @@ } | ||
if ( e ) { | ||
if ( e && e.stopPropagation ) { | ||
e.stopPropagation(); | ||
@@ -655,3 +725,3 @@ } | ||
if ( e ) { | ||
if ( e && e.stopImmediatePropagation ) { | ||
e.stopImmediatePropagation(); | ||
@@ -665,10 +735,4 @@ } | ||
// Create mouseenter/leave events using mouseover/out and event-time checks | ||
// so that event delegation works in jQuery. | ||
// Do the same for pointerenter/pointerleave and pointerover/pointerout | ||
// | ||
// Support: Safari 7 only | ||
// Safari sends mouseenter too often; see: | ||
// https://code.google.com/p/chromium/issues/detail?id=470258 | ||
// for the description of the bug (it existed in older Chrome versions as well). | ||
jQuery.each( { | ||
// Support: Chrome 15+ | ||
jQuery.each({ | ||
mouseenter: "mouseover", | ||
@@ -689,5 +753,5 @@ mouseleave: "mouseout", | ||
// For mouseenter/leave call the handler if related is outside the target. | ||
// For mousenter/leave call the handler if related is outside the target. | ||
// NB: No relatedTarget if the mouse left/entered the browser window | ||
if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { | ||
if ( !related || (related !== target && !jQuery.contains( target, related )) ) { | ||
event.type = handleObj.origType; | ||
@@ -700,10 +764,97 @@ ret = handleObj.handler.apply( this, arguments ); | ||
}; | ||
} ); | ||
}); | ||
jQuery.fn.extend( { | ||
on: function( types, selector, data, fn ) { | ||
return on( this, types, selector, data, fn ); | ||
// Support: Firefox, Chrome, Safari | ||
// Create "bubbling" focus and blur events | ||
if ( !support.focusinBubbles ) { | ||
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { | ||
// Attach a single capturing handler on the document while someone wants focusin/focusout | ||
var handler = function( event ) { | ||
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); | ||
}; | ||
jQuery.event.special[ fix ] = { | ||
setup: function() { | ||
var doc = this.ownerDocument || this, | ||
attaches = data_priv.access( doc, fix ); | ||
if ( !attaches ) { | ||
doc.addEventListener( orig, handler, true ); | ||
} | ||
data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); | ||
}, | ||
teardown: function() { | ||
var doc = this.ownerDocument || this, | ||
attaches = data_priv.access( doc, fix ) - 1; | ||
if ( !attaches ) { | ||
doc.removeEventListener( orig, handler, true ); | ||
data_priv.remove( doc, fix ); | ||
} else { | ||
data_priv.access( doc, fix, attaches ); | ||
} | ||
} | ||
}; | ||
}); | ||
} | ||
jQuery.fn.extend({ | ||
on: function( types, selector, data, fn, /*INTERNAL*/ one ) { | ||
var origFn, type; | ||
// Types can be a map of types/handlers | ||
if ( typeof types === "object" ) { | ||
// ( types-Object, selector, data ) | ||
if ( typeof selector !== "string" ) { | ||
// ( types-Object, data ) | ||
data = data || selector; | ||
selector = undefined; | ||
} | ||
for ( type in types ) { | ||
this.on( type, selector, data, types[ type ], one ); | ||
} | ||
return this; | ||
} | ||
if ( data == null && fn == null ) { | ||
// ( types, fn ) | ||
fn = selector; | ||
data = selector = undefined; | ||
} else if ( fn == null ) { | ||
if ( typeof selector === "string" ) { | ||
// ( types, selector, fn ) | ||
fn = data; | ||
data = undefined; | ||
} else { | ||
// ( types, data, fn ) | ||
fn = data; | ||
data = selector; | ||
selector = undefined; | ||
} | ||
} | ||
if ( fn === false ) { | ||
fn = returnFalse; | ||
} else if ( !fn ) { | ||
return this; | ||
} | ||
if ( one === 1 ) { | ||
origFn = fn; | ||
fn = function( event ) { | ||
// Can use an empty set, since event contains the info | ||
jQuery().off( event ); | ||
return origFn.apply( this, arguments ); | ||
}; | ||
// Use same guid so caller can remove using origFn | ||
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); | ||
} | ||
return this.each( function() { | ||
jQuery.event.add( this, types, fn, data, selector ); | ||
}); | ||
}, | ||
one: function( types, selector, data, fn ) { | ||
return on( this, types, selector, data, fn, 1 ); | ||
return this.on( types, selector, data, fn, 1 ); | ||
}, | ||
@@ -713,9 +864,6 @@ off: function( types, selector, fn ) { | ||
if ( types && types.preventDefault && types.handleObj ) { | ||
// ( event ) dispatched jQuery.Event | ||
handleObj = types.handleObj; | ||
jQuery( types.delegateTarget ).off( | ||
handleObj.namespace ? | ||
handleObj.origType + "." + handleObj.namespace : | ||
handleObj.origType, | ||
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, | ||
handleObj.selector, | ||
@@ -727,3 +875,2 @@ handleObj.handler | ||
if ( typeof types === "object" ) { | ||
// ( types-object [, selector] ) | ||
@@ -736,3 +883,2 @@ for ( type in types ) { | ||
if ( selector === false || typeof selector === "function" ) { | ||
// ( types [, fn] ) | ||
@@ -745,9 +891,21 @@ fn = selector; | ||
} | ||
return this.each( function() { | ||
return this.each(function() { | ||
jQuery.event.remove( this, types, fn, selector ); | ||
} ); | ||
}); | ||
}, | ||
trigger: function( type, data ) { | ||
return this.each(function() { | ||
jQuery.event.trigger( type, data, this ); | ||
}); | ||
}, | ||
triggerHandler: function( type, data ) { | ||
var elem = this[0]; | ||
if ( elem ) { | ||
return jQuery.event.trigger( type, data, elem, true ); | ||
} | ||
} | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -7,15 +7,8 @@ "../event" | ||
// Attach a bunch of functions for handling common AJAX events | ||
jQuery.each( [ | ||
"ajaxStart", | ||
"ajaxStop", | ||
"ajaxComplete", | ||
"ajaxError", | ||
"ajaxSuccess", | ||
"ajaxSend" | ||
], function( i, type ) { | ||
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { | ||
jQuery.fn[ type ] = function( fn ) { | ||
return this.on( type, fn ); | ||
}; | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,12 +0,9 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
"../event", | ||
"./trigger" | ||
"../event" | ||
], function( jQuery ) { | ||
jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + | ||
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + | ||
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + | ||
"change select submit keydown keypress keyup error contextmenu" ).split( " " ), | ||
function( i, name ) { | ||
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { | ||
@@ -19,10 +16,25 @@ // Handle event binding | ||
}; | ||
} ); | ||
}); | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
hover: function( fnOver, fnOut ) { | ||
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); | ||
}, | ||
bind: function( types, data, fn ) { | ||
return this.on( types, null, data, fn ); | ||
}, | ||
unbind: function( types, fn ) { | ||
return this.off( types, null, fn ); | ||
}, | ||
delegate: function( selector, types, data, fn ) { | ||
return this.on( types, selector, data, fn ); | ||
}, | ||
undelegate: function( selector, types, fn ) { | ||
// ( namespace ) or ( selector, types [, fn] ) | ||
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); | ||
} | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,9 +0,9 @@ | ||
define( [ | ||
define([ | ||
"../var/support" | ||
], function( support ) { | ||
support.focusin = "onfocusin" in window; | ||
support.focusinBubbles = "onfocusin" in window; | ||
return support; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core" | ||
@@ -21,5 +21,5 @@ ], function( jQuery ) { | ||
return jQuery; | ||
} ); | ||
}); | ||
} | ||
} ); | ||
}); |
@@ -0,3 +1,7 @@ | ||
define([ | ||
"../core", | ||
"../var/strundefined" | ||
], function( jQuery, strundefined ) { | ||
var | ||
// Map over jQuery in case of overwrite | ||
@@ -24,4 +28,6 @@ _jQuery = window.jQuery, | ||
// and CommonJS for browser emulators (#13566) | ||
if ( !noGlobal ) { | ||
if ( typeof noGlobal === strundefined ) { | ||
window.jQuery = window.$ = jQuery; | ||
} | ||
}); |
@@ -8,3 +8,3 @@ /*! | ||
* | ||
* Copyright jQuery Foundation and other contributors | ||
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors | ||
* Released under the MIT license | ||
@@ -11,0 +11,0 @@ * http://jquery.org/license |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -14,3 +14,2 @@ "./selector", | ||
"./event/alias", | ||
"./event/focusin", | ||
"./manipulation", | ||
@@ -33,7 +32,8 @@ "./manipulation/_evalUrl", | ||
"./deprecated", | ||
"./exports/amd" | ||
"./exports/amd", | ||
"./exports/global" | ||
], function( jQuery ) { | ||
return ( window.jQuery = window.$ = jQuery ); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -7,36 +7,45 @@ "./var/concat", | ||
"./manipulation/var/rcheckableType", | ||
"./manipulation/var/rtagName", | ||
"./manipulation/var/rscriptType", | ||
"./manipulation/wrapMap", | ||
"./manipulation/getAll", | ||
"./manipulation/setGlobalEval", | ||
"./manipulation/buildFragment", | ||
"./manipulation/support", | ||
"./data/var/data_priv", | ||
"./data/var/data_user", | ||
"./data/var/dataPriv", | ||
"./data/var/dataUser", | ||
"./data/var/acceptData", | ||
"./core/init", | ||
"./data/accepts", | ||
"./traversing", | ||
"./selector", | ||
"./event" | ||
], function( jQuery, concat, push, access, | ||
rcheckableType, rtagName, rscriptType, | ||
wrapMap, getAll, setGlobalEval, buildFragment, support, | ||
dataPriv, dataUser, acceptData ) { | ||
], function( jQuery, concat, push, access, rcheckableType, support, data_priv, data_user ) { | ||
var | ||
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, | ||
// Support: IE 10-11, Edge 10240+ | ||
// In IE/Edge using regex groups here causes severe slowdowns. | ||
// See https://connect.microsoft.com/IE/feedback/details/1736512/ | ||
rnoInnerhtml = /<script|<style|<link/i, | ||
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, | ||
rtagName = /<([\w:]+)/, | ||
rhtml = /<|&#?\w+;/, | ||
rnoInnerhtml = /<(?:script|style|link)/i, | ||
// checked="checked" or checked | ||
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, | ||
rscriptType = /^$|\/(?:java|ecma)script/i, | ||
rscriptTypeMasked = /^true\/(.*)/, | ||
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; | ||
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, | ||
// We have to close these tags to support XHTML (#13200) | ||
wrapMap = { | ||
// Support: IE9 | ||
option: [ 1, "<select multiple='multiple'>", "</select>" ], | ||
thead: [ 1, "<table>", "</table>" ], | ||
col: [ 2, "<table><colgroup>", "</colgroup></table>" ], | ||
tr: [ 2, "<table><tbody>", "</tbody></table>" ], | ||
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], | ||
_default: [ 0, "", "" ] | ||
}; | ||
// Support: IE9 | ||
wrapMap.optgroup = wrapMap.option; | ||
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; | ||
wrapMap.th = wrapMap.td; | ||
// Support: 1.x compatibility | ||
// Manipulating tables requires a tbody | ||
@@ -47,4 +56,4 @@ function manipulationTarget( elem, content ) { | ||
elem.getElementsByTagName( "tbody" )[ 0 ] || | ||
elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : | ||
elem.getElementsByTagName("tbody")[0] || | ||
elem.appendChild( elem.ownerDocument.createElement("tbody") ) : | ||
elem; | ||
@@ -55,3 +64,3 @@ } | ||
function disableScript( elem ) { | ||
elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; | ||
elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; | ||
return elem; | ||
@@ -65,3 +74,3 @@ } | ||
} else { | ||
elem.removeAttribute( "type" ); | ||
elem.removeAttribute("type"); | ||
} | ||
@@ -72,2 +81,14 @@ | ||
// Mark scripts as having already been evaluated | ||
function setGlobalEval( elems, refElements ) { | ||
var i = 0, | ||
l = elems.length; | ||
for ( ; i < l; i++ ) { | ||
data_priv.set( | ||
elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) | ||
); | ||
} | ||
} | ||
function cloneCopyEvent( src, dest ) { | ||
@@ -81,5 +102,5 @@ var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; | ||
// 1. Copy private data: events, handlers, etc. | ||
if ( dataPriv.hasData( src ) ) { | ||
pdataOld = dataPriv.access( src ); | ||
pdataCur = dataPriv.set( dest, pdataOld ); | ||
if ( data_priv.hasData( src ) ) { | ||
pdataOld = data_priv.access( src ); | ||
pdataCur = data_priv.set( dest, pdataOld ); | ||
events = pdataOld.events; | ||
@@ -100,10 +121,20 @@ | ||
// 2. Copy user data | ||
if ( dataUser.hasData( src ) ) { | ||
udataOld = dataUser.access( src ); | ||
if ( data_user.hasData( src ) ) { | ||
udataOld = data_user.access( src ); | ||
udataCur = jQuery.extend( {}, udataOld ); | ||
dataUser.set( dest, udataCur ); | ||
data_user.set( dest, udataCur ); | ||
} | ||
} | ||
function getAll( context, tag ) { | ||
var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : | ||
context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : | ||
[]; | ||
return tag === undefined || tag && jQuery.nodeName( context, tag ) ? | ||
jQuery.merge( [ context ], ret ) : | ||
ret; | ||
} | ||
// Fix IE bugs, see support tests | ||
@@ -123,118 +154,3 @@ function fixInput( src, dest ) { | ||
function domManip( collection, args, callback, ignored ) { | ||
// Flatten any nested arrays | ||
args = concat.apply( [], args ); | ||
var fragment, first, scripts, hasScripts, node, doc, | ||
i = 0, | ||
l = collection.length, | ||
iNoClone = l - 1, | ||
value = args[ 0 ], | ||
isFunction = jQuery.isFunction( value ); | ||
// We can't cloneNode fragments that contain checked, in WebKit | ||
if ( isFunction || | ||
( l > 1 && typeof value === "string" && | ||
!support.checkClone && rchecked.test( value ) ) ) { | ||
return collection.each( function( index ) { | ||
var self = collection.eq( index ); | ||
if ( isFunction ) { | ||
args[ 0 ] = value.call( this, index, self.html() ); | ||
} | ||
domManip( self, args, callback, ignored ); | ||
} ); | ||
} | ||
if ( l ) { | ||
fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); | ||
first = fragment.firstChild; | ||
if ( fragment.childNodes.length === 1 ) { | ||
fragment = first; | ||
} | ||
// Require either new content or an interest in ignored elements to invoke the callback | ||
if ( first || ignored ) { | ||
scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); | ||
hasScripts = scripts.length; | ||
// Use the original fragment for the last item | ||
// instead of the first because it can end up | ||
// being emptied incorrectly in certain situations (#8070). | ||
for ( ; i < l; i++ ) { | ||
node = fragment; | ||
if ( i !== iNoClone ) { | ||
node = jQuery.clone( node, true, true ); | ||
// Keep references to cloned scripts for later restoration | ||
if ( hasScripts ) { | ||
// Support: Android<4.1, PhantomJS<2 | ||
// push.apply(_, arraylike) throws on ancient WebKit | ||
jQuery.merge( scripts, getAll( node, "script" ) ); | ||
} | ||
} | ||
callback.call( collection[ i ], node, i ); | ||
} | ||
if ( hasScripts ) { | ||
doc = scripts[ scripts.length - 1 ].ownerDocument; | ||
// Reenable scripts | ||
jQuery.map( scripts, restoreScript ); | ||
// Evaluate executable scripts on first document insertion | ||
for ( i = 0; i < hasScripts; i++ ) { | ||
node = scripts[ i ]; | ||
if ( rscriptType.test( node.type || "" ) && | ||
!dataPriv.access( node, "globalEval" ) && | ||
jQuery.contains( doc, node ) ) { | ||
if ( node.src ) { | ||
// Optional AJAX dependency, but won't run scripts if not present | ||
if ( jQuery._evalUrl ) { | ||
jQuery._evalUrl( node.src ); | ||
} | ||
} else { | ||
jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return collection; | ||
} | ||
function remove( elem, selector, keepData ) { | ||
var node, | ||
nodes = selector ? jQuery.filter( selector, elem ) : elem, | ||
i = 0; | ||
for ( ; ( node = nodes[ i ] ) != null; i++ ) { | ||
if ( !keepData && node.nodeType === 1 ) { | ||
jQuery.cleanData( getAll( node ) ); | ||
} | ||
if ( node.parentNode ) { | ||
if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { | ||
setGlobalEval( getAll( node, "script" ) ); | ||
} | ||
node.parentNode.removeChild( node ); | ||
} | ||
} | ||
return elem; | ||
} | ||
jQuery.extend( { | ||
htmlPrefilter: function( html ) { | ||
return html.replace( rxhtmlTag, "<$1></$2>" ); | ||
}, | ||
jQuery.extend({ | ||
clone: function( elem, dataAndEvents, deepDataAndEvents ) { | ||
@@ -282,10 +198,98 @@ var i, l, srcElements, destElements, | ||
buildFragment: function( elems, context, scripts, selection ) { | ||
var elem, tmp, tag, wrap, contains, j, | ||
fragment = context.createDocumentFragment(), | ||
nodes = [], | ||
i = 0, | ||
l = elems.length; | ||
for ( ; i < l; i++ ) { | ||
elem = elems[ i ]; | ||
if ( elem || elem === 0 ) { | ||
// Add nodes directly | ||
if ( jQuery.type( elem ) === "object" ) { | ||
// Support: QtWebKit, PhantomJS | ||
// push.apply(_, arraylike) throws on ancient WebKit | ||
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); | ||
// Convert non-html into a text node | ||
} else if ( !rhtml.test( elem ) ) { | ||
nodes.push( context.createTextNode( elem ) ); | ||
// Convert html into DOM nodes | ||
} else { | ||
tmp = tmp || fragment.appendChild( context.createElement("div") ); | ||
// Deserialize a standard representation | ||
tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); | ||
wrap = wrapMap[ tag ] || wrapMap._default; | ||
tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ]; | ||
// Descend through wrappers to the right content | ||
j = wrap[ 0 ]; | ||
while ( j-- ) { | ||
tmp = tmp.lastChild; | ||
} | ||
// Support: QtWebKit, PhantomJS | ||
// push.apply(_, arraylike) throws on ancient WebKit | ||
jQuery.merge( nodes, tmp.childNodes ); | ||
// Remember the top-level container | ||
tmp = fragment.firstChild; | ||
// Ensure the created nodes are orphaned (#12392) | ||
tmp.textContent = ""; | ||
} | ||
} | ||
} | ||
// Remove wrapper from fragment | ||
fragment.textContent = ""; | ||
i = 0; | ||
while ( (elem = nodes[ i++ ]) ) { | ||
// #4087 - If origin and destination elements are the same, and this is | ||
// that element, do not do anything | ||
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { | ||
continue; | ||
} | ||
contains = jQuery.contains( elem.ownerDocument, elem ); | ||
// Append to fragment | ||
tmp = getAll( fragment.appendChild( elem ), "script" ); | ||
// Preserve script evaluation history | ||
if ( contains ) { | ||
setGlobalEval( tmp ); | ||
} | ||
// Capture executables | ||
if ( scripts ) { | ||
j = 0; | ||
while ( (elem = tmp[ j++ ]) ) { | ||
if ( rscriptType.test( elem.type || "" ) ) { | ||
scripts.push( elem ); | ||
} | ||
} | ||
} | ||
} | ||
return fragment; | ||
}, | ||
cleanData: function( elems ) { | ||
var data, elem, type, | ||
var data, elem, type, key, | ||
special = jQuery.event.special, | ||
i = 0; | ||
for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { | ||
if ( acceptData( elem ) ) { | ||
if ( ( data = elem[ dataPriv.expando ] ) ) { | ||
for ( ; (elem = elems[ i ]) !== undefined; i++ ) { | ||
if ( jQuery.acceptData( elem ) ) { | ||
key = elem[ data_priv.expando ]; | ||
if ( key && (data = data_priv.cache[ key ]) ) { | ||
if ( data.events ) { | ||
@@ -302,31 +306,15 @@ for ( type in data.events ) { | ||
} | ||
// Support: Chrome <= 35-45+ | ||
// Assign undefined instead of using delete, see Data#remove | ||
elem[ dataPriv.expando ] = undefined; | ||
if ( data_priv.cache[ key ] ) { | ||
// Discard any remaining `private` data | ||
delete data_priv.cache[ key ]; | ||
} | ||
} | ||
if ( elem[ dataUser.expando ] ) { | ||
// Support: Chrome <= 35-45+ | ||
// Assign undefined instead of using delete, see Data#remove | ||
elem[ dataUser.expando ] = undefined; | ||
} | ||
} | ||
// Discard any remaining `user` data | ||
delete data_user.cache[ elem[ data_user.expando ] ]; | ||
} | ||
} | ||
} ); | ||
}); | ||
jQuery.fn.extend( { | ||
// Keep domManip exposed until 3.0 (gh-2225) | ||
domManip: domManip, | ||
detach: function( selector ) { | ||
return remove( this, selector, true ); | ||
}, | ||
remove: function( selector ) { | ||
return remove( this, selector ); | ||
}, | ||
jQuery.fn.extend({ | ||
text: function( value ) { | ||
@@ -336,7 +324,7 @@ return access( this, function( value ) { | ||
jQuery.text( this ) : | ||
this.empty().each( function() { | ||
this.empty().each(function() { | ||
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { | ||
this.textContent = value; | ||
} | ||
} ); | ||
}); | ||
}, null, value, arguments.length ); | ||
@@ -346,3 +334,3 @@ }, | ||
append: function() { | ||
return domManip( this, arguments, function( elem ) { | ||
return this.domManip( arguments, function( elem ) { | ||
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { | ||
@@ -352,7 +340,7 @@ var target = manipulationTarget( this, elem ); | ||
} | ||
} ); | ||
}); | ||
}, | ||
prepend: function() { | ||
return domManip( this, arguments, function( elem ) { | ||
return this.domManip( arguments, function( elem ) { | ||
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { | ||
@@ -362,21 +350,42 @@ var target = manipulationTarget( this, elem ); | ||
} | ||
} ); | ||
}); | ||
}, | ||
before: function() { | ||
return domManip( this, arguments, function( elem ) { | ||
return this.domManip( arguments, function( elem ) { | ||
if ( this.parentNode ) { | ||
this.parentNode.insertBefore( elem, this ); | ||
} | ||
} ); | ||
}); | ||
}, | ||
after: function() { | ||
return domManip( this, arguments, function( elem ) { | ||
return this.domManip( arguments, function( elem ) { | ||
if ( this.parentNode ) { | ||
this.parentNode.insertBefore( elem, this.nextSibling ); | ||
} | ||
} ); | ||
}); | ||
}, | ||
remove: function( selector, keepData /* Internal Use Only */ ) { | ||
var elem, | ||
elems = selector ? jQuery.filter( selector, this ) : this, | ||
i = 0; | ||
for ( ; (elem = elems[i]) != null; i++ ) { | ||
if ( !keepData && elem.nodeType === 1 ) { | ||
jQuery.cleanData( getAll( elem ) ); | ||
} | ||
if ( elem.parentNode ) { | ||
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { | ||
setGlobalEval( getAll( elem, "script" ) ); | ||
} | ||
elem.parentNode.removeChild( elem ); | ||
} | ||
} | ||
return this; | ||
}, | ||
empty: function() { | ||
@@ -386,3 +395,3 @@ var elem, | ||
for ( ; ( elem = this[ i ] ) != null; i++ ) { | ||
for ( ; (elem = this[i]) != null; i++ ) { | ||
if ( elem.nodeType === 1 ) { | ||
@@ -405,5 +414,5 @@ | ||
return this.map( function() { | ||
return this.map(function() { | ||
return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); | ||
} ); | ||
}); | ||
}, | ||
@@ -425,3 +434,3 @@ | ||
value = jQuery.htmlPrefilter( value ); | ||
value = value.replace( rxhtmlTag, "<$1></$2>" ); | ||
@@ -442,3 +451,3 @@ try { | ||
// If using innerHTML throws an exception, use the fallback method | ||
} catch ( e ) {} | ||
} catch( e ) {} | ||
} | ||
@@ -453,21 +462,111 @@ | ||
replaceWith: function() { | ||
var ignored = []; | ||
var arg = arguments[ 0 ]; | ||
// Make the changes, replacing each non-ignored context element with the new content | ||
return domManip( this, arguments, function( elem ) { | ||
var parent = this.parentNode; | ||
// Make the changes, replacing each context element with the new content | ||
this.domManip( arguments, function( elem ) { | ||
arg = this.parentNode; | ||
if ( jQuery.inArray( this, ignored ) < 0 ) { | ||
jQuery.cleanData( getAll( this ) ); | ||
if ( parent ) { | ||
parent.replaceChild( elem, this ); | ||
jQuery.cleanData( getAll( this ) ); | ||
if ( arg ) { | ||
arg.replaceChild( elem, this ); | ||
} | ||
}); | ||
// Force removal if there was no new content (e.g., from empty arguments) | ||
return arg && (arg.length || arg.nodeType) ? this : this.remove(); | ||
}, | ||
detach: function( selector ) { | ||
return this.remove( selector, true ); | ||
}, | ||
domManip: function( args, callback ) { | ||
// Flatten any nested arrays | ||
args = concat.apply( [], args ); | ||
var fragment, first, scripts, hasScripts, node, doc, | ||
i = 0, | ||
l = this.length, | ||
set = this, | ||
iNoClone = l - 1, | ||
value = args[ 0 ], | ||
isFunction = jQuery.isFunction( value ); | ||
// We can't cloneNode fragments that contain checked, in WebKit | ||
if ( isFunction || | ||
( l > 1 && typeof value === "string" && | ||
!support.checkClone && rchecked.test( value ) ) ) { | ||
return this.each(function( index ) { | ||
var self = set.eq( index ); | ||
if ( isFunction ) { | ||
args[ 0 ] = value.call( this, index, self.html() ); | ||
} | ||
self.domManip( args, callback ); | ||
}); | ||
} | ||
if ( l ) { | ||
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); | ||
first = fragment.firstChild; | ||
if ( fragment.childNodes.length === 1 ) { | ||
fragment = first; | ||
} | ||
// Force callback invocation | ||
}, ignored ); | ||
if ( first ) { | ||
scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); | ||
hasScripts = scripts.length; | ||
// Use the original fragment for the last item instead of the first because it can end up | ||
// being emptied incorrectly in certain situations (#8070). | ||
for ( ; i < l; i++ ) { | ||
node = fragment; | ||
if ( i !== iNoClone ) { | ||
node = jQuery.clone( node, true, true ); | ||
// Keep references to cloned scripts for later restoration | ||
if ( hasScripts ) { | ||
// Support: QtWebKit | ||
// jQuery.merge because push.apply(_, arraylike) throws | ||
jQuery.merge( scripts, getAll( node, "script" ) ); | ||
} | ||
} | ||
callback.call( this[ i ], node, i ); | ||
} | ||
if ( hasScripts ) { | ||
doc = scripts[ scripts.length - 1 ].ownerDocument; | ||
// Reenable scripts | ||
jQuery.map( scripts, restoreScript ); | ||
// Evaluate executable scripts on first document insertion | ||
for ( i = 0; i < hasScripts; i++ ) { | ||
node = scripts[ i ]; | ||
if ( rscriptType.test( node.type || "" ) && | ||
!data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { | ||
if ( node.src ) { | ||
// Optional AJAX dependency, but won't run scripts if not present | ||
if ( jQuery._evalUrl ) { | ||
jQuery._evalUrl( node.src ); | ||
} | ||
} else { | ||
jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return this; | ||
} | ||
} ); | ||
}); | ||
jQuery.each( { | ||
jQuery.each({ | ||
appendTo: "append", | ||
@@ -497,5 +596,5 @@ prependTo: "prepend", | ||
}; | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../ajax" | ||
@@ -6,6 +6,4 @@ ], function( jQuery ) { | ||
jQuery._evalUrl = function( url ) { | ||
return jQuery.ajax( { | ||
return jQuery.ajax({ | ||
url: url, | ||
// Make this explicit, since user can override this through ajaxSetup (#11264) | ||
type: "GET", | ||
@@ -16,3 +14,3 @@ dataType: "script", | ||
"throws": true | ||
} ); | ||
}); | ||
}; | ||
@@ -22,2 +20,2 @@ | ||
} ); | ||
}); |
@@ -1,7 +0,6 @@ | ||
define( [ | ||
"../var/document", | ||
define([ | ||
"../var/support" | ||
], function( document, support ) { | ||
], function( support ) { | ||
( function() { | ||
(function() { | ||
var fragment = document.createDocumentFragment(), | ||
@@ -11,3 +10,3 @@ div = fragment.appendChild( document.createElement( "div" ) ), | ||
// Support: Android 4.0-4.3, Safari<=5.1 | ||
// Support: Safari<=5.1 | ||
// Check state lost if the name is set (#11217) | ||
@@ -30,6 +29,6 @@ // Support: Windows Web Apps (WWA) | ||
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; | ||
} )(); | ||
})(); | ||
return support; | ||
} ); | ||
}); |
@@ -1,3 +0,3 @@ | ||
define( function() { | ||
return ( /^(?:checkbox|radio)$/i ); | ||
} ); | ||
define(function() { | ||
return (/^(?:checkbox|radio)$/i); | ||
}); |
@@ -1,6 +0,5 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
"./var/strundefined", | ||
"./core/access", | ||
"./var/document", | ||
"./var/documentElement", | ||
"./css/var/rnumnonpx", | ||
@@ -14,4 +13,6 @@ "./css/curCSS", | ||
"./selector" // contains | ||
], function( jQuery, access, document, documentElement, rnumnonpx, curCSS, addGetHookIf, support ) { | ||
], function( jQuery, strundefined, access, rnumnonpx, curCSS, addGetHookIf, support ) { | ||
var docElem = window.document.documentElement; | ||
/** | ||
@@ -40,3 +41,3 @@ * Gets a window from an element | ||
calculatePosition = ( position === "absolute" || position === "fixed" ) && | ||
( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; | ||
( curCSSTop + curCSSLeft ).indexOf("auto") > -1; | ||
@@ -56,5 +57,3 @@ // Need to be able to calculate position if either | ||
if ( jQuery.isFunction( options ) ) { | ||
// Use jQuery.extend here to allow modification of coordinates argument (gh-1848) | ||
options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); | ||
options = options.call( elem, i, curOffset ); | ||
} | ||
@@ -78,3 +77,3 @@ | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
offset: function( options ) { | ||
@@ -84,5 +83,5 @@ if ( arguments.length ) { | ||
this : | ||
this.each( function( i ) { | ||
this.each(function( i ) { | ||
jQuery.offset.setOffset( this, options, i ); | ||
} ); | ||
}); | ||
} | ||
@@ -106,3 +105,7 @@ | ||
box = elem.getBoundingClientRect(); | ||
// Support: BlackBerry 5, iOS 3 (original iPhone) | ||
// If we don't have gBCR, just use 0,0 rather than error | ||
if ( typeof elem.getBoundingClientRect !== strundefined ) { | ||
box = elem.getBoundingClientRect(); | ||
} | ||
win = getWindow( doc ); | ||
@@ -124,6 +127,4 @@ return { | ||
// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, | ||
// because it is its only offset parent | ||
// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent | ||
if ( jQuery.css( elem, "position" ) === "fixed" ) { | ||
// Assume getBoundingClientRect is there when computed position is fixed | ||
@@ -133,3 +134,2 @@ offset = elem.getBoundingClientRect(); | ||
} else { | ||
// Get *real* offsetParent | ||
@@ -156,24 +156,14 @@ offsetParent = this.offsetParent(); | ||
// This method will return documentElement in the following cases: | ||
// 1) For the element inside the iframe without offsetParent, this method will return | ||
// documentElement of the parent window | ||
// 2) For the hidden or detached element | ||
// 3) For body or html element, i.e. in case of the html node - it will return itself | ||
// | ||
// but those exceptions were never presented as a real life use-cases | ||
// and might be considered as more preferable results. | ||
// | ||
// This logic, however, is not guaranteed and can change at any point in the future | ||
offsetParent: function() { | ||
return this.map( function() { | ||
var offsetParent = this.offsetParent; | ||
return this.map(function() { | ||
var offsetParent = this.offsetParent || docElem; | ||
while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { | ||
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { | ||
offsetParent = offsetParent.offsetParent; | ||
} | ||
return offsetParent || documentElement; | ||
} ); | ||
return offsetParent || docElem; | ||
}); | ||
} | ||
} ); | ||
}); | ||
@@ -194,4 +184,4 @@ // Create scrollLeft and scrollTop methods | ||
win.scrollTo( | ||
!top ? val : win.pageXOffset, | ||
top ? val : win.pageYOffset | ||
!top ? val : window.pageXOffset, | ||
top ? val : window.pageYOffset | ||
); | ||
@@ -202,7 +192,7 @@ | ||
} | ||
}, method, val, arguments.length ); | ||
}, method, val, arguments.length, null ); | ||
}; | ||
} ); | ||
}); | ||
// Support: Safari<7-8+, Chrome<37-44+ | ||
// Support: Safari<7+, Chrome<37+ | ||
// Add the top/left cssHooks using jQuery.fn.position | ||
@@ -218,3 +208,2 @@ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 | ||
computed = curCSS( elem, prop ); | ||
// If curCSS returns percentage, fallback to offset | ||
@@ -227,5 +216,5 @@ return rnumnonpx.test( computed ) ? | ||
); | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,1 @@ | ||
return jQuery; | ||
})); |
@@ -1,9 +0,9 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
"./data/var/dataPriv", | ||
"./data/var/data_priv", | ||
"./deferred", | ||
"./callbacks" | ||
], function( jQuery, dataPriv ) { | ||
], function( jQuery, data_priv ) { | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
queue: function( elem, type, data ) { | ||
@@ -14,3 +14,3 @@ var queue; | ||
type = ( type || "fx" ) + "queue"; | ||
queue = dataPriv.get( elem, type ); | ||
queue = data_priv.get( elem, type ); | ||
@@ -20,3 +20,3 @@ // Speed up dequeue by getting out quickly if this is just a lookup | ||
if ( !queue || jQuery.isArray( data ) ) { | ||
queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); | ||
queue = data_priv.access( elem, type, jQuery.makeArray(data) ); | ||
} else { | ||
@@ -68,11 +68,11 @@ queue.push( data ); | ||
var key = type + "queueHooks"; | ||
return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { | ||
empty: jQuery.Callbacks( "once memory" ).add( function() { | ||
dataPriv.remove( elem, [ type + "queue", key ] ); | ||
} ) | ||
} ); | ||
return data_priv.get( elem, key ) || data_priv.access( elem, key, { | ||
empty: jQuery.Callbacks("once memory").add(function() { | ||
data_priv.remove( elem, [ type + "queue", key ] ); | ||
}) | ||
}); | ||
} | ||
} ); | ||
}); | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
queue: function( type, data ) { | ||
@@ -88,3 +88,3 @@ var setter = 2; | ||
if ( arguments.length < setter ) { | ||
return jQuery.queue( this[ 0 ], type ); | ||
return jQuery.queue( this[0], type ); | ||
} | ||
@@ -94,3 +94,3 @@ | ||
this : | ||
this.each( function() { | ||
this.each(function() { | ||
var queue = jQuery.queue( this, type, data ); | ||
@@ -101,11 +101,11 @@ | ||
if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { | ||
if ( type === "fx" && queue[0] !== "inprogress" ) { | ||
jQuery.dequeue( this, type ); | ||
} | ||
} ); | ||
}); | ||
}, | ||
dequeue: function( type ) { | ||
return this.each( function() { | ||
return this.each(function() { | ||
jQuery.dequeue( this, type ); | ||
} ); | ||
}); | ||
}, | ||
@@ -115,3 +115,2 @@ clearQueue: function( type ) { | ||
}, | ||
// Get a promise resolved when queues of a certain type | ||
@@ -138,3 +137,3 @@ // are emptied (fx is the type by default) | ||
while ( i-- ) { | ||
tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); | ||
tmp = data_priv.get( elements[ i ], type + "queueHooks" ); | ||
if ( tmp && tmp.empty ) { | ||
@@ -148,5 +147,5 @@ count++; | ||
} | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -8,3 +8,3 @@ "../queue", | ||
// Based off of the plugin by Clint Helfers, with permission. | ||
// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ | ||
// http://blindsignals.com/index.php/2009/07/jquery-delay/ | ||
jQuery.fn.delay = function( time, type ) { | ||
@@ -15,10 +15,10 @@ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; | ||
return this.queue( type, function( next, hooks ) { | ||
var timeout = window.setTimeout( next, time ); | ||
var timeout = setTimeout( next, time ); | ||
hooks.stop = function() { | ||
window.clearTimeout( timeout ); | ||
clearTimeout( timeout ); | ||
}; | ||
} ); | ||
}); | ||
}; | ||
return jQuery.fn.delay; | ||
} ); | ||
}); |
@@ -1,8 +0,4 @@ | ||
define( [ | ||
"./core", | ||
"./var/document", | ||
"./var/documentElement", | ||
"./var/hasOwn", | ||
"./var/indexOf" | ||
], function( jQuery, document, documentElement, hasOwn, indexOf ) { | ||
define([ | ||
"./core" | ||
], function( jQuery ) { | ||
@@ -34,82 +30,42 @@ /* | ||
var hasDuplicate, sortInput, | ||
sortStable = jQuery.expando.split( "" ).sort( sortOrder ).join( "" ) === jQuery.expando, | ||
matches = documentElement.matches || | ||
documentElement.webkitMatchesSelector || | ||
documentElement.mozMatchesSelector || | ||
documentElement.oMatchesSelector || | ||
documentElement.msMatchesSelector; | ||
function sortOrder( a, b ) { | ||
// Flag for duplicate removal | ||
if ( a === b ) { | ||
hasDuplicate = true; | ||
return 0; | ||
} | ||
// Sort on method existence if only one input has compareDocumentPosition | ||
var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; | ||
if ( compare ) { | ||
return compare; | ||
} | ||
// Calculate position if both inputs belong to the same document | ||
compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? | ||
a.compareDocumentPosition( b ) : | ||
// Otherwise we know they are disconnected | ||
1; | ||
// Disconnected nodes | ||
if ( compare & 1 ) { | ||
// Choose the first element that is related to our preferred document | ||
if ( a === document || a.ownerDocument === document && | ||
jQuery.contains( document, a ) ) { | ||
return -1; | ||
var docElem = window.document.documentElement, | ||
selector_hasDuplicate, | ||
matches = docElem.matches || | ||
docElem.webkitMatchesSelector || | ||
docElem.mozMatchesSelector || | ||
docElem.oMatchesSelector || | ||
docElem.msMatchesSelector, | ||
selector_sortOrder = function( a, b ) { | ||
// Flag for duplicate removal | ||
if ( a === b ) { | ||
selector_hasDuplicate = true; | ||
return 0; | ||
} | ||
if ( b === document || b.ownerDocument === document && | ||
jQuery.contains( document, b ) ) { | ||
return 1; | ||
} | ||
// Maintain original order | ||
return sortInput ? | ||
( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : | ||
0; | ||
} | ||
var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); | ||
return compare & 4 ? -1 : 1; | ||
} | ||
if ( compare ) { | ||
// Disconnected nodes | ||
if ( compare & 1 ) { | ||
function uniqueSort( results ) { | ||
var elem, | ||
duplicates = [], | ||
j = 0, | ||
i = 0; | ||
// Choose the first element that is related to our document | ||
if ( a === document || jQuery.contains(document, a) ) { | ||
return -1; | ||
} | ||
if ( b === document || jQuery.contains(document, b) ) { | ||
return 1; | ||
} | ||
hasDuplicate = false; | ||
sortInput = !sortStable && results.slice( 0 ); | ||
results.sort( sortOrder ); | ||
// Maintain original order | ||
return 0; | ||
} | ||
if ( hasDuplicate ) { | ||
while ( ( elem = results[ i++ ] ) ) { | ||
if ( elem === results[ i ] ) { | ||
j = duplicates.push( i ); | ||
} | ||
return compare & 4 ? -1 : 1; | ||
} | ||
while ( j-- ) { | ||
results.splice( duplicates[ j ], 1 ); | ||
} | ||
} | ||
// Clear input after sorting to release objects | ||
// See https://github.com/jquery/sizzle/pull/225 | ||
sortInput = null; | ||
// Not directly comparable, sort on existence of method | ||
return a.compareDocumentPosition ? -1 : 1; | ||
}; | ||
return results; | ||
} | ||
jQuery.extend( { | ||
jQuery.extend({ | ||
find: function( selector, context, results, seed ) { | ||
@@ -128,3 +84,3 @@ var elem, nodeType, | ||
// Early return if context is not an element or document | ||
if ( ( nodeType = context.nodeType ) !== 1 && nodeType !== 9 ) { | ||
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { | ||
return []; | ||
@@ -134,4 +90,4 @@ } | ||
if ( seed ) { | ||
while ( ( elem = seed[ i++ ] ) ) { | ||
if ( jQuery.find.matchesSelector( elem, selector ) ) { | ||
while ( (elem = seed[i++]) ) { | ||
if ( jQuery.find.matchesSelector(elem, selector) ) { | ||
results.push( elem ); | ||
@@ -141,3 +97,3 @@ } | ||
} else { | ||
jQuery.merge( results, context.querySelectorAll( selector ) ); | ||
jQuery.merge( results, context.querySelectorAll(selector) ); | ||
} | ||
@@ -147,4 +103,24 @@ | ||
}, | ||
uniqueSort: uniqueSort, | ||
unique: uniqueSort, | ||
unique: function( results ) { | ||
var elem, | ||
duplicates = [], | ||
i = 0, | ||
j = 0; | ||
selector_hasDuplicate = false; | ||
results.sort( selector_sortOrder ); | ||
if ( selector_hasDuplicate ) { | ||
while ( (elem = results[i++]) ) { | ||
if ( elem === results[ i ] ) { | ||
j = duplicates.push( i ); | ||
} | ||
} | ||
while ( j-- ) { | ||
results.splice( duplicates[ j ], 1 ); | ||
} | ||
} | ||
return results; | ||
}, | ||
text: function( elem ) { | ||
@@ -157,6 +133,4 @@ var node, | ||
if ( !nodeType ) { | ||
// If no nodeType, this is expected to be an array | ||
while ( ( node = elem[ i++ ] ) ) { | ||
while ( (node = elem[i++]) ) { | ||
// Do not traverse comment nodes | ||
@@ -166,3 +140,2 @@ ret += jQuery.text( node ); | ||
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { | ||
// Use textContent for elements | ||
@@ -173,3 +146,2 @@ return elem.textContent; | ||
} | ||
// Do not include comment or processing instruction nodes | ||
@@ -182,10 +154,6 @@ | ||
bup = b && b.parentNode; | ||
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains( bup ) ); | ||
return a === bup || !!( bup && bup.nodeType === 1 && adown.contains(bup) ); | ||
}, | ||
isXMLDoc: function( elem ) { | ||
// documentElement is verified for cases where it doesn't yet exist | ||
// (such as loading iframes in IE - #4833) | ||
var documentElement = elem && ( elem.ownerDocument || elem ).documentElement; | ||
return documentElement ? documentElement.nodeName !== "HTML" : false; | ||
return (elem.ownerDocument || elem).documentElement.nodeName !== "HTML"; | ||
}, | ||
@@ -195,8 +163,7 @@ expr: { | ||
match: { | ||
bool: new RegExp( "^(?:checked|selected|async|autofocus|autoplay|controls|defer" + | ||
"|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$", "i" ), | ||
bool: /^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i, | ||
needsContext: /^[\x20\t\r\n\f]*[>+~]/ | ||
} | ||
} | ||
} ); | ||
}); | ||
@@ -211,12 +178,6 @@ jQuery.extend( jQuery.find, { | ||
attr: function( elem, name ) { | ||
var fn = jQuery.expr.attrHandle[ name.toLowerCase() ], | ||
// Don't get fooled by Object.prototype properties (jQuery #13807) | ||
value = fn && hasOwn.call( jQuery.expr.attrHandle, name.toLowerCase() ) ? | ||
fn( elem, name, jQuery.isXMLDoc( elem ) ) : | ||
undefined; | ||
return value !== undefined ? value : elem.getAttribute( name ); | ||
return elem.getAttribute( name ); | ||
} | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,4 +0,4 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
"../external/sizzle/dist/sizzle" | ||
"sizzle" | ||
], function( jQuery, Sizzle ) { | ||
@@ -8,4 +8,4 @@ | ||
jQuery.expr = Sizzle.selectors; | ||
jQuery.expr[ ":" ] = jQuery.expr.pseudos; | ||
jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; | ||
jQuery.expr[":"] = jQuery.expr.pseudos; | ||
jQuery.unique = Sizzle.uniqueSort; | ||
jQuery.text = Sizzle.getText; | ||
@@ -15,2 +15,2 @@ jQuery.isXMLDoc = Sizzle.isXML; | ||
} ); | ||
}); |
@@ -1,1 +0,1 @@ | ||
define( [ "./selector-sizzle" ], function() {} ); | ||
define([ "./selector-sizzle" ]); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -19,7 +19,5 @@ "./manipulation/var/rcheckableType", | ||
if ( jQuery.isArray( obj ) ) { | ||
// Serialize array item. | ||
jQuery.each( obj, function( i, v ) { | ||
if ( traditional || rbracket.test( prefix ) ) { | ||
// Treat each array item as a scalar. | ||
@@ -29,15 +27,8 @@ add( prefix, v ); | ||
} else { | ||
// Item is non-scalar (array or object), encode its numeric index. | ||
buildParams( | ||
prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", | ||
v, | ||
traditional, | ||
add | ||
); | ||
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); | ||
} | ||
} ); | ||
}); | ||
} else if ( !traditional && jQuery.type( obj ) === "object" ) { | ||
// Serialize object item. | ||
@@ -49,3 +40,2 @@ for ( name in obj ) { | ||
} else { | ||
// Serialize scalar item. | ||
@@ -62,3 +52,2 @@ add( prefix, obj ); | ||
add = function( key, value ) { | ||
// If value is a function, invoke it and return its value | ||
@@ -76,10 +65,8 @@ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); | ||
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { | ||
// Serialize the form elements | ||
jQuery.each( a, function() { | ||
add( this.name, this.value ); | ||
} ); | ||
}); | ||
} else { | ||
// If traditional, encode the "old" way (the way 1.3.2 or older | ||
@@ -96,3 +83,3 @@ // did it), otherwise encode params recursively. | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
serialize: function() { | ||
@@ -102,9 +89,8 @@ return jQuery.param( this.serializeArray() ); | ||
serializeArray: function() { | ||
return this.map( function() { | ||
return this.map(function() { | ||
// Can add propHook for "elements" to filter or add form elements | ||
var elements = jQuery.prop( this, "elements" ); | ||
return elements ? jQuery.makeArray( elements ) : this; | ||
} ) | ||
.filter( function() { | ||
}) | ||
.filter(function() { | ||
var type = this.type; | ||
@@ -116,4 +102,4 @@ | ||
( this.checked || !rcheckableType.test( type ) ); | ||
} ) | ||
.map( function( i, elem ) { | ||
}) | ||
.map(function( i, elem ) { | ||
var val = jQuery( this ).val(); | ||
@@ -126,9 +112,9 @@ | ||
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; | ||
} ) : | ||
}) : | ||
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; | ||
} ).get(); | ||
}).get(); | ||
} | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,6 +0,4 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
"./var/indexOf", | ||
"./traversing/var/dir", | ||
"./traversing/var/siblings", | ||
"./traversing/var/rneedsContext", | ||
@@ -10,6 +8,5 @@ "./core/init", | ||
"./selector" | ||
], function( jQuery, indexOf, dir, siblings, rneedsContext ) { | ||
], function( jQuery, indexOf, rneedsContext ) { | ||
var rparentsprev = /^(?:parents|prev(?:Until|All))/, | ||
// Methods guaranteed to produce a unique set when starting from a unique set | ||
@@ -23,3 +20,32 @@ guaranteedUnique = { | ||
jQuery.fn.extend( { | ||
jQuery.extend({ | ||
dir: function( elem, dir, until ) { | ||
var matched = [], | ||
truncate = until !== undefined; | ||
while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { | ||
if ( elem.nodeType === 1 ) { | ||
if ( truncate && jQuery( elem ).is( until ) ) { | ||
break; | ||
} | ||
matched.push( elem ); | ||
} | ||
} | ||
return matched; | ||
}, | ||
sibling: function( n, elem ) { | ||
var matched = []; | ||
for ( ; n; n = n.nextSibling ) { | ||
if ( n.nodeType === 1 && n !== elem ) { | ||
matched.push( n ); | ||
} | ||
} | ||
return matched; | ||
} | ||
}); | ||
jQuery.fn.extend({ | ||
has: function( target ) { | ||
@@ -29,10 +55,10 @@ var targets = jQuery( target, this ), | ||
return this.filter( function() { | ||
return this.filter(function() { | ||
var i = 0; | ||
for ( ; i < l; i++ ) { | ||
if ( jQuery.contains( this, targets[ i ] ) ) { | ||
if ( jQuery.contains( this, targets[i] ) ) { | ||
return true; | ||
} | ||
} | ||
} ); | ||
}); | ||
}, | ||
@@ -50,11 +76,10 @@ | ||
for ( ; i < l; i++ ) { | ||
for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { | ||
for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { | ||
// Always skip document fragments | ||
if ( cur.nodeType < 11 && ( pos ? | ||
pos.index( cur ) > -1 : | ||
if ( cur.nodeType < 11 && (pos ? | ||
pos.index(cur) > -1 : | ||
// Don't pass non-elements to Sizzle | ||
cur.nodeType === 1 && | ||
jQuery.find.matchesSelector( cur, selectors ) ) ) { | ||
jQuery.find.matchesSelector(cur, selectors)) ) { | ||
@@ -67,3 +92,3 @@ matched.push( cur ); | ||
return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); | ||
return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); | ||
}, | ||
@@ -94,3 +119,3 @@ | ||
return this.pushStack( | ||
jQuery.uniqueSort( | ||
jQuery.unique( | ||
jQuery.merge( this.get(), jQuery( selector, context ) ) | ||
@@ -103,13 +128,13 @@ ) | ||
return this.add( selector == null ? | ||
this.prevObject : this.prevObject.filter( selector ) | ||
this.prevObject : this.prevObject.filter(selector) | ||
); | ||
} | ||
} ); | ||
}); | ||
function sibling( cur, dir ) { | ||
while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} | ||
while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} | ||
return cur; | ||
} | ||
jQuery.each( { | ||
jQuery.each({ | ||
parent: function( elem ) { | ||
@@ -120,6 +145,6 @@ var parent = elem.parentNode; | ||
parents: function( elem ) { | ||
return dir( elem, "parentNode" ); | ||
return jQuery.dir( elem, "parentNode" ); | ||
}, | ||
parentsUntil: function( elem, i, until ) { | ||
return dir( elem, "parentNode", until ); | ||
return jQuery.dir( elem, "parentNode", until ); | ||
}, | ||
@@ -133,18 +158,18 @@ next: function( elem ) { | ||
nextAll: function( elem ) { | ||
return dir( elem, "nextSibling" ); | ||
return jQuery.dir( elem, "nextSibling" ); | ||
}, | ||
prevAll: function( elem ) { | ||
return dir( elem, "previousSibling" ); | ||
return jQuery.dir( elem, "previousSibling" ); | ||
}, | ||
nextUntil: function( elem, i, until ) { | ||
return dir( elem, "nextSibling", until ); | ||
return jQuery.dir( elem, "nextSibling", until ); | ||
}, | ||
prevUntil: function( elem, i, until ) { | ||
return dir( elem, "previousSibling", until ); | ||
return jQuery.dir( elem, "previousSibling", until ); | ||
}, | ||
siblings: function( elem ) { | ||
return siblings( ( elem.parentNode || {} ).firstChild, elem ); | ||
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); | ||
}, | ||
children: function( elem ) { | ||
return siblings( elem.firstChild ); | ||
return jQuery.sibling( elem.firstChild ); | ||
}, | ||
@@ -167,6 +192,5 @@ contents: function( elem ) { | ||
if ( this.length > 1 ) { | ||
// Remove duplicates | ||
if ( !guaranteedUnique[ name ] ) { | ||
jQuery.uniqueSort( matched ); | ||
jQuery.unique( matched ); | ||
} | ||
@@ -182,5 +206,5 @@ | ||
}; | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../core", | ||
@@ -16,3 +16,3 @@ "../var/indexOf", | ||
return !!qualifier.call( elem, i, elem ) !== not; | ||
} ); | ||
}); | ||
@@ -24,3 +24,3 @@ } | ||
return ( elem === qualifier ) !== not; | ||
} ); | ||
}); | ||
@@ -38,4 +38,4 @@ } | ||
return jQuery.grep( elements, function( elem ) { | ||
return ( indexOf.call( qualifier, elem ) > -1 ) !== not; | ||
} ); | ||
return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; | ||
}); | ||
} | ||
@@ -54,6 +54,6 @@ | ||
return elem.nodeType === 1; | ||
} ) ); | ||
})); | ||
}; | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
find: function( selector ) { | ||
@@ -66,3 +66,3 @@ var i, | ||
if ( typeof selector !== "string" ) { | ||
return this.pushStack( jQuery( selector ).filter( function() { | ||
return this.pushStack( jQuery( selector ).filter(function() { | ||
for ( i = 0; i < len; i++ ) { | ||
@@ -73,3 +73,3 @@ if ( jQuery.contains( self[ i ], this ) ) { | ||
} | ||
} ) ); | ||
}) ); | ||
} | ||
@@ -87,6 +87,6 @@ | ||
filter: function( selector ) { | ||
return this.pushStack( winnow( this, selector || [], false ) ); | ||
return this.pushStack( winnow(this, selector || [], false) ); | ||
}, | ||
not: function( selector ) { | ||
return this.pushStack( winnow( this, selector || [], true ) ); | ||
return this.pushStack( winnow(this, selector || [], true) ); | ||
}, | ||
@@ -105,4 +105,4 @@ is: function( selector ) { | ||
} | ||
} ); | ||
}); | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"../../core", | ||
@@ -6,2 +6,2 @@ "../../selector" | ||
return jQuery.expr.match.needsContext; | ||
} ); | ||
}); |
@@ -1,3 +0,3 @@ | ||
define( function() { | ||
define(function() { | ||
return []; | ||
} ); | ||
}); |
@@ -1,5 +0,4 @@ | ||
define( function() { | ||
define(function() { | ||
// [[Class]] -> type pairs | ||
return {}; | ||
} ); | ||
}); |
@@ -1,5 +0,5 @@ | ||
define( [ | ||
define([ | ||
"./arr" | ||
], function( arr ) { | ||
return arr.concat; | ||
} ); | ||
}); |
@@ -1,5 +0,5 @@ | ||
define( [ | ||
define([ | ||
"./class2type" | ||
], function( class2type ) { | ||
return class2type.hasOwnProperty; | ||
} ); | ||
}); |
@@ -1,5 +0,5 @@ | ||
define( [ | ||
define([ | ||
"./arr" | ||
], function( arr ) { | ||
return arr.indexOf; | ||
} ); | ||
}); |
@@ -1,3 +0,3 @@ | ||
define( function() { | ||
return ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; | ||
} ); | ||
define(function() { | ||
return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; | ||
}); |
@@ -1,5 +0,5 @@ | ||
define( [ | ||
define([ | ||
"./arr" | ||
], function( arr ) { | ||
return arr.push; | ||
} ); | ||
}); |
@@ -1,3 +0,3 @@ | ||
define( function() { | ||
return ( /\S+/g ); | ||
} ); | ||
define(function() { | ||
return (/\S+/g); | ||
}); |
@@ -1,5 +0,5 @@ | ||
define( [ | ||
define([ | ||
"./arr" | ||
], function( arr ) { | ||
return arr.slice; | ||
} ); | ||
}); |
@@ -1,5 +0,4 @@ | ||
define( function() { | ||
define(function() { | ||
// All support tests are defined in their respective modules. | ||
return {}; | ||
} ); | ||
}); |
@@ -1,5 +0,5 @@ | ||
define( [ | ||
define([ | ||
"./class2type" | ||
], function( class2type ) { | ||
return class2type.toString; | ||
} ); | ||
}); |
@@ -1,2 +0,2 @@ | ||
define( [ | ||
define([ | ||
"./core", | ||
@@ -8,3 +8,3 @@ "./core/init", | ||
jQuery.fn.extend( { | ||
jQuery.fn.extend({ | ||
wrapAll: function( html ) { | ||
@@ -14,5 +14,5 @@ var wrap; | ||
if ( jQuery.isFunction( html ) ) { | ||
return this.each( function( i ) { | ||
jQuery( this ).wrapAll( html.call( this, i ) ); | ||
} ); | ||
return this.each(function( i ) { | ||
jQuery( this ).wrapAll( html.call(this, i) ); | ||
}); | ||
} | ||
@@ -29,3 +29,3 @@ | ||
wrap.map( function() { | ||
wrap.map(function() { | ||
var elem = this; | ||
@@ -38,3 +38,3 @@ | ||
return elem; | ||
} ).append( this ); | ||
}).append( this ); | ||
} | ||
@@ -47,8 +47,8 @@ | ||
if ( jQuery.isFunction( html ) ) { | ||
return this.each( function( i ) { | ||
jQuery( this ).wrapInner( html.call( this, i ) ); | ||
} ); | ||
return this.each(function( i ) { | ||
jQuery( this ).wrapInner( html.call(this, i) ); | ||
}); | ||
} | ||
return this.each( function() { | ||
return this.each(function() { | ||
var self = jQuery( this ), | ||
@@ -63,3 +63,3 @@ contents = self.contents(); | ||
} | ||
} ); | ||
}); | ||
}, | ||
@@ -70,17 +70,17 @@ | ||
return this.each( function( i ) { | ||
jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); | ||
} ); | ||
return this.each(function( i ) { | ||
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); | ||
}); | ||
}, | ||
unwrap: function() { | ||
return this.parent().each( function() { | ||
return this.parent().each(function() { | ||
if ( !jQuery.nodeName( this, "body" ) ) { | ||
jQuery( this ).replaceWith( this.childNodes ); | ||
} | ||
} ).end(); | ||
}).end(); | ||
} | ||
} ); | ||
}); | ||
return jQuery; | ||
} ); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license
Found 2 instances in 1 package
0
100
4262325
389
82739
2