diff options
author | luxagraf <sng@luxagraf> | 2021-01-30 15:13:31 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf> | 2021-01-30 15:13:31 -0500 |
commit | 6004980567ab9e645c61ef7a127051aa227c3de2 (patch) | |
tree | dd4370a9054d66a902b2ce57c102d17179bf7dd5 /design/templates | |
parent | 3e33f6f56b6b146528d400fb86b5f95274eec422 (diff) |
lttr: changed video insert function to include a link to youtube
Diffstat (limited to 'design/templates')
-rw-r--r-- | design/templates/admin/insert_images.html | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/design/templates/admin/insert_images.html b/design/templates/admin/insert_images.html index 5b5e601..b620380 100644 --- a/design/templates/admin/insert_images.html +++ b/design/templates/admin/insert_images.html @@ -30,7 +30,7 @@ figure { } </style> <script> -function buildVideo(video_mp4, video_webm, id, c, poster) { +function buildVideo(video_mp4, video_webm, id, c, poster, ytlink) { console.log(poster); html = '<div class="self-embed-container">\n\t<video poster="'+poster+'" controls="true" loop="false" preload="auto" id="'+id+'" class="vidauto'; if (c) { @@ -40,7 +40,8 @@ function buildVideo(video_mp4, video_webm, id, c, poster) { } html += '>\n\t\t<source src="'+video_webm+'" type="video/webm">\n'; html += '\t\t<source src="'+video_mp4+'" type="video/mp4">\n'; - html += '\t\tYour browser does not support video playback via HTML5.\n\t</video>\n</div>'; + html += '\t\tYour browser does not support video playback via HTML5.\n\t</video>\n + html += '\t<a href="+'ytlink+'">Watch on YouTube</a>\n</div>'; return html; } function buildImage(image_url, id, c, caption) { @@ -82,7 +83,7 @@ function openInNewTab(url) { <figcaption>{{object.id}} {% if object.caption %}– {{object.caption}}{%endif%}</figcaption> </figure> <ul class="actions">{%if object.get_type == "LuxVideo" %} - <li><a data-is-video="true" data-video-mp4="{{object.video_mp4.url}}" data-video-webm="{{object.video_webm.url}}" data-id="{{object.id}}" data-class="vid" data-poster="{{object.video_poster.url}}" onclick="insertImage(this);return false;" class="insert" href="#">Insert video</a>{%else%}{% get_image_by_size object 'admin_insert' as tn %} + <li><a data-is-video="true" data-video-mp4="{{object.video_mp4.url}}" data-video-webm="{{object.video_webm.url}}" data-id="{{object.id}}" data-class="vid" data-poster="{{object.video_poster.url}}" data-ytlink="{{object.youtube_url}}" onclick="insertImage(this);return false;" class="insert" href="#">Insert video</a>{%else%}{% get_image_by_size object 'admin_insert' as tn %} <li><a data-src="{{tn}}" data-id="{{object.id}}" data-class="picwide" onclick="insertImage(this);return false;" href="#" >full width</a></li> <li><a data-src="{{tn}}" data-id="{{object.id}}" data-class="picwide" data-caption="true" onclick="insertImage(this);return false;" href="#">full width cap</a></li> <li><a data-src="{{tn}}" data-id="{{object.id}}" data-class="cluster pic66" onclick="insertImage(this);return false;" href="#">cluster</a></li> @@ -109,7 +110,7 @@ function openInNewTab(url) { function insertImage(item) { if (item.dataset.isVideo) { console.log(item.dataset.poster); - var code = buildVideo(item.dataset.videoMp4, item.dataset.videoWebm, item.dataset.id, item.dataset.class, item.dataset.poster); + var code = buildVideo(item.dataset.videoMp4, item.dataset.videoWebm, item.dataset.id, item.dataset.class, item.dataset.poster, item.dataset.ytlink); } else if (item.dataset.isAudio) { var code = buildAudio(item.dataset.mp3, item.dataset.ogg); } else { |