Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Travis node.js versions #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion dist/baguetteBox.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* baguetteBox.js
* @author feimosi
* @version 1.11.1
* @version 1.11.1 youtube iframe mod by kesha4
* @url https://github.com/feimosi/baguetteBox.js
*/
#baguetteBox-overlay {
Expand Down Expand Up @@ -40,6 +40,15 @@
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); }
#baguetteBox-overlay .full-image iframe {
display: inline-block;
position: relative;
max-height: 100%;
max-width: 100%;
vertical-align: middle;
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); }
#baguetteBox-overlay .full-image figcaption {
display: block;
position: absolute;
Expand Down
61 changes: 43 additions & 18 deletions dist/baguetteBox.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* baguetteBox.js
* @author feimosi
* @version 1.11.1
* @version 1.11.1 youtube iframe mod by kesha4
* @url https://github.com/feimosi/baguetteBox.js
*/

Expand Down Expand Up @@ -48,7 +48,9 @@
afterShow: null,
afterHide: null,
onChange: null,
overlayBackgroundColor: 'rgba(0,0,0,.8)'
overlayBackgroundColor: 'rgba(0,0,0,.8)',
iframeWidth: 854,
iframeHeight: 480,
};
// Object containing information about features compatibility
var supports = {};
Expand All @@ -65,7 +67,7 @@
// If set to true ignore touch events because animation was already fired
var touchFlag = false;
// Regex pattern to match image files
var regex = /.+\.(gif|jpe?g|png|webp)/i;
var regex = /.+(\.|youtube\.com\/)(gif|jpe?g|png|webp|embed)/i;
// Object of all used galleries
var data = {};
// Array containing temporary images DOM elements
Expand Down Expand Up @@ -517,7 +519,7 @@
}

// If image is already loaded run callback and return
if (imageContainer.getElementsByTagName('img')[0]) {
if (imageContainer.getElementsByTagName('img')[0] || imageContainer.getElementsByTagName('iframe')[0]) {
if (callback) {
callback();
}
Expand Down Expand Up @@ -548,22 +550,45 @@
}
imageContainer.appendChild(figure);

// Prepare gallery img element
var image = create('img');
image.onload = function() {
// Remove loader element
var spinner = document.querySelector('#baguette-img-' + index + ' .baguetteBox-spinner');
figure.removeChild(spinner);
if (!options.async && callback) {
callback();
if (imageSrc.indexOf('/embed') === -1) {
// Prepare gallery img element
var imgOrIframe = create('img');
imgOrIframe.onload = function() {
// Remove loader element
var spinner = document.querySelector('#baguette-img-' + index + ' .baguetteBox-spinner');
figure.removeChild(spinner);
if (!options.async && callback) {
callback();
}
};
imgOrIframe.setAttribute('src', imageSrc);
imgOrIframe.alt = thumbnailElement ? thumbnailElement.alt || '' : '';
if (options.titleTag && imageCaption) {
imgOrIframe.title = imageCaption;
}

} else {
// Prepare gallery iframe element
var imgOrIframe = create('iframe');
imgOrIframe.onload = function() {
// Remove loader element
var spinner = document.querySelector('#baguette-img-' + index + ' .baguetteBox-spinner');
figure.removeChild(spinner);
if (!options.async && callback) {
callback();
}
};
imgOrIframe.setAttribute('src', imageSrc);
imgOrIframe.setAttribute('width', options.iframeWidth);
imgOrIframe.setAttribute('height', options.iframeHeight);
imgOrIframe.setAttribute('frameborder', '0');
imgOrIframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture');
imgOrIframe.setAttribute('allowfullscreen', '');
if (options.titleTag && imageCaption) {
imgOrIframe.title = imageCaption;
}
};
image.setAttribute('src', imageSrc);
image.alt = thumbnailElement ? thumbnailElement.alt || '' : '';
if (options.titleTag && imageCaption) {
image.title = imageCaption;
}
figure.appendChild(image);
figure.appendChild(imgOrIframe);

// Run callback
if (options.async && callback) {
Expand Down
4 changes: 2 additions & 2 deletions dist/baguetteBox.min.css

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

Loading