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

View file

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

View file

@ -1,8 +1,8 @@
/*! /*!
* jQuery UI Sortable 1.10.1 * jQuery UI Sortable 1.10.4
* http://jqueryui.com * http://jqueryui.com
* *
* Copyright 2013 jQuery Foundation and other contributors * Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license. * Released under the MIT license.
* http://jquery.org/license * http://jquery.org/license
* *
@ -15,14 +15,16 @@
*/ */
(function( $, undefined ) { (function( $, undefined ) {
/*jshint loopfunc: true */
function isOverAxis( x, reference, size ) { function isOverAxis( x, reference, size ) {
return ( x > reference ) && ( 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, { $.widget("ui.sortable", $.ui.mouse, {
version: "1.10.1", version: "1.10.4",
widgetEventPrefix: "sort", widgetEventPrefix: "sort",
ready: false, ready: false,
options: { options: {
@ -73,7 +75,7 @@ $.widget("ui.sortable", $.ui.mouse, {
this.refresh(); this.refresh();
//Let's determine if the items are being displayed horizontally //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 //Let's determine the parent's offset
this.offset = this.element.offset(); this.offset = this.element.offset();
@ -158,7 +160,7 @@ $.widget("ui.sortable", $.ui.mouse, {
_mouseStart: function(event, overrideHandle, noActivation) { _mouseStart: function(event, overrideHandle, noActivation) {
var i, var i, body,
o = this.options; o = this.options;
this.currentContainer = this; this.currentContainer = this;
@ -228,11 +230,14 @@ $.widget("ui.sortable", $.ui.mouse, {
this._setContainment(); this._setContainment();
} }
if(o.cursor) { // cursor option if( o.cursor && o.cursor !== "auto" ) { // cursor option
if ($("body").css("cursor")) { body = this.document.find( "body" );
this._storedCursor = $("body").css("cursor");
} // support: IE
$("body").css("cursor", o.cursor); 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 if(o.opacity) { // opacity option
@ -360,12 +365,12 @@ $.widget("ui.sortable", $.ui.mouse, {
} }
// Only put the placeholder inside the current Container, skip all // 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 // an item from one container to another the
// currentContainer is switched before the placeholder is moved. // currentContainer is switched before the placeholder is moved.
// //
// Without this moving items in "sub-sortables" can cause the placeholder to jitter // Without this, moving items in "sub-sortables" can cause
// beetween the outer and inner container. // the placeholder to jitter beetween the outer and inner container.
if (item.instance !== this.currentContainer) { if (item.instance !== this.currentContainer) {
continue; continue;
} }
@ -421,14 +426,18 @@ $.widget("ui.sortable", $.ui.mouse, {
if(this.options.revert) { if(this.options.revert) {
var that = this, 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.reverting = true;
$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
$(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() {
that._clear(event); that._clear(event);
}); });
} else { } else {
@ -535,7 +544,9 @@ $.widget("ui.sortable", $.ui.mouse, {
b = t + item.height, b = t + item.height,
dyClick = this.offset.click.top, dyClick = this.offset.click.top,
dxClick = this.offset.click.left, 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" || if ( this.options.tolerance === "pointer" ||
this.options.forcePointerForContainers || 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]); 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--){ for (i = queries.length - 1; i >= 0; i--){
queries[i][0].each(function() { queries[i][0].each( addItems );
items.push(this);
});
} }
return $(items); return $(items);
@ -749,15 +761,26 @@ $.widget("ui.sortable", $.ui.mouse, {
o.placeholder = { o.placeholder = {
element: function() { element: function() {
var el = $(document.createElement(that.currentItem[0].nodeName)) var nodeName = that.currentItem[0].nodeName.toLowerCase(),
element = $( "<" + nodeName + ">", that.document[0] )
.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
.removeClass("ui-sortable-helper")[0]; .removeClass("ui-sortable-helper");
if(!className) { if ( nodeName === "tr" ) {
el.style.visibility = "hidden"; 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) { update: function(container, p) {
@ -786,7 +809,7 @@ $.widget("ui.sortable", $.ui.mouse, {
}, },
_contactContainers: function(event) { _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, innermostContainer = null,
innermostIndex = null; innermostIndex = null;
@ -825,15 +848,18 @@ $.widget("ui.sortable", $.ui.mouse, {
// move the item into the container if it's not there already // move the item into the container if it's not there already
if(this.containers.length === 1) { if(this.containers.length === 1) {
if (!this.containers[innermostIndex].containerCache.over) {
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
this.containers[innermostIndex].containerCache.over = 1; this.containers[innermostIndex].containerCache.over = 1;
}
} else { } else {
//When entering a new container, we will find the item with the least distance and append our item near it //When entering a new container, we will find the item with the least distance and append our item near it
dist = 10000; dist = 10000;
itemWithLeastDistance = null; itemWithLeastDistance = null;
posProperty = this.containers[innermostIndex].floating ? "left" : "top"; floating = innermostContainer.floating || isFloating(this.currentItem);
sizeProperty = this.containers[innermostIndex].floating ? "width" : "height"; posProperty = floating ? "left" : "top";
sizeProperty = floating ? "width" : "height";
base = this.positionAbs[posProperty] + this.offset.click[posProperty]; base = this.positionAbs[posProperty] + this.offset.click[posProperty];
for (j = this.items.length - 1; j >= 0; j--) { for (j = this.items.length - 1; j >= 0; j--) {
if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) { 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]) { if(this.items[j].item[0] === this.currentItem[0]) {
continue; 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]; cur = this.items[j].item.offset()[posProperty];
nearBottom = false; nearBottom = false;
if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){
@ -860,10 +889,14 @@ $.widget("ui.sortable", $.ui.mouse, {
return; 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); itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
this._trigger("change", event, this._uiHash()); this._trigger("change", event, this._uiHash());
this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
this.currentContainer = this.containers[innermostIndex];
//Update the placeholder //Update the placeholder
this.options.placeholder.update(this.currentContainer, this.placeholder); this.options.placeholder.update(this.currentContainer, this.placeholder);
@ -1167,19 +1200,25 @@ $.widget("ui.sortable", $.ui.mouse, {
//Post events to containers //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--){ for (i = this.containers.length - 1; i >= 0; i--){
if(!noPropagation) { if (!noPropagation) {
delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
} }
if(this.containers[i].containerCache.over) { 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; this.containers[i].containerCache.over = 0;
} }
} }
//Do what was originally in plugins //Do what was originally in plugins
if(this._storedCursor) { if ( this.storedCursor ) {
$("body").css("cursor", this._storedCursor); this.document.find( "body" ).css( "cursor", this.storedCursor );
this.storedStylesheet.remove();
} }
if(this._storedOpacity) { if(this._storedOpacity) {
this.helper.css("opacity", 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 * http://jqueryui.com
* *
* Copyright 2013 jQuery Foundation and other contributors * Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license. * Released under the MIT license.
* http://jquery.org/license * http://jquery.org/license
* *
@ -106,7 +106,7 @@ $.widget = function( name, base, prototype ) {
// TODO: remove support for widgetEventPrefix // TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start // always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based // don't prefix for widgets that aren't DOM-based
widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
}, proxiedPrototype, { }, proxiedPrototype, {
constructor: constructor, constructor: constructor,
namespace: namespace, namespace: namespace,
@ -315,12 +315,12 @@ $.Widget.prototype = {
curOption = curOption[ parts[ i ] ]; curOption = curOption[ parts[ i ] ];
} }
key = parts.pop(); key = parts.pop();
if ( value === undefined ) { if ( arguments.length === 1 ) {
return curOption[ key ] === undefined ? null : curOption[ key ]; return curOption[ key ] === undefined ? null : curOption[ key ];
} }
curOption[ key ] = value; curOption[ key ] = value;
} else { } else {
if ( value === undefined ) { if ( arguments.length === 1 ) {
return this.options[ key ] === undefined ? null : this.options[ key ]; return this.options[ key ] === undefined ? null : this.options[ key ];
} }
options[ key ] = value; options[ key ] = value;