Update Mootools
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
// MooTools: the javascript framework.
|
||||
// Load this file's selection again by visiting: http://mootools.net/more/0f75cfbac1aabbedaba7630beef8d10c
|
||||
// Or build this file again with packager using: packager build More/Events.Pseudos More/Date More/Date.Extras More/Element.Forms More/Element.Position More/Element.Shortcuts More/Fx.Scroll More/Fx.Slide More/Sortables More/Request.JSONP More/Request.Periodical
|
||||
/*
|
||||
---
|
||||
MooTools: the javascript framework
|
||||
|
||||
web build:
|
||||
- http://mootools.net/more/0f75cfbac1aabbedaba7630beef8d10c
|
||||
|
||||
packager build:
|
||||
- packager build More/Events.Pseudos More/Date More/Date.Extras More/Element.Forms More/Element.Position More/Element.Shortcuts More/Fx.Scroll More/Fx.Slide More/Sortables More/Request.JSONP More/Request.Periodical
|
||||
|
||||
...
|
||||
*/
|
||||
|
||||
/*
|
||||
---
|
||||
|
||||
@@ -31,8 +41,8 @@ provides: [MooTools.More]
|
||||
*/
|
||||
|
||||
MooTools.More = {
|
||||
'version': '1.4.0.1',
|
||||
'build': 'a4244edf2aa97ac8a196fc96082dd35af1abab87'
|
||||
version: '1.5.0',
|
||||
build: '73db5e24e6e9c5c87b3a27aebef2248053f7db37'
|
||||
};
|
||||
|
||||
|
||||
@@ -48,7 +58,7 @@ license: MIT-style license
|
||||
authors:
|
||||
- Arian Stolwijk
|
||||
|
||||
requires: [Core/Class.Extras, Core/Slick.Parser, More/MooTools.More]
|
||||
requires: [Core/Class.Extras, Core/Slick.Parser, MooTools.More]
|
||||
|
||||
provides: [Events.Pseudos]
|
||||
|
||||
@@ -211,7 +221,7 @@ authors:
|
||||
|
||||
requires:
|
||||
- Core/Object
|
||||
- /MooTools.More
|
||||
- MooTools.More
|
||||
|
||||
provides: [Object.Extras]
|
||||
|
||||
@@ -280,8 +290,8 @@ authors:
|
||||
|
||||
requires:
|
||||
- Core/Events
|
||||
- /Object.Extras
|
||||
- /MooTools.More
|
||||
- Object.Extras
|
||||
- MooTools.More
|
||||
|
||||
provides: [Locale, Lang]
|
||||
|
||||
@@ -444,7 +454,7 @@ authors:
|
||||
- Aaron Newton
|
||||
|
||||
requires:
|
||||
- /Locale
|
||||
- Locale
|
||||
|
||||
provides: [Locale.en-US.Date]
|
||||
|
||||
@@ -1079,7 +1089,7 @@ authors:
|
||||
- Scott Kyle
|
||||
|
||||
requires:
|
||||
- /Date
|
||||
- Date
|
||||
|
||||
provides: [Date.Extras]
|
||||
|
||||
@@ -1235,10 +1245,8 @@ var special = {
|
||||
'S': /[ŠŞŚ]/g,
|
||||
't': /[ťţ]/g,
|
||||
'T': /[ŤŢ]/g,
|
||||
'ue': /[ü]/g,
|
||||
'UE': /[Ü]/g,
|
||||
'u': /[ùúûůµ]/g,
|
||||
'U': /[ÙÚÛŮ]/g,
|
||||
'u': /[ùúûůüµ]/g,
|
||||
'U': /[ÙÚÛŮÜ]/g,
|
||||
'y': /[ÿý]/g,
|
||||
'Y': /[ŸÝ]/g,
|
||||
'z': /[žźż]/g,
|
||||
@@ -1263,7 +1271,16 @@ tidy = {
|
||||
'-': /[\u2013]/g,
|
||||
// '--': /[\u2014]/g,
|
||||
'»': /[\uFFFD]/g
|
||||
};
|
||||
},
|
||||
|
||||
conversions = {
|
||||
ms: 1,
|
||||
s: 1000,
|
||||
m: 6e4,
|
||||
h: 36e5
|
||||
},
|
||||
|
||||
findUnits = /(\d*.?\d+)([msh]+)/;
|
||||
|
||||
var walk = function(string, replacements){
|
||||
var result = string, key;
|
||||
@@ -1325,6 +1342,13 @@ String.implement({
|
||||
if (trail) string += trail;
|
||||
}
|
||||
return string;
|
||||
},
|
||||
|
||||
ms: function(){
|
||||
// "Borrowed" from https://gist.github.com/1503944
|
||||
var units = findUnits.exec(this);
|
||||
if (units == null) return Number(this);
|
||||
return Number(units[1]) * conversions[units[2]];
|
||||
}
|
||||
|
||||
});
|
||||
@@ -1348,8 +1372,8 @@ authors:
|
||||
|
||||
requires:
|
||||
- Core/Element
|
||||
- /String.Extras
|
||||
- /MooTools.More
|
||||
- String.Extras
|
||||
- MooTools.More
|
||||
|
||||
provides: [Element.Forms]
|
||||
|
||||
@@ -1493,7 +1517,7 @@ authors:
|
||||
requires:
|
||||
- Core/Element.Style
|
||||
- Core/Element.Dimensions
|
||||
- /MooTools.More
|
||||
- MooTools.More
|
||||
|
||||
provides: [Element.Measure]
|
||||
|
||||
@@ -1710,13 +1734,15 @@ var local = Element.Position = {
|
||||
},
|
||||
|
||||
setOffsetOption: function(element, options){
|
||||
var parentOffset = {x: 0, y: 0},
|
||||
offsetParent = element.measure(function(){
|
||||
return document.id(this.getOffsetParent());
|
||||
}),
|
||||
parentScroll = offsetParent.getScroll();
|
||||
var parentOffset = {x: 0, y: 0};
|
||||
var parentScroll = {x: 0, y: 0};
|
||||
var offsetParent = element.measure(function(){
|
||||
return document.id(this.getOffsetParent());
|
||||
});
|
||||
|
||||
if (!offsetParent || offsetParent == element.getDocument().body) return;
|
||||
|
||||
parentScroll = offsetParent.getScroll();
|
||||
parentOffset = offsetParent.measure(function(){
|
||||
var position = this.getPosition();
|
||||
if (this.getStyle('position') == 'fixed'){
|
||||
@@ -1896,7 +1922,7 @@ authors:
|
||||
|
||||
requires:
|
||||
- Core/Element.Style
|
||||
- /MooTools.More
|
||||
- MooTools.More
|
||||
|
||||
provides: [Element.Shortcuts]
|
||||
|
||||
@@ -1976,7 +2002,7 @@ requires:
|
||||
- Core/Fx
|
||||
- Core/Element.Event
|
||||
- Core/Element.Dimensions
|
||||
- /MooTools.More
|
||||
- MooTools.More
|
||||
|
||||
provides: [Fx.Scroll]
|
||||
|
||||
@@ -2014,7 +2040,6 @@ Fx.Scroll = new Class({
|
||||
|
||||
set: function(){
|
||||
var now = Array.flatten(arguments);
|
||||
if (Browser.firefox) now = [Math.round(now[0]), Math.round(now[1])]; // not needed anymore in newer firefox versions
|
||||
this.element.scrollTo(now[0], now[1]);
|
||||
return this;
|
||||
},
|
||||
@@ -2148,7 +2173,7 @@ authors:
|
||||
requires:
|
||||
- Core/Fx
|
||||
- Core/Element.Style
|
||||
- /MooTools.More
|
||||
- MooTools.More
|
||||
|
||||
provides: [Fx.Slide]
|
||||
|
||||
@@ -2325,7 +2350,7 @@ requires:
|
||||
- Core/Element.Event
|
||||
- Core/Element.Style
|
||||
- Core/Element.Dimensions
|
||||
- /MooTools.More
|
||||
- MooTools.More
|
||||
|
||||
provides: [Drag]
|
||||
...
|
||||
@@ -2371,10 +2396,10 @@ var Drag = new Class({
|
||||
this.mouse = {'now': {}, 'pos': {}};
|
||||
this.value = {'start': {}, 'now': {}};
|
||||
|
||||
this.selection = (Browser.ie) ? 'selectstart' : 'mousedown';
|
||||
this.selection = 'selectstart' in document ? 'selectstart' : 'mousedown';
|
||||
|
||||
|
||||
if (Browser.ie && !Drag.ondragstartFixed){
|
||||
if ('ondragstart' in document && !('FileReader' in window) && !Drag.ondragstartFixed){
|
||||
document.ondragstart = Function.from(false);
|
||||
Drag.ondragstartFixed = true;
|
||||
}
|
||||
@@ -2559,7 +2584,7 @@ authors:
|
||||
|
||||
requires:
|
||||
- Core/Element.Dimensions
|
||||
- /Drag
|
||||
- Drag
|
||||
|
||||
provides: [Drag.Move]
|
||||
|
||||
@@ -2586,10 +2611,7 @@ Drag.Move = new Class({
|
||||
element = this.element;
|
||||
|
||||
this.droppables = $$(this.options.droppables);
|
||||
this.container = document.id(this.options.container);
|
||||
|
||||
if (this.container && typeOf(this.container) != 'element')
|
||||
this.container = document.id(this.container.getDocument().body);
|
||||
this.setContainer(this.options.container);
|
||||
|
||||
if (this.options.style){
|
||||
if (this.options.modifiers.x == 'left' && this.options.modifiers.y == 'top'){
|
||||
@@ -2606,6 +2628,13 @@ Drag.Move = new Class({
|
||||
this.addEvent('start', this.checkDroppables, true);
|
||||
this.overed = null;
|
||||
},
|
||||
|
||||
setContainer: function(container) {
|
||||
this.container = document.id(container);
|
||||
if (this.container && typeOf(this.container) != 'element'){
|
||||
this.container = document.id(this.container.getDocument().body);
|
||||
}
|
||||
},
|
||||
|
||||
start: function(event){
|
||||
if (this.container) this.options.limit = this.calculateLimit();
|
||||
@@ -2670,7 +2699,9 @@ Drag.Move = new Class({
|
||||
|
||||
if (container != offsetParent){
|
||||
left += containerMargin.left + offsetParentPadding.left;
|
||||
top += ((Browser.ie6 || Browser.ie7) ? 0 : containerMargin.top) + offsetParentPadding.top;
|
||||
if (!offsetParentPadding.left && left < 0) left = 0;
|
||||
top += offsetParent == document.body ? 0 : containerMargin.top + offsetParentPadding.top;
|
||||
if (!offsetParentPadding.top && top < 0) top = 0;
|
||||
}
|
||||
} else {
|
||||
left -= elementMargin.left;
|
||||
@@ -2754,7 +2785,7 @@ authors:
|
||||
|
||||
requires:
|
||||
- Core/Fx.Morph
|
||||
- /Drag.Move
|
||||
- Drag.Move
|
||||
|
||||
provides: [Sortables]
|
||||
|
||||
@@ -2773,7 +2804,8 @@ var Sortables = new Class({
|
||||
clone: false,
|
||||
revert: false,
|
||||
handle: false,
|
||||
dragOptions: {}
|
||||
dragOptions: {},
|
||||
unDraggableTags: ['button', 'input', 'a', 'textarea', 'select', 'option']
|
||||
},
|
||||
|
||||
initialize: function(lists, options){
|
||||
@@ -2839,6 +2871,24 @@ var Sortables = new Class({
|
||||
return list;
|
||||
}, this));
|
||||
},
|
||||
|
||||
getDroppableCoordinates: function (element){
|
||||
var offsetParent = element.getOffsetParent();
|
||||
var position = element.getPosition(offsetParent);
|
||||
var scroll = {
|
||||
w: window.getScroll(),
|
||||
offsetParent: offsetParent.getScroll()
|
||||
};
|
||||
position.x += scroll.offsetParent.x;
|
||||
position.y += scroll.offsetParent.y;
|
||||
|
||||
if (offsetParent.getStyle('position') == 'fixed'){
|
||||
position.x -= scroll.w.x;
|
||||
position.y -= scroll.w.y;
|
||||
}
|
||||
|
||||
return position;
|
||||
},
|
||||
|
||||
getClone: function(event, element){
|
||||
if (!this.options.clone) return new Element(element.tagName).inject(document.body);
|
||||
@@ -2859,7 +2909,7 @@ var Sortables = new Class({
|
||||
});
|
||||
}
|
||||
|
||||
return clone.inject(this.list).setPosition(element.getPosition(element.getOffsetParent()));
|
||||
return clone.inject(this.list).setPosition(this.getDroppableCoordinates(this.element));
|
||||
},
|
||||
|
||||
getDroppables: function(){
|
||||
@@ -2884,7 +2934,7 @@ var Sortables = new Class({
|
||||
if (
|
||||
!this.idle ||
|
||||
event.rightClick ||
|
||||
['button', 'input', 'a', 'textarea'].contains(event.target.get('tag'))
|
||||
(!this.options.handle && this.options.unDraggableTags.contains(event.target.get('tag')))
|
||||
) return;
|
||||
|
||||
this.idle = false;
|
||||
@@ -2915,14 +2965,16 @@ var Sortables = new Class({
|
||||
end: function(){
|
||||
this.drag.detach();
|
||||
this.element.setStyle('opacity', this.opacity);
|
||||
var self = this;
|
||||
if (this.effect){
|
||||
var dim = this.element.getStyles('width', 'height'),
|
||||
clone = this.clone,
|
||||
pos = clone.computePosition(this.element.getPosition(this.clone.getOffsetParent()));
|
||||
pos = clone.computePosition(this.getDroppableCoordinates(clone));
|
||||
|
||||
var destroy = function(){
|
||||
this.removeEvent('cancel', destroy);
|
||||
clone.destroy();
|
||||
self.reset();
|
||||
};
|
||||
|
||||
this.effect.element = clone;
|
||||
@@ -2935,8 +2987,9 @@ var Sortables = new Class({
|
||||
}).addEvent('cancel', destroy).chain(destroy);
|
||||
} else {
|
||||
this.clone.destroy();
|
||||
self.reset();
|
||||
}
|
||||
this.reset();
|
||||
|
||||
},
|
||||
|
||||
reset: function(){
|
||||
@@ -3125,7 +3178,7 @@ authors:
|
||||
|
||||
requires:
|
||||
- Core/Request
|
||||
- /MooTools.More
|
||||
- MooTools.More
|
||||
|
||||
provides: [Request.Periodical]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user