PageSourceSearch

https://rusmuseumvrm.ru/js/vendor/fastclick.min.js

js rusmuseumvrm.ru collected 2026-10-02 05:25:59 UTC 11,953 bytes, 300 lines download raw bytes

1(function() {
2    "use strict";
3    function e(t, r) {
4        function s(e, t) {
5            return function() {
6                return e.apply(t, arguments);
7            };
8        }
9        var i;
10        r = r || {};
11        this.trackingClick = !1;
12        this.trackingClickStart = 0;
13        this.targetElement = null;
14        this.touchStartX = 0;
15        this.touchStartY = 0;
16        this.lastTouchIdentifier = 0;
17        this.touchBoundary = r.touchBoundary || 10;
18        this.layer = t;
19        this.tapDelay = r.tapDelay || 200;
20        this.tapTimeout = r.tapTimeout || 700;
21        if (e.notNeeded(t)) return;
22        var o = [ "onMouse", "onClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel" ], u = this;
23        for (var a = 0, f = o.length; a < f; a++) u[o[a]] = s(u[o[a]], u);
24        if (n) {
25            t.addEventListener("mouseover", this.onMouse, !0);
26            t.addEventListener("mousedown", this.onMouse, !0);
27            t.addEventListener("mouseup", this.onMouse, !0);
28        }
29        t.addEventListener("click", this.onClick, !0);
30        t.addEventListener("touchstart", this.onTouchStart, !1);
31        t.addEventListener("touchmove", this.onTouchMove, !1);
32        t.addEventListener("touchend", this.onTouchEnd, !1);
33        t.addEventListener("touchcancel", this.onTouchCancel, !1);
34        if (!Event.prototype.stopImmediatePropagation) {
35            t.removeEventListener = function(e, n, r) {
36                var i = Node.prototype.removeEventListener;
37                e === "click" ? i.call(t, e, n.hijacked || n, r) : i.call(t, e, n, r);
38            };
39            t.addEventListener = function(e, n, r) {
40                var i = Node.prototype.addEventListener;
41                e === "click" ? i.call(t, e, n.hijacked || (n.hijacked = function(e) {
42                    e.propagationStopped || n(e);
43                }), r) : i.call(t, e, n, r);
44            };
45        }
46        if (typeof t.onclick == "function") {
47            i = t.onclick;
48            t.addEventListener("click", function(e) {
49                i(e);
50            }, !1);
51            t.onclick = null;
52        }
53    }
54    var t = navigator.userAgent.indexOf("Windows Phone") >= 0, n = navigator.userAgent.indexOf("Android") > 0 && !t, r = /iP(ad|hone|od)/.test(navigator.userAgent) && !t, i = r && /OS 4_\d(_\d)?/.test(navigator.userAgent), s = r && /OS [6-7]_\d/.test(navigator.userAgent), o = navigator.userAgent.indexOf("BB10") > 0;
55    e.prototype.needsClick = function(e) {
56        switch (e.nodeName.toLowerCase()) {
57          case "button":
58          case "select":
59          case "textarea":
60            if (e.disabled) return !0;
61            break;
62          case "input":
63            if (r && e.type === "file" || e.disabled) return !0;
64            break;
65          case "label":
66          case "iframe":
67          case "video":
68            return !0;
69        }
70        return /\bneedsclick\b/.test(e.className);
71    };
72    e.prototype.needsFocus = function(e) {
73        switch (e.nodeName.toLowerCase()) {
74          case "textarea":
75            return !0;
76          case "select":
77            return !n;
78          case "input":
79            switch (e.type) {
80              case "button":
81              case "checkbox":
82              case "file":
83              case "image":
84              case "radio":
85              case "submit":
86                return !1;
87            }
88            return !e.disabled && !e.readOnly;
89          default:
90            return /\bneedsfocus\b/.test(e.className);
91        }
92    };
93    e.prototype.sendClick = function(e, t) {
94        var n, r;
95        document.activeElement && document.activeElement !== e && document.activeElement.blur();
96        r = t.changedTouches[0];
97        n = document.createEvent("MouseEvents");
98        n.initMouseEvent(this.determineEventType(e), !0, !0, window, 1, r.screenX, r.screenY, r.clientX, r.clientY, !1, !1, !1, !1, 0, null);
99        n.forwardedTouchEvent = !0;
100        e.dispatchEvent(n);
101    };
102    e.prototype.determineEventType = function(e) {
103        return n && e.tagName.toLowerCase() === "select" ? "mousedown" : "click";
104    };
105    e.prototype.focus = function(e) {
106        var t;
107        if (r && e.setSelectionRange && e.type.indexOf("date") !== 0 && e.type !== "time" && e.type !== "month") {
108            t = e.value.length;
109            e.setSelectionRange(t, t);
110        } else e.focus();
111    };
112    e.prototype.updateScrollParent = function(e) {
113        var t, n;
114        t = e.fastClickScrollParent;
115        if (!t || !t.contains(e)) {
116            n = e;
117            do {
118                if (n.scrollHeight > n.offsetHeight) {
119                    t = n;
120                    e.fastClickScrollParent = n;
121                    break;
122                }
123                n = n.parentElement;
124            } while (n);
125        }
126        t && (t.fastClickLastScrollTop = t.scrollTop);
127    };
128    e.prototype.getTargetElementFromEventTarget = function(e) {
129        return e.nodeType === Node.TEXT_NODE ? e.parentNode : e;
130    };
131    e.prototype.onTouchStart = function(e) {
132        var t, n, s;
133        if (e.targetTouches.length > 1) return !0;
134        t = this.getTargetElementFromEventTarget(e.target);
135        n = e.targetTouches[0];
136        if (r) {
137            s = window.getSelection();
138            if (s.rangeCount && !s.isCollapsed) return !0;
139            if (!i) {
140                if (n.identifier && n.identifier === this.lastTouchIdentifier) {
141                    e.preventDefault();
142                    return !1;
143                }
144                this.lastTouchIdentifier = n.identifier;
145                this.updateScrollParent(t);
146            }
147        }
148        this.trackingClick = !0;
149        this.trackingClickStart = e.timeStamp;
150        this.targetElement = t;
151        this.touchStartX = n.pageX;
152        this.touchStartY = n.pageY;
153        e.timeStamp - this.lastClickTime < this.tapDelay && e.preventDefault();
154        return !0;
155    };
156    e.prototype.touchHasMoved = function(e) {
157        var t = e.changedTouches[0], n = this.touchBoundary;
158        return Math.abs(t.pageX - this.touchStartX) > n || Math.abs(t.pageY - this.touchStartY) > n ? !0 : !1;
159    };
160    e.prototype.onTouchMove = function(e) {
161        if (!this.trackingClick) return !0;
162        if (this.targetElement !== this.getTargetElementFromEventTarget(e.target) || this.touchHasMoved(e)) {
163            this.trackingClick = !1;
164            this.targetElement = null;
165        }
166        return !0;
167    };
168    e.prototype.findControl = function(e) {
169        return e.control !== undefined ? e.control : e.htmlFor ? document.getElementById(e.htmlFor) : e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea");
170    };
171    e.prototype.onTouchEnd = function(e) {
172        var t, o, u, a, f, l = this.targetElement;
173        if (!this.trackingClick) return !0;
174        if (e.timeStamp - this.lastClickTime < this.tapDelay) {
175            this.cancelNextClick = !0;
176            return !0;
177        }
178        if (e.timeStamp - this.trackingClickStart > this.tapTimeout) return !0;
179        this.cancelNextClick = !1;
180        this.lastClickTime = e.timeStamp;
181        o = this.trackingClickStart;
182        this.trackingClick = !1;
183        this.trackingClickStart = 0;
184        if (s) {
185            f = e.changedTouches[0];
186            l = document.elementFromPoint(f.pageX - window.pageXOffset, f.pageY - window.pageYOffset) || l;
187            l.fastClickScrollParent = this.targetElement.fastClickScrollParent;
188        }
189        u = l.tagName.toLowerCase();
190        if (u === "label") {
191            t = this.findControl(l);
192            if (t) {
193                this.focus(l);
194                if (n) return !1;
195                l = t;
196            }
197        } else if (this.needsFocus(l)) {
198            if (e.timeStamp - o > 100 || r && window.top !== window && u === "input") {
199                this.targetElement = null;
200                return !1;
201            }
202            this.focus(l);
203            this.sendClick(l, e);
204            if (!r || u !== "select") {
205                this.targetElement = null;
206                e.preventDefault();
207            }
208            return !1;
209        }
210        if (r && !i) {
211            a = l.fastClickScrollParent;
212            if (a && a.fastClickLastScrollTop !== a.scrollTop) return !0;
213        }
214        if (!this.needsClick(l)) {
215            e.preventDefault();
216            this.sendClick(l, e);
217        }
218        return !1;
219    };
220    e.prototype.onTouchCancel = function() {
221        this.trackingClick = !1;
222        this.targetElement = null;
223    };
224    e.prototype.onMouse = function(e) {
225        if (!this.targetElement) return !0;
226        if (e.forwardedTouchEvent) return !0;
227        if (!e.cancelable) return !0;
228        if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
229            e.stopImmediatePropagation ? e.stopImmediatePropagation() : e.propagationStopped = !0;
230            e.stopPropagation();
231            e.preventDefault();
232            return !1;
233        }
234        return !0;
235    };
236    e.prototype.onClick = function(e) {
237        var t;
238        if (this.trackingClick) {
239            this.targetElement = null;
240            this.trackingClick = !1;
241            return !0;
242        }
243        if (e.target.type === "submit" && e.detail === 0) return !0;
244        t = this.onMouse(e);
245        t || (this.targetElement = null);
246        return t;
247    };
248    e.prototype.destroy = function() {
249        var e = this.layer;
250        if (n) {
251            e.removeEventListener("mouseover", this.onMouse, !0);
252            e.removeEventListener("mousedown", this.onMouse, !0);
253            e.removeEventListener("mouseup", this.onMouse, !0);
254        }
255        e.removeEventListener("click", this.onClick, !0);
256        e.removeEventListener("touchstart", this.onTouchStart, !1);
257        e.removeEventListener("touchmove", this.onTouchMove, !1);
258        e.removeEventListener("touchend", this.onTouchEnd, !1);
259        e.removeEventListener("touchcancel", this.onTouchCancel, 
259!1);
260    };
261    e.notNeeded = function(e) {
262        var t, r, i, s;
263        if (typeof window.ontouchstart == "undefined") return !0;
264        r = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [ undefined, 0 ])[1];
265        if (r) {
266            if (!n) return !0;
267            t = document.querySelector("meta[name=viewport]");
268            if (t) {
269                if (t.content.indexOf("user-scalable=no") !== -1) return !0;
270                if (r > 31 && document.documentElement.scrollWidth <= window.outerWidth) return !0;
271            }
272        }
273        if (o) {
274            i = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
275            if (i[1] >= 10 && i[2] >= 3) {
276                t = document.querySelector("meta[name=viewport]");
277                if (t) {
278                    if (t.content.indexOf("user-scalable=no") !== -1) return !0;
279                    if (document.documentElement.scrollWidth <= window.outerWidth) return !0;
280                }
281            }
282        }
283        if (e.style.msTouchAction === "none" || e.style.touchAction === "manipulation") return !0;
284        s = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [ undefined, 0 ])[1];
285        if (s >= 27) {
286            t = document.querySelector("meta[name=viewport]");
287            if (t && (t.content.indexOf("user-scalable=no") !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) return !0;
288        }
289        return e.style.touchAction === "none" || e.style.touchAction === "manipulation" ? !0 : !1;
290    };
291    e.attach = function(t, n) {
292        return new e(t, n);
293    };
294    if (typeof define == "function" && typeof define.amd == "object" && define.amd) define(function() {
295        return e;
296    }); else if (typeof module != "undefined" && module.exports) {
297        module.exports = e.attach;
298        module.exports.FastClick = e;
299    } else window.FastClick = e;
300})();

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.