viewerjs 1.9.2 → 1.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/viewer.common.js +137 -70
- package/dist/viewer.css +163 -190
- package/dist/viewer.esm.js +138 -71
- package/dist/viewer.js +139 -72
- package/dist/viewer.min.css +3 -3
- package/dist/viewer.min.js +3 -3
- package/package.json +29 -43
- package/src/css/viewer.css +1 -1
- package/src/css/viewer.scss +1 -1
- package/src/index.css +1 -1
- package/src/index.scss +1 -1
- package/src/js/constants.js +1 -0
- package/src/js/defaults.js +2 -1
- package/src/js/handlers.js +9 -4
- package/src/js/methods.js +64 -17
- package/src/js/others.js +8 -2
- package/src/js/render.js +30 -7
- package/types/index.d.ts +2 -2
- package/CHANGELOG.md +0 -255
package/dist/viewer.js
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Viewer.js v1.
|
|
2
|
+
* Viewer.js v1.10.3
|
|
3
3
|
* https://fengyuanchen.github.io/viewerjs
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2015-present Chen Fengyuan
|
|
6
6
|
* Released under the MIT license
|
|
7
7
|
*
|
|
8
|
-
* Date:
|
|
8
|
+
* Date: 2022-02-02T05:15:01.702Z
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function (global, factory) {
|
|
12
12
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
13
13
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
14
14
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Viewer = factory());
|
|
15
|
-
}(this, (function () { 'use strict';
|
|
15
|
+
})(this, (function () { 'use strict';
|
|
16
16
|
|
|
17
17
|
function ownKeys(object, enumerableOnly) {
|
|
18
18
|
var keys = Object.keys(object);
|
|
19
19
|
|
|
20
20
|
if (Object.getOwnPropertySymbols) {
|
|
21
21
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
keys.push.apply(keys, symbols);
|
|
22
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
23
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
24
|
+
})), keys.push.apply(keys, symbols);
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
return keys;
|
|
@@ -34,19 +29,12 @@
|
|
|
34
29
|
|
|
35
30
|
function _objectSpread2(target) {
|
|
36
31
|
for (var i = 1; i < arguments.length; i++) {
|
|
37
|
-
var source = arguments[i]
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
44
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
45
|
-
} else {
|
|
46
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
47
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
48
|
-
});
|
|
49
|
-
}
|
|
32
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
33
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
34
|
+
_defineProperty(target, key, source[key]);
|
|
35
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
36
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
37
|
+
});
|
|
50
38
|
}
|
|
51
39
|
|
|
52
40
|
return target;
|
|
@@ -55,17 +43,11 @@
|
|
|
55
43
|
function _typeof(obj) {
|
|
56
44
|
"@babel/helpers - typeof";
|
|
57
45
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
_typeof = function (obj) {
|
|
64
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return _typeof(obj);
|
|
46
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
47
|
+
return typeof obj;
|
|
48
|
+
} : function (obj) {
|
|
49
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
50
|
+
}, _typeof(obj);
|
|
69
51
|
}
|
|
70
52
|
|
|
71
53
|
function _classCallCheck(instance, Constructor) {
|
|
@@ -87,6 +69,9 @@
|
|
|
87
69
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
88
70
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
89
71
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
72
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
73
|
+
writable: false
|
|
74
|
+
});
|
|
90
75
|
return Constructor;
|
|
91
76
|
}
|
|
92
77
|
|
|
@@ -157,7 +142,8 @@
|
|
|
157
142
|
|
|
158
143
|
/**
|
|
159
144
|
* Enable to request fullscreen when play.
|
|
160
|
-
* @
|
|
145
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/FullscreenOptions}
|
|
146
|
+
* @type {boolean|FullscreenOptions}
|
|
161
147
|
*/
|
|
162
148
|
fullscreen: true,
|
|
163
149
|
|
|
@@ -377,6 +363,7 @@
|
|
|
377
363
|
var EVENT_FOCUSIN = 'focusin';
|
|
378
364
|
var EVENT_KEY_DOWN = 'keydown';
|
|
379
365
|
var EVENT_LOAD = 'load';
|
|
366
|
+
var EVENT_ERROR = 'error';
|
|
380
367
|
var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
|
|
381
368
|
var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
|
|
382
369
|
var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
|
|
@@ -493,15 +480,15 @@
|
|
|
493
480
|
if (Array.isArray(data) || isNumber(data.length)
|
|
494
481
|
/* array-like */
|
|
495
482
|
) {
|
|
496
|
-
|
|
497
|
-
|
|
483
|
+
var length = data.length;
|
|
484
|
+
var i;
|
|
498
485
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
}
|
|
486
|
+
for (i = 0; i < length; i += 1) {
|
|
487
|
+
if (callback.call(data, data[i], i, data) === false) {
|
|
488
|
+
break;
|
|
503
489
|
}
|
|
504
|
-
}
|
|
490
|
+
}
|
|
491
|
+
} else if (isObject(data)) {
|
|
505
492
|
Object.keys(data).forEach(function (key) {
|
|
506
493
|
callback.call(data, data[key], key, data);
|
|
507
494
|
});
|
|
@@ -1126,13 +1113,17 @@
|
|
|
1126
1113
|
this.items = items;
|
|
1127
1114
|
forEach(items, function (item) {
|
|
1128
1115
|
var image = item.firstElementChild;
|
|
1116
|
+
var onLoad;
|
|
1117
|
+
var onError;
|
|
1129
1118
|
setData(image, 'filled', true);
|
|
1130
1119
|
|
|
1131
1120
|
if (options.loading) {
|
|
1132
1121
|
addClass(item, CLASS_LOADING);
|
|
1133
1122
|
}
|
|
1134
1123
|
|
|
1135
|
-
addListener(image, EVENT_LOAD, function (event) {
|
|
1124
|
+
addListener(image, EVENT_LOAD, onLoad = function onLoad(event) {
|
|
1125
|
+
removeListener(image, EVENT_ERROR, onError);
|
|
1126
|
+
|
|
1136
1127
|
if (options.loading) {
|
|
1137
1128
|
removeClass(item, CLASS_LOADING);
|
|
1138
1129
|
}
|
|
@@ -1141,6 +1132,15 @@
|
|
|
1141
1132
|
}, {
|
|
1142
1133
|
once: true
|
|
1143
1134
|
});
|
|
1135
|
+
addListener(image, EVENT_ERROR, onError = function onError() {
|
|
1136
|
+
removeListener(image, EVENT_LOAD, onLoad);
|
|
1137
|
+
|
|
1138
|
+
if (options.loading) {
|
|
1139
|
+
removeClass(item, CLASS_LOADING);
|
|
1140
|
+
}
|
|
1141
|
+
}, {
|
|
1142
|
+
once: true
|
|
1143
|
+
});
|
|
1144
1144
|
});
|
|
1145
1145
|
|
|
1146
1146
|
if (options.transition) {
|
|
@@ -1151,16 +1151,23 @@
|
|
|
1151
1151
|
});
|
|
1152
1152
|
}
|
|
1153
1153
|
},
|
|
1154
|
-
renderList: function renderList(
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1157
|
-
|
|
1158
|
-
|
|
1154
|
+
renderList: function renderList() {
|
|
1155
|
+
var index = this.index;
|
|
1156
|
+
var item = this.items[index];
|
|
1157
|
+
|
|
1158
|
+
if (!item) {
|
|
1159
|
+
return;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
var next = item.nextElementSibling;
|
|
1163
|
+
var gutter = parseInt(window.getComputedStyle(next || item).marginLeft, 10);
|
|
1164
|
+
var offsetWidth = item.offsetWidth;
|
|
1165
|
+
var outerWidth = offsetWidth + gutter; // Place the active item in the center of the screen
|
|
1159
1166
|
|
|
1160
1167
|
setStyle(this.list, assign({
|
|
1161
|
-
width: outerWidth * this.length
|
|
1168
|
+
width: outerWidth * this.length - gutter
|
|
1162
1169
|
}, getTransforms({
|
|
1163
|
-
translateX: (this.viewerData.width -
|
|
1170
|
+
translateX: (this.viewerData.width - offsetWidth) / 2 - outerWidth * index
|
|
1164
1171
|
})));
|
|
1165
1172
|
},
|
|
1166
1173
|
resetList: function resetList() {
|
|
@@ -1210,6 +1217,7 @@
|
|
|
1210
1217
|
y: top,
|
|
1211
1218
|
width: width,
|
|
1212
1219
|
height: height,
|
|
1220
|
+
oldRatio: 1,
|
|
1213
1221
|
ratio: width / naturalWidth,
|
|
1214
1222
|
aspectRatio: aspectRatio,
|
|
1215
1223
|
naturalWidth: naturalWidth,
|
|
@@ -1435,9 +1443,10 @@
|
|
|
1435
1443
|
// Cancel the emulated double click when the native dblclick event was triggered.
|
|
1436
1444
|
if (IS_TOUCH_DEVICE && event.isTrusted) {
|
|
1437
1445
|
clearTimeout(this.doubleClickImageTimeout);
|
|
1438
|
-
}
|
|
1446
|
+
} // XXX: No pageX/Y properties in custom event, fallback to the original event.
|
|
1439
1447
|
|
|
1440
|
-
|
|
1448
|
+
|
|
1449
|
+
this.toggle(event.isTrusted ? event : event.detail && event.detail.originalEvent);
|
|
1441
1450
|
}
|
|
1442
1451
|
},
|
|
1443
1452
|
load: function load() {
|
|
@@ -1459,7 +1468,7 @@
|
|
|
1459
1468
|
removeClass(this.canvas, CLASS_LOADING);
|
|
1460
1469
|
}
|
|
1461
1470
|
|
|
1462
|
-
image.style.cssText = 'height:0;' + "margin-left:".concat(viewerData.width / 2, "px;") + "margin-top:".concat(viewerData.height / 2, "px;") + 'max-width:none!important;' + 'position:
|
|
1471
|
+
image.style.cssText = 'height:0;' + "margin-left:".concat(viewerData.width / 2, "px;") + "margin-top:".concat(viewerData.height / 2, "px;") + 'max-width:none!important;' + 'position:relative;' + 'width:0;';
|
|
1463
1472
|
this.initImage(function () {
|
|
1464
1473
|
toggleClass(image, CLASS_MOVE, options.movable);
|
|
1465
1474
|
toggleClass(image, CLASS_TRANSITION, options.transition);
|
|
@@ -1704,7 +1713,9 @@
|
|
|
1704
1713
|
this.imageClicked = false; // This timeout will be cleared later when a native dblclick event is triggering
|
|
1705
1714
|
|
|
1706
1715
|
this.doubleClickImageTimeout = setTimeout(function () {
|
|
1707
|
-
dispatchEvent(_this2.image, EVENT_DBLCLICK
|
|
1716
|
+
dispatchEvent(_this2.image, EVENT_DBLCLICK, {
|
|
1717
|
+
originalEvent: event
|
|
1718
|
+
});
|
|
1708
1719
|
}, 50);
|
|
1709
1720
|
} else {
|
|
1710
1721
|
this.imageClicked = true; // The default timing of a double click in Windows is 500 ms
|
|
@@ -1719,7 +1730,9 @@
|
|
|
1719
1730
|
if (options.backdrop && options.backdrop !== 'static' && event.target === this.canvas) {
|
|
1720
1731
|
// This timeout will be cleared later when a native click event is triggering
|
|
1721
1732
|
this.clickCanvasTimeout = setTimeout(function () {
|
|
1722
|
-
dispatchEvent(_this2.canvas, EVENT_CLICK
|
|
1733
|
+
dispatchEvent(_this2.canvas, EVENT_CLICK, {
|
|
1734
|
+
originalEvent: event
|
|
1735
|
+
});
|
|
1723
1736
|
}, 50);
|
|
1724
1737
|
}
|
|
1725
1738
|
}
|
|
@@ -1947,7 +1960,7 @@
|
|
|
1947
1960
|
addListener(image, EVENT_TRANSITION_END, onImageTransitionEnd, {
|
|
1948
1961
|
once: true
|
|
1949
1962
|
});
|
|
1950
|
-
this.zoomTo(0, false,
|
|
1963
|
+
this.zoomTo(0, false, null, true);
|
|
1951
1964
|
} else {
|
|
1952
1965
|
onImageTransitionEnd();
|
|
1953
1966
|
}
|
|
@@ -2016,8 +2029,12 @@
|
|
|
2016
2029
|
}
|
|
2017
2030
|
|
|
2018
2031
|
var activeItem = this.items[this.index];
|
|
2019
|
-
|
|
2020
|
-
activeItem
|
|
2032
|
+
|
|
2033
|
+
if (activeItem) {
|
|
2034
|
+
removeClass(activeItem, CLASS_ACTIVE);
|
|
2035
|
+
activeItem.removeAttribute('aria-selected');
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2021
2038
|
addClass(item, CLASS_ACTIVE);
|
|
2022
2039
|
item.setAttribute('aria-selected', true);
|
|
2023
2040
|
|
|
@@ -2049,6 +2066,7 @@
|
|
|
2049
2066
|
};
|
|
2050
2067
|
|
|
2051
2068
|
var onLoad;
|
|
2069
|
+
var onError;
|
|
2052
2070
|
addListener(element, EVENT_VIEWED, onViewed, {
|
|
2053
2071
|
once: true
|
|
2054
2072
|
});
|
|
@@ -2077,7 +2095,27 @@
|
|
|
2077
2095
|
if (image.complete) {
|
|
2078
2096
|
this.load();
|
|
2079
2097
|
} else {
|
|
2080
|
-
addListener(image, EVENT_LOAD, onLoad =
|
|
2098
|
+
addListener(image, EVENT_LOAD, onLoad = function onLoad() {
|
|
2099
|
+
removeListener(image, EVENT_ERROR, onError);
|
|
2100
|
+
|
|
2101
|
+
_this2.load();
|
|
2102
|
+
}, {
|
|
2103
|
+
once: true
|
|
2104
|
+
});
|
|
2105
|
+
addListener(image, EVENT_ERROR, onError = function onError() {
|
|
2106
|
+
removeListener(image, EVENT_LOAD, onLoad);
|
|
2107
|
+
|
|
2108
|
+
if (_this2.timeout) {
|
|
2109
|
+
clearTimeout(_this2.timeout);
|
|
2110
|
+
_this2.timeout = false;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
removeClass(image, CLASS_INVISIBLE);
|
|
2114
|
+
|
|
2115
|
+
if (options.loading) {
|
|
2116
|
+
removeClass(_this2.canvas, CLASS_LOADING);
|
|
2117
|
+
}
|
|
2118
|
+
}, {
|
|
2081
2119
|
once: true
|
|
2082
2120
|
});
|
|
2083
2121
|
|
|
@@ -2448,15 +2486,31 @@
|
|
|
2448
2486
|
ratio = Math.min(Math.max(ratio, minZoomRatio), maxZoomRatio);
|
|
2449
2487
|
}
|
|
2450
2488
|
|
|
2451
|
-
if (_originalEvent
|
|
2452
|
-
|
|
2489
|
+
if (_originalEvent) {
|
|
2490
|
+
switch (_originalEvent.type) {
|
|
2491
|
+
case 'wheel':
|
|
2492
|
+
if (options.zoomRatio >= 0.055 && ratio > 0.95 && ratio < 1.05) {
|
|
2493
|
+
ratio = 1;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
break;
|
|
2497
|
+
|
|
2498
|
+
case 'pointermove':
|
|
2499
|
+
case 'touchmove':
|
|
2500
|
+
case 'mousemove':
|
|
2501
|
+
if (ratio > 0.99 && ratio < 1.01) {
|
|
2502
|
+
ratio = 1;
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
break;
|
|
2506
|
+
}
|
|
2453
2507
|
}
|
|
2454
2508
|
|
|
2455
2509
|
var newWidth = naturalWidth * ratio;
|
|
2456
2510
|
var newHeight = naturalHeight * ratio;
|
|
2457
2511
|
var offsetWidth = newWidth - width;
|
|
2458
2512
|
var offsetHeight = newHeight - height;
|
|
2459
|
-
var oldRatio =
|
|
2513
|
+
var oldRatio = imageData.ratio;
|
|
2460
2514
|
|
|
2461
2515
|
if (isFunction(options.zoom)) {
|
|
2462
2516
|
addListener(element, EVENT_ZOOM, options.zoom, {
|
|
@@ -2476,7 +2530,7 @@
|
|
|
2476
2530
|
|
|
2477
2531
|
if (_originalEvent) {
|
|
2478
2532
|
var offset = getOffset(this.viewer);
|
|
2479
|
-
var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
|
|
2533
|
+
var center = pointers && Object.keys(pointers).length > 0 ? getPointersCenter(pointers) : {
|
|
2480
2534
|
pageX: _originalEvent.pageX,
|
|
2481
2535
|
pageY: _originalEvent.pageY
|
|
2482
2536
|
}; // Zoom from the triggering point of the event
|
|
@@ -2493,6 +2547,7 @@
|
|
|
2493
2547
|
imageData.top = imageData.y;
|
|
2494
2548
|
imageData.width = newWidth;
|
|
2495
2549
|
imageData.height = newHeight;
|
|
2550
|
+
imageData.oldRatio = oldRatio;
|
|
2496
2551
|
imageData.ratio = ratio;
|
|
2497
2552
|
this.renderImage(function () {
|
|
2498
2553
|
_this6.zooming = false;
|
|
@@ -2522,7 +2577,7 @@
|
|
|
2522
2577
|
|
|
2523
2578
|
/**
|
|
2524
2579
|
* Play the images
|
|
2525
|
-
* @param {boolean} [fullscreen=false] - Indicate if request fullscreen or not.
|
|
2580
|
+
* @param {boolean|FullscreenOptions} [fullscreen=false] - Indicate if request fullscreen or not.
|
|
2526
2581
|
* @returns {Viewer} this
|
|
2527
2582
|
*/
|
|
2528
2583
|
play: function play() {
|
|
@@ -2556,7 +2611,7 @@
|
|
|
2556
2611
|
this.onLoadWhenPlay = onLoad;
|
|
2557
2612
|
|
|
2558
2613
|
if (fullscreen) {
|
|
2559
|
-
this.requestFullscreen();
|
|
2614
|
+
this.requestFullscreen(fullscreen);
|
|
2560
2615
|
}
|
|
2561
2616
|
|
|
2562
2617
|
addClass(player, CLASS_SHOW);
|
|
@@ -2801,12 +2856,19 @@
|
|
|
2801
2856
|
}, 1000);
|
|
2802
2857
|
return this;
|
|
2803
2858
|
},
|
|
2804
|
-
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* Toggle the image size between its current size and natural size
|
|
2862
|
+
* @param {Event} [_originalEvent=null] - The original event if any.
|
|
2863
|
+
* @returns {Viewer} this
|
|
2864
|
+
*/
|
|
2805
2865
|
toggle: function toggle() {
|
|
2866
|
+
var _originalEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
2867
|
+
|
|
2806
2868
|
if (this.imageData.ratio === 1) {
|
|
2807
|
-
this.zoomTo(this.
|
|
2869
|
+
this.zoomTo(this.imageData.oldRatio, true, _originalEvent);
|
|
2808
2870
|
} else {
|
|
2809
|
-
this.zoomTo(1, true);
|
|
2871
|
+
this.zoomTo(1, true, _originalEvent);
|
|
2810
2872
|
}
|
|
2811
2873
|
|
|
2812
2874
|
return this;
|
|
@@ -3068,14 +3130,19 @@
|
|
|
3068
3130
|
});
|
|
3069
3131
|
}
|
|
3070
3132
|
},
|
|
3071
|
-
requestFullscreen: function requestFullscreen() {
|
|
3133
|
+
requestFullscreen: function requestFullscreen(options) {
|
|
3072
3134
|
var document = this.element.ownerDocument;
|
|
3073
3135
|
|
|
3074
3136
|
if (this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
|
|
3075
3137
|
var documentElement = document.documentElement; // Element.requestFullscreen()
|
|
3076
3138
|
|
|
3077
3139
|
if (documentElement.requestFullscreen) {
|
|
3078
|
-
|
|
3140
|
+
// Avoid TypeError when convert `options` to dictionary
|
|
3141
|
+
if (isPlainObject(options)) {
|
|
3142
|
+
documentElement.requestFullscreen(options);
|
|
3143
|
+
} else {
|
|
3144
|
+
documentElement.requestFullscreen();
|
|
3145
|
+
}
|
|
3079
3146
|
} else if (documentElement.webkitRequestFullscreen) {
|
|
3080
3147
|
documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
|
|
3081
3148
|
} else if (documentElement.mozRequestFullScreen) {
|
|
@@ -3505,4 +3572,4 @@
|
|
|
3505
3572
|
|
|
3506
3573
|
return Viewer;
|
|
3507
3574
|
|
|
3508
|
-
}))
|
|
3575
|
+
}));
|
package/dist/viewer.min.css
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Viewer.js v1.
|
|
2
|
+
* Viewer.js v1.10.3
|
|
3
3
|
* https://fengyuanchen.github.io/viewerjs
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2015-present Chen Fengyuan
|
|
6
6
|
* Released under the MIT license
|
|
7
7
|
*
|
|
8
|
-
* Date:
|
|
9
|
-
*/.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB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L3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-size:280px;color:transparent;display:block;font-size:0;height:20px;line-height:0;width:20px}.viewer-zoom-in:before{background-position:0 0;content:"Zoom In"}.viewer-zoom-out:before{background-position:-20px 0;content:"Zoom Out"}.viewer-one-to-one:before{background-position:-40px 0;content:"One to One"}.viewer-reset:before{background-position:-60px 0;content:"Reset"}.viewer-prev:before{background-position:-80px 0;content:"Previous"}.viewer-play:before{background-position:-100px 0;content:"Play"}.viewer-next:before{background-position:-120px 0;content:"Next"}.viewer-rotate-left:before{background-position:-140px 0;content:"Rotate Left"}.viewer-rotate-right:before{background-position:-160px 0;content:"Rotate Right"}.viewer-flip-horizontal:before{background-position:-180px 0;content:"Flip Horizontal"}.viewer-flip-vertical:before{background-position:-200px 0;content:"Flip Vertical"}.viewer-fullscreen:before{background-position:-220px 0;content:"Enter Full Screen"}.viewer-fullscreen-exit:before{background-position:-240px 0;content:"Exit Full Screen"}.viewer-close:before{background-position:-260px 0;content:"Close"}.viewer-container{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;bottom:0;direction:ltr;font-size:0;left:0;line-height:0;overflow:hidden;position:absolute;right:0;top:0
|
|
8
|
+
* Date: 2022-02-02T05:14:59.271Z
|
|
9
|
+
*/.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnI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pbHI3KkNTB1NfkL81j2mvhDp91HgV9MKuRIqrykj3WPq4rHyL+axj8/qGPmTqi6F9YDlHOvJU6oYcTsh/TYSzWmTE6JT19CtLTJt32D6CmHe0eQn1O8z5AXgT4sx4Vcu0/EQecMydB8z0hUWkTd2t4CrwNEePqMBcAR4mrBbwyXLPWJa8zrXmmLEhNBmfpkuY2102xxrih+pb+ieAb6vGhuA97UcJ5KR8gZ77K+99xxeYBzH6Q3/Z0fHcXrDC4zjOL3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-size:280px;color:transparent;display:block;font-size:0;height:20px;line-height:0;width:20px}.viewer-zoom-in:before{background-position:0 0;content:"Zoom In"}.viewer-zoom-out:before{background-position:-20px 0;content:"Zoom Out"}.viewer-one-to-one:before{background-position:-40px 0;content:"One to One"}.viewer-reset:before{background-position:-60px 0;content:"Reset"}.viewer-prev:before{background-position:-80px 0;content:"Previous"}.viewer-play:before{background-position:-100px 0;content:"Play"}.viewer-next:before{background-position:-120px 0;content:"Next"}.viewer-rotate-left:before{background-position:-140px 0;content:"Rotate Left"}.viewer-rotate-right:before{background-position:-160px 0;content:"Rotate Right"}.viewer-flip-horizontal:before{background-position:-180px 0;content:"Flip Horizontal"}.viewer-flip-vertical:before{background-position:-200px 0;content:"Flip Vertical"}.viewer-fullscreen:before{background-position:-220px 0;content:"Enter Full Screen"}.viewer-fullscreen-exit:before{background-position:-240px 0;content:"Exit Full Screen"}.viewer-close:before{background-position:-260px 0;content:"Close"}.viewer-container{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;bottom:0;direction:ltr;font-size:0;left:0;line-height:0;overflow:hidden;position:absolute;right:0;top:0;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.viewer-container ::-moz-selection,.viewer-container::-moz-selection{background-color:transparent}.viewer-container ::selection,.viewer-container::selection{background-color:transparent}.viewer-container:focus{outline:0}.viewer-container img{display:block;height:auto;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.viewer-canvas{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.viewer-canvas>img{height:auto;margin:15px auto;max-width:90%!important;width:auto}.viewer-footer{bottom:0;left:0;overflow:hidden;position:absolute;right:0;text-align:center}.viewer-navbar{background-color:rgba(0,0,0,.5);overflow:hidden}.viewer-list{box-sizing:content-box;height:50px;margin:0;overflow:hidden;padding:1px 0}.viewer-list>li{color:transparent;cursor:pointer;float:left;font-size:0;height:50px;line-height:0;opacity:.5;overflow:hidden;transition:opacity .15s;width:30px}.viewer-list>li:focus,.viewer-list>li:hover{opacity:.75}.viewer-list>li:focus{outline:0}.viewer-list>li+li{margin-left:1px}.viewer-list>.viewer-loading{position:relative}.viewer-list>.viewer-loading:after{border-width:2px;height:20px;margin-left:-10px;margin-top:-10px;width:20px}.viewer-list>.viewer-active,.viewer-list>.viewer-active:focus,.viewer-list>.viewer-active:hover{opacity:1}.viewer-player{background-color:#000;bottom:0;cursor:none;display:none;right:0;z-index:1}.viewer-player,.viewer-player>img{left:0;position:absolute;top:0}.viewer-toolbar>ul{display:inline-block;margin:0 auto 5px;overflow:hidden;padding:6px 3px}.viewer-toolbar>ul>li{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;float:left;height:24px;overflow:hidden;transition:background-color .15s;width:24px}.viewer-toolbar>ul>li:focus,.viewer-toolbar>ul>li:hover{background-color:rgba(0,0,0,.8)}.viewer-toolbar>ul>li:focus{box-shadow:0 0 3px #fff;outline:0;position:relative;z-index:1}.viewer-toolbar>ul>li:before{margin:2px}.viewer-toolbar>ul>li+li{margin-left:1px}.viewer-toolbar>ul>.viewer-small{height:18px;margin-bottom:3px;margin-top:3px;width:18px}.viewer-toolbar>ul>.viewer-small:before{margin:-1px}.viewer-toolbar>ul>.viewer-large{height:30px;margin-bottom:-3px;margin-top:-3px;width:30px}.viewer-toolbar>ul>.viewer-large:before{margin:5px}.viewer-tooltip{background-color:rgba(0,0,0,.8);border-radius:10px;color:#fff;display:none;font-size:12px;height:20px;left:50%;line-height:20px;margin-left:-25px;margin-top:-10px;position:absolute;text-align:center;top:50%;width:50px}.viewer-title{color:#ccc;display:inline-block;font-size:12px;line-height:1.2;margin:0 5% 5px;max-width:90%;opacity:.8;overflow:hidden;text-overflow:ellipsis;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:80px;overflow:hidden;position:absolute;right:-40px;top:-40px;transition:background-color .15s;width:80px}.viewer-button:focus,.viewer-button:hover{background-color:rgba(0,0,0,.8)}.viewer-button:focus{box-shadow:0 0 3px #fff;outline:0}.viewer-button:before{bottom:15px;left:15px;position:absolute}.viewer-fixed{position:fixed}.viewer-open{overflow:hidden}.viewer-show{display:block}.viewer-hide{display:none}.viewer-backdrop{background-color:rgba(0,0,0,.5)}.viewer-invisible{visibility:hidden}.viewer-move{cursor:move;cursor:-webkit-grab;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{transition:all .3s}@-webkit-keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.viewer-loading:after{-webkit-animation:viewer-spinner 1s linear infinite;animation:viewer-spinner 1s linear infinite;border:4px solid hsla(0,0%,100%,.1);border-left-color:hsla(0,0%,100%,.5);border-radius:50%;content:"";display:inline-block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:1}@media (max-width:767px){.viewer-hide-xs-down{display:none}}@media (max-width:991px){.viewer-hide-sm-down{display:none}}@media (max-width:1199px){.viewer-hide-md-down{display:none}}
|