From 57264264851c43386ffd1008bf6d589210586ef2 Mon Sep 17 00:00:00 2001 From: lokal-profil Date: Tue, 30 May 2023 22:51:54 +0200 Subject: [PATCH 1/2] Make api url a variable --- public_html/resources/vue/typeahead-search.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public_html/resources/vue/typeahead-search.html b/public_html/resources/vue/typeahead-search.html index d782204..4ad0500 100644 --- a/public_html/resources/vue/typeahead-search.html +++ b/public_html/resources/vue/typeahead-search.html @@ -112,10 +112,12 @@ me.results = [] ; let language = me.getLanguage() ; + + let wd_api_base = 'https://www.wikidata.org/w/' ; if ( me.fulltext ) { - $.getJSON ( 'https://www.wikidata.org/w/api.php?callback=?' , { + $.getJSON ( wd_api_base + 'api.php?callback=?' , { action:'query', list:'search', srnamespace:(me.type=='property'?120:0), // TODO lexemes'n'stuff @@ -132,7 +134,7 @@ } else { - $.getJSON ( 'https://www.wikidata.org/w/api.php?callback=?' , { + $.getJSON ( wd_api_base + 'api.php?callback=?' , { action:'wbsearchentities', language:language, type:(me.type||'item'), From 785be170e2dbd1ab12a595b7710908a7c84803aa Mon Sep 17 00:00:00 2001 From: lokal-profil Date: Tue, 30 May 2023 22:54:40 +0200 Subject: [PATCH 2/2] Make api url local --- public_html/resources/vue/typeahead-search.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public_html/resources/vue/typeahead-search.html b/public_html/resources/vue/typeahead-search.html index 4ad0500..1fac94f 100644 --- a/public_html/resources/vue/typeahead-search.html +++ b/public_html/resources/vue/typeahead-search.html @@ -113,7 +113,8 @@ let language = me.getLanguage() ; - let wd_api_base = 'https://www.wikidata.org/w/' ; + // let wd_api_base = 'https://www.wikidata.org/w/' ; + let wd_api_base = '/w/' ; if ( me.fulltext ) {