<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<!--
Copyright (C) 2016 Sebastian Pipping <sebastian@pipping.org>
Licensed under GNU GPL v3 or later
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>jawanndenn: Vote!</title>

        <meta name="viewport" content="width=device-width, initial-scale=1" />

        <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js" />
        <script src="{{ url_prefix|safe }}/static/3rdparty/noty-2.4.1/js/noty/packaged/jquery.noty.packaged.min.js" />

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css" />
        <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/js/materialize.min.js" />

        <script type="text/javascript" src="{{ url_prefix|safe }}/static/js/html.js?sha1=85e9e5f0be4160539a04f4af533093f1616820f6" />
        <script type="text/javascript" src="{{ url_prefix|safe }}/static/js/poll.js?sha1=5342f6f12026a4027a2cc70eed0e79736323f6a6" />
        <link rel="stylesheet" type="text/css" href="{{ url_prefix|safe }}/static/css/style.css?sha1=a024ed989079086c9e2ba073a8f7787e180eb508" />

        <script type="text/javascript">
            $( document ).ready(function() {
                var pollId = /[0-9a-fA-F]{64}/.exec(window.location.pathname)[0]
                $.get( '{{ url_prefix|safe }}/data/' + pollId, function(data) {
                    var poll = $( '#poll' );
                    poll.html( createPollHtml( data.config, data.votes, Mode.LIVE, '{{ csrf_token }}' ) );
                    $( '#pollForm' ).attr('action', "{{ url_prefix|safe }}/vote/" + pollId);
                    if (data.config.equal_width) {
                        equalizeWidth( poll );
                    }
                }, 'json')
                .fail(function() {
                    var html = 'Error: Poll data could not be loaded.';
                    noty({text: html, type: 'error', timeout: null});
                });
            });
        </script>
    </head>
    <body>
        <div id='live'>
            <div id='poll' />
        </div>
        <footer />
    </body>
</html>
