Skip to content

Commit 6a1a6a3

Browse files
committedNov 6, 2022
build: release 1.11.1
1 parent e706ad1 commit 6a1a6a3

12 files changed

+917
-939
lines changed
 

‎CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## next
3+
## 1.11.1 (Nov 6, 2022)
44

55
- Add missing type definitions for `initialCoverage` option and `zoom` and `zoomTo` methods (#571).
66

‎dist/viewer.common.js

+36-19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
2-
* Viewer.js v1.11.0
2+
* Viewer.js v1.11.1
33
* https://fengyuanchen.github.io/viewerjs
44
*
55
* Copyright 2015-present Chen Fengyuan
66
* Released under the MIT license
77
*
8-
* Date: 2022-10-16T06:41:28.706Z
8+
* Date: 2022-11-06T05:18:19.939Z
99
*/
1010

1111
'use strict';
@@ -646,7 +646,8 @@ var onceSupported = function () {
646646
* This setter can fix a `TypeError` in strict mode
647647
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
648648
* @param {boolean} value - The value to set
649-
*/set: function set(value) {
649+
*/
650+
set: function set(value) {
650651
once = value;
651652
}
652653
});
@@ -1650,7 +1651,8 @@ var methods = {
16501651
/** Show the viewer (only available in modal mode)
16511652
* @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.
16521653
* @returns {Viewer} this
1653-
*/show: function show() {
1654+
*/
1655+
show: function show() {
16541656
var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
16551657
var element = this.element,
16561658
options = this.options;
@@ -1709,7 +1711,8 @@ var methods = {
17091711
* Hide the viewer (only available in modal mode)
17101712
* @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not.
17111713
* @returns {Viewer} this
1712-
*/hide: function hide() {
1714+
*/
1715+
hide: function hide() {
17131716
var _this = this;
17141717
var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
17151718
var element = this.element,
@@ -1786,7 +1789,8 @@ var methods = {
17861789
* View one of the images with image's index
17871790
* @param {number} index - The index of the image to view.
17881791
* @returns {Viewer} this
1789-
*/view: function view() {
1792+
*/
1793+
view: function view() {
17901794
var _this2 = this;
17911795
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.initialViewIndex;
17921796
index = Number(index) || 0;
@@ -1925,7 +1929,8 @@ var methods = {
19251929
* @param {boolean} [loop=false] - Indicate if view the last one
19261930
* when it is the first one at present.
19271931
* @returns {Viewer} this
1928-
*/prev: function prev() {
1932+
*/
1933+
prev: function prev() {
19291934
var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
19301935
var index = this.index - 1;
19311936
if (index < 0) {
@@ -1939,7 +1944,8 @@ var methods = {
19391944
* @param {boolean} [loop=false] - Indicate if view the first one
19401945
* when it is the last one at present.
19411946
* @returns {Viewer} this
1942-
*/next: function next() {
1947+
*/
1948+
next: function next() {
19431949
var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
19441950
var maxIndex = this.length - 1;
19451951
var index = this.index + 1;
@@ -1954,7 +1960,8 @@ var methods = {
19541960
* @param {number} x - The moving distance in the horizontal direction.
19551961
* @param {number} [y=x] The moving distance in the vertical direction.
19561962
* @returns {Viewer} this
1957-
*/move: function move(x) {
1963+
*/
1964+
move: function move(x) {
19581965
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
19591966
var imageData = this.imageData;
19601967
this.moveTo(isUndefined(x) ? x : imageData.x + Number(x), isUndefined(y) ? y : imageData.y + Number(y));
@@ -1966,7 +1973,8 @@ var methods = {
19661973
* @param {number} [y=x] - The new position in the vertical direction.
19671974
* @param {Event} [_originalEvent=null] - The original event if any.
19681975
* @returns {Viewer} this
1969-
*/moveTo: function moveTo(x) {
1976+
*/
1977+
moveTo: function moveTo(x) {
19701978
var _this3 = this;
19711979
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
19721980
var _originalEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
@@ -2034,15 +2042,17 @@ var methods = {
20342042
* Rotate the image with a relative degree.
20352043
* @param {number} degree - The rotate degree.
20362044
* @returns {Viewer} this
2037-
*/rotate: function rotate(degree) {
2045+
*/
2046+
rotate: function rotate(degree) {
20382047
this.rotateTo((this.imageData.rotate || 0) + Number(degree));
20392048
return this;
20402049
},
20412050
/**
20422051
* Rotate the image to an absolute degree.
20432052
* @param {number} degree - The rotate degree.
20442053
* @returns {Viewer} this
2045-
*/rotateTo: function rotateTo(degree) {
2054+
*/
2055+
rotateTo: function rotateTo(degree) {
20462056
var _this4 = this;
20472057
var element = this.element,
20482058
options = this.options,
@@ -2084,15 +2094,17 @@ var methods = {
20842094
* Scale the image on the x-axis.
20852095
* @param {number} scaleX - The scale ratio on the x-axis.
20862096
* @returns {Viewer} this
2087-
*/scaleX: function scaleX(_scaleX) {
2097+
*/
2098+
scaleX: function scaleX(_scaleX) {
20882099
this.scale(_scaleX, this.imageData.scaleY);
20892100
return this;
20902101
},
20912102
/**
20922103
* Scale the image on the y-axis.
20932104
* @param {number} scaleY - The scale ratio on the y-axis.
20942105
* @returns {Viewer} this
2095-
*/scaleY: function scaleY(_scaleY) {
2106+
*/
2107+
scaleY: function scaleY(_scaleY) {
20962108
this.scale(this.imageData.scaleX, _scaleY);
20972109
return this;
20982110
},
@@ -2101,7 +2113,8 @@ var methods = {
21012113
* @param {number} scaleX - The scale ratio on the x-axis.
21022114
* @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
21032115
* @returns {Viewer} this
2104-
*/scale: function scale(scaleX) {
2116+
*/
2117+
scale: function scale(scaleX) {
21052118
var _this5 = this;
21062119
var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
21072120
var element = this.element,
@@ -2167,7 +2180,8 @@ var methods = {
21672180
* @param {Object} [pivot] - The pivot point coordinate for zooming.
21682181
* @param {Event} [_originalEvent=null] - The original event if any.
21692182
* @returns {Viewer} this
2170-
*/zoom: function zoom(ratio) {
2183+
*/
2184+
zoom: function zoom(ratio) {
21712185
var showTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
21722186
var pivot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
21732187
var _originalEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
@@ -2189,7 +2203,8 @@ var methods = {
21892203
* @param {Event} [_originalEvent=null] - The original event if any.
21902204
* @param {Event} [_zoomable=false] - Indicates if the current zoom is available or not.
21912205
* @returns {Viewer} this
2192-
*/zoomTo: function zoomTo(ratio) {
2206+
*/
2207+
zoomTo: function zoomTo(ratio) {
21932208
var _this6 = this;
21942209
var showTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
21952210
var pivot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
@@ -2295,7 +2310,8 @@ var methods = {
22952310
* Play the images
22962311
* @param {boolean|FullscreenOptions} [fullscreen=false] - Indicate if request fullscreen or not.
22972312
* @returns {Viewer} this
2298-
*/play: function play() {
2313+
*/
2314+
play: function play() {
22992315
var _this7 = this;
23002316
var fullscreen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
23012317
if (!this.isShown || this.played) {
@@ -2544,7 +2560,8 @@ var methods = {
25442560
* Toggle the image size between its current size and natural size
25452561
* @param {Event} [_originalEvent=null] - The original event if any.
25462562
* @returns {Viewer} this
2547-
*/toggle: function toggle() {
2563+
*/
2564+
toggle: function toggle() {
25482565
var _originalEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
25492566
if (this.imageData.ratio === 1) {
25502567
this.zoomTo(this.imageData.oldRatio, true, null, _originalEvent);

‎dist/viewer.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
2-
* Viewer.js v1.11.0
2+
* Viewer.js v1.11.1
33
* https://fengyuanchen.github.io/viewerjs
44
*
55
* Copyright 2015-present Chen Fengyuan
66
* Released under the MIT license
77
*
8-
* Date: 2022-10-16T06:41:23.145Z
8+
* Date: 2022-11-06T05:18:17.414Z
99
*/
1010

1111
.viewer-zoom-in::before, .viewer-zoom-out::before, .viewer-one-to-one::before, .viewer-reset::before, .viewer-prev::before, .viewer-play::before, .viewer-next::before, .viewer-rotate-left::before, .viewer-rotate-right::before, .viewer-flip-horizontal::before, .viewer-flip-vertical::before, .viewer-fullscreen::before, .viewer-fullscreen-exit::before, .viewer-close::before {

‎dist/viewer.esm.js

+36-19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*!
2-
* Viewer.js v1.11.0
2+
* Viewer.js v1.11.1
33
* https://fengyuanchen.github.io/viewerjs
44
*
55
* Copyright 2015-present Chen Fengyuan
66
* Released under the MIT license
77
*
8-
* Date: 2022-10-16T06:41:28.706Z
8+
* Date: 2022-11-06T05:18:19.939Z
99
*/
1010

1111
function ownKeys(object, enumerableOnly) {
@@ -644,7 +644,8 @@ var onceSupported = function () {
644644
* This setter can fix a `TypeError` in strict mode
645645
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
646646
* @param {boolean} value - The value to set
647-
*/set: function set(value) {
647+
*/
648+
set: function set(value) {
648649
once = value;
649650
}
650651
});
@@ -1648,7 +1649,8 @@ var methods = {
16481649
/** Show the viewer (only available in modal mode)
16491650
* @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.
16501651
* @returns {Viewer} this
1651-
*/show: function show() {
1652+
*/
1653+
show: function show() {
16521654
var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
16531655
var element = this.element,
16541656
options = this.options;
@@ -1707,7 +1709,8 @@ var methods = {
17071709
* Hide the viewer (only available in modal mode)
17081710
* @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not.
17091711
* @returns {Viewer} this
1710-
*/hide: function hide() {
1712+
*/
1713+
hide: function hide() {
17111714
var _this = this;
17121715
var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
17131716
var element = this.element,
@@ -1784,7 +1787,8 @@ var methods = {
17841787
* View one of the images with image's index
17851788
* @param {number} index - The index of the image to view.
17861789
* @returns {Viewer} this
1787-
*/view: function view() {
1790+
*/
1791+
view: function view() {
17881792
var _this2 = this;
17891793
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.initialViewIndex;
17901794
index = Number(index) || 0;
@@ -1923,7 +1927,8 @@ var methods = {
19231927
* @param {boolean} [loop=false] - Indicate if view the last one
19241928
* when it is the first one at present.
19251929
* @returns {Viewer} this
1926-
*/prev: function prev() {
1930+
*/
1931+
prev: function prev() {
19271932
var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
19281933
var index = this.index - 1;
19291934
if (index < 0) {
@@ -1937,7 +1942,8 @@ var methods = {
19371942
* @param {boolean} [loop=false] - Indicate if view the first one
19381943
* when it is the last one at present.
19391944
* @returns {Viewer} this
1940-
*/next: function next() {
1945+
*/
1946+
next: function next() {
19411947
var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
19421948
var maxIndex = this.length - 1;
19431949
var index = this.index + 1;
@@ -1952,7 +1958,8 @@ var methods = {
19521958
* @param {number} x - The moving distance in the horizontal direction.
19531959
* @param {number} [y=x] The moving distance in the vertical direction.
19541960
* @returns {Viewer} this
1955-
*/move: function move(x) {
1961+
*/
1962+
move: function move(x) {
19561963
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
19571964
var imageData = this.imageData;
19581965
this.moveTo(isUndefined(x) ? x : imageData.x + Number(x), isUndefined(y) ? y : imageData.y + Number(y));
@@ -1964,7 +1971,8 @@ var methods = {
19641971
* @param {number} [y=x] - The new position in the vertical direction.
19651972
* @param {Event} [_originalEvent=null] - The original event if any.
19661973
* @returns {Viewer} this
1967-
*/moveTo: function moveTo(x) {
1974+
*/
1975+
moveTo: function moveTo(x) {
19681976
var _this3 = this;
19691977
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
19701978
var _originalEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
@@ -2032,15 +2040,17 @@ var methods = {
20322040
* Rotate the image with a relative degree.
20332041
* @param {number} degree - The rotate degree.
20342042
* @returns {Viewer} this
2035-
*/rotate: function rotate(degree) {
2043+
*/
2044+
rotate: function rotate(degree) {
20362045
this.rotateTo((this.imageData.rotate || 0) + Number(degree));
20372046
return this;
20382047
},
20392048
/**
20402049
* Rotate the image to an absolute degree.
20412050
* @param {number} degree - The rotate degree.
20422051
* @returns {Viewer} this
2043-
*/rotateTo: function rotateTo(degree) {
2052+
*/
2053+
rotateTo: function rotateTo(degree) {
20442054
var _this4 = this;
20452055
var element = this.element,
20462056
options = this.options,
@@ -2082,15 +2092,17 @@ var methods = {
20822092
* Scale the image on the x-axis.
20832093
* @param {number} scaleX - The scale ratio on the x-axis.
20842094
* @returns {Viewer} this
2085-
*/scaleX: function scaleX(_scaleX) {
2095+
*/
2096+
scaleX: function scaleX(_scaleX) {
20862097
this.scale(_scaleX, this.imageData.scaleY);
20872098
return this;
20882099
},
20892100
/**
20902101
* Scale the image on the y-axis.
20912102
* @param {number} scaleY - The scale ratio on the y-axis.
20922103
* @returns {Viewer} this
2093-
*/scaleY: function scaleY(_scaleY) {
2104+
*/
2105+
scaleY: function scaleY(_scaleY) {
20942106
this.scale(this.imageData.scaleX, _scaleY);
20952107
return this;
20962108
},
@@ -2099,7 +2111,8 @@ var methods = {
20992111
* @param {number} scaleX - The scale ratio on the x-axis.
21002112
* @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
21012113
* @returns {Viewer} this
2102-
*/scale: function scale(scaleX) {
2114+
*/
2115+
scale: function scale(scaleX) {
21032116
var _this5 = this;
21042117
var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
21052118
var element = this.element,
@@ -2165,7 +2178,8 @@ var methods = {
21652178
* @param {Object} [pivot] - The pivot point coordinate for zooming.
21662179
* @param {Event} [_originalEvent=null] - The original event if any.
21672180
* @returns {Viewer} this
2168-
*/zoom: function zoom(ratio) {
2181+
*/
2182+
zoom: function zoom(ratio) {
21692183
var showTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
21702184
var pivot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
21712185
var _originalEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
@@ -2187,7 +2201,8 @@ var methods = {
21872201
* @param {Event} [_originalEvent=null] - The original event if any.
21882202
* @param {Event} [_zoomable=false] - Indicates if the current zoom is available or not.
21892203
* @returns {Viewer} this
2190-
*/zoomTo: function zoomTo(ratio) {
2204+
*/
2205+
zoomTo: function zoomTo(ratio) {
21912206
var _this6 = this;
21922207
var showTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
21932208
var pivot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
@@ -2293,7 +2308,8 @@ var methods = {
22932308
* Play the images
22942309
* @param {boolean|FullscreenOptions} [fullscreen=false] - Indicate if request fullscreen or not.
22952310
* @returns {Viewer} this
2296-
*/play: function play() {
2311+
*/
2312+
play: function play() {
22972313
var _this7 = this;
22982314
var fullscreen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
22992315
if (!this.isShown || this.played) {
@@ -2542,7 +2558,8 @@ var methods = {
25422558
* Toggle the image size between its current size and natural size
25432559
* @param {Event} [_originalEvent=null] - The original event if any.
25442560
* @returns {Viewer} this
2545-
*/toggle: function toggle() {
2561+
*/
2562+
toggle: function toggle() {
25462563
var _originalEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
25472564
if (this.imageData.ratio === 1) {
25482565
this.zoomTo(this.imageData.oldRatio, true, null, _originalEvent);

0 commit comments

Comments
 (0)
Please sign in to comment.