1924 lines
77 KiB
JavaScript
1924 lines
77 KiB
JavaScript
|
/*! jQuery UI - v1.11.4 - 2016-07-07
|
|||
|
* http://jqueryui.com
|
|||
|
* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, slider.js
|
|||
|
* Copyright jQuery Foundation and other contributors; Licensed MIT */
|
|||
|
|
|||
|
(function (t) {
|
|||
|
'function' == typeof define && define.amd ? define(['jquery'], t) : t(jQuery);
|
|||
|
})(function (t) {
|
|||
|
function e(e, s) {
|
|||
|
var n,
|
|||
|
o,
|
|||
|
a,
|
|||
|
r = e.nodeName.toLowerCase();
|
|||
|
return 'area' === r
|
|||
|
? ((n = e.parentNode),
|
|||
|
(o = n.name),
|
|||
|
e.href && o && 'map' === n.nodeName.toLowerCase() ? ((a = t("img[usemap='#" + o + "']")[0]), !!a && i(a)) : !1)
|
|||
|
: (/^(input|select|textarea|button|object)$/.test(r) ? !e.disabled : 'a' === r ? e.href || s : s) && i(e);
|
|||
|
}
|
|||
|
function i(e) {
|
|||
|
return (
|
|||
|
t.expr.filters.visible(e) &&
|
|||
|
!t(e)
|
|||
|
.parents()
|
|||
|
.addBack()
|
|||
|
.filter(function () {
|
|||
|
return 'hidden' === t.css(this, 'visibility');
|
|||
|
}).length
|
|||
|
);
|
|||
|
}
|
|||
|
(t.ui = t.ui || {}),
|
|||
|
t.extend(t.ui, {
|
|||
|
version: '1.11.4',
|
|||
|
keyCode: {
|
|||
|
BACKSPACE: 8,
|
|||
|
COMMA: 188,
|
|||
|
DELETE: 46,
|
|||
|
DOWN: 40,
|
|||
|
END: 35,
|
|||
|
ENTER: 13,
|
|||
|
ESCAPE: 27,
|
|||
|
HOME: 36,
|
|||
|
LEFT: 37,
|
|||
|
PAGE_DOWN: 34,
|
|||
|
PAGE_UP: 33,
|
|||
|
PERIOD: 190,
|
|||
|
RIGHT: 39,
|
|||
|
SPACE: 32,
|
|||
|
TAB: 9,
|
|||
|
UP: 38,
|
|||
|
},
|
|||
|
}),
|
|||
|
t.fn.extend({
|
|||
|
scrollParent: function (e) {
|
|||
|
var i = this.css('position'),
|
|||
|
s = 'absolute' === i,
|
|||
|
n = e ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
|
|||
|
o = this.parents()
|
|||
|
.filter(function () {
|
|||
|
var e = t(this);
|
|||
|
return s && 'static' === e.css('position') ? !1 : n.test(e.css('overflow') + e.css('overflow-y') + e.css('overflow-x'));
|
|||
|
})
|
|||
|
.eq(0);
|
|||
|
return 'fixed' !== i && o.length ? o : t(this[0].ownerDocument || document);
|
|||
|
},
|
|||
|
uniqueId: (function () {
|
|||
|
var t = 0;
|
|||
|
return function () {
|
|||
|
return this.each(function () {
|
|||
|
this.id || (this.id = 'ui-id-' + ++t);
|
|||
|
});
|
|||
|
};
|
|||
|
})(),
|
|||
|
removeUniqueId: function () {
|
|||
|
return this.each(function () {
|
|||
|
/^ui-id-\d+$/.test(this.id) && t(this).removeAttr('id');
|
|||
|
});
|
|||
|
},
|
|||
|
}),
|
|||
|
t.extend(t.expr[':'], {
|
|||
|
data: t.expr.createPseudo
|
|||
|
? t.expr.createPseudo(function (e) {
|
|||
|
return function (i) {
|
|||
|
return !!t.data(i, e);
|
|||
|
};
|
|||
|
})
|
|||
|
: function (e, i, s) {
|
|||
|
return !!t.data(e, s[3]);
|
|||
|
},
|
|||
|
focusable: function (i) {
|
|||
|
return e(i, !isNaN(t.attr(i, 'tabindex')));
|
|||
|
},
|
|||
|
tabbable: function (i) {
|
|||
|
var s = t.attr(i, 'tabindex'),
|
|||
|
n = isNaN(s);
|
|||
|
return (n || s >= 0) && e(i, !n);
|
|||
|
},
|
|||
|
}),
|
|||
|
t('<a>').outerWidth(1).jquery ||
|
|||
|
t.each(['Width', 'Height'], function (e, i) {
|
|||
|
function s(e, i, s, o) {
|
|||
|
return (
|
|||
|
t.each(n, function () {
|
|||
|
(i -= parseFloat(t.css(e, 'padding' + this)) || 0),
|
|||
|
s && (i -= parseFloat(t.css(e, 'border' + this + 'Width')) || 0),
|
|||
|
o && (i -= parseFloat(t.css(e, 'margin' + this)) || 0);
|
|||
|
}),
|
|||
|
i
|
|||
|
);
|
|||
|
}
|
|||
|
var n = 'Width' === i ? ['Left', 'Right'] : ['Top', 'Bottom'],
|
|||
|
o = i.toLowerCase(),
|
|||
|
a = { innerWidth: t.fn.innerWidth, innerHeight: t.fn.innerHeight, outerWidth: t.fn.outerWidth, outerHeight: t.fn.outerHeight };
|
|||
|
(t.fn['inner' + i] = function (e) {
|
|||
|
return void 0 === e
|
|||
|
? a['inner' + i].call(this)
|
|||
|
: this.each(function () {
|
|||
|
t(this).css(o, s(this, e) + 'px');
|
|||
|
});
|
|||
|
}),
|
|||
|
(t.fn['outer' + i] = function (e, n) {
|
|||
|
return 'number' != typeof e
|
|||
|
? a['outer' + i].call(this, e)
|
|||
|
: this.each(function () {
|
|||
|
t(this).css(o, s(this, e, !0, n) + 'px');
|
|||
|
});
|
|||
|
});
|
|||
|
}),
|
|||
|
t.fn.addBack ||
|
|||
|
(t.fn.addBack = function (t) {
|
|||
|
return this.add(null == t ? this.prevObject : this.prevObject.filter(t));
|
|||
|
}),
|
|||
|
t('<a>').data('a-b', 'a').removeData('a-b').data('a-b') &&
|
|||
|
(t.fn.removeData = (function (e) {
|
|||
|
return function (i) {
|
|||
|
return arguments.length ? e.call(this, t.camelCase(i)) : e.call(this);
|
|||
|
};
|
|||
|
})(t.fn.removeData)),
|
|||
|
(t.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())),
|
|||
|
t.fn.extend({
|
|||
|
focus: (function (e) {
|
|||
|
return function (i, s) {
|
|||
|
return 'number' == typeof i
|
|||
|
? this.each(function () {
|
|||
|
var e = this;
|
|||
|
setTimeout(function () {
|
|||
|
t(e).focus(), s && s.call(e);
|
|||
|
}, i);
|
|||
|
})
|
|||
|
: e.apply(this, arguments);
|
|||
|
};
|
|||
|
})(t.fn.focus),
|
|||
|
disableSelection: (function () {
|
|||
|
var t = 'onselectstart' in document.createElement('div') ? 'selectstart' : 'mousedown';
|
|||
|
return function () {
|
|||
|
return this.bind(t + '.ui-disableSelection', function (t) {
|
|||
|
t.preventDefault();
|
|||
|
});
|
|||
|
};
|
|||
|
})(),
|
|||
|
enableSelection: function () {
|
|||
|
return this.unbind('.ui-disableSelection');
|
|||
|
},
|
|||
|
zIndex: function (e) {
|
|||
|
if (void 0 !== e) return this.css('zIndex', e);
|
|||
|
if (this.length)
|
|||
|
for (var i, s, n = t(this[0]); n.length && n[0] !== document; ) {
|
|||
|
if (
|
|||
|
((i = n.css('position')),
|
|||
|
('absolute' === i || 'relative' === i || 'fixed' === i) && ((s = parseInt(n.css('zIndex'), 10)), !isNaN(s) && 0 !== s))
|
|||
|
)
|
|||
|
return s;
|
|||
|
n = n.parent();
|
|||
|
}
|
|||
|
return 0;
|
|||
|
},
|
|||
|
}),
|
|||
|
(t.ui.plugin = {
|
|||
|
add: function (e, i, s) {
|
|||
|
var n,
|
|||
|
o = t.ui[e].prototype;
|
|||
|
for (n in s) (o.plugins[n] = o.plugins[n] || []), o.plugins[n].push([i, s[n]]);
|
|||
|
},
|
|||
|
call: function (t, e, i, s) {
|
|||
|
var n,
|
|||
|
o = t.plugins[e];
|
|||
|
if (o && (s || (t.element[0].parentNode && 11 !== t.element[0].parentNode.nodeType)))
|
|||
|
for (n = 0; o.length > n; n++) t.options[o[n][0]] && o[n][1].apply(t.element, i);
|
|||
|
},
|
|||
|
});
|
|||
|
var s = 0,
|
|||
|
n = Array.prototype.slice;
|
|||
|
(t.cleanData = (function (e) {
|
|||
|
return function (i) {
|
|||
|
var s, n, o;
|
|||
|
for (o = 0; null != (n = i[o]); o++)
|
|||
|
try {
|
|||
|
(s = t._data(n, 'events')), s && s.remove && t(n).triggerHandler('remove');
|
|||
|
} catch (a) {}
|
|||
|
e(i);
|
|||
|
};
|
|||
|
})(t.cleanData)),
|
|||
|
(t.widget = function (e, i, s) {
|
|||
|
var n,
|
|||
|
o,
|
|||
|
a,
|
|||
|
r,
|
|||
|
h = {},
|
|||
|
l = e.split('.')[0];
|
|||
|
return (
|
|||
|
(e = e.split('.')[1]),
|
|||
|
(n = l + '-' + e),
|
|||
|
s || ((s = i), (i = t.Widget)),
|
|||
|
(t.expr[':'][n.toLowerCase()] = function (e) {
|
|||
|
return !!t.data(e, n);
|
|||
|
}),
|
|||
|
(t[l] = t[l] || {}),
|
|||
|
(o = t[l][e]),
|
|||
|
(a = t[l][e] =
|
|||
|
function (t, e) {
|
|||
|
return this._createWidget ? (arguments.length && this._createWidget(t, e), void 0) : new a(t, e);
|
|||
|
}),
|
|||
|
t.extend(a, o, { version: s.version, _proto: t.extend({}, s), _childConstructors: [] }),
|
|||
|
(r = new i()),
|
|||
|
(r.options = t.widget.extend({}, r.options)),
|
|||
|
t.each(s, function (e, s) {
|
|||
|
return t.isFunction(s)
|
|||
|
? ((h[e] = (function () {
|
|||
|
var t = function () {
|
|||
|
return i.prototype[e].apply(this, arguments);
|
|||
|
},
|
|||
|
n = function (t) {
|
|||
|
return i.prototype[e].apply(this, t);
|
|||
|
};
|
|||
|
return function () {
|
|||
|
var e,
|
|||
|
i = this._super,
|
|||
|
o = this._superApply;
|
|||
|
return (
|
|||
|
(this._super = t), (this._superApply = n), (e = s.apply(this, arguments)), (this._super = i), (this._superApply = o), e
|
|||
|
);
|
|||
|
};
|
|||
|
})()),
|
|||
|
void 0)
|
|||
|
: ((h[e] = s), void 0);
|
|||
|
}),
|
|||
|
(a.prototype = t.widget.extend(r, { widgetEventPrefix: o ? r.widgetEventPrefix || e : e }, h, {
|
|||
|
constructor: a,
|
|||
|
namespace: l,
|
|||
|
widgetName: e,
|
|||
|
widgetFullName: n,
|
|||
|
})),
|
|||
|
o
|
|||
|
? (t.each(o._childConstructors, function (e, i) {
|
|||
|
var s = i.prototype;
|
|||
|
t.widget(s.namespace + '.' + s.widgetName, a, i._proto);
|
|||
|
}),
|
|||
|
delete o._childConstructors)
|
|||
|
: i._childConstructors.push(a),
|
|||
|
t.widget.bridge(e, a),
|
|||
|
a
|
|||
|
);
|
|||
|
}),
|
|||
|
(t.widget.extend = function (e) {
|
|||
|
for (var i, s, o = n.call(arguments, 1), a = 0, r = o.length; r > a; a++)
|
|||
|
for (i in o[a])
|
|||
|
(s = o[a][i]),
|
|||
|
o[a].hasOwnProperty(i) &&
|
|||
|
void 0 !== s &&
|
|||
|
(e[i] = t.isPlainObject(s) ? (t.isPlainObject(e[i]) ? t.widget.extend({}, e[i], s) : t.widget.extend({}, s)) : s);
|
|||
|
return e;
|
|||
|
}),
|
|||
|
(t.widget.bridge = function (e, i) {
|
|||
|
var s = i.prototype.widgetFullName || e;
|
|||
|
t.fn[e] = function (o) {
|
|||
|
var a = 'string' == typeof o,
|
|||
|
r = n.call(arguments, 1),
|
|||
|
h = this;
|
|||
|
return (
|
|||
|
a
|
|||
|
? this.each(function () {
|
|||
|
var i,
|
|||
|
n = t.data(this, s);
|
|||
|
return 'instance' === o
|
|||
|
? ((h = n), !1)
|
|||
|
: n
|
|||
|
? t.isFunction(n[o]) && '_' !== o.charAt(0)
|
|||
|
? ((i = n[o].apply(n, r)), i !== n && void 0 !== i ? ((h = i && i.jquery ? h.pushStack(i.get()) : i), !1) : void 0)
|
|||
|
: t.error("no such method '" + o + "' for " + e + ' widget instance')
|
|||
|
: t.error('cannot call methods on ' + e + ' prior to initialization; ' + "attempted to call method '" + o + "'");
|
|||
|
})
|
|||
|
: (r.length && (o = t.widget.extend.apply(null, [o].concat(r))),
|
|||
|
this.each(function () {
|
|||
|
var e = t.data(this, s);
|
|||
|
e ? (e.option(o || {}), e._init && e._init()) : t.data(this, s, new i(o, this));
|
|||
|
})),
|
|||
|
h
|
|||
|
);
|
|||
|
};
|
|||
|
}),
|
|||
|
(t.Widget = function () {}),
|
|||
|
(t.Widget._childConstructors = []),
|
|||
|
(t.Widget.prototype = {
|
|||
|
widgetName: 'widget',
|
|||
|
widgetEventPrefix: '',
|
|||
|
defaultElement: '<div>',
|
|||
|
options: { disabled: !1, create: null },
|
|||
|
_createWidget: function (e, i) {
|
|||
|
(i = t(i || this.defaultElement || this)[0]),
|
|||
|
(this.element = t(i)),
|
|||
|
(this.uuid = s++),
|
|||
|
(this.eventNamespace = '.' + this.widgetName + this.uuid),
|
|||
|
(this.bindings = t()),
|
|||
|
(this.hoverable = t()),
|
|||
|
(this.focusable = t()),
|
|||
|
i !== this &&
|
|||
|
(t.data(i, this.widgetFullName, this),
|
|||
|
this._on(!0, this.element, {
|
|||
|
remove: function (t) {
|
|||
|
t.target === i && this.destroy();
|
|||
|
},
|
|||
|
}),
|
|||
|
(this.document = t(i.style ? i.ownerDocument : i.document || i)),
|
|||
|
(this.window = t(this.document[0].defaultView || this.document[0].parentWindow))),
|
|||
|
(this.options = t.widget.extend({}, this.options, this._getCreateOptions(), e)),
|
|||
|
this._create(),
|
|||
|
this._trigger('create', null, this._getCreateEventData()),
|
|||
|
this._init();
|
|||
|
},
|
|||
|
_getCreateOptions: t.noop,
|
|||
|
_getCreateEventData: t.noop,
|
|||
|
_create: t.noop,
|
|||
|
_init: t.noop,
|
|||
|
destroy: function () {
|
|||
|
this._destroy(),
|
|||
|
this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),
|
|||
|
this.widget()
|
|||
|
.unbind(this.eventNamespace)
|
|||
|
.removeAttr('aria-disabled')
|
|||
|
.removeClass(this.widgetFullName + '-disabled ' + 'ui-state-disabled'),
|
|||
|
this.bindings.unbind(this.eventNamespace),
|
|||
|
this.hoverable.removeClass('ui-state-hover'),
|
|||
|
this.focusable.removeClass('ui-state-focus');
|
|||
|
},
|
|||
|
_destroy: t.noop,
|
|||
|
widget: function () {
|
|||
|
return this.element;
|
|||
|
},
|
|||
|
option: function (e, i) {
|
|||
|
var s,
|
|||
|
n,
|
|||
|
o,
|
|||
|
a = e;
|
|||
|
if (0 === arguments.length) return t.widget.extend({}, this.options);
|
|||
|
if ('string' == typeof e)
|
|||
|
if (((a = {}), (s = e.split('.')), (e = s.shift()), s.length)) {
|
|||
|
for (n = a[e] = t.widget.extend({}, this.options[e]), o = 0; s.length - 1 > o; o++) (n[s[o]] = n[s[o]] || {}), (n = n[s[o]]);
|
|||
|
if (((e = s.pop()), 1 === arguments.length)) return void 0 === n[e] ? null : n[e];
|
|||
|
n[e] = i;
|
|||
|
} else {
|
|||
|
if (1 === arguments.length) return void 0 === this.options[e] ? null : this.options[e];
|
|||
|
a[e] = i;
|
|||
|
}
|
|||
|
return this._setOptions(a), this;
|
|||
|
},
|
|||
|
_setOptions: function (t) {
|
|||
|
var e;
|
|||
|
for (e in t) this._setOption(e, t[e]);
|
|||
|
return this;
|
|||
|
},
|
|||
|
_setOption: function (t, e) {
|
|||
|
return (
|
|||
|
(this.options[t] = e),
|
|||
|
'disabled' === t &&
|
|||
|
(this.widget().toggleClass(this.widgetFullName + '-disabled', !!e),
|
|||
|
e && (this.hoverable.removeClass('ui-state-hover'), this.focusable.removeClass('ui-state-focus'))),
|
|||
|
this
|
|||
|
);
|
|||
|
},
|
|||
|
enable: function () {
|
|||
|
return this._setOptions({ disabled: !1 });
|
|||
|
},
|
|||
|
disable: function () {
|
|||
|
return this._setOptions({ disabled: !0 });
|
|||
|
},
|
|||
|
_on: function (e, i, s) {
|
|||
|
var n,
|
|||
|
o = this;
|
|||
|
'boolean' != typeof e && ((s = i), (i = e), (e = !1)),
|
|||
|
s ? ((i = n = t(i)), (this.bindings = this.bindings.add(i))) : ((s = i), (i = this.element), (n = this.widget())),
|
|||
|
t.each(s, function (s, a) {
|
|||
|
function r() {
|
|||
|
return e || (o.options.disabled !== !0 && !t(this).hasClass('ui-state-disabled'))
|
|||
|
? ('string' == typeof a ? o[a] : a).apply(o, arguments)
|
|||
|
: void 0;
|
|||
|
}
|
|||
|
'string' != typeof a && (r.guid = a.guid = a.guid || r.guid || t.guid++);
|
|||
|
var h = s.match(/^([\w:-]*)\s*(.*)$/),
|
|||
|
l = h[1] + o.eventNamespace,
|
|||
|
u = h[2];
|
|||
|
u ? n.delegate(u, l, r) : i.bind(l, r);
|
|||
|
});
|
|||
|
},
|
|||
|
_off: function (e, i) {
|
|||
|
(i = (i || '').split(' ').join(this.eventNamespace + ' ') + this.eventNamespace),
|
|||
|
e.unbind(i).undelegate(i),
|
|||
|
(this.bindings = t(this.bindings.not(e).get())),
|
|||
|
(this.focusable = t(this.focusable.not(e).get())),
|
|||
|
(this.hoverable = t(this.hoverable.not(e).get()));
|
|||
|
},
|
|||
|
_delay: function (t, e) {
|
|||
|
function i() {
|
|||
|
return ('string' == typeof t ? s[t] : t).apply(s, arguments);
|
|||
|
}
|
|||
|
var s = this;
|
|||
|
return setTimeout(i, e || 0);
|
|||
|
},
|
|||
|
_hoverable: function (e) {
|
|||
|
(this.hoverable = this.hoverable.add(e)),
|
|||
|
this._on(e, {
|
|||
|
mouseenter: function (e) {
|
|||
|
t(e.currentTarget).addClass('ui-state-hover');
|
|||
|
},
|
|||
|
mouseleave: function (e) {
|
|||
|
t(e.currentTarget).removeClass('ui-state-hover');
|
|||
|
},
|
|||
|
});
|
|||
|
},
|
|||
|
_focusable: function (e) {
|
|||
|
(this.focusable = this.focusable.add(e)),
|
|||
|
this._on(e, {
|
|||
|
focusin: function (e) {
|
|||
|
t(e.currentTarget).addClass('ui-state-focus');
|
|||
|
},
|
|||
|
focusout: function (e) {
|
|||
|
t(e.currentTarget).removeClass('ui-state-focus');
|
|||
|
},
|
|||
|
});
|
|||
|
},
|
|||
|
_trigger: function (e, i, s) {
|
|||
|
var n,
|
|||
|
o,
|
|||
|
a = this.options[e];
|
|||
|
if (
|
|||
|
((s = s || {}),
|
|||
|
(i = t.Event(i)),
|
|||
|
(i.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase()),
|
|||
|
(i.target = this.element[0]),
|
|||
|
(o = i.originalEvent))
|
|||
|
)
|
|||
|
for (n in o) n in i || (i[n] = o[n]);
|
|||
|
return this.element.trigger(i, s), !((t.isFunction(a) && a.apply(this.element[0], [i].concat(s)) === !1) || i.isDefaultPrevented());
|
|||
|
},
|
|||
|
}),
|
|||
|
t.each({ show: 'fadeIn', hide: 'fadeOut' }, function (e, i) {
|
|||
|
t.Widget.prototype['_' + e] = function (s, n, o) {
|
|||
|
'string' == typeof n && (n = { effect: n });
|
|||
|
var a,
|
|||
|
r = n ? (n === !0 || 'number' == typeof n ? i : n.effect || i) : e;
|
|||
|
(n = n || {}),
|
|||
|
'number' == typeof n && (n = { duration: n }),
|
|||
|
(a = !t.isEmptyObject(n)),
|
|||
|
(n.complete = o),
|
|||
|
n.delay && s.delay(n.delay),
|
|||
|
a && t.effects && t.effects.effect[r]
|
|||
|
? s[e](n)
|
|||
|
: r !== e && s[r]
|
|||
|
? s[r](n.duration, n.easing, o)
|
|||
|
: s.queue(function (i) {
|
|||
|
t(this)[e](), o && o.call(s[0]), i();
|
|||
|
});
|
|||
|
};
|
|||
|
}),
|
|||
|
t.widget;
|
|||
|
var o = !1;
|
|||
|
t(document).mouseup(function () {
|
|||
|
o = !1;
|
|||
|
}),
|
|||
|
t.widget('ui.mouse', {
|
|||
|
version: '1.11.4',
|
|||
|
options: { cancel: 'input,textarea,button,select,option', distance: 1, delay: 0 },
|
|||
|
_mouseInit: function () {
|
|||
|
var e = this;
|
|||
|
this.element
|
|||
|
.bind('mousedown.' + this.widgetName, function (t) {
|
|||
|
return e._mouseDown(t);
|
|||
|
})
|
|||
|
.bind('click.' + this.widgetName, function (i) {
|
|||
|
return !0 === t.data(i.target, e.widgetName + '.preventClickEvent')
|
|||
|
? (t.removeData(i.target, e.widgetName + '.preventClickEvent'), i.stopImmediatePropagation(), !1)
|
|||
|
: void 0;
|
|||
|
}),
|
|||
|
(this.started = !1);
|
|||
|
},
|
|||
|
_mouseDestroy: function () {
|
|||
|
this.element.unbind('.' + this.widgetName),
|
|||
|
this._mouseMoveDelegate &&
|
|||
|
this.document
|
|||
|
.unbind('mousemove.' + this.widgetName, this._mouseMoveDelegate)
|
|||
|
.unbind('mouseup.' + this.widgetName, this._mouseUpDelegate);
|
|||
|
},
|
|||
|
_mouseDown: function (e) {
|
|||
|
if (!o) {
|
|||
|
(this._mouseMoved = !1), this._mouseStarted && this._mouseUp(e), (this._mouseDownEvent = e);
|
|||
|
var i = this,
|
|||
|
s = 1 === e.which,
|
|||
|
n = 'string' == typeof this.options.cancel && e.target.nodeName ? t(e.target).closest(this.options.cancel).length : !1;
|
|||
|
return s && !n && this._mouseCapture(e)
|
|||
|
? ((this.mouseDelayMet = !this.options.delay),
|
|||
|
this.mouseDelayMet ||
|
|||
|
(this._mouseDelayTimer = setTimeout(function () {
|
|||
|
i.mouseDelayMet = !0;
|
|||
|
}, this.options.delay)),
|
|||
|
this._mouseDistanceMet(e) &&
|
|||
|
this._mouseDelayMet(e) &&
|
|||
|
((this._mouseStarted = this._mouseStart(e) !== !1), !this._mouseStarted)
|
|||
|
? (e.preventDefault(), !0)
|
|||
|
: (!0 === t.data(e.target, this.widgetName + '.preventClickEvent') &&
|
|||
|
t.removeData(e.target, this.widgetName + '.preventClickEvent'),
|
|||
|
(this._mouseMoveDelegate = function (t) {
|
|||
|
return i._mouseMove(t);
|
|||
|
}),
|
|||
|
(this._mouseUpDelegate = function (t) {
|
|||
|
return i._mouseUp(t);
|
|||
|
}),
|
|||
|
this.document
|
|||
|
.bind('mousemove.' + this.widgetName, this._mouseMoveDelegate)
|
|||
|
.bind('mouseup.' + this.widgetName, this._mouseUpDelegate),
|
|||
|
e.preventDefault(),
|
|||
|
(o = !0),
|
|||
|
!0))
|
|||
|
: !0;
|
|||
|
}
|
|||
|
},
|
|||
|
_mouseMove: function (e) {
|
|||
|
if (this._mouseMoved) {
|
|||
|
if (t.ui.ie && (!document.documentMode || 9 > document.documentMode) && !e.button) return this._mouseUp(e);
|
|||
|
if (!e.which) return this._mouseUp(e);
|
|||
|
}
|
|||
|
return (
|
|||
|
(e.which || e.button) && (this._mouseMoved = !0),
|
|||
|
this._mouseStarted
|
|||
|
? (this._mouseDrag(e), e.preventDefault())
|
|||
|
: (this._mouseDistanceMet(e) &&
|
|||
|
this._mouseDelayMet(e) &&
|
|||
|
((this._mouseStarted = this._mouseStart(this._mouseDownEvent, e) !== !1),
|
|||
|
this._mouseStarted ? this._mouseDrag(e) : this._mouseUp(e)),
|
|||
|
!this._mouseStarted)
|
|||
|
);
|
|||
|
},
|
|||
|
_mouseUp: function (e) {
|
|||
|
return (
|
|||
|
this.document
|
|||
|
.unbind('mousemove.' + this.widgetName, this._mouseMoveDelegate)
|
|||
|
.unbind('mouseup.' + this.widgetName, this._mouseUpDelegate),
|
|||
|
this._mouseStarted &&
|
|||
|
((this._mouseStarted = !1),
|
|||
|
e.target === this._mouseDownEvent.target && t.data(e.target, this.widgetName + '.preventClickEvent', !0),
|
|||
|
this._mouseStop(e)),
|
|||
|
(o = !1),
|
|||
|
!1
|
|||
|
);
|
|||
|
},
|
|||
|
_mouseDistanceMet: function (t) {
|
|||
|
return (
|
|||
|
Math.max(Math.abs(this._mouseDownEvent.pageX - t.pageX), Math.abs(this._mouseDownEvent.pageY - t.pageY)) >= this.options.distance
|
|||
|
);
|
|||
|
},
|
|||
|
_mouseDelayMet: function () {
|
|||
|
return this.mouseDelayMet;
|
|||
|
},
|
|||
|
_mouseStart: function () {},
|
|||
|
_mouseDrag: function () {},
|
|||
|
_mouseStop: function () {},
|
|||
|
_mouseCapture: function () {
|
|||
|
return !0;
|
|||
|
},
|
|||
|
}),
|
|||
|
(function () {
|
|||
|
function e(t, e, i) {
|
|||
|
return [parseFloat(t[0]) * (p.test(t[0]) ? e / 100 : 1), parseFloat(t[1]) * (p.test(t[1]) ? i / 100 : 1)];
|
|||
|
}
|
|||
|
function i(e, i) {
|
|||
|
return parseInt(t.css(e, i), 10) || 0;
|
|||
|
}
|
|||
|
function s(e) {
|
|||
|
var i = e[0];
|
|||
|
return 9 === i.nodeType
|
|||
|
? { width: e.width(), height: e.height(), offset: { top: 0, left: 0 } }
|
|||
|
: t.isWindow(i)
|
|||
|
? { width: e.width(), height: e.height(), offset: { top: e.scrollTop(), left: e.scrollLeft() } }
|
|||
|
: i.preventDefault
|
|||
|
? { width: 0, height: 0, offset: { top: i.pageY, left: i.pageX } }
|
|||
|
: { width: e.outerWidth(), height: e.outerHeight(), offset: e.offset() };
|
|||
|
}
|
|||
|
t.ui = t.ui || {};
|
|||
|
var n,
|
|||
|
o,
|
|||
|
a = Math.max,
|
|||
|
r = Math.abs,
|
|||
|
h = Math.round,
|
|||
|
l = /left|center|right/,
|
|||
|
u = /top|center|bottom/,
|
|||
|
c = /[\+\-]\d+(\.[\d]+)?%?/,
|
|||
|
d = /^\w+/,
|
|||
|
p = /%$/,
|
|||
|
f = t.fn.position;
|
|||
|
(t.position = {
|
|||
|
scrollbarWidth: function () {
|
|||
|
if (void 0 !== n) return n;
|
|||
|
var e,
|
|||
|
i,
|
|||
|
s = t(
|
|||
|
"<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"
|
|||
|
),
|
|||
|
o = s.children()[0];
|
|||
|
return (
|
|||
|
t('body').append(s),
|
|||
|
(e = o.offsetWidth),
|
|||
|
s.css('overflow', 'scroll'),
|
|||
|
(i = o.offsetWidth),
|
|||
|
e === i && (i = s[0].clientWidth),
|
|||
|
s.remove(),
|
|||
|
(n = e - i)
|
|||
|
);
|
|||
|
},
|
|||
|
getScrollInfo: function (e) {
|
|||
|
var i = e.isWindow || e.isDocument ? '' : e.element.css('overflow-x'),
|
|||
|
s = e.isWindow || e.isDocument ? '' : e.element.css('overflow-y'),
|
|||
|
n = 'scroll' === i || ('auto' === i && e.width < e.element[0].scrollWidth),
|
|||
|
o = 'scroll' === s || ('auto' === s && e.height < e.element[0].scrollHeight);
|
|||
|
return { width: o ? t.position.scrollbarWidth() : 0, height: n ? t.position.scrollbarWidth() : 0 };
|
|||
|
},
|
|||
|
getWithinInfo: function (e) {
|
|||
|
var i = t(e || window),
|
|||
|
s = t.isWindow(i[0]),
|
|||
|
n = !!i[0] && 9 === i[0].nodeType;
|
|||
|
return {
|
|||
|
element: i,
|
|||
|
isWindow: s,
|
|||
|
isDocument: n,
|
|||
|
offset: i.offset() || { left: 0, top: 0 },
|
|||
|
scrollLeft: i.scrollLeft(),
|
|||
|
scrollTop: i.scrollTop(),
|
|||
|
width: s || n ? i.width() : i.outerWidth(),
|
|||
|
height: s || n ? i.height() : i.outerHeight(),
|
|||
|
};
|
|||
|
},
|
|||
|
}),
|
|||
|
(t.fn.position = function (n) {
|
|||
|
if (!n || !n.of) return f.apply(this, arguments);
|
|||
|
n = t.extend({}, n);
|
|||
|
var p,
|
|||
|
m,
|
|||
|
g,
|
|||
|
v,
|
|||
|
_,
|
|||
|
b,
|
|||
|
y = t(n.of),
|
|||
|
x = t.position.getWithinInfo(n.within),
|
|||
|
w = t.position.getScrollInfo(x),
|
|||
|
k = (n.collision || 'flip').split(' '),
|
|||
|
D = {};
|
|||
|
return (
|
|||
|
(b = s(y)),
|
|||
|
y[0].preventDefault && (n.at = 'left top'),
|
|||
|
(m = b.width),
|
|||
|
(g = b.height),
|
|||
|
(v = b.offset),
|
|||
|
(_ = t.extend({}, v)),
|
|||
|
t.each(['my', 'at'], function () {
|
|||
|
var t,
|
|||
|
e,
|
|||
|
i = (n[this] || '').split(' ');
|
|||
|
1 === i.length && (i = l.test(i[0]) ? i.concat(['center']) : u.test(i[0]) ? ['center'].concat(i) : ['center', 'center']),
|
|||
|
(i[0] = l.test(i[0]) ? i[0] : 'center'),
|
|||
|
(i[1] = u.test(i[1]) ? i[1] : 'center'),
|
|||
|
(t = c.exec(i[0])),
|
|||
|
(e = c.exec(i[1])),
|
|||
|
(D[this] = [t ? t[0] : 0, e ? e[0] : 0]),
|
|||
|
(n[this] = [d.exec(i[0])[0], d.exec(i[1])[0]]);
|
|||
|
}),
|
|||
|
1 === k.length && (k[1] = k[0]),
|
|||
|
'right' === n.at[0] ? (_.left += m) : 'center' === n.at[0] && (_.left += m / 2),
|
|||
|
'bottom' === n.at[1] ? (_.top += g) : 'center' === n.at[1] && (_.top += g / 2),
|
|||
|
(p = e(D.at, m, g)),
|
|||
|
(_.left += p[0]),
|
|||
|
(_.top += p[1]),
|
|||
|
this.each(function () {
|
|||
|
var s,
|
|||
|
l,
|
|||
|
u = t(this),
|
|||
|
c = u.outerWidth(),
|
|||
|
d = u.outerHeight(),
|
|||
|
f = i(this, 'marginLeft'),
|
|||
|
b = i(this, 'marginTop'),
|
|||
|
T = c + f + i(this, 'marginRight') + w.width,
|
|||
|
C = d + b + i(this, 'marginBottom') + w.height,
|
|||
|
S = t.extend({}, _),
|
|||
|
M = e(D.my, u.outerWidth(), u.outerHeight());
|
|||
|
'right' === n.my[0] ? (S.left -= c) : 'center' === n.my[0] && (S.left -= c / 2),
|
|||
|
'bottom' === n.my[1] ? (S.top -= d) : 'center' === n.my[1] && (S.top -= d / 2),
|
|||
|
(S.left += M[0]),
|
|||
|
(S.top += M[1]),
|
|||
|
o || ((S.left = h(S.left)), (S.top = h(S.top))),
|
|||
|
(s = { marginLeft: f, marginTop: b }),
|
|||
|
t.each(['left', 'top'], function (e, i) {
|
|||
|
t.ui.position[k[e]] &&
|
|||
|
t.ui.position[k[e]][i](S, {
|
|||
|
targetWidth: m,
|
|||
|
targetHeight: g,
|
|||
|
elemWidth: c,
|
|||
|
elemHeight: d,
|
|||
|
collisionPosition: s,
|
|||
|
collisionWidth: T,
|
|||
|
collisionHeight: C,
|
|||
|
offset: [p[0] + M[0], p[1] + M[1]],
|
|||
|
my: n.my,
|
|||
|
at: n.at,
|
|||
|
within: x,
|
|||
|
elem: u,
|
|||
|
});
|
|||
|
}),
|
|||
|
n.using &&
|
|||
|
(l = function (t) {
|
|||
|
var e = v.left - S.left,
|
|||
|
i = e + m - c,
|
|||
|
s = v.top - S.top,
|
|||
|
o = s + g - d,
|
|||
|
h = {
|
|||
|
target: { element: y, left: v.left, top: v.top, width: m, height: g },
|
|||
|
element: { element: u, left: S.left, top: S.top, width: c, height: d },
|
|||
|
horizontal: 0 > i ? 'left' : e > 0 ? 'right' : 'center',
|
|||
|
vertical: 0 > o ? 'top' : s > 0 ? 'bottom' : 'middle',
|
|||
|
};
|
|||
|
c > m && m > r(e + i) && (h.horizontal = 'center'),
|
|||
|
d > g && g > r(s + o) && (h.vertical = 'middle'),
|
|||
|
(h.important = a(r(e), r(i)) > a(r(s), r(o)) ? 'horizontal' : 'vertical'),
|
|||
|
n.using.call(this, t, h);
|
|||
|
}),
|
|||
|
u.offset(t.extend(S, { using: l }));
|
|||
|
})
|
|||
|
);
|
|||
|
}),
|
|||
|
(t.ui.position = {
|
|||
|
fit: {
|
|||
|
left: function (t, e) {
|
|||
|
var i,
|
|||
|
s = e.within,
|
|||
|
n = s.isWindow ? s.scrollLeft : s.offset.left,
|
|||
|
o = s.width,
|
|||
|
r = t.left - e.collisionPosition.marginLeft,
|
|||
|
h = n - r,
|
|||
|
l = r + e.collisionWidth - o - n;
|
|||
|
e.collisionWidth > o
|
|||
|
? h > 0 && 0 >= l
|
|||
|
? ((i = t.left + h + e.collisionWidth - o - n), (t.left += h - i))
|
|||
|
: (t.left = l > 0 && 0 >= h ? n : h > l ? n + o - e.collisionWidth : n)
|
|||
|
: h > 0
|
|||
|
? (t.left += h)
|
|||
|
: l > 0
|
|||
|
? (t.left -= l)
|
|||
|
: (t.left = a(t.left - r, t.left));
|
|||
|
},
|
|||
|
top: function (t, e) {
|
|||
|
var i,
|
|||
|
s = e.within,
|
|||
|
n = s.isWindow ? s.scrollTop : s.offset.top,
|
|||
|
o = e.within.height,
|
|||
|
r = t.top - e.collisionPosition.marginTop,
|
|||
|
h = n - r,
|
|||
|
l = r + e.collisionHeight - o - n;
|
|||
|
e.collisionHeight > o
|
|||
|
? h > 0 && 0 >= l
|
|||
|
? ((i = t.top + h + e.collisionHeight - o - n), (t.top += h - i))
|
|||
|
: (t.top = l > 0 && 0 >= h ? n : h > l ? n + o - e.collisionHeight : n)
|
|||
|
: h > 0
|
|||
|
? (t.top += h)
|
|||
|
: l > 0
|
|||
|
? (t.top -= l)
|
|||
|
: (t.top = a(t.top - r, t.top));
|
|||
|
},
|
|||
|
},
|
|||
|
flip: {
|
|||
|
left: function (t, e) {
|
|||
|
var i,
|
|||
|
s,
|
|||
|
n = e.within,
|
|||
|
o = n.offset.left + n.scrollLeft,
|
|||
|
a = n.width,
|
|||
|
h = n.isWindow ? n.scrollLeft : n.offset.left,
|
|||
|
l = t.left - e.collisionPosition.marginLeft,
|
|||
|
u = l - h,
|
|||
|
c = l + e.collisionWidth - a - h,
|
|||
|
d = 'left' === e.my[0] ? -e.elemWidth : 'right' === e.my[0] ? e.elemWidth : 0,
|
|||
|
p = 'left' === e.at[0] ? e.targetWidth : 'right' === e.at[0] ? -e.targetWidth : 0,
|
|||
|
f = -2 * e.offset[0];
|
|||
|
0 > u
|
|||
|
? ((i = t.left + d + p + f + e.collisionWidth - a - o), (0 > i || r(u) > i) && (t.left += d + p + f))
|
|||
|
: c > 0 && ((s = t.left - e.collisionPosition.marginLeft + d + p + f - h), (s > 0 || c > r(s)) && (t.left += d + p + f));
|
|||
|
},
|
|||
|
top: function (t, e) {
|
|||
|
var i,
|
|||
|
s,
|
|||
|
n = e.within,
|
|||
|
o = n.offset.top + n.scrollTop,
|
|||
|
a = n.height,
|
|||
|
h = n.isWindow ? n.scrollTop : n.offset.top,
|
|||
|
l = t.top - e.collisionPosition.marginTop,
|
|||
|
u = l - h,
|
|||
|
c = l + e.collisionHeight - a - h,
|
|||
|
d = 'top' === e.my[1],
|
|||
|
p = d ? -e.elemHeight : 'bottom' === e.my[1] ? e.elemHeight : 0,
|
|||
|
f = 'top' === e.at[1] ? e.targetHeight : 'bottom' === e.at[1] ? -e.targetHeight : 0,
|
|||
|
m = -2 * e.offset[1];
|
|||
|
0 > u
|
|||
|
? ((s = t.top + p + f + m + e.collisionHeight - a - o), (0 > s || r(u) > s) && (t.top += p + f + m))
|
|||
|
: c > 0 && ((i = t.top - e.collisionPosition.marginTop + p + f + m - h), (i > 0 || c > r(i)) && (t.top += p + f + m));
|
|||
|
},
|
|||
|
},
|
|||
|
flipfit: {
|
|||
|
left: function () {
|
|||
|
t.ui.position.flip.left.apply(this, arguments), t.ui.position.fit.left.apply(this, arguments);
|
|||
|
},
|
|||
|
top: function () {
|
|||
|
t.ui.position.flip.top.apply(this, arguments), t.ui.position.fit.top.apply(this, arguments);
|
|||
|
},
|
|||
|
},
|
|||
|
}),
|
|||
|
(function () {
|
|||
|
var e,
|
|||
|
i,
|
|||
|
s,
|
|||
|
n,
|
|||
|
a,
|
|||
|
r = document.getElementsByTagName('body')[0],
|
|||
|
h = document.createElement('div');
|
|||
|
(e = document.createElement(r ? 'div' : 'body')),
|
|||
|
(s = { visibility: 'hidden', width: 0, height: 0, border: 0, margin: 0, background: 'none' }),
|
|||
|
r && t.extend(s, { position: 'absolute', left: '-1000px', top: '-1000px' });
|
|||
|
for (a in s) e.style[a] = s[a];
|
|||
|
e.appendChild(h),
|
|||
|
(i = r || document.documentElement),
|
|||
|
i.insertBefore(e, i.firstChild),
|
|||
|
(h.style.cssText = 'position: absolute; left: 10.7432222px;'),
|
|||
|
(n = t(h).offset().left),
|
|||
|
(o = n > 10 && 11 > n),
|
|||
|
(e.innerHTML = ''),
|
|||
|
i.removeChild(e);
|
|||
|
})();
|
|||
|
})(),
|
|||
|
t.ui.position,
|
|||
|
t.widget('ui.draggable', t.ui.mouse, {
|
|||
|
version: '1.11.4',
|
|||
|
widgetEventPrefix: 'drag',
|
|||
|
options: {
|
|||
|
addClasses: !0,
|
|||
|
appendTo: 'parent',
|
|||
|
axis: !1,
|
|||
|
connectToSortable: !1,
|
|||
|
containment: !1,
|
|||
|
cursor: 'auto',
|
|||
|
cursorAt: !1,
|
|||
|
grid: !1,
|
|||
|
handle: !1,
|
|||
|
helper: 'original',
|
|||
|
iframeFix: !1,
|
|||
|
opacity: !1,
|
|||
|
refreshPositions: !1,
|
|||
|
revert: !1,
|
|||
|
revertDuration: 500,
|
|||
|
scope: 'default',
|
|||
|
scroll: !0,
|
|||
|
scrollSensitivity: 20,
|
|||
|
scrollSpeed: 20,
|
|||
|
snap: !1,
|
|||
|
snapMode: 'both',
|
|||
|
snapTolerance: 20,
|
|||
|
stack: !1,
|
|||
|
zIndex: !1,
|
|||
|
drag: null,
|
|||
|
start: null,
|
|||
|
stop: null,
|
|||
|
},
|
|||
|
_create: function () {
|
|||
|
'original' === this.options.helper && this._setPositionRelative(),
|
|||
|
this.options.addClasses && this.element.addClass('ui-draggable'),
|
|||
|
this.options.disabled && this.element.addClass('ui-draggable-disabled'),
|
|||
|
this._setHandleClassName(),
|
|||
|
this._mouseInit();
|
|||
|
},
|
|||
|
_setOption: function (t, e) {
|
|||
|
this._super(t, e), 'handle' === t && (this._removeHandleClassName(), this._setHandleClassName());
|
|||
|
},
|
|||
|
_destroy: function () {
|
|||
|
return (this.helper || this.element).is('.ui-draggable-dragging')
|
|||
|
? ((this.destroyOnClear = !0), void 0)
|
|||
|
: (this.element.removeClass('ui-draggable ui-draggable-dragging ui-draggable-disabled'),
|
|||
|
this._removeHandleClassName(),
|
|||
|
this._mouseDestroy(),
|
|||
|
void 0);
|
|||
|
},
|
|||
|
_mouseCapture: function (e) {
|
|||
|
var i = this.options;
|
|||
|
return (
|
|||
|
this._blurActiveElement(e),
|
|||
|
this.helper || i.disabled || t(e.target).closest('.ui-resizable-handle').length > 0
|
|||
|
? !1
|
|||
|
: ((this.handle = this._getHandle(e)), this.handle ? (this._blockFrames(i.iframeFix === !0 ? 'iframe' : i.iframeFix), !0) : !1)
|
|||
|
);
|
|||
|
},
|
|||
|
_blockFrames: function (e) {
|
|||
|
this.iframeBlocks = this.document.find(e).map(function () {
|
|||
|
var e = t(this);
|
|||
|
return t('<div>')
|
|||
|
.css('position', 'absolute')
|
|||
|
.appendTo(e.parent())
|
|||
|
.outerWidth(e.outerWidth())
|
|||
|
.outerHeight(e.outerHeight())
|
|||
|
.offset(e.offset())[0];
|
|||
|
});
|
|||
|
},
|
|||
|
_unblockFrames: function () {
|
|||
|
this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks);
|
|||
|
},
|
|||
|
_blurActiveElement: function (e) {
|
|||
|
var i = this.document[0];
|
|||
|
if (this.handleElement.is(e.target))
|
|||
|
try {
|
|||
|
i.activeElement && 'body' !== i.activeElement.nodeName.toLowerCase() && t(i.activeElement).blur();
|
|||
|
} catch (s) {}
|
|||
|
},
|
|||
|
_mouseStart: function (e) {
|
|||
|
var i = this.options;
|
|||
|
return (
|
|||
|
(this.helper = this._createHelper(e)),
|
|||
|
this.helper.addClass('ui-draggable-dragging'),
|
|||
|
this._cacheHelperProportions(),
|
|||
|
t.ui.ddmanager && (t.ui.ddmanager.current = this),
|
|||
|
this._cacheMargins(),
|
|||
|
(this.cssPosition = this.helper.css('position')),
|
|||
|
(this.scrollParent = this.helper.scrollParent(!0)),
|
|||
|
(this.offsetParent = this.helper.offsetParent()),
|
|||
|
(this.hasFixedAncestor =
|
|||
|
this.helper.parents().filter(function () {
|
|||
|
return 'fixed' === t(this).css('position');
|
|||
|
}).length > 0),
|
|||
|
(this.positionAbs = this.element.offset()),
|
|||
|
this._refreshOffsets(e),
|
|||
|
(this.originalPosition = this.position = this._generatePosition(e, !1)),
|
|||
|
(this.originalPageX = e.pageX),
|
|||
|
(this.originalPageY = e.pageY),
|
|||
|
i.cursorAt && this._adjustOffsetFromHelper(i.cursorAt),
|
|||
|
this._setContainment(),
|
|||
|
this._trigger('start', e) === !1
|
|||
|
? (this._clear(), !1)
|
|||
|
: (this._cacheHelperProportions(),
|
|||
|
t.ui.ddmanager && !i.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e),
|
|||
|
this._normalizeRightBottom(),
|
|||
|
this._mouseDrag(e, !0),
|
|||
|
t.ui.ddmanager && t.ui.ddmanager.dragStart(this, e),
|
|||
|
!0)
|
|||
|
);
|
|||
|
},
|
|||
|
_refreshOffsets: function (t) {
|
|||
|
(this.offset = {
|
|||
|
top: this.positionAbs.top - this.margins.top,
|
|||
|
left: this.positionAbs.left - this.margins.left,
|
|||
|
scroll: !1,
|
|||
|
parent: this._getParentOffset(),
|
|||
|
relative: this._getRelativeOffset(),
|
|||
|
}),
|
|||
|
(this.offset.click = { left: t.pageX - this.offset.left, top: t.pageY - this.offset.top });
|
|||
|
},
|
|||
|
_mouseDrag: function (e, i) {
|
|||
|
if (
|
|||
|
(this.hasFixedAncestor && (this.offset.parent = this._getParentOffset()),
|
|||
|
(this.position = this._generatePosition(e, !0)),
|
|||
|
(this.positionAbs = this._convertPositionTo('absolute')),
|
|||
|
!i)
|
|||
|
) {
|
|||
|
var s = this._uiHash();
|
|||
|
if (this._trigger('drag', e, s) === !1) return this._mouseUp({}), !1;
|
|||
|
this.position = s.position;
|
|||
|
}
|
|||
|
return (
|
|||
|
(this.helper[0].style.left = this.position.left + 'px'),
|
|||
|
(this.helper[0].style.top = this.position.top + 'px'),
|
|||
|
t.ui.ddmanager && t.ui.ddmanager.drag(this, e),
|
|||
|
!1
|
|||
|
);
|
|||
|
},
|
|||
|
_mouseStop: function (e) {
|
|||
|
var i = this,
|
|||
|
s = !1;
|
|||
|
return (
|
|||
|
t.ui.ddmanager && !this.options.dropBehaviour && (s = t.ui.ddmanager.drop(this, e)),
|
|||
|
this.dropped && ((s = this.dropped), (this.dropped = !1)),
|
|||
|
('invalid' === this.options.revert && !s) ||
|
|||
|
('valid' === this.options.revert && s) ||
|
|||
|
this.options.revert === !0 ||
|
|||
|
(t.isFunction(this.options.revert) && this.options.revert.call(this.element, s))
|
|||
|
? t(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () {
|
|||
|
i._trigger('stop', e) !== !1 && i._clear();
|
|||
|
})
|
|||
|
: this._trigger('stop', e) !== !1 && this._clear(),
|
|||
|
!1
|
|||
|
);
|
|||
|
},
|
|||
|
_mouseUp: function (e) {
|
|||
|
return (
|
|||
|
this._unblockFrames(),
|
|||
|
t.ui.ddmanager && t.ui.ddmanager.dragStop(this, e),
|
|||
|
this.handleElement.is(e.target) && this.element.focus(),
|
|||
|
t.ui.mouse.prototype._mouseUp.call(this, e)
|
|||
|
);
|
|||
|
},
|
|||
|
cancel: function () {
|
|||
|
return this.helper.is('.ui-draggable-dragging') ? this._mouseUp({}) : this._clear(), this;
|
|||
|
},
|
|||
|
_getHandle: function (e) {
|
|||
|
return this.options.handle ? !!t(e.target).closest(this.element.find(this.options.handle)).length : !0;
|
|||
|
},
|
|||
|
_setHandleClassName: function () {
|
|||
|
(this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element),
|
|||
|
this.handleElement.addClass('ui-draggable-handle');
|
|||
|
},
|
|||
|
_removeHandleClassName: function () {
|
|||
|
this.handleElement.removeClass('ui-draggable-handle');
|
|||
|
},
|
|||
|
_createHelper: function (e) {
|
|||
|
var i = this.options,
|
|||
|
s = t.isFunction(i.helper),
|
|||
|
n = s ? t(i.helper.apply(this.element[0], [e])) : 'clone' === i.helper ? this.element.clone().removeAttr('id') : this.element;
|
|||
|
return (
|
|||
|
n.parents('body').length || n.appendTo('parent' === i.appendTo ? this.element[0].parentNode : i.appendTo),
|
|||
|
s && n[0] === this.element[0] && this._setPositionRelative(),
|
|||
|
n[0] === this.element[0] || /(fixed|absolute)/.test(n.css('position')) || n.css('position', 'absolute'),
|
|||
|
n
|
|||
|
);
|
|||
|
},
|
|||
|
_setPositionRelative: function () {
|
|||
|
/^(?:r|a|f)/.test(this.element.css('position')) || (this.element[0].style.position = 'relative');
|
|||
|
},
|
|||
|
_adjustOffsetFromHelper: function (e) {
|
|||
|
'string' == typeof e && (e = e.split(' ')),
|
|||
|
t.isArray(e) && (e = { left: +e[0], top: +e[1] || 0 }),
|
|||
|
'left' in e && (this.offset.click.left = e.left + this.margins.left),
|
|||
|
'right' in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left),
|
|||
|
'top' in e && (this.offset.click.top = e.top + this.margins.top),
|
|||
|
'bottom' in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top);
|
|||
|
},
|
|||
|
_isRootNode: function (t) {
|
|||
|
return /(html|body)/i.test(t.tagName) || t === this.document[0];
|
|||
|
},
|
|||
|
_getParentOffset: function () {
|
|||
|
var e = this.offsetParent.offset(),
|
|||
|
i = this.document[0];
|
|||
|
return (
|
|||
|
'absolute' === this.cssPosition &&
|
|||
|
this.scrollParent[0] !== i &&
|
|||
|
t.contains(this.scrollParent[0], this.offsetParent[0]) &&
|
|||
|
((e.left += this.scrollParent.scrollLeft()), (e.top += this.scrollParent.scrollTop())),
|
|||
|
this._isRootNode(this.offsetParent[0]) && (e = { top: 0, left: 0 }),
|
|||
|
{
|
|||
|
top: e.top + (parseInt(this.offsetParent.css('borderTopWidth'), 10) || 0),
|
|||
|
left: e.left + (parseInt(this.offsetParent.css('borderLeftWidth'), 10) || 0),
|
|||
|
}
|
|||
|
);
|
|||
|
},
|
|||
|
_getRelativeOffset: function () {
|
|||
|
if ('relative' !== this.cssPosition) return { top: 0, left: 0 };
|
|||
|
var t = this.element.position(),
|
|||
|
e = this._isRootNode(this.scrollParent[0]);
|
|||
|
return {
|
|||
|
top: t.top - (parseInt(this.helper.css('top'), 10) || 0) + (e ? 0 : this.scrollParent.scrollTop()),
|
|||
|
left: t.left - (parseInt(this.helper.css('left'), 10) || 0) + (e ? 0 : this.scrollParent.scrollLeft()),
|
|||
|
};
|
|||
|
},
|
|||
|
_cacheMargins: function () {
|
|||
|
this.margins = {
|
|||
|
left: parseInt(this.element.css('marginLeft'), 10) || 0,
|
|||
|
top: parseInt(this.element.css('marginTop'), 10) || 0,
|
|||
|
right: parseInt(this.element.css('marginRight'), 10) || 0,
|
|||
|
bottom: parseInt(this.element.css('marginBottom'), 10) || 0,
|
|||
|
};
|
|||
|
},
|
|||
|
_cacheHelperProportions: function () {
|
|||
|
this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };
|
|||
|
},
|
|||
|
_setContainment: function () {
|
|||
|
var e,
|
|||
|
i,
|
|||
|
s,
|
|||
|
n = this.options,
|
|||
|
o = this.document[0];
|
|||
|
return (
|
|||
|
(this.relativeContainer = null),
|
|||
|
n.containment
|
|||
|
? 'window' === n.containment
|
|||
|
? ((this.containment = [
|
|||
|
t(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
|
|||
|
t(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
|
|||
|
t(window).scrollLeft() + t(window).width() - this.helperProportions.width - this.margins.left,
|
|||
|
t(window).scrollTop() +
|
|||
|
(t(window).height() || o.body.parentNode.scrollHeight) -
|
|||
|
this.helperProportions.height -
|
|||
|
this.margins.top,
|
|||
|
]),
|
|||
|
void 0)
|
|||
|
: 'document' === n.containment
|
|||
|
? ((this.containment = [
|
|||
|
0,
|
|||
|
0,
|
|||
|
t(o).width() - this.helperProportions.width - this.margins.left,
|
|||
|
(t(o).height() || o.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top,
|
|||
|
]),
|
|||
|
void 0)
|
|||
|
: n.containment.constructor === Array
|
|||
|
? ((this.containment = n.containment), void 0)
|
|||
|
: ('parent' === n.containment && (n.containment = this.helper[0].parentNode),
|
|||
|
(i = t(n.containment)),
|
|||
|
(s = i[0]),
|
|||
|
s &&
|
|||
|
((e = /(scroll|auto)/.test(i.css('overflow'))),
|
|||
|
(this.containment = [
|
|||
|
(parseInt(i.css('borderLeftWidth'), 10) || 0) + (parseInt(i.css('paddingLeft'), 10) || 0),
|
|||
|
(parseInt(i.css('borderTopWidth'), 10) || 0) + (parseInt(i.css('paddingTop'), 10) || 0),
|
|||
|
(e ? Math.max(s.scrollWidth, s.offsetWidth) : s.offsetWidth) -
|
|||
|
(parseInt(i.css('borderRightWidth'), 10) || 0) -
|
|||
|
(parseInt(i.css('paddingRight'), 10) || 0) -
|
|||
|
this.helperProportions.width -
|
|||
|
this.margins.left -
|
|||
|
this.margins.right,
|
|||
|
(e ? Math.max(s.scrollHeight, s.offsetHeight) : s.offsetHeight) -
|
|||
|
(parseInt(i.css('borderBottomWidth'), 10) || 0) -
|
|||
|
(parseInt(i.css('paddingBottom'), 10) || 0) -
|
|||
|
this.helperProportions.height -
|
|||
|
this.margins.top -
|
|||
|
this.margins.bottom,
|
|||
|
]),
|
|||
|
(this.relativeContainer = i)),
|
|||
|
void 0)
|
|||
|
: ((this.containment = null), void 0)
|
|||
|
);
|
|||
|
},
|
|||
|
_convertPositionTo: function (t, e) {
|
|||
|
e || (e = this.position);
|
|||
|
var i = 'absolute' === t ? 1 : -1,
|
|||
|
s = this._isRootNode(this.scrollParent[0]);
|
|||
|
return {
|
|||
|
top:
|
|||
|
e.top +
|
|||
|
this.offset.relative.top * i +
|
|||
|
this.offset.parent.top * i -
|
|||
|
('fixed' === this.cssPosition ? -this.offset.scroll.top : s ? 0 : this.offset.scroll.top) * i,
|
|||
|
left:
|
|||
|
e.left +
|
|||
|
this.offset.relative.left * i +
|
|||
|
this.offset.parent.left * i -
|
|||
|
('fixed' === this.cssPosition ? -this.offset.scroll.left : s ? 0 : this.offset.scroll.left) * i,
|
|||
|
};
|
|||
|
},
|
|||
|
_generatePosition: function (t, e) {
|
|||
|
var i,
|
|||
|
s,
|
|||
|
n,
|
|||
|
o,
|
|||
|
a = this.options,
|
|||
|
r = this._isRootNode(this.scrollParent[0]),
|
|||
|
h = t.pageX,
|
|||
|
l = t.pageY;
|
|||
|
return (
|
|||
|
(r && this.offset.scroll) || (this.offset.scroll = { top: this.scrollParent.scrollTop(), left: this.scrollParent.scrollLeft() }),
|
|||
|
e &&
|
|||
|
(this.containment &&
|
|||
|
(this.relativeContainer
|
|||
|
? ((s = this.relativeContainer.offset()),
|
|||
|
(i = [
|
|||
|
this.containment[0] + s.left,
|
|||
|
this.containment[1] + s.top,
|
|||
|
this.containment[2] + s.left,
|
|||
|
this.containment[3] + s.top,
|
|||
|
]))
|
|||
|
: (i = this.containment),
|
|||
|
t.pageX - this.offset.click.left < i[0] && (h = i[0] + this.offset.click.left),
|
|||
|
t.pageY - this.offset.click.top < i[1] && (l = i[1] + this.offset.click.top),
|
|||
|
t.pageX - this.offset.click.left > i[2] && (h = i[2] + this.offset.click.left),
|
|||
|
t.pageY - this.offset.click.top > i[3] && (l = i[3] + this.offset.click.top)),
|
|||
|
a.grid &&
|
|||
|
((n = a.grid[1] ? this.originalPageY + Math.round((l - this.originalPageY) / a.grid[1]) * a.grid[1] : this.originalPageY),
|
|||
|
(l = i
|
|||
|
? n - this.offset.click.top >= i[1] || n - this.offset.click.top > i[3]
|
|||
|
? n
|
|||
|
: n - this.offset.click.top >= i[1]
|
|||
|
? n - a.grid[1]
|
|||
|
: n + a.grid[1]
|
|||
|
: n),
|
|||
|
(o = a.grid[0] ? this.originalPageX + Math.round((h - this.originalPageX) / a.grid[0]) * a.grid[0] : this.originalPageX),
|
|||
|
(h = i
|
|||
|
? o - this.offset.click.left >= i[0] || o - this.offset.click.left > i[2]
|
|||
|
? o
|
|||
|
: o - this.offset.click.left >= i[0]
|
|||
|
? o - a.grid[0]
|
|||
|
: o + a.grid[0]
|
|||
|
: o)),
|
|||
|
'y' === a.axis && (h = this.originalPageX),
|
|||
|
'x' === a.axis && (l = this.originalPageY)),
|
|||
|
{
|
|||
|
top:
|
|||
|
l -
|
|||
|
this.offset.click.top -
|
|||
|
this.offset.relative.top -
|
|||
|
this.offset.parent.top +
|
|||
|
('fixed' === this.cssPosition ? -this.offset.scroll.top : r ? 0 : this.offset.scroll.top),
|
|||
|
left:
|
|||
|
h -
|
|||
|
this.offset.click.left -
|
|||
|
this.offset.relative.left -
|
|||
|
this.offset.parent.left +
|
|||
|
('fixed' === this.cssPosition ? -this.offset.scroll.left : r ? 0 : this.offset.scroll.left),
|
|||
|
}
|
|||
|
);
|
|||
|
},
|
|||
|
_clear: function () {
|
|||
|
this.helper.removeClass('ui-draggable-dragging'),
|
|||
|
this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(),
|
|||
|
(this.helper = null),
|
|||
|
(this.cancelHelperRemoval = !1),
|
|||
|
this.destroyOnClear && this.destroy();
|
|||
|
},
|
|||
|
_normalizeRightBottom: function () {
|
|||
|
'y' !== this.options.axis &&
|
|||
|
'auto' !== this.helper.css('right') &&
|
|||
|
(this.helper.width(this.helper.width()), this.helper.css('right', 'auto')),
|
|||
|
'x' !== this.options.axis &&
|
|||
|
'auto' !== this.helper.css('bottom') &&
|
|||
|
(this.helper.height(this.helper.height()), this.helper.css('bottom', 'auto'));
|
|||
|
},
|
|||
|
_trigger: function (e, i, s) {
|
|||
|
return (
|
|||
|
(s = s || this._uiHash()),
|
|||
|
t.ui.plugin.call(this, e, [i, s, this], !0),
|
|||
|
/^(drag|start|stop)/.test(e) && ((this.positionAbs = this._convertPositionTo('absolute')), (s.offset = this.positionAbs)),
|
|||
|
t.Widget.prototype._trigger.call(this, e, i, s)
|
|||
|
);
|
|||
|
},
|
|||
|
plugins: {},
|
|||
|
_uiHash: function () {
|
|||
|
return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs };
|
|||
|
},
|
|||
|
}),
|
|||
|
t.ui.plugin.add('draggable', 'connectToSortable', {
|
|||
|
start: function (e, i, s) {
|
|||
|
var n = t.extend({}, i, { item: s.element });
|
|||
|
(s.sortables = []),
|
|||
|
t(s.options.connectToSortable).each(function () {
|
|||
|
var i = t(this).sortable('instance');
|
|||
|
i && !i.options.disabled && (s.sortables.push(i), i.refreshPositions(), i._trigger('activate', e, n));
|
|||
|
});
|
|||
|
},
|
|||
|
stop: function (e, i, s) {
|
|||
|
var n = t.extend({}, i, { item: s.element });
|
|||
|
(s.cancelHelperRemoval = !1),
|
|||
|
t.each(s.sortables, function () {
|
|||
|
var t = this;
|
|||
|
t.isOver
|
|||
|
? ((t.isOver = 0),
|
|||
|
(s.cancelHelperRemoval = !0),
|
|||
|
(t.cancelHelperRemoval = !1),
|
|||
|
(t._storedCSS = {
|
|||
|
position: t.placeholder.css('position'),
|
|||
|
top: t.placeholder.css('top'),
|
|||
|
left: t.placeholder.css('left'),
|
|||
|
}),
|
|||
|
t._mouseStop(e),
|
|||
|
(t.options.helper = t.options._helper))
|
|||
|
: ((t.cancelHelperRemoval = !0), t._trigger('deactivate', e, n));
|
|||
|
});
|
|||
|
},
|
|||
|
drag: function (e, i, s) {
|
|||
|
t.each(s.sortables, function () {
|
|||
|
var n = !1,
|
|||
|
o = this;
|
|||
|
(o.positionAbs = s.positionAbs),
|
|||
|
(o.helperProportions = s.helperProportions),
|
|||
|
(o.offset.click = s.offset.click),
|
|||
|
o._intersectsWith(o.containerCache) &&
|
|||
|
((n = !0),
|
|||
|
t.each(s.sortables, function () {
|
|||
|
return (
|
|||
|
(this.positionAbs = s.positionAbs),
|
|||
|
(this.helperProportions = s.helperProportions),
|
|||
|
(this.offset.click = s.offset.click),
|
|||
|
this !== o && this._intersectsWith(this.containerCache) && t.contains(o.element[0], this.element[0]) && (n = !1),
|
|||
|
n
|
|||
|
);
|
|||
|
})),
|
|||
|
n
|
|||
|
? (o.isOver ||
|
|||
|
((o.isOver = 1),
|
|||
|
(s._parent = i.helper.parent()),
|
|||
|
(o.currentItem = i.helper.appendTo(o.element).data('ui-sortable-item', !0)),
|
|||
|
(o.options._helper = o.options.helper),
|
|||
|
(o.options.helper = function () {
|
|||
|
return i.helper[0];
|
|||
|
}),
|
|||
|
(e.target = o.currentItem[0]),
|
|||
|
o._mouseCapture(e, !0),
|
|||
|
o._mouseStart(e, !0, !0),
|
|||
|
(o.offset.click.top = s.offset.click.top),
|
|||
|
(o.offset.click.left = s.offset.click.left),
|
|||
|
(o.offset.parent.left -= s.offset.parent.left - o.offset.parent.left),
|
|||
|
(o.offset.parent.top -= s.offset.parent.top - o.offset.parent.top),
|
|||
|
s._trigger('toSortable', e),
|
|||
|
(s.dropped = o.element),
|
|||
|
t.each(s.sortables, function () {
|
|||
|
this.refreshPositions();
|
|||
|
}),
|
|||
|
(s.currentItem = s.element),
|
|||
|
(o.fromOutside = s)),
|
|||
|
o.currentItem && (o._mouseDrag(e), (i.position = o.position)))
|
|||
|
: o.isOver &&
|
|||
|
((o.isOver = 0),
|
|||
|
(o.cancelHelperRemoval = !0),
|
|||
|
(o.options._revert = o.options.revert),
|
|||
|
(o.options.revert = !1),
|
|||
|
o._trigger('out', e, o._uiHash(o)),
|
|||
|
o._mouseStop(e, !0),
|
|||
|
(o.options.revert = o.options._revert),
|
|||
|
(o.options.helper = o.options._helper),
|
|||
|
o.placeholder && o.placeholder.remove(),
|
|||
|
i.helper.appendTo(s._parent),
|
|||
|
s._refreshOffsets(e),
|
|||
|
(i.position = s._generatePosition(e, !0)),
|
|||
|
s._trigger('fromSortable', e),
|
|||
|
(s.dropped = !1),
|
|||
|
t.each(s.sortables, function () {
|
|||
|
this.refreshPositions();
|
|||
|
}));
|
|||
|
});
|
|||
|
},
|
|||
|
}),
|
|||
|
t.ui.plugin.add('draggable', 'cursor', {
|
|||
|
start: function (e, i, s) {
|
|||
|
var n = t('body'),
|
|||
|
o = s.options;
|
|||
|
n.css('cursor') && (o._cursor = n.css('cursor')), n.css('cursor', o.cursor);
|
|||
|
},
|
|||
|
stop: function (e, i, s) {
|
|||
|
var n = s.options;
|
|||
|
n._cursor && t('body').css('cursor', n._cursor);
|
|||
|
},
|
|||
|
}),
|
|||
|
t.ui.plugin.add('draggable', 'opacity', {
|
|||
|
start: function (e, i, s) {
|
|||
|
var n = t(i.helper),
|
|||
|
o = s.options;
|
|||
|
n.css('opacity') && (o._opacity = n.css('opacity')), n.css('opacity', o.opacity);
|
|||
|
},
|
|||
|
stop: function (e, i, s) {
|
|||
|
var n = s.options;
|
|||
|
n._opacity && t(i.helper).css('opacity', n._opacity);
|
|||
|
},
|
|||
|
}),
|
|||
|
t.ui.plugin.add('draggable', 'scroll', {
|
|||
|
start: function (t, e, i) {
|
|||
|
i.scrollParentNotHidden || (i.scrollParentNotHidden = i.helper.scrollParent(!1)),
|
|||
|
i.scrollParentNotHidden[0] !== i.document[0] &&
|
|||
|
'HTML' !== i.scrollParentNotHidden[0].tagName &&
|
|||
|
(i.overflowOffset = i.scrollParentNotHidden.offset());
|
|||
|
},
|
|||
|
drag: function (e, i, s) {
|
|||
|
var n = s.options,
|
|||
|
o = !1,
|
|||
|
a = s.scrollParentNotHidden[0],
|
|||
|
r = s.document[0];
|
|||
|
a !== r && 'HTML' !== a.tagName
|
|||
|
? ((n.axis && 'x' === n.axis) ||
|
|||
|
(s.overflowOffset.top + a.offsetHeight - e.pageY < n.scrollSensitivity
|
|||
|
? (a.scrollTop = o = a.scrollTop + n.scrollSpeed)
|
|||
|
: e.pageY - s.overflowOffset.top < n.scrollSensitivity && (a.scrollTop = o = a.scrollTop - n.scrollSpeed)),
|
|||
|
(n.axis && 'y' === n.axis) ||
|
|||
|
(s.overflowOffset.left + a.offsetWidth - e.pageX < n.scrollSensitivity
|
|||
|
? (a.scrollLeft = o = a.scrollLeft + n.scrollSpeed)
|
|||
|
: e.pageX - s.overflowOffset.left < n.scrollSensitivity && (a.scrollLeft = o = a.scrollLeft - n.scrollSpeed)))
|
|||
|
: ((n.axis && 'x' === n.axis) ||
|
|||
|
(e.pageY - t(r).scrollTop() < n.scrollSensitivity
|
|||
|
? (o = t(r).scrollTop(t(r).scrollTop() - n.scrollSpeed))
|
|||
|
: t(window).height() - (e.pageY - t(r).scrollTop()) < n.scrollSensitivity &&
|
|||
|
(o = t(r).scrollTop(t(r).scrollTop() + n.scrollSpeed))),
|
|||
|
(n.axis && 'y' === n.axis) ||
|
|||
|
(e.pageX - t(r).scrollLeft() < n.scrollSensitivity
|
|||
|
? (o = t(r).scrollLeft(t(r).scrollLeft() - n.scrollSpeed))
|
|||
|
: t(window).width() - (e.pageX - t(r).scrollLeft()) < n.scrollSensitivity &&
|
|||
|
(o = t(r).scrollLeft(t(r).scrollLeft() + n.scrollSpeed)))),
|
|||
|
o !== !1 && t.ui.ddmanager && !n.dropBehaviour && t.ui.ddmanager.prepareOffsets(s, e);
|
|||
|
},
|
|||
|
}),
|
|||
|
t.ui.plugin.add('draggable', 'snap', {
|
|||
|
start: function (e, i, s) {
|
|||
|
var n = s.options;
|
|||
|
(s.snapElements = []),
|
|||
|
t(n.snap.constructor !== String ? n.snap.items || ':data(ui-draggable)' : n.snap).each(function () {
|
|||
|
var e = t(this),
|
|||
|
i = e.offset();
|
|||
|
this !== s.element[0] &&
|
|||
|
s.snapElements.push({ item: this, width: e.outerWidth(), height: e.outerHeight(), top: i.top, left: i.left });
|
|||
|
});
|
|||
|
},
|
|||
|
drag: function (e, i, s) {
|
|||
|
var n,
|
|||
|
o,
|
|||
|
a,
|
|||
|
r,
|
|||
|
h,
|
|||
|
l,
|
|||
|
u,
|
|||
|
c,
|
|||
|
d,
|
|||
|
p,
|
|||
|
f = s.options,
|
|||
|
m = f.snapTolerance,
|
|||
|
g = i.offset.left,
|
|||
|
v = g + s.helperProportions.width,
|
|||
|
_ = i.offset.top,
|
|||
|
b = _ + s.helperProportions.height;
|
|||
|
for (d = s.snapElements.length - 1; d >= 0; d--)
|
|||
|
(h = s.snapElements[d].left - s.margins.left),
|
|||
|
(l = h + s.snapElements[d].width),
|
|||
|
(u = s.snapElements[d].top - s.margins.top),
|
|||
|
(c = u + s.snapElements[d].height),
|
|||
|
h - m > v || g > l + m || u - m > b || _ > c + m || !t.contains(s.snapElements[d].item.ownerDocument, s.snapElements[d].item)
|
|||
|
? (s.snapElements[d].snapping &&
|
|||
|
s.options.snap.release &&
|
|||
|
s.options.snap.release.call(s.element, e, t.extend(s._uiHash(), { snapItem: s.snapElements[d].item })),
|
|||
|
(s.snapElements[d].snapping = !1))
|
|||
|
: ('inner' !== f.snapMode &&
|
|||
|
((n = m >= Math.abs(u - b)),
|
|||
|
(o = m >= Math.abs(c - _)),
|
|||
|
(a = m >= Math.abs(h - v)),
|
|||
|
(r = m >= Math.abs(l - g)),
|
|||
|
n && (i.position.top = s._convertPositionTo('relative', { top: u - s.helperProportions.height, left: 0 }).top),
|
|||
|
o && (i.position.top = s._convertPositionTo('relative', { top: c, left: 0 }).top),
|
|||
|
a && (i.position.left = s._convertPositionTo('relative', { top: 0, left: h - s.helperProportions.width }).left),
|
|||
|
r && (i.position.left = s._convertPositionTo('relative', { top: 0, left: l }).left)),
|
|||
|
(p = n || o || a || r),
|
|||
|
'outer' !== f.snapMode &&
|
|||
|
((n = m >= Math.abs(u - _)),
|
|||
|
(o = m >= Math.abs(c - b)),
|
|||
|
(a = m >= Math.abs(h - g)),
|
|||
|
(r = m >= Math.abs(l - v)),
|
|||
|
n && (i.position.top = s._convertPositionTo('relative', { top: u, left: 0 }).top),
|
|||
|
o && (i.position.top = s._convertPositionTo('relative', { top: c - s.helperProportions.height, left: 0 }).top),
|
|||
|
a && (i.position.left = s._convertPositionTo('relative', { top: 0, left: h }).left),
|
|||
|
r && (i.position.left = s._convertPositionTo('relative', { top: 0, left: l - s.helperProportions.width }).left)),
|
|||
|
!s.snapElements[d].snapping &&
|
|||
|
(n || o || a || r || p) &&
|
|||
|
s.options.snap.snap &&
|
|||
|
s.options.snap.snap.call(s.element, e, t.extend(s._uiHash(), { snapItem: s.snapElements[d].item })),
|
|||
|
(s.snapElements[d].snapping = n || o || a || r || p));
|
|||
|
},
|
|||
|
}),
|
|||
|
t.ui.plugin.add('draggable', 'stack', {
|
|||
|
start: function (e, i, s) {
|
|||
|
var n,
|
|||
|
o = s.options,
|
|||
|
a = t.makeArray(t(o.stack)).sort(function (e, i) {
|
|||
|
return (parseInt(t(e).css('zIndex'), 10) || 0) - (parseInt(t(i).css('zIndex'), 10) || 0);
|
|||
|
});
|
|||
|
a.length &&
|
|||
|
((n = parseInt(t(a[0]).css('zIndex'), 10) || 0),
|
|||
|
t(a).each(function (e) {
|
|||
|
t(this).css('zIndex', n + e);
|
|||
|
}),
|
|||
|
this.css('zIndex', n + a.length));
|
|||
|
},
|
|||
|
}),
|
|||
|
t.ui.plugin.add('draggable', 'zIndex', {
|
|||
|
start: function (e, i, s) {
|
|||
|
var n = t(i.helper),
|
|||
|
o = s.options;
|
|||
|
n.css('zIndex') && (o._zIndex = n.css('zIndex')), n.css('zIndex', o.zIndex);
|
|||
|
},
|
|||
|
stop: function (e, i, s) {
|
|||
|
var n = s.options;
|
|||
|
n._zIndex && t(i.helper).css('zIndex', n._zIndex);
|
|||
|
},
|
|||
|
}),
|
|||
|
t.ui.draggable,
|
|||
|
t.widget('ui.slider', t.ui.mouse, {
|
|||
|
version: '1.11.4',
|
|||
|
widgetEventPrefix: 'slide',
|
|||
|
options: {
|
|||
|
animate: !1,
|
|||
|
distance: 0,
|
|||
|
max: 100,
|
|||
|
min: 0,
|
|||
|
orientation: 'horizontal',
|
|||
|
range: !1,
|
|||
|
step: 1,
|
|||
|
value: 0,
|
|||
|
values: null,
|
|||
|
change: null,
|
|||
|
slide: null,
|
|||
|
start: null,
|
|||
|
stop: null,
|
|||
|
},
|
|||
|
numPages: 5,
|
|||
|
_create: function () {
|
|||
|
(this._keySliding = !1),
|
|||
|
(this._mouseSliding = !1),
|
|||
|
(this._animateOff = !0),
|
|||
|
(this._handleIndex = null),
|
|||
|
this._detectOrientation(),
|
|||
|
this._mouseInit(),
|
|||
|
this._calculateNewMax(),
|
|||
|
this.element.addClass('ui-slider ui-slider-' + this.orientation + ' ui-widget' + ' ui-widget-content' + ' ui-corner-all'),
|
|||
|
this._refresh(),
|
|||
|
this._setOption('disabled', this.options.disabled),
|
|||
|
(this._animateOff = !1);
|
|||
|
},
|
|||
|
_refresh: function () {
|
|||
|
this._createRange(), this._createHandles(), this._setupEvents(), this._refreshValue();
|
|||
|
},
|
|||
|
_createHandles: function () {
|
|||
|
var e,
|
|||
|
i,
|
|||
|
s = this.options,
|
|||
|
n = this.element.find('.ui-slider-handle').addClass('ui-state-default ui-corner-all'),
|
|||
|
o = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
|
|||
|
a = [];
|
|||
|
for (i = (s.values && s.values.length) || 1, n.length > i && (n.slice(i).remove(), (n = n.slice(0, i))), e = n.length; i > e; e++)
|
|||
|
a.push(o);
|
|||
|
(this.handles = n.add(t(a.join('')).appendTo(this.element))),
|
|||
|
(this.handle = this.handles.eq(0)),
|
|||
|
this.handles.each(function (e) {
|
|||
|
t(this).data('ui-slider-handle-index', e);
|
|||
|
});
|
|||
|
},
|
|||
|
_createRange: function () {
|
|||
|
var e = this.options,
|
|||
|
i = '';
|
|||
|
e.range
|
|||
|
? (e.range === !0 &&
|
|||
|
(e.values
|
|||
|
? e.values.length && 2 !== e.values.length
|
|||
|
? (e.values = [e.values[0], e.values[0]])
|
|||
|
: t.isArray(e.values) && (e.values = e.values.slice(0))
|
|||
|
: (e.values = [this._valueMin(), this._valueMin()])),
|
|||
|
this.range && this.range.length
|
|||
|
? this.range.removeClass('ui-slider-range-min ui-slider-range-max').css({ left: '', bottom: '' })
|
|||
|
: ((this.range = t('<div></div>').appendTo(this.element)), (i = 'ui-slider-range ui-widget-header ui-corner-all')),
|
|||
|
this.range.addClass(i + ('min' === e.range || 'max' === e.range ? ' ui-slider-range-' + e.range : '')))
|
|||
|
: (this.range && this.range.remove(), (this.range = null));
|
|||
|
},
|
|||
|
_setupEvents: function () {
|
|||
|
this._off(this.handles), this._on(this.handles, this._handleEvents), this._hoverable(this.handles), this._focusable(this.handles);
|
|||
|
},
|
|||
|
_destroy: function () {
|
|||
|
this.handles.remove(),
|
|||
|
this.range && this.range.remove(),
|
|||
|
this.element.removeClass('ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all'),
|
|||
|
this._mouseDestroy();
|
|||
|
},
|
|||
|
_mouseCapture: function (e) {
|
|||
|
var i,
|
|||
|
s,
|
|||
|
n,
|
|||
|
o,
|
|||
|
a,
|
|||
|
r,
|
|||
|
h,
|
|||
|
l,
|
|||
|
u = this,
|
|||
|
c = this.options;
|
|||
|
return c.disabled
|
|||
|
? !1
|
|||
|
: ((this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }),
|
|||
|
(this.elementOffset = this.element.offset()),
|
|||
|
(i = { x: e.pageX, y: e.pageY }),
|
|||
|
(s = this._normValueFromMouse(i)),
|
|||
|
(n = this._valueMax() - this._valueMin() + 1),
|
|||
|
this.handles.each(function (e) {
|
|||
|
var i = Math.abs(s - u.values(e));
|
|||
|
(n > i || (n === i && (e === u._lastChangedValue || u.values(e) === c.min))) && ((n = i), (o = t(this)), (a = e));
|
|||
|
}),
|
|||
|
(r = this._start(e, a)),
|
|||
|
r === !1
|
|||
|
? !1
|
|||
|
: ((this._mouseSliding = !0),
|
|||
|
(this._handleIndex = a),
|
|||
|
o.addClass('ui-state-active').focus(),
|
|||
|
(h = o.offset()),
|
|||
|
(l = !t(e.target).parents().addBack().is('.ui-slider-handle')),
|
|||
|
(this._clickOffset = l
|
|||
|
? { left: 0, top: 0 }
|
|||
|
: {
|
|||
|
left: e.pageX - h.left - o.width() / 2,
|
|||
|
top:
|
|||
|
e.pageY -
|
|||
|
h.top -
|
|||
|
o.height() / 2 -
|
|||
|
(parseInt(o.css('borderTopWidth'), 10) || 0) -
|
|||
|
(parseInt(o.css('borderBottomWidth'), 10) || 0) +
|
|||
|
(parseInt(o.css('marginTop'), 10) || 0),
|
|||
|
}),
|
|||
|
this.handles.hasClass('ui-state-hover') || this._slide(e, a, s),
|
|||
|
(this._animateOff = !0),
|
|||
|
!0));
|
|||
|
},
|
|||
|
_mouseStart: function () {
|
|||
|
return !0;
|
|||
|
},
|
|||
|
_mouseDrag: function (t) {
|
|||
|
var e = { x: t.pageX, y: t.pageY },
|
|||
|
i = this._normValueFromMouse(e);
|
|||
|
return this._slide(t, this._handleIndex, i), !1;
|
|||
|
},
|
|||
|
_mouseStop: function (t) {
|
|||
|
return (
|
|||
|
this.handles.removeClass('ui-state-active'),
|
|||
|
(this._mouseSliding = !1),
|
|||
|
this._stop(t, this._handleIndex),
|
|||
|
this._change(t, this._handleIndex),
|
|||
|
(this._handleIndex = null),
|
|||
|
(this._clickOffset = null),
|
|||
|
(this._animateOff = !1),
|
|||
|
!1
|
|||
|
);
|
|||
|
},
|
|||
|
_detectOrientation: function () {
|
|||
|
this.orientation = 'vertical' === this.options.orientation ? 'vertical' : 'horizontal';
|
|||
|
},
|
|||
|
_normValueFromMouse: function (t) {
|
|||
|
var e, i, s, n, o;
|
|||
|
return (
|
|||
|
'horizontal' === this.orientation
|
|||
|
? ((e = this.elementSize.width), (i = t.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)))
|
|||
|
: ((e = this.elementSize.height), (i = t.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0))),
|
|||
|
(s = i / e),
|
|||
|
s > 1 && (s = 1),
|
|||
|
0 > s && (s = 0),
|
|||
|
'vertical' === this.orientation && (s = 1 - s),
|
|||
|
(n = this._valueMax() - this._valueMin()),
|
|||
|
(o = this._valueMin() + s * n),
|
|||
|
this._trimAlignValue(o)
|
|||
|
);
|
|||
|
},
|
|||
|
_start: function (t, e) {
|
|||
|
var i = { handle: this.handles[e], value: this.value() };
|
|||
|
return (
|
|||
|
this.options.values && this.options.values.length && ((i.value = this.values(e)), (i.values = this.values())),
|
|||
|
this._trigger('start', t, i)
|
|||
|
);
|
|||
|
},
|
|||
|
_slide: function (t, e, i) {
|
|||
|
var s, n, o;
|
|||
|
this.options.values && this.options.values.length
|
|||
|
? ((s = this.values(e ? 0 : 1)),
|
|||
|
2 === this.options.values.length && this.options.range === !0 && ((0 === e && i > s) || (1 === e && s > i)) && (i = s),
|
|||
|
i !== this.values(e) &&
|
|||
|
((n = this.values()),
|
|||
|
(n[e] = i),
|
|||
|
(o = this._trigger('slide', t, { handle: this.handles[e], value: i, values: n })),
|
|||
|
(s = this.values(e ? 0 : 1)),
|
|||
|
o !== !1 && this.values(e, i)))
|
|||
|
: i !== this.value() && ((o = this._trigger('slide', t, { handle: this.handles[e], value: i })), o !== !1 && this.value(i));
|
|||
|
},
|
|||
|
_stop: function (t, e) {
|
|||
|
var i = { handle: this.handles[e], value: this.value() };
|
|||
|
this.options.values && this.options.values.length && ((i.value = this.values(e)), (i.values = this.values())),
|
|||
|
this._trigger('stop', t, i);
|
|||
|
},
|
|||
|
_change: function (t, e) {
|
|||
|
if (!this._keySliding && !this._mouseSliding) {
|
|||
|
var i = { handle: this.handles[e], value: this.value() };
|
|||
|
this.options.values && this.options.values.length && ((i.value = this.values(e)), (i.values = this.values())),
|
|||
|
(this._lastChangedValue = e),
|
|||
|
this._trigger('change', t, i);
|
|||
|
}
|
|||
|
},
|
|||
|
value: function (t) {
|
|||
|
return arguments.length
|
|||
|
? ((this.options.value = this._trimAlignValue(t)), this._refreshValue(), this._change(null, 0), void 0)
|
|||
|
: this._value();
|
|||
|
},
|
|||
|
values: function (e, i) {
|
|||
|
var s, n, o;
|
|||
|
if (arguments.length > 1)
|
|||
|
return (this.options.values[e] = this._trimAlignValue(i)), this._refreshValue(), this._change(null, e), void 0;
|
|||
|
if (!arguments.length) return this._values();
|
|||
|
if (!t.isArray(arguments[0])) return this.options.values && this.options.values.length ? this._values(e) : this.value();
|
|||
|
for (s = this.options.values, n = arguments[0], o = 0; s.length > o; o += 1)
|
|||
|
(s[o] = this._trimAlignValue(n[o])), this._change(null, o);
|
|||
|
this._refreshValue();
|
|||
|
},
|
|||
|
_setOption: function (e, i) {
|
|||
|
var s,
|
|||
|
n = 0;
|
|||
|
switch (
|
|||
|
('range' === e &&
|
|||
|
this.options.range === !0 &&
|
|||
|
('min' === i
|
|||
|
? ((this.options.value = this._values(0)), (this.options.values = null))
|
|||
|
: 'max' === i && ((this.options.value = this._values(this.options.values.length - 1)), (this.options.values = null))),
|
|||
|
t.isArray(this.options.values) && (n = this.options.values.length),
|
|||
|
'disabled' === e && this.element.toggleClass('ui-state-disabled', !!i),
|
|||
|
this._super(e, i),
|
|||
|
e)
|
|||
|
) {
|
|||
|
case 'orientation':
|
|||
|
this._detectOrientation(),
|
|||
|
this.element.removeClass('ui-slider-horizontal ui-slider-vertical').addClass('ui-slider-' + this.orientation),
|
|||
|
this._refreshValue(),
|
|||
|
this.handles.css('horizontal' === i ? 'bottom' : 'left', '');
|
|||
|
break;
|
|||
|
case 'value':
|
|||
|
(this._animateOff = !0), this._refreshValue(), this._change(null, 0), (this._animateOff = !1);
|
|||
|
break;
|
|||
|
case 'values':
|
|||
|
for (this._animateOff = !0, this._refreshValue(), s = 0; n > s; s += 1) this._change(null, s);
|
|||
|
this._animateOff = !1;
|
|||
|
break;
|
|||
|
case 'step':
|
|||
|
case 'min':
|
|||
|
case 'max':
|
|||
|
(this._animateOff = !0), this._calculateNewMax(), this._refreshValue(), (this._animateOff = !1);
|
|||
|
break;
|
|||
|
case 'range':
|
|||
|
(this._animateOff = !0), this._refresh(), (this._animateOff = !1);
|
|||
|
}
|
|||
|
},
|
|||
|
_value: function () {
|
|||
|
var t = this.options.value;
|
|||
|
return (t = this._trimAlignValue(t));
|
|||
|
},
|
|||
|
_values: function (t) {
|
|||
|
var e, i, s;
|
|||
|
if (arguments.length) return (e = this.options.values[t]), (e = this._trimAlignValue(e));
|
|||
|
if (this.options.values && this.options.values.length) {
|
|||
|
for (i = this.options.values.slice(), s = 0; i.length > s; s += 1) i[s] = this._trimAlignValue(i[s]);
|
|||
|
return i;
|
|||
|
}
|
|||
|
return [];
|
|||
|
},
|
|||
|
_trimAlignValue: function (t) {
|
|||
|
if (this._valueMin() >= t) return this._valueMin();
|
|||
|
if (t >= this._valueMax()) return this._valueMax();
|
|||
|
var e = this.options.step > 0 ? this.options.step : 1,
|
|||
|
i = (t - this._valueMin()) % e,
|
|||
|
s = t - i;
|
|||
|
return 2 * Math.abs(i) >= e && (s += i > 0 ? e : -e), parseFloat(s.toFixed(5));
|
|||
|
},
|
|||
|
_calculateNewMax: function () {
|
|||
|
var t = this.options.max,
|
|||
|
e = this._valueMin(),
|
|||
|
i = this.options.step,
|
|||
|
s = Math.floor(+(t - e).toFixed(this._precision()) / i) * i;
|
|||
|
(t = s + e), (this.max = parseFloat(t.toFixed(this._precision())));
|
|||
|
},
|
|||
|
_precision: function () {
|
|||
|
var t = this._precisionOf(this.options.step);
|
|||
|
return null !== this.options.min && (t = Math.max(t, this._precisionOf(this.options.min))), t;
|
|||
|
},
|
|||
|
_precisionOf: function (t) {
|
|||
|
var e = '' + t,
|
|||
|
i = e.indexOf('.');
|
|||
|
return -1 === i ? 0 : e.length - i - 1;
|
|||
|
},
|
|||
|
_valueMin: function () {
|
|||
|
return this.options.min;
|
|||
|
},
|
|||
|
_valueMax: function () {
|
|||
|
return this.max;
|
|||
|
},
|
|||
|
_refreshValue: function () {
|
|||
|
var e,
|
|||
|
i,
|
|||
|
s,
|
|||
|
n,
|
|||
|
o,
|
|||
|
a = this.options.range,
|
|||
|
r = this.options,
|
|||
|
h = this,
|
|||
|
l = this._animateOff ? !1 : r.animate,
|
|||
|
u = {};
|
|||
|
this.options.values && this.options.values.length
|
|||
|
? this.handles.each(function (s) {
|
|||
|
(i = 100 * ((h.values(s) - h._valueMin()) / (h._valueMax() - h._valueMin()))),
|
|||
|
(u['horizontal' === h.orientation ? 'left' : 'bottom'] = i + '%'),
|
|||
|
t(this).stop(1, 1)[l ? 'animate' : 'css'](u, r.animate),
|
|||
|
h.options.range === !0 &&
|
|||
|
('horizontal' === h.orientation
|
|||
|
? (0 === s && h.range.stop(1, 1)[l ? 'animate' : 'css']({ left: i + '%' }, r.animate),
|
|||
|
1 === s && h.range[l ? 'animate' : 'css']({ width: i - e + '%' }, { queue: !1, duration: r.animate }))
|
|||
|
: (0 === s && h.range.stop(1, 1)[l ? 'animate' : 'css']({ bottom: i + '%' }, r.animate),
|
|||
|
1 === s && h.range[l ? 'animate' : 'css']({ height: i - e + '%' }, { queue: !1, duration: r.animate }))),
|
|||
|
(e = i);
|
|||
|
})
|
|||
|
: ((s = this.value()),
|
|||
|
(n = this._valueMin()),
|
|||
|
(o = this._valueMax()),
|
|||
|
(i = o !== n ? 100 * ((s - n) / (o - n)) : 0),
|
|||
|
(u['horizontal' === this.orientation ? 'left' : 'bottom'] = i + '%'),
|
|||
|
this.handle.stop(1, 1)[l ? 'animate' : 'css'](u, r.animate),
|
|||
|
'min' === a && 'horizontal' === this.orientation && this.range.stop(1, 1)[l ? 'animate' : 'css']({ width: i + '%' }, r.animate),
|
|||
|
'max' === a &&
|
|||
|
'horizontal' === this.orientation &&
|
|||
|
this.range[l ? 'animate' : 'css']({ width: 100 - i + '%' }, { queue: !1, duration: r.animate }),
|
|||
|
'min' === a && 'vertical' === this.orientation && this.range.stop(1, 1)[l ? 'animate' : 'css']({ height: i + '%' }, r.animate),
|
|||
|
'max' === a &&
|
|||
|
'vertical' === this.orientation &&
|
|||
|
this.range[l ? 'animate' : 'css']({ height: 100 - i + '%' }, { queue: !1, duration: r.animate }));
|
|||
|
},
|
|||
|
_handleEvents: {
|
|||
|
keydown: function (e) {
|
|||
|
var i,
|
|||
|
s,
|
|||
|
n,
|
|||
|
o,
|
|||
|
a = t(e.target).data('ui-slider-handle-index');
|
|||
|
switch (e.keyCode) {
|
|||
|
case t.ui.keyCode.HOME:
|
|||
|
case t.ui.keyCode.END:
|
|||
|
case t.ui.keyCode.PAGE_UP:
|
|||
|
case t.ui.keyCode.PAGE_DOWN:
|
|||
|
case t.ui.keyCode.UP:
|
|||
|
case t.ui.keyCode.RIGHT:
|
|||
|
case t.ui.keyCode.DOWN:
|
|||
|
case t.ui.keyCode.LEFT:
|
|||
|
if (
|
|||
|
(e.preventDefault(),
|
|||
|
!this._keySliding && ((this._keySliding = !0), t(e.target).addClass('ui-state-active'), (i = this._start(e, a)), i === !1))
|
|||
|
)
|
|||
|
return;
|
|||
|
}
|
|||
|
switch (
|
|||
|
((o = this.options.step),
|
|||
|
(s = n = this.options.values && this.options.values.length ? this.values(a) : this.value()),
|
|||
|
e.keyCode)
|
|||
|
) {
|
|||
|
case t.ui.keyCode.HOME:
|
|||
|
n = this._valueMin();
|
|||
|
break;
|
|||
|
case t.ui.keyCode.END:
|
|||
|
n = this._valueMax();
|
|||
|
break;
|
|||
|
case t.ui.keyCode.PAGE_UP:
|
|||
|
n = this._trimAlignValue(s + (this._valueMax() - this._valueMin()) / this.numPages);
|
|||
|
break;
|
|||
|
case t.ui.keyCode.PAGE_DOWN:
|
|||
|
n = this._trimAlignValue(s - (this._valueMax() - this._valueMin()) / this.numPages);
|
|||
|
break;
|
|||
|
case t.ui.keyCode.UP:
|
|||
|
case t.ui.keyCode.RIGHT:
|
|||
|
if (s === this._valueMax()) return;
|
|||
|
n = this._trimAlignValue(s + o);
|
|||
|
break;
|
|||
|
case t.ui.keyCode.DOWN:
|
|||
|
case t.ui.keyCode.LEFT:
|
|||
|
if (s === this._valueMin()) return;
|
|||
|
n = this._trimAlignValue(s - o);
|
|||
|
}
|
|||
|
this._slide(e, a, n);
|
|||
|
},
|
|||
|
keyup: function (e) {
|
|||
|
var i = t(e.target).data('ui-slider-handle-index');
|
|||
|
this._keySliding && ((this._keySliding = !1), this._stop(e, i), this._change(e, i), t(e.target).removeClass('ui-state-active'));
|
|||
|
},
|
|||
|
},
|
|||
|
});
|
|||
|
});
|
|||
|
|
|||
|
/*!
|
|||
|
* jQuery UI Touch Punch 0.2.3
|
|||
|
*
|
|||
|
* Copyright 2011–2014, Dave Furfero
|
|||
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|||
|
*
|
|||
|
* Depends:
|
|||
|
* jquery.ui.widget.js
|
|||
|
* jquery.ui.mouse.js
|
|||
|
*/
|
|||
|
!(function (a) {
|
|||
|
function f(a, b) {
|
|||
|
if (!(a.originalEvent.touches.length > 1)) {
|
|||
|
a.preventDefault();
|
|||
|
var c = a.originalEvent.changedTouches[0],
|
|||
|
d = document.createEvent('MouseEvents');
|
|||
|
d.initMouseEvent(b, !0, !0, window, 1, c.screenX, c.screenY, c.clientX, c.clientY, !1, !1, !1, !1, 0, null),
|
|||
|
a.target.dispatchEvent(d);
|
|||
|
}
|
|||
|
}
|
|||
|
if (((a.support.touch = 'ontouchend' in document), a.support.touch)) {
|
|||
|
var e,
|
|||
|
b = a.ui.mouse.prototype,
|
|||
|
c = b._mouseInit,
|
|||
|
d = b._mouseDestroy;
|
|||
|
(b._touchStart = function (a) {
|
|||
|
var b = this;
|
|||
|
!e &&
|
|||
|
b._mouseCapture(a.originalEvent.changedTouches[0]) &&
|
|||
|
((e = !0), (b._touchMoved = !1), f(a, 'mouseover'), f(a, 'mousemove'), f(a, 'mousedown'));
|
|||
|
}),
|
|||
|
(b._touchMove = function (a) {
|
|||
|
e && ((this._touchMoved = !0), f(a, 'mousemove'));
|
|||
|
}),
|
|||
|
(b._touchEnd = function (a) {
|
|||
|
e && (f(a, 'mouseup'), f(a, 'mouseout'), this._touchMoved || f(a, 'click'), (e = !1));
|
|||
|
}),
|
|||
|
(b._mouseInit = function () {
|
|||
|
var b = this;
|
|||
|
b.element.bind({ touchstart: a.proxy(b, '_touchStart'), touchmove: a.proxy(b, '_touchMove'), touchend: a.proxy(b, '_touchEnd') }),
|
|||
|
c.call(b);
|
|||
|
}),
|
|||
|
(b._mouseDestroy = function () {
|
|||
|
var b = this;
|
|||
|
b.element.unbind({ touchstart: a.proxy(b, '_touchStart'), touchmove: a.proxy(b, '_touchMove'), touchend: a.proxy(b, '_touchEnd') }),
|
|||
|
d.call(b);
|
|||
|
});
|
|||
|
}
|
|||
|
})(jQuery);
|