Skip to content

Commit

Permalink
Added new simple-lightbox.legacy.js with IE 11 Support. Fixes #175, #178
Browse files Browse the repository at this point in the history
, #183 and some other bugs from 2.4.0
  • Loading branch information
Arinas committed Oct 19, 2020
1 parent 94af357 commit 36f10f1
Show file tree
Hide file tree
Showing 23 changed files with 15,422 additions and 319 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Touch-friendly image lightbox for mobile and desktop
* preloading next and previous image
* Android, iOs and Windows phone support
* CSS3 Transitions with fallback for older browsers
* Works in every modern Browser, even in IE 9+
* Works in every modern Browser, even in IE 11
* Can use jQuery 1.x,2.x and 3.x, but don't need
* Keyboard support
* Pinch to zoom
Expand All @@ -33,6 +33,7 @@ npm install simplelightbox
After that include simple-lightbox(.min).css and simple-lightbox(.min).js to your page.

### Usage
#### Standalone Plugin
When using the standalone variant (`simple-lightbox(.min).js`)
```javascript
new SimpleLightbox('.some-element a', { /* options */ });
Expand All @@ -43,6 +44,18 @@ The jquery-compatible (`simple-lightbox.jquery(.min).js`) variant works as befor
$('.some-element a').simpleLightbox({ /* options */ });
```

#### With Webpack/Browserify/Parcel etc...
Choose the module file you want do import or require.
**Module with Babel tranformation**
```javascript
import SimpleLightbox from "simplelightbox";
```

**Plain ES Module without Babel**
```javascript
import SimpleLightbox from "simplelightbox/dist/simple-lightbox.esm"
```

### Markup
For the default setup, you just need links that are pointing to images.
```markup
Expand Down Expand Up @@ -193,8 +206,9 @@ Run `gulp watch` to enable continous watching of both src/simple-lightbox.js and
Just call `gulp build` to have all files and variants created inside dist!

### Changelog
**2.4.1 - Added new simple-lightbox.legacy.js with IE 11 Support. Fixes #175, #178, #183 and some other bugs from 2.4.0**
**2.4.0 - Added new option for fixed elements class #195**
**2.3.0 - Merged Feature for ESM Modules. Thanks to Serafin Lichtenhahn #173**
**2.3.0 - Merged Feature for ESM Modules. Thanks to Dmytro Hrynevych #180**
**2.2.2 - Fixed direct closing on load error #182**
**2.2.1 - Fixed bug #174 and problem with ES Modules**
**2.2.0 - Added ES Modules support, thanks to @seralichtenhahn for the PR. This fixed #164**
Expand Down Expand Up @@ -272,3 +286,4 @@ Just call `gulp build` to have all files and variants created inside dist!
[Raphael Hättich](https://github.com/RaphaelHaettich)
[Serafin Lichtenhahn](https://github.com/seralichtenhahn)
[Jochen Sengier](https://www.celcius.be) - [Github](https://github.com/celcius-jochen/)
[Dmytro Hrynevych](https://github.com/dmh)
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simplelightbox",
"version": "2.4.0",
"version": "2.4.1",
"homepage": "https://simplelightbox.com/",
"authors": [
"André Rinas <info@andrerinas.de> (https://www.andrerinas.de)"
Expand Down
24 changes: 17 additions & 7 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,700" rel="stylesheet">
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.2.1" />
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.4.1" />
<link rel="stylesheet" href="demo.css" />
<title>SimpleLightbox by André Rinas</title>
</head>
Expand All @@ -14,7 +14,7 @@
<div class="header-container">
<div class="container demo-container">
<div class="info">
<h1>SimpleLightbox <sup>v2.4.0</sup></h1>
<h1>SimpleLightbox <sup>v2.4.1</sup></h1>
<span class="subline">Touch-friendly image lightbox</span>
<nav>
<a class="btn donate" target="_blank" href="https://www.paypal.me/anrinas">Donate</a>
Expand Down Expand Up @@ -90,6 +90,7 @@ <h2>Install</h2>
<h2>Usage</h2>
</div>
<div class="col-right">
<h3>Standalone Plugin</h3>
<p>
When using the standalone variant (`simple-lightbox(.min).js`)
</p>
Expand All @@ -98,10 +99,14 @@ <h2>Usage</h2>
When using the standalone variant (`simple-lightbox(.min).js`)
</p>
<pre class="language-javascript"><code class="language-javascript">var lightbox = $('.gallery a').simpleLightbox({ /* options */ });</code></pre>
<p>
SimpleLightbox supports ES-Modules. So you can import and use it like:
</p>
<pre class="language-javascript"><code class="language-javascript">import SimpleLightbox from "simplelightbox/dist/simple-lightbox.modules.js";</code></pre>

<h3>With Webpack/Browserify/Parcel etc...</h3>
<p>Choose the module file you want do import or require.</p>
<strong>Module with Babel tranformation<strong><br>
<pre class="language-javascript"><code class="language-javascript">import SimpleLightbox from "simplelightbox";</code></pre>
<br>
<strong>Plain ES Module without Babel<strong><br>
<pre class="language-javascript"><code class="language-javascript">import SimpleLightbox from "simplelightbox/dist/simple-lightbox.esm";</code></pre>
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -594,6 +599,7 @@ <h2>Customization</h2>
<h2>Changelog</h2>
</div>
<div class="col-right">
<strong>2.4.1</strong> - Added new simple-lightbox.legacy.js with IE 11 Support<br />
<strong>2.4.0</strong> - Added new option for fixed elements class #195<br />
<strong>2.3.0</strong> - Merged Feature for ESM Modules. Thanks to Serafin Lichtenhahn #173<br />
<strong>2.2.1</strong> - Fixed bug #174 and problem with ES Modules<br />
Expand Down Expand Up @@ -679,6 +685,10 @@ <h2>Author/<br />Contributors</h2>
<a href="https://github.com/bitstarr">bitstarr</a><br>
<a href="http://geoffrey.crofte.fr/">Geoffrey Crofte</a> - <a href="https://github.com/creativejuiz/">Github</a><br>
<a href="http://webseiten-anders.de/">Karl Anders</a> - <a href="https://github.com/karland/">Github</a>
<a href="https://github.com/RaphaelHaettich">Raphael Hättich</a>
<a href="https://github.com/seralichtenhahn">Serafin Lichtenhahn</a>
<a href="https://www.celcius.be">Jochen Sengier</a> - <a href="https://github.com/celcius-jochen/">Github</a>
<a href="https://github.com/dmh">Dmytro Hrynevych</a>
</p>
</div>
</div>
Expand All @@ -694,7 +704,7 @@ <h2>Author/<br />Contributors</h2>
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/michalsnik/aos@2.1.1/dist/aos.js"></script>
<script src="../dist/simple-lightbox.js?v2.4.0"></script>
<script src="../dist/simple-lightbox.min.js?v2.4.1"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
Expand Down
4 changes: 2 additions & 2 deletions demo/onlyImages.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title>Simple Lightbox - Responsive touch friendly Image lightbox</title>
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,700" rel="stylesheet">
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.2.1" />
<link rel="stylesheet" href="../dist/simple-lightbox.css?v2.4.1" />
<style>
body {
font-family: 'Raleway', sans-serif;
Expand Down Expand Up @@ -62,7 +62,7 @@ <h1 class="align-center">Simple Lightbox Demo Page</h1>
<p>All images are free availabled on <a href="https://unsplash.com/" target="_blank">Unsplash</a></p>
<p>Documentation and download <a target="_blank" href="https://simplelightbox.com">here</a></p>
</div>
<script src="../dist/simple-lightbox.js?v2.4.0"></script>
<script src="../dist/simple-lightbox.js?v2.4.1"></script>
<script>
(function() {
var $gallery = new SimpleLightbox('.gallery a', {});
Expand Down
2 changes: 1 addition & 1 deletion dist/simple-lightbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.2.2
Version 2.4.1
*/
body.hidden-scroll {
overflow: hidden; }
Expand Down
6 changes: 4 additions & 2 deletions dist/simple-lightbox.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.2.2
Version 2.4.1
*/
class SimpleLightbox {

Expand Down Expand Up @@ -1317,4 +1317,6 @@ class SimpleLightbox {
return this;
}
}
export default SimpleLightbox;
export default SimpleLightbox;

global.SimpleLightbox = SimpleLightbox;
37 changes: 28 additions & 9 deletions dist/simple-lightbox.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,33 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.2.2
Version 2.4.1
*/
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";

function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
require('./simple-lightbox');

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
(function ($, window, document, undefined) {
'use strict';

$.fn.simpleLightbox = function (options) {
return this.length ? new SimpleLightbox(this.get(), options) : null;
};
})(jQuery, window, document);

},{"./simple-lightbox":2}],2:[function(require,module,exports){
(function (global){(function (){
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;

function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

Expand Down Expand Up @@ -1579,10 +1599,9 @@ var SimpleLightbox = /*#__PURE__*/function () {
return SimpleLightbox;
}();

(function ($, window, document, undefined) {
'use strict';
var _default = SimpleLightbox;
exports["default"] = _default;
global.SimpleLightbox = SimpleLightbox;

$.fn.simpleLightbox = function (options) {
return new SimpleLightbox(this.get(), options);
};
})(jQuery, window, document);
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1]);
8 changes: 1 addition & 7 deletions dist/simple-lightbox.jquery.min.js

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions dist/simple-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
By André Rinas, www.andrerinas.de
Documentation, www.simplelightbox.de
Available for use under the MIT License
Version 2.2.2
Version 2.4.1
*/
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){(function (){
"use strict";

function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

Expand Down Expand Up @@ -1577,4 +1584,11 @@ var SimpleLightbox = /*#__PURE__*/function () {
}]);

return SimpleLightbox;
}();
}();

var _default = SimpleLightbox;
exports["default"] = _default;
global.SimpleLightbox = SimpleLightbox;

}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1]);

0 comments on commit 36f10f1

Please sign in to comment.