Minor bugfixtures

This commit is contained in:
Tony Air 2019-06-26 09:52:06 +07:00
parent 3b2a504225
commit d19033d8dc
2 changed files with 531 additions and 533 deletions

View File

@ -215,21 +215,19 @@
src = ''; src = '';
classTerm = 'meta-lightbox-video'; classTerm = 'meta-lightbox-video';
if (video[1] == 'youtube') { if (video[1] == 'youtube' || video[1] == 'youtu' || video[1] == 'youtube-nocookie') {
src = '//www.youtube.com/embed/' + video[4]; const YouTubeGetID = (url) => {
classTerm = 'meta-lightbox-youtube'; url = url.split(/(vi\/|v%3D|v=|\/v\/|youtu\.be\/|\/embed\/)/);
} return undefined !== url[2] ? url[2].split(/[^0-9a-z_\-]/i)[0] : url[0];
if (video[1] == 'youtu') { };
src = '//www.youtube.com/embed/' + video[3];
classTerm = 'meta-lightbox-youtube'; src = '//www.youtube-nocookie.com/embed/' + YouTubeGetID(href);
} classTerm = classTerm + 'meta-lightbox-youtube';
if (video[1] == 'youtube-nocookie') {
src = '//www.youtube-nocookie.com/embed/' + video[4];
classTerm = 'nivo-lightbox-youtube';
} }
if (video[1] == 'vimeo') { if (video[1] == 'vimeo') {
src = '//player.vimeo.com/video/' + video[3]; src = '//player.vimeo.com/video/' + video[3];
classTerm = 'meta-lightbox-vimeo'; classTerm = classTerm + 'meta-lightbox-vimeo';
} }
if (src) { if (src) {

View File

@ -1,5 +1,5 @@
$link-color: #007bff; $lightbox-link-hover-color: #007bff !default;
$grid-float-breakpoint-max: 576px; $lightbox-breakpoint: 576px !default;
.meta-lightbox-theme-default.meta-lightbox-overlay { .meta-lightbox-theme-default.meta-lightbox-overlay {
background: #666; background: #666;
@ -27,7 +27,7 @@ $grid-float-breakpoint-max: 576px;
} }
&:hover { &:hover {
color: $link-color; color: $lightbox-link-hover-color;
opacity: 1; opacity: 1;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
} }
@ -45,7 +45,7 @@ $grid-float-breakpoint-max: 576px;
height: 1.2em; height: 1.2em;
&:focus { &:focus {
color: $link-color; color: $lightbox-link-hover-color;
opacity: 1; opacity: 1;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
} }
@ -64,7 +64,7 @@ $grid-float-breakpoint-max: 576px;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.4); box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.4);
} }
@media (max-width: $grid-float-breakpoint-max) { @media (max-width: $lightbox-breakpoint) {
.meta-lightbox-wrap { .meta-lightbox-wrap {
top: 5px !important; top: 5px !important;
bottom: 5px; bottom: 5px;