update jquery and jquery ui

This should still be compatible with bootstrap2 but is required for bootstrap3
This commit is contained in:
Sören Brunk 2014-04-07 13:42:45 +02:00
parent 1cd169e0c8
commit 4d4797b8c8
5 changed files with 7377 additions and 7635 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
/*!
* jQuery UI Core 1.10.1
* jQuery UI Core 1.10.4
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
@ -13,16 +13,11 @@
var uuid = 0,
runiqueId = /^ui-id-\d+$/;
// prevent duplicate loading
// this is only a problem because we proxy existing functions
// and we don't want to double proxy them
// $.ui might exist from components with no dependencies, e.g., $.ui.position
$.ui = $.ui || {};
if ( $.ui.version ) {
return;
}
$.extend( $.ui, {
version: "1.10.1",
version: "1.10.4",
keyCode: {
BACKSPACE: 8,
@ -52,20 +47,21 @@ $.extend( $.ui, {
// plugins
$.fn.extend({
_focus: $.fn.focus,
focus: function( delay, fn ) {
return typeof delay === "number" ?
this.each(function() {
var elem = this;
setTimeout(function() {
$( elem ).focus();
if ( fn ) {
fn.call( elem );
}
}, delay );
}) :
this._focus.apply( this, arguments );
},
focus: (function( orig ) {
return function( delay, fn ) {
return typeof delay === "number" ?
this.each(function() {
var elem = this;
setTimeout(function() {
$( elem ).focus();
if ( fn ) {
fn.call( elem );
}
}, delay );
}) :
orig.apply( this, arguments );
};
})( $.fn.focus ),
scrollParent: function() {
var scrollParent;
@ -271,7 +267,7 @@ $.fn.extend({
});
$.extend( $.ui, {
// $.ui.plugin is deprecated. Use the proxy pattern instead.
// $.ui.plugin is deprecated. Use $.widget() extensions instead.
plugin: {
add: function( module, option, set ) {
var i,

View file

@ -1,8 +1,8 @@
/*!
* jQuery UI Mouse 1.10.1
* jQuery UI Mouse 1.10.4
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
@ -19,7 +19,7 @@ $( document ).mouseup( function() {
});
$.widget("ui.mouse", {
version: "1.10.1",
version: "1.10.4",
options: {
cancel: "input,textarea,button,select,option",
distance: 1,

View file

@ -1,8 +1,8 @@
/*!
* jQuery UI Sortable 1.10.1
* jQuery UI Sortable 1.10.4
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
@ -15,14 +15,16 @@
*/
(function( $, undefined ) {
/*jshint loopfunc: true */
function isOverAxis( x, reference, size ) {
return ( x > reference ) && ( x < ( reference + size ) );
}
function isFloating(item) {
return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
}
$.widget("ui.sortable", $.ui.mouse, {
version: "1.10.1",
version: "1.10.4",
widgetEventPrefix: "sort",
ready: false,
options: {
@ -73,7 +75,7 @@ $.widget("ui.sortable", $.ui.mouse, {
this.refresh();
//Let's determine if the items are being displayed horizontally
this.floating = this.items.length ? o.axis === "x" || (/left|right/).test(this.items[0].item.css("float")) || (/inline|table-cell/).test(this.items[0].item.css("display")) : false;
this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false;
//Let's determine the parent's offset
this.offset = this.element.offset();
@ -158,7 +160,7 @@ $.widget("ui.sortable", $.ui.mouse, {
_mouseStart: function(event, overrideHandle, noActivation) {
var i,
var i, body,
o = this.options;
this.currentContainer = this;
@ -228,11 +230,14 @@ $.widget("ui.sortable", $.ui.mouse, {
this._setContainment();
}
if(o.cursor) { // cursor option
if ($("body").css("cursor")) {
this._storedCursor = $("body").css("cursor");
}
$("body").css("cursor", o.cursor);
if( o.cursor && o.cursor !== "auto" ) { // cursor option
body = this.document.find( "body" );
// support: IE
this.storedCursor = body.css( "cursor" );
body.css( "cursor", o.cursor );
this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
}
if(o.opacity) { // opacity option
@ -360,12 +365,12 @@ $.widget("ui.sortable", $.ui.mouse, {
}
// Only put the placeholder inside the current Container, skip all
// items form other containers. This works because when moving
// items from other containers. This works because when moving
// an item from one container to another the
// currentContainer is switched before the placeholder is moved.
//
// Without this moving items in "sub-sortables" can cause the placeholder to jitter
// beetween the outer and inner container.
// Without this, moving items in "sub-sortables" can cause
// the placeholder to jitter beetween the outer and inner container.
if (item.instance !== this.currentContainer) {
continue;
}
@ -421,14 +426,18 @@ $.widget("ui.sortable", $.ui.mouse, {
if(this.options.revert) {
var that = this,
cur = this.placeholder.offset();
cur = this.placeholder.offset(),
axis = this.options.axis,
animation = {};
if ( !axis || axis === "x" ) {
animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
}
if ( !axis || axis === "y" ) {
animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
}
this.reverting = true;
$(this.helper).animate({
left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft),
top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop)
}, parseInt(this.options.revert, 10) || 500, function() {
$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
that._clear(event);
});
} else {
@ -535,7 +544,9 @@ $.widget("ui.sortable", $.ui.mouse, {
b = t + item.height,
dyClick = this.offset.click.top,
dxClick = this.offset.click.left,
isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
isOverElement = isOverElementHeight && isOverElementWidth;
if ( this.options.tolerance === "pointer" ||
this.options.forcePointerForContainers ||
@ -627,10 +638,11 @@ $.widget("ui.sortable", $.ui.mouse, {
queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
function addItems() {
items.push( this );
}
for (i = queries.length - 1; i >= 0; i--){
queries[i][0].each(function() {
items.push(this);
});
queries[i][0].each( addItems );
}
return $(items);
@ -749,15 +761,26 @@ $.widget("ui.sortable", $.ui.mouse, {
o.placeholder = {
element: function() {
var el = $(document.createElement(that.currentItem[0].nodeName))
.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
.removeClass("ui-sortable-helper")[0];
var nodeName = that.currentItem[0].nodeName.toLowerCase(),
element = $( "<" + nodeName + ">", that.document[0] )
.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
.removeClass("ui-sortable-helper");
if(!className) {
el.style.visibility = "hidden";
if ( nodeName === "tr" ) {
that.currentItem.children().each(function() {
$( "<td>&#160;</td>", that.document[0] )
.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
.appendTo( element );
});
} else if ( nodeName === "img" ) {
element.attr( "src", that.currentItem.attr( "src" ) );
}
return el;
if ( !className ) {
element.css( "visibility", "hidden" );
}
return element;
},
update: function(container, p) {
@ -786,7 +809,7 @@ $.widget("ui.sortable", $.ui.mouse, {
},
_contactContainers: function(event) {
var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom,
var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,
innermostContainer = null,
innermostIndex = null;
@ -825,15 +848,18 @@ $.widget("ui.sortable", $.ui.mouse, {
// move the item into the container if it's not there already
if(this.containers.length === 1) {
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
this.containers[innermostIndex].containerCache.over = 1;
if (!this.containers[innermostIndex].containerCache.over) {
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
this.containers[innermostIndex].containerCache.over = 1;
}
} else {
//When entering a new container, we will find the item with the least distance and append our item near it
dist = 10000;
itemWithLeastDistance = null;
posProperty = this.containers[innermostIndex].floating ? "left" : "top";
sizeProperty = this.containers[innermostIndex].floating ? "width" : "height";
floating = innermostContainer.floating || isFloating(this.currentItem);
posProperty = floating ? "left" : "top";
sizeProperty = floating ? "width" : "height";
base = this.positionAbs[posProperty] + this.offset.click[posProperty];
for (j = this.items.length - 1; j >= 0; j--) {
if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
@ -842,6 +868,9 @@ $.widget("ui.sortable", $.ui.mouse, {
if(this.items[j].item[0] === this.currentItem[0]) {
continue;
}
if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) {
continue;
}
cur = this.items[j].item.offset()[posProperty];
nearBottom = false;
if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){
@ -860,10 +889,14 @@ $.widget("ui.sortable", $.ui.mouse, {
return;
}
this.currentContainer = this.containers[innermostIndex];
if(this.currentContainer === this.containers[innermostIndex]) {
return;
}
itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
this._trigger("change", event, this._uiHash());
this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
this.currentContainer = this.containers[innermostIndex];
//Update the placeholder
this.options.placeholder.update(this.currentContainer, this.placeholder);
@ -1167,19 +1200,25 @@ $.widget("ui.sortable", $.ui.mouse, {
//Post events to containers
function delayEvent( type, instance, container ) {
return function( event ) {
container._trigger( type, event, instance._uiHash( instance ) );
};
}
for (i = this.containers.length - 1; i >= 0; i--){
if(!noPropagation) {
delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
if (!noPropagation) {
delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
}
if(this.containers[i].containerCache.over) {
delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
this.containers[i].containerCache.over = 0;
}
}
//Do what was originally in plugins
if(this._storedCursor) {
$("body").css("cursor", this._storedCursor);
if ( this.storedCursor ) {
this.document.find( "body" ).css( "cursor", this.storedCursor );
this.storedStylesheet.remove();
}
if(this._storedOpacity) {
this.helper.css("opacity", this._storedOpacity);

View file

@ -1,8 +1,8 @@
/*!
* jQuery UI Widget 1.10.1
* jQuery UI Widget 1.10.4
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
@ -106,7 +106,7 @@ $.widget = function( name, base, prototype ) {
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,
@ -315,12 +315,12 @@ $.Widget.prototype = {
curOption = curOption[ parts[ i ] ];
}
key = parts.pop();
if ( value === undefined ) {
if ( arguments.length === 1 ) {
return curOption[ key ] === undefined ? null : curOption[ key ];
}
curOption[ key ] = value;
} else {
if ( value === undefined ) {
if ( arguments.length === 1 ) {
return this.options[ key ] === undefined ? null : this.options[ key ];
}
options[ key ] = value;