Skip to content

Commit 7cdbee6

Browse files
author
Gaurav SinghaRoy
committed
some fix in URI encode
1 parent 0bf70ff commit 7cdbee6

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

app/assets/javascripts/resources/sparql.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ SPARQL = {
9696
}
9797
var download_url = Utils.rdf2any.server+Utils.rdf2any.actions.convert+"json?dataset="+QueryBuilder.datasets.get_selected()+"&query="+encodeURIComponent(query);
9898
window.open(download_url);
99+
},
100+
for_class : function(){
101+
var query = $("#txt_sparql_query").val();
102+
if(QueryBuilder.properties.will_show_properties_in_preview() == true){
103+
$("#btn_show_checked_properties_no").click();
104+
query = $("#txt_sparql_query").val();
105+
$("#btn_show_checked_properties_yes").click();
106+
}
107+
var download_url = Utils.rdf2any.server+Utils.rdf2any.actions.convert+"json?dataset="+QueryBuilder.datasets.get_selected()+"&query="+encodeURIComponent(query)+"&for_class="+QueryBuilder.classes.get_selected_class();
108+
window.open(download_url);
99109
}
100110

101111
},

app/views/query/_search_results.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<div class="btn-group " id="btn_group_download">
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" onclick="SPARQL.download.json.virtuoso()"><span class="glyphicon glyphicon-road"></span>&nbsp;JSON</button>
42+
<button type="button" class="btn btn-default btn-info" onclick="SPARQL.download.json.for_class()"><span class="glyphicon glyphicon-road"></span>&nbsp;JSON</button>
4343
<button type="button" class="btn btn-default btn-warning" onclick="SPARQL.download.pdf()"><span class="glyphicon glyphicon-file"></span>&nbsp;PDF</button>
4444
<%if in_query_builder_action?%>
4545
<button class="btn btn-default btn-danger" onclick="QueryBuilder.convert.configured.initiate_download()"><span class="glyphicon glyphicon-glass"></span>&nbsp;Generic</button>

0 commit comments

Comments
 (0)