Skip to content
This repository was archived by the owner on Apr 15, 2021. It is now read-only.
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
8 changes: 4 additions & 4 deletions nivo-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
checkContent: function( link ) {
var $this = this,
href = link.attr('href'),
video = href.match(/(youtube|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
video = href.match(/(youtube|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))\/([\w]+)?([\S]+)/);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This updates the checkContent to make sure it's okay with the additional URL parameters...


if(href.match(/\.(jpeg|jpg|gif|png)$/i) !== null){
return true;
Expand Down Expand Up @@ -151,7 +151,7 @@
processContent: function(content, link){
var $this = this,
href = link.attr('href'),
video = href.match(/(youtube|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))/);
video = href.match(/(youtube|youtu|vimeo)\.(com|be)\/(watch\?v=([\w-]+)|([\w-]+))\/([\w]+)?([\S]+)/);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and this line saves the URL parameters as a part of the video array.


content.html('').addClass('nivo-lightbox-loading');

Expand Down Expand Up @@ -194,11 +194,11 @@
classTerm = 'nivo-lightbox-video';

if(video[1] == 'youtube'){
src = 'http://www.youtube.com/embed/'+ video[4];
src = 'http://www.youtube.com/embed/'+ video[6]+ video[7];
classTerm = 'nivo-lightbox-youtube';
}
if(video[1] == 'youtu'){
src = 'http://www.youtube.com/embed/'+ video[3];
src = 'http://www.youtube.com/embed/'+ video[6]+ video[7];
classTerm = 'nivo-lightbox-youtube';
}
if(video[1] == 'vimeo'){
Expand Down
15 changes: 14 additions & 1 deletion nivo-lightbox.min.js

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