Merge branch 'feature/yasqe' of https://github.com/lawlesst/Vitro into lawlesst-feature/yasqe

This commit is contained in:
Graham Triggs 2015-12-02 15:05:00 +00:00
commit 8b1919e69b
3 changed files with 15 additions and 10 deletions

View file

@ -12,10 +12,12 @@ div.sparqlform label {
input.block { input.block {
display: block; display: block;
} }
textarea, textarea {
div.sparqlform div {
margin-bottom: 1.5em; margin-bottom: 1.5em;
} }
div.sparqlform div.options, div.sparqlform input.submit {
margin-top: 1.5em;
}
form { form {
padding-bottom: 20px; padding-bottom: 20px;
} }

View file

@ -6,13 +6,10 @@
<h2>SPARQL Query</h2> <h2>SPARQL Query</h2>
<form action='${submitUrl}' method="get"> <form action='${submitUrl}' method="get">
<h3>Query:</h3> <h3>Query:</h3>
<div>
<textarea name='query' rows ='30' cols='100' class="span-23 maxWidth">
${sampleQuery}
</textarea>
</div>
<div> <textarea name='query' rows='30' cols='100' class="span-23 maxWidth" id="query-area">${sampleQuery}</textarea>
<div class="options">
<h3>Format for SELECT and ASK query results:</h3> <h3>Format for SELECT and ASK query results:</h3>
<label><input type='radio' name='resultFormat' value='text/plain' checked>RS_TEXT</label> <label><input type='radio' name='resultFormat' value='text/plain' checked>RS_TEXT</label>
<label><input type='radio' name='resultFormat' value='text/csv'>CSV</label> <label><input type='radio' name='resultFormat' value='text/csv'>CSV</label>
@ -21,7 +18,7 @@ ${sampleQuery}
<label><input type='radio' name='resultFormat' value='application/sparql-results+json'>RS_JSON</label> <label><input type='radio' name='resultFormat' value='application/sparql-results+json'>RS_JSON</label>
</div> </div>
<div> <div class="options">
<h3>Format for CONSTRUCT and DESCRIBE query results:</h3> <h3>Format for CONSTRUCT and DESCRIBE query results:</h3>
<label><input type='radio' name='rdfResultFormat' value='text/plain'>N-Triples</label> <label><input type='radio' name='rdfResultFormat' value='text/plain'>N-Triples</label>
<label><input type='radio' name='rdfResultFormat' value='application/rdf+xml' checked>RDF/XML</label> <label><input type='radio' name='rdfResultFormat' value='application/rdf+xml' checked>RDF/XML</label>
@ -33,3 +30,7 @@ ${sampleQuery}
<input class="submit" type="submit" value="Run Query" /> <input class="submit" type="submit" value="Run Query" />
</form> </form>
</div><!-- content --> </div><!-- content -->
${stylesheets.add('<link rel="stylesheet" href="//cdn.jsdelivr.net/yasqe/2.6.1/yasqe.min.css" />')}
${scripts.add('<script type="text/javascript" src="//cdn.jsdelivr.net/yasqe/2.6.1/yasqe.bundled.min.js"></script>',
'<script type="text/javascript" src="${urls.base}/js/sparql/init-yasqe.js"></script>')}

View file

@ -0,0 +1,2 @@
YASQE.defaults.createShareLink = false;
var yasqe = YASQE.fromTextArea(document.getElementById('query-area'));