Skip to content

Commit dc9b6fb

Browse files
author
Gaurav SinghaRoy
committed
implemented JSON download
1 parent 6b59867 commit dc9b6fb

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

app/assets/javascripts/resources/sparql.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ SPARQL = {
2424
},
2525
time_taken : function(data){
2626
return data.results.time_taken;
27+
},
28+
print : function(){
29+
Utils.alert("The PRINT feature has not been implemented yet.");
2730
}
2831
},
2932
textbox : {
@@ -38,16 +41,16 @@ SPARQL = {
3841
},
3942
download : {
4043
rdb : function(){
41-
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"/rdb-converter.sql?query="+encodeURIComponent($("#txt_sparql_query").val()));
44+
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"rdb-converter.sql?query="+encodeURIComponent($("#txt_sparql_query").val()));
4245
},
4346
csv : function(){
44-
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"/csv-converter.csv?query="+encodeURIComponent($("#txt_sparql_query").val()));
47+
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"csv-converter.csv?query="+encodeURIComponent($("#txt_sparql_query").val()));
4548
},
4649
pdf : function(){
4750
Utils.alert("The PDF download feature has not been implemented yet.");
4851
},
4952
json : function(){
50-
Utils.alert("The JSON download feature has not been implemented yet.");
53+
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"json?query="+encodeURIComponent($("#txt_sparql_query").val()));
5154
}
5255
}
5356

app/views/query/_search_results.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="col-md-6 ">
1010
<div class="btn-group pull-right">
1111
<button type="button" class="btn btn-danger" onclick="show_sparql_download_modal()"><span class="glyphicon glyphicon-floppy-save"></span>&nbsp;Download</button>
12-
<button type="button" class="btn btn-warning" ><span class="glyphicon glyphicon-print"></span>&nbsp;Print</button>
12+
<button type="button" class="btn btn-warning" onclick="SPARQL.result.print()"><span class="glyphicon glyphicon-print"></span>&nbsp;Print</button>
1313
</div>
1414
</div>
1515
</div>

0 commit comments

Comments
 (0)