<!DOCTYPE html>
<html>
<head>
        <script src='/js/vendor/Readability.js'></script>
        <script src='/js/vendor/handlebars.min.js'></script>
        <script src='/js/vendor/purify.min.js'></script>
        
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' *; img-src *; media-src *; object-src 'none'"/>

        <script id="template" type="text/x-handlebars-template">
                <div class="item" dir="{{direction}}">
                        <header class="content">
                                {{#if item.feedTitle}}
                                        <div class="feedTitle">{{ item.feedTitle }}</div>
                                {{/if}}
                                <h1>
                                        {{#if title}}
                                                <a href="{{item.source}}">{{title}}</a>
                                        {{else}}
                                                <a href="{{item.source}}" class="missingTitle">Link to post</a>
                                        {{/if}}
                                </h1>
                                {{#if slashSection}}
                                        <div class="slash">
                                                <span class="slashSection">Section</span><span class="slashValue">{{ slashSection }}</span>
                                                {{#if slashDepartment}}
                                                <span class="slashDepartment">Department</span><span class="slashValue">{{ slashDepartment }}</span>
                                                {{/if}}
                                        </div>
                                {{/if}}

                                <div class='metaHeader'>
                                        {{#if author }}
                                                <span class='meta'><_span>Author</_span>: {{{author}}}</span>
                                        {{else}}
                                                {{#if creator }}
                                                        <span class='meta'><_span>Creator</_span>: {{{creator}}}</span>
                                                {{/if}}
                                        {{/if}}

                                        {{#if sharedby }}
                                                <span class='meta'><_span>Shared By</_span>: {{{sharedby}}}</span>
                                        {{/if}}
                                        {{#if via }}
                                                <span class='meta'><_span>Via</_span>: <a href="{{via}}">{{via}}</a></span>
                                        {{/if}}
                                        {{#if categories}}
                                                <span class='meta categories'>
                                                        <_span>Filed under:</_span>
                                                        {{#each categories}}
                                                                <span class="category">{{.}}</span>
                                                        {{/each}}
                                                </span>
                                        {{/if}}
                                </div>
                        </header>			

                        <div id="content" class="content">
                                <div id="description">{{{ item.description }}}</div>

                                <!-- embed suitable enclosures -->
                                {{#if audios.length}}
                                        <div id='enclosureAudio'>
                                                <audio class="enclosure" controls="controls" preload="none" src="{{audios.[0].url}}"></audio>
                                                {{#if audios.[1]}}
                                                <select>
                                                        {{#each audios}}
                                                        <option value="{{this.url}}">{{this.url}}</option>
                                                        {{/each}}
                                                </select>
                                                {{/if}}
                                        </div>
                                {{/if}}
                                {{#if videos.length}}
                                        <div id='enclosureVideo'>
                                                <video class="enclosure" controls="controls" preload="none" src="{{videos.[0].url}}"></video>
                                                {{#if videos.[1]}}
                                                <select>
                                                        {{#each videos}}
                                                        <option value="{{this.url}}">{{this.url}}</option>
                                                        {{/each}}
                                                </select>
                                                {{/if}}
                                        </div>
                                {{/if}}
                        </div>
                </div>
        </script>
</head>
<body>
        <noscript>ERROR: Javascript needs to be activated. Please report an issue with Liferea!</noscript>
</body>
<script type="module">
        import { load_item } from '/js/htmlview.js';
        import * as u from '/js/user.js';

        window.load_item = load_item;
        window.onload = (e) => {
                REPLACE_MARKER
        };
</script>
</html>
