{% extends 'template.html' %}



{% set styles=['yasgui.min'] %}



{% block content %}
<div id='yasgui'></div>
{% endblock %}



{% block scripts %}

{% for script in ['yasgui.min','jsapi'] %}
<script src='{{ url_for("static", filename="js/%s.js" % script) }}'></script>
{% endfor %}

<script type='text/javascript'>

var YASQE    = YASGUI.YASQE,
    defaults = YASQE.defaults;

defaults.value = {{ default_query | tojson }},
defaults.sparql['endpoint'] = 'http://localhost:5000/scry/';
    
{% if endpoint %}
defaults.sparql['endpoint'] = '{{endpoint}}';
{% endif %}

var yasgui = YASGUI(document.getElementById('yasgui')),
    yasqe  = yasgui.current().yasqe,
    yasr   = yasgui.current().yasqe;

{% if query %}
yasqe.setValue({{ query | tojson }});
{% endif %}

yasqe.collapsePrefixes("fold");

</script>

{% endblock %}