add end to youtube parameters

master
David Kebler 2017-04-22 17:10:49 -07:00
parent 301675b096
commit 2588a27126
4 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,7 @@
{{ $filename := .Get "filename" }} {{ $filename := .Get "filename" }}
{{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }} {{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
<div class="box box--column box--image <div class="box box--column box--image
{{ with .Get "style"}} box--image-{{ . }}{{ end }}
{{ with .Get "link"}}{{ if eq . "lightbox" }} box--image-lightbox{{ end }}{{ end }} {{ with .Get "link"}}{{ if eq . "lightbox" }} box--image-lightbox{{ end }}{{ end }}
" "
{{ with .Get "maxwidth"}} maxWidth="{{ . }}"{{ end }} {{ with .Get "maxwidth"}} maxWidth="{{ . }}"{{ end }}

View File

@ -12,6 +12,7 @@
<div <div
youtube_id="{{ .Get "id" }}" youtube_id="{{ .Get "id" }}"
{{ with .Get "start"}} start="{{ . }}"{{ end }} {{ with .Get "start"}} start="{{ . }}"{{ end }}
{{ with .Get "end"}} end="{{ . }}"{{ end }}
{{ with .Get "plist"}} list="{{ . }}"{{ end }} {{ with .Get "plist"}} list="{{ . }}"{{ end }}
{{ with $.Scratch.Get "maxwidth"}} maxWidth="{{ . }}"{{ end }} {{ with $.Scratch.Get "maxwidth"}} maxWidth="{{ . }}"{{ end }}
{{ with $.Scratch.Get "wpad"}} wPad="{{ . }}"{{ end }} {{ with $.Scratch.Get "wpad"}} wPad="{{ . }}"{{ end }}

View File

@ -287,7 +287,7 @@
justify-content: center; justify-content: center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
-webkit-filter: brightness(.8); filter: brightness(0.8);
} }
.thumb--yt:hover { .thumb--yt:hover {

View File

@ -30,9 +30,10 @@
var mw = $box.attr('maxWidth'); var mw = $box.attr('maxWidth');
var wp = $box.attr('wPad'); var wp = $box.attr('wPad');
var start = $box.attr("start") || 1 var start = $box.attr("start") || 1
if ($box.attr("end")) { var end = "&end=" + $box.attr("end") } else { var end = "" }
var list = "" var list = ""
if ($box.attr("list")) { list = `&list=${$box.attr("list")}` } if ($box.attr("list")) { list = `&list=${$box.attr("list")}` }
var url = `https://www.youtube.com/embed/${id}?${autoplay}start=${start}` var url = `https://www.youtube.com/embed/${id}?${autoplay}start=${start}${end}`
var vIframe = `<iframe width = "560" height = "315" src ="${url}${list}" frameborder = "0" allowfullscreen></iframe>` var vIframe = `<iframe width = "560" height = "315" src ="${url}${list}" frameborder = "0" allowfullscreen></iframe>`
$box.html(vIframe).children().fitToWindow($box.data("maxWidth") || mw, $box.data("wPad") || wp) $box.html(vIframe).children().fitToWindow($box.data("maxWidth") || mw, $box.data("wPad") || wp)
} }