szurubooru/public_html/templates/post-content.tpl
2014-10-18 18:48:32 +02:00

34 lines
1,007 B
Smarty

<% var postContentUrl = '/data/posts/' + post.name + '?x=' + Math.random() /* reset gif animations */ %>
<div class="post-type-<%= post.contentType %>">
<% if (post.contentType == 'image') { %>
<img alt="<%= post.name %>" src="<%= postContentUrl %>"/>
<% } else if (post.contentType == 'youtube') { %>
<iframe src="//www.youtube.com/embed/<%= post.contentChecksum %>?wmode=opaque" allowfullscreen></iframe>
<% } else if (post.contentType == 'flash') { %>
<object
type="<%= post.contentMimeType %>"
width="<%= post.imageWidth %>"
height="<%= post.imageHeight %>"
data="<%= postContentUrl %>">
<param name="wmode" value="opaque"/>
<param name="movie" value="<%= postContentUrl %>"/>
</object>
<% } else if (post.contentType == 'video') { %>
<video controls>
<source type="<%= post.contentMimeType %>" src="<%= postContentUrl %>"/>
Your browser doesn't support HTML5 videos.
</video>
<% } else { console.log(new Error('Unknown post type')) } %>
</div>