{% extends "frog/gallery.html" %}
<script>
    {% block script %}
    var viewer;
    window.addEvent('domready', function() {
        viewer = new Frog.Viewer();
        viewer.addEvent('hide', function() {
            location.href = '/frog/gallery/1';
        });
        var img = JSON.parse('{{object.serialize|safe}}');
        viewer.setImages([img]);
        viewer.fitToWindow();
        viewer.show();
    });
    {% endblock %}
</script>