Skip to content

Commit

Permalink
build: release 1.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Jun 29, 2019
1 parent b3b9d2f commit 6b531ce
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 116 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.3.5 (Jun 29, 2019)

- Improve escaping function to avoid to escape HTML entities repeatedly.

Expand Down
12 changes: 6 additions & 6 deletions dist/viewer.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.3.4
* Viewer.js v1.3.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-06-01T03:32:35.881Z
* Date: 2019-06-29T10:32:18.607Z
*/

'use strict';
Expand Down Expand Up @@ -451,7 +451,7 @@ function setStyle(element, styles) {
*/

function escapeHTMLEntities(value) {
return isString(value) ? value.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
return isString(value) ? value.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
}
/**
* Check if the given element has a special class.
Expand Down Expand Up @@ -959,7 +959,7 @@ var render = {
var element = this.element,
options = this.options,
list = this.list;
var items = [];
var items = '';
forEach(this.images, function (image, i) {
var src = escapeHTMLEntities(image.src);
var alt = escapeHTMLEntities(image.alt || getImageNameFromURL(src));
Expand All @@ -972,10 +972,10 @@ var render = {
}

if (src || url) {
items.push('<li>' + '<img' + " src=\"".concat(src || url, "\"") + ' role="button"' + ' data-viewer-action="view"' + " data-index=\"".concat(i, "\"") + " data-original-url=\"".concat(url || src, "\"") + " alt=\"".concat(alt, "\"") + '>' + '</li>');
items += '<li>' + '<img' + " src=\"".concat(src || url, "\"") + ' role="button"' + ' data-viewer-action="view"' + " data-index=\"".concat(i, "\"") + " data-original-url=\"".concat(url || src, "\"") + " alt=\"".concat(alt, "\"") + '>' + '</li>';
}
});
list.innerHTML = items.join('');
list.innerHTML = items;
this.items = list.getElementsByTagName('li');
forEach(this.items, function (item) {
var image = item.firstElementChild;
Expand Down
4 changes: 2 additions & 2 deletions dist/viewer.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.3.4
* Viewer.js v1.3.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-06-01T03:32:33.340Z
* Date: 2019-06-29T10:32:15.670Z
*/

.viewer-zoom-in::before,
Expand Down
12 changes: 6 additions & 6 deletions dist/viewer.esm.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.3.4
* Viewer.js v1.3.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-06-01T03:32:35.881Z
* Date: 2019-06-29T10:32:18.607Z
*/

function _typeof(obj) {
Expand Down Expand Up @@ -449,7 +449,7 @@ function setStyle(element, styles) {
*/

function escapeHTMLEntities(value) {
return isString(value) ? value.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
return isString(value) ? value.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
}
/**
* Check if the given element has a special class.
Expand Down Expand Up @@ -957,7 +957,7 @@ var render = {
var element = this.element,
options = this.options,
list = this.list;
var items = [];
var items = '';
forEach(this.images, function (image, i) {
var src = escapeHTMLEntities(image.src);
var alt = escapeHTMLEntities(image.alt || getImageNameFromURL(src));
Expand All @@ -970,10 +970,10 @@ var render = {
}

if (src || url) {
items.push('<li>' + '<img' + " src=\"".concat(src || url, "\"") + ' role="button"' + ' data-viewer-action="view"' + " data-index=\"".concat(i, "\"") + " data-original-url=\"".concat(url || src, "\"") + " alt=\"".concat(alt, "\"") + '>' + '</li>');
items += '<li>' + '<img' + " src=\"".concat(src || url, "\"") + ' role="button"' + ' data-viewer-action="view"' + " data-index=\"".concat(i, "\"") + " data-original-url=\"".concat(url || src, "\"") + " alt=\"".concat(alt, "\"") + '>' + '</li>';
}
});
list.innerHTML = items.join('');
list.innerHTML = items;
this.items = list.getElementsByTagName('li');
forEach(this.items, function (item) {
var image = item.firstElementChild;
Expand Down
12 changes: 6 additions & 6 deletions dist/viewer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.3.4
* Viewer.js v1.3.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-06-01T03:32:35.881Z
* Date: 2019-06-29T10:32:18.607Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -455,7 +455,7 @@
*/

function escapeHTMLEntities(value) {
return isString(value) ? value.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
return isString(value) ? value.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
}
/**
* Check if the given element has a special class.
Expand Down Expand Up @@ -963,7 +963,7 @@
var element = this.element,
options = this.options,
list = this.list;
var items = [];
var items = '';
forEach(this.images, function (image, i) {
var src = escapeHTMLEntities(image.src);
var alt = escapeHTMLEntities(image.alt || getImageNameFromURL(src));
Expand All @@ -976,10 +976,10 @@
}

if (src || url) {
items.push('<li>' + '<img' + " src=\"".concat(src || url, "\"") + ' role="button"' + ' data-viewer-action="view"' + " data-index=\"".concat(i, "\"") + " data-original-url=\"".concat(url || src, "\"") + " alt=\"".concat(alt, "\"") + '>' + '</li>');
items += '<li>' + '<img' + " src=\"".concat(src || url, "\"") + ' role="button"' + ' data-viewer-action="view"' + " data-index=\"".concat(i, "\"") + " data-original-url=\"".concat(url || src, "\"") + " alt=\"".concat(alt, "\"") + '>' + '</li>';
}
});
list.innerHTML = items.join('');
list.innerHTML = items;
this.items = list.getElementsByTagName('li');
forEach(this.items, function (item) {
var image = item.firstElementChild;
Expand Down
4 changes: 2 additions & 2 deletions dist/viewer.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/css/viewer.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.3.4
* Viewer.js v1.3.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-06-01T03:32:33.340Z
* Date: 2019-06-29T10:32:15.670Z
*/

.viewer-zoom-in::before,
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<div class="container">
<div class="row">
<div class="col-md">
<h1>Viewer.js <small class="h6">v1.3.4</small></h1>
<h1>Viewer.js <small class="h6">v1.3.5</small></h1>
<p class="lead">JavaScript image viewer.</p>
</div>
<div class="col-md">
Expand Down
12 changes: 6 additions & 6 deletions docs/js/viewer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Viewer.js v1.3.4
* Viewer.js v1.3.5
* https://fengyuanchen.github.io/viewerjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-06-01T03:32:35.881Z
* Date: 2019-06-29T10:32:18.607Z
*/

(function (global, factory) {
Expand Down Expand Up @@ -455,7 +455,7 @@
*/

function escapeHTMLEntities(value) {
return isString(value) ? value.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
return isString(value) ? value.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
}
/**
* Check if the given element has a special class.
Expand Down Expand Up @@ -963,7 +963,7 @@
var element = this.element,
options = this.options,
list = this.list;
var items = [];
var items = '';
forEach(this.images, function (image, i) {
var src = escapeHTMLEntities(image.src);
var alt = escapeHTMLEntities(image.alt || getImageNameFromURL(src));
Expand All @@ -976,10 +976,10 @@
}

if (src || url) {
items.push('<li>' + '<img' + " src=\"".concat(src || url, "\"") + ' role="button"' + ' data-viewer-action="view"' + " data-index=\"".concat(i, "\"") + " data-original-url=\"".concat(url || src, "\"") + " alt=\"".concat(alt, "\"") + '>' + '</li>');
items += '<li>' + '<img' + " src=\"".concat(src || url, "\"") + ' role="button"' + ' data-viewer-action="view"' + " data-index=\"".concat(i, "\"") + " data-original-url=\"".concat(url || src, "\"") + " alt=\"".concat(alt, "\"") + '>' + '</li>';
}
});
list.innerHTML = items.join('');
list.innerHTML = items;
this.items = list.getElementsByTagName('li');
forEach(this.items, function (item) {
var image = item.firstElementChild;
Expand Down
Loading

0 comments on commit 6b531ce

Please sign in to comment.