Przeglądaj źródła

修复sonar扫描问题

guohh 4 lat temu
rodzic
commit
6c5069de63
1 zmienionych plików z 9 dodań i 9 usunięć
  1. 9 9
      ipu-server/web/res/js/base/hammer.js

+ 9 - 9
ipu-server/web/res/js/base/hammer.js

3
 *
3
 *
4
 * Copyright (c) 2014 Jorik Tangelder;
4
 * Copyright (c) 2014 Jorik Tangelder;
5
 * Licensed under the MIT license */
5
 * Licensed under the MIT license */
6
(function(window, document, exportName, undefined) {
6
(function(window, document, exportName, undefinedVar) {
7
  'use strict';
7
  'use strict';
8

8

9
var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
9
var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
58

58

59
    if (obj.forEach) {
59
    if (obj.forEach) {
60
        obj.forEach(iterator, context);
60
        obj.forEach(iterator, context);
61
    } else if (obj.length !== undefined) {
61
    } else if (obj.length !== undefinedVar) {
62
        i = 0;
62
        i = 0;
63
        while (i < obj.length) {
63
        while (i < obj.length) {
64
            iterator.call(context, obj[i], i, obj);
64
            iterator.call(context, obj[i], i, obj);
83
    var keys = Object.keys(src);
83
    var keys = Object.keys(src);
84
    var i = 0;
84
    var i = 0;
85
    while (i < keys.length) {
85
    while (i < keys.length) {
86
        if (!merge || (merge && dest[keys[i]] === undefined)) {
86
        if (!merge || (merge && dest[keys[i]] === undefinedVar)) {
87
            dest[keys[i]] = src[keys[i]];
87
            dest[keys[i]] = src[keys[i]];
88
        }
88
        }
89
        i++;
89
        i++;
142
 */
142
 */
143
function boolOrFn(val, args) {
143
function boolOrFn(val, args) {
144
    if (typeof val == TYPE_FUNCTION) {
144
    if (typeof val == TYPE_FUNCTION) {
145
        return val.apply(args ? args[0] || undefined : undefined, args);
145
        return val.apply(args ? args[0] || undefinedVar : undefinedVar, args);
146
    }
146
    }
147
    return val;
147
    return val;
148
}
148
}
154
 * @returns {*}
154
 * @returns {*}
155
 */
155
 */
156
function ifUndefined(val1, val2) {
156
function ifUndefined(val1, val2) {
157
    return (val1 === undefined) ? val2 : val1;
157
    return (val1 === undefinedVar) ? val2 : val1;
158
}
158
}
159

159

160
/**
160
/**
302
        }
302
        }
303
        i++;
303
        i++;
304
    }
304
    }
305
    return undefined;
305
    return undefinedVar;
306
}
306
}
307

307

308
/**
308
/**
327
var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
327
var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
328

328

329
var SUPPORT_TOUCH = ('ontouchstart' in window);
329
var SUPPORT_TOUCH = ('ontouchstart' in window);
330
var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
330
var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefinedVar;
331
var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
331
var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
332

332

333
var INPUT_TYPE_TOUCH = 'touch';
333
var INPUT_TYPE_TOUCH = 'touch';
545
        deltaTime = input.timeStamp - last.timeStamp,
545
        deltaTime = input.timeStamp - last.timeStamp,
546
        velocity, velocityX, velocityY, direction;
546
        velocity, velocityX, velocityY, direction;
547

547

548
    if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
548
    if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefinedVar)) {
549
        var deltaX = last.deltaX - input.deltaX;
549
        var deltaX = last.deltaX - input.deltaX;
550
        var deltaY = last.deltaY - input.deltaY;
550
        var deltaY = last.deltaY - input.deltaY;
551

551

1081
});
1081
});
1082

1082

1083
var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
1083
var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
1084
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
1084
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefinedVar;
1085

1085

1086
// magical touchAction value
1086
// magical touchAction value
1087
var TOUCH_ACTION_COMPUTE = 'compute';
1087
var TOUCH_ACTION_COMPUTE = 'compute';