Skip to content

Commit 6b59867

Browse files
author
Gaurav SinghaRoy
committed
added alertboxes for pdf download
1 parent 8aaa3bb commit 6b59867

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

app/assets/javascripts/query.js.coffee

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@
5454
return
5555
return
5656

57-
@download_sparql_result_set = (type)->
58-
if type is "csv"
59-
window.open("http://localhost:8080/rdf2any/v1.0/convert/csv-converter.csv?query="+encodeURIComponent($("#txt_sparql_query").val()))
60-
else if type is "rdb"
61-
window.open("http://localhost:8080/rdf2any/v1.0/convert/rdb-converter.sql?query="+encodeURIComponent($("#txt_sparql_query").val()))
62-
else if type is "pdf"
63-
$.get get_server_address()+"/query/execute_sparql",
64-
query: $("#txt_sparql_query").val()
65-
pdf: "true"
6657
@show_sparql_download_modal =->
6758
if SPARQL.textbox.is_valid()
6859
$("#sparql_download_modal").modal("show")

app/assets/javascripts/resources/sparql.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ SPARQL = {
4242
},
4343
csv : function(){
4444
window.open(Utils.rdf2any.server+Utils.rdf2any.actions.convert+"/csv-converter.csv?query="+encodeURIComponent($("#txt_sparql_query").val()));
45+
},
46+
pdf : function(){
47+
Utils.alert("The PDF download feature has not been implemented yet.");
48+
},
49+
json : function(){
50+
Utils.alert("The JSON download feature has not been implemented yet.");
4551
}
4652
}
4753

app/views/query/_search_results.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
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>
4141
<button type="button" class="btn btn-default btn-success" onclick="SPARQL.download.csv()"><span class="glyphicon glyphicon-align-justify"></span>&nbsp;CSV</button>
42-
<button type="button" class="btn btn-default btn-info"><span class="glyphicon glyphicon-road"></span>&nbsp;JSON</button>
43-
<button type="button" class="btn btn-default btn-warning" onclick="download_sparql_result_set('pdf')"><span class="glyphicon glyphicon-file"></span>&nbsp;PDF</button>
42+
<button type="button" class="btn btn-default btn-info" onclick="SPARQL.download.json()"><span class="glyphicon glyphicon-road"></span>&nbsp;JSON</button>
43+
<button type="button" class="btn btn-default btn-warning" onclick="SPARQL.download.pdf()"><span class="glyphicon glyphicon-file"></span>&nbsp;PDF</button>
4444
</div>
4545
</div>
4646
<div class="modal-footer">

0 commit comments

Comments
 (0)