Skip to content

Commit 8aaa3bb

Browse files
author
Gaurav SinghaRoy
committed
refactored csv download
1 parent 6ac0af6 commit 8aaa3bb

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

app/assets/javascripts/resources/sparql.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ SPARQL = {
3838
},
3939
download : {
4040
rdb : function(){
41-
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"/rdb-converter.sql?query="+encodeURIComponent($("#txt_sparql_query").val()))
41+
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"/rdb-converter.sql?query="+encodeURIComponent($("#txt_sparql_query").val()));
42+
},
43+
csv : function(){
44+
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"/csv-converter.csv?query="+encodeURIComponent($("#txt_sparql_query").val()));
4245
}
4346
}
4447

app/views/query/_search_results.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div class="modal-body">
3939
<div class="btn-group ">
4040
<button type="button" class="btn btn-default btn-primary" onclick="SPARQL.download.rdb()"><span class="glyphicon glyphicon-list-alt"></span>&nbsp;RDB Script</button>
41-
<button type="button" class="btn btn-default btn-success" onclick="download_sparql_result_set('csv')"><span class="glyphicon glyphicon-align-justify"></span>&nbsp;CSV</button>
41+
<button type="button" class="btn btn-default btn-success" onclick="SPARQL.download.csv()"><span class="glyphicon glyphicon-align-justify"></span>&nbsp;CSV</button>
4242
<button type="button" class="btn btn-default btn-info"><span class="glyphicon glyphicon-road"></span>&nbsp;JSON</button>
4343
<button type="button" class="btn btn-default btn-warning" onclick="download_sparql_result_set('pdf')"><span class="glyphicon glyphicon-file"></span>&nbsp;PDF</button>
4444
</div>

0 commit comments

Comments
 (0)