Skip to content

Commit

Permalink
Cannot overload, so second function name
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Jun 22, 2024
1 parent bef684d commit 4f593ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions scholia/app/static/scholia.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function addReloadButton(element, callback) {
}
}

function sparqlToResponse(endpointUrl, sparql, doneCallback) {
function sparqlToResponse2(endpointUrl, sparql, doneCallback) {
var settings = {
headers: { Accept: "application/sparql-results+json" },
data: { query: sparql },
Expand All @@ -218,7 +218,7 @@ function sparqlToResponse(endpointUrl, sparql, doneCallback) {


function sparqlToResponse(sparql, doneCallback) {
return sparqlToResponse(
return sparqlToResponse2(
"https://query.wikidata.org/bigdata/namespace/wdq/sparql",
sparql, doneCallback
);
Expand All @@ -242,15 +242,15 @@ function sparqlDataToSimpleData(response) {


function sparqlToDataTablePost(sparql, element, filename, options = {}) {
sparqlToDataTablePost(
sparqlToDataTablePost2(
"https://query.wikidata.org/sparql",
"https://query.wikidata.org/",
sparql, element, filename, options
);
}


function sparqlToDataTablePost(url, editURL, sparql, element, filename, options = {}) {
function sparqlToDataTablePost2(url, editURL, sparql, element, filename, options = {}) {
// Options: paging=
if (!url) url = "https://query.wikidata.org/sparql";
if (!editURL) editURL = "https://query.wikidata.org/";
Expand Down Expand Up @@ -304,15 +304,15 @@ function sparqlToDataTablePost(url, editURL, sparql, element, filename, options


function sparqlToDataTable(sparql, element, filename, options = {}) {
sparqlToDataTablePost(
sparqlToDataTablePost2(
"https://query.wikidata.org/sparql",
"https://query.wikidata.org/",
sparql, element, filename, options
);
}


function sparqlToDataTable(url, editURL, sparql, element, filename, options = {}) {
function sparqlToDataTable2(url, editURL, sparql, element, filename, options = {}) {
// Options: paging=true
if (!url) url = "https://query.wikidata.org/sparql";
if (!editURL) editURL = "https://query.wikidata.org/";
Expand Down Expand Up @@ -443,7 +443,7 @@ function sparqlToDataTable(url, editURL, sparql, element, filename, options = {}


function sparqlToIframe(sparql, element, filename) {
sparqlToIframe(
sparqlToIframe2(
"https://query.wikidata.org/sparql",
"https://query.wikidata.org/",
"https://query.wikidata.org/embed.html#",
Expand All @@ -452,7 +452,7 @@ function sparqlToIframe(sparql, element, filename) {
}


function sparqlToIframe(url, editURL, embedURL, sparql, element, filename) {
function sparqlToIframe2(url, editURL, embedURL, sparql, element, filename) {
let $iframe = $(element);
if (!url) url = "https://query.wikidata.org/sparql";
if (!editURL) editURL = "https://query.wikidata.org/";
Expand Down
6 changes: 3 additions & 3 deletions scholia/app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% macro sparql_to_table_post(panel, options={}) -%}
// {{ panel }} table
sparqlToDataTablePost("{{ sparql_endpoint }}", "{{ sparql_editURL }}",
sparqlToDataTablePost2("{{ sparql_endpoint }}", "{{ sparql_editURL }}",
`# tool: scholia
{% include aspect + '_' + panel + '.sparql' %}
`,
Expand All @@ -12,7 +12,7 @@

{% macro sparql_to_table(panel, options={}) -%}
// {{ panel }} table
sparqlToDataTable("{{ sparql_endpoint }}", "{{ sparql_editURL }}",
sparqlToDataTable2("{{ sparql_endpoint }}", "{{ sparql_editURL }}",
`# tool: scholia
{% include aspect + '_' + panel + '.sparql' %}
`,
Expand All @@ -22,7 +22,7 @@

{% macro sparql_to_iframe(panel) -%}
// {{ panel }} iframe
sparqlToIframe("{{ sparql_endpoint }}", "{{ sparql_editURL }}",
sparqlToIframe2("{{ sparql_endpoint }}", "{{ sparql_editURL }}",
"{{ sparql_embedURL }}", `# tool: scholia
{% include aspect + '_' + panel + '.sparql' %}`,
"#{{ panel }}-iframe", "{{ aspect }}_{{ panel }}.sparql");
Expand Down

0 comments on commit 4f593ae

Please sign in to comment.