From ae4ab7a825f0a71311fe7effb2bbc655ff3a78ae Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 26 Jun 2017 15:36:29 +0200 Subject: [PATCH] Added lightbox --- README.md | 5 +- assets/3rdparty/lightbox/ekko-lightbox.css | 2 + assets/3rdparty/lightbox/ekko-lightbox.js | 660 ++++++++++++++++++ assets/3rdparty/lightbox/ekko-lightbox.js.map | 1 + .../3rdparty/lightbox/ekko-lightbox.min.css | 2 + .../lightbox/ekko-lightbox.min.css.map | 1 + assets/3rdparty/lightbox/ekko-lightbox.min.js | 2 + .../lightbox/ekko-lightbox.min.js.map | 1 + assets/js/common/utils.js | 3 + .../components/conversations/chatWindows.js | 19 +- corePage/config/dev.config.php | 6 + 11 files changed, 699 insertions(+), 3 deletions(-) create mode 100644 assets/3rdparty/lightbox/ekko-lightbox.css create mode 100644 assets/3rdparty/lightbox/ekko-lightbox.js create mode 100644 assets/3rdparty/lightbox/ekko-lightbox.js.map create mode 100644 assets/3rdparty/lightbox/ekko-lightbox.min.css create mode 100644 assets/3rdparty/lightbox/ekko-lightbox.min.css.map create mode 100644 assets/3rdparty/lightbox/ekko-lightbox.min.js create mode 100644 assets/3rdparty/lightbox/ekko-lightbox.min.js.map diff --git a/README.md b/README.md index ea859948..3a33a813 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ WebComunic RestClient (Javascript WebApplication) ComunicWeb would not exists without the following technologies developped by their respective owner : - Jquery -- bootstrap +- Bootstrap - font-awesome - ionicons - adminLTE @@ -15,4 +15,5 @@ ComunicWeb would not exists without the following technologies developped by the - Select2 4.0 - bootstrap-notify - Twitter Emoji (https://github.com/twitter/twemoji) -- jQuery Textarea AutoSize plugin (by Javier Julio) \ No newline at end of file +- jQuery Textarea AutoSize plugin (by Javier Julio) +- lightbox (https://github.com/ashleydw/lightbox) \ No newline at end of file diff --git a/assets/3rdparty/lightbox/ekko-lightbox.css b/assets/3rdparty/lightbox/ekko-lightbox.css new file mode 100644 index 00000000..0e619ee2 --- /dev/null +++ b/assets/3rdparty/lightbox/ekko-lightbox.css @@ -0,0 +1,2 @@ +.ekko-lightbox-container{position:relative}.ekko-lightbox-container>div.ekko-lightbox-item{position:absolute;top:0;left:0;bottom:0;right:0;width:100%}.ekko-lightbox iframe{width:100%;height:100%}.ekko-lightbox-nav-overlay{z-index:1;position:absolute;top:0;left:0;width:100%;height:100%;display:-ms-flexbox;display:flex}.ekko-lightbox-nav-overlay a{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0;transition:opacity .5s;color:#fff;font-size:30px;z-index:1}.ekko-lightbox-nav-overlay a>*{-ms-flex-positive:1;flex-grow:1}.ekko-lightbox-nav-overlay a>:focus{outline:none}.ekko-lightbox-nav-overlay a span{padding:0 30px}.ekko-lightbox-nav-overlay a:last-child span{text-align:right}.ekko-lightbox-nav-overlay a:hover{text-decoration:none}.ekko-lightbox-nav-overlay a:focus{outline:none}.ekko-lightbox-nav-overlay a.disabled{cursor:default;visibility:hidden}.ekko-lightbox a:hover{opacity:1;text-decoration:none}.ekko-lightbox .modal-dialog{display:none}.ekko-lightbox .modal-footer{text-align:left}.ekko-lightbox-loader{position:absolute;top:0;left:0;bottom:0;right:0;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.ekko-lightbox-loader>div{width:40px;height:40px;position:relative;text-align:center}.ekko-lightbox-loader>div>div{width:100%;height:100%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;animation:a 2s infinite ease-in-out}.ekko-lightbox-loader>div>div:last-child{animation-delay:-1s}.modal-dialog .ekko-lightbox-loader>div>div{background-color:#333}@keyframes a{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}} +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVra28tbGlnaHRib3guY3N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2IHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzMzMztcbn1cbkAtd2Via2l0LWtleWZyYW1lcyBzay1ib3VuY2Uge1xuICAwJSxcbiAgMTAwJSB7XG4gICAgLXdlYmtpdC10cmFuc2Zvcm06IHNjYWxlKDApO1xuICB9XG4gIDUwJSB7XG4gICAgLXdlYmtpdC10cmFuc2Zvcm06IHNjYWxlKDEpO1xuICB9XG59XG5Aa2V5ZnJhbWVzIHNrLWJvdW5jZSB7XG4gIDAlLFxuICAxMDAlIHtcbiAgICB0cmFuc2Zvcm06IHNjYWxlKDApO1xuICAgIC13ZWJraXQtdHJhbnNmb3JtOiBzY2FsZSgwKTtcbiAgfVxuICA1MCUge1xuICAgIHRyYW5zZm9ybTogc2NhbGUoMSk7XG4gICAgLXdlYmtpdC10cmFuc2Zvcm06IHNjYWxlKDEpO1xuICB9XG59XG4iXX0= */ \ No newline at end of file diff --git a/assets/3rdparty/lightbox/ekko-lightbox.js b/assets/3rdparty/lightbox/ekko-lightbox.js new file mode 100644 index 00000000..07810871 --- /dev/null +++ b/assets/3rdparty/lightbox/ekko-lightbox.js @@ -0,0 +1,660 @@ +/*! + * Lightbox for Bootstrap by @ashleydw + * https://github.com/ashleydw/lightbox + * + * License: https://github.com/ashleydw/lightbox/blob/master/LICENSE + */ ++function ($) { + +'use strict'; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var Lightbox = (function ($) { + + var NAME = 'ekkoLightbox'; + var JQUERY_NO_CONFLICT = $.fn[NAME]; + + var Default = { + title: '', + footer: '', + showArrows: true, //display the left / right arrows or not + wrapping: true, //if true, gallery loops infinitely + type: null, //force the lightbox into image / youtube mode. if null, or not image|youtube|vimeo; detect it + alwaysShowClose: false, //always show the close button, even if there is no title + loadingMessage: '
', // http://tobiasahlin.com/spinkit/ + leftArrow: '', + rightArrow: '', + strings: { + close: 'Close', + fail: 'Failed to load image:', + type: 'Could not detect remote target type. Force the type using data-type' + }, + doc: document, // if in an iframe can specify top.document + onShow: function onShow() {}, + onShown: function onShown() {}, + onHide: function onHide() {}, + onHidden: function onHidden() {}, + onNavigate: function onNavigate() {}, + onContentLoaded: function onContentLoaded() {} + }; + + var Lightbox = (function () { + _createClass(Lightbox, null, [{ + key: 'Default', + + /** + + Class properties: + + _$element: null -> the element currently being displayed + _$modal: The bootstrap modal generated + _$modalDialog: The .modal-dialog + _$modalContent: The .modal-content + _$modalBody: The .modal-body + _$modalHeader: The .modal-header + _$modalFooter: The .modal-footer + _$lightboxContainerOne: Container of the first lightbox element + _$lightboxContainerTwo: Container of the second lightbox element + _$lightboxBody: First element in the container + _$modalArrows: The overlayed arrows container + _$galleryItems: Other 's available for this gallery + _galleryName: Name of the current data('gallery') showing + _galleryIndex: The current index of the _$galleryItems being shown + _config: {} the options for the modal + _modalId: unique id for the current lightbox + _padding / _border: CSS properties for the modal container; these are used to calculate the available space for the content + */ + + get: function get() { + return Default; + } + }]); + + function Lightbox($element, config) { + var _this = this; + + _classCallCheck(this, Lightbox); + + this._config = $.extend({}, Default, config); + this._$modalArrows = null; + this._galleryIndex = 0; + this._galleryName = null; + this._padding = null; + this._border = null; + this._titleIsShown = false; + this._footerIsShown = false; + this._wantedWidth = 0; + this._wantedHeight = 0; + this._touchstartX = 0; + this._touchendX = 0; + + this._modalId = 'ekkoLightbox-' + Math.floor(Math.random() * 1000 + 1); + this._$element = $element instanceof jQuery ? $element : $($element); + + this._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3; + + var h4 = ''; + var btn = ''; + + var header = ''; + var footer = ''; + var body = ''; + var dialog = ''; + $(this._config.doc.body).append(''); + + this._$modal = $('#' + this._modalId, this._config.doc); + this._$modalDialog = this._$modal.find('.modal-dialog').first(); + this._$modalContent = this._$modal.find('.modal-content').first(); + this._$modalBody = this._$modal.find('.modal-body').first(); + this._$modalHeader = this._$modal.find('.modal-header').first(); + this._$modalFooter = this._$modal.find('.modal-footer').first(); + + this._$lightboxContainer = this._$modalBody.find('.ekko-lightbox-container').first(); + this._$lightboxBodyOne = this._$lightboxContainer.find('> div:first-child').first(); + this._$lightboxBodyTwo = this._$lightboxContainer.find('> div:last-child').first(); + + this._border = this._calculateBorders(); + this._padding = this._calculatePadding(); + + this._galleryName = this._$element.data('gallery'); + if (this._galleryName) { + this._$galleryItems = $(document.body).find('*[data-gallery="' + this._galleryName + '"]'); + this._galleryIndex = this._$galleryItems.index(this._$element); + $(document).on('keydown.ekkoLightbox', this._navigationalBinder.bind(this)); + + // add the directional arrows to the modal + if (this._config.showArrows && this._$galleryItems.length > 1) { + this._$lightboxContainer.append('
' + this._config.leftArrow + '' + this._config.rightArrow + '
'); + this._$modalArrows = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay').first(); + this._$lightboxContainer.on('click', 'a:first-child', function (event) { + event.preventDefault(); + return _this.navigateLeft(); + }); + this._$lightboxContainer.on('click', 'a:last-child', function (event) { + event.preventDefault(); + return _this.navigateRight(); + }); + this.updateNavigation(); + } + } + + this._$modal.on('show.bs.modal', this._config.onShow.bind(this)).on('shown.bs.modal', function () { + _this._toggleLoading(true); + _this._handle(); + return _this._config.onShown.call(_this); + }).on('hide.bs.modal', this._config.onHide.bind(this)).on('hidden.bs.modal', function () { + if (_this._galleryName) { + $(document).off('keydown.ekkoLightbox'); + $(window).off('resize.ekkoLightbox'); + } + _this._$modal.remove(); + return _this._config.onHidden.call(_this); + }).modal(this._config); + + $(window).on('resize.ekkoLightbox', function () { + _this._resize(_this._wantedWidth, _this._wantedHeight); + }); + this._$lightboxContainer.on('touchstart', function () { + _this._touchstartX = event.changedTouches[0].screenX; + }).on('touchend', function () { + _this._touchendX = event.changedTouches[0].screenX; + _this._swipeGesure(); + }); + } + + _createClass(Lightbox, [{ + key: 'element', + value: function element() { + return this._$element; + } + }, { + key: 'modal', + value: function modal() { + return this._$modal; + } + }, { + key: 'navigateTo', + value: function navigateTo(index) { + + if (index < 0 || index > this._$galleryItems.length - 1) return this; + + this._galleryIndex = index; + + this.updateNavigation(); + + this._$element = $(this._$galleryItems.get(this._galleryIndex)); + this._handle(); + } + }, { + key: 'navigateLeft', + value: function navigateLeft() { + + if (!this._$galleryItems) return; + + if (this._$galleryItems.length === 1) return; + + if (this._galleryIndex === 0) { + if (this._config.wrapping) this._galleryIndex = this._$galleryItems.length - 1;else return; + } else //circular + this._galleryIndex--; + + this._config.onNavigate.call(this, 'left', this._galleryIndex); + return this.navigateTo(this._galleryIndex); + } + }, { + key: 'navigateRight', + value: function navigateRight() { + + if (!this._$galleryItems) return; + + if (this._$galleryItems.length === 1) return; + + if (this._galleryIndex === this._$galleryItems.length - 1) { + if (this._config.wrapping) this._galleryIndex = 0;else return; + } else //circular + this._galleryIndex++; + + this._config.onNavigate.call(this, 'right', this._galleryIndex); + return this.navigateTo(this._galleryIndex); + } + }, { + key: 'updateNavigation', + value: function updateNavigation() { + if (!this._config.wrapping) { + var $nav = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay'); + if (this._galleryIndex === 0) $nav.find('a:first-child').addClass('disabled');else $nav.find('a:first-child').removeClass('disabled'); + + if (this._galleryIndex === this._$galleryItems.length - 1) $nav.find('a:last-child').addClass('disabled');else $nav.find('a:last-child').removeClass('disabled'); + } + } + }, { + key: 'close', + value: function close() { + return this._$modal.modal('hide'); + } + + // helper private methods + }, { + key: '_navigationalBinder', + value: function _navigationalBinder(event) { + event = event || window.event; + if (event.keyCode === 39) return this.navigateRight(); + if (event.keyCode === 37) return this.navigateLeft(); + } + + // type detection private methods + }, { + key: '_detectRemoteType', + value: function _detectRemoteType(src, type) { + + type = type || false; + + if (!type && this._isImage(src)) type = 'image'; + if (!type && this._getYoutubeId(src)) type = 'youtube'; + if (!type && this._getVimeoId(src)) type = 'vimeo'; + if (!type && this._getInstagramId(src)) type = 'instagram'; + + if (!type || ['image', 'youtube', 'vimeo', 'instagram', 'video', 'url'].indexOf(type) < 0) type = 'url'; + + return type; + } + }, { + key: '_isImage', + value: function _isImage(string) { + return string && string.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); + } + }, { + key: '_containerToUse', + value: function _containerToUse() { + var _this2 = this; + + // if currently showing an image, fade it out and remove + var $toUse = this._$lightboxBodyTwo; + var $current = this._$lightboxBodyOne; + + if (this._$lightboxBodyTwo.hasClass('in')) { + $toUse = this._$lightboxBodyOne; + $current = this._$lightboxBodyTwo; + } + + $current.removeClass('in show'); + setTimeout(function () { + if (!_this2._$lightboxBodyTwo.hasClass('in')) _this2._$lightboxBodyTwo.empty(); + if (!_this2._$lightboxBodyOne.hasClass('in')) _this2._$lightboxBodyOne.empty(); + }, 500); + + $toUse.addClass('in show'); + return $toUse; + } + }, { + key: '_handle', + value: function _handle() { + + var $toUse = this._containerToUse(); + this._updateTitleAndFooter(); + + var currentRemote = this._$element.attr('data-remote') || this._$element.attr('href'); + var currentType = this._detectRemoteType(currentRemote, this._$element.attr('data-type') || false); + + if (['image', 'youtube', 'vimeo', 'instagram', 'video', 'url'].indexOf(currentType) < 0) return this._error(this._config.strings.type); + + switch (currentType) { + case 'image': + this._preloadImage(currentRemote, $toUse); + this._preloadImageByIndex(this._galleryIndex, 3); + break; + case 'youtube': + this._showYoutubeVideo(currentRemote, $toUse); + break; + case 'vimeo': + this._showVimeoVideo(this._getVimeoId(currentRemote), $toUse); + break; + case 'instagram': + this._showInstagramVideo(this._getInstagramId(currentRemote), $toUse); + break; + case 'video': + this._showHtml5Video(currentRemote, $toUse); + break; + default: + // url + this._loadRemoteContent(currentRemote, $toUse); + break; + } + + return this; + } + }, { + key: '_getYoutubeId', + value: function _getYoutubeId(string) { + if (!string) return false; + var matches = string.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/); + return matches && matches[2].length === 11 ? matches[2] : false; + } + }, { + key: '_getVimeoId', + value: function _getVimeoId(string) { + return string && string.indexOf('vimeo') > 0 ? string : false; + } + }, { + key: '_getInstagramId', + value: function _getInstagramId(string) { + return string && string.indexOf('instagram') > 0 ? string : false; + } + + // layout private methods + }, { + key: '_toggleLoading', + value: function _toggleLoading(show) { + show = show || false; + if (show) { + this._$modalDialog.css('display', 'none'); + this._$modal.removeClass('in show'); + $('.modal-backdrop').append(this._config.loadingMessage); + } else { + this._$modalDialog.css('display', 'block'); + this._$modal.addClass('in show'); + $('.modal-backdrop').find('.ekko-lightbox-loader').remove(); + } + return this; + } + }, { + key: '_calculateBorders', + value: function _calculateBorders() { + return { + top: this._totalCssByAttribute('border-top-width'), + right: this._totalCssByAttribute('border-right-width'), + bottom: this._totalCssByAttribute('border-bottom-width'), + left: this._totalCssByAttribute('border-left-width') + }; + } + }, { + key: '_calculatePadding', + value: function _calculatePadding() { + return { + top: this._totalCssByAttribute('padding-top'), + right: this._totalCssByAttribute('padding-right'), + bottom: this._totalCssByAttribute('padding-bottom'), + left: this._totalCssByAttribute('padding-left') + }; + } + }, { + key: '_totalCssByAttribute', + value: function _totalCssByAttribute(attribute) { + return parseInt(this._$modalDialog.css(attribute), 10) + parseInt(this._$modalContent.css(attribute), 10) + parseInt(this._$modalBody.css(attribute), 10); + } + }, { + key: '_updateTitleAndFooter', + value: function _updateTitleAndFooter() { + var title = this._$element.data('title') || ""; + var caption = this._$element.data('footer') || ""; + + this._titleIsShown = false; + if (title || this._config.alwaysShowClose) { + this._titleIsShown = true; + this._$modalHeader.css('display', '').find('.modal-title').html(title || " "); + } else this._$modalHeader.css('display', 'none'); + + this._footerIsShown = false; + if (caption) { + this._footerIsShown = true; + this._$modalFooter.css('display', '').html(caption); + } else this._$modalFooter.css('display', 'none'); + + return this; + } + }, { + key: '_showYoutubeVideo', + value: function _showYoutubeVideo(remote, $containerForElement) { + var id = this._getYoutubeId(remote); + var query = remote.indexOf('&') > 0 ? remote.substr(remote.indexOf('&')) : ''; + var width = this._$element.data('width') || 560; + var height = this._$element.data('height') || width / (560 / 315); + return this._showVideoIframe('//www.youtube.com/embed/' + id + '?badge=0&autoplay=1&html5=1' + query, width, height, $containerForElement); + } + }, { + key: '_showVimeoVideo', + value: function _showVimeoVideo(id, $containerForElement) { + var width = this._$element.data('width') || 500; + var height = this._$element.data('height') || width / (560 / 315); + return this._showVideoIframe(id + '?autoplay=1', width, height, $containerForElement); + } + }, { + key: '_showInstagramVideo', + value: function _showInstagramVideo(id, $containerForElement) { + // instagram load their content into iframe's so this can be put straight into the element + var width = this._$element.data('width') || 612; + var height = width + 80; + id = id.substr(-1) !== '/' ? id + '/' : id; // ensure id has trailing slash + $containerForElement.html(''); + this._resize(width, height); + this._config.onContentLoaded.call(this); + if (this._$modalArrows) //hide the arrows when showing video + this._$modalArrows.css('display', 'none'); + this._toggleLoading(false); + return this; + } + }, { + key: '_showVideoIframe', + value: function _showVideoIframe(url, width, height, $containerForElement) { + // should be used for videos only. for remote content use loadRemoteContent (data-type=url) + height = height || width; // default to square + $containerForElement.html('
'); + this._resize(width, height); + this._config.onContentLoaded.call(this); + if (this._$modalArrows) this._$modalArrows.css('display', 'none'); //hide the arrows when showing video + this._toggleLoading(false); + return this; + } + }, { + key: '_showHtml5Video', + value: function _showHtml5Video(url, $containerForElement) { + // should be used for videos only. for remote content use loadRemoteContent (data-type=url) + var width = this._$element.data('width') || 560; + var height = this._$element.data('height') || width / (560 / 315); + $containerForElement.html('
'); + this._resize(width, height); + this._config.onContentLoaded.call(this); + if (this._$modalArrows) this._$modalArrows.css('display', 'none'); //hide the arrows when showing video + this._toggleLoading(false); + return this; + } + }, { + key: '_loadRemoteContent', + value: function _loadRemoteContent(url, $containerForElement) { + var _this3 = this; + + var width = this._$element.data('width') || 560; + var height = this._$element.data('height') || 560; + + var disableExternalCheck = this._$element.data('disableExternalCheck') || false; + this._toggleLoading(false); + + // external urls are loading into an iframe + // local ajax can be loaded into the container itself + if (!disableExternalCheck && !this._isExternal(url)) { + $containerForElement.load(url, $.proxy(function () { + return _this3._$element.trigger('loaded.bs.modal');l; + })); + } else { + $containerForElement.html(''); + this._config.onContentLoaded.call(this); + } + + if (this._$modalArrows) //hide the arrows when remote content + this._$modalArrows.css('display', 'none'); + + this._resize(width, height); + return this; + } + }, { + key: '_isExternal', + value: function _isExternal(url) { + var match = url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/); + if (typeof match[1] === "string" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol) return true; + + if (typeof match[2] === "string" && match[2].length > 0 && match[2].replace(new RegExp(':(' + ({ + "http:": 80, + "https:": 443 + })[location.protocol] + ')?$'), "") !== location.host) return true; + + return false; + } + }, { + key: '_error', + value: function _error(message) { + console.error(message); + this._containerToUse().html(message); + this._resize(300, 300); + return this; + } + }, { + key: '_preloadImageByIndex', + value: function _preloadImageByIndex(startIndex, numberOfTimes) { + + if (!this._$galleryItems) return; + + var next = $(this._$galleryItems.get(startIndex), false); + if (typeof next == 'undefined') return; + + var src = next.attr('data-remote') || next.attr('href'); + if (next.attr('data-type') === 'image' || this._isImage(src)) this._preloadImage(src, false); + + if (numberOfTimes > 0) return this._preloadImageByIndex(startIndex + 1, numberOfTimes - 1); + } + }, { + key: '_preloadImage', + value: function _preloadImage(src, $containerForImage) { + var _this4 = this; + + $containerForImage = $containerForImage || false; + + var img = new Image(); + if ($containerForImage) { + (function () { + + // if loading takes > 200ms show a loader + var loadingTimeout = setTimeout(function () { + $containerForImage.append(_this4._config.loadingMessage); + }, 200); + + img.onload = function () { + if (loadingTimeout) clearTimeout(loadingTimeout); + loadingTimeout = null; + var image = $(''); + image.attr('src', img.src); + image.addClass('img-fluid'); + + // backward compatibility for bootstrap v3 + image.css('width', '100%'); + + $containerForImage.html(image); + if (_this4._$modalArrows) _this4._$modalArrows.css('display', ''); // remove display to default to css property + + _this4._resize(img.width, img.height); + _this4._toggleLoading(false); + return _this4._config.onContentLoaded.call(_this4); + }; + img.onerror = function () { + _this4._toggleLoading(false); + return _this4._error(_this4._config.strings.fail + (' ' + src)); + }; + })(); + } + + img.src = src; + return img; + } + }, { + key: '_swipeGesure', + value: function _swipeGesure() { + if (this._touchendX < this._touchstartX) { + return this.navigateRight(); + } + if (this._touchendX > this._touchstartX) { + return this.navigateLeft(); + } + } + }, { + key: '_resize', + value: function _resize(width, height) { + + height = height || width; + this._wantedWidth = width; + this._wantedHeight = height; + + // if width > the available space, scale down the expected width and height + var widthBorderAndPadding = this._padding.left + this._padding.right + this._border.left + this._border.right; + var maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth); + if (width + widthBorderAndPadding > maxWidth) { + height = (maxWidth - widthBorderAndPadding) / width * height; + width = maxWidth; + } else width = width + widthBorderAndPadding; + + var headerHeight = 0, + footerHeight = 0; + + // as the resize is performed the modal is show, the calculate might fail + // if so, default to the default sizes + if (this._footerIsShown) footerHeight = this._$modalFooter.outerHeight(true) || 55; + + if (this._titleIsShown) headerHeight = this._$modalHeader.outerHeight(true) || 67; + + var borderPadding = this._padding.top + this._padding.bottom + this._border.bottom + this._border.top; + + //calculated each time as resizing the window can cause them to change due to Bootstraps fluid margins + var margins = parseFloat(this._$modalDialog.css('margin-top')) + parseFloat(this._$modalDialog.css('margin-bottom')); + + var maxHeight = Math.min(height, $(window).height() - borderPadding - margins - headerHeight - footerHeight); + if (height > maxHeight) { + // if height > the available height, scale down the width + var factor = Math.min(maxHeight / height, 1); + width = Math.ceil(factor * width); + } + + this._$lightboxContainer.css('height', maxHeight); + this._$modalDialog.css('width', 'auto').css('maxWidth', width); + + var modal = this._$modal.data('bs.modal'); + if (modal) { + // v4 method is mistakenly protected + try { + modal._handleUpdate(); + } catch (Exception) { + modal.handleUpdate(); + } + } + return this; + } + }], [{ + key: '_jQueryInterface', + value: function _jQueryInterface(config) { + var _this5 = this; + + config = config || {}; + return this.each(function () { + var $this = $(_this5); + var _config = $.extend({}, Lightbox.Default, $this.data(), typeof config === 'object' && config); + + new Lightbox(_this5, _config); + }); + } + }]); + + return Lightbox; + })(); + + $.fn[NAME] = Lightbox._jQueryInterface; + $.fn[NAME].Constructor = Lightbox; + $.fn[NAME].noConflict = function () { + $.fn[NAME] = JQUERY_NO_CONFLICT; + return Lightbox._jQueryInterface; + }; + + return Lightbox; +})(jQuery); +//# sourceMappingURL=ekko-lightbox.js.map + +}(jQuery); diff --git a/assets/3rdparty/lightbox/ekko-lightbox.js.map b/assets/3rdparty/lightbox/ekko-lightbox.js.map new file mode 100644 index 00000000..28fe47f5 --- /dev/null +++ b/assets/3rdparty/lightbox/ekko-lightbox.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../ekko-lightbox.js"],"names":[],"mappings":";;;;;;AAAA,IAAM,QAAQ,GAAG,CAAC,UAAC,CAAC,EAAK;;AAExB,KAAM,IAAI,GAAG,cAAc,CAAA;AAC3B,KAAM,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;;AAErC,KAAM,OAAO,GAAG;AACf,OAAK,EAAE,EAAE;AACT,QAAM,EAAE,EAAE;AACV,YAAU,EAAE,IAAI;AAChB,UAAQ,EAAE,IAAI;AACd,MAAI,EAAE,IAAI;AACV,iBAAe,EAAE,KAAK;AACtB,gBAAc,EAAE,2EAA2E;AAC3F,WAAS,EAAE,uBAAuB;AAClC,YAAU,EAAE,uBAAuB;AACnC,SAAO,EAAE;AACR,QAAK,EAAE,OAAO;AACd,OAAI,EAAE,uBAAuB;AAC7B,OAAI,EAAE,qEAAqE;GAC3E;AACD,KAAG,EAAE,QAAQ;AACb,QAAM,EAAA,kBAAG,EAAE;AACX,SAAO,EAAA,mBAAG,EAAE;AACZ,QAAM,EAAA,k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QAAQ,CAAC,gBAAgB,CAAA;AAClD,EAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,GAAG,QAAQ,CAAA;AACjC,EAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,GAAI,YAAM;AAC9B,GAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAA;AAC/B,SAAO,QAAQ,CAAC,gBAAgB,CAAA;EAChC,CAAA;;AAED,QAAO,QAAQ,CAAA;CAEf,CAAA,CAAE,MAAM,CAAC,CAAA","file":"ekko-lightbox.js","sourcesContent":["const Lightbox = (($) => {\n\t\n\tconst NAME = 'ekkoLightbox'\n\tconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\n\tconst Default = {\n\t\ttitle: '',\n\t\tfooter: '',\n\t\tshowArrows: true, //display the left / right arrows or not\n\t\twrapping: true, //if true, gallery loops infinitely\n\t\ttype: null, //force the lightbox into image / youtube mode. if null, or not image|youtube|vimeo; detect it\n\t\talwaysShowClose: false, //always show the close button, even if there is no title\n\t\tloadingMessage: '
', // http://tobiasahlin.com/spinkit/\n\t\tleftArrow: '',\n\t\trightArrow: '',\n\t\tstrings: {\n\t\t\tclose: 'Close',\n\t\t\tfail: 'Failed to load image:',\n\t\t\ttype: 'Could not detect remote target type. Force the type using data-type',\n\t\t},\n\t\tdoc: document, // if in an iframe can specify top.document\n\t\tonShow() {},\n\t\tonShown() {},\n\t\tonHide() {},\n\t\tonHidden() {},\n\t\tonNavigate() {},\n\t\tonContentLoaded() {}\n\t}\n\n\tclass Lightbox {\n\n\t\t/**\n\t\t \n\t Class properties:\n\t\t \n\t\t _$element: null -> the element currently being displayed\n\t\t _$modal: The bootstrap modal generated\n\t\t _$modalDialog: The .modal-dialog\n\t\t _$modalContent: The .modal-content\n\t\t _$modalBody: The .modal-body\n\t\t _$modalHeader: The .modal-header\n\t\t _$modalFooter: The .modal-footer\n\t\t _$lightboxContainerOne: Container of the first lightbox element\n\t\t _$lightboxContainerTwo: Container of the second lightbox element\n\t\t _$lightboxBody: First element in the container\n\t\t _$modalArrows: The overlayed arrows container\n\n\t\t _$galleryItems: Other 's available for this gallery\n\t\t _galleryName: Name of the current data('gallery') showing\n\t\t _galleryIndex: The current index of the _$galleryItems being shown\n\n\t\t _config: {} the options for the modal\n\t\t _modalId: unique id for the current lightbox\n\t\t _padding / _border: CSS properties for the modal container; these are used to calculate the available space for the content\n\n\t\t */\n\n\t\tstatic get Default() {\n\t\t\treturn Default\n\t\t}\n\n\t\tconstructor($element, config) {\n\t\t\tthis._config = $.extend({}, Default, config)\n\t\t\tthis._$modalArrows = null\n\t\t\tthis._galleryIndex = 0\n\t\t\tthis._galleryName = null\n\t\t\tthis._padding = null\n\t\t\tthis._border = null\n\t\t\tthis._titleIsShown = false\n\t\t\tthis._footerIsShown = false\n\t\t\tthis._wantedWidth = 0\n\t\t\tthis._wantedHeight = 0\n\t\t\tthis._touchstartX = 0\n\t\t\tthis._touchendX = 0\n\t\t\t\n\t\t\tthis._modalId = `ekkoLightbox-${Math.floor((Math.random() * 1000) + 1)}`;\n\t\t\tthis._$element = $element instanceof jQuery ? $element : $($element)\n\n\t\t\tthis._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3;\n\n\t\t\tlet h4 = `

${this._config.title || \" \"}

`;\n\t\t\tlet btn = ``;\n\n\t\t\tlet header = `
`+(this._isBootstrap3 ? btn+h4 : h4+btn)+`
`;\n\t\t\tlet footer = `
${this._config.footer || \" \"}
`;\n\t\t\tlet body = '
'\n\t\t\tlet dialog = `
${header}${body}${footer}
`\n\t\t\t$(this._config.doc.body).append(`
${dialog}
`)\n\n\t\t\tthis._$modal = $(`#${this._modalId}`, this._config.doc)\n\t\t\tthis._$modalDialog = this._$modal.find('.modal-dialog').first()\n\t\t\tthis._$modalContent = this._$modal.find('.modal-content').first()\n\t\t\tthis._$modalBody = this._$modal.find('.modal-body').first()\n\t\t\tthis._$modalHeader = this._$modal.find('.modal-header').first()\n\t\t\tthis._$modalFooter = this._$modal.find('.modal-footer').first()\n\n\t\t\tthis._$lightboxContainer = this._$modalBody.find('.ekko-lightbox-container').first()\n\t\t\tthis._$lightboxBodyOne = this._$lightboxContainer.find('> div:first-child').first()\n\t\t\tthis._$lightboxBodyTwo = this._$lightboxContainer.find('> div:last-child').first()\n\n\t\t\tthis._border = this._calculateBorders()\n\t\t\tthis._padding = this._calculatePadding()\n\n\t\t\tthis._galleryName = this._$element.data('gallery')\n\t\t\tif (this._galleryName) {\n\t\t\t\tthis._$galleryItems = $(document.body).find(`*[data-gallery=\"${this._galleryName}\"]`)\n\t\t\t\tthis._galleryIndex = this._$galleryItems.index(this._$element)\n\t\t\t\t$(document).on('keydown.ekkoLightbox', this._navigationalBinder.bind(this))\n\n\t\t\t\t// add the directional arrows to the modal\n\t\t\t\tif (this._config.showArrows && this._$galleryItems.length > 1) {\n\t\t\t\t\tthis._$lightboxContainer.append(`
${this._config.leftArrow}${this._config.rightArrow}
`)\n\t\t\t\t\tthis._$modalArrows = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay').first()\n\t\t\t\t\tthis._$lightboxContainer.on('click', 'a:first-child', event => {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn this.navigateLeft()\n\t\t\t\t\t})\n\t\t\t\t\tthis._$lightboxContainer.on('click', 'a:last-child', event => {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn this.navigateRight()\n\t\t\t\t\t})\n\t\t\t\t\tthis.updateNavigation()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._$modal\n\t\t\t.on('show.bs.modal', this._config.onShow.bind(this))\n\t\t\t.on('shown.bs.modal', () => {\n\t\t\t\tthis._toggleLoading(true)\n\t\t\t\tthis._handle()\n\t\t\t\treturn this._config.onShown.call(this)\n\t\t\t})\n\t\t\t.on('hide.bs.modal', this._config.onHide.bind(this))\n\t\t\t.on('hidden.bs.modal', () => {\n\t\t\t\tif (this._galleryName) {\n\t\t\t\t\t$(document).off('keydown.ekkoLightbox')\n\t\t\t\t\t$(window).off('resize.ekkoLightbox')\n\t\t\t\t}\n\t\t\t\tthis._$modal.remove()\n\t\t\t\treturn this._config.onHidden.call(this)\n\t\t\t})\n\t\t\t.modal(this._config)\n\n\t\t\t$(window).on('resize.ekkoLightbox', () => {\n\t\t\t\tthis._resize(this._wantedWidth, this._wantedHeight)\n\t\t\t})\n\t\t\tthis._$lightboxContainer\n\t\t\t.on('touchstart', () => {\n\t\t\t\tthis._touchstartX = event.changedTouches[0].screenX;\n\n\t\t\t})\n\t\t\t.on('touchend', () => {\n\t\t\t\tthis._touchendX = event.changedTouches[0].screenX;\n\t\t\t this._swipeGesure();\n\t\t\t})\n\t\t}\n\n\t\telement() {\n\t\t\treturn this._$element;\n\t\t}\n\n\t\tmodal() {\n\t\t\treturn this._$modal;\n\t\t}\n\n\t\tnavigateTo(index) {\n\n\t\t\tif (index < 0 || index > this._$galleryItems.length-1)\n\t\t\t\treturn this\n\n\t\t\tthis._galleryIndex = index\n\n\t\t\tthis.updateNavigation()\n\n\t\t\tthis._$element = $(this._$galleryItems.get(this._galleryIndex))\n\t\t\tthis._handle();\n\t\t}\n\n\t\tnavigateLeft() {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n \n\t\t\tif (this._$galleryItems.length === 1)\n\t\t\t\treturn\n\n\t\t\tif (this._galleryIndex === 0) {\n\t\t\t\tif (this._config.wrapping)\n\t\t\t\t\tthis._galleryIndex = this._$galleryItems.length - 1\n\t\t\t\telse\n\t\t\t\t\treturn\n\t\t\t}\n\t\t\telse //circular\n\t\t\t\tthis._galleryIndex--\n\n\t\t\tthis._config.onNavigate.call(this, 'left', this._galleryIndex)\n\t\t\treturn this.navigateTo(this._galleryIndex)\n\t\t}\n\n\t\tnavigateRight() {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n \n\t\t\tif (this._$galleryItems.length === 1)\n\t\t\t\treturn\n\n\t\t\tif (this._galleryIndex === this._$galleryItems.length - 1) {\n\t\t\t\tif (this._config.wrapping)\n\t\t\t\t\tthis._galleryIndex = 0\n\t\t\t\telse\n\t\t\t\t\treturn\n\t\t\t}\n\t\t\telse //circular\n\t\t\t\tthis._galleryIndex++\n\n\t\t\tthis._config.onNavigate.call(this, 'right', this._galleryIndex)\n\t\t\treturn this.navigateTo(this._galleryIndex)\n\t\t}\n\n\t\tupdateNavigation() {\n\t\t\tif (!this._config.wrapping) {\n\t\t\t\tlet $nav = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay')\n\t\t\t\tif (this._galleryIndex === 0)\n\t\t\t\t\t$nav.find('a:first-child').addClass('disabled')\n\t\t\t\telse\n\t\t\t\t\t$nav.find('a:first-child').removeClass('disabled')\n\n\t\t\t\tif (this._galleryIndex === this._$galleryItems.length - 1)\n\t\t\t\t\t$nav.find('a:last-child').addClass('disabled')\n\t\t\t\telse\n\t\t\t\t\t$nav.find('a:last-child').removeClass('disabled')\n\t\t\t}\n\t\t}\n\n\t\tclose() {\n\t\t\treturn this._$modal.modal('hide');\n\t\t}\n\n\t\t// helper private methods\n\t\t_navigationalBinder(event) {\n\t\t\tevent = event || window.event;\n\t\t\tif (event.keyCode === 39)\n\t\t\t\treturn this.navigateRight()\n\t\t\tif (event.keyCode === 37)\n\t\t\t\treturn this.navigateLeft()\n\t\t}\n\n\t\t// type detection private methods\n\t\t_detectRemoteType(src, type) {\n\n\t\t\ttype = type || false;\n\n\t\t\tif(!type && this._isImage(src))\n\t\t\t\ttype = 'image';\n\t\t\tif(!type && this._getYoutubeId(src))\n\t\t\t\ttype = 'youtube';\n\t\t\tif(!type && this._getVimeoId(src))\n\t\t\t\ttype = 'vimeo';\n\t\t\tif(!type && this._getInstagramId(src))\n\t\t\t\ttype = 'instagram';\n\n\t\t\tif(!type || ['image', 'youtube', 'vimeo', 'instagram', 'video', 'url'].indexOf(type) < 0)\n\t\t\t\ttype = 'url';\n\n\t\t\treturn type;\n\t\t}\n\n\t\t_isImage(string) {\n\t\t\treturn string && string.match(/(^data:image\\/.*,)|(\\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\\?|#).*)?$)/i)\n\t\t}\n\n\t\t_containerToUse() {\n\t\t\t// if currently showing an image, fade it out and remove\n\t\t\tlet $toUse = this._$lightboxBodyTwo\n\t\t\tlet $current = this._$lightboxBodyOne\n\n\t\t\tif(this._$lightboxBodyTwo.hasClass('in')) {\n\t\t\t\t$toUse = this._$lightboxBodyOne\n\t\t\t\t$current = this._$lightboxBodyTwo\n\t\t\t}\n\n\t\t\t$current.removeClass('in show')\n\t\t\tsetTimeout(() => {\n\t\t\t\tif(!this._$lightboxBodyTwo.hasClass('in'))\n\t\t\t\t\tthis._$lightboxBodyTwo.empty()\n\t\t\t\tif(!this._$lightboxBodyOne.hasClass('in'))\n\t\t\t\t\tthis._$lightboxBodyOne.empty()\n\t\t\t}, 500)\n\n\t\t\t$toUse.addClass('in show')\n\t\t\treturn $toUse\n\t\t}\n\n\t\t_handle() {\n\n\t\t\tlet $toUse = this._containerToUse()\n\t\t\tthis._updateTitleAndFooter()\n\n\t\t\tlet currentRemote = this._$element.attr('data-remote') || this._$element.attr('href')\n\t\t\tlet currentType = this._detectRemoteType(currentRemote, this._$element.attr('data-type') || false)\n\n\t\t\tif(['image', 'youtube', 'vimeo', 'instagram', 'video', 'url'].indexOf(currentType) < 0)\n\t\t\t\treturn this._error(this._config.strings.type)\n\n\t\t\tswitch(currentType) {\n\t\t\t\tcase 'image':\n\t\t\t\t\tthis._preloadImage(currentRemote, $toUse)\n\t\t\t\t\tthis._preloadImageByIndex(this._galleryIndex, 3)\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'youtube':\n\t\t\t\t\tthis._showYoutubeVideo(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'vimeo':\n\t\t\t\t\tthis._showVimeoVideo(this._getVimeoId(currentRemote), $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'instagram':\n\t\t\t\t\tthis._showInstagramVideo(this._getInstagramId(currentRemote), $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'video':\n\t\t\t\t\tthis._showHtml5Video(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // url\n\t\t\t\t\tthis._loadRemoteContent(currentRemote, $toUse);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\t_getYoutubeId(string) {\n\t\t\tif(!string)\n\t\t\t\treturn false;\n\t\t\tlet matches = string.match(/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/)\n\t\t\treturn (matches && matches[2].length === 11) ? matches[2] : false\n\t\t}\n\n\t\t_getVimeoId(string) {\n\t\t\treturn string && string.indexOf('vimeo') > 0 ? string : false\n\t\t}\n\n\t\t_getInstagramId(string) {\n\t\t\treturn string && string.indexOf('instagram') > 0 ? string : false\n\t\t}\n\n\t\t// layout private methods\n\t\t_toggleLoading(show) {\n\t\t\tshow = show || false\n\t\t\tif(show) {\n\t\t\t\tthis._$modalDialog.css('display', 'none')\n\t\t\t\tthis._$modal.removeClass('in show')\n\t\t\t\t$('.modal-backdrop').append(this._config.loadingMessage)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._$modalDialog.css('display', 'block')\n\t\t\t\tthis._$modal.addClass('in show')\n\t\t\t\t$('.modal-backdrop').find('.ekko-lightbox-loader').remove()\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t_calculateBorders() {\n\t\t\treturn {\n\t\t\t\ttop: this._totalCssByAttribute('border-top-width'),\n\t\t\t\tright: this._totalCssByAttribute('border-right-width'),\n\t\t\t\tbottom: this._totalCssByAttribute('border-bottom-width'),\n\t\t\t\tleft: this._totalCssByAttribute('border-left-width'),\n\t\t\t}\n\t\t}\n\t\t\n\t\t_calculatePadding() {\n\t\t\treturn {\n\t\t\t\ttop: this._totalCssByAttribute('padding-top'),\n\t\t\t\tright: this._totalCssByAttribute('padding-right'),\n\t\t\t\tbottom: this._totalCssByAttribute('padding-bottom'),\n\t\t\t\tleft: this._totalCssByAttribute('padding-left'),\n\t\t\t}\n\t\t}\n\n\t\t_totalCssByAttribute(attribute) {\n\t\t\treturn parseInt(this._$modalDialog.css(attribute), 10) +\n\t\t\t\tparseInt(this._$modalContent.css(attribute), 10) +\n\t\t\t\tparseInt(this._$modalBody.css(attribute), 10)\n\t\t}\n\n\t\t_updateTitleAndFooter() {\n\t\t\tlet title = this._$element.data('title') || \"\"\n\t\t\tlet caption = this._$element.data('footer') || \"\"\n\n\t\t\tthis._titleIsShown = false\n\t\t\tif (title || this._config.alwaysShowClose) {\n\t\t\t\tthis._titleIsShown = true\n\t\t\t\tthis._$modalHeader.css('display', '').find('.modal-title').html(title || \" \")\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis._$modalHeader.css('display', 'none')\n\n\t\t\tthis._footerIsShown = false\n\t\t\tif (caption) {\n\t\t\t\tthis._footerIsShown = true\n\t\t\t\tthis._$modalFooter.css('display', '').html(caption)\n\t\t\t}\n\t\t\telse\n\t\t\t\tthis._$modalFooter.css('display', 'none')\n\n\t\t\treturn this;\n\t\t}\n\n\t\t_showYoutubeVideo(remote, $containerForElement) {\n\t\t\tlet id = this._getYoutubeId(remote)\n\t\t\tlet query = remote.indexOf('&') > 0 ? remote.substr(remote.indexOf('&')) : ''\n\t\t\tlet width = this._$element.data('width') || 560\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\treturn this._showVideoIframe(\n\t\t\t\t`//www.youtube.com/embed/${id}?badge=0&autoplay=1&html5=1${query}`,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\t$containerForElement\n\t\t\t);\n\t\t}\n\n\t\t_showVimeoVideo(id, $containerForElement) {\n\t\t\tlet width = this._$element.data('width') || 500\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\treturn this._showVideoIframe(id + '?autoplay=1', width, height, $containerForElement)\n\t\t}\n\n\t\t_showInstagramVideo(id, $containerForElement) {\n\t\t\t// instagram load their content into iframe's so this can be put straight into the element\n\t\t\tlet width = this._$element.data('width') || 612\n\t\t\tlet height = width + 80;\n\t\t\tid = id.substr(-1) !== '/' ? id + '/' : id; // ensure id has trailing slash\n\t\t\t$containerForElement.html(``);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows) //hide the arrows when showing video\n\t\t\t\tthis._$modalArrows.css('display', 'none');\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n\n\t\t_showVideoIframe(url, width, height, $containerForElement) { // should be used for videos only. for remote content use loadRemoteContent (data-type=url)\n\t\t\theight = height || width; // default to square\n\t\t\t$containerForElement.html(`
`);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows)\n\t\t\t\tthis._$modalArrows.css('display', 'none'); //hide the arrows when showing video\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n\n\t\t_showHtml5Video(url, $containerForElement) { // should be used for videos only. for remote content use loadRemoteContent (data-type=url)\n\t\t\tlet width = this._$element.data('width') || 560\n\t\t\tlet height = this._$element.data('height') || width / ( 560/315 )\n\t\t\t$containerForElement.html(`
`);\n\t\t\tthis._resize(width, height);\n\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\tif (this._$modalArrows)\n\t\t\t\tthis._$modalArrows.css('display', 'none'); //hide the arrows when showing video\n\t\t\tthis._toggleLoading(false);\n\t\t\treturn this;\n\t\t}\n\n\t\t_loadRemoteContent(url, $containerForElement) {\n\t\t\tlet width = this._$element.data('width') || 560;\n\t\t\tlet height = this._$element.data('height') || 560;\n\n\t\t\tlet disableExternalCheck = this._$element.data('disableExternalCheck') || false;\n\t\t\tthis._toggleLoading(false);\n\n\t\t\t// external urls are loading into an iframe\n\t\t\t// local ajax can be loaded into the container itself\n\t\t\tif (!disableExternalCheck && !this._isExternal(url)) {\n\t\t\t\t$containerForElement.load(url, $.proxy(() => {\n\t\t\t\t\treturn this._$element.trigger('loaded.bs.modal');l\n\t\t\t\t}));\n\n\t\t\t} else {\n\t\t\t\t$containerForElement.html(``);\n\t\t\t\tthis._config.onContentLoaded.call(this);\n\t\t\t}\n\n\t\t\tif (this._$modalArrows) //hide the arrows when remote content\n\t\t\t\tthis._$modalArrows.css('display', 'none')\n\n\t\t\tthis._resize(width, height);\n\t\t\treturn this;\n\t\t}\n\n\t\t_isExternal(url) {\n\t\t\tlet match = url.match(/^([^:\\/?#]+:)?(?:\\/\\/([^\\/?#]*))?([^?#]+)?(\\?[^#]*)?(#.*)?/);\n\t\t\tif (typeof match[1] === \"string\" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol)\n\t\t\t\treturn true;\n\n\t\t\tif (typeof match[2] === \"string\" && match[2].length > 0 && match[2].replace(new RegExp(`:(${{\n\t\t\t\t\t\"http:\": 80,\n\t\t\t\t\t\"https:\": 443\n\t\t\t\t}[location.protocol]})?$`), \"\") !== location.host)\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}\n\n\t\t_error( message ) {\n\t\t\tconsole.error(message);\n\t\t\tthis._containerToUse().html(message);\n\t\t\tthis._resize(300, 300);\n\t\t\treturn this;\n\t\t}\n\n\t\t_preloadImageByIndex(startIndex, numberOfTimes) {\n\n\t\t\tif(!this._$galleryItems)\n\t\t\t\treturn;\n\n\t\t\tlet next = $(this._$galleryItems.get(startIndex), false)\n\t\t\tif(typeof next == 'undefined')\n\t\t\t\treturn\n\n\t\t\tlet src = next.attr('data-remote') || next.attr('href')\n\t\t\tif (next.attr('data-type') === 'image' || this._isImage(src))\n\t\t\t\tthis._preloadImage(src, false)\n\n\t\t\tif(numberOfTimes > 0)\n\t\t\t\treturn this._preloadImageByIndex(startIndex + 1, numberOfTimes-1);\n\t\t}\n\n\t\t_preloadImage( src, $containerForImage) {\n\n\t\t\t$containerForImage = $containerForImage || false\n\n\t\t\tlet img = new Image();\n\t\t\tif ($containerForImage) {\n\n\t\t\t\t// if loading takes > 200ms show a loader\n\t\t\t\tlet loadingTimeout = setTimeout(() => {\n\t\t\t\t\t$containerForImage.append(this._config.loadingMessage)\n\t\t\t\t}, 200)\n\n\t\t\t\timg.onload = () => {\n\t\t\t\t\tif(loadingTimeout)\n\t\t\t\t\t\tclearTimeout(loadingTimeout)\n\t\t\t\t\tloadingTimeout = null;\n\t\t\t\t\tlet image = $('');\n\t\t\t\t\timage.attr('src', img.src);\n\t\t\t\t\timage.addClass('img-fluid');\n\n\t\t\t\t\t// backward compatibility for bootstrap v3\n\t\t\t\t\timage.css('width', '100%');\n\n\t\t\t\t\t$containerForImage.html(image);\n\t\t\t\t\tif (this._$modalArrows)\n\t\t\t\t\t\tthis._$modalArrows.css('display', '') // remove display to default to css property\n\n\t\t\t\t\tthis._resize(img.width, img.height);\n\t\t\t\t\tthis._toggleLoading(false);\n\t\t\t\t\treturn this._config.onContentLoaded.call(this);\n\t\t\t\t};\n\t\t\t\timg.onerror = () => {\n\t\t\t\t\tthis._toggleLoading(false);\n\t\t\t\t\treturn this._error(this._config.strings.fail+` ${src}`);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\timg.src = src;\n\t\t\treturn img;\n\t\t}\n\n\t\t_swipeGesure() {\n\t\t if (this._touchendX < this._touchstartX) {\n\t\t return this.navigateRight();\n\t\t }\n\t\t if (this._touchendX > this._touchstartX) {\n\t\t return this.navigateLeft();\n\t\t }\n\t\t}\n\n\t\t_resize( width, height ) {\n\n\t\t\theight = height || width\n\t\t\tthis._wantedWidth = width\n\t\t\tthis._wantedHeight = height\n\n\t\t\t// if width > the available space, scale down the expected width and height\n\t\t\tlet widthBorderAndPadding = this._padding.left + this._padding.right + this._border.left + this._border.right\n\t\t\tlet maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth)\n\t\t\tif((width + widthBorderAndPadding) > maxWidth) {\n\t\t\t\theight = ((maxWidth - widthBorderAndPadding) / width) * height\n\t\t\t\twidth = maxWidth\n\t\t\t} else\n\t\t\t\twidth = (width + widthBorderAndPadding)\n\n\t\t\tlet headerHeight = 0,\n\t\t\t\tfooterHeight = 0\n\n\t\t\t// as the resize is performed the modal is show, the calculate might fail\n\t\t\t// if so, default to the default sizes\n\t\t\tif (this._footerIsShown)\n\t\t\t\tfooterHeight = this._$modalFooter.outerHeight(true) || 55\n\n\t\t\tif (this._titleIsShown)\n\t\t\t\theaderHeight = this._$modalHeader.outerHeight(true) || 67\n\n\t\t\tlet borderPadding = this._padding.top + this._padding.bottom + this._border.bottom + this._border.top\n\n\t\t\t//calculated each time as resizing the window can cause them to change due to Bootstraps fluid margins\n\t\t\tlet margins = parseFloat(this._$modalDialog.css('margin-top')) + parseFloat(this._$modalDialog.css('margin-bottom'));\n\n\t\t\tlet maxHeight = Math.min(height, $(window).height() - borderPadding - margins - headerHeight - footerHeight);\n\t\t\tif(height > maxHeight) {\n\t\t\t\t// if height > the available height, scale down the width\n\t\t\t\tlet factor = Math.min(maxHeight / height, 1);\n\t\t\t\twidth = Math.ceil(factor * width);\n\t\t\t}\n\n\t\t\tthis._$lightboxContainer.css('height', maxHeight)\n\t\t\tthis._$modalDialog.css('width', 'auto') .css('maxWidth', width);\n\n\t\t\tlet modal = this._$modal.data('bs.modal');\n\t\t\tif (modal) {\n\t\t\t\t// v4 method is mistakenly protected\n\t\t\t\ttry {\n\t\t\t\t\tmodal._handleUpdate();\n\t\t\t\t} catch(Exception) {\n\t\t\t\t\tmodal.handleUpdate();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tstatic _jQueryInterface(config) {\n\t\t\tconfig = config || {}\n\t\t\treturn this.each(() => {\n\t\t\t\tlet $this = $(this)\n\t\t\t\tlet _config = $.extend(\n\t\t\t\t\t{},\n\t\t\t\t\tLightbox.Default,\n\t\t\t\t\t$this.data(),\n\t\t\t\t\ttypeof config === 'object' && config\n\t\t\t\t)\n\n\t\t\t\tnew Lightbox(this, _config)\n\t\t\t})\n\t\t}\n\t}\n\n\n\n\t$.fn[NAME] = Lightbox._jQueryInterface\n\t$.fn[NAME].Constructor = Lightbox\n\t$.fn[NAME].noConflict = () => {\n\t\t$.fn[NAME] = JQUERY_NO_CONFLICT\n\t\treturn Lightbox._jQueryInterface\n\t}\n\n\treturn Lightbox\n\n})(jQuery)\n\nexport default Lightbox"]} \ No newline at end of file diff --git a/assets/3rdparty/lightbox/ekko-lightbox.min.css b/assets/3rdparty/lightbox/ekko-lightbox.min.css new file mode 100644 index 00000000..98e91ebd --- /dev/null +++ b/assets/3rdparty/lightbox/ekko-lightbox.min.css @@ -0,0 +1,2 @@ +.ekko-lightbox-nav-overlay a:focus,.ekko-lightbox-nav-overlay a>:focus{outline:0}.ekko-lightbox-container{position:relative}.ekko-lightbox-container>div.ekko-lightbox-item{position:absolute;top:0;left:0;width:100%;transition:opacity .5s ease-in-out;opacity:1}.ekko-lightbox-nav-overlay{z-index:1;position:absolute;top:0;left:0;width:100%;height:100%;display:-ms-flexbox;display:flex}.ekko-lightbox-nav-overlay a{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0;transition:opacity .5s;color:#fff;font-size:30px;z-index:1}.ekko-lightbox-nav-overlay a>*{-ms-flex-positive:1;flex-grow:1}.ekko-lightbox-nav-overlay a span{padding:0 30px}.ekko-lightbox-nav-overlay a:last-child span{text-align:right}.ekko-lightbox-nav-overlay a:hover{text-decoration:none}.ekko-lightbox a:hover{opacity:1;text-decoration:none}.ekko-lightbox .modal-footer{text-align:left}.ekko-lightbox-loader{position:absolute;top:0;left:0;bottom:0;right:0;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.ekko-lightbox-loader>div{width:40px;height:40px;position:relative;text-align:center}.ekko-lightbox-loader>div>div{width:100%;height:100%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;animation:a 2s infinite ease-in-out}.ekko-lightbox-loader>div>div:last-child{animation-delay:-1s}@keyframes a{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}} +/*# sourceMappingURL=ekko-lightbox.min.css.map */ \ No newline at end of file diff --git a/assets/3rdparty/lightbox/ekko-lightbox.min.css.map b/assets/3rdparty/lightbox/ekko-lightbox.min.css.map new file mode 100644 index 00000000..17f09be5 --- /dev/null +++ b/assets/3rdparty/lightbox/ekko-lightbox.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["dist/ekko-lightbox.css"],"names":[],"mappings":"AAkDA,uEACE,SAAS,CAnDX,yBACE,iBAAU,CAEZ,gDACE,kBACA,MACA,OACA,WACA,mCACA,SAAS,CAEX,2BACE,UACA,kBACA,MACA,OACA,WACA,YACA,oBACA,YAAS,CAEX,6BACE,WACI,OACJ,oBACA,aACA,sBACI,mBACJ,UACA,uBACA,WACA,eACA,SAAS,CAEX,+BACE,oBACI,WAAW,CAKjB,kCACE,cAAW,CAEb,6CACE,gBAAY,CAEd,mCACE,oBAAiB,CAKnB,uBACE,UACA,oBAAiB,CAEnB,6BACE,eAAY,CAEd,sBACE,kBACA,MACA,OACA,SACA,QACA,WACA,oBACA,aAEA,0BACI,sBAEJ,qBACI,uBAEJ,sBACI,kBAAa,CAEnB,0BACE,WACA,YACA,kBACA,iBAAY,CAEd,8BACE,WACA,YACA,kBACA,sBACA,WACA,kBACA,MACA,OACA,mCAAiC,CAEnC,yCACE,mBAAiB,CAEnB,aACE,MAEE,mBACA,0BAAmB,CAErB,IACE,mBACA,0BAAmB,CAAA,CAAA","file":"ekko-lightbox.min.css"} \ No newline at end of file diff --git a/assets/3rdparty/lightbox/ekko-lightbox.min.js b/assets/3rdparty/lightbox/ekko-lightbox.min.js new file mode 100644 index 00000000..9837bfe4 --- /dev/null +++ b/assets/3rdparty/lightbox/ekko-lightbox.min.js @@ -0,0 +1,2 @@ ++function(a){"use strict";function b(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function a(a,b){for(var c=0;c
',leftArrow:"",rightArrow:"",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},g=function(){function d(c,e){var g=this;b(this,d),this._config=a.extend({},f,e),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._touchstartX=0,this._touchendX=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=c instanceof jQuery?c:a(c),this._isBootstrap3=3==a.fn.modal.Constructor.VERSION[0];var h='",i='',j='",k='",l='',m='";a(this._config.doc.body).append('"),this._$modal=a("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=a(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),a(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(a){return a.preventDefault(),g.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(a){return a.preventDefault(),g.navigateRight()}),this.updateNavigation())),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return g._toggleLoading(!0),g._handle(),g._config.onShown.call(g)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return g._galleryName&&(a(document).off("keydown.ekkoLightbox"),a(window).off("resize.ekkoLightbox")),g._$modal.remove(),g._config.onHidden.call(g)}).modal(this._config),a(window).on("resize.ekkoLightbox",function(){g._resize(g._wantedWidth,g._wantedHeight)}),this._$lightboxContainer.on("touchstart",function(){g._touchstartX=event.changedTouches[0].screenX}).on("touchend",function(){g._touchendX=event.changedTouches[0].screenX,g._swipeGesure()})}return c(d,null,[{key:"Default",get:function(){return f}}]),c(d,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(b){return b<0||b>this._$galleryItems.length-1?this:(this._galleryIndex=b,this.updateNavigation(),this._$element=a(this._$galleryItems.get(this._galleryIndex)),void this._handle())}},{key:"navigateLeft",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(0===this._galleryIndex){if(!this._config.wrapping)return;this._galleryIndex=this._$galleryItems.length-1}else this._galleryIndex--;return this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"navigateRight",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(this._galleryIndex===this._$galleryItems.length-1){if(!this._config.wrapping)return;this._galleryIndex=0}else this._galleryIndex++;return this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"updateNavigation",value:function(){if(!this._config.wrapping){var a=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay");0===this._galleryIndex?a.find("a:first-child").addClass("disabled"):a.find("a:first-child").removeClass("disabled"),this._galleryIndex===this._$galleryItems.length-1?a.find("a:last-child").addClass("disabled"):a.find("a:last-child").removeClass("disabled")}}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(a){return a=a||window.event,39===a.keyCode?this.navigateRight():37===a.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(a,b){return b=b||!1,!b&&this._isImage(a)&&(b="image"),!b&&this._getYoutubeId(a)&&(b="youtube"),!b&&this._getVimeoId(a)&&(b="vimeo"),!b&&this._getInstagramId(a)&&(b="instagram"),(!b||["image","youtube","vimeo","instagram","video","url"].indexOf(b)<0)&&(b="url"),b}},{key:"_isImage",value:function(a){return a&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var a=this,b=this._$lightboxBodyTwo,c=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(b=this._$lightboxBodyOne,c=this._$lightboxBodyTwo),c.removeClass("in show"),setTimeout(function(){a._$lightboxBodyTwo.hasClass("in")||a._$lightboxBodyTwo.empty(),a._$lightboxBodyOne.hasClass("in")||a._$lightboxBodyOne.empty()},500),b.addClass("in show"),b}},{key:"_handle",value:function(){var a=this._containerToUse();this._updateTitleAndFooter();var b=this._$element.attr("data-remote")||this._$element.attr("href"),c=this._detectRemoteType(b,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","video","url"].indexOf(c)<0)return this._error(this._config.strings.type);switch(c){case"image":this._preloadImage(b,a),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(b,a);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(b),a);break;case"instagram":this._showInstagramVideo(this._getInstagramId(b),a);break;case"video":this._showHtml5Video(b,a);break;default:this._loadRemoteContent(b,a)}return this}},{key:"_getYoutubeId",value:function(a){if(!a)return!1;var b=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!b||11!==b[2].length)&&b[2]}},{key:"_getVimeoId",value:function(a){return!!(a&&a.indexOf("vimeo")>0)&&a}},{key:"_getInstagramId",value:function(a){return!!(a&&a.indexOf("instagram")>0)&&a}},{key:"_toggleLoading",value:function(b){return b=b||!1,b?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),a(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display","block"),this._$modal.addClass("in show"),a(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(a){return parseInt(this._$modalDialog.css(a),10)+parseInt(this._$modalContent.css(a),10)+parseInt(this._$modalBody.css(a),10)}},{key:"_updateTitleAndFooter",value:function(){var a=this._$element.data("title")||"",b=this._$element.data("footer")||"";return this._titleIsShown=!1,a||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(a||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,b?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(b)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(a,b){var c=this._getYoutubeId(a),d=a.indexOf("&")>0?a.substr(a.indexOf("&")):"",e=this._$element.data("width")||560,f=this._$element.data("height")||e/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+c+"?badge=0&autoplay=1&html5=1"+d,e,f,b)}},{key:"_showVimeoVideo",value:function(a,b){var c=this._$element.data("width")||500,d=this._$element.data("height")||c/(560/315);return this._showVideoIframe(a+"?autoplay=1",c,d,b)}},{key:"_showInstagramVideo",value:function(a,b){var c=this._$element.data("width")||612,d=c+80;return a="/"!==a.substr(-1)?a+"/":a,b.html(''),this._resize(c,d),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(a,b,c,d){return c=c||b,d.html('
'),this._resize(b,c),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Video",value:function(a,b){var c=this._$element.data("width")||560,d=this._$element.data("height")||c/(560/315);return b.html('
'),this._resize(c,d),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(b,c){var d=this,e=this._$element.data("width")||560,f=this._$element.data("height")||560,g=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),g||this._isExternal(b)?(c.html(''),this._config.onContentLoaded.call(this)):c.load(b,a.proxy(function(){return d._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(e,f),this}},{key:"_isExternal",value:function(a){var b=a.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof b[1]&&b[1].length>0&&b[1].toLowerCase()!==location.protocol||"string"==typeof b[2]&&b[2].length>0&&b[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(a){return console.error(a),this._containerToUse().html(a),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(b,c){if(this._$galleryItems){var d=a(this._$galleryItems.get(b),!1);if("undefined"!=typeof d){var e=d.attr("data-remote")||d.attr("href");return("image"===d.attr("data-type")||this._isImage(e))&&this._preloadImage(e,!1),c>0?this._preloadImageByIndex(b+1,c-1):void 0}}}},{key:"_preloadImage",value:function(b,c){var d=this;c=c||!1;var e=new Image;return c&&!function(){var f=setTimeout(function(){c.append(d._config.loadingMessage)},200);e.onload=function(){f&&clearTimeout(f),f=null;var b=a("");return b.attr("src",e.src),b.addClass("img-fluid"),b.css("width","100%"),c.html(b),d._$modalArrows&&d._$modalArrows.css("display",""),d._resize(e.width,e.height),d._toggleLoading(!1),d._config.onContentLoaded.call(d)},e.onerror=function(){return d._toggleLoading(!1),d._error(d._config.strings.fail+(" "+b))}}(),e.src=b,e}},{key:"_swipeGesure",value:function(){return this._touchendXthis._touchstartX?this.navigateLeft():void 0}},{key:"_resize",value:function(b,c){c=c||b,this._wantedWidth=b,this._wantedHeight=c;var d=this._padding.left+this._padding.right+this._border.left+this._border.right,e=Math.min(b+d,this._config.doc.body.clientWidth);b+d>e?(c=(e-d)/b*c,b=e):b+=d;var f=0,g=0;this._footerIsShown&&(g=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(f=this._$modalHeader.outerHeight(!0)||67);var h=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,i=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),j=Math.min(c,a(window).height()-h-i-f-g);if(c>j){var k=Math.min(j/c,1);b=Math.ceil(k*b)}this._$lightboxContainer.css("height",j),this._$modalDialog.css("width","auto").css("maxWidth",b);var l=this._$modal.data("bs.modal");if(l)try{l._handleUpdate()}catch(m){l.handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(b){var c=this;return b=b||{},this.each(function(){var e=a(c),f=a.extend({},d.Default,e.data(),"object"==typeof b&&b);new d(c,f)})}}]),d}();return a.fn[d]=g._jQueryInterface,a.fn[d].Constructor=g,a.fn[d].noConflict=function(){return a.fn[d]=e,g._jQueryInterface},g})(jQuery)}(jQuery); +//# sourceMappingURL=ekko-lightbox.min.js.map \ No newline at end of file diff --git a/assets/3rdparty/lightbox/ekko-lightbox.min.js.map b/assets/3rdparty/lightbox/ekko-lightbox.min.js.map new file mode 100644 index 00000000..9957af66 --- /dev/null +++ b/assets/3rdparty/lightbox/ekko-lightbox.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["ekko-lightbox.js"],"names":["$","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","NAME","JQUERY_NO_CONFLICT","fn","Default","title","footer","showArrows","wrapping","type","alwaysShowClose","loadingMessage","leftArrow","rightArrow","strings","close","fail","doc","document","onShow","onShown","onHide","onHidden","onNavigate","onContentLoaded","Lightbox","$element","config","_this","this","_config","extend","_$modalArrows","_galleryIndex","_galleryName","_padding","_border","_titleIsShown","_footerIsShown","_wantedWidth","_wantedHeight","_touchstartX","_touchendX","_modalId","Math","floor","random","_$element","jQuery","_isBootstrap3","modal","VERSION","h4","btn","header","body","dialog","append","_$modal","_$modalDialog","find","first","_$modalContent","_$modalBody","_$modalHeader","_$modalFooter","_$lightboxContainer","_$lightboxBodyOne","_$lightboxBodyTwo","_calculateBorders","_calculatePadding","data","_$galleryItems","index","on","_navigationalBinder","bind","event","preventDefault","navigateLeft","navigateRight","updateNavigation","_toggleLoading","_handle","call","off","window","remove","_resize","changedTouches","screenX","_swipeGesure","get","value","navigateTo","$nav","addClass","removeClass","keyCode","src","_isImage","_getYoutubeId","_getVimeoId","_getInstagramId","indexOf","string","match","_this2","$toUse","$current","hasClass","setTimeout","empty","_containerToUse","_updateTitleAndFooter","currentRemote","attr","currentType","_detectRemoteType","_error","_preloadImage","_preloadImageByIndex","_showYoutubeVideo","_showVimeoVideo","_showInstagramVideo","_showHtml5Video","_loadRemoteContent","matches","show","css","top","_totalCssByAttribute","right","bottom","left","attribute","parseInt","caption","html","remote","$containerForElement","id","query","substr","width","height","_showVideoIframe","url","_this3","disableExternalCheck","_isExternal","load","proxy","trigger","toLowerCase","location","protocol","replace","RegExp","http:","https:","host","message","console","error","startIndex","numberOfTimes","next","$containerForImage","_this4","img","Image","loadingTimeout","onload","clearTimeout","image","onerror","widthBorderAndPadding","maxWidth","min","clientWidth","headerHeight","footerHeight","outerHeight","borderPadding","margins","parseFloat","maxHeight","factor","ceil","_handleUpdate","Exception","handleUpdate","_this5","each","$this","_jQueryInter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AEvB,GAAIC,GAAShJ,KAAKuI,IAAIQ,EAAY1C,EAAQ,EAC1CD,GAAQpG,KAAKiJ,KAAKD,EAAS5C,GAG5BnH,KAAKqC,oBAAoB+D,IAAI,SAAU0D,GACvC9J,KAAK8B,cAAcsE,IAAI,QAAS,QAAQA,IAAI,WAAYe,EAExD,IAAI9F,GAAQrB,KAAK6B,QAAQa,KAAK,WAC9B,IAAIrB,EAEH,IACCA,EAAM4I,gBACL,MAAOC,GACR7I,EAAM8I,eAGR,MAAOnK,WAGRhC,IAAK,mBACLgG,MAAO,SAA0BlE,GAChC,GAAIsK,GAASpK,IAGb,OADAF,GAASA,MACFE,KAAKqK,KAAK,WAChB,GAAIC,GAAQvN,EAAEqN,GACVnK,EAAUlD,EAAEmD,UAAWN,EAASrB,QAAS+L,EAAM5H,OAA0B,gBAAX5C,IAAuBA,EAEzF,IAAIF,GAASwK,EAAQnK,SAKjBL,IAUR,OAPA7C,GAAEuB,GAAGF,GAAQwB,EAAS2K,iBACtBxN,EAAEuB,GAAGF,GAAMlB,YAAc0C,EACzB7C,EAAEuB,GAAGF,GAAMoM,WAAa,WAEvB,MADAzN,GAAEuB,GAAGF,GAAQC,EACNuB,EAAS2K,kBAGV3K,IACLuB,SAGDA","file":"ekko-lightbox.min.js"} \ No newline at end of file diff --git a/assets/js/common/utils.js b/assets/js/common/utils.js index a70a536a..4272ebe7 100644 --- a/assets/js/common/utils.js +++ b/assets/js/common/utils.js @@ -33,6 +33,7 @@ function createElem(nodeType, appendTo){ * @info {String} id The ID of the new element * @info {String} title The title of the new element * @info {String} src The src attribute of the new element + * @info {String} href href attribute for the src element * @info {String} elemType The type attribute of the new element * @info {String} value The value of the new element * @info {String} placeholder The placeholder of the new element @@ -76,6 +77,8 @@ function createElem2(infos){ //Specify the source of the element if(infos.src) newElem.src = infos.src; + if(infos.href) + newElem.href = infos.href; //Specify element type if(infos.elemType) diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index 190a50f0..60a6338e 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -794,12 +794,29 @@ ComunicWeb.components.conversations.chatWindows = { //Check if an image has to be added if(messageInfos.image_path != null){ - createElem2({ + + //Image link + var imageLink = createElem2({ appendTo: messageTargetElem, + type:"a", + href: messageInfos.image_path, + }); + + //Image element + createElem2({ + appendTo: imageLink, type: "img", src: messageInfos.image_path, class: "conversation-msg-image" }); + + //Enable lightbox + imageLink.onclick = function(){ + $(this).ekkoLightbox({ + alwaysShowClose: true, + }); + return false; + } } //Parse emojies in text message diff --git a/corePage/config/dev.config.php b/corePage/config/dev.config.php index 104acd70..76717a79 100644 --- a/corePage/config/dev.config.php +++ b/corePage/config/dev.config.php @@ -19,6 +19,9 @@ $config['3rdPartyCSSfiles'] = array( "%PATH_ASSETS%3rdparty/adminLTE/plugins/select2/select2.min.css", "%PATH_ASSETS%3rdparty/adminLTE/dist/css/AdminLTE.min.css", "%PATH_ASSETS%3rdparty/adminLTE/dist/css/skins/_all-skins.min.css", + + //Light box + "%PATH_ASSETS%3rdparty/lightbox/ekko-lightbox.min.css", ); //App CSS files @@ -81,6 +84,9 @@ $config['3rdPartyJSfiles'] = array( //Textarea auto-size "%PATH_ASSETS%3rdparty/jquery.textarea_autosize/jquery.textarea_autosize.min.js", + + //Light box + "%PATH_ASSETS%3rdparty/lightbox/ekko-lightbox.min.js", ); //Application JS files