Add height, max{height,width}, width video params

This commit is contained in:
Will Faught
2023-03-03 20:19:33 -08:00
parent d54682b8d3
commit b8259e8e96
7 changed files with 152 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ function paigeResize() {
var es = document.querySelectorAll(".paige-video");
for (var i = 0; i < es.length; i++) {
var e = es[i];
if (e.style.width !== w) {
if (!e.style.height && !e.style.width) {
e.style.width = w + "px";
}
}

View File

@@ -2,11 +2,35 @@
{{ $class := $params.class | default "paige-video ratio ratio-16x9" }}
{{ $fullscreen := $params.fullscreen }}
{{ $height := $params.height }}
{{ $maxheight := $params.maxheight }}
{{ $maxwidth := $params.maxwidth }}
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
{{ $src := $params.src }}
{{ $title := $params.title }}
{{ $width := $params.width }}
<div class="{{ $class }}">
{{ $styles := slice }}
{{ if $height }}
{{ $styles = $styles | append (print "height: " $height) }}
{{ end }}
{{ if $maxheight }}
{{ $styles = $styles | append (print "max-height: " $maxheight) }}
{{ end }}
{{ if $maxwidth }}
{{ $styles = $styles | append (print "max-width: " $maxwidth) }}
{{ end }}
{{ if $width }}
{{ $styles = $styles | append (print "width: " $width) }}
{{ end }}
{{ $styles = delimit $styles "; " }}
<div class="{{ $class }}" {{ with $styles }} style="{{ . | safeCSS }}" {{ end }}>
{{ partial "paige/iframe.html" (dict
"fullscreen" $fullscreen
"referrerpolicy" $referrerpolicy

View File

@@ -10,6 +10,7 @@
{{ $height := .Get "height" }}
{{ $keyboard := .Get "keyboard" | default true }}
{{ $loop := .Get "loop" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $muted := .Get "muted" }}
{{ $pip := .Get "pip" }}
@@ -115,6 +116,8 @@
{{ partial "paige/video.html" (dict
"fullscreen" $fullscreen
"height" $height
"maxheight" $maxheight
"maxwidth" $maxwidth
"referrerpolicy" $referrerpolicy
"src" $src
"title" $description

View File

@@ -6,6 +6,7 @@
{{ $height := .Get "height" }}
{{ $list := .Get "list" }}
{{ $loop := .Get "loop" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $mute := .Get "mute" }}
{{ $referrerpolicy := .Get "referrerpolicy" | default "no-referrer-when-downgrade" }}
@@ -69,6 +70,8 @@
{{ partial "paige/video.html" (dict
"fullscreen" $fullscreen
"height" $height
"maxheight" $maxheight
"maxwidth" $maxwidth
"referrerpolicy" $referrerpolicy
"src" $src
"title" $description