jekyll-theme-prettydocs 0.0.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE.txt +0 -0
- data/README.md +59 -178
- data/_includes/footer.html +6 -6
- data/_includes/home.html +122 -0
- data/_includes/promo-block.html +29 -86
- data/_layouts/home.html +36 -53
- data/_layouts/page.html +51 -5
- data/assets/.DS_Store +0 -0
- data/assets/css/.DS_Store +0 -0
- data/assets/css/styles.css +1373 -1267
- data/assets/images/.DS_Store +0 -0
- data/assets/images/demo/.DS_Store +0 -0
- data/assets/images/demo/fontawesome-icons.png +0 -0
- data/assets/images/demo/instance-promo.jpg +0 -0
- data/assets/images/demo/theme-atom.png +0 -0
- data/assets/images/demo/theme-decibel.png +0 -0
- data/assets/images/demo/theme-delta.png +0 -0
- data/assets/images/demo/theme-devstudio.png +0 -0
- data/assets/images/demo/theme-instance.png +0 -0
- data/assets/images/demo/theme-onboard.png +0 -0
- data/assets/images/demo/theme-orbit.png +0 -0
- data/assets/images/demo/theme-pillar.png +0 -0
- data/assets/images/demo/theme-sphere.png +0 -0
- data/assets/images/demo/theme-startupkit.png +0 -0
- data/assets/images/demo/theme-tempo.png +0 -0
- data/assets/images/demo/theme-trades.png +0 -0
- data/assets/images/empty.gif +0 -0
- data/assets/images/untitled folder/.DS_Store +0 -0
- data/assets/images/untitled folder/bootstrap-template-for-schools-academy.png +0 -0
- data/assets/images/untitled folder/crowdfunding-landing-page-onboard.png +0 -0
- data/assets/images/untitled folder/free-bootstrap-portfolio-theme-for-developers.png +0 -0
- data/assets/images/untitled folder/free-bootstrap-theme-appkit-landing.png +0 -0
- data/assets/images/untitled folder/free-bootstrap-theme-for-developers-devaid.png +0 -0
- data/assets/images/untitled folder/free-bootstrap-theme-for-develpers-prettydocs.png +0 -0
- data/assets/images/untitled folder/free-bootstrap-theme-for-documentation-prettydedocs.png +0 -0
- data/assets/images/untitled folder/free-bootstrap-theme-for-startups-developers-appkit-landing.png +0 -0
- data/assets/images/untitled folder/html5-website-template-college-green.png +0 -0
- data/assets/images/untitled folder/html5-website-template-placeholder.png +0 -0
- data/assets/images/untitled folder/restaurant-landing-page-epicure.png +0 -0
- data/assets/images/untitled folder/wedding-invitation-landing-page-matrimony.png +0 -0
- data/assets/js/.DS_Store +0 -0
- data/assets/js/main.js +42 -46
- data/assets/plugins/.DS_Store +0 -0
- data/assets/plugins/bootstrap/css/bootstrap-grid.css +1912 -0
- data/assets/plugins/bootstrap/css/bootstrap-grid.css.map +0 -0
- data/assets/plugins/bootstrap/css/bootstrap-grid.min.css +7 -0
- data/assets/plugins/bootstrap/css/bootstrap-grid.min.css.map +0 -0
- data/assets/plugins/bootstrap/css/bootstrap-reboot.css +331 -0
- data/assets/plugins/bootstrap/css/bootstrap-reboot.css.map +0 -0
- data/assets/plugins/bootstrap/css/bootstrap-reboot.min.css +8 -0
- data/assets/plugins/bootstrap/css/bootstrap-reboot.min.css.map +0 -0
- data/assets/plugins/bootstrap/css/bootstrap.css +7946 -5683
- data/assets/plugins/bootstrap/css/bootstrap.css.map +0 -0
- data/assets/plugins/bootstrap/css/bootstrap.min.css +4 -3
- data/assets/plugins/bootstrap/css/bootstrap.min.css.map +0 -0
- data/assets/plugins/bootstrap/js/bootstrap.bundle.js +6461 -0
- data/assets/plugins/bootstrap/js/bootstrap.bundle.js.map +0 -0
- data/assets/plugins/bootstrap/js/bootstrap.bundle.min.js +7 -0
- data/assets/plugins/bootstrap/js/bootstrap.bundle.min.js.map +0 -0
- data/assets/plugins/bootstrap/js/bootstrap.js +3448 -1867
- data/assets/plugins/bootstrap/js/bootstrap.js.map +0 -0
- data/assets/plugins/bootstrap/js/bootstrap.min.js +6 -6
- data/assets/plugins/bootstrap/js/bootstrap.min.js.map +0 -0
- data/assets/plugins/jquery-3.3.1.min.js +2 -0
- data/assets/plugins/lightbox/Gruntfile.js +84 -83
- data/assets/plugins/lightbox/ISSUE_TEMPLATE.md +9 -0
- data/assets/plugins/lightbox/LICENSE +21 -0
- data/assets/plugins/lightbox/README.md +15 -10
- data/assets/plugins/lightbox/bower.json +29 -38
- data/assets/plugins/lightbox/dist/ekko-lightbox.css +2 -62
- data/assets/plugins/lightbox/dist/ekko-lightbox.js +668 -400
- data/assets/plugins/lightbox/dist/ekko-lightbox.js.map +1 -0
- data/assets/plugins/lightbox/dist/ekko-lightbox.min.js +2 -7
- data/assets/plugins/lightbox/dist/ekko-lightbox.min.js.map +1 -0
- data/assets/plugins/lightbox/ekko-lightbox.js +671 -0
- data/assets/plugins/lightbox/ekko-lightbox.less +139 -64
- data/assets/plugins/lightbox/examples/bs3.html +596 -0
- data/assets/plugins/lightbox/index.html +659 -0
- data/assets/plugins/lightbox/package.json +57 -46
- data/assets/plugins/lightbox/webpack.config.js +89 -0
- data/assets/plugins/lightbox/yarn.lock +6683 -0
- data/assets/plugins/prism/min/prism-min.js +0 -0
- data/assets/plugins/stickyfill/.editorconfig +9 -0
- data/assets/plugins/stickyfill/.gitignore +1 -0
- data/assets/plugins/stickyfill/Gruntfile.js +106 -0
- data/assets/plugins/stickyfill/LICENSE +21 -0
- data/assets/plugins/stickyfill/README.md +229 -0
- data/assets/plugins/stickyfill/dist/stickyfill.es6.js +507 -0
- data/assets/plugins/stickyfill/dist/stickyfill.js +520 -0
- data/assets/plugins/stickyfill/dist/stickyfill.min.js +7 -0
- data/assets/plugins/stickyfill/package-lock.json +2109 -0
- data/assets/plugins/stickyfill/package.json +32 -0
- data/assets/plugins/stickyfill/src/stickyfill.js +500 -0
- data/assets/plugins/stickyfill/test/index.html +941 -0
- data/assets/plugins/stickyfill/test/js/jquery-3.1.1.min.js +4 -0
- data/assets/plugins/stickyfill/types/index.d.ts +17 -0
- data/assets/plugins/stickyfill/yarn.lock +1475 -0
- data/assets/scss/.DS_Store +0 -0
- data/assets/{less/base.less → scss/_base.scss} +283 -307
- data/assets/{less/doc.less → scss/_doc.scss} +747 -747
- data/assets/{less/landing.less → scss/_landing.scss} +231 -244
- data/assets/scss/_mixins.scss +175 -0
- data/assets/scss/config.codekit3 +2243 -0
- data/assets/scss/styles.scss +45 -0
- metadata +76 -96
- data/_includes/blue-doc-wrapper.html +0 -293
- data/_includes/blue-header.html +0 -17
- data/_includes/card-charts.html +0 -10
- data/_includes/card-components.html +0 -10
- data/_includes/card-faqs.html +0 -10
- data/_includes/card-license.html +0 -10
- data/_includes/card-quick.html +0 -10
- data/_includes/card-showcase.html +0 -10
- data/_includes/cards-section.html +0 -47
- data/_includes/doc-wrapper.html +0 -170
- data/_includes/fb-root.html +0 -9
- data/_includes/green-doc-wrapper.html +0 -484
- data/_includes/green-header.html +0 -17
- data/_includes/header-home.html +0 -21
- data/_includes/header.html +0 -70
- data/_includes/icon-github.html +0 -1
- data/_includes/landing-header.html +0 -22
- data/_includes/orange-doc-wrapper.html +0 -65
- data/_includes/orange-header.html +0 -17
- data/_includes/pink-doc-wrapper.html +0 -281
- data/_includes/pink-header.html +0 -17
- data/_includes/purple-doc-wrapper.html +0 -138
- data/_includes/purple-header.html +0 -17
- data/_layouts/blue.html +0 -53
- data/_layouts/default.html +0 -53
- data/_layouts/green.html +0 -53
- data/_layouts/orange.html +0 -53
- data/_layouts/pink.html +0 -53
- data/_layouts/post.html +0 -5
- data/_layouts/purple.html +0 -53
- data/assets/images/demo/a-complete-example-of-page.png +0 -0
- data/assets/less/mixins.less +0 -185
- data/assets/less/styles.less +0 -13
- data/assets/less/theme-default.less +0 -115
- data/assets/plugins/bootstrap/css/bootstrap-theme.css +0 -587
- data/assets/plugins/bootstrap/css/bootstrap-theme.css.map +0 -0
- data/assets/plugins/bootstrap/css/bootstrap-theme.min.css +0 -6
- data/assets/plugins/bootstrap/css/bootstrap-theme.min.css.map +0 -0
- data/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- data/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.svg +0 -288
- data/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- data/assets/plugins/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/assets/plugins/bootstrap/js/npm.js +0 -13
- data/assets/plugins/font-awesome/HELP-US-OUT.txt +0 -7
- data/assets/plugins/font-awesome/css/font-awesome.css +0 -2199
- data/assets/plugins/font-awesome/css/font-awesome.min.css +0 -4
- data/assets/plugins/font-awesome/fonts/FontAwesome.otf +0 -0
- data/assets/plugins/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- data/assets/plugins/font-awesome/fonts/fontawesome-webfont.svg +0 -685
- data/assets/plugins/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- data/assets/plugins/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- data/assets/plugins/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- data/assets/plugins/font-awesome/less/animated.less +0 -34
- data/assets/plugins/font-awesome/less/bordered-pulled.less +0 -25
- data/assets/plugins/font-awesome/less/core.less +0 -12
- data/assets/plugins/font-awesome/less/fixed-width.less +0 -6
- data/assets/plugins/font-awesome/less/font-awesome.less +0 -18
- data/assets/plugins/font-awesome/less/icons.less +0 -733
- data/assets/plugins/font-awesome/less/larger.less +0 -13
- data/assets/plugins/font-awesome/less/list.less +0 -19
- data/assets/plugins/font-awesome/less/mixins.less +0 -60
- data/assets/plugins/font-awesome/less/path.less +0 -15
- data/assets/plugins/font-awesome/less/rotated-flipped.less +0 -20
- data/assets/plugins/font-awesome/less/screen-reader.less +0 -5
- data/assets/plugins/font-awesome/less/stacked.less +0 -20
- data/assets/plugins/font-awesome/less/variables.less +0 -744
- data/assets/plugins/font-awesome/scss/_animated.scss +0 -34
- data/assets/plugins/font-awesome/scss/_bordered-pulled.scss +0 -25
- data/assets/plugins/font-awesome/scss/_core.scss +0 -12
- data/assets/plugins/font-awesome/scss/_fixed-width.scss +0 -6
- data/assets/plugins/font-awesome/scss/_icons.scss +0 -733
- data/assets/plugins/font-awesome/scss/_larger.scss +0 -13
- data/assets/plugins/font-awesome/scss/_list.scss +0 -19
- data/assets/plugins/font-awesome/scss/_mixins.scss +0 -60
- data/assets/plugins/font-awesome/scss/_path.scss +0 -15
- data/assets/plugins/font-awesome/scss/_rotated-flipped.scss +0 -20
- data/assets/plugins/font-awesome/scss/_screen-reader.scss +0 -5
- data/assets/plugins/font-awesome/scss/_stacked.scss +0 -20
- data/assets/plugins/font-awesome/scss/_variables.scss +0 -744
- data/assets/plugins/font-awesome/scss/font-awesome.scss +0 -18
- data/assets/plugins/jquery-1.12.3.min.js +0 -5
- data/assets/plugins/lightbox/LICENSE.txt +0 -339
- data/assets/plugins/lightbox/dist/ekko-lightbox.min.css +0 -6
- data/assets/plugins/lightbox/ekko-lightbox.coffee +0 -353
- data/assets/plugins/lightbox/examples/index.html +0 -559
- data/assets/plugins/lightbox/examples/remote/page1.html +0 -9
- data/assets/plugins/lightbox/examples/remote/page2.html +0 -9
- data/assets/plugins/lightbox/examples/remote/readme.md +0 -1
@@ -0,0 +1 @@
|
|
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,UAAQ,EAAE,IAAI;AACd,WAAS,EAAE,IAAI;AACf,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,Q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AM,GAAG,MAAM,IAAI,EAAE,CAAA;AACrB,WAAO,IAAI,CAAC,IAAI,CAAC,YAAM;AACtB,SAAI,KAAK,GAAG,CAAC,QAAM,CAAA;AACnB,SAAI,OAAO,GAAG,CAAC,CAAC,MAAM,CACrB,EAAE,EACF,QAAQ,CAAC,OAAO,EAChB,KAAK,CAAC,IAAI,EAAE,EACZ,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CACpC,CAAA;;AAED,SAAI,QAAQ,SAAO,OAAO,CAAC,CAAA;KAC3B,CAAC,CAAA;IACF;;;SA/mBI,QAAQ;;;AAonBd,EAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAe,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\n\tconst NAME = 'ekkoLightbox'\n\tconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\n\tconst Default = {\n\t\ttitle: '',\n\t\tfooter: '',\n\t\tmaxWidth: 9999,\n\t\tmaxHeight: 9999,\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: '<div class=\"ekko-lightbox-loader\"><div><div></div><div></div></div></div>', // http://tobiasahlin.com/spinkit/\n\t\tleftArrow: '<span>❮</span>',\n\t\trightArrow: '<span>❯</span>',\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\n\t Class properties:\n\n\t\t _$element: null -> the <a> 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 <a>'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\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 = `<h4 class=\"modal-title\">${this._config.title || \" \"}</h4>`;\n\t\t\tlet btn = `<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"${this._config.strings.close}\"><span aria-hidden=\"true\">×</span></button>`;\n\n\t\t\tlet header = `<div class=\"modal-header${this._config.title || this._config.alwaysShowClose ? '' : ' hide'}\">`+(this._isBootstrap3 ? btn+h4 : h4+btn)+`</div>`;\n\t\t\tlet footer = `<div class=\"modal-footer${this._config.footer ? '' : ' hide'}\">${this._config.footer || \" \"}</div>`;\n\t\t\tlet body = '<div class=\"modal-body\"><div class=\"ekko-lightbox-container\"><div class=\"ekko-lightbox-item fade in show\"></div><div class=\"ekko-lightbox-item fade\"></div></div></div>'\n\t\t\tlet dialog = `<div class=\"modal-dialog\" role=\"document\"><div class=\"modal-content\">${header}${body}${footer}</div></div>`\n\t\t\t$(this._config.doc.body).append(`<div id=\"${this._modalId}\" class=\"ekko-lightbox modal fade\" tabindex=\"-1\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">${dialog}</div>`)\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(`<div class=\"ekko-lightbox-nav-overlay\"><a href=\"#\">${this._config.leftArrow}</a><a href=\"#\">${this._config.rightArrow}</a></div>`)\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\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(`<iframe width=\"${width}\" height=\"${height}\" src=\"${id}embed/\" frameborder=\"0\" allowfullscreen></iframe>`);\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(`<div class=\"embed-responsive embed-responsive-16by9\"><iframe width=\"${width}\" height=\"${height}\" src=\"${url}\" frameborder=\"0\" allowfullscreen class=\"embed-responsive-item\"></iframe></div>`);\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(`<div class=\"embed-responsive embed-responsive-16by9\"><video width=\"${width}\" height=\"${height}\" src=\"${url}\" preload=\"auto\" autoplay controls class=\"embed-responsive-item\"></video></div>`);\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(`<iframe src=\"${url}\" frameborder=\"0\" allowfullscreen></iframe>`);\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 = $('<img />');\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\tlet imageAspecRatio = width / 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\n\t\t\t// force 10px margin if window size > 575px\n\t\t\tlet addMargin = this._config.doc.body.clientWidth > 575 ? 20 : 0\n\t\t\tlet discountMargin = this._config.doc.body.clientWidth > 575 ? 0 : 20\n\n\t\t\tlet maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth - addMargin, this._config.maxWidth)\n\n\t\t\tif((width + widthBorderAndPadding) > maxWidth) {\n\t\t\t\theight = (maxWidth - widthBorderAndPadding - discountMargin) / imageAspecRatio;\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 footerHeight = 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, this._config.maxHeight - borderPadding - headerHeight - footerHeight);\n\n\t\t\tif(height > maxHeight) {\n\t\t\t\t// if height > the available height, scale down the width\n\t\t\t\twidth = Math.ceil(maxHeight * imageAspecRatio) + widthBorderAndPadding;\n\t\t\t}\n\n\t\t\tthis._$lightboxContainer.css('height', maxHeight)\n\t\t\tthis._$modalDialog.css('flex', 1).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\n"]}
|
@@ -1,7 +1,2 @@
|
|
1
|
-
/*!
|
2
|
-
|
3
|
-
* https://github.com/ashleydw/lightbox
|
4
|
-
*
|
5
|
-
* License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
|
6
|
-
*/
|
7
|
-
(function(){"use strict";var a,b;a=jQuery,b=function(b,c){var d,e,f,g=this;return this.options=a.extend({title:null,footer:null,remote:null},a.fn.ekkoLightbox.defaults,c||{}),this.$element=a(b),d="",this.modal_id=this.options.modal_id?this.options.modal_id:"ekkoLightbox-"+Math.floor(1e3*Math.random()+1),f='<div class="modal-header"'+(this.options.title||this.options.always_show_close?"":' style="display:none"')+'><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h4 class="modal-title">'+(this.options.title||" ")+"</h4></div>",e='<div class="modal-footer"'+(this.options.footer?"":' style="display:none"')+">"+this.options.footer+"</div>",a(document.body).append('<div id="'+this.modal_id+'" class="ekko-lightbox modal fade" tabindex="-1"><div class="modal-dialog"><div class="modal-content">'+f+'<div class="modal-body"><div class="ekko-lightbox-container"><div></div></div></div>'+e+"</div></div></div>"),this.modal=a("#"+this.modal_id),this.modal_dialog=this.modal.find(".modal-dialog").first(),this.modal_content=this.modal.find(".modal-content").first(),this.modal_body=this.modal.find(".modal-body").first(),this.lightbox_container=this.modal_body.find(".ekko-lightbox-container").first(),this.lightbox_body=this.lightbox_container.find("> div:first-child").first(),this.showLoading(),this.modal_arrows=null,this.border={top:parseFloat(this.modal_dialog.css("border-top-width"))+parseFloat(this.modal_content.css("border-top-width"))+parseFloat(this.modal_body.css("border-top-width")),right:parseFloat(this.modal_dialog.css("border-right-width"))+parseFloat(this.modal_content.css("border-right-width"))+parseFloat(this.modal_body.css("border-right-width")),bottom:parseFloat(this.modal_dialog.css("border-bottom-width"))+parseFloat(this.modal_content.css("border-bottom-width"))+parseFloat(this.modal_body.css("border-bottom-width")),left:parseFloat(this.modal_dialog.css("border-left-width"))+parseFloat(this.modal_content.css("border-left-width"))+parseFloat(this.modal_body.css("border-left-width"))},this.padding={top:parseFloat(this.modal_dialog.css("padding-top"))+parseFloat(this.modal_content.css("padding-top"))+parseFloat(this.modal_body.css("padding-top")),right:parseFloat(this.modal_dialog.css("padding-right"))+parseFloat(this.modal_content.css("padding-right"))+parseFloat(this.modal_body.css("padding-right")),bottom:parseFloat(this.modal_dialog.css("padding-bottom"))+parseFloat(this.modal_content.css("padding-bottom"))+parseFloat(this.modal_body.css("padding-bottom")),left:parseFloat(this.modal_dialog.css("padding-left"))+parseFloat(this.modal_content.css("padding-left"))+parseFloat(this.modal_body.css("padding-left"))},this.modal.on("show.bs.modal",this.options.onShow.bind(this)).on("shown.bs.modal",function(){return g.modal_shown(),g.options.onShown.call(g)}).on("hide.bs.modal",this.options.onHide.bind(this)).on("hidden.bs.modal",function(){return g.gallery&&a(document).off("keydown.ekkoLightbox"),g.modal.remove(),g.options.onHidden.call(g)}).modal("show",c),this.modal},b.prototype={modal_shown:function(){var b,c=this;return this.options.remote?(this.gallery=this.$element.data("gallery"),this.gallery&&("document.body"===this.options.gallery_parent_selector||""===this.options.gallery_parent_selector?this.gallery_items=a(document.body).find('*[data-toggle="lightbox"][data-gallery="'+this.gallery+'"]'):this.gallery_items=this.$element.parents(this.options.gallery_parent_selector).first().find('*[data-toggle="lightbox"][data-gallery="'+this.gallery+'"]'),this.gallery_index=this.gallery_items.index(this.$element),a(document).on("keydown.ekkoLightbox",this.navigate.bind(this)),this.options.directional_arrows&&this.gallery_items.length>1&&(this.lightbox_container.append('<div class="ekko-lightbox-nav-overlay"><a href="#" class="'+this.strip_stops(this.options.left_arrow_class)+'"></a><a href="#" class="'+this.strip_stops(this.options.right_arrow_class)+'"></a></div>'),this.modal_arrows=this.lightbox_container.find("div.ekko-lightbox-nav-overlay").first(),this.lightbox_container.find("a"+this.strip_spaces(this.options.left_arrow_class)).on("click",function(a){return a.preventDefault(),c.navigate_left()}),this.lightbox_container.find("a"+this.strip_spaces(this.options.right_arrow_class)).on("click",function(a){return a.preventDefault(),c.navigate_right()}))),this.options.type?"image"===this.options.type?this.preloadImage(this.options.remote,!0):"youtube"===this.options.type&&(b=this.getYoutubeId(this.options.remote))?this.showYoutubeVideo(b):"vimeo"===this.options.type?this.showVimeoVideo(this.options.remote):"instagram"===this.options.type?this.showInstagramVideo(this.options.remote):"url"===this.options.type?this.loadRemoteContent(this.options.remote):"video"===this.options.type?this.showVideoIframe(this.options.remote):this.error('Could not detect remote target type. Force the type using data-type="image|youtube|vimeo|instagram|url|video"'):this.detectRemoteType(this.options.remote)):this.error("No remote target given")},strip_stops:function(a){return a.replace(/\./g,"")},strip_spaces:function(a){return a.replace(/\s/g,"")},isImage:function(a){return a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSwf:function(a){return a.match(/\.(swf)((\?|#).*)?$/i)},getYoutubeId:function(a){var b;return b=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/),b&&11===b[2].length?b[2]:!1},getVimeoId:function(a){return a.indexOf("vimeo")>0?a:!1},getInstagramId:function(a){return a.indexOf("instagram")>0?a:!1},navigate:function(a){if(a=a||window.event,39===a.keyCode||37===a.keyCode){if(39===a.keyCode)return this.navigate_right();if(37===a.keyCode)return this.navigate_left()}},navigateTo:function(b){var c,d;return 0>b||b>this.gallery_items.length-1?this:(this.showLoading(),this.gallery_index=b,this.$element=a(this.gallery_items.get(this.gallery_index)),this.updateTitleAndFooter(),d=this.$element.attr("data-remote")||this.$element.attr("href"),this.detectRemoteType(d,this.$element.attr("data-type")||!1),this.gallery_index+1<this.gallery_items.length&&(c=a(this.gallery_items.get(this.gallery_index+1),!1),d=c.attr("data-remote")||c.attr("href"),"image"===c.attr("data-type")||this.isImage(d))?this.preloadImage(d,!1):void 0)},navigate_left:function(){return 1!==this.gallery_items.length?(0===this.gallery_index?this.gallery_index=this.gallery_items.length-1:this.gallery_index--,this.options.onNavigate.call(this,"left",this.gallery_index),this.navigateTo(this.gallery_index)):void 0},navigate_right:function(){return 1!==this.gallery_items.length?(this.gallery_index===this.gallery_items.length-1?this.gallery_index=0:this.gallery_index++,this.options.onNavigate.call(this,"right",this.gallery_index),this.navigateTo(this.gallery_index)):void 0},detectRemoteType:function(a,b){var c;return b=b||!1,"image"===b||this.isImage(a)?(this.options.type="image",this.preloadImage(a,!0)):"youtube"===b||(c=this.getYoutubeId(a))?(this.options.type="youtube",this.showYoutubeVideo(c)):"vimeo"===b||(c=this.getVimeoId(a))?(this.options.type="vimeo",this.showVimeoVideo(c)):"instagram"===b||(c=this.getInstagramId(a))?(this.options.type="instagram",this.showInstagramVideo(c)):"video"===b?(this.options.type="video",this.showVideoIframe(c)):(this.options.type="url",this.loadRemoteContent(a))},updateTitleAndFooter:function(){var a,b,c,d;return c=this.modal_content.find(".modal-header"),b=this.modal_content.find(".modal-footer"),d=this.$element.data("title")||"",a=this.$element.data("footer")||"",d||this.options.always_show_close?c.css("display","").find(".modal-title").html(d||" "):c.css("display","none"),a?b.css("display","").html(a):b.css("display","none"),this},showLoading:function(){return this.lightbox_body.html('<div class="modal-loading">'+this.options.loadingMessage+"</div>"),this},showYoutubeVideo:function(a){var b,c;return c=this.checkDimensions(this.$element.data("width")||560),b=c/(560/315),this.showVideoIframe("//www.youtube.com/embed/"+a+"?badge=0&autoplay=1&html5=1",c,b)},showVimeoVideo:function(a){var b,c;return c=this.checkDimensions(this.$element.data("width")||560),b=c/(500/281),this.showVideoIframe(a+"?autoplay=1",c,b)},showInstagramVideo:function(a){var b,c;return c=this.checkDimensions(this.$element.data("width")||612),this.resize(c),b=c+80,this.lightbox_body.html('<iframe width="'+c+'" height="'+b+'" src="'+this.addTrailingSlash(a)+'embed/" frameborder="0" allowfullscreen></iframe>'),this.options.onContentLoaded.call(this),this.modal_arrows?this.modal_arrows.css("display","none"):void 0},showVideoIframe:function(a,b,c){return c=c||b,this.resize(b),this.lightbox_body.html('<div class="embed-responsive embed-responsive-16by9"><iframe width="'+b+'" height="'+c+'" src="'+a+'" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>'),this.options.onContentLoaded.call(this),this.modal_arrows&&this.modal_arrows.css("display","none"),this},loadRemoteContent:function(b){var c,d,e=this;return d=this.$element.data("width")||560,this.resize(d),c=this.$element.data("disableExternalCheck")||!1,c||this.isExternal(b)?(this.lightbox_body.html('<iframe width="'+d+'" height="'+d+'" src="'+b+'" frameborder="0" allowfullscreen></iframe>'),this.options.onContentLoaded.call(this)):this.lightbox_body.load(b,a.proxy(function(){return e.$element.trigger("loaded.bs.modal")})),this.modal_arrows&&this.modal_arrows.css("display","none"),this},isExternal:function(a){var b;return b=a.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/),"string"==typeof b[1]&&b[1].length>0&&b[1].toLowerCase()!==location.protocol?!0:"string"==typeof b[2]&&b[2].length>0&&b[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host?!0:!1},error:function(a){return this.lightbox_body.html(a),this},preloadImage:function(b,c){var d,e=this;return d=new Image,(null==c||c===!0)&&(d.onload=function(){var b;return b=a("<img />"),b.attr("src",d.src),b.addClass("img-responsive"),e.lightbox_body.html(b),e.modal_arrows&&e.modal_arrows.css("display","block"),b.load(function(){return e.resize(d.width),e.options.onContentLoaded.call(e)})},d.onerror=function(){return e.error("Failed to load image: "+b)}),d.src=b,d},resize:function(b){var c;return c=b+this.border.left+this.padding.left+this.padding.right+this.border.right,this.modal_dialog.css("width","auto").css("max-width",c),this.lightbox_container.find("a").css("line-height",function(){return a(this).parent().height()+"px"}),this},checkDimensions:function(a){var b,c;return c=a+this.border.left+this.padding.left+this.padding.right+this.border.right,b=document.body.clientWidth,c>b&&(a=this.modal_body.width()),a},close:function(){return this.modal.modal("hide")},addTrailingSlash:function(a){return"/"!==a.substr(-1)&&(a+="/"),a}},a.fn.ekkoLightbox=function(c){return this.each(function(){var d;return d=a(this),c=a.extend({remote:d.attr("data-remote")||d.attr("href"),gallery_parent_selector:d.attr("data-parent"),type:d.attr("data-type")},c,d.data()),new b(this,c),this})},a.fn.ekkoLightbox.defaults={gallery_parent_selector:"document.body",left_arrow_class:".glyphicon .glyphicon-chevron-left",right_arrow_class:".glyphicon .glyphicon-chevron-right",directional_arrows:!0,type:null,always_show_close:!0,loadingMessage:"Loading...",onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}}}).call(this);
|
1
|
+
+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<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();(function(a){var d="ekkoLightbox",e=a.fn[d],f={title:"",footer:"",maxWidth:9999,maxHeight:9999,showArrows:!0,wrapping:!0,type:null,alwaysShowClose:!1,loadingMessage:'<div class="ekko-lightbox-loader"><div><div></div><div></div></div></div>',leftArrow:"<span>❮</span>",rightArrow:"<span>❯</span>",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='<h4 class="modal-title">'+(this._config.title||" ")+"</h4>",i='<button type="button" class="close" data-dismiss="modal" aria-label="'+this._config.strings.close+'"><span aria-hidden="true">×</span></button>',j='<div class="modal-header'+(this._config.title||this._config.alwaysShowClose?"":" hide")+'">'+(this._isBootstrap3?i+h:h+i)+"</div>",k='<div class="modal-footer'+(this._config.footer?"":" hide")+'">'+(this._config.footer||" ")+"</div>",l='<div class="modal-body"><div class="ekko-lightbox-container"><div class="ekko-lightbox-item fade in show"></div><div class="ekko-lightbox-item fade"></div></div></div>',m='<div class="modal-dialog" role="document"><div class="modal-content">'+j+l+k+"</div></div>";a(this._config.doc.body).append('<div id="'+this._modalId+'" class="ekko-lightbox modal fade" tabindex="-1" tabindex="-1" role="dialog" aria-hidden="true">'+m+"</div>"),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('<div class="ekko-lightbox-nav-overlay"><a href="#">'+this._config.leftArrow+'</a><a href="#">'+this._config.rightArrow+"</a></div>"),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('<iframe width="'+c+'" height="'+d+'" src="'+a+'embed/" frameborder="0" allowfullscreen></iframe>'),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('<div class="embed-responsive embed-responsive-16by9"><iframe width="'+b+'" height="'+c+'" src="'+a+'" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>'),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('<div class="embed-responsive embed-responsive-16by9"><video width="'+c+'" height="'+d+'" src="'+a+'" preload="auto" autoplay controls class="embed-responsive-item"></video></div>'),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('<iframe src="'+b+'" frameborder="0" allowfullscreen></iframe>'),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("<img />");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._touchendX<this._touchstartX?this.navigateRight():this._touchendX>this._touchstartX?this.navigateLeft():void 0}},{key:"_resize",value:function(b,c){c=c||b,this._wantedWidth=b,this._wantedHeight=c;var d=b/c,e=this._padding.left+this._padding.right+this._border.left+this._border.right,f=this._config.doc.body.clientWidth>575?20:0,g=this._config.doc.body.clientWidth>575?0:20,h=Math.min(b+e,this._config.doc.body.clientWidth-f,this._config.maxWidth);b+e>h?(c=(h-e-g)/d,b=h):b+=e;var i=0,j=0;this._footerIsShown&&(j=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(i=this._$modalHeader.outerHeight(!0)||67);var k=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,l=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),m=Math.min(c,a(window).height()-k-l-i-j,this._config.maxHeight-k-i-j);c>m&&(b=Math.ceil(m*d)+e),this._$lightboxContainer.css("height",m),this._$modalDialog.css("flex",1).css("maxWidth",b);var n=this._$modal.data("bs.modal");if(n)try{n._handleUpdate()}catch(o){n.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);
|
2
|
+
//# sourceMappingURL=ekko-lightbox.min.js.map
|
@@ -0,0 +1 @@
|
|
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","maxWidth","maxHeight","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","imageAspecRatio","widthBorderAndPadding","addMargin","clientWidth","discountMargin","min","headerHeight","footerHeight","outerHeight","borderPadding","margins","parseFloat","ceil","_handleUpdate","Exception","handleUpdate","_this5","each","$this","_jQueryInterface","noConflict"],"mappings":"CAMC,SAAUA,GAEX,YAIA,SAASC,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCAFhH,GAAIC,GAAe,WAAe,QAASC,GAAiBC,EAAQC,GAAS,IAAK,GAAIC,GAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,GAAIE,GAAaH,EAAMC,EAAIE,GAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,SAAWF,KAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAAiB,MAAO,UAAUR,EAAae,EAAYC,GAAiJ,MAA9HD,IAAYZ,EAAiBH,EAAYiB,UAAWF,GAAiBC,GAAab,EAA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WAC9B,IAAIrB,EAEH,IACCA,EAAM4I,gBACL,MAAOC,GACR7I,EAAM8I,eAGR,MAAOnK,WAGRlC,IAAK,mBACLkG,MAAO,SAA0BlE,GAChC,GAAIsK,GAASpK,IAGb,OADAF,GAASA,MACFE,KAAKqK,KAAK,WAChB,GAAIC,GAAQzN,EAAEuN,GACVnK,EAAUpD,EAAEqD,UAAWN,EAASvB,QAASiM,EAAM5H,OAA0B,gBAAX5C,IAAuBA,EAEzF,IAAIF,GAASwK,EAAQnK,SAKjBL,IAUR,OAPA/C,GAAEuB,GAAGF,GAAQ0B,EAAS2K,iBACtB1N,EAAEuB,GAAGF,GAAMlB,YAAc4C,EACzB/C,EAAEuB,GAAGF,GAAMsM,WAAa,WAEvB,MADA3N,GAAEuB,GAAGF,GAAQC,EACNyB,EAAS2K,kBAGV3K,IACLuB,SAGDA","file":"ekko-lightbox.min.js"}
|
@@ -0,0 +1,671 @@
|
|
1
|
+
const Lightbox = (($) => {
|
2
|
+
|
3
|
+
const NAME = 'ekkoLightbox'
|
4
|
+
const JQUERY_NO_CONFLICT = $.fn[NAME]
|
5
|
+
|
6
|
+
const Default = {
|
7
|
+
title: '',
|
8
|
+
footer: '',
|
9
|
+
maxWidth: 9999,
|
10
|
+
maxHeight: 9999,
|
11
|
+
showArrows: true, //display the left / right arrows or not
|
12
|
+
wrapping: true, //if true, gallery loops infinitely
|
13
|
+
type: null, //force the lightbox into image / youtube mode. if null, or not image|youtube|vimeo; detect it
|
14
|
+
alwaysShowClose: false, //always show the close button, even if there is no title
|
15
|
+
loadingMessage: '<div class="ekko-lightbox-loader"><div><div></div><div></div></div></div>', // http://tobiasahlin.com/spinkit/
|
16
|
+
leftArrow: '<span>❮</span>',
|
17
|
+
rightArrow: '<span>❯</span>',
|
18
|
+
strings: {
|
19
|
+
close: 'Close',
|
20
|
+
fail: 'Failed to load image:',
|
21
|
+
type: 'Could not detect remote target type. Force the type using data-type',
|
22
|
+
},
|
23
|
+
doc: document, // if in an iframe can specify top.document
|
24
|
+
onShow() {},
|
25
|
+
onShown() {},
|
26
|
+
onHide() {},
|
27
|
+
onHidden() {},
|
28
|
+
onNavigate() {},
|
29
|
+
onContentLoaded() {}
|
30
|
+
}
|
31
|
+
|
32
|
+
class Lightbox {
|
33
|
+
|
34
|
+
/**
|
35
|
+
|
36
|
+
Class properties:
|
37
|
+
|
38
|
+
_$element: null -> the <a> element currently being displayed
|
39
|
+
_$modal: The bootstrap modal generated
|
40
|
+
_$modalDialog: The .modal-dialog
|
41
|
+
_$modalContent: The .modal-content
|
42
|
+
_$modalBody: The .modal-body
|
43
|
+
_$modalHeader: The .modal-header
|
44
|
+
_$modalFooter: The .modal-footer
|
45
|
+
_$lightboxContainerOne: Container of the first lightbox element
|
46
|
+
_$lightboxContainerTwo: Container of the second lightbox element
|
47
|
+
_$lightboxBody: First element in the container
|
48
|
+
_$modalArrows: The overlayed arrows container
|
49
|
+
|
50
|
+
_$galleryItems: Other <a>'s available for this gallery
|
51
|
+
_galleryName: Name of the current data('gallery') showing
|
52
|
+
_galleryIndex: The current index of the _$galleryItems being shown
|
53
|
+
|
54
|
+
_config: {} the options for the modal
|
55
|
+
_modalId: unique id for the current lightbox
|
56
|
+
_padding / _border: CSS properties for the modal container; these are used to calculate the available space for the content
|
57
|
+
|
58
|
+
*/
|
59
|
+
|
60
|
+
static get Default() {
|
61
|
+
return Default
|
62
|
+
}
|
63
|
+
|
64
|
+
constructor($element, config) {
|
65
|
+
this._config = $.extend({}, Default, config)
|
66
|
+
this._$modalArrows = null
|
67
|
+
this._galleryIndex = 0
|
68
|
+
this._galleryName = null
|
69
|
+
this._padding = null
|
70
|
+
this._border = null
|
71
|
+
this._titleIsShown = false
|
72
|
+
this._footerIsShown = false
|
73
|
+
this._wantedWidth = 0
|
74
|
+
this._wantedHeight = 0
|
75
|
+
this._touchstartX = 0
|
76
|
+
this._touchendX = 0
|
77
|
+
|
78
|
+
this._modalId = `ekkoLightbox-${Math.floor((Math.random() * 1000) + 1)}`;
|
79
|
+
this._$element = $element instanceof jQuery ? $element : $($element)
|
80
|
+
|
81
|
+
this._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3;
|
82
|
+
|
83
|
+
let h4 = `<h4 class="modal-title">${this._config.title || " "}</h4>`;
|
84
|
+
let btn = `<button type="button" class="close" data-dismiss="modal" aria-label="${this._config.strings.close}"><span aria-hidden="true">×</span></button>`;
|
85
|
+
|
86
|
+
let header = `<div class="modal-header${this._config.title || this._config.alwaysShowClose ? '' : ' hide'}">`+(this._isBootstrap3 ? btn+h4 : h4+btn)+`</div>`;
|
87
|
+
let footer = `<div class="modal-footer${this._config.footer ? '' : ' hide'}">${this._config.footer || " "}</div>`;
|
88
|
+
let body = '<div class="modal-body"><div class="ekko-lightbox-container"><div class="ekko-lightbox-item fade in show"></div><div class="ekko-lightbox-item fade"></div></div></div>'
|
89
|
+
let dialog = `<div class="modal-dialog" role="document"><div class="modal-content">${header}${body}${footer}</div></div>`
|
90
|
+
$(this._config.doc.body).append(`<div id="${this._modalId}" class="ekko-lightbox modal fade" tabindex="-1" tabindex="-1" role="dialog" aria-hidden="true">${dialog}</div>`)
|
91
|
+
|
92
|
+
this._$modal = $(`#${this._modalId}`, this._config.doc)
|
93
|
+
this._$modalDialog = this._$modal.find('.modal-dialog').first()
|
94
|
+
this._$modalContent = this._$modal.find('.modal-content').first()
|
95
|
+
this._$modalBody = this._$modal.find('.modal-body').first()
|
96
|
+
this._$modalHeader = this._$modal.find('.modal-header').first()
|
97
|
+
this._$modalFooter = this._$modal.find('.modal-footer').first()
|
98
|
+
|
99
|
+
this._$lightboxContainer = this._$modalBody.find('.ekko-lightbox-container').first()
|
100
|
+
this._$lightboxBodyOne = this._$lightboxContainer.find('> div:first-child').first()
|
101
|
+
this._$lightboxBodyTwo = this._$lightboxContainer.find('> div:last-child').first()
|
102
|
+
|
103
|
+
this._border = this._calculateBorders()
|
104
|
+
this._padding = this._calculatePadding()
|
105
|
+
|
106
|
+
this._galleryName = this._$element.data('gallery')
|
107
|
+
if (this._galleryName) {
|
108
|
+
this._$galleryItems = $(document.body).find(`*[data-gallery="${this._galleryName}"]`)
|
109
|
+
this._galleryIndex = this._$galleryItems.index(this._$element)
|
110
|
+
$(document).on('keydown.ekkoLightbox', this._navigationalBinder.bind(this))
|
111
|
+
|
112
|
+
// add the directional arrows to the modal
|
113
|
+
if (this._config.showArrows && this._$galleryItems.length > 1) {
|
114
|
+
this._$lightboxContainer.append(`<div class="ekko-lightbox-nav-overlay"><a href="#">${this._config.leftArrow}</a><a href="#">${this._config.rightArrow}</a></div>`)
|
115
|
+
this._$modalArrows = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay').first()
|
116
|
+
this._$lightboxContainer.on('click', 'a:first-child', event => {
|
117
|
+
event.preventDefault()
|
118
|
+
return this.navigateLeft()
|
119
|
+
})
|
120
|
+
this._$lightboxContainer.on('click', 'a:last-child', event => {
|
121
|
+
event.preventDefault()
|
122
|
+
return this.navigateRight()
|
123
|
+
})
|
124
|
+
this.updateNavigation()
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
this._$modal
|
129
|
+
.on('show.bs.modal', this._config.onShow.bind(this))
|
130
|
+
.on('shown.bs.modal', () => {
|
131
|
+
this._toggleLoading(true)
|
132
|
+
this._handle()
|
133
|
+
return this._config.onShown.call(this)
|
134
|
+
})
|
135
|
+
.on('hide.bs.modal', this._config.onHide.bind(this))
|
136
|
+
.on('hidden.bs.modal', () => {
|
137
|
+
if (this._galleryName) {
|
138
|
+
$(document).off('keydown.ekkoLightbox')
|
139
|
+
$(window).off('resize.ekkoLightbox')
|
140
|
+
}
|
141
|
+
this._$modal.remove()
|
142
|
+
return this._config.onHidden.call(this)
|
143
|
+
})
|
144
|
+
.modal(this._config)
|
145
|
+
|
146
|
+
$(window).on('resize.ekkoLightbox', () => {
|
147
|
+
this._resize(this._wantedWidth, this._wantedHeight)
|
148
|
+
})
|
149
|
+
this._$lightboxContainer
|
150
|
+
.on('touchstart', () => {
|
151
|
+
this._touchstartX = event.changedTouches[0].screenX;
|
152
|
+
|
153
|
+
})
|
154
|
+
.on('touchend', () => {
|
155
|
+
this._touchendX = event.changedTouches[0].screenX;
|
156
|
+
this._swipeGesure();
|
157
|
+
})
|
158
|
+
}
|
159
|
+
|
160
|
+
element() {
|
161
|
+
return this._$element;
|
162
|
+
}
|
163
|
+
|
164
|
+
modal() {
|
165
|
+
return this._$modal;
|
166
|
+
}
|
167
|
+
|
168
|
+
navigateTo(index) {
|
169
|
+
|
170
|
+
if (index < 0 || index > this._$galleryItems.length-1)
|
171
|
+
return this
|
172
|
+
|
173
|
+
this._galleryIndex = index
|
174
|
+
|
175
|
+
this.updateNavigation()
|
176
|
+
|
177
|
+
this._$element = $(this._$galleryItems.get(this._galleryIndex))
|
178
|
+
this._handle();
|
179
|
+
}
|
180
|
+
|
181
|
+
navigateLeft() {
|
182
|
+
|
183
|
+
if(!this._$galleryItems)
|
184
|
+
return;
|
185
|
+
|
186
|
+
if (this._$galleryItems.length === 1)
|
187
|
+
return
|
188
|
+
|
189
|
+
if (this._galleryIndex === 0) {
|
190
|
+
if (this._config.wrapping)
|
191
|
+
this._galleryIndex = this._$galleryItems.length - 1
|
192
|
+
else
|
193
|
+
return
|
194
|
+
}
|
195
|
+
else //circular
|
196
|
+
this._galleryIndex--
|
197
|
+
|
198
|
+
this._config.onNavigate.call(this, 'left', this._galleryIndex)
|
199
|
+
return this.navigateTo(this._galleryIndex)
|
200
|
+
}
|
201
|
+
|
202
|
+
navigateRight() {
|
203
|
+
|
204
|
+
if(!this._$galleryItems)
|
205
|
+
return;
|
206
|
+
|
207
|
+
if (this._$galleryItems.length === 1)
|
208
|
+
return
|
209
|
+
|
210
|
+
if (this._galleryIndex === this._$galleryItems.length - 1) {
|
211
|
+
if (this._config.wrapping)
|
212
|
+
this._galleryIndex = 0
|
213
|
+
else
|
214
|
+
return
|
215
|
+
}
|
216
|
+
else //circular
|
217
|
+
this._galleryIndex++
|
218
|
+
|
219
|
+
this._config.onNavigate.call(this, 'right', this._galleryIndex)
|
220
|
+
return this.navigateTo(this._galleryIndex)
|
221
|
+
}
|
222
|
+
|
223
|
+
updateNavigation() {
|
224
|
+
if (!this._config.wrapping) {
|
225
|
+
let $nav = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay')
|
226
|
+
if (this._galleryIndex === 0)
|
227
|
+
$nav.find('a:first-child').addClass('disabled')
|
228
|
+
else
|
229
|
+
$nav.find('a:first-child').removeClass('disabled')
|
230
|
+
|
231
|
+
if (this._galleryIndex === this._$galleryItems.length - 1)
|
232
|
+
$nav.find('a:last-child').addClass('disabled')
|
233
|
+
else
|
234
|
+
$nav.find('a:last-child').removeClass('disabled')
|
235
|
+
}
|
236
|
+
}
|
237
|
+
|
238
|
+
close() {
|
239
|
+
return this._$modal.modal('hide');
|
240
|
+
}
|
241
|
+
|
242
|
+
// helper private methods
|
243
|
+
_navigationalBinder(event) {
|
244
|
+
event = event || window.event;
|
245
|
+
if (event.keyCode === 39)
|
246
|
+
return this.navigateRight()
|
247
|
+
if (event.keyCode === 37)
|
248
|
+
return this.navigateLeft()
|
249
|
+
}
|
250
|
+
|
251
|
+
// type detection private methods
|
252
|
+
_detectRemoteType(src, type) {
|
253
|
+
|
254
|
+
type = type || false;
|
255
|
+
|
256
|
+
if(!type && this._isImage(src))
|
257
|
+
type = 'image';
|
258
|
+
if(!type && this._getYoutubeId(src))
|
259
|
+
type = 'youtube';
|
260
|
+
if(!type && this._getVimeoId(src))
|
261
|
+
type = 'vimeo';
|
262
|
+
if(!type && this._getInstagramId(src))
|
263
|
+
type = 'instagram';
|
264
|
+
|
265
|
+
if(!type || ['image', 'youtube', 'vimeo', 'instagram', 'video', 'url'].indexOf(type) < 0)
|
266
|
+
type = 'url';
|
267
|
+
|
268
|
+
return type;
|
269
|
+
}
|
270
|
+
|
271
|
+
_isImage(string) {
|
272
|
+
return string && string.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)
|
273
|
+
}
|
274
|
+
|
275
|
+
_containerToUse() {
|
276
|
+
// if currently showing an image, fade it out and remove
|
277
|
+
let $toUse = this._$lightboxBodyTwo
|
278
|
+
let $current = this._$lightboxBodyOne
|
279
|
+
|
280
|
+
if(this._$lightboxBodyTwo.hasClass('in')) {
|
281
|
+
$toUse = this._$lightboxBodyOne
|
282
|
+
$current = this._$lightboxBodyTwo
|
283
|
+
}
|
284
|
+
|
285
|
+
$current.removeClass('in show')
|
286
|
+
setTimeout(() => {
|
287
|
+
if(!this._$lightboxBodyTwo.hasClass('in'))
|
288
|
+
this._$lightboxBodyTwo.empty()
|
289
|
+
if(!this._$lightboxBodyOne.hasClass('in'))
|
290
|
+
this._$lightboxBodyOne.empty()
|
291
|
+
}, 500)
|
292
|
+
|
293
|
+
$toUse.addClass('in show')
|
294
|
+
return $toUse
|
295
|
+
}
|
296
|
+
|
297
|
+
_handle() {
|
298
|
+
|
299
|
+
let $toUse = this._containerToUse()
|
300
|
+
this._updateTitleAndFooter()
|
301
|
+
|
302
|
+
let currentRemote = this._$element.attr('data-remote') || this._$element.attr('href')
|
303
|
+
let currentType = this._detectRemoteType(currentRemote, this._$element.attr('data-type') || false)
|
304
|
+
|
305
|
+
if(['image', 'youtube', 'vimeo', 'instagram', 'video', 'url'].indexOf(currentType) < 0)
|
306
|
+
return this._error(this._config.strings.type)
|
307
|
+
|
308
|
+
switch(currentType) {
|
309
|
+
case 'image':
|
310
|
+
this._preloadImage(currentRemote, $toUse)
|
311
|
+
this._preloadImageByIndex(this._galleryIndex, 3)
|
312
|
+
break;
|
313
|
+
case 'youtube':
|
314
|
+
this._showYoutubeVideo(currentRemote, $toUse);
|
315
|
+
break;
|
316
|
+
case 'vimeo':
|
317
|
+
this._showVimeoVideo(this._getVimeoId(currentRemote), $toUse);
|
318
|
+
break;
|
319
|
+
case 'instagram':
|
320
|
+
this._showInstagramVideo(this._getInstagramId(currentRemote), $toUse);
|
321
|
+
break;
|
322
|
+
case 'video':
|
323
|
+
this._showHtml5Video(currentRemote, $toUse);
|
324
|
+
break;
|
325
|
+
default: // url
|
326
|
+
this._loadRemoteContent(currentRemote, $toUse);
|
327
|
+
break;
|
328
|
+
}
|
329
|
+
|
330
|
+
return this;
|
331
|
+
}
|
332
|
+
|
333
|
+
_getYoutubeId(string) {
|
334
|
+
if(!string)
|
335
|
+
return false;
|
336
|
+
let matches = string.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/)
|
337
|
+
return (matches && matches[2].length === 11) ? matches[2] : false
|
338
|
+
}
|
339
|
+
|
340
|
+
_getVimeoId(string) {
|
341
|
+
return string && string.indexOf('vimeo') > 0 ? string : false
|
342
|
+
}
|
343
|
+
|
344
|
+
_getInstagramId(string) {
|
345
|
+
return string && string.indexOf('instagram') > 0 ? string : false
|
346
|
+
}
|
347
|
+
|
348
|
+
// layout private methods
|
349
|
+
_toggleLoading(show) {
|
350
|
+
show = show || false
|
351
|
+
if(show) {
|
352
|
+
this._$modalDialog.css('display', 'none')
|
353
|
+
this._$modal.removeClass('in show')
|
354
|
+
$('.modal-backdrop').append(this._config.loadingMessage)
|
355
|
+
}
|
356
|
+
else {
|
357
|
+
this._$modalDialog.css('display', 'block')
|
358
|
+
this._$modal.addClass('in show')
|
359
|
+
$('.modal-backdrop').find('.ekko-lightbox-loader').remove()
|
360
|
+
}
|
361
|
+
return this;
|
362
|
+
}
|
363
|
+
|
364
|
+
_calculateBorders() {
|
365
|
+
return {
|
366
|
+
top: this._totalCssByAttribute('border-top-width'),
|
367
|
+
right: this._totalCssByAttribute('border-right-width'),
|
368
|
+
bottom: this._totalCssByAttribute('border-bottom-width'),
|
369
|
+
left: this._totalCssByAttribute('border-left-width'),
|
370
|
+
}
|
371
|
+
}
|
372
|
+
|
373
|
+
_calculatePadding() {
|
374
|
+
return {
|
375
|
+
top: this._totalCssByAttribute('padding-top'),
|
376
|
+
right: this._totalCssByAttribute('padding-right'),
|
377
|
+
bottom: this._totalCssByAttribute('padding-bottom'),
|
378
|
+
left: this._totalCssByAttribute('padding-left'),
|
379
|
+
}
|
380
|
+
}
|
381
|
+
|
382
|
+
_totalCssByAttribute(attribute) {
|
383
|
+
return parseInt(this._$modalDialog.css(attribute), 10) +
|
384
|
+
parseInt(this._$modalContent.css(attribute), 10) +
|
385
|
+
parseInt(this._$modalBody.css(attribute), 10)
|
386
|
+
}
|
387
|
+
|
388
|
+
_updateTitleAndFooter() {
|
389
|
+
let title = this._$element.data('title') || ""
|
390
|
+
let caption = this._$element.data('footer') || ""
|
391
|
+
|
392
|
+
this._titleIsShown = false
|
393
|
+
if (title || this._config.alwaysShowClose) {
|
394
|
+
this._titleIsShown = true
|
395
|
+
this._$modalHeader.css('display', '').find('.modal-title').html(title || " ")
|
396
|
+
}
|
397
|
+
else
|
398
|
+
this._$modalHeader.css('display', 'none')
|
399
|
+
|
400
|
+
this._footerIsShown = false
|
401
|
+
if (caption) {
|
402
|
+
this._footerIsShown = true
|
403
|
+
this._$modalFooter.css('display', '').html(caption)
|
404
|
+
}
|
405
|
+
else
|
406
|
+
this._$modalFooter.css('display', 'none')
|
407
|
+
|
408
|
+
return this;
|
409
|
+
}
|
410
|
+
|
411
|
+
_showYoutubeVideo(remote, $containerForElement) {
|
412
|
+
let id = this._getYoutubeId(remote)
|
413
|
+
let query = remote.indexOf('&') > 0 ? remote.substr(remote.indexOf('&')) : ''
|
414
|
+
let width = this._$element.data('width') || 560
|
415
|
+
let height = this._$element.data('height') || width / ( 560/315 )
|
416
|
+
return this._showVideoIframe(
|
417
|
+
`//www.youtube.com/embed/${id}?badge=0&autoplay=1&html5=1${query}`,
|
418
|
+
width,
|
419
|
+
height,
|
420
|
+
$containerForElement
|
421
|
+
);
|
422
|
+
}
|
423
|
+
|
424
|
+
_showVimeoVideo(id, $containerForElement) {
|
425
|
+
let width = this._$element.data('width') || 500
|
426
|
+
let height = this._$element.data('height') || width / ( 560/315 )
|
427
|
+
return this._showVideoIframe(id + '?autoplay=1', width, height, $containerForElement)
|
428
|
+
}
|
429
|
+
|
430
|
+
_showInstagramVideo(id, $containerForElement) {
|
431
|
+
// instagram load their content into iframe's so this can be put straight into the element
|
432
|
+
let width = this._$element.data('width') || 612
|
433
|
+
let height = width + 80;
|
434
|
+
id = id.substr(-1) !== '/' ? id + '/' : id; // ensure id has trailing slash
|
435
|
+
$containerForElement.html(`<iframe width="${width}" height="${height}" src="${id}embed/" frameborder="0" allowfullscreen></iframe>`);
|
436
|
+
this._resize(width, height);
|
437
|
+
this._config.onContentLoaded.call(this);
|
438
|
+
if (this._$modalArrows) //hide the arrows when showing video
|
439
|
+
this._$modalArrows.css('display', 'none');
|
440
|
+
this._toggleLoading(false);
|
441
|
+
return this;
|
442
|
+
}
|
443
|
+
|
444
|
+
_showVideoIframe(url, width, height, $containerForElement) { // should be used for videos only. for remote content use loadRemoteContent (data-type=url)
|
445
|
+
height = height || width; // default to square
|
446
|
+
$containerForElement.html(`<div class="embed-responsive embed-responsive-16by9"><iframe width="${width}" height="${height}" src="${url}" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>`);
|
447
|
+
this._resize(width, height);
|
448
|
+
this._config.onContentLoaded.call(this);
|
449
|
+
if (this._$modalArrows)
|
450
|
+
this._$modalArrows.css('display', 'none'); //hide the arrows when showing video
|
451
|
+
this._toggleLoading(false);
|
452
|
+
return this;
|
453
|
+
}
|
454
|
+
|
455
|
+
_showHtml5Video(url, $containerForElement) { // should be used for videos only. for remote content use loadRemoteContent (data-type=url)
|
456
|
+
let width = this._$element.data('width') || 560
|
457
|
+
let height = this._$element.data('height') || width / ( 560/315 )
|
458
|
+
$containerForElement.html(`<div class="embed-responsive embed-responsive-16by9"><video width="${width}" height="${height}" src="${url}" preload="auto" autoplay controls class="embed-responsive-item"></video></div>`);
|
459
|
+
this._resize(width, height);
|
460
|
+
this._config.onContentLoaded.call(this);
|
461
|
+
if (this._$modalArrows)
|
462
|
+
this._$modalArrows.css('display', 'none'); //hide the arrows when showing video
|
463
|
+
this._toggleLoading(false);
|
464
|
+
return this;
|
465
|
+
}
|
466
|
+
|
467
|
+
_loadRemoteContent(url, $containerForElement) {
|
468
|
+
let width = this._$element.data('width') || 560;
|
469
|
+
let height = this._$element.data('height') || 560;
|
470
|
+
|
471
|
+
let disableExternalCheck = this._$element.data('disableExternalCheck') || false;
|
472
|
+
this._toggleLoading(false);
|
473
|
+
|
474
|
+
// external urls are loading into an iframe
|
475
|
+
// local ajax can be loaded into the container itself
|
476
|
+
if (!disableExternalCheck && !this._isExternal(url)) {
|
477
|
+
$containerForElement.load(url, $.proxy(() => {
|
478
|
+
return this._$element.trigger('loaded.bs.modal');l
|
479
|
+
}));
|
480
|
+
|
481
|
+
} else {
|
482
|
+
$containerForElement.html(`<iframe src="${url}" frameborder="0" allowfullscreen></iframe>`);
|
483
|
+
this._config.onContentLoaded.call(this);
|
484
|
+
}
|
485
|
+
|
486
|
+
if (this._$modalArrows) //hide the arrows when remote content
|
487
|
+
this._$modalArrows.css('display', 'none')
|
488
|
+
|
489
|
+
this._resize(width, height);
|
490
|
+
return this;
|
491
|
+
}
|
492
|
+
|
493
|
+
_isExternal(url) {
|
494
|
+
let match = url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);
|
495
|
+
if (typeof match[1] === "string" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol)
|
496
|
+
return true;
|
497
|
+
|
498
|
+
if (typeof match[2] === "string" && match[2].length > 0 && match[2].replace(new RegExp(`:(${{
|
499
|
+
"http:": 80,
|
500
|
+
"https:": 443
|
501
|
+
}[location.protocol]})?$`), "") !== location.host)
|
502
|
+
return true;
|
503
|
+
|
504
|
+
return false;
|
505
|
+
}
|
506
|
+
|
507
|
+
_error( message ) {
|
508
|
+
console.error(message);
|
509
|
+
this._containerToUse().html(message);
|
510
|
+
this._resize(300, 300);
|
511
|
+
return this;
|
512
|
+
}
|
513
|
+
|
514
|
+
_preloadImageByIndex(startIndex, numberOfTimes) {
|
515
|
+
|
516
|
+
if(!this._$galleryItems)
|
517
|
+
return;
|
518
|
+
|
519
|
+
let next = $(this._$galleryItems.get(startIndex), false)
|
520
|
+
if(typeof next == 'undefined')
|
521
|
+
return
|
522
|
+
|
523
|
+
let src = next.attr('data-remote') || next.attr('href')
|
524
|
+
if (next.attr('data-type') === 'image' || this._isImage(src))
|
525
|
+
this._preloadImage(src, false)
|
526
|
+
|
527
|
+
if(numberOfTimes > 0)
|
528
|
+
return this._preloadImageByIndex(startIndex + 1, numberOfTimes-1);
|
529
|
+
}
|
530
|
+
|
531
|
+
_preloadImage( src, $containerForImage) {
|
532
|
+
|
533
|
+
$containerForImage = $containerForImage || false
|
534
|
+
|
535
|
+
let img = new Image();
|
536
|
+
if ($containerForImage) {
|
537
|
+
|
538
|
+
// if loading takes > 200ms show a loader
|
539
|
+
let loadingTimeout = setTimeout(() => {
|
540
|
+
$containerForImage.append(this._config.loadingMessage)
|
541
|
+
}, 200)
|
542
|
+
|
543
|
+
img.onload = () => {
|
544
|
+
if(loadingTimeout)
|
545
|
+
clearTimeout(loadingTimeout)
|
546
|
+
loadingTimeout = null;
|
547
|
+
let image = $('<img />');
|
548
|
+
image.attr('src', img.src);
|
549
|
+
image.addClass('img-fluid');
|
550
|
+
|
551
|
+
// backward compatibility for bootstrap v3
|
552
|
+
image.css('width', '100%');
|
553
|
+
|
554
|
+
$containerForImage.html(image);
|
555
|
+
if (this._$modalArrows)
|
556
|
+
this._$modalArrows.css('display', '') // remove display to default to css property
|
557
|
+
|
558
|
+
this._resize(img.width, img.height);
|
559
|
+
this._toggleLoading(false);
|
560
|
+
return this._config.onContentLoaded.call(this);
|
561
|
+
};
|
562
|
+
img.onerror = () => {
|
563
|
+
this._toggleLoading(false);
|
564
|
+
return this._error(this._config.strings.fail+` ${src}`);
|
565
|
+
};
|
566
|
+
}
|
567
|
+
|
568
|
+
img.src = src;
|
569
|
+
return img;
|
570
|
+
}
|
571
|
+
|
572
|
+
_swipeGesure() {
|
573
|
+
if (this._touchendX < this._touchstartX) {
|
574
|
+
return this.navigateRight();
|
575
|
+
}
|
576
|
+
if (this._touchendX > this._touchstartX) {
|
577
|
+
return this.navigateLeft();
|
578
|
+
}
|
579
|
+
}
|
580
|
+
|
581
|
+
_resize( width, height ) {
|
582
|
+
|
583
|
+
height = height || width
|
584
|
+
this._wantedWidth = width
|
585
|
+
this._wantedHeight = height
|
586
|
+
|
587
|
+
let imageAspecRatio = width / height;
|
588
|
+
|
589
|
+
// if width > the available space, scale down the expected width and height
|
590
|
+
let widthBorderAndPadding = this._padding.left + this._padding.right + this._border.left + this._border.right
|
591
|
+
|
592
|
+
// force 10px margin if window size > 575px
|
593
|
+
let addMargin = this._config.doc.body.clientWidth > 575 ? 20 : 0
|
594
|
+
let discountMargin = this._config.doc.body.clientWidth > 575 ? 0 : 20
|
595
|
+
|
596
|
+
let maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth - addMargin, this._config.maxWidth)
|
597
|
+
|
598
|
+
if((width + widthBorderAndPadding) > maxWidth) {
|
599
|
+
height = (maxWidth - widthBorderAndPadding - discountMargin) / imageAspecRatio;
|
600
|
+
width = maxWidth
|
601
|
+
} else
|
602
|
+
width = (width + widthBorderAndPadding)
|
603
|
+
|
604
|
+
let headerHeight = 0,
|
605
|
+
footerHeight = 0
|
606
|
+
|
607
|
+
// as the resize is performed the modal is show, the calculate might fail
|
608
|
+
// if so, default to the default sizes
|
609
|
+
if (this._footerIsShown)
|
610
|
+
footerHeight = this._$modalFooter.outerHeight(true) || 55
|
611
|
+
|
612
|
+
if (this._titleIsShown)
|
613
|
+
headerHeight = this._$modalHeader.outerHeight(true) || 67
|
614
|
+
|
615
|
+
let borderPadding = this._padding.top + this._padding.bottom + this._border.bottom + this._border.top
|
616
|
+
|
617
|
+
//calculated each time as resizing the window can cause them to change due to Bootstraps fluid margins
|
618
|
+
let margins = parseFloat(this._$modalDialog.css('margin-top')) + parseFloat(this._$modalDialog.css('margin-bottom'));
|
619
|
+
|
620
|
+
let maxHeight = Math.min(height, $(window).height() - borderPadding - margins - headerHeight - footerHeight, this._config.maxHeight - borderPadding - headerHeight - footerHeight);
|
621
|
+
|
622
|
+
if(height > maxHeight) {
|
623
|
+
// if height > the available height, scale down the width
|
624
|
+
width = Math.ceil(maxHeight * imageAspecRatio) + widthBorderAndPadding;
|
625
|
+
}
|
626
|
+
|
627
|
+
this._$lightboxContainer.css('height', maxHeight)
|
628
|
+
this._$modalDialog.css('flex', 1).css('maxWidth', width);
|
629
|
+
|
630
|
+
let modal = this._$modal.data('bs.modal');
|
631
|
+
if (modal) {
|
632
|
+
// v4 method is mistakenly protected
|
633
|
+
try {
|
634
|
+
modal._handleUpdate();
|
635
|
+
} catch(Exception) {
|
636
|
+
modal.handleUpdate();
|
637
|
+
}
|
638
|
+
}
|
639
|
+
return this;
|
640
|
+
}
|
641
|
+
|
642
|
+
static _jQueryInterface(config) {
|
643
|
+
config = config || {}
|
644
|
+
return this.each(() => {
|
645
|
+
let $this = $(this)
|
646
|
+
let _config = $.extend(
|
647
|
+
{},
|
648
|
+
Lightbox.Default,
|
649
|
+
$this.data(),
|
650
|
+
typeof config === 'object' && config
|
651
|
+
)
|
652
|
+
|
653
|
+
new Lightbox(this, _config)
|
654
|
+
})
|
655
|
+
}
|
656
|
+
}
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
$.fn[NAME] = Lightbox._jQueryInterface
|
661
|
+
$.fn[NAME].Constructor = Lightbox
|
662
|
+
$.fn[NAME].noConflict = () => {
|
663
|
+
$.fn[NAME] = JQUERY_NO_CONFLICT
|
664
|
+
return Lightbox._jQueryInterface
|
665
|
+
}
|
666
|
+
|
667
|
+
return Lightbox
|
668
|
+
|
669
|
+
})(jQuery)
|
670
|
+
|
671
|
+
export default Lightbox
|