PageSourceSearch

https://www.visuris.be/filestore/apps/jquery/sortable.js

js visuris.be collected 2026-10-02 18:02:25 UTC 11,019 bytes, 1 lines download raw bytes

1!function (a, b, c, d) { function e(a, b) { var c = Math.max(0, a[0] - b[0], b[0] - a[1]), d = Math.max(0, a[2] - b[1], b[1] - a[3]); return c + d } function f(b, c, d, e) { var f = b.length; for (e = e ? "offset" : "position", d = d || 0; f--;) { var g = b[f].el ? b[f].el : a(b[f]), h = g[e](); h.left += parseInt(g.css("margin-left"), 10), h.top += parseInt(g.css("margin-top"), 10), c[f] = [h.left - d, h.left + g.outerWidth() + d, h.top - d, h.top + g.outerHeight() + d] } } function g(a, b) { var c = b.offset(); return { left: a.left - c.left, top: a.top - c.top } } function h(a, b, c) { b = [b.left, b.top], c = c && [c.left, c.top]; for (var d, f = a.length, g = []; f--;) d = a[f], g[f] = [f, e(d, b), c && e(d, c)]; return g = g.sort(function (a, b) { return b[1] - a[1] || b[2] - a[2] || b[0] - a[0] }) } function i(b) { this.options = a.extend({}, l, b), this.containers = [], this.options.rootGroup || (this.scrollProxy = a.proxy(this.scroll, this), this.dragProxy = a.proxy(this.drag, this), this.dropProxy = a.proxy(this.drop, this), this.placeholder = a(this.options.placeholder), b.isValidTarget || (this.options.isValidTarget = d)) } function j(b, c) { this.el = b, this.options = a.extend({}, k, c), this.group = i.get(this.options), this.rootGroup = this.options.rootGroup || this.group, this.handle = this.rootGroup.options.handle || this.rootGroup.options.itemSelector; var d = this.rootGroup.options.itemPath; this.target = d ? this.el.find(d) : this.el, this.target.on(p.start, this.handle, a.proxy(this.dragInit, this)), this.options.drop && this.group.containers.push(this) } var k = { drag: !0, drop: !0, exclude: "", nested: !0, vertical: !0 }, l = { afterMove: function (a, b, c) { }, containerPath: "", containerSelector: "ol, ul", distance: 0, delay: 0, handle: "", itemPath: "", itemSelector: "li", bodyClass: "dragging", draggedClass: "dragged", isValidTarget: function (a, b) { return !0 }, onCancel: function (a, b, c, d) { }, onDrag: function (a, b, c, d) { a.css(b) }, onDragStart: function (b, c, d, e) { b.css({ height: b.outerHeight(), width: b.outerWidth() }), b.addClass(c.group.options.draggedClass), a("body").addClass(c.group.options.bodyClass) }, onDrop: function (b, c, d, e) { b.removeClass(c.group.options.draggedClass).removeAttr("style"), a("body").removeClass(c.group.options.bodyClass) }, onMousedown: function (a, b, c) { if (!c.target.nodeName.match(/^(input|select|textarea)$/i)) return c.preventDefault(), !0 }, placeholderClass: "placeholder", placeholder: '<li class="placeholder"></li>', pullPlaceholder: !0, serialize: function (b, c, d) { return b = a.extend({}, b.data()), d ? [c] : (c[0] && (b.children = c), delete b.subContainers, delete b.sortable, b) }, tolerance: 0 }, m = {}, n = 0, o = { left: 0, top: 0, bottom: 0, right: 0 }, p = { start: "touchstart.sortable mousedown.sortable", drop: "touchend.sortable touchcancel.sortable mouseup.sortable", drag: "touchmove.sortable mousemove.sortable", scroll: "scroll.sortable" }; i.get = function (a) { return m[a.group] || (a.group === d && (a.group = n++), m[a.group] = new i(a)), m[a.group] }, i.prototype = { dragInit: function (b, c) { this.$document = a(c.el[0].ownerDocument); var d = a(b.target).closest(this.options.itemSelector); d.length && (this.item = d, this.itemContainer = c, !this.item.is(this.options.exclude) && this.options.onMousedown(this.item, l.onMousedown, b) && (this.setPointer(b), this.toggleListeners("on"), this.setupDelayTimer(), this.dragInitDone = !0)) }, drag: function (a) { if (!this.dragging) { if (!this.distanceMet(a) || !this.delayMet) return; this.options.onDragStart(this.item, this.itemContainer, l.onDragStart, a), this.item.before(this.placeholder), this.dragging = !0 } this.setPointer(a), this.options.onDrag(this.item, g(this.pointer, this.item.offsetParent()), l.onDrag, a), a = this.getPointer(a); var b = this.sameResultBox, c = this.options.tolerance; (!b || b.top - c > a.top || b.bottom + c < a.top || b.left - c > a.left || b.right + c < a.left) && !this.searchValidTarget() && (this.placeholder.detach(), this.lastAppendedItem = d) }, drop: function (a) { this.toggleListeners("off"), this.dragInitDone = !1, this.dragging && (this.placeholder.closest("html")[0] ? this.placeholder.before(this.item).detach() : this.options.onCancel(this.item, this.itemContainer, l.onCancel, a), this.options.onDrop(this.item, this.getContainer(this.item), l.onDrop, a), this.clearDimensions(), this.clearOffsetParent(), this.lastAppendedItem = this.sameResultBox = d, this.dragging = !1) }, searchValidTarget: function (a, b) { a || (a = this.relativePointer || this.pointer, b = this.lastRelativePointer || this.lastPointer); for (var c = h(this.getContainerDimensions(), a, b), e = c.length; e--;) { var f = c[e][0]; if ((!c[e][1] || this.options.pullPlaceholder) && (f = this.containers[f], !f.disabled)) { if (!this.$getOffsetParent()) { var i = f.getItemOffsetParent(); a = g(a, i), b = g(b, i) } if (f.searchValidTarget(a, b)) return !0 } } this.sameResultBox && (this.sameResultBox = d) }, movePlaceholder: function (a, b, c, d) { var e = this.lastAppendedItem; !d && e && e[0] === b[0] || (b[c](this.placeholder), this.lastAppendedItem = b, this.sameResultBox = d, this.options.afterMove(this.placeholder, a, b)) }, getContainerDimensions: function () { return this.containerDimensions || f(this.containers, this.containerDimensions = [], this.options.tolerance, !this.$getOffsetParent()), this.containerDimensions }, getContainer: function (a) { return a.closest(this.options.containerSelector).data(c) }, $getOffsetParent: function () { if (this.offsetParent === d) { var a = this.containers.length - 1, b = this.containers[a].getItemOffsetParent(); if (!this.options.rootGroup) for (; a--;) if (b[0] != this.containers[a].getItemOffsetParent()[0]) { b = !1; break } this.offsetParent = b } return this.offsetParent }
1, setPointer: function (a) { if (a = this.getPointer(a), this.$getOffsetParent()) { var b = g(a, this.$getOffsetParent()); this.lastRelativePointer = this.relativePointer, this.relativePointer = b } this.lastPointer = this.pointer, this.pointer = a }, distanceMet: function (a) { return a = this.getPointer(a), Math.max(Math.abs(this.pointer.left - a.left), Math.abs(this.pointer.top - a.top)) >= this.options.distance }, getPointer: function (a) { var b = a.originalEvent || a.originalEvent.touches && a.originalEvent.touches[0]; return { left: a.pageX || b.pageX, top: a.pageY || b.pageY } }, setupDelayTimer: function () { var a = this; this.delayMet = !this.options.delay, this.delayMet || (clearTimeout(this._mouseDelayTimer), this._mouseDelayTimer = setTimeout(function () { a.delayMet = !0 }, this.options.delay)) }, scroll: function (a) { this.clearDimensions(), this.clearOffsetParent() }, toggleListeners: function (b) { var c = this; a.each(["drag", "drop", "scroll"], function (a, d) { c.$document[b](p[d], c[d + "Proxy"]) }) }, clearOffsetParent: function () { this.offsetParent = d }, clearDimensions: function () { this.traverse(function (a) { a._clearDimensions() }) }, traverse: function (a) { a(this); for (var b = this.containers.length; b--;) this.containers[b].traverse(a) }, _clearDimensions: function () { this.containerDimensions = d }, _destroy: function () { m[this.options.group] = d } }, j.prototype = { dragInit: function (a) { var b = this.rootGroup; !this.disabled && !b.dragInitDone && this.options.drag && this.isValidDrag(a) && b.dragInit(a, this) }, isValidDrag: function (a) { return 1 == a.which || "touchstart" == a.type && 1 == a.originalEvent.touches.length }, searchValidTarget: function (a, b) { var c = h(this.getItemDimensions(), a, b), d = c.length, e = this.rootGroup, f = !e.options.isValidTarget || e.options.isValidTarget(e.item, this); if (!d && f) return e.movePlaceholder(this, this.target, "append"), !0; for (; d--;) if (e = c[d][0], !c[d][1] && this.hasChildGroup(e)) { if (this.getContainerGroup(e).searchValidTarget(a, b)) return !0 } else if (f) return this.movePlaceholder(e, a), !0 }, movePlaceholder: function (b, c) { var d = a(this.items[b]), e = this.itemDimensions[b], f = "after", g = d.outerWidth(), h = d.outerHeight(), i = d.offset(), i = { left: i.left, right: i.left + g, top: i.top, bottom: i.top + h }; this.options.vertical ? c.top <= (e[2] + e[3]) / 2 ? (f = "before", i.bottom -= h / 2) : i.top += h / 2 : c.left <= (e[0] + e[1]) / 2 ? (f = "before", i.right -= g / 2) : i.left += g / 2, this.hasChildGroup(b) && (i = o), this.rootGroup.movePlaceholder(this, d, f, i) }, getItemDimensions: function () { return this.itemDimensions || (this.items = this.$getChildren(this.el, "item").filter(":not(." + this.group.options.placeholderClass + ", ." + this.group.options.draggedClass + ")").get(), f(this.items, this.itemDimensions = [], this.options.tolerance)), this.itemDimensions }, getItemOffsetParent: function () { var a = this.el; return "relative" === a.css("position") || "absolute" === a.css("position") || "fixed" === a.css("position") ? a : a.offsetParent() }, hasChildGroup: function (a) { return this.options.nested && this.getContainerGroup(a) }, getContainerGroup: function (b) { var e = a.data(this.items[b], "subContainers"); if (e === d) { var f = this.$getChildren(this.items[b], "container"), e = !1; f[0] && (e = a.extend({}, this.options, { rootGroup: this.rootGroup, group: n++ }), e = f[c](e).data(c).group), a.data(this.items[b], "subContainers", e) } return e }, $getChildren: function (b, c) { var d = this.rootGroup.options, e = d[c + "Path"], d = d[c + "Selector"]; return b = a(b), e && (b = b.find(e)), b.children(d) }, _serialize: function (b, c) { var d = this, e = this.$getChildren(b, c ? "item" : "container").not(this.options.exclude).map(function () { return d._serialize(a(this), !c) }).get(); return this.rootGroup.options.serialize(b, e, c) }, traverse: function (b) { a.each(this.items || [], function (c) { (c = a.data(this, "subContainers")) && c.traverse(b) }), b(this) }, _clearDimensions: function () { this.itemDimensions = d }, _destroy: function () { var b = this; this.target.off(p.start, this.handle), this.el.removeData(c), this.options.drop && (this.group.containers = a.grep(this.group.containers, function (a) { return a != b })), a.each(this.items || [], function () { a.removeData(this, "subContainers") }) } }; var q = { enable: function () { this.traverse(function (a) { a.disabled = !1 }) }, disable: function () { this.traverse(function (a) { a.disabled = !0 }) }, serialize: function () { return this._serialize(this.el, !0) }, refresh: function () { this.traverse(function (a) { a._clearDimensions() }) }, destroy: function () { this.traverse(function (a) { a._destroy() }) } }; a.extend(j.prototype, q), a.fn[c] = function (b) { var e = Array.prototype.slice.call(arguments, 1); return this.map(function () { var f = a(this), g = f.data(c); return g && q[b] ? q[b].apply(g, e) || this : (g || b !== d && "object" != typeof b || f.data(c, new j(f, b)), this) }) } }(jQuery, window, "sortable");

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.