PageSourceSearch

https://onesmart.com.vn/LightSkin/plugin/img-LC/js/alloy_finger.min.js

js onesmart.com.vn collected 2026-10-02 02:10:44 UTC 7,809 bytes, 1 lines download raw bytes

1!function () { function t(t) { return Math.sqrt(t.x * t.x + t.y * t.y) } function e(e, i) { var s = function (e, i) { var s = t(e) * t(i); if (0 === s) return 0; var h = function (t, e) { return t.x * e.x + t.y * e.y }(e, i) / s; return h > 1 && (h = 1), Math.acos(h) }(e, i); return function (t, e) { return t.x * e.y - e.x * t.y }(e, i) > 0 && (s *= -1), 180 * s / Math.PI } var i = function (t) { this.handlers = [], this.el = t }; function s(t, e) { var s = new i(t); return s.add(e), s } i.prototype.add = function (t) { this.handlers.push(t) }, i.prototype.del = function (t) { t || (this.handlers = []); for (var e = this.handlers.length; e >= 0; e--)this.handlers[e] === t && this.handlers.splice(e, 1) }, i.prototype.dispatch = function () { for (var t = 0, e = this.handlers.length; t < e; t++) { var i = this.handlers[t]; "function" == typeof i && i.apply(this.el, arguments) } }; var h = function (t, e) { this.element = "string" == typeof t ? document.querySelector(t) : t, this.start = this.start.bind(this), this.move = this.move.bind(this), this.end = this.end.bind(this), this.cancel = this.cancel.bind(this), this.element.addEventListener("touchstart", this.start, !1), this.element.addEventListener("touchmove", this.move, !1), this.element.addEventListener("touchend", this.end, !1), this.element.addEventListener("touchcancel", this.cancel, !1), this.preV = { x: null, y: null }, this.pinchStartLen = null, this.zoom = 1, this.isDoubleTap = !1; var i = function () { }; this.rotate = s(this.element, e.rotate || i), this.touchStart = s(this.element, e.touchStart || i), this.multipointStart = s(this.element, e.multipointStart || i), this.multipointEnd = s(this.element, e.multipointEnd || i), this.pinch = s(this.element, e.pinch || i), this.swipe = s(this.element, e.swipe || i), this.tap = s(this.element, e.tap || i), this.doubleTap = s(this.element, e.doubleTap || i), this.longTap = s(this.element, e.longTap || i), this.singleTap = s(this.element, e.singleTap || i), this.pressMove = s(this.element, e.pressMove || i), this.twoFingerPressMove = s(this.element, e.twoFingerPressMove || i), this.touchMove = s(this.element, e.touchMove || i), this.touchEnd = s(this.element, e.touchEnd || i), this.touchCancel = s(this.element, e.touchCancel || i), this._cancelAllHandler = this.cancelAll.bind(this), window.addEventListener("scroll", this._cancelAllHandler), this.delta = null, this.last = null, this.now = null, this.tapTimeout = null, this.singleTapTimeout = null, this.longTapTimeout = null, this.swipeTimeout = null, this.x1 = this.x2 = this.y1 = this.y2 = null, this.preTapPosition = { x: null, y: null } }; h.prototype = { start: function (e) { if (e.touches) { this.now = Date.now(), this.x1 = e.touches[0].pageX, this.y1 = e.touches[0].pageY, this.delta = this.now - (this.last || this.now), this.touchStart.dispatch(e, this.element), null !== this.preTapPosition.x && (this.isDoubleTap = this.delta > 0 && this.delta <= 250 && Math.abs(this.preTapPosition.x - this.x1) < 30 && Math.abs(this.preTapPosition.y - this.y1) < 30, this.isDoubleTap && clearTimeout(this.singleTapTimeout)), this.preTapPosition.x = this.x1, this.preTapPosition.y = this.y1, this.last = this.now; var i = this.preV; if (e.touches.length > 1) { this._cancelLongTap(), this._cancelSingleTap(); var s = { x: e.touches[1].pageX - this.x1, y: e.touches[1].pageY - this.y1 }; i.x = s.x, i.y = s.y, this.pinchStartLen = t(i), this.multipointStart.dispatch(e, this.element) } this._preventTap = !1, this.longTapTimeout = setTimeout(function () { this.longTap.dispatch(e, this.element), this._preventTap = !0 }.bind(this), 750) } }, move: function (i) { if (i.touches) { var s = this.preV, h = i.touches.length, n = i.touches[0].pageX, o = i.touches[0].pageY; if (this.isDoubleTap = !1, h > 1) { var l = i.touches[1].pageX, a = i.touches[1].pageY, u = { x: i.touches[1].pageX - n, y: i.touches[1].pageY - o }; null !== s.x && (this.pinchStartLen > 0 && (i.zoom = t(u) / this.pinchStartLen, this.pinch.dispatch(i, this.element)), i.angle = e(u, s), this.rotate.dispatch(i, this.element)), s.x = u.x, s.y = u.y, null !== this.x2 && null !== this.sx2 ? (i.deltaX = (n - this.x2 + l - this.sx2) / 2, i.deltaY = (o 
1- this.y2 + a - this.sy2) / 2) : (i.deltaX = 0, i.deltaY = 0), this.twoFingerPressMove.dispatch(i, this.element), this.sx2 = l, this.sy2 = a } else { if (null !== this.x2) { i.deltaX = n - this.x2, i.deltaY = o - this.y2; var p = Math.abs(this.x1 - this.x2), c = Math.abs(this.y1 - this.y2); (p > 10 || c > 10) && (this._preventTap = !0) } else i.deltaX = 0, i.deltaY = 0; this.pressMove.dispatch(i, this.element) } this.touchMove.dispatch(i, this.element), this._cancelLongTap(), this.x2 = n, this.y2 = o, h > 1 && i.preventDefault() } }, end: function (t) { if (t.changedTouches) { this._cancelLongTap(); var e = this; t.touches.length < 2 && (this.multipointEnd.dispatch(t, this.element), this.sx2 = this.sy2 = null), this.x2 && Math.abs(this.x1 - this.x2) > 30 || this.y2 && Math.abs(this.y1 - this.y2) > 30 ? (t.direction = this._swipeDirection(this.x1, this.x2, this.y1, this.y2), this.swipeTimeout = setTimeout((function () { e.swipe.dispatch(t, e.element) }), 0)) : (this.tapTimeout = setTimeout((function () { e._preventTap || e.tap.dispatch(t, e.element), e.isDoubleTap && (e.doubleTap.dispatch(t, e.element), e.isDoubleTap = !1) }), 0), e.isDoubleTap || (e.singleTapTimeout = setTimeout((function () { e.singleTap.dispatch(t, e.element) }), 250))), this.touchEnd.dispatch(t, this.element), this.preV.x = 0, this.preV.y = 0, this.zoom = 1, this.pinchStartLen = null, this.x1 = this.x2 = this.y1 = this.y2 = null } }, cancelAll: function () { this._preventTap = !0, clearTimeout(this.singleTapTimeout), clearTimeout(this.tapTimeout), clearTimeout(this.longTapTimeout), clearTimeout(this.swipeTimeout) }, cancel: function (t) { this.cancelAll(), this.touchCancel.dispatch(t, this.element) }, _cancelLongTap: function () { clearTimeout(this.longTapTimeout) }, _cancelSingleTap: function () { clearTimeout(this.singleTapTimeout) }, _swipeDirection: function (t, e, i, s) { return Math.abs(t - e) >= Math.abs(i - s) ? t - e > 0 ? "Left" : "Right" : i - s > 0 ? "Up" : "Down" }, on: function (t, e) { this[t] && this[t].add(e) }, off: function (t, e) { this[t] && this[t].del(e) }, destroy: function () { return this.singleTapTimeout && clearTimeout(this.singleTapTimeout), this.tapTimeout && clearTimeout(this.tapTimeout), this.longTapTimeout && clearTimeout(this.longTapTimeout), this.swipeTimeout && clearTimeout(this.swipeTimeout), this.element.removeEventListener("touchstart", this.start), this.element.removeEventListener("touchmove", this.move), this.element.removeEventListener("touchend", this.end), this.element.removeEventListener("touchcancel", this.cancel), this.rotate.del(), this.touchStart.del(), this.multipointStart.del(), this.multipointEnd.del(), this.pinch.del(), this.swipe.del(), this.tap.del(), this.doubleTap.del(), this.longTap.del(), this.singleTap.del(), this.pressMove.del(), this.twoFingerPressMove.del(), this.touchMove.del(), this.touchEnd.del(), this.touchCancel.del(), this.preV = this.pinchStartLen = this.zoom = this.isDoubleTap = this.delta = this.last = this.now = this.tapTimeout = this.singleTapTimeout = this.longTapTimeout = this.swipeTimeout = this.x1 = this.x2 = this.y1 = this.y2 = this.preTapPosition = this.rotate = this.touchStart = this.multipointStart = this.multipointEnd = this.pinch = this.swipe = this.tap = this.doubleTap = this.longTap = this.singleTap = this.pressMove = this.touchMove = this.touchEnd = this.touchCancel = this.twoFingerPressMove = null, window.removeEventListener("scroll", this._cancelAllHandler), null } }, "undefined" != typeof module && "object" == typeof exports ? module.exports = h : window.AlloyFinger = h }();

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.