Skip to content

Commit

Permalink
build: release 1.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Oct 22, 2021
1 parent e5b45a4 commit 25df020
Show file tree
Hide file tree
Showing 12 changed files with 1,375 additions and 1,469 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## next
## 1.10.2 (Oct 22, 2021)

- Increase title height for avoiding truncation (#509).
- Fix a `TypeError` when there are not any images (#504).
Expand Down
48 changes: 44 additions & 4 deletions dist/viewer.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.10.1
* Viewer.js v1.10.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2021-08-01T13:35:49.731Z
* Date: 2021-10-22T13:59:51.046Z
*/

'use strict';
Expand Down Expand Up @@ -374,6 +374,7 @@ var EVENT_DRAG_START = 'dragstart';
var EVENT_FOCUSIN = 'focusin';
var EVENT_KEY_DOWN = 'keydown';
var EVENT_LOAD = 'load';
var EVENT_ERROR = 'error';
var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
Expand Down Expand Up @@ -1123,13 +1124,17 @@ var render = {
this.items = items;
forEach(items, function (item) {
var image = item.firstElementChild;
var onLoad;
var onError;
setData(image, 'filled', true);

if (options.loading) {
addClass(item, CLASS_LOADING);
}

addListener(image, EVENT_LOAD, function (event) {
addListener(image, EVENT_LOAD, onLoad = function onLoad(event) {
removeListener(image, EVENT_ERROR, onError);

if (options.loading) {
removeClass(item, CLASS_LOADING);
}
Expand All @@ -1138,6 +1143,15 @@ var render = {
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);

if (options.loading) {
removeClass(item, CLASS_LOADING);
}
}, {
once: true
});
});

if (options.transition) {
Expand All @@ -1151,6 +1165,11 @@ var render = {
renderList: function renderList() {
var index = this.index;
var item = this.items[index];

if (!item) {
return;
}

var next = item.nextElementSibling;
var gutter = parseInt(window.getComputedStyle(next || item).marginLeft, 10);
var offsetWidth = item.offsetWidth;
Expand Down Expand Up @@ -2053,6 +2072,7 @@ var methods = {
};

var onLoad;
var onError;
addListener(element, EVENT_VIEWED, onViewed, {
once: true
});
Expand Down Expand Up @@ -2081,7 +2101,27 @@ var methods = {
if (image.complete) {
this.load();
} else {
addListener(image, EVENT_LOAD, onLoad = this.load.bind(this), {
addListener(image, EVENT_LOAD, onLoad = function onLoad() {
removeListener(image, EVENT_ERROR, onError);

_this2.load();
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);

if (_this2.timeout) {
clearTimeout(_this2.timeout);
_this2.timeout = false;
}

removeClass(image, CLASS_INVISIBLE);

if (options.loading) {
removeClass(_this2.canvas, CLASS_LOADING);
}
}, {
once: true
});

Expand Down
6 changes: 3 additions & 3 deletions dist/viewer.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.10.1
* Viewer.js v1.10.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2021-08-01T13:35:44.576Z
* Date: 2021-10-22T13:59:46.805Z
*/

.viewer-zoom-in::before,
Expand Down Expand Up @@ -332,7 +332,7 @@
color: #ccc;
display: inline-block;
font-size: 12px;
line-height: 1;
line-height: 1.2;
margin: 0 5% 5px;
max-width: 90%;
opacity: 0.8;
Expand Down
48 changes: 44 additions & 4 deletions dist/viewer.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.10.1
* Viewer.js v1.10.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2021-08-01T13:35:49.731Z
* Date: 2021-10-22T13:59:51.046Z
*/

function ownKeys(object, enumerableOnly) {
Expand Down Expand Up @@ -372,6 +372,7 @@ var EVENT_DRAG_START = 'dragstart';
var EVENT_FOCUSIN = 'focusin';
var EVENT_KEY_DOWN = 'keydown';
var EVENT_LOAD = 'load';
var EVENT_ERROR = 'error';
var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
Expand Down Expand Up @@ -1121,13 +1122,17 @@ var render = {
this.items = items;
forEach(items, function (item) {
var image = item.firstElementChild;
var onLoad;
var onError;
setData(image, 'filled', true);

if (options.loading) {
addClass(item, CLASS_LOADING);
}

addListener(image, EVENT_LOAD, function (event) {
addListener(image, EVENT_LOAD, onLoad = function onLoad(event) {
removeListener(image, EVENT_ERROR, onError);

if (options.loading) {
removeClass(item, CLASS_LOADING);
}
Expand All @@ -1136,6 +1141,15 @@ var render = {
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);

if (options.loading) {
removeClass(item, CLASS_LOADING);
}
}, {
once: true
});
});

if (options.transition) {
Expand All @@ -1149,6 +1163,11 @@ var render = {
renderList: function renderList() {
var index = this.index;
var item = this.items[index];

if (!item) {
return;
}

var next = item.nextElementSibling;
var gutter = parseInt(window.getComputedStyle(next || item).marginLeft, 10);
var offsetWidth = item.offsetWidth;
Expand Down Expand Up @@ -2051,6 +2070,7 @@ var methods = {
};

var onLoad;
var onError;
addListener(element, EVENT_VIEWED, onViewed, {
once: true
});
Expand Down Expand Up @@ -2079,7 +2099,27 @@ var methods = {
if (image.complete) {
this.load();
} else {
addListener(image, EVENT_LOAD, onLoad = this.load.bind(this), {
addListener(image, EVENT_LOAD, onLoad = function onLoad() {
removeListener(image, EVENT_ERROR, onError);

_this2.load();
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);

if (_this2.timeout) {
clearTimeout(_this2.timeout);
_this2.timeout = false;
}

removeClass(image, CLASS_INVISIBLE);

if (options.loading) {
removeClass(_this2.canvas, CLASS_LOADING);
}
}, {
once: true
});

Expand Down
52 changes: 46 additions & 6 deletions dist/viewer.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*!
* Viewer.js v1.10.1
* Viewer.js v1.10.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2021-08-01T13:35:49.731Z
* Date: 2021-10-22T13:59:51.046Z
*/

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Viewer = factory());
}(this, (function () { 'use strict';
})(this, (function () { 'use strict';

function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
Expand Down Expand Up @@ -378,6 +378,7 @@
var EVENT_FOCUSIN = 'focusin';
var EVENT_KEY_DOWN = 'keydown';
var EVENT_LOAD = 'load';
var EVENT_ERROR = 'error';
var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
Expand Down Expand Up @@ -1127,13 +1128,17 @@
this.items = items;
forEach(items, function (item) {
var image = item.firstElementChild;
var onLoad;
var onError;
setData(image, 'filled', true);

if (options.loading) {
addClass(item, CLASS_LOADING);
}

addListener(image, EVENT_LOAD, function (event) {
addListener(image, EVENT_LOAD, onLoad = function onLoad(event) {
removeListener(image, EVENT_ERROR, onError);

if (options.loading) {
removeClass(item, CLASS_LOADING);
}
Expand All @@ -1142,6 +1147,15 @@
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);

if (options.loading) {
removeClass(item, CLASS_LOADING);
}
}, {
once: true
});
});

if (options.transition) {
Expand All @@ -1155,6 +1169,11 @@
renderList: function renderList() {
var index = this.index;
var item = this.items[index];

if (!item) {
return;
}

var next = item.nextElementSibling;
var gutter = parseInt(window.getComputedStyle(next || item).marginLeft, 10);
var offsetWidth = item.offsetWidth;
Expand Down Expand Up @@ -2057,6 +2076,7 @@
};

var onLoad;
var onError;
addListener(element, EVENT_VIEWED, onViewed, {
once: true
});
Expand Down Expand Up @@ -2085,7 +2105,27 @@
if (image.complete) {
this.load();
} else {
addListener(image, EVENT_LOAD, onLoad = this.load.bind(this), {
addListener(image, EVENT_LOAD, onLoad = function onLoad() {
removeListener(image, EVENT_ERROR, onError);

_this2.load();
}, {
once: true
});
addListener(image, EVENT_ERROR, onError = function onError() {
removeListener(image, EVENT_LOAD, onLoad);

if (_this2.timeout) {
clearTimeout(_this2.timeout);
_this2.timeout = false;
}

removeClass(image, CLASS_INVISIBLE);

if (options.loading) {
removeClass(_this2.canvas, CLASS_LOADING);
}
}, {
once: true
});

Expand Down Expand Up @@ -3526,4 +3566,4 @@

return Viewer;

})));
}));
6 changes: 3 additions & 3 deletions dist/viewer.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/viewer.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/css/viewer.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.10.1
* Viewer.js v1.10.2
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2021-08-01T13:35:44.576Z
* Date: 2021-10-22T13:59:46.805Z
*/

.viewer-zoom-in::before,
Expand Down Expand Up @@ -332,7 +332,7 @@
color: #ccc;
display: inline-block;
font-size: 12px;
line-height: 1;
line-height: 1.2;
margin: 0 5% 5px;
max-width: 90%;
opacity: 0.8;
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<div class="container">
<div class="row">
<div class="col-md">
<h1>Viewer.js <small class="h6">v1.10.1</small></h1>
<h1>Viewer.js <small class="h6">v1.10.2</small></h1>
<p class="lead">JavaScript image viewer.</p>
</div>
<div class="col-md">
Expand Down
Loading

0 comments on commit 25df020

Please sign in to comment.