(function (e, t) { function i(t, n) { var r, i, o, u; if (typeof t.nodeName == "undefined") return false; if ("area" === u) { r = t.parentNode; i = r.name; if (!t.href || !i || r.nodeName.toLowerCase() !== "map") { return false } o = e("img[usemap=#" + i + "]")[0]; return !!o && s(o) } return (/input|select|textarea|button|object/.test(u) ? !t.disabled : "a" === u ? t.href || n : n) && s(t) } function s(t) { return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function () { return e.css(this, "visibility") === "hidden" }).length } var n = 0, r = /^ui-id-\d+$/; e.ui = e.ui || {}; e.extend(e.ui, { version: "1.10.4", keyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38} }); e.fn.extend({ focus: function (t) { return function (n, r) { return typeof n === "number" ? this.each(function () { var t = this; setTimeout(function () { e(t).focus(); if (r) { r.call(t) } }, n) }) : t.apply(this, arguments) } } (e.fn.focus), scrollParent: function () { var t; if (e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position"))) { t = this.parents().filter(function () { return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) }).eq(0) } else { t = this.parents().filter(function () { return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) }).eq(0) } return /fixed/.test(this.css("position")) || !t.length ? e(document) : t }, zIndex: function (n) { if (n !== t) { return this.css("zIndex", n) } if (this.length) { var r = e(this[0]), i, s; while (r.length && r[0] !== document) { i = r.css("position"); if (i === "absolute" || i === "relative" || i === "fixed") { s = parseInt(r.css("zIndex"), 10); if (!isNaN(s) && s !== 0) { return s } } r = r.parent() } } return 0 }, uniqueId: function () { return this.each(function () { if (!this.id) { this.id = "ui-id-" + ++n } }) }, removeUniqueId: function () { return this.each(function () { if (r.test(this.id)) { e(this).removeAttr("id") } }) } }); e.extend(e.expr[":"], { data: e.expr.createPseudo ? e.expr.createPseudo(function (t) { return function (n) { return !!e.data(n, t) } }) : function (t, n, r) { return !!e.data(t, r[3]) }, focusable: function (t) { return i(t, !isNaN(e.attr(t, "tabindex"))) }, tabbable: function (t) { var n = e.attr(t, "tabindex"), r = isNaN(n); return (r || n >= 0) && i(t, !r) } }); if (!e("").outerWidth(1).jquery) { e.each(["Width", "Height"], function (n, r) { function u(t, n, r, s) { e.each(i, function () { n -= parseFloat(e.css(t, "padding" + this)) || 0; if (r) { n -= parseFloat(e.css(t, "border" + this + "Width")) || 0 } if (s) { n -= parseFloat(e.css(t, "margin" + this)) || 0 } }); return n } var i = r === "Width" ? ["Left", "Right"] : ["Top", "Bottom"], s = r.toLowerCase(), o = { innerWidth: e.fn.innerWidth, innerHeight: e.fn.innerHeight, outerWidth: e.fn.outerWidth, outerHeight: e.fn.outerHeight }; e.fn["inner" + r] = function (n) { if (n === t) { return o["inner" + r].call(this) } return this.each(function () { e(this).css(s, u(this, n) + "px") }) }; e.fn["outer" + r] = function (t, n) { if (typeof t !== "number") { return o["outer" + r].call(this, t) } return this.each(function () { e(this).css(s, u(this, t, true, n) + "px") }) } }) } if (!e.fn.addBack) { e.fn.addBack = function (e) { return this.add(e == null ? this.prevObject : this.prevObject.filter(e)) } } if (e("").data("a-b", "a").removeData("a-b").data("a-b")) { e.fn.removeData = function (t) { return function (n) { if (arguments.length) { return t.call(this, e.camelCase(n)) } else { return t.call(this) } } } (e.fn.removeData) } e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); e.support.selectstart = "onselectstart" in document.createElement("div"); e.fn.extend({ disableSelection: function () { return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (e) { e.preventDefault() }) }, enableSelection: function () { return this.unbind(".ui-disableSelection") } }); e.extend(e.ui, { plugin: { add: function (t, n, r) { var i, s = e.ui[t].prototype; for (i in r) { s.plugins[i] = s.plugins[i] || []; s.plugins[i].push([n, r[i]]) } }, call: function (e, t, n) { var r, i = e.plugins[t]; if (!i || !e.element[0].parentNode || e.element[0].parentNode.nodeType === 11) { return } for (r = 0; r < i.length; r++) { if (e.options[i[r][0]]) { i[r][1].apply(e.element, n) } } } }, hasScroll: function (t, n) { if (e(t).css("overflow") === "hidden") { return false } var r = n && n === "left" ? "scrollLeft" : "scrollTop", i = false; if (t[r] > 0) { return true } t[r] = 1; i = t[r] > 0; t[r] = 0; return i } }) })(jQuery); (function (e, t) { var n = 0, r = Array.prototype.slice, i = e.cleanData; e.cleanData = function (t) { for (var n = 0, r; (r = t[n]) != null; n++) { try { e(r).triggerHandler("remove") } catch (s) { } } i(t) }; e.widget = function (t, n, r) { var i, s, o, u, a = {}, f = t.split(".")[0]; t = t.split(".")[1]; i = f + "-" + t; if (!r) { r = n; n = e.Widget } e.expr[":"][i.toLowerCase()] = function (t) { return !!e.data(t, i) }; e[f] = e[f] || {}; s = e[f][t]; o = e[f][t] = function (e, t) { if (!this._createWidget) { return new o(e, t) } if (arguments.length) { this._createWidget(e, t) } }; e.extend(o, s, { version: r.version, _proto: e.extend({}, r), _childConstructors: [] }); u = new n; u.options = e.widget.extend({}, u.options); e.each(r, function (t, r) { if (!e.isFunction(r)) { a[t] = r; return } a[t] = function () { var e = function () { return n.prototype[t].apply(this, arguments) }, i = function (e) { return n.prototype[t].apply(this, e) }; return function () { var t = this._super, n = this._superApply, s; this._super = e; this._superApply = i; s = r.apply(this, arguments); this._super = t; this._superApply = n; return s } } () }); o.prototype = e.widget.extend(u, { widgetEventPrefix: s ? u.widgetEventPrefix || t : t }, a, { constructor: o, namespace: f, widgetName: t, widgetFullName: i }); if (s) { e.each(s._childConstructors, function (t, n) { var r = n.prototype; e.widget(r.namespace + "." + r.widgetName, o, n._proto) }); delete s._childConstructors } else { n._childConstructors.push(o) } e.widget.bridge(t, o) }; e.widget.extend = function (n) { var i = r.call(arguments, 1), s = 0, o = i.length, u, a; for (; s < o; s++) { for (u in i[s]) { a = i[s][u]; if (i[s].hasOwnProperty(u) && a !== t) { if (e.isPlainObject(a)) { n[u] = e.isPlainObject(n[u]) ? e.widget.extend({}, n[u], a) : e.widget.extend({}, a) } else { n[u] = a } } } } return n }; e.widget.bridge = function (n, i) { var s = i.prototype.widgetFullName || n; e.fn[n] = function (o) { var u = typeof o === "string", a = r.call(arguments, 1), f = this; o = !u && a.length ? e.widget.extend.apply(null, [o].concat(a)) : o; if (u) { this.each(function () { var r, i = e.data(this, s); if (!i) { return e.error("cannot call methods on " + n + " prior to initialization; " + "attempted to call method '" + o + "'") } if (!e.isFunction(i[o]) || o.charAt(0) === "_") { return e.error("no such method '" + o + "' for " + n + " widget instance") } r = i[o].apply(i, a); if (r !== i && r !== t) { f = r && r.jquery ? f.pushStack(r.get()) : r; return false } }) } else { this.each(function () { var t = e.data(this, s); if (t) { t.option(o || {})._init() } else { e.data(this, s, new i(o, this)) } }) } return f } }; e.Widget = function () { }; e.Widget._childConstructors = []; e.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "
", options: { disabled: false, create: null }, _createWidget: function (t, r) { r = e(r || this.defaultElement || this)[0]; this.element = e(r); this.uuid = n++; this.eventNamespace = "." + this.widgetName + this.uuid; this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t); this.bindings = e(); this.hoverable = e(); this.focusable = e(); if (r !== this) { e.data(r, this.widgetFullName, this); this._on(true, this.element, { remove: function (e) { if (e.target === r) { this.destroy() } } }); this.document = e(r.style ? r.ownerDocument : r.document || r); this.window = e(this.document[0].defaultView || this.document[0].parentWindow) } this._create(); this._trigger("create", null, this._getCreateEventData()); this._init() }, _getCreateOptions: e.noop, _getCreateEventData: e.noop, _create: e.noop, _init: e.noop, destroy: function () { this._destroy(); this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.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: e.noop, widget: function () { return this.element }, option: function (n, r) { var i = n, s, o, u; if (arguments.length === 0) { return e.widget.extend({}, this.options) } if (typeof n === "string") { i = {}; s = n.split("."); n = s.shift(); if (s.length) { o = i[n] = e.widget.extend({}, this.options[n]); for (u = 0; u < s.length - 1; u++) { o[s[u]] = o[s[u]] || {}; o = o[s[u]] } n = s.pop(); if (arguments.length === 1) { return o[n] === t ? null : o[n] } o[n] = r } else { if (arguments.length === 1) { return this.options[n] === t ? null : this.options[n] } i[n] = r } } this._setOptions(i); return this }, _setOptions: function (e) { var t; for (t in e) { this._setOption(t, e[t]) } return this }, _setOption: function (e, t) { this.options[e] = t; if (e === "disabled") { this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!t).attr("aria-disabled", t); this.hoverable.removeClass("ui-state-hover"); this.focusable.removeClass("ui-state-focus") } return this }, enable: function () { return this._setOption("disabled", false) }, disable: function () { return this._setOption("disabled", true) }, _on: function (t, n, r) { var i, s = this; if (typeof t !== "boolean") { r = n; n = t; t = false } if (!r) { r = n; n = this.element; i = this.widget() } else { n = i = e(n); this.bindings = this.bindings.add(n) } e.each(r, function (r, o) { function u() { if (!t && (s.options.disabled === true || e(this).hasClass("ui-state-disabled"))) { return } return (typeof o === "string" ? s[o] : o).apply(s, arguments) } if (typeof o !== "string") { u.guid = o.guid = o.guid || u.guid || e.guid++ } var a = r.match(/^(\w+)\s*(.*)$/), f = a[1] + s.eventNamespace, l = a[2]; if (l) { i.delegate(l, f, u) } else { n.bind(f, u) } }) }, _off: function (e, t) { t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace; e.unbind(t).undelegate(t) }, _delay: function (e, t) { function n() { return (typeof e === "string" ? r[e] : e).apply(r, arguments) } var r = this; return setTimeout(n, t || 0) }, _hoverable: function (t) { this.hoverable = this.hoverable.add(t); this._on(t, { mouseenter: function (t) { e(t.currentTarget).addClass("ui-state-hover") }, mouseleave: function (t) { e(t.currentTarget).removeClass("ui-state-hover") } }) }, _focusable: function (t) { this.focusable = this.focusable.add(t); this._on(t, { focusin: function (t) { e(t.currentTarget).addClass("ui-state-focus") }, focusout: function (t) { e(t.currentTarget).removeClass("ui-state-focus") } }) }, _trigger: function (t, n, r) { var i, s, o = this.options[t]; r = r || {}; n = e.Event(n); n.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(); n.target = this.element[0]; s = n.originalEvent; if (s) { for (i in s) { if (!(i in n)) { n[i] = s[i] } } } this.element.trigger(n, r); return !(e.isFunction(o) && o.apply(this.element[0], [n].concat(r)) === false || n.isDefaultPrevented()) } }; e.each({ show: "fadeIn", hide: "fadeOut" }, function (t, n) { e.Widget.prototype["_" + t] = function (r, i, s) { if (typeof i === "string") { i = { effect: i} } var o, u = !i ? t : i === true || typeof i === "number" ? n : i.effect || n; i = i || {}; if (typeof i === "number") { i = { duration: i} } o = !e.isEmptyObject(i); i.complete = s; if (i.delay) { r.delay(i.delay) } if (o && e.effects && e.effects.effect[u]) { r[t](i) } else if (u !== t && r[u]) { r[u](i.duration, i.easing, s) } else { r.queue(function (n) { e(this)[t](); if (s) { s.call(r[0]) } n() }) } } }) })(jQuery); (function (e, t) { var n = false; e(document).mouseup(function () { n = false }); e.widget("ui.mouse", { version: "1.10.4", options: { cancel: "input,textarea,button,select,option", distance: 1, delay: 0 }, _mouseInit: function () { var t = this; this.element.bind("mousedown." + this.widgetName, function (e) { return t._mouseDown(e) }).bind("click." + this.widgetName, function (n) { if (true === e.data(n.target, t.widgetName + ".preventClickEvent")) { e.removeData(n.target, t.widgetName + ".preventClickEvent"); n.stopImmediatePropagation(); return false } }); this.started = false }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName); if (this._mouseMoveDelegate) { e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate) } }, _mouseDown: function (t) { if (n) { return } this._mouseStarted && this._mouseUp(t); this._mouseDownEvent = t; var r = this, i = t.which === 1, s = typeof this.options.cancel === "string" && t.target.nodeName ? e(t.target).closest(this.options.cancel).length : false; if (!i || s || !this._mouseCapture(t)) { return true } this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) { this._mouseDelayTimer = setTimeout(function () { r.mouseDelayMet = true }, this.options.delay) } if (this._mouseDistanceMet(t) && this._mouseDelayMet(t)) { this._mouseStarted = this._mouseStart(t) !== false; if (!this._mouseStarted) { t.preventDefault(); return true } } if (true === e.data(t.target, this.widgetName + ".preventClickEvent")) { e.removeData(t.target, this.widgetName + ".preventClickEvent") } this._mouseMoveDelegate = function (e) { return r._mouseMove(e) }; this._mouseUpDelegate = function (e) { return r._mouseUp(e) }; e(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate); t.preventDefault(); n = true; return true }, _mouseMove: function (t) { if (e.ui.ie && (!document.documentMode || document.documentMode < 9) && !t.button) { return this._mouseUp(t) } if (this._mouseStarted) { this._mouseDrag(t); return t.preventDefault() } if (this._mouseDistanceMet(t) && this._mouseDelayMet(t)) { this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== false; this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t) } return !this._mouseStarted }, _mouseUp: function (t) { e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate); if (this._mouseStarted) { this._mouseStarted = false; if (t.target === this._mouseDownEvent.target) { e.data(t.target, this.widgetName + ".preventClickEvent", true) } this._mouseStop(t) } return false }, _mouseDistanceMet: function (e) { return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return true } }) })(jQuery); (function (e, t) { function h(e, t, n) { return [parseFloat(e[0]) * (l.test(e[0]) ? t / 100 : 1), parseFloat(e[1]) * (l.test(e[1]) ? n / 100 : 1)] } function p(t, n) { return parseInt(e.css(t, n), 10) || 0 } function d(t) { var n = t[0]; if (n.nodeType === 9) { return { width: t.width(), height: t.height(), offset: { top: 0, left: 0}} } if (e.isWindow(n)) { return { width: t.width(), height: t.height(), offset: { top: t.scrollTop(), left: t.scrollLeft()}} } if (n.preventDefault) { return { width: 0, height: 0, offset: { top: n.pageY, left: n.pageX}} } return { width: t.outerWidth(), height: t.outerHeight(), offset: t.offset()} } e.ui = e.ui || {}; var n, r = Math.max, i = Math.abs, s = Math.round, o = /left|center|right/, u = /top|center|bottom/, a = /[\+\-]\d+(\.[\d]+)?%?/, f = /^\w+/, l = /%$/, c = e.fn.position; e.position = { scrollbarWidth: function () { if (n !== t) { return n } var r, i, s = e("
"), o = s.children()[0]; e("body").append(s); r = o.offsetWidth; s.css("overflow", "scroll"); i = o.offsetWidth; if (r === i) { i = s[0].clientWidth } s.remove(); return n = r - i }, getScrollInfo: function (t) { var n = t.isWindow || t.isDocument ? "" : t.element.css("overflow-x"), r = t.isWindow || t.isDocument ? "" : t.element.css("overflow-y"), i = n === "scroll" || n === "auto" && t.width < t.element[0].scrollWidth, s = r === "scroll" || r === "auto" && t.height < t.element[0].scrollHeight; return { width: s ? e.position.scrollbarWidth() : 0, height: i ? e.position.scrollbarWidth() : 0} }, getWithinInfo: function (t) { var n = e(t || window), r = e.isWindow(n[0]), i = !!n[0] && n[0].nodeType === 9; return { element: n, isWindow: r, isDocument: i, offset: n.offset() || { left: 0, top: 0 }, scrollLeft: n.scrollLeft(), scrollTop: n.scrollTop(), width: r ? n.width() : n.outerWidth(), height: r ? n.height() : n.outerHeight()} } }; e.fn.position = function (t) { if (!t || !t.of) { return c.apply(this, arguments) } t = e.extend({}, t); var n, l, v, m, g, y, b = e(t.of), w = e.position.getWithinInfo(t.within), E = e.position.getScrollInfo(w), S = (t.collision || "flip").split(" "), x = {}; y = d(b); if (b[0].preventDefault) { t.at = "left top" } l = y.width; v = y.height; m = y.offset; g = e.extend({}, m); e.each(["my", "at"], function () { var e = (t[this] || "").split(" "), n, r; if (e.length === 1) { e = o.test(e[0]) ? e.concat(["center"]) : u.test(e[0]) ? ["center"].concat(e) : ["center", "center"] } e[0] = o.test(e[0]) ? e[0] : "center"; e[1] = u.test(e[1]) ? e[1] : "center"; n = a.exec(e[0]); r = a.exec(e[1]); x[this] = [n ? n[0] : 0, r ? r[0] : 0]; t[this] = [f.exec(e[0])[0], f.exec(e[1])[0]] }); if (S.length === 1) { S[1] = S[0] } if (t.at[0] === "right") { g.left += l } else if (t.at[0] === "center") { g.left += l / 2 } if (t.at[1] === "bottom") { g.top += v } else if (t.at[1] === "center") { g.top += v / 2 } n = h(x.at, l, v); g.left += n[0]; g.top += n[1]; return this.each(function () { var o, u, a = e(this), f = a.outerWidth(), c = a.outerHeight(), d = p(this, "marginLeft"), y = p(this, "marginTop"), T = f + d + p(this, "marginRight") + E.width, N = c + y + p(this, "marginBottom") + E.height, C = e.extend({}, g), k = h(x.my, a.outerWidth(), a.outerHeight()); if (t.my[0] === "right") { C.left -= f } else if (t.my[0] === "center") { C.left -= f / 2 } if (t.my[1] === "bottom") { C.top -= c } else if (t.my[1] === "center") { C.top -= c / 2 } C.left += k[0]; C.top += k[1]; if (!e.support.offsetFractions) { C.left = s(C.left); C.top = s(C.top) } o = { marginLeft: d, marginTop: y }; e.each(["left", "top"], function (r, i) { if (e.ui.position[S[r]]) { e.ui.position[S[r]][i](C, { targetWidth: l, targetHeight: v, elemWidth: f, elemHeight: c, collisionPosition: o, collisionWidth: T, collisionHeight: N, offset: [n[0] + k[0], n[1] + k[1]], my: t.my, at: t.at, within: w, elem: a }) } }); if (t.using) { u = function (e) { var n = m.left - C.left, s = n + l - f, o = m.top - C.top, u = o + v - c, h = { target: { element: b, left: m.left, top: m.top, width: l, height: v }, element: { element: a, left: C.left, top: C.top, width: f, height: c }, horizontal: s < 0 ? "left" : n > 0 ? "right" : "center", vertical: u < 0 ? "top" : o > 0 ? "bottom" : "middle" }; if (l < f && i(n + s) < l) { h.horizontal = "center" } if (v < c && i(o + u) < v) { h.vertical = "middle" } if (r(i(n), i(s)) > r(i(o), i(u))) { h.important = "horizontal" } else { h.important = "vertical" } t.using.call(this, e, h) } } a.offset(e.extend(C, { using: u })) }) }; e.ui.position = { fit: { left: function (e, t) { var n = t.within, i = n.isWindow ? n.scrollLeft : n.offset.left, s = n.width, o = e.left - t.collisionPosition.marginLeft, u = i - o, a = o + t.collisionWidth - s - i, f; if (t.collisionWidth > s) { if (u > 0 && a <= 0) { f = e.left + u + t.collisionWidth - s - i; e.left += u - f } else if (a > 0 && u <= 0) { e.left = i } else { if (u > a) { e.left = i + s - t.collisionWidth } else { e.left = i } } } else if (u > 0) { e.left += u } else if (a > 0) { e.left -= a } else { e.left = r(e.left - o, e.left) } }, top: function (e, t) { var n = t.within, i = n.isWindow ? n.scrollTop : n.offset.top, s = t.within.height, o = e.top - t.collisionPosition.marginTop, u = i - o, a = o + t.collisionHeight - s - i, f; if (t.collisionHeight > s) { if (u > 0 && a <= 0) { f = e.top + u + t.collisionHeight - s - i; e.top += u - f } else if (a > 0 && u <= 0) { e.top = i } else { if (u > a) { e.top = i + s - t.collisionHeight } else { e.top = i } } } else if (u > 0) { e.top += u } else if (a > 0) { e.top -= a } else { e.top = r(e.top - o, e.top) } } }, flip: { left: function (e, t) { var n = t.within, r = n.offset.left + n.scrollLeft, s = n.width, o = n.isWindow ? n.scrollLeft : n.offset.left, u = e.left - t.collisionPosition.marginLeft, a = u - o, f = u + t.collisionWidth - s - o, l = t.my[0] === "left" ? -t.elemWidth : t.my[0] === "right" ? t.elemWidth : 0, c = t.at[0] === "left" ? t.targetWidth : t.at[0] === "right" ? -t.targetWidth : 0, h = -2 * t.offset[0], p, d; if (a < 0) { p = e.left + l + c + h + t.collisionWidth - s - r; if (p < 0 || p < i(a)) { e.left += l + c + h } } else if (f > 0) { d = e.left - t.collisionPosition.marginLeft + l + c + h - o; if (d > 0 || i(d) < f) { e.left += l + c + h } } }, top: function (e, t) { var n = t.within, r = n.offset.top + n.scrollTop, s = n.height, o = n.isWindow ? n.scrollTop : n.offset.top, u = e.top - t.collisionPosition.marginTop, a = u - o, f = u + t.collisionHeight - s - o, l = t.my[1] === "top", c = l ? -t.elemHeight : t.my[1] === "bottom" ? t.elemHeight : 0, h = t.at[1] === "top" ? t.targetHeight : t.at[1] === "bottom" ? -t.targetHeight : 0, p = -2 * t.offset[1], d, v; if (a < 0) { v = e.top + c + h + p + t.collisionHeight - s - r; if (e.top + c + h + p > a && (v < 0 || v < i(a))) { e.top += c + h + p } } else if (f > 0) { d = e.top - t.collisionPosition.marginTop + c + h + p - o; if (e.top + c + h + p > f && (d > 0 || i(d) < f)) { e.top += c + h + p } } } }, flipfit: { left: function () { e.ui.position.flip.left.apply(this, arguments); e.ui.position.fit.left.apply(this, arguments) }, top: function () { e.ui.position.flip.top.apply(this, arguments); e.ui.position.fit.top.apply(this, arguments) } } }; (function () { var t, n, r, i, s, o = document.getElementsByTagName("body")[0], u = document.createElement("div"); t = document.createElement(o ? "div" : "body"); r = { visibility: "hidden", width: 0, height: 0, border: 0, margin: 0, background: "none" }; if (o) { e.extend(r, { position: "absolute", left: "-1000px", top: "-1000px" }) } for (s in r) { t.style[s] = r[s] } t.appendChild(u); n = o || document.documentElement; n.insertBefore(t, n.firstChild); u.style.cssText = "position: absolute; left: 10.7432222px;"; i = e(u).offset().left; e.support.offsetFractions = i > 10 && i < 11; t.innerHTML = ""; n.removeChild(t) })() })(jQuery); (function (e, t) { e.widget("ui.draggable", e.ui.mouse, { version: "1.10.4", widgetEventPrefix: "drag", options: { addClasses: true, appendTo: "parent", axis: false, connectToSortable: false, containment: false, cursor: "auto", cursorAt: false, grid: false, handle: false, helper: "original", iframeFix: false, opacity: false, refreshPositions: false, revert: false, revertDuration: 500, scope: "default", scroll: true, scrollSensitivity: 20, scrollSpeed: 20, snap: false, snapMode: "both", snapTolerance: 20, stack: false, zIndex: false, drag: null, start: null, stop: null }, _create: function () { if (this.options.helper === "original" && !/^(?:r|a|f)/.test(this.element.css("position"))) { this.element[0].style.position = "relative" } if (this.options.addClasses) { this.element.addClass("ui-draggable") } if (this.options.disabled) { this.element.addClass("ui-draggable-disabled") } this._mouseInit() }, _destroy: function () { this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"); this._mouseDestroy() }, _mouseCapture: function (t) { var n = this.options; if (this.helper || n.disabled || e(t.target).closest(".ui-resizable-handle").length > 0) { return false } this.handle = this._getHandle(t); if (!this.handle) { return false } e(n.iframeFix === true ? "iframe" : n.iframeFix).each(function () { e("
").css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1e3 }).css(e(this).offset()).appendTo("body") }); return true }, _mouseStart: function (t) { var n = this.options; this.helper = this._createHelper(t); this.helper.addClass("ui-draggable-dragging"); this._cacheHelperProportions(); if (e.ui.ddmanager) { e.ui.ddmanager.current = this } this._cacheMargins(); this.cssPosition = this.helper.css("position"); this.scrollParent = this.helper.scrollParent(); this.offsetParent = this.helper.offsetParent(); this.offsetParentCssPosition = this.offsetParent.css("position"); this.offset = this.positionAbs = this.element.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; this.offset.scroll = false; e.extend(this.offset, { click: { left: t.pageX - this.offset.left, top: t.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }); this.originalPosition = this.position = this._generatePosition(t); this.originalPageX = t.pageX; this.originalPageY = t.pageY; n.cursorAt && this._adjustOffsetFromHelper(n.cursorAt); this._setContainment(); if (this._trigger("start", t) === false) { this._clear(); return false } this._cacheHelperProportions(); if (e.ui.ddmanager && !n.dropBehaviour) { e.ui.ddmanager.prepareOffsets(this, t) } this._mouseDrag(t, true); if (e.ui.ddmanager) { e.ui.ddmanager.dragStart(this, t) } return true }, _mouseDrag: function (t, n) { if (this.offsetParentCssPosition === "fixed") { this.offset.parent = this._getParentOffset() } this.position = this._generatePosition(t); this.positionAbs = this._convertPositionTo("absolute"); if (!n) { var r = this._uiHash(); if (this._trigger("drag", t, r) === false) { this._mouseUp({}); return false } this.position = r.position } if (!this.options.axis || this.options.axis !== "y") { this.helper[0].style.left = this.position.left + "px" } if (!this.options.axis || this.options.axis !== "x") { this.helper[0].style.top = this.position.top + "px" } if (e.ui.ddmanager) { e.ui.ddmanager.drag(this, t) } return false }, _mouseStop: function (t) { var n = this, r = false; if (e.ui.ddmanager && !this.options.dropBehaviour) { r = e.ui.ddmanager.drop(this, t) } if (this.dropped) { r = this.dropped; this.dropped = false } if (this.options.helper === "original" && !e.contains(this.element[0].ownerDocument, this.element[0])) { return false } if (this.options.revert === "invalid" && !r || this.options.revert === "valid" && r || this.options.revert === true || e.isFunction(this.options.revert) && this.options.revert.call(this.element, r)) { e(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { if (n._trigger("stop", t) !== false) { n._clear() } }) } else { if (this._trigger("stop", t) !== false) { this._clear() } } return false }, _mouseUp: function (t) { e("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }); if (e.ui.ddmanager) { e.ui.ddmanager.dragStop(this, t) } return e.ui.mouse.prototype._mouseUp.call(this, t) }, cancel: function () { if (this.helper.is(".ui-draggable-dragging")) { this._mouseUp({}) } else { this._clear() } return this }, _getHandle: function (t) { return this.options.handle ? !!e(t.target).closest(this.element.find(this.options.handle)).length : true }, _createHelper: function (t) { var n = this.options, r = e.isFunction(n.helper) ? e(n.helper.apply(this.element[0], [t])) : n.helper === "clone" ? this.element.clone().removeAttr("id") : this.element; if (!r.parents("body").length) { r.appendTo(n.appendTo === "parent" ? this.element[0].parentNode : n.appendTo) } if (r[0] !== this.element[0] && !/(fixed|absolute)/.test(r.css("position"))) { r.css("position", "absolute") } return r }, _adjustOffsetFromHelper: function (t) { if (typeof t === "string") { t = t.split(" ") } if (e.isArray(t)) { t = { left: +t[0], top: +t[1] || 0} } if ("left" in t) { this.offset.click.left = t.left + this.margins.left } if ("right" in t) { this.offset.click.left = this.helperProportions.width - t.right + this.margins.left } if ("top" in t) { this.offset.click.top = t.top + this.margins.top } if ("bottom" in t) { this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top } }, _getParentOffset: function () { var t = this.offsetParent.offset(); if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0])) { t.left += this.scrollParent.scrollLeft(); t.top += this.scrollParent.scrollTop() } if (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && e.ui.ie) { t = { top: 0, left: 0} } return { top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} }, _getRelativeOffset: function () { if (this.cssPosition === "relative") { var e = this.element.position(); return { top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()} } else { return { top: 0, left: 0} } }, _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 t, n, r, i = this.options; if (!i.containment) { this.containment = null; return } if (i.containment === "window") { this.containment = [e(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, e(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, e(window).scrollLeft() + e(window).width() - this.helperProportions.width - this.margins.left, e(window).scrollTop() + (e(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]; return } if (i.containment === "document") { this.containment = [0, 0, e(document).width() - this.helperProportions.width - this.margins.left, (e(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]; return } if (i.containment.constructor === Array) { this.containment = i.containment; return } if (i.containment === "parent") { i.containment = this.helper[0].parentNode } n = e(i.containment); r = n[0]; if (!r) { return } t = n.css("overflow") !== "hidden"; this.containment = [(parseInt(n.css("borderLeftWidth"), 10) || 0) + (parseInt(n.css("paddingLeft"), 10) || 0), (parseInt(n.css("borderTopWidth"), 10) || 0) + (parseInt(n.css("paddingTop"), 10) || 0), (t ? Math.max(r.scrollWidth, r.offsetWidth) : r.offsetWidth) - (parseInt(n.css("borderRightWidth"), 10) || 0) - (parseInt(n.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (t ? Math.max(r.scrollHeight, r.offsetHeight) : r.offsetHeight) - (parseInt(n.css("borderBottomWidth"), 10) || 0) - (parseInt(n.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom]; this.relative_container = n }, _convertPositionTo: function (t, n) { if (!n) { n = this.position } var r = t === "absolute" ? 1 : -1, i = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent; if (!this.offset.scroll) { this.offset.scroll = { top: i.scrollTop(), left: i.scrollLeft()} } return { top: n.top + this.offset.relative.top * r + this.offset.parent.top * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top) * r, left: n.left + this.offset.relative.left * r + this.offset.parent.left * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left) * r} }, _generatePosition: function (t) { var n, r, i, s, o = this.options, u = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, a = t.pageX, f = t.pageY; if (!this.offset.scroll) { this.offset.scroll = { top: u.scrollTop(), left: u.scrollLeft()} } if (this.originalPosition) { if (this.containment) { if (this.relative_container) { r = this.relative_container.offset(); n = [this.containment[0] + r.left, this.containment[1] + r.top, this.containment[2] + r.left, this.containment[3] + r.top] } else { n = this.containment } if (t.pageX - this.offset.click.left < n[0]) { a = n[0] + this.offset.click.left } if (t.pageY - this.offset.click.top < n[1]) { f = n[1] + this.offset.click.top } if (t.pageX - this.offset.click.left > n[2]) { a = n[2] + this.offset.click.left } if (t.pageY - this.offset.click.top > n[3]) { f = n[3] + this.offset.click.top } } if (o.grid) { i = o.grid[1] ? this.originalPageY + Math.round((f - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; f = n ? i - this.offset.click.top >= n[1] || i - this.offset.click.top > n[3] ? i : i - this.offset.click.top >= n[1] ? i - o.grid[1] : i + o.grid[1] : i; s = o.grid[0] ? this.originalPageX + Math.round((a - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; a = n ? s - this.offset.click.left >= n[0] || s - this.offset.click.left > n[2] ? s : s - this.offset.click.left >= n[0] ? s - o.grid[0] : s + o.grid[0] : s } } return { top: f - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top), left: a - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left)} }, _clear: function () { this.helper.removeClass("ui-draggable-dragging"); if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) { this.helper.remove() } this.helper = null; this.cancelHelperRemoval = false }, _trigger: function (t, n, r) { r = r || this._uiHash(); e.ui.plugin.call(this, t, [n, r]); if (t === "drag") { this.positionAbs = this._convertPositionTo("absolute") } return e.Widget.prototype._trigger.call(this, t, n, r) }, plugins: {}, _uiHash: function () { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs} } }); e.ui.plugin.add("draggable", "connectToSortable", { start: function (t, n) { var r = e(this).data("ui-draggable"), i = r.options, s = e.extend({}, n, { item: r.element }); r.sortables = []; e(i.connectToSortable).each(function () { var n = e.data(this, "ui-sortable"); if (n && !n.options.disabled) { r.sortables.push({ instance: n, shouldRevert: n.options.revert }); n.refreshPositions(); n._trigger("activate", t, s) } }) }, stop: function (t, n) { var r = e(this).data("ui-draggable"), i = e.extend({}, n, { item: r.element }); e.each(r.sortables, function () { if (this.instance.isOver) { this.instance.isOver = 0; r.cancelHelperRemoval = true; this.instance.cancelHelperRemoval = false; if (this.shouldRevert) { this.instance.options.revert = this.shouldRevert } this.instance._mouseStop(t); this.instance.options.helper = this.instance.options._helper; if (r.options.helper === "original") { this.instance.currentItem.css({ top: "auto", left: "auto" }) } } else { this.instance.cancelHelperRemoval = false; this.instance._trigger("deactivate", t, i) } }) }, drag: function (t, n) { var r = e(this).data("ui-draggable"), i = this; e.each(r.sortables, function () { var s = false, o = this; this.instance.positionAbs = r.positionAbs; this.instance.helperProportions = r.helperProportions; this.instance.offset.click = r.offset.click; if (this.instance._intersectsWith(this.instance.containerCache)) { s = true; e.each(r.sortables, function () { this.instance.positionAbs = r.positionAbs; this.instance.helperProportions = r.helperProportions; this.instance.offset.click = r.offset.click; if (this !== o && this.instance._intersectsWith(this.instance.containerCache) && e.contains(o.instance.element[0], this.instance.element[0])) { s = false } return s }) } if (s) { if (!this.instance.isOver) { this.instance.isOver = 1; this.instance.currentItem = e(i).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", true); this.instance.options._helper = this.instance.options.helper; this.instance.options.helper = function () { return n.helper[0] }; t.target = this.instance.currentItem[0]; this.instance._mouseCapture(t, true); this.instance._mouseStart(t, true, true); this.instance.offset.click.top = r.offset.click.top; this.instance.offset.click.left = r.offset.click.left; this.instance.offset.parent.left -= r.offset.parent.left - this.instance.offset.parent.left; this.instance.offset.parent.top -= r.offset.parent.top - this.instance.offset.parent.top; r._trigger("toSortable", t); r.dropped = this.instance.element; r.currentItem = r.element; this.instance.fromOutside = r } if (this.instance.currentItem) { this.instance._mouseDrag(t) } } else { if (this.instance.isOver) { this.instance.isOver = 0; this.instance.cancelHelperRemoval = true; this.instance.options.revert = false; this.instance._trigger("out", t, this.instance._uiHash(this.instance)); this.instance._mouseStop(t, true); this.instance.options.helper = this.instance.options._helper; this.instance.currentItem.remove(); if (this.instance.placeholder) { this.instance.placeholder.remove() } r._trigger("fromSortable", t); r.dropped = false } } }) } }); e.ui.plugin.add("draggable", "cursor", { start: function () { var t = e("body"), n = e(this).data("ui-draggable").options; if (t.css("cursor")) { n._cursor = t.css("cursor") } t.css("cursor", n.cursor) }, stop: function () { var t = e(this).data("ui-draggable").options; if (t._cursor) { e("body").css("cursor", t._cursor) } } }); e.ui.plugin.add("draggable", "opacity", { start: function (t, n) { var r = e(n.helper), i = e(this).data("ui-draggable").options; if (r.css("opacity")) { i._opacity = r.css("opacity") } r.css("opacity", i.opacity) }, stop: function (t, n) { var r = e(this).data("ui-draggable").options; if (r._opacity) { e(n.helper).css("opacity", r._opacity) } } }); e.ui.plugin.add("draggable", "scroll", { start: function () { var t = e(this).data("ui-draggable"); if (t.scrollParent[0] !== document && t.scrollParent[0].tagName !== "HTML") { t.overflowOffset = t.scrollParent.offset() } }, drag: function (t) { var n = e(this).data("ui-draggable"), r = n.options, i = false; if (n.scrollParent[0] !== document && n.scrollParent[0].tagName !== "HTML") { if (!r.axis || r.axis !== "x") { if (n.overflowOffset.top + n.scrollParent[0].offsetHeight - t.pageY < r.scrollSensitivity) { n.scrollParent[0].scrollTop = i = n.scrollParent[0].scrollTop + r.scrollSpeed } else if (t.pageY - n.overflowOffset.top < r.scrollSensitivity) { n.scrollParent[0].scrollTop = i = n.scrollParent[0].scrollTop - r.scrollSpeed } } if (!r.axis || r.axis !== "y") { if (n.overflowOffset.left + n.scrollParent[0].offsetWidth - t.pageX < r.scrollSensitivity) { n.scrollParent[0].scrollLeft = i = n.scrollParent[0].scrollLeft + r.scrollSpeed } else if (t.pageX - n.overflowOffset.left < r.scrollSensitivity) { n.scrollParent[0].scrollLeft = i = n.scrollParent[0].scrollLeft - r.scrollSpeed } } } else { if (!r.axis || r.axis !== "x") { if (t.pageY - e(document).scrollTop() < r.scrollSensitivity) { i = e(document).scrollTop(e(document).scrollTop() - r.scrollSpeed) } else if (e(window).height() - (t.pageY - e(document).scrollTop()) < r.scrollSensitivity) { i = e(document).scrollTop(e(document).scrollTop() + r.scrollSpeed) } } if (!r.axis || r.axis !== "y") { if (t.pageX - e(document).scrollLeft() < r.scrollSensitivity) { i = e(document).scrollLeft(e(document).scrollLeft() - r.scrollSpeed) } else if (e(window).width() - (t.pageX - e(document).scrollLeft()) < r.scrollSensitivity) { i = e(document).scrollLeft(e(document).scrollLeft() + r.scrollSpeed) } } } if (i !== false && e.ui.ddmanager && !r.dropBehaviour) { e.ui.ddmanager.prepareOffsets(n, t) } } }); e.ui.plugin.add("draggable", "snap", { start: function () { var t = e(this).data("ui-draggable"), n = t.options; t.snapElements = []; e(n.snap.constructor !== String ? n.snap.items || ":data(ui-draggable)" : n.snap).each(function () { var n = e(this), r = n.offset(); if (this !== t.element[0]) { t.snapElements.push({ item: this, width: n.outerWidth(), height: n.outerHeight(), top: r.top, left: r.left }) } }) }, drag: function (t, n) { var r, i, s, o, u, a, f, l, c, h, p = e(this).data("ui-draggable"), d = p.options, v = d.snapTolerance, m = n.offset.left, g = m + p.helperProportions.width, y = n.offset.top, b = y + p.helperProportions.height; for (c = p.snapElements.length - 1; c >= 0; c--) { u = p.snapElements[c].left; a = u + p.snapElements[c].width; f = p.snapElements[c].top; l = f + p.snapElements[c].height; if (g < u - v || m > a + v || b < f - v || y > l + v || !e.contains(p.snapElements[c].item.ownerDocument, p.snapElements[c].item)) { if (p.snapElements[c].snapping) { p.options.snap.release && p.options.snap.release.call(p.element, t, e.extend(p._uiHash(), { snapItem: p.snapElements[c].item })) } p.snapElements[c].snapping = false; continue } if (d.snapMode !== "inner") { r = Math.abs(f - b) <= v; i = Math.abs(l - y) <= v; s = Math.abs(u - g) <= v; o = Math.abs(a - m) <= v; if (r) { n.position.top = p._convertPositionTo("relative", { top: f - p.helperProportions.height, left: 0 }).top - p.margins.top } if (i) { n.position.top = p._convertPositionTo("relative", { top: l, left: 0 }).top - p.margins.top } if (s) { n.position.left = p._convertPositionTo("relative", { top: 0, left: u - p.helperProportions.width }).left - p.margins.left } if (o) { n.position.left = p._convertPositionTo("relative", { top: 0, left: a }).left - p.margins.left } } h = r || i || s || o; if (d.snapMode !== "outer") { r = Math.abs(f - y) <= v; i = Math.abs(l - b) <= v; s = Math.abs(u - m) <= v; o = Math.abs(a - g) <= v; if (r) { n.position.top = p._convertPositionTo("relative", { top: f, left: 0 }).top - p.margins.top } if (i) { n.position.top = p._convertPositionTo("relative", { top: l - p.helperProportions.height, left: 0 }).top - p.margins.top } if (s) { n.position.left = p._convertPositionTo("relative", { top: 0, left: u }).left - p.margins.left } if (o) { n.position.left = p._convertPositionTo("relative", { top: 0, left: a - p.helperProportions.width }).left - p.margins.left } } if (!p.snapElements[c].snapping && (r || i || s || o || h)) { p.options.snap.snap && p.options.snap.snap.call(p.element, t, e.extend(p._uiHash(), { snapItem: p.snapElements[c].item })) } p.snapElements[c].snapping = r || i || s || o || h } } }); e.ui.plugin.add("draggable", "stack", { start: function () { var t, n = this.data("ui-draggable").options, r = e.makeArray(e(n.stack)).sort(function (t, n) { return (parseInt(e(t).css("zIndex"), 10) || 0) - (parseInt(e(n).css("zIndex"), 10) || 0) }); if (!r.length) { return } t = parseInt(e(r[0]).css("zIndex"), 10) || 0; e(r).each(function (n) { e(this).css("zIndex", t + n) }); this.css("zIndex", t + r.length) } }); e.ui.plugin.add("draggable", "zIndex", { start: function (t, n) { var r = e(n.helper), i = e(this).data("ui-draggable").options; if (r.css("zIndex")) { i._zIndex = r.css("zIndex") } r.css("zIndex", i.zIndex) }, stop: function (t, n) { var r = e(this).data("ui-draggable").options; if (r._zIndex) { e(n.helper).css("zIndex", r._zIndex) } } }) })(jQuery); (function (e, t) { function n(e, t, n) { return e > t && e < t + n } e.widget("ui.droppable", { version: "1.10.4", widgetEventPrefix: "drop", options: { accept: "*", activeClass: false, addClasses: true, greedy: false, hoverClass: false, scope: "default", tolerance: "intersect", activate: null, deactivate: null, drop: null, out: null, over: null }, _create: function () { var t, n = this.options, r = n.accept; this.isover = false; this.isout = true; this.accept = e.isFunction(r) ? r : function (e) { return e.is(r) }; this.proportions = function () { if (arguments.length) { t = arguments[0] } else { return t ? t : t = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight} } }; e.ui.ddmanager.droppables[n.scope] = e.ui.ddmanager.droppables[n.scope] || []; e.ui.ddmanager.droppables[n.scope].push(this); n.addClasses && this.element.addClass("ui-droppable") }, _destroy: function () { var t = 0, n = e.ui.ddmanager.droppables[this.options.scope]; for (; t < n.length; t++) { if (n[t] === this) { n.splice(t, 1) } } this.element.removeClass("ui-droppable ui-droppable-disabled") }, _setOption: function (t, n) { if (t === "accept") { this.accept = e.isFunction(n) ? n : function (e) { return e.is(n) } } e.Widget.prototype._setOption.apply(this, arguments) }, _activate: function (t) { var n = e.ui.ddmanager.current; if (this.options.activeClass) { this.element.addClass(this.options.activeClass) } if (n) { this._trigger("activate", t, this.ui(n)) } }, _deactivate: function (t) { var n = e.ui.ddmanager.current; if (this.options.activeClass) { this.element.removeClass(this.options.activeClass) } if (n) { this._trigger("deactivate", t, this.ui(n)) } }, _over: function (t) { var n = e.ui.ddmanager.current; if (!n || (n.currentItem || n.element)[0] === this.element[0]) { return } if (this.accept.call(this.element[0], n.currentItem || n.element)) { if (this.options.hoverClass) { this.element.addClass(this.options.hoverClass) } this._trigger("over", t, this.ui(n)) } }, _out: function (t) { var n = e.ui.ddmanager.current; if (!n || (n.currentItem || n.element)[0] === this.element[0]) { return } if (this.accept.call(this.element[0], n.currentItem || n.element)) { if (this.options.hoverClass) { this.element.removeClass(this.options.hoverClass) } this._trigger("out", t, this.ui(n)) } }, _drop: function (t, n) { var r = n || e.ui.ddmanager.current, i = false; if (!r || (r.currentItem || r.element)[0] === this.element[0]) { return false } this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function () { var t = e.data(this, "ui-droppable"); if (t.options.greedy && !t.options.disabled && t.options.scope === r.options.scope && t.accept.call(t.element[0], r.currentItem || r.element) && e.ui.intersect(r, e.extend(t, { offset: t.element.offset() }), t.options.tolerance)) { i = true; return false } }); if (i) { return false } if (this.accept.call(this.element[0], r.currentItem || r.element)) { if (this.options.activeClass) { this.element.removeClass(this.options.activeClass) } if (this.options.hoverClass) { this.element.removeClass(this.options.hoverClass) } this._trigger("drop", t, this.ui(r)); return this.element } return false }, ui: function (e) { return { draggable: e.currentItem || e.element, helper: e.helper, position: e.position, offset: e.positionAbs} } }); e.ui.intersect = function (e, t, r) { if (!t.offset) { return false } var i, s, o = (e.positionAbs || e.position.absolute).left, u = (e.positionAbs || e.position.absolute).top, a = o + e.helperProportions.width, f = u + e.helperProportions.height, l = t.offset.left, c = t.offset.top, h = l + t.proportions().width, p = c + t.proportions().height; switch (r) { case "fit": return l <= o && a <= h && c <= u && f <= p; case "intersect": return l < o + e.helperProportions.width / 2 && a - e.helperProportions.width / 2 < h && c < u + e.helperProportions.height / 2 && f - e.helperProportions.height / 2 < p; case "pointer": i = (e.positionAbs || e.position.absolute).left + (e.clickOffset || e.offset.click).left; s = (e.positionAbs || e.position.absolute).top + (e.clickOffset || e.offset.click).top; return n(s, c, t.proportions().height) && n(i, l, t.proportions().width); case "touch": return (u >= c && u <= p || f >= c && f <= p || u < c && f > p) && (o >= l && o <= h || a >= l && a <= h || o < l && a > h); default: return false } }; e.ui.ddmanager = { current: null, droppables: { "default": [] }, prepareOffsets: function (t, n) { var r, i, s = e.ui.ddmanager.droppables[t.options.scope] || [], o = n ? n.type : null, u = (t.currentItem || t.element).find(":data(ui-droppable)").addBack(); e: for (r = 0; r < s.length; r++) { if (s[r].options.disabled || t && !s[r].accept.call(s[r].element[0], t.currentItem || t.element)) { continue } for (i = 0; i < u.length; i++) { if (u[i] === s[r].element[0]) { s[r].proportions().height = 0; continue e } } s[r].visible = s[r].element.css("display") !== "none"; if (!s[r].visible) { continue } if (o === "mousedown") { s[r]._activate.call(s[r], n) } s[r].offset = s[r].element.offset(); s[r].proportions({ width: s[r].element[0].offsetWidth, height: s[r].element[0].offsetHeight }) } }, drop: function (t, n) { var r = false; e.each((e.ui.ddmanager.droppables[t.options.scope] || []).slice(), function () { if (!this.options) { return } if (!this.options.disabled && this.visible && e.ui.intersect(t, this, this.options.tolerance)) { r = this._drop.call(this, n) || r } if (!this.options.disabled && this.visible && this.accept.call(this.element[0], t.currentItem || t.element)) { this.isout = true; this.isover = false; this._deactivate.call(this, n) } }); return r }, dragStart: function (t, n) { t.element.parentsUntil("body").bind("scroll.droppable", function () { if (!t.options.refreshPositions) { e.ui.ddmanager.prepareOffsets(t, n) } }) }, drag: function (t, n) { if (t.options.refreshPositions) { e.ui.ddmanager.prepareOffsets(t, n) } e.each(e.ui.ddmanager.droppables[t.options.scope] || [], function () { if (this.options.disabled || this.greedyChild || !this.visible) { return } var r, i, s, o = e.ui.intersect(t, this, this.options.tolerance), u = !o && this.isover ? "isout" : o && !this.isover ? "isover" : null; if (!u) { return } if (this.options.greedy) { i = this.options.scope; s = this.element.parents(":data(ui-droppable)").filter(function () { return e.data(this, "ui-droppable").options.scope === i }); if (s.length) { r = e.data(s[0], "ui-droppable"); r.greedyChild = u === "isover" } } if (r && u === "isover") { r.isover = false; r.isout = true; r._out.call(r, n) } this[u] = true; this[u === "isout" ? "isover" : "isout"] = false; this[u === "isover" ? "_over" : "_out"].call(this, n); if (r && u === "isout") { r.isout = false; r.isover = true; r._over.call(r, n) } }) }, dragStop: function (t, n) { t.element.parentsUntil("body").unbind("scroll.droppable"); if (!t.options.refreshPositions) { e.ui.ddmanager.prepareOffsets(t, n) } } } })(jQuery); (function (e, t) { function n(e) { return parseInt(e, 10) || 0 } function r(e) { return !isNaN(parseInt(e, 10)) } e.widget("ui.resizable", e.ui.mouse, { version: "1.10.4", widgetEventPrefix: "resize", options: { alsoResize: false, animate: false, animateDuration: "slow", animateEasing: "swing", aspectRatio: false, autoHide: false, containment: false, ghost: false, grid: false, handles: "e,s,se", helper: false, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, zIndex: 90, resize: null, start: null, stop: null }, _create: function () { var t, n, r, i, s, o = this, u = this.options; this.element.addClass("ui-resizable"); e.extend(this, { _aspectRatio: !!u.aspectRatio, aspectRatio: u.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: u.helper || u.ghost || u.animate ? u.helper || "ui-resizable-helper" : null }); if (this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { this.element.wrap(e("
").css({ position: this.element.css("position"), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css("top"), left: this.element.css("left") })); this.element = this.element.parent().data("ui-resizable", this.element.data("ui-resizable")); this.elementIsWrapper = true; this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0 }); this.originalResizeStyle = this.originalElement.css("resize"); this.originalElement.css("resize", "none"); this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" })); this.originalElement.css({ margin: this.originalElement.css("margin") }); this._proportionallyResize() } this.handles = u.handles || (!e(".ui-resizable-handle", this.element).length ? "e,s,se" : { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw" }); if (this.handles.constructor === String) { if (this.handles === "all") { this.handles = "n,e,s,w,se,sw,ne,nw" } t = this.handles.split(","); this.handles = {}; for (n = 0; n < t.length; n++) { r = e.trim(t[n]); s = "ui-resizable-" + r; i = e("
"); i.css({ zIndex: u.zIndex }); if ("se" === r) { i.addClass("ui-icon ui-icon-gripsmall-diagonal-se") } this.handles[r] = ".ui-resizable-" + r; this.element.append(i) } } this._renderAxis = function (t) { var n, r, i, s; t = t || this.element; for (n in this.handles) { if (this.handles[n].constructor === String) { this.handles[n] = e(this.handles[n], this.element).show() } if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { r = e(this.handles[n], this.element); s = /sw|ne|nw|se|n|s/.test(n) ? r.outerHeight() : r.outerWidth(); i = ["padding", /ne|nw|n/.test(n) ? "Top" : /se|sw|s/.test(n) ? "Bottom" : /^e$/.test(n) ? "Right" : "Left"].join(""); t.css(i, s); this._proportionallyResize() } if (!e(this.handles[n]).length) { continue } } }; this._renderAxis(this.element); this._handles = e(".ui-resizable-handle", this.element).disableSelection(); this._handles.mouseover(function () { if (!o.resizing) { if (this.className) { i = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i) } o.axis = i && i[1] ? i[1] : "se" } }); if (u.autoHide) { this._handles.hide(); e(this.element).addClass("ui-resizable-autohide").mouseenter(function () { if (u.disabled) { return } e(this).removeClass("ui-resizable-autohide"); o._handles.show() }).mouseleave(function () { if (u.disabled) { return } if (!o.resizing) { e(this).addClass("ui-resizable-autohide"); o._handles.hide() } }) } this._mouseInit() }, _destroy: function () { this._mouseDestroy(); var t, n = function (t) { e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove() }; if (this.elementIsWrapper) { n(this.element); t = this.element; this.originalElement.css({ position: t.css("position"), width: t.outerWidth(), height: t.outerHeight(), top: t.css("top"), left: t.css("left") }).insertAfter(t); t.remove() } this.originalElement.css("resize", this.originalResizeStyle); n(this.originalElement); return this }, _mouseCapture: function (t) { var n, r, i = false; for (n in this.handles) { r = e(this.handles[n])[0]; if (r === t.target || e.contains(r, t.target)) { i = true } } return !this.options.disabled && i }, _mouseStart: function (t) { var r, i, s, o = this.options, u = this.element.position(), a = this.element; this.resizing = true; if (/absolute/.test(a.css("position"))) { a.css({ position: "absolute", top: a.css("top"), left: a.css("left") }) } else if (a.is(".ui-draggable")) { a.css({ position: "absolute", top: u.top, left: u.left }) } this._renderProxy(); r = n(this.helper.css("left")); i = n(this.helper.css("top")); if (o.containment) { r += e(o.containment).scrollLeft() || 0; i += e(o.containment).scrollTop() || 0 } this.offset = this.helper.offset(); this.position = { left: r, top: i }; this.size = this._helper ? { width: this.helper.width(), height: this.helper.height()} : { width: a.width(), height: a.height() }; this.originalSize = this._helper ? { width: a.outerWidth(), height: a.outerHeight()} : { width: a.width(), height: a.height() }; this.originalPosition = { left: r, top: i }; this.sizeDiff = { width: a.outerWidth() - a.width(), height: a.outerHeight() - a.height() }; this.originalMousePosition = { left: t.pageX, top: t.pageY }; this.aspectRatio = typeof o.aspectRatio === "number" ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1; s = e(".ui-resizable-" + this.axis).css("cursor"); e("body").css("cursor", s === "auto" ? this.axis + "-resize" : s); a.addClass("ui-resizable-resizing"); this._propagate("start", t); return true }, _mouseDrag: function (t) { var n, r = this.helper, i = {}, s = this.originalMousePosition, o = this.axis, u = this.position.top, a = this.position.left, f = this.size.width, l = this.size.height, c = t.pageX - s.left || 0, h = t.pageY - s.top || 0, p = this._change[o]; if (!p) { return false } n = p.apply(this, [t, c, h]); this._updateVirtualBoundaries(t.shiftKey); if (this._aspectRatio || t.shiftKey) { n = this._updateRatio(n, t) } n = this._respectSize(n, t); this._updateCache(n); this._propagate("resize", t); if (this.position.top !== u) { i.top = this.position.top + "px" } if (this.position.left !== a) { i.left = this.position.left + "px" } if (this.size.width !== f) { i.width = this.size.width + "px" } if (this.size.height !== l) { i.height = this.size.height + "px" } r.css(i); if (!this._helper && this._proportionallyResizeElements.length) { this._proportionallyResize() } if (!e.isEmptyObject(i)) { this._trigger("resize", t, this.ui()) } return false }, _mouseStop: function (t) { this.resizing = false; var n, r, i, s, o, u, a, f = this.options, l = this; if (this._helper) { n = this._proportionallyResizeElements; r = n.length && /textarea/i.test(n[0].nodeName); i = r && e.ui.hasScroll(n[0], "left") ? 0 : l.sizeDiff.height; s = r ? 0 : l.sizeDiff.width; o = { width: l.helper.width() - s, height: l.helper.height() - i }; u = parseInt(l.element.css("left"), 10) + (l.position.left - l.originalPosition.left) || null; a = parseInt(l.element.css("top"), 10) + (l.position.top - l.originalPosition.top) || null; if (!f.animate) { this.element.css(e.extend(o, { top: a, left: u })) } l.helper.height(l.size.height); l.helper.width(l.size.width); if (this._helper && !f.animate) { this._proportionallyResize() } } e("body").css("cursor", "auto"); this.element.removeClass("ui-resizable-resizing"); this._propagate("stop", t); if (this._helper) { this.helper.remove() } return false }, _updateVirtualBoundaries: function (e) { var t, n, i, s, o, u = this.options; o = { minWidth: r(u.minWidth) ? u.minWidth : 0, maxWidth: r(u.maxWidth) ? u.maxWidth : Infinity, minHeight: r(u.minHeight) ? u.minHeight : 0, maxHeight: r(u.maxHeight) ? u.maxHeight : Infinity }; if (this._aspectRatio || e) { t = o.minHeight * this.aspectRatio; i = o.minWidth / this.aspectRatio; n = o.maxHeight * this.aspectRatio; s = o.maxWidth / this.aspectRatio; if (t > o.minWidth) { o.minWidth = t } if (i > o.minHeight) { o.minHeight = i } if (n < o.maxWidth) { o.maxWidth = n } if (s < o.maxHeight) { o.maxHeight = s } } this._vBoundaries = o }, _updateCache: function (e) { this.offset = this.helper.offset(); if (r(e.left)) { this.position.left = e.left } if (r(e.top)) { this.position.top = e.top } if (r(e.height)) { this.size.height = e.height } if (r(e.width)) { this.size.width = e.width } }, _updateRatio: function (e) { var t = this.position, n = this.size, i = this.axis; if (r(e.height)) { e.width = e.height * this.aspectRatio } else if (r(e.width)) { e.height = e.width / this.aspectRatio } if (i === "sw") { e.left = t.left + (n.width - e.width); e.top = null } if (i === "nw") { e.top = t.top + (n.height - e.height); e.left = t.left + (n.width - e.width) } return e }, _respectSize: function (e) { var t = this._vBoundaries, n = this.axis, i = r(e.width) && t.maxWidth && t.maxWidth < e.width, s = r(e.height) && t.maxHeight && t.maxHeight < e.height, o = r(e.width) && t.minWidth && t.minWidth > e.width, u = r(e.height) && t.minHeight && t.minHeight > e.height, a = this.originalPosition.left + this.originalSize.width, f = this.position.top + this.size.height, l = /sw|nw|w/.test(n), c = /nw|ne|n/.test(n); if (o) { e.width = t.minWidth } if (u) { e.height = t.minHeight } if (i) { e.width = t.maxWidth } if (s) { e.height = t.maxHeight } if (o && l) { e.left = a - t.minWidth } if (i && l) { e.left = a - t.maxWidth } if (u && c) { e.top = f - t.minHeight } if (s && c) { e.top = f - t.maxHeight } if (!e.width && !e.height && !e.left && e.top) { e.top = null } else if (!e.width && !e.height && !e.top && e.left) { e.left = null } return e }, _proportionallyResize: function () { if (!this._proportionallyResizeElements.length) { return } var e, t, n, r, i, s = this.helper || this.element; for (e = 0; e < this._proportionallyResizeElements.length; e++) { i = this._proportionallyResizeElements[e]; if (!this.borderDif) { this.borderDif = []; n = [i.css("borderTopWidth"), i.css("borderRightWidth"), i.css("borderBottomWidth"), i.css("borderLeftWidth")]; r = [i.css("paddingTop"), i.css("paddingRight"), i.css("paddingBottom"), i.css("paddingLeft")]; for (t = 0; t < n.length; t++) { this.borderDif[t] = (parseInt(n[t], 10) || 0) + (parseInt(r[t], 10) || 0) } } i.css({ height: s.height() - this.borderDif[0] - this.borderDif[2] || 0, width: s.width() - this.borderDif[1] - this.borderDif[3] || 0 }) } }, _renderProxy: function () { var t = this.element, n = this.options; this.elementOffset = t.offset(); if (this._helper) { this.helper = this.helper || e("
"); this.helper.addClass(this._helper).css({ width: this.element.outerWidth() - 1, height: this.element.outerHeight() - 1, position: "absolute", left: this.elementOffset.left + "px", top: this.elementOffset.top + "px", zIndex: ++n.zIndex }); this.helper.appendTo("body").disableSelection() } else { this.helper = this.element } }, _change: { e: function (e, t) { return { width: this.originalSize.width + t} }, w: function (e, t) { var n = this.originalSize, r = this.originalPosition; return { left: r.left + t, width: n.width - t} }, n: function (e, t, n) { var r = this.originalSize, i = this.originalPosition; return { top: i.top + n, height: r.height - n} }, s: function (e, t, n) { return { height: this.originalSize.height + n} }, se: function (t, n, r) { return e.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [t, n, r])) }, sw: function (t, n, r) { return e.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [t, n, r])) }, ne: function (t, n, r) { return e.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [t, n, r])) }, nw: function (t, n, r) { return e.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [t, n, r])) } }, _propagate: function (t, n) { e.ui.plugin.call(this, t, [n, this.ui()]); t !== "resize" && this._trigger(t, n, this.ui()) }, plugins: {}, ui: function () { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition} } }); e.ui.plugin.add("resizable", "animate", { stop: function (t) { var n = e(this).data("ui-resizable"), r = n.options, i = n._proportionallyResizeElements, s = i.length && /textarea/i.test(i[0].nodeName), o = s && e.ui.hasScroll(i[0], "left") ? 0 : n.sizeDiff.height, u = s ? 0 : n.sizeDiff.width, a = { width: n.size.width - u, height: n.size.height - o }, f = parseInt(n.element.css("left"), 10) + (n.position.left - n.originalPosition.left) || null, l = parseInt(n.element.css("top"), 10) + (n.position.top - n.originalPosition.top) || null; n.element.animate(e.extend(a, l && f ? { top: l, left: f} : {}), { duration: r.animateDuration, easing: r.animateEasing, step: function () { var r = { width: parseInt(n.element.css("width"), 10), height: parseInt(n.element.css("height"), 10), top: parseInt(n.element.css("top"), 10), left: parseInt(n.element.css("left"), 10) }; if (i && i.length) { e(i[0]).css({ width: r.width, height: r.height }) } n._updateCache(r); n._propagate("resize", t) } }) } }); e.ui.plugin.add("resizable", "containment", { start: function () { var t, r, i, s, o, u, a, f = e(this).data("ui-resizable"), l = f.options, c = f.element, h = l.containment, p = h instanceof e ? h.get(0) : /parent/.test(h) ? c.parent().get(0) : h; if (!p) { return } f.containerElement = e(p); if (/document/.test(h) || h === document) { f.containerOffset = { left: 0, top: 0 }; f.containerPosition = { left: 0, top: 0 }; f.parentData = { element: e(document), left: 0, top: 0, width: e(document).width(), height: e(document).height() || document.body.parentNode.scrollHeight} } else { t = e(p); r = []; e(["Top", "Right", "Left", "Bottom"]).each(function (e, i) { r[e] = n(t.css("padding" + i)) }); f.containerOffset = t.offset(); f.containerPosition = t.position(); f.containerSize = { height: t.innerHeight() - r[3], width: t.innerWidth() - r[1] }; i = f.containerOffset; s = f.containerSize.height; o = f.containerSize.width; u = e.ui.hasScroll(p, "left") ? p.scrollWidth : o; a = e.ui.hasScroll(p) ? p.scrollHeight : s; f.parentData = { element: p, left: i.left, top: i.top, width: u, height: a} } }, resize: function (t) { var n, r, i, s, o = e(this).data("ui-resizable"), u = o.options, a = o.containerOffset, f = o.position, l = o._aspectRatio || t.shiftKey, c = { top: 0, left: 0 }, h = o.containerElement; if (h[0] !== document && /static/.test(h.css("position"))) { c = a } if (f.left < (o._helper ? a.left : 0)) { o.size.width = o.size.width + (o._helper ? o.position.left - a.left : o.position.left - c.left); if (l) { o.size.height = o.size.width / o.aspectRatio } o.position.left = u.helper ? a.left : 0 } if (f.top < (o._helper ? a.top : 0)) { o.size.height = o.size.height + (o._helper ? o.position.top - a.top : o.position.top); if (l) { o.size.width = o.size.height * o.aspectRatio } o.position.top = o._helper ? a.top : 0 } o.offset.left = o.parentData.left + o.position.left; o.offset.top = o.parentData.top + o.position.top; n = Math.abs((o._helper ? o.offset.left - c.left : o.offset.left - c.left) + o.sizeDiff.width); r = Math.abs((o._helper ? o.offset.top - c.top : o.offset.top - a.top) + o.sizeDiff.height); i = o.containerElement.get(0) === o.element.parent().get(0); s = /relative|absolute/.test(o.containerElement.css("position")); if (i && s) { n -= Math.abs(o.parentData.left) } if (n + o.size.width >= o.parentData.width) { o.size.width = o.parentData.width - n; if (l) { o.size.height = o.size.width / o.aspectRatio } } if (r + o.size.height >= o.parentData.height) { o.size.height = o.parentData.height - r; if (l) { o.size.width = o.size.height * o.aspectRatio } } }, stop: function () { var t = e(this).data("ui-resizable"), n = t.options, r = t.containerOffset, i = t.containerPosition, s = t.containerElement, o = e(t.helper), u = o.offset(), a = o.outerWidth() - t.sizeDiff.width, f = o.outerHeight() - t.sizeDiff.height; if (t._helper && !n.animate && /relative/.test(s.css("position"))) { e(this).css({ left: u.left - i.left - r.left, width: a, height: f }) } if (t._helper && !n.animate && /static/.test(s.css("position"))) { e(this).css({ left: u.left - i.left - r.left, width: a, height: f }) } } }); e.ui.plugin.add("resizable", "alsoResize", { start: function () { var t = e(this).data("ui-resizable"), n = t.options, r = function (t) { e(t).each(function () { var t = e(this); t.data("ui-resizable-alsoresize", { width: parseInt(t.width(), 10), height: parseInt(t.height(), 10), left: parseInt(t.css("left"), 10), top: parseInt(t.css("top"), 10) }) }) }; if (typeof n.alsoResize === "object" && !n.alsoResize.parentNode) { if (n.alsoResize.length) { n.alsoResize = n.alsoResize[0]; r(n.alsoResize) } else { e.each(n.alsoResize, function (e) { r(e) }) } } else { r(n.alsoResize) } }, resize: function (t, n) { var r = e(this).data("ui-resizable"), i = r.options, s = r.originalSize, o = r.originalPosition, u = { height: r.size.height - s.height || 0, width: r.size.width - s.width || 0, top: r.position.top - o.top || 0, left: r.position.left - o.left || 0 }, a = function (t, r) { e(t).each(function () { var t = e(this), i = e(this).data("ui-resizable-alsoresize"), s = {}, o = r && r.length ? r : t.parents(n.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; e.each(o, function (e, t) { var n = (i[t] || 0) + (u[t] || 0); if (n && n >= 0) { s[t] = n || null } }); t.css(s) }) }; if (typeof i.alsoResize === "object" && !i.alsoResize.nodeType) { e.each(i.alsoResize, function (e, t) { a(e, t) }) } else { a(i.alsoResize) } }, stop: function () { e(this).removeData("resizable-alsoresize") } }); e.ui.plugin.add("resizable", "ghost", { start: function () { var t = e(this).data("ui-resizable"), n = t.options, r = t.size; t.ghost = t.originalElement.clone(); t.ghost.css({ opacity: .25, display: "block", position: "relative", height: r.height, width: r.width, margin: 0, left: 0, top: 0 }).addClass("ui-resizable-ghost").addClass(typeof n.ghost === "string" ? n.ghost : ""); t.ghost.appendTo(t.helper) }, resize: function () { var t = e(this).data("ui-resizable"); if (t.ghost) { t.ghost.css({ position: "relative", height: t.size.height, width: t.size.width }) } }, stop: function () { var t = e(this).data("ui-resizable"); if (t.ghost && t.helper) { t.helper.get(0).removeChild(t.ghost.get(0)) } } }); e.ui.plugin.add("resizable", "grid", { resize: function () { var t = e(this).data("ui-resizable"), n = t.options, r = t.size, i = t.originalSize, s = t.originalPosition, o = t.axis, u = typeof n.grid === "number" ? [n.grid, n.grid] : n.grid, a = u[0] || 1, f = u[1] || 1, l = Math.round((r.width - i.width) / a) * a, c = Math.round((r.height - i.height) / f) * f, h = i.width + l, p = i.height + c, d = n.maxWidth && n.maxWidth < h, v = n.maxHeight && n.maxHeight < p, m = n.minWidth && n.minWidth > h, g = n.minHeight && n.minHeight > p; n.grid = u; if (m) { h = h + a } if (g) { p = p + f } if (d) { h = h - a } if (v) { p = p - f } if (/^(se|s|e)$/.test(o)) { t.size.width = h; t.size.height = p } else if (/^(ne)$/.test(o)) { t.size.width = h; t.size.height = p; t.position.top = s.top - c } else if (/^(sw)$/.test(o)) { t.size.width = h; t.size.height = p; t.position.left = s.left - l } else { if (p - f > 0) { t.size.height = p; t.position.top = s.top - c } else { t.size.height = f; t.position.top = s.top + i.height - f } if (h - a > 0) { t.size.width = h; t.position.left = s.left - l } else { t.size.width = a; t.position.left = s.left + i.width - a } } } }) })(jQuery); (function (e, t) { e.widget("ui.selectable", e.ui.mouse, { version: "1.10.4", options: { appendTo: "body", autoRefresh: true, distance: 0, filter: "*", tolerance: "touch", selected: null, selecting: null, start: null, stop: null, unselected: null, unselecting: null }, _create: function () { var t, n = this; this.element.addClass("ui-selectable"); this.dragged = false; this.refresh = function () { t = e(n.options.filter, n.element[0]); t.addClass("ui-selectee"); t.each(function () { var t = e(this), n = t.offset(); e.data(this, "selectable-item", { element: this, $element: t, left: n.left, top: n.top, right: n.left + t.outerWidth(), bottom: n.top + t.outerHeight(), startselected: false, selected: t.hasClass("ui-selected"), selecting: t.hasClass("ui-selecting"), unselecting: t.hasClass("ui-unselecting") }) }) }; this.refresh(); this.selectees = t.addClass("ui-selectee"); this._mouseInit(); this.helper = e("
") }, _destroy: function () { this.selectees.removeClass("ui-selectee").removeData("selectable-item"); this.element.removeClass("ui-selectable ui-selectable-disabled"); this._mouseDestroy() }, _mouseStart: function (t) { var n = this, r = this.options; this.opos = [t.pageX, t.pageY]; if (this.options.disabled) { return } this.selectees = e(r.filter, this.element[0]); this._trigger("start", t); e(r.appendTo).append(this.helper); this.helper.css({ left: t.pageX, top: t.pageY, width: 0, height: 0 }); if (r.autoRefresh) { this.refresh() } this.selectees.filter(".ui-selected").each(function () { var r = e.data(this, "selectable-item"); r.startselected = true; if (!t.metaKey && !t.ctrlKey) { r.$element.removeClass("ui-selected"); r.selected = false; r.$element.addClass("ui-unselecting"); r.unselecting = true; n._trigger("unselecting", t, { unselecting: r.element }) } }); e(t.target).parents().addBack().each(function () { var r, i = e.data(this, "selectable-item"); if (i) { r = !t.metaKey && !t.ctrlKey || !i.$element.hasClass("ui-selected"); i.$element.removeClass(r ? "ui-unselecting" : "ui-selected").addClass(r ? "ui-selecting" : "ui-unselecting"); i.unselecting = !r; i.selecting = r; i.selected = r; if (r) { n._trigger("selecting", t, { selecting: i.element }) } else { n._trigger("unselecting", t, { unselecting: i.element }) } return false } }) }, _mouseDrag: function (t) { this.dragged = true; if (this.options.disabled) { return } var n, r = this, i = this.options, s = this.opos[0], o = this.opos[1], u = t.pageX, a = t.pageY; if (s > u) { n = u; u = s; s = n } if (o > a) { n = a; a = o; o = n } this.helper.css({ left: s, top: o, width: u - s, height: a - o }); this.selectees.each(function () { var n = e.data(this, "selectable-item"), f = false; if (!n || n.element === r.element[0]) { return } if (i.tolerance === "touch") { f = !(n.left > u || n.right < s || n.top > a || n.bottom < o) } else if (i.tolerance === "fit") { f = n.left > s && n.right < u && n.top > o && n.bottom < a } if (f) { if (n.selected) { n.$element.removeClass("ui-selected"); n.selected = false } if (n.unselecting) { n.$element.removeClass("ui-unselecting"); n.unselecting = false } if (!n.selecting) { n.$element.addClass("ui-selecting"); n.selecting = true; r._trigger("selecting", t, { selecting: n.element }) } } else { if (n.selecting) { if ((t.metaKey || t.ctrlKey) && n.startselected) { n.$element.removeClass("ui-selecting"); n.selecting = false; n.$element.addClass("ui-selected"); n.selected = true } else { n.$element.removeClass("ui-selecting"); n.selecting = false; if (n.startselected) { n.$element.addClass("ui-unselecting"); n.unselecting = true } r._trigger("unselecting", t, { unselecting: n.element }) } } if (n.selected) { if (!t.metaKey && !t.ctrlKey && !n.startselected) { n.$element.removeClass("ui-selected"); n.selected = false; n.$element.addClass("ui-unselecting"); n.unselecting = true; r._trigger("unselecting", t, { unselecting: n.element }) } } } }); return false }, _mouseStop: function (t) { var n = this; this.dragged = false; e(".ui-unselecting", this.element[0]).each(function () { var r = e.data(this, "selectable-item"); r.$element.removeClass("ui-unselecting"); r.unselecting = false; r.startselected = false; n._trigger("unselected", t, { unselected: r.element }) }); e(".ui-selecting", this.element[0]).each(function () { var r = e.data(this, "selectable-item"); r.$element.removeClass("ui-selecting").addClass("ui-selected"); r.selecting = false; r.selected = true; r.startselected = true; n._trigger("selected", t, { selected: r.element }) }); this._trigger("stop", t); this.helper.remove(); return false } }) })(jQuery); (function (e, t) { function n(e, t, n) { return e > t && e < t + n } function r(e) { return /left|right/.test(e.css("float")) || /inline|table-cell/.test(e.css("display")) } e.widget("ui.sortable", e.ui.mouse, { version: "1.10.4", widgetEventPrefix: "sort", ready: false, options: { appendTo: "parent", axis: false, connectWith: false, containment: false, cursor: "auto", cursorAt: false, dropOnEmpty: true, forcePlaceholderSize: false, forceHelperSize: false, grid: false, handle: false, helper: "original", items: "> *", opacity: false, placeholder: false, revert: false, scroll: true, scrollSensitivity: 20, scrollSpeed: 20, scope: "default", tolerance: "intersect", zIndex: 1e3, activate: null, beforeStop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null }, _create: function () { var e = this.options; this.containerCache = {}; this.element.addClass("ui-sortable"); this.refresh(); this.floating = this.items.length ? e.axis === "x" || r(this.items[0].item) : false; this.offset = this.element.offset(); this._mouseInit(); this.ready = true }, _destroy: function () { this.element.removeClass("ui-sortable ui-sortable-disabled"); this._mouseDestroy(); for (var e = this.items.length - 1; e >= 0; e--) { this.items[e].item.removeData(this.widgetName + "-item") } return this }, _setOption: function (t, n) { if (t === "disabled") { this.options[t] = n; this.widget().toggleClass("ui-sortable-disabled", !!n) } else { e.Widget.prototype._setOption.apply(this, arguments) } }, _mouseCapture: function (t, n) { var r = null, i = false, s = this; if (this.reverting) { return false } if (this.options.disabled || this.options.type === "static") { return false } this._refreshItems(t); e(t.target).parents().each(function () { if (e.data(this, s.widgetName + "-item") === s) { r = e(this); return false } }); if (e.data(t.target, s.widgetName + "-item") === s) { r = e(t.target) } if (!r) { return false } if (this.options.handle && !n) { e(this.options.handle, r).find("*").addBack().each(function () { if (this === t.target) { i = true } }); if (!i) { return false } } this.currentItem = r; this._removeCurrentsFromItems(); return true }, _mouseStart: function (t, n, r) { var i, s, o = this.options; this.currentContainer = this; this.refreshPositions(); this.helper = this._createHelper(t); this._cacheHelperProportions(); this._cacheMargins(); this.scrollParent = this.helper.scrollParent(); this.offset = this.currentItem.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; e.extend(this.offset, { click: { left: t.pageX - this.offset.left, top: t.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }); this.helper.css("position", "absolute"); this.cssPosition = this.helper.css("position"); this.originalPosition = this._generatePosition(t); this.originalPageX = t.pageX; this.originalPageY = t.pageY; o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt); this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; if (this.helper[0] !== this.currentItem[0]) { this.currentItem.hide() } this._createPlaceholder(); if (o.containment) { this._setContainment() } if (o.cursor && o.cursor !== "auto") { s = this.document.find("body"); this.storedCursor = s.css("cursor"); s.css("cursor", o.cursor); this.storedStylesheet = e("").appendTo(s) } if (o.opacity) { if (this.helper.css("opacity")) { this._storedOpacity = this.helper.css("opacity") } this.helper.css("opacity", o.opacity) } if (o.zIndex) { if (this.helper.css("zIndex")) { this._storedZIndex = this.helper.css("zIndex") } this.helper.css("zIndex", o.zIndex) } if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { this.overflowOffset = this.scrollParent.offset() } this._trigger("start", t, this._uiHash()); if (!this._preserveHelperProportions) { this._cacheHelperProportions() } if (!r) { for (i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", t, this._uiHash(this)) } } if (e.ui.ddmanager) { e.ui.ddmanager.current = this } if (e.ui.ddmanager && !o.dropBehaviour) { e.ui.ddmanager.prepareOffsets(this, t) } this.dragging = true; this.helper.addClass("ui-sortable-helper"); this._mouseDrag(t); return true }, _mouseDrag: function (t) { var n, r, i, s, o = this.options, u = false; this.position = this._generatePosition(t); this.positionAbs = this._convertPositionTo("absolute"); if (!this.lastPositionAbs) { this.lastPositionAbs = this.positionAbs } if (this.options.scroll) { if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { if (this.overflowOffset.top + this.scrollParent[0].offsetHeight - t.pageY < o.scrollSensitivity) { this.scrollParent[0].scrollTop = u = this.scrollParent[0].scrollTop + o.scrollSpeed } else if (t.pageY - this.overflowOffset.top < o.scrollSensitivity) { this.scrollParent[0].scrollTop = u = this.scrollParent[0].scrollTop - o.scrollSpeed } if (this.overflowOffset.left + this.scrollParent[0].offsetWidth - t.pageX < o.scrollSensitivity) { this.scrollParent[0].scrollLeft = u = this.scrollParent[0].scrollLeft + o.scrollSpeed } else if (t.pageX - this.overflowOffset.left < o.scrollSensitivity) { this.scrollParent[0].scrollLeft = u = this.scrollParent[0].scrollLeft - o.scrollSpeed } } else { if (t.pageY - e(document).scrollTop() < o.scrollSensitivity) { u = e(document).scrollTop(e(document).scrollTop() - o.scrollSpeed) } else if (e(window).height() - (t.pageY - e(document).scrollTop()) < o.scrollSensitivity) { u = e(document).scrollTop(e(document).scrollTop() + o.scrollSpeed) } if (t.pageX - e(document).scrollLeft() < o.scrollSensitivity) { u = e(document).scrollLeft(e(document).scrollLeft() - o.scrollSpeed) } else if (e(window).width() - (t.pageX - e(document).scrollLeft()) < o.scrollSensitivity) { u = e(document).scrollLeft(e(document).scrollLeft() + o.scrollSpeed) } } if (u !== false && e.ui.ddmanager && !o.dropBehaviour) { e.ui.ddmanager.prepareOffsets(this, t) } } this.positionAbs = this._convertPositionTo("absolute"); if (!this.options.axis || this.options.axis !== "y") { this.helper[0].style.left = this.position.left + "px" } if (!this.options.axis || this.options.axis !== "x") { this.helper[0].style.top = this.position.top + "px" } for (n = this.items.length - 1; n >= 0; n--) { r = this.items[n]; i = r.item[0]; s = this._intersectsWithPointer(r); if (!s) { continue } if (r.instance !== this.currentContainer) { continue } if (i !== this.currentItem[0] && this.placeholder[s === 1 ? "next" : "prev"]()[0] !== i && !e.contains(this.placeholder[0], i) && (this.options.type === "semi-dynamic" ? !e.contains(this.element[0], i) : true)) { this.direction = s === 1 ? "down" : "up"; if (this.options.tolerance === "pointer" || this._intersectsWithSides(r)) { this._rearrange(t, r) } else { break } this._trigger("change", t, this._uiHash()); break } } this._contactContainers(t); if (e.ui.ddmanager) { e.ui.ddmanager.drag(this, t) } this._trigger("sort", t, this._uiHash()); this.lastPositionAbs = this.positionAbs; return false }, _mouseStop: function (t, n) { if (!t) { return } if (e.ui.ddmanager && !this.options.dropBehaviour) { e.ui.ddmanager.drop(this, t) } if (this.options.revert) { var r = this, i = this.placeholder.offset(), s = this.options.axis, o = {}; if (!s || s === "x") { o.left = i.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft) } if (!s || s === "y") { o.top = i.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop) } this.reverting = true; e(this.helper).animate(o, parseInt(this.options.revert, 10) || 500, function () { r._clear(t) }) } else { this._clear(t, n) } return false }, cancel: function () { if (this.dragging) { this._mouseUp({ target: null }); if (this.options.helper === "original") { this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else { this.currentItem.show() } for (var t = this.containers.length - 1; t >= 0; t--) { this.containers[t]._trigger("deactivate", null, this._uiHash(this)); if (this.containers[t].containerCache.over) { this.containers[t]._trigger("out", null, this._uiHash(this)); this.containers[t].containerCache.over = 0 } } } if (this.placeholder) { if (this.placeholder[0].parentNode) { this.placeholder[0].parentNode.removeChild(this.placeholder[0]) } if (this.options.helper !== "original" && this.helper && this.helper[0].parentNode) { this.helper.remove() } e.extend(this, { helper: null, dragging: false, reverting: false, _noFinalSort: null }); if (this.domPosition.prev) { e(this.domPosition.prev).after(this.currentItem) } else { e(this.domPosition.parent).prepend(this.currentItem) } } return this }, serialize: function (t) { var n = this._getItemsAsjQuery(t && t.connected), r = []; t = t || {}; e(n).each(function () { var n = (e(t.item || this).attr(t.attribute || "id") || "").match(t.expression || /(.+)[\-=_](.+)/); if (n) { r.push((t.key || n[1] + "[]") + "=" + (t.key && t.expression ? n[1] : n[2])) } }); if (!r.length && t.key) { r.push(t.key + "=") } return r.join("&") }, toArray: function (t) { var n = this._getItemsAsjQuery(t && t.connected), r = []; t = t || {}; n.each(function () { r.push(e(t.item || this).attr(t.attribute || "id") || "") }); return r }, _intersectsWith: function (e) { var t = this.positionAbs.left, n = t + this.helperProportions.width, r = this.positionAbs.top, i = r + this.helperProportions.height, s = e.left, o = s + e.width, u = e.top, a = u + e.height, f = this.offset.click.top, l = this.offset.click.left, c = this.options.axis === "x" || r + f > u && r + f < a, h = this.options.axis === "y" || t + l > s && t + l < o, p = c && h; if (this.options.tolerance === "pointer" || this.options.forcePointerForContainers || this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > e[this.floating ? "width" : "height"]) { return p } else { return s < t + this.helperProportions.width / 2 && n - this.helperProportions.width / 2 < o && u < r + this.helperProportions.height / 2 && i - this.helperProportions.height / 2 < a } }, _intersectsWithPointer: function (e) { var t = this.options.axis === "x" || n(this.positionAbs.top + this.offset.click.top, e.top, e.height), r = this.options.axis === "y" || n(this.positionAbs.left + this.offset.click.left, e.left, e.width), i = t && r, s = this._getDragVerticalDirection(), o = this._getDragHorizontalDirection(); if (!i) { return false } return this.floating ? o && o === "right" || s === "down" ? 2 : 1 : s && (s === "down" ? 2 : 1) }, _intersectsWithSides: function (e) { var t = n(this.positionAbs.top + this.offset.click.top, e.top + e.height / 2, e.height), r = n(this.positionAbs.left + this.offset.click.left, e.left + e.width / 2, e.width), i = this._getDragVerticalDirection(), s = this._getDragHorizontalDirection(); if (this.floating && s) { return s === "right" && r || s === "left" && !r } else { return i && (i === "down" && t || i === "up" && !t) } }, _getDragVerticalDirection: function () { var e = this.positionAbs.top - this.lastPositionAbs.top; return e !== 0 && (e > 0 ? "down" : "up") }, _getDragHorizontalDirection: function () { var e = this.positionAbs.left - this.lastPositionAbs.left; return e !== 0 && (e > 0 ? "right" : "left") }, refresh: function (e) { this._refreshItems(e); this.refreshPositions(); return this }, _connectWith: function () { var e = this.options; return e.connectWith.constructor === String ? [e.connectWith] : e.connectWith }, _getItemsAsjQuery: function (t) { function f() { o.push(this) } var n, r, i, s, o = [], u = [], a = this._connectWith(); if (a && t) { for (n = a.length - 1; n >= 0; n--) { i = e(a[n]); for (r = i.length - 1; r >= 0; r--) { s = e.data(i[r], this.widgetFullName); if (s && s !== this && !s.options.disabled) { u.push([e.isFunction(s.options.items) ? s.options.items.call(s.element) : e(s.options.items, s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), s]) } } } } u.push([e.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : e(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]); for (n = u.length - 1; n >= 0; n--) { u[n][0].each(f) } return e(o) }, _removeCurrentsFromItems: function () { var t = this.currentItem.find(":data(" + this.widgetName + "-item)"); this.items = e.grep(this.items, function (e) { for (var n = 0; n < t.length; n++) { if (t[n] === e.item[0]) { return false } } return true }) }, _refreshItems: function (t) { this.items = []; this.containers = [this]; var n, r, i, s, o, u, a, f, l = this.items, c = [[e.isFunction(this.options.items) ? this.options.items.call(this.element[0], t, { item: this.currentItem }) : e(this.options.items, this.element), this]], h = this._connectWith(); if (h && this.ready) { for (n = h.length - 1; n >= 0; n--) { i = e(h[n]); for (r = i.length - 1; r >= 0; r--) { s = e.data(i[r], this.widgetFullName); if (s && s !== this && !s.options.disabled) { c.push([e.isFunction(s.options.items) ? s.options.items.call(s.element[0], t, { item: this.currentItem }) : e(s.options.items, s.element), s]); this.containers.push(s) } } } } for (n = c.length - 1; n >= 0; n--) { o = c[n][1]; u = c[n][0]; for (r = 0, f = u.length; r < f; r++) { a = e(u[r]); a.data(this.widgetName + "-item", o); l.push({ item: a, instance: o, width: 0, height: 0, left: 0, top: 0 }) } } }, refreshPositions: function (t) { if (this.offsetParent && this.helper) { this.offset.parent = this._getParentOffset() } var n, r, i, s; for (n = this.items.length - 1; n >= 0; n--) { r = this.items[n]; if (r.instance !== this.currentContainer && this.currentContainer && r.item[0] !== this.currentItem[0]) { continue } i = this.options.toleranceElement ? e(this.options.toleranceElement, r.item) : r.item; if (!t) { r.width = i.outerWidth(); r.height = i.outerHeight() } s = i.offset(); r.left = s.left; r.top = s.top } if (this.options.custom && this.options.custom.refreshContainers) { this.options.custom.refreshContainers.call(this) } else { for (n = this.containers.length - 1; n >= 0; n--) { s = this.containers[n].element.offset(); this.containers[n].containerCache.left = s.left; this.containers[n].containerCache.top = s.top; this.containers[n].containerCache.width = this.containers[n].element.outerWidth(); this.containers[n].containerCache.height = this.containers[n].element.outerHeight() } } return this }, _createPlaceholder: function (t) { t = t || this; var n, r = t.options; if (!r.placeholder || r.placeholder.constructor === String) { n = r.placeholder; r.placeholder = { element: function () { var r = t.currentItem[0].nodeName.toLowerCase(), i = e("<" + r + ">", t.document[0]).addClass(n || t.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper"); if (r === "tr") { t.currentItem.children().each(function () { e(" ", t.document[0]).attr("colspan", e(this).attr("colspan") || 1).appendTo(i) }) } else if (r === "img") { i.attr("src", t.currentItem.attr("src")) } if (!n) { i.css("visibility", "hidden") } return i }, update: function (e, i) { if (n && !r.forcePlaceholderSize) { return } if (!i.height()) { i.height(t.currentItem.innerHeight() - parseInt(t.currentItem.css("paddingTop") || 0, 10) - parseInt(t.currentItem.css("paddingBottom") || 0, 10)) } if (!i.width()) { i.width(t.currentItem.innerWidth() - parseInt(t.currentItem.css("paddingLeft") || 0, 10) - parseInt(t.currentItem.css("paddingRight") || 0, 10)) } } } } t.placeholder = e(r.placeholder.element.call(t.element, t.currentItem)); t.currentItem.after(t.placeholder); r.placeholder.update(t, t.placeholder) }, _contactContainers: function (t) { var i, s, o, u, a, f, l, c, h, p, d = null, v = null; for (i = this.containers.length - 1; i >= 0; i--) { if (e.contains(this.currentItem[0], this.containers[i].element[0])) { continue } if (this._intersectsWith(this.containers[i].containerCache)) { if (d && e.contains(this.containers[i].element[0], d.element[0])) { continue } d = this.containers[i]; v = i } else { if (this.containers[i].containerCache.over) { this.containers[i]._trigger("out", t, this._uiHash(this)); this.containers[i].containerCache.over = 0 } } } if (!d) { return } if (this.containers.length === 1) { if (!this.containers[v].containerCache.over) { this.containers[v]._trigger("over", t, this._uiHash(this)); this.containers[v].containerCache.over = 1 } } else { o = 1e4; u = null; p = d.floating || r(this.currentItem); a = p ? "left" : "top"; f = p ? "width" : "height"; l = this.positionAbs[a] + this.offset.click[a]; for (s = this.items.length - 1; s >= 0; s--) { if (!e.contains(this.containers[v].element[0], this.items[s].item[0])) { continue } if (this.items[s].item[0] === this.currentItem[0]) { continue } if (p && !n(this.positionAbs.top + this.offset.click.top, this.items[s].top, this.items[s].height)) { continue } c = this.items[s].item.offset()[a]; h = false; if (Math.abs(c - l) > Math.abs(c + this.items[s][f] - l)) { h = true; c += this.items[s][f] } if (Math.abs(c - l) < o) { o = Math.abs(c - l); u = this.items[s]; this.direction = h ? "up" : "down" } } if (!u && !this.options.dropOnEmpty) { return } if (this.currentContainer === this.containers[v]) { return } u ? this._rearrange(t, u, null, true) : this._rearrange(t, null, this.containers[v].element, true); this._trigger("change", t, this._uiHash()); this.containers[v]._trigger("change", t, this._uiHash(this)); this.currentContainer = this.containers[v]; this.options.placeholder.update(this.currentContainer, this.placeholder); this.containers[v]._trigger("over", t, this._uiHash(this)); this.containers[v].containerCache.over = 1 } }, _createHelper: function (t) { var n = this.options, r = e.isFunction(n.helper) ? e(n.helper.apply(this.element[0], [t, this.currentItem])) : n.helper === "clone" ? this.currentItem.clone() : this.currentItem; if (!r.parents("body").length) { e(n.appendTo !== "parent" ? n.appendTo : this.currentItem[0].parentNode)[0].appendChild(r[0]) } if (r[0] === this.currentItem[0]) { this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left")} } if (!r[0].style.width || n.forceHelperSize) { r.width(this.currentItem.width()) } if (!r[0].style.height || n.forceHelperSize) { r.height(this.currentItem.height()) } return r }, _adjustOffsetFromHelper: function (t) { if (typeof t === "string") { t = t.split(" ") } if (e.isArray(t)) { t = { left: +t[0], top: +t[1] || 0} } if ("left" in t) { this.offset.click.left = t.left + this.margins.left } if ("right" in t) { this.offset.click.left = this.helperProportions.width - t.right + this.margins.left } if ("top" in t) { this.offset.click.top = t.top + this.margins.top } if ("bottom" in t) { this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top } }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var t = this.offsetParent.offset(); if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0])) { t.left += this.scrollParent.scrollLeft(); t.top += this.scrollParent.scrollTop() } if (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && e.ui.ie) { t = { top: 0, left: 0} } return { top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} }, _getRelativeOffset: function () { if (this.cssPosition === "relative") { var e = this.currentItem.position(); return { top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()} } else { return { top: 0, left: 0} } }, _cacheMargins: function () { this.margins = { left: parseInt(this.currentItem.css("marginLeft"), 10) || 0, top: parseInt(this.currentItem.css("marginTop"), 10) || 0} }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight()} }, _setContainment: function () { var t, n, r, i = this.options; if (i.containment === "parent") { i.containment = this.helper[0].parentNode } if (i.containment === "document" || i.containment === "window") { this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, e(i.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (e(i.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top] } if (!/^(document|window|parent)$/.test(i.containment)) { t = e(i.containment)[0]; n = e(i.containment).offset(); r = e(t).css("overflow") !== "hidden"; this.containment = [n.left + (parseInt(e(t).css("borderLeftWidth"), 10) || 0) + (parseInt(e(t).css("paddingLeft"), 10) || 0) - this.margins.left, n.top + (parseInt(e(t).css("borderTopWidth"), 10) || 0) + (parseInt(e(t).css("paddingTop"), 10) || 0) - this.margins.top, n.left + (r ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) - (parseInt(e(t).css("borderLeftWidth"), 10) || 0) - (parseInt(e(t).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, n.top + (r ? Math.max(t.scrollHeight, t.offsetHeight) : t.offsetHeight) - (parseInt(e(t).css("borderTopWidth"), 10) || 0) - (parseInt(e(t).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top] } }, _convertPositionTo: function (t, n) { if (!n) { n = this.position } var r = t === "absolute" ? 1 : -1, i = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, s = /(html|body)/i.test(i[0].tagName); return { top: n.top + this.offset.relative.top * r + this.offset.parent.top * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : s ? 0 : i.scrollTop()) * r, left: n.left + this.offset.relative.left * r + this.offset.parent.left * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : s ? 0 : i.scrollLeft()) * r} }, _generatePosition: function (t) { var n, r, i = this.options, s = t.pageX, o = t.pageY, u = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, a = /(html|body)/i.test(u[0].tagName); if (this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) { this.offset.relative = this._getRelativeOffset() } if (this.originalPosition) { if (this.containment) { if (t.pageX - this.offset.click.left < this.containment[0]) { s = this.containment[0] + this.offset.click.left } if (t.pageY - this.offset.click.top < this.containment[1]) { o = this.containment[1] + this.offset.click.top } if (t.pageX - this.offset.click.left > this.containment[2]) { s = this.containment[2] + this.offset.click.left } if (t.pageY - this.offset.click.top > this.containment[3]) { o = this.containment[3] + this.offset.click.top } } if (i.grid) { n = this.originalPageY + Math.round((o - this.originalPageY) / i.grid[1]) * i.grid[1]; o = this.containment ? n - this.offset.click.top >= this.containment[1] && n - this.offset.click.top <= this.containment[3] ? n : n - this.offset.click.top >= this.containment[1] ? n - i.grid[1] : n + i.grid[1] : n; r = this.originalPageX + Math.round((s - this.originalPageX) / i.grid[0]) * i.grid[0]; s = this.containment ? r - this.offset.click.left >= this.containment[0] && r - this.offset.click.left <= this.containment[2] ? r : r - this.offset.click.left >= this.containment[0] ? r - i.grid[0] : r + i.grid[0] : r } } return { top: o - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : a ? 0 : u.scrollTop()), left: s - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : a ? 0 : u.scrollLeft())} }, _rearrange: function (e, t, n, r) { n ? n[0].appendChild(this.placeholder[0]) : t.item[0].parentNode.insertBefore(this.placeholder[0], this.direction === "down" ? t.item[0] : t.item[0].nextSibling); this.counter = this.counter ? ++this.counter : 1; var i = this.counter; this._delay(function () { if (i === this.counter) { this.refreshPositions(!r) } }) }, _clear: function (e, t) { function i(e, t, n) { return function (r) { n._trigger(e, r, t._uiHash(t)) } } this.reverting = false; var n, r = []; if (!this._noFinalSort && this.currentItem.parent().length) { this.placeholder.before(this.currentItem) } this._noFinalSort = null; if (this.helper[0] === this.currentItem[0]) { for (n in this._storedCSS) { if (this._storedCSS[n] === "auto" || this._storedCSS[n] === "static") { this._storedCSS[n] = "" } } this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else { this.currentItem.show() } if (this.fromOutside && !t) { r.push(function (e) { this._trigger("receive", e, this._uiHash(this.fromOutside)) }) } if ((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !t) { r.push(function (e) { this._trigger("update", e, this._uiHash()) }) } if (this !== this.currentContainer) { if (!t) { r.push(function (e) { this._trigger("remove", e, this._uiHash()) }); r.push(function (e) { return function (t) { e._trigger("receive", t, this._uiHash(this)) } } .call(this, this.currentContainer)); r.push(function (e) { return function (t) { e._trigger("update", t, this._uiHash(this)) } } .call(this, this.currentContainer)) } } for (n = this.containers.length - 1; n >= 0; n--) { if (!t) { r.push(i("deactivate", this, this.containers[n])) } if (this.containers[n].containerCache.over) { r.push(i("out", this, this.containers[n])); this.containers[n].containerCache.over = 0 } } if (this.storedCursor) { this.document.find("body").css("cursor", this.storedCursor); this.storedStylesheet.remove() } if (this._storedOpacity) { this.helper.css("opacity", this._storedOpacity) } if (this._storedZIndex) { this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex) } this.dragging = false; if (this.cancelHelperRemoval) { if (!t) { this._trigger("beforeStop", e, this._uiHash()); for (n = 0; n < r.length; n++) { r[n].call(this, e) } this._trigger("stop", e, this._uiHash()) } this.fromOutside = false; return false } if (!t) { this._trigger("beforeStop", e, this._uiHash()) } this.placeholder[0].parentNode.removeChild(this.placeholder[0]); if (this.helper[0] !== this.currentItem[0]) { this.helper.remove() } this.helper = null; if (!t) { for (n = 0; n < r.length; n++) { r[n].call(this, e) } this._trigger("stop", e, this._uiHash()) } this.fromOutside = false; return true }, _trigger: function () { if (e.Widget.prototype._trigger.apply(this, arguments) === false) { this.cancel() } }, _uiHash: function (t) { var n = t || this; return { helper: n.helper, placeholder: n.placeholder || e([]), position: n.position, originalPosition: n.originalPosition, offset: n.positionAbs, item: n.currentItem, sender: t ? t.element : null} } }) })(jQuery); (function (e, t) { var n = 0, r = {}, i = {}; r.height = r.paddingTop = r.paddingBottom = r.borderTopWidth = r.borderBottomWidth = "hide"; i.height = i.paddingTop = i.paddingBottom = i.borderTopWidth = i.borderBottomWidth = "show"; e.widget("ui.accordion", { version: "1.10.4", options: { active: 0, animate: {}, collapsible: false, event: "click", header: "> li > :first-child,> :not(li):even", heightStyle: "auto", icons: { activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e" }, activate: null, beforeActivate: null }, _create: function () { var t = this.options; this.prevShow = this.prevHide = e(); this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role", "tablist"); if (!t.collapsible && (t.active === false || t.active == null)) { t.active = 0 } this._processPanels(); if (t.active < 0) { t.active += this.headers.length } this._refresh() }, _getCreateEventData: function () { return { header: this.active, panel: !this.active.length ? e() : this.active.next(), content: !this.active.length ? e() : this.active.next()} }, _createIcons: function () { var t = this.options.icons; if (t) { e("").addClass("ui-accordion-header-icon ui-icon " + t.header).prependTo(this.headers); this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader); this.headers.addClass("ui-accordion-icons") } }, _destroyIcons: function () { this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove() }, _destroy: function () { var e; this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"); this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function () { if (/^ui-accordion/.test(this.id)) { this.removeAttribute("id") } }); this._destroyIcons(); e = this.headers.next().css("display", "").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function () { if (/^ui-accordion/.test(this.id)) { this.removeAttribute("id") } }); if (this.options.heightStyle !== "content") { e.css("height", "") } }, _setOption: function (e, t) { if (e === "active") { this._activate(t); return } if (e === "event") { if (this.options.event) { this._off(this.headers, this.options.event) } this._setupEvents(t) } this._super(e, t); if (e === "collapsible" && !t && this.options.active === false) { this._activate(0) } if (e === "icons") { this._destroyIcons(); if (t) { this._createIcons() } } if (e === "disabled") { this.headers.add(this.headers.next()).toggleClass("ui-state-disabled", !!t) } }, _keydown: function (t) { if (t.altKey || t.ctrlKey) { return } var n = e.ui.keyCode, r = this.headers.length, i = this.headers.index(t.target), s = false; switch (t.keyCode) { case n.RIGHT: case n.DOWN: s = this.headers[(i + 1) % r]; break; case n.LEFT: case n.UP: s = this.headers[(i - 1 + r) % r]; break; case n.SPACE: case n.ENTER: this._eventHandler(t); break; case n.HOME: s = this.headers[0]; break; case n.END: s = this.headers[r - 1]; break } if (s) { e(t.target).attr("tabIndex", -1); e(s).attr("tabIndex", 0); s.focus(); t.preventDefault() } }, _panelKeyDown: function (t) { if (t.keyCode === e.ui.keyCode.UP && t.ctrlKey) { e(t.currentTarget).prev().focus() } }, refresh: function () { var t = this.options; this._processPanels(); if (t.active === false && t.collapsible === true || !this.headers.length) { t.active = false; this.active = e() } else if (t.active === false) { this._activate(0) } else if (this.active.length && !e.contains(this.element[0], this.active[0])) { if (this.headers.length === this.headers.find(".ui-state-disabled").length) { t.active = false; this.active = e() } else { this._activate(Math.max(0, t.active - 1)) } } else { t.active = this.headers.index(this.active) } this._destroyIcons(); this._refresh() }, _processPanels: function () { this.headers = this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"); this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide() }, _refresh: function () { var t, r = this.options, i = r.heightStyle, s = this.element.parent(), o = this.accordionId = "ui-accordion-" + (this.element.attr("id") || ++n); this.active = this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"); this.active.next().addClass("ui-accordion-content-active").show(); this.headers.attr("role", "tab").each(function (t) { var n = e(this), r = n.attr("id"), i = n.next(), s = i.attr("id"); if (!r) { r = o + "-header-" + t; n.attr("id", r) } if (!s) { s = o + "-panel-" + t; i.attr("id", s) } n.attr("aria-controls", s); i.attr("aria-labelledby", r) }).next().attr("role", "tabpanel"); this.headers.not(this.active).attr({ "aria-selected": "false", "aria-expanded": "false", tabIndex: -1 }).next().attr({ "aria-hidden": "true" }).hide(); if (!this.active.length) { this.headers.eq(0).attr("tabIndex", 0) } else { this.active.attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 }).next().attr({ "aria-hidden": "false" }) } this._createIcons(); this._setupEvents(r.event); if (i === "fill") { t = s.height(); this.element.siblings(":visible").each(function () { var n = e(this), r = n.css("position"); if (r === "absolute" || r === "fixed") { return } t -= n.outerHeight(true) }); this.headers.each(function () { t -= e(this).outerHeight(true) }); this.headers.next().each(function () { e(this).height(Math.max(0, t - e(this).innerHeight() + e(this).height())) }).css("overflow", "auto") } else if (i === "auto") { t = 0; this.headers.next().each(function () { t = Math.max(t, e(this).css("height", "").height()) }).height(t) } }, _activate: function (t) { var n = this._findActive(t)[0]; if (n === this.active[0]) { return } n = n || this.active[0]; this._eventHandler({ target: n, currentTarget: n, preventDefault: e.noop }) }, _findActive: function (t) { return typeof t === "number" ? this.headers.eq(t) : e() }, _setupEvents: function (t) { var n = { keydown: "_keydown" }; if (t) { e.each(t.split(" "), function (e, t) { n[t] = "_eventHandler" }) } this._off(this.headers.add(this.headers.next())); this._on(this.headers, n); this._on(this.headers.next(), { keydown: "_panelKeyDown" }); this._hoverable(this.headers); this._focusable(this.headers) }, _eventHandler: function (t) { var n = this.options, r = this.active, i = e(t.currentTarget), s = i[0] === r[0], o = s && n.collapsible, u = o ? e() : i.next(), a = r.next(), f = { oldHeader: r, oldPanel: a, newHeader: o ? e() : i, newPanel: u }; t.preventDefault(); if (s && !n.collapsible || this._trigger("beforeActivate", t, f) === false) { return } n.active = o ? false : this.headers.index(i); this.active = s ? e() : i; this._toggle(f); r.removeClass("ui-accordion-header-active ui-state-active"); if (n.icons) { r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header) } if (!s) { i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"); if (n.icons) { i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader) } i.next().addClass("ui-accordion-content-active") } }, _toggle: function (t) { var n = t.newPanel, r = this.prevShow.length ? this.prevShow : t.oldPanel; this.prevShow.add(this.prevHide).stop(true, true); this.prevShow = n; this.prevHide = r; if (this.options.animate) { this._animate(n, r, t) } else { r.hide(); n.show(); this._toggleComplete(t) } r.attr({ "aria-hidden": "true" }); r.prev().attr("aria-selected", "false"); if (n.length && r.length) { r.prev().attr({ tabIndex: -1, "aria-expanded": "false" }) } else if (n.length) { this.headers.filter(function () { return e(this).attr("tabIndex") === 0 }).attr("tabIndex", -1) } n.attr("aria-hidden", "false").prev().attr({ "aria-selected": "true", tabIndex: 0, "aria-expanded": "true" }) }, _animate: function (e, t, n) { var s, o, u, a = this, f = 0, l = e.length && (!t.length || e.index() < t.index()), c = this.options.animate || {}, h = l && c.down || c, p = function () { a._toggleComplete(n) }; if (typeof h === "number") { u = h } if (typeof h === "string") { o = h } o = o || h.easing || c.easing; u = u || h.duration || c.duration; if (!t.length) { return e.animate(i, u, o, p) } if (!e.length) { return t.animate(r, u, o, p) } s = e.show().outerHeight(); t.animate(r, { duration: u, easing: o, step: function (e, t) { t.now = Math.round(e) } }); e.hide().animate(i, { duration: u, easing: o, complete: p, step: function (e, n) { n.now = Math.round(e); if (n.prop !== "height") { f += n.now } else if (a.options.heightStyle !== "content") { n.now = Math.round(s - t.outerHeight() - f); f = 0 } } }) }, _toggleComplete: function (e) { var t = e.oldPanel; t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"); if (t.length) { t.parent()[0].className = t.parent()[0].className } this._trigger("activate", null, e) } }) })(jQuery); (function (e, t) { e.widget("ui.autocomplete", { version: "1.10.4", defaultElement: "", options: { appendTo: null, autoFocus: false, delay: 300, minLength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: null, change: null, close: null, focus: null, open: null, response: null, search: null, select: null }, requestIndex: 0, pending: 0, _create: function () { var t, n, r, i = this.element[0].nodeName.toLowerCase(), s = i === "textarea", o = i === "input"; this.isMultiLine = s ? true : o ? false : this.element.prop("isContentEditable"); this.valueMethod = this.element[s || o ? "val" : "text"]; this.isNewMenu = true; this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off"); this._on(this.element, { keydown: function (i) { if (this.element.prop("readOnly")) { t = true; r = true; n = true; return } t = false; r = false; n = false; var s = e.ui.keyCode; switch (i.keyCode) { case s.PAGE_UP: t = true; this._move("previousPage", i); break; case s.PAGE_DOWN: t = true; this._move("nextPage", i); break; case s.UP: t = true; this._keyEvent("previous", i); break; case s.DOWN: t = true; this._keyEvent("next", i); break; case s.ENTER: case s.NUMPAD_ENTER: if (this.menu.active) { t = true; i.preventDefault(); this.menu.select(i) } break; case s.TAB: if (this.menu.active) { this.menu.select(i) } break; case s.ESCAPE: if (this.menu.element.is(":visible")) { this._value(this.term); this.close(i); i.preventDefault() } break; default: n = true; this._searchTimeout(i); break } }, keypress: function (r) { if (t) { t = false; if (!this.isMultiLine || this.menu.element.is(":visible")) { r.preventDefault() } return } if (n) { return } var i = e.ui.keyCode; switch (r.keyCode) { case i.PAGE_UP: this._move("previousPage", r); break; case i.PAGE_DOWN: this._move("nextPage", r); break; case i.UP: this._keyEvent("previous", r); break; case i.DOWN: this._keyEvent("next", r); break } }, input: function (e) { if (r) { r = false; e.preventDefault(); return } this._searchTimeout(e) }, focus: function () { this.selectedItem = null; this.previous = this._value() }, blur: function (e) { if (this.cancelBlur) { delete this.cancelBlur; return } clearTimeout(this.searching); this.close(e); this._change(e) } }); this._initSource(); this.menu = e("